|
@@ -1,13 +1,100 @@
|
|
|
package edu.travel.warehouse.web;
|
|
|
|
|
|
+import edu.travel.dto.ShopWarehouseDto;
|
|
|
+import edu.travel.remote.ShopWarehouseRemoteController;
|
|
|
+import edu.travel.rpc.RPCBaseResponse;
|
|
|
+import edu.travel.vo.ShopWarehouseVo;
|
|
|
import edu.travel.warehouse.entity.ShopWarehouse;
|
|
|
+import edu.travel.warehouse.service.ShopWarehouseService;
|
|
|
import edu.travel.web.BaseController;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 库房表
|
|
|
+ */
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/shopWarehouse")
|
|
|
-public class ShopWarehouseController extends BaseController<ShopWarehouse> {
|
|
|
+public class ShopWarehouseController extends BaseController<ShopWarehouse> implements ShopWarehouseRemoteController {
|
|
|
+ /**
|
|
|
+ * 库房表控制层
|
|
|
+ */
|
|
|
+ @Autowired
|
|
|
+ private ShopWarehouseService shopWarehouseService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页查询(连表)
|
|
|
+ */
|
|
|
+ @GetMapping("/getWarehouseCountryPageForm")
|
|
|
+ public RPCBaseResponse<List<ShopWarehouseVo>> getWarehouseCountryPageForm(ShopWarehouseDto dto) {
|
|
|
+ return shopWarehouseService.getWarehouseCountryPageForm(dto);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询库房详情
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @GetMapping("/getWarehouseFormId")
|
|
|
+ public RPCBaseResponse<ShopWarehouseVo> getFormId(String id) {
|
|
|
+ RPCBaseResponse<ShopWarehouse> shopWarehouseRPCBaseResponse = super.getId(id);
|
|
|
+ RPCBaseResponse<ShopWarehouseVo> shopWarehouseVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
|
+ BeanUtils.copyProperties(shopWarehouseRPCBaseResponse, shopWarehouseVoRPCBaseResponse);
|
|
|
+ return shopWarehouseVoRPCBaseResponse;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新库房信息
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @PostMapping("/updateWarehouseFormId")
|
|
|
+ public RPCBaseResponse<ShopWarehouseVo> updateTargetFormId(@RequestBody ShopWarehouseDto entity) {
|
|
|
+ ShopWarehouse shopWarehouse = new ShopWarehouse();
|
|
|
+ BeanUtils.copyProperties(entity, shopWarehouse);
|
|
|
+ RPCBaseResponse<ShopWarehouse> shopWarehouseRPCBaseResponse = super.updateTargetById(shopWarehouse);
|
|
|
+ RPCBaseResponse<ShopWarehouseVo> shopWarehouseVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
|
+ BeanUtils.copyProperties(shopWarehouseRPCBaseResponse, shopWarehouseVoRPCBaseResponse);
|
|
|
+ return shopWarehouseVoRPCBaseResponse;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增库房信息
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @PostMapping("/saveWarehouseForm")
|
|
|
+ public RPCBaseResponse<ShopWarehouseVo> saveFormTarget(@RequestBody ShopWarehouseDto entity) {
|
|
|
+ ShopWarehouse shopWarehouse = new ShopWarehouse();
|
|
|
+ BeanUtils.copyProperties(entity, shopWarehouse);
|
|
|
+ RPCBaseResponse<ShopWarehouse> shopWarehouseRPCBaseResponse = super.saveTarget(shopWarehouse);
|
|
|
+ RPCBaseResponse<ShopWarehouseVo> shopWarehouseVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
|
+ BeanUtils.copyProperties(shopWarehouseRPCBaseResponse, shopWarehouseVoRPCBaseResponse);
|
|
|
+ return shopWarehouseVoRPCBaseResponse;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除库房信息
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @PostMapping("/deleteWarehouseFormId")
|
|
|
+ public RPCBaseResponse<ShopWarehouseVo> deleteTargetFormId(@RequestBody List<String> ids) {
|
|
|
+ RPCBaseResponse<ShopWarehouse> shopWarehouseRPCBaseResponse = super.deleteTargetById(ids);
|
|
|
+ RPCBaseResponse<ShopWarehouseVo> shopWarehouseVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
|
+ BeanUtils.copyProperties(shopWarehouseRPCBaseResponse, shopWarehouseVoRPCBaseResponse);
|
|
|
+ return shopWarehouseVoRPCBaseResponse;
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询所有库房信息
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @GetMapping("/getWarehouseForm")
|
|
|
+ public RPCBaseResponse<List<ShopWarehouseVo>> getAllForm() {
|
|
|
+ RPCBaseResponse<List<ShopWarehouse>> shopWarehouseRPCBaseResponse = super.listAll();
|
|
|
+ RPCBaseResponse<List<ShopWarehouseVo>> shopWarehouseVoRPCBaseResponse = new RPCBaseResponse<>();
|
|
|
+ BeanUtils.copyProperties(shopWarehouseRPCBaseResponse, shopWarehouseVoRPCBaseResponse);
|
|
|
+ return shopWarehouseVoRPCBaseResponse;
|
|
|
+ }
|
|
|
}
|