From 5752973f8cac35ebf44af194aebc0e427774f5c1 Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Fri, 28 Jul 2023 15:19:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B9=BF=E6=96=99=E8=AE=A1=E5=88=92=E7=AE=A1?= =?UTF-8?q?=E7=90=86(=E6=9F=A5=E8=AF=A2=E8=AF=A6=E6=83=85list)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProWetMaterialPlanController.java | 11 + .../mes/domain/ProWetMaterialPlanDetail.java | 266 ++++++++++-------- .../ProWetMaterialPlanDetailMapper.java | 8 + .../impl/ProWetMaterialPlanServiceImpl.java | 29 +- .../resources/mapper/mes/ProRouteMapper.xml | 1 + .../mes/ProWetMaterialPlanDetailMapper.xml | 10 + 6 files changed, 212 insertions(+), 113 deletions(-) diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/ProWetMaterialPlanController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/ProWetMaterialPlanController.java index 1adbe7d5d..926cc48c6 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/controller/ProWetMaterialPlanController.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/ProWetMaterialPlanController.java @@ -29,6 +29,17 @@ public class ProWetMaterialPlanController extends BaseController { @Autowired private IProWetMaterialPlanService proWetMaterialPlanService; + /** + * 通过主计划id查询湿料计划详情list + * + * @param id + * @return + */ + @GetMapping("/getPlanDetail") + public AjaxResult getWetMaterialPlanDetailListById(String id) { + return proWetMaterialPlanService.getWetMaterialPlanDetailListById(id); + } + /** * 提交湿料计划接口 * diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/ProWetMaterialPlanDetail.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/ProWetMaterialPlanDetail.java index 5e6efb160..6232b3b85 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/domain/ProWetMaterialPlanDetail.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/ProWetMaterialPlanDetail.java @@ -89,6 +89,150 @@ public class ProWetMaterialPlanDetail extends BaseEntity { @Excel(name = "计划日期", width = 30, dateFormat = "yyyy-MM-dd") private Date planTime; + // 工单编码 + private String workorderCode; + + + // 工单日期 + @JsonFormat(pattern = "yyyy-MM-dd") + private Date productDate; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getFactoryCode() { + return factoryCode; + } + + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getWetMaterialPlanId() { + return wetMaterialPlanId; + } + + public void setWetMaterialPlanId(String wetMaterialPlanId) { + this.wetMaterialPlanId = wetMaterialPlanId; + } + + public String getWorkorderId() { + return workorderId; + } + + public void setWorkorderId(String workorderId) { + this.workorderId = workorderId; + } + + public String getAtrr1() { + return atrr1; + } + + public void setAtrr1(String atrr1) { + this.atrr1 = atrr1; + } + + public String getAtrr2() { + return atrr2; + } + + public void setAtrr2(String atrr2) { + this.atrr2 = atrr2; + } + + public String getAtrr3() { + return atrr3; + } + + public void setAtrr3(String atrr3) { + this.atrr3 = atrr3; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getBucketId() { + return bucketId; + } + + public void setBucketId(String bucketId) { + this.bucketId = bucketId; + } + + public String getBucketCode() { + return bucketCode; + } + + public void setBucketCode(String bucketCode) { + this.bucketCode = bucketCode; + } + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialId() { + return materialId; + } + + public void setMaterialId(String materialId) { + this.materialId = materialId; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public Long getShiftId() { + return shiftId; + } + + public void setShiftId(Long shiftId) { + this.shiftId = shiftId; + } + + public String getShiftCode() { + return shiftCode; + } + + public void setShiftCode(String shiftCode) { + this.shiftCode = shiftCode; + } + + public String getShiftDesc() { + return shiftDesc; + } + + public void setShiftDesc(String shiftDesc) { + this.shiftDesc = shiftDesc; + } + public Date getPlanTime() { return planTime; } @@ -97,124 +241,20 @@ public class ProWetMaterialPlanDetail extends BaseEntity { this.planTime = planTime; } - public void setId(String id) { - this.id = id; + public String getWorkorderCode() { + return workorderCode; } - public String getId() { - return id; - } - public void setFactoryCode(String factoryCode) { - this.factoryCode = factoryCode; + public void setWorkorderCode(String workorderCode) { + this.workorderCode = workorderCode; } - public String getFactoryCode() { - return factoryCode; - } - public void setWetMaterialPlanId(String wetMaterialPlanId) { - this.wetMaterialPlanId = wetMaterialPlanId; + public Date getProductDate() { + return productDate; } - public String getWetMaterialPlanId() { - return wetMaterialPlanId; - } - public void setWorkorderId(String workorderId) { - this.workorderId = workorderId; - } - - public String getWorkorderId() { - return workorderId; - } - public void setAtrr1(String atrr1) { - this.atrr1 = atrr1; - } - - public String getAtrr1() { - return atrr1; - } - public void setAtrr2(String atrr2) { - this.atrr2 = atrr2; - } - - public String getAtrr2() { - return atrr2; - } - public void setAtrr3(String atrr3) { - this.atrr3 = atrr3; - } - - public String getAtrr3() { - return atrr3; - } - public void setStatus(String status) { - this.status = status; - } - - public String getStatus() { - return status; - } - public void setBucketId(String bucketId) { - this.bucketId = bucketId; - } - - public String getBucketId() { - return bucketId; - } - public void setBucketCode(String bucketCode) { - this.bucketCode = bucketCode; - } - - public String getBucketCode() { - return bucketCode; - } - public void setMaterialCode(String materialCode) { - this.materialCode = materialCode; - } - - public String getMaterialCode() { - return materialCode; - } - public void setMaterialId(String materialId) { - this.materialId = materialId; - } - - public String getMaterialId() { - return materialId; - } - public void setMaterialName(String materialName) { - this.materialName = materialName; - } - - public String getMaterialName() { - return materialName; - } - public void setProductName(String productName) { - this.productName = productName; - } - - public String getProductName() { - return productName; - } - public void setShiftId(Long shiftId) { - this.shiftId = shiftId; - } - - public Long getShiftId() { - return shiftId; - } - public void setShiftCode(String shiftCode) { - this.shiftCode = shiftCode; - } - - public String getShiftCode() { - return shiftCode; - } - public void setShiftDesc(String shiftDesc) { - this.shiftDesc = shiftDesc; - } - - public String getShiftDesc() { - return shiftDesc; + public void setProductDate(Date productDate) { + this.productDate = productDate; } @Override @@ -242,6 +282,8 @@ public class ProWetMaterialPlanDetail extends BaseEntity { .append("shiftCode", getShiftCode()) .append("shiftDesc", getShiftDesc()) .append("planTime",getPlanTime()) + .append("workorderCode",getWorkorderCode()) + .append("productDate",getProductDate()) .toString(); } } \ No newline at end of file diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProWetMaterialPlanDetailMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProWetMaterialPlanDetailMapper.java index d580953e5..3cfb883f7 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProWetMaterialPlanDetailMapper.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProWetMaterialPlanDetailMapper.java @@ -59,4 +59,12 @@ public interface ProWetMaterialPlanDetailMapper { * @return 结果 */ public int deleteProWetMaterialPlanDetailByIds(String[] ids); + + /** + * 通过主计划 id查询史料详情list + * + * @param id + * @return + */ + List selectProWetMaterialPlanDetailListById(String id); } \ No newline at end of file diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/ProWetMaterialPlanServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/ProWetMaterialPlanServiceImpl.java index c6157756f..9b312dff8 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/ProWetMaterialPlanServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/ProWetMaterialPlanServiceImpl.java @@ -199,7 +199,7 @@ public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService // 将湿料计划详情更新至数据库 proWetMaterialPlanDetailMapper.insertProWetMaterialPlanDetail(createProWetMaterialPlanDetail(proOrderWorkorderList.get(i), proWetMaterialPlan.getId())); } - }else { + } else { // 循环创建湿料计划详情 for (int i = 0; i < proOrderWorkorderList.size(); i++) { // 将湿料计划详情更新至数据库 @@ -209,6 +209,23 @@ public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService return success(); } + /** + * 通过主计划id获取湿料计划详情list + * + * @param id + * @return + */ + @Override + @DS("#header.poolName") + public AjaxResult getWetMaterialPlanDetailListById(String id) { + List detailList = proWetMaterialPlanDetailMapper.selectProWetMaterialPlanDetailListById(id); + // 获取班次名称 + for (int i = 0;i < detailList.size();i++){ + detailList.get(i).setShiftDesc(proWetMaterialPlanMapper.selectShiftById(String.valueOf(detailList.get(i).getShiftId()))); + } + return success(detailList); + } + /** * 创建湿料(主)计划 * @@ -253,6 +270,8 @@ public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService ProWetMaterialPlanDetail detail = new ProWetMaterialPlanDetail(); // 设置主键id detail.setId(IdUtils.fastSimpleUUID()); + // 产品名称 + detail.setProductName(workorder.getProductName()); // TODO 计划工厂编码 //detail.setFactoryCode(); // 主计划id @@ -279,6 +298,14 @@ public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService detail.setShiftDesc(workorder.getShiftDesc()); // 湿料计划时间 detail.setPlanTime(workorder.getPlanTime()); + // 创建者 + detail.setCreateBy(SecurityContextHolder.getUserName()); + // 创建时间 + detail.setCreateTime(DateUtils.getNowDate()); + // 更新者 + detail.setUpdateBy(SecurityContextHolder.getUserName()); + // 更新时间 + detail.setUpdateTime(DateUtils.getNowDate()); return detail; } diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/ProRouteMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/ProRouteMapper.xml index c1eff99db..bcffc6367 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/ProRouteMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/ProRouteMapper.xml @@ -67,6 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/ProWetMaterialPlanDetailMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/ProWetMaterialPlanDetailMapper.xml index da5d1b9d5..60294bc9b 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/ProWetMaterialPlanDetailMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/ProWetMaterialPlanDetailMapper.xml @@ -27,6 +27,9 @@ + + + @@ -61,6 +64,13 @@ where id = #{id} + + insert into pro_wet_material_plan_detail