From 29056a32591be0a8d6fb810de5d59a6d34b836cb Mon Sep 17 00:00:00 2001 From: lenovo <123> Date: Wed, 22 Feb 2023 15:01:08 +0800 Subject: [PATCH] =?UTF-8?q?2023-2-22=E4=BA=A7=E5=93=81=E5=B7=A5=E5=BA=8F?= =?UTF-8?q?=E9=9D=A2=E6=96=99=E8=BE=85=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demo/pro/entity/ZyProcessAccessories.java | 2 +- .../demo/pro/entity/ZyProcessFabric.java | 2 +- .../mapper/ZyProductProcessMapper.java | 11 ++++++ .../service/impl/WorkOrderServiceImpl.java | 38 ++++++++++++++++++- 4 files changed, 49 insertions(+), 4 deletions(-) diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessAccessories.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessAccessories.java index 29d80d00..bb26db58 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessAccessories.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessAccessories.java @@ -67,7 +67,7 @@ public class ZyProcessAccessories implements Serializable { private String accessoriesId; @ApiModelProperty(value = "用量") - private String amount; + private Double amount; @TableField(exist = false) private String processCode; @TableField(exist = false) diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessFabric.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessFabric.java index aab90ecf..73dc17f1 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessFabric.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessFabric.java @@ -51,7 +51,7 @@ public class ZyProcessFabric implements Serializable { @ApiModelProperty(value = "创建时间") private Date createTime; @ApiModelProperty(value = "用量") - private String amount; + private Double amount; @TableField(exist = false) private String processCode; @TableField(exist = false) diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/mapper/ZyProductProcessMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/mapper/ZyProductProcessMapper.java index 1deb9c49..b12ea3a8 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/mapper/ZyProductProcessMapper.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/mapper/ZyProductProcessMapper.java @@ -9,6 +9,8 @@ import org.apache.ibatis.annotations.Param; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; +import org.jeecg.modules.demo.pro.entity.ZyProcessAccessories; +import org.jeecg.modules.demo.pro.entity.ZyProcessFabric; import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess; /** @@ -44,4 +46,13 @@ public interface ZyProductProcessMapper extends BaseMapper { //按照number降序排列,通过产品id筛选,然后通过processId和processCode筛选 @Select("") IPage page1(Page page, @Param("productId") String productId, @Param("process") String processId, @Param("code") String processCode); + + @Select("select id from zy_product_process where product_id=#{productId} and process_id=#{processId}") + String findProductProcessId(@Param("productId") String productId, @Param("processId") String processId); + //工序面料的全部信息 + @Select("select * from zy_process_fabric where process_id =#{processId}") + List findFabric(String processId); + //工序辅料的全部信息 + @Select("select * from zy_process_accessories where process_id =#{processId}") + List findAccessories(String processId); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/impl/WorkOrderServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/impl/WorkOrderServiceImpl.java index 6d71b47c..70d9e19c 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/impl/WorkOrderServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/impl/WorkOrderServiceImpl.java @@ -17,6 +17,8 @@ import org.jeecg.modules.demo.ordergoodsfabric.entity.OrderGoodsFabric; import org.jeecg.modules.demo.ordergoodsfabric.mapper.OrderGoodsFabricMapper; import org.jeecg.modules.demo.ordergoodsmodule.entity.OrderGoodsModule; import org.jeecg.modules.demo.ordergoodsmodule.mapper.OrderGoodsModuleMapper; +import org.jeecg.modules.demo.pro.entity.ZyProcessAccessories; +import org.jeecg.modules.demo.pro.entity.ZyProcessFabric; import org.jeecg.modules.demo.pro.entity.ZyProcessMachine; import org.jeecg.modules.demo.pro.mapper.ZyProcessMachineMapper; import org.jeecg.modules.demo.zyStyleModular.entity.ZyStyleModular; @@ -37,6 +39,10 @@ import org.jeecg.modules.product.productModule.entity.ProductModule; import org.jeecg.modules.product.productModule.mapper.ProductModuleMapper; import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess; import org.jeecg.modules.product.zyproductprocess.mapper.ZyProductProcessMapper; +import org.jeecg.modules.productprocessaccessories.entity.ProductProcessAccessories; +import org.jeecg.modules.productprocessaccessories.mapper.ProductProcessAccessoriesMapper; +import org.jeecg.modules.productprocessfabric.entity.ProductProcessFabric; +import org.jeecg.modules.productprocessfabric.mapper.ProductProcessFabricMapper; import org.jeecg.modules.workorder.entity.WorkOrder; import org.jeecg.modules.workorder.entity.WorkOrderVo; import org.jeecg.modules.workorder.mapper.WorkOrderMapper; @@ -143,8 +149,10 @@ public class WorkOrderServiceImpl extends ServiceImpl listFabric= productProcessMapper.findFabric(zpp.getProcessId()); + //辅料 + List listAccessories=productProcessMapper.findAccessories(zpp.getProcessId()); + //然后将产品工序id和辅料面料绑定 + //产品工序面料 + for (ZyProcessFabric zyProcessFabric : listFabric) { + ProductProcessFabric fabric=new ProductProcessFabric(); + fabric.setFabricId(zyProcessFabric.getFabricId()); + fabric.setAmount(zyProcessFabric.getAmount()); + fabric.setProductProcessId(productprocessId); + fabric.setId(null); + productProcessFabricMapper.insert(fabric); + } + //产品工序辅料 + for (ZyProcessAccessories listAccessory : listAccessories) { + ProductProcessAccessories accessories=new ProductProcessAccessories(); + accessories.setAccessoriesId(listAccessory.getAccessoriesId()); + accessories.setAmount(listAccessory.getAmount()); + accessories.setProductProcessId(productprocessId); + accessories.setId(null); + productProcessAccessoriesMapper.insert(accessories); + } //ZyProcess =processMapper.selectById(item.getProcessId()); //region 获取工序工具