diff --git a/ant-design-vue-jeecg/src/views/productplan/ProductplanManage.vue b/ant-design-vue-jeecg/src/views/productplan/ProductplanManage.vue index da687141..25ae73e0 100644 --- a/ant-design-vue-jeecg/src/views/productplan/ProductplanManage.vue +++ b/ant-design-vue-jeecg/src/views/productplan/ProductplanManage.vue @@ -53,7 +53,7 @@ 查看物料单 - 发送到仓库 + 发送到仓库 导出 返回 @@ -205,6 +205,7 @@ export default { syncProductProcess: "/org.jeecg.modules.productplan/zyPlanProcess/syncProductProcess", autoFilling: "/org.jeecg.modules.productplan/zyPlanProcess/autoFilling", createMaterialBill: "/org.jeecg.modules.productplan/zyPlanProcess/createMaterialBill", + sendToRepository: "/org.jeecg.modules.productplan/zyPlanProcess/sendToRepository", stationToolslist: "/stationTool/list2", stationMachinelist: "/stationMachine/list2", addProcessBatch: "/org.jeecg.modules.productplan/zyPlanProcess/addProcessBatch", @@ -364,7 +365,17 @@ export default { //发送到仓库 sendToRepository(){ - + this.loading = true; + getAction(this.url.sendToRepository, {"planId": this.planId}).then((res) => { + if (res.success) { + this.$message.success("操作成功"); + this.loadData(); + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) }, //加载传递参数 @@ -372,7 +383,6 @@ export default { // debugger; if (this.loadRouteType === false) { this.planId = this.$route.query.planId; - // this.biaoTi = this.$route.query.styleNames+"款式面料管理"; console.log("*******传递的planId:" + this.planId) this.loadRouteType = true; } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java index 05f66f4e..2c11750f 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java @@ -146,6 +146,14 @@ public class ZyPlanProcessController extends JeecgController sendToRepository(ZyPlanProcess zyPlanProcess, + HttpServletRequest req) { + zyPlanProcessService.sendToRepository(zyPlanProcess); + return Result.OK(); + } + @ApiOperation(value = "计划班组管理-查询产品工序&班组", notes = "计划班组管理-查询产品工序&班组") @GetMapping(value = "/getTeamDatalist") public Result getTeamDatalist(ZyPlanProcess zyPlanProcess, diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java index aaf98675..4cc0099a 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java @@ -28,4 +28,6 @@ public interface IZyPlanProcessService extends IService { void createMaterialBill(ZyPlanProcess zyPlanProcess); Map getWuLiaoDetail(ZyPlanProcess zyPlanProcess); + + void sendToRepository(ZyPlanProcess zyPlanProcess); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java index 90aa62d7..63b0afe0 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java @@ -11,6 +11,8 @@ import org.jeecg.modules.demo.accessories.entity.ZyAccessories; import org.jeecg.modules.demo.accessories.service.IZyAccessoriesService; import org.jeecg.modules.demo.base.entity.ZyProcess; import org.jeecg.modules.demo.base.service.IZyProcessService; +import org.jeecg.modules.demo.delivery.entity.Delivery; +import org.jeecg.modules.demo.delivery.service.IDeliveryService; import org.jeecg.modules.demo.fabric.entity.ZyFabric; import org.jeecg.modules.demo.fabric.service.IZyFabricService; import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; @@ -146,6 +148,9 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl getProcessDatalist(ZyPlanProcess zyPlanProcess) { //生产计划id String planId = zyPlanProcess.getPlanId(); @@ -508,6 +513,56 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl fabricList = iZyPlanFabricService.list(new LambdaQueryWrapper() + .eq(ZyPlanFabric::getPlanId, zyPlanProcess.getPlanId())); + List deliveryList4Fabric = new LinkedList<>(); + Optional.ofNullable(fabricList).orElse(new LinkedList<>()).forEach(e -> { + Delivery delivery = new Delivery(); + delivery.setDeliveryReason("0"); + delivery.setDeliveryTime(new Date()); + delivery.setItemType("0"); + delivery.setAmount(e.getAmount().doubleValue()); + delivery.setCarrierId("admin"); + delivery.setAdminId("admin"); + delivery.setStorehouseId("TODO"); + ZyFabric zyFabric = iZyFabricService.getById(e.getFabricId()); + if (!ObjectUtils.isEmpty(zyFabric)) { + delivery.setItemCode(zyFabric.getFabricNumber()); + } + deliveryList4Fabric.add(delivery); + }); + iDeliveryService.saveBatch(deliveryList4Fabric); + + List accessoriesList = iZyPlanAccessoriesService.list(new LambdaQueryWrapper() + .eq(ZyPlanAccessories::getPlanId, zyPlanProcess.getPlanId())); + List deliveryList4accessories = new LinkedList<>(); + Optional.ofNullable(accessoriesList).orElse(new LinkedList<>()).forEach(e -> { + Delivery delivery2 = new Delivery(); + delivery2.setDeliveryReason("0"); + delivery2.setDeliveryTime(new Date()); + delivery2.setItemType("1"); + delivery2.setAmount(e.getAmount().doubleValue()); + delivery2.setCarrierId("admin"); + delivery2.setAdminId("admin"); + delivery2.setStorehouseId("TODO"); + ZyAccessories zyAccessories = iZyAccessoriesService.getById(e.getAccessoriesId()); + if (!ObjectUtils.isEmpty(zyAccessories)) { + delivery2.setItemCode(zyAccessories.getNums()); + } + deliveryList4accessories.add(delivery2); + }); + iDeliveryService.saveBatch(deliveryList4accessories); + } + + @Override public Map getWuLiaoDetail(ZyPlanProcess zyPlanProcess) { String planId = zyPlanProcess.getPlanId();