From 3be5a51fefdc1218b96a91d3c037a7a0e237a3b0 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854> Date: Wed, 1 Feb 2023 10:40:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=B7=A5=E5=BA=8F=E7=AE=A1?= =?UTF-8?q?=E7=90=86-=E5=8F=91=E9=80=81=E5=88=B0=E4=BB=93=E5=BA=93=202.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ZyPlanProcessServiceImpl.java | 91 ++++++++++--------- 1 file changed, 46 insertions(+), 45 deletions(-) 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 63b0afe0..bd81fbe7 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 @@ -515,51 +515,52 @@ 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); +// String planId = zyPlanProcess.getPlanId(); +// ZyProductPlan zyProductPlan = iZyProductPlanService.getById(planId); +// if (ObjectUtils.isEmpty(zyProductPlan)) { +// throw new JeecgBootException("生产计划不存在!"); +// } + +// List 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); + iDeliveryService.sendToRepository(zyPlanProcess.getPlanId()); }