From 23a37d3242ed9302ad7130c7424762507408a16e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=88=86=E7=B1=B3=E8=8A=B1?= <417727563@qq.com> Date: Tue, 17 Jan 2023 17:46:30 +0800 Subject: [PATCH] 2023-01-17-04 --- .../demo/pro/entity/ZyProcessMachine.java | 4 +- .../zyorders/service/IZyOrdersService.java | 1 + .../entity/ZyProductProcess.java | 1 + .../controller/WorkOrderController.java | 20 +-- .../workorder/service/IWorkOrderService.java | 4 +- .../service/impl/WorkOrderServiceImpl.java | 129 ++++++++++++++---- 6 files changed, 120 insertions(+), 39 deletions(-) diff --git a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessMachine.java b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessMachine.java index 02bc86ef..ca24dec1 100644 --- a/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessMachine.java +++ b/jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessMachine.java @@ -40,9 +40,9 @@ public class ZyProcessMachine implements Serializable { @ApiModelProperty(value = "工序") private String processId; /**机器*/ - @Excel(name = "机器", width = 15, dictTable = "zy_devicetype", dicText = "name", dicCode = "id") + @Excel(name = "设备", width = 15, dictTable = "zy_devicetype", dicText = "name", dicCode = "id") @Dict(dictTable = "zy_device", dicText = "name", dicCode = "id") - @ApiModelProperty(value = "机器") + @ApiModelProperty(value = "设备") private String machineId; /**创建时间*/ @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/IZyOrdersService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/IZyOrdersService.java index e8dc53e5..1ddb16c5 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/IZyOrdersService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/IZyOrdersService.java @@ -1,5 +1,6 @@ package org.jeecg.modules.demo.zyorders.service; +import org.jeecg.common.api.vo.Result; import org.jeecg.modules.demo.zyorders.entity.ZyOrders; import com.baomidou.mybatisplus.extension.service.IService; diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/entity/ZyProductProcess.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/entity/ZyProductProcess.java index 7b90cfcb..9a3c84a0 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/entity/ZyProductProcess.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/entity/ZyProductProcess.java @@ -63,6 +63,7 @@ public class ZyProductProcess implements Serializable { @ApiModelProperty(value = "工序id") @Dict(dictTable = "zy_process",dicText = "process_name",dicCode = "id") private String processId; + /**序号*/ @Excel(name = "序号", width = 15) @ApiModelProperty(value = "序号") diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/controller/WorkOrderController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/controller/WorkOrderController.java index c9db1de8..607155e0 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/controller/WorkOrderController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/controller/WorkOrderController.java @@ -303,15 +303,11 @@ public class WorkOrderController extends JeecgController { IPage selectPage(Page page, WorkOrderVo workOrder); //派单 - Result paidan(ZyOrders zyOrders,String depId); + Result paidan(ZyOrders zyOrders,String depId); + + Result cancellationWorkOrder(WorkOrder woModel); } 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 ae97e4b7..2553db37 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 @@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.jeecg.common.api.vo.Result; +import org.jeecg.modules.demo.base.entity.ZyProcess; +import org.jeecg.modules.demo.base.mapper.ZyProcessMapper; import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure; import org.jeecg.modules.demo.customermeasure.mapper.CustomerMeasureMapper; import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; @@ -15,16 +17,26 @@ 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.ZyProcessMachine; +import org.jeecg.modules.demo.pro.mapper.ZyProcessMachineMapper; import org.jeecg.modules.demo.zyStyleModular.entity.ZyStyleModular; import org.jeecg.modules.demo.zyStyleModular.mapper.ZyStyleModularMapper; import org.jeecg.modules.demo.zyorders.entity.ZyOrders; +import org.jeecg.modules.demo.zyorders.mapper.ZyOrdersMapper; +import org.jeecg.modules.operationtool.entity.ZyOperationtool; +import org.jeecg.modules.operationtool.mapper.ZyOperationtoolMapper; import org.jeecg.modules.product.pdaccessories.entity.ProductAccessories; import org.jeecg.modules.product.pdaccessories.mapper.ProductAccessoriesMapper; import org.jeecg.modules.product.pdfabric.entity.ProductFabric; import org.jeecg.modules.product.pdfabric.mapper.ProductFabricMapper; +import org.jeecg.modules.product.pdmachine.entity.ProductMachine; +import org.jeecg.modules.product.pdmachine.mapper.ProductMachineMapper; +import org.jeecg.modules.product.pdoperationtool.entity.ProductOperationtool; +import org.jeecg.modules.product.pdoperationtool.mapper.ProductOperationtoolMapper; 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.workorder.entity.WorkOrder; import org.jeecg.modules.workorder.entity.WorkOrderVo; import org.jeecg.modules.workorder.mapper.WorkOrderMapper; @@ -54,6 +66,10 @@ import java.util.List; @Service public class WorkOrderServiceImpl extends ServiceImpl implements IWorkOrderService { + //订单 + @Autowired + private ZyOrdersMapper zyOrdersMapper; + //订单商品 @Autowired private OrderGoodsMapper orderGoodsMapper; @@ -78,10 +94,35 @@ public class WorkOrderServiceImpl extends ServiceImpl paidan(ZyOrders zyOrders,String depId) { //订单ID String orderId=zyOrders.getId(); //商品订单是否存在 @@ -213,34 +254,60 @@ public class WorkOrderServiceImpl extends ServiceImpl styleModularLWrapper=new QueryWrapper(); styleModularLWrapper.eq("type_id",ogModel.getStyleId()); List zyStyleModularList=styleModularMapper.selectList(styleModularLWrapper); - //将工序保存到产品工序中 - - List productProcessList=new ArrayList<>(); + //将工序保存到产品工序中 + //List productProcessList=new ArrayList<>(); for(ZyStyleModular item:zyStyleModularList) { ZyProductProcess zpp=new ZyProductProcess(); - //zpp.setProductId()//产品id - -// /***/ -// @Excel(name = "产品id", width = 15) -// @ApiModelProperty(value = "产品id") -// @Dict(dictTable = "zy_product",dicText = "product_code",dicCode = "id") -// private String productId; -// /**工序id*/ -// @Excel(name = "工序id", width = 15) -// @ApiModelProperty(value = "工序id") -// @Dict(dictTable = "zy_process",dicText = "process_name",dicCode = "id") -// private String processId; -// /**序号*/ -// @Excel(name = "序号", width = 15) -// @ApiModelProperty(value = "序号") -// private Integer number; - productProcessList.add(zpp); + zpp.setProductId(productModel.getId());//产品id + zpp.setProcessId(item.getProcessId());//工序id + zpp.setNumber(item.getSerialnumber());//序号 + productProcessMapper.insert(zpp);//保存 + + //ZyProcess =processMapper.selectById(item.getProcessId()); + + //region 获取工序工具 + QueryWrapper operationtoolWrapper=new QueryWrapper(); + //根据工序ID + operationtoolWrapper.eq("operationid",item.getProcessId()); + List operationtoolList=zyOperationtoolMapper.selectList(operationtoolWrapper); + int sort=1; + for(ZyOperationtool itemTool:operationtoolList) + { + ProductOperationtool poModel=new ProductOperationtool(); + poModel.setProductId(productModel.getId());//产品id + poModel.setOperationtoolId(itemTool.getToolid());//工具id + + poModel.setSort(sort++);//序号 + productOperationtoolMapper.insert(poModel); + + } + //endregion + + //region 获取工序设备 + QueryWrapper processMachineWrapper=new QueryWrapper(); + //根据工序ID + processMachineWrapper.eq("process_id",item.getProcessId()); + List processMachineList=zyProcessMachine.selectList(processMachineWrapper); + //遍历设备 + sort=1; + for(ZyProcessMachine itemMachine:processMachineList) + { + ProductMachine pmModel=new ProductMachine(); + pmModel.setProductId(productModel.getId());//产品id + pmModel.setMachineId(itemMachine.getMachineId());//设备 + pmModel.setSort(sort++);//序号 + productMachineMapper.insert(pmModel); + + } + //endregion + + //productProcessList.add(zpp); } //zyProductProcessService.save() //#endregion @@ -306,6 +373,7 @@ public class WorkOrderServiceImpl extends ServiceImpl cancellationWorkOrder(WorkOrder woModel) { + + //ZyProduct return null; }