From 8160104cf9af10a0f558998649cedaf76cdb9729 Mon Sep 17 00:00:00 2001 From: xins Date: Mon, 11 Mar 2024 10:07:13 +0800 Subject: [PATCH] =?UTF-8?q?1.7.3=20QMS=EF=BC=9APDA=E8=B4=A8=E6=A3=80?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=20MES=EF=BC=9A=E8=BD=A6=E9=97=B4=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hw/mes/controller/MesApiController.java | 57 ++++- .../com/hw/mes/domain/MesBaseAttachInfo.java | 22 ++ .../hw/mes/domain/MesProductPlanDetail.java | 21 ++ .../vo/MesProductPlanDetailAttachVo.java | 25 +++ .../MesProductPlanDetailCompleteAttachVo.java | 25 +++ .../mapper/MesProductPlanDetailMapper.java | 8 + .../service/IMesProductPlanDetailService.java | 7 + .../mes/service/IMesProductPlanService.java | 8 + .../impl/MesProductPlanDetailServiceImpl.java | 27 ++- .../impl/MesProductPlanServiceImpl.java | 44 +++- .../mapper/mes/MesBaseAttachInfoMapper.xml | 3 +- .../mapper/mes/MesProductPlanDetailMapper.xml | 18 +- .../qms/controller/QmsMobileController.java | 58 ++++- .../QmsQualityInstanceController.java | 105 +++++++++ .../hw/qms/domain/QmsCheckInstanceFile.java | 79 +++++++ .../com/hw/qms/domain/QmsQualityInstance.java | 144 ++++++++++++ .../domain/QmsQualityInstanceActivity.java | 212 ++++++++++++++++++ .../qms/domain/vo/QmsCheckResultDetailVo.java | 42 ++++ .../mapper/QmsCheckInstanceFileMapper.java | 61 +++++ .../qms/mapper/QmsQualityInstanceMapper.java | 97 ++++++++ .../service/IQmsCheckInstanceFileService.java | 61 +++++ .../service/IQmsQualityInstanceService.java | 71 ++++++ .../impl/QmsCheckInstanceFileServiceImpl.java | 93 ++++++++ .../impl/QmsQualityInstanceServiceImpl.java | 154 +++++++++++++ .../mapper/qms/QmsCheckInstanceFileMapper.xml | 66 ++++++ .../mapper/qms/QmsQualityInstanceMapper.xml | 157 +++++++++++++ 26 files changed, 1639 insertions(+), 26 deletions(-) create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/domain/vo/MesProductPlanDetailAttachVo.java create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/domain/vo/MesProductPlanDetailCompleteAttachVo.java create mode 100644 hw-modules/hw-qms/src/main/java/com/hw/qms/controller/QmsQualityInstanceController.java create mode 100644 hw-modules/hw-qms/src/main/java/com/hw/qms/domain/QmsCheckInstanceFile.java create mode 100644 hw-modules/hw-qms/src/main/java/com/hw/qms/domain/QmsQualityInstance.java create mode 100644 hw-modules/hw-qms/src/main/java/com/hw/qms/domain/QmsQualityInstanceActivity.java create mode 100644 hw-modules/hw-qms/src/main/java/com/hw/qms/mapper/QmsCheckInstanceFileMapper.java create mode 100644 hw-modules/hw-qms/src/main/java/com/hw/qms/mapper/QmsQualityInstanceMapper.java create mode 100644 hw-modules/hw-qms/src/main/java/com/hw/qms/service/IQmsCheckInstanceFileService.java create mode 100644 hw-modules/hw-qms/src/main/java/com/hw/qms/service/IQmsQualityInstanceService.java create mode 100644 hw-modules/hw-qms/src/main/java/com/hw/qms/service/impl/QmsCheckInstanceFileServiceImpl.java create mode 100644 hw-modules/hw-qms/src/main/java/com/hw/qms/service/impl/QmsQualityInstanceServiceImpl.java create mode 100644 hw-modules/hw-qms/src/main/resources/mapper/qms/QmsCheckInstanceFileMapper.xml create mode 100644 hw-modules/hw-qms/src/main/resources/mapper/qms/QmsQualityInstanceMapper.xml diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java index 8ca8631..5993462 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java @@ -10,11 +10,10 @@ import com.hw.common.security.utils.SecurityUtils; import com.hw.mes.domain.MesMaterialBom; import com.hw.mes.domain.MesProductPlan; import com.hw.mes.domain.MesProductPlanDetail; +import com.hw.mes.domain.vo.MesProductPlanDetailAttachVo; +import com.hw.mes.domain.vo.MesProductPlanDetailCompleteAttachVo; import com.hw.mes.domain.vo.MesProductPlanDetailVo; -import com.hw.mes.service.IMesMaterialBomService; -import com.hw.mes.service.IMesProductOrderService; -import com.hw.mes.service.IMesProductPlanDetailService; -import com.hw.mes.service.IMesProductPlanService; +import com.hw.mes.service.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -24,7 +23,7 @@ import java.util.List; /** * MES对外提供接口Controller * - * @author Yinq + * @author xins * @date 2024-01-30 */ @RestController @@ -99,6 +98,7 @@ public class MesApiController extends BaseController { /** * 完成生产计划明细(适用于各工序) + * 传planDetailId */ @Log(title = "生产计划明细", businessType = BusinessType.COMPLETE) @PostMapping(("/completeProductPlanDetail")) @@ -108,21 +108,35 @@ public class MesApiController extends BaseController { /** - * 获取最新的生产计划明细,在刚登录页面打开时获取根据工位ID获取,如果点击生产计划则根据生产计划ID获取(适用于四楼激光切割、折弯焊接和五楼) + * 获取最新的生产计划明细,在刚登录页面打开时获取根据最新一条派工获取,如果点击生产计划则根据生产计划ID获取(适用于四楼折弯焊接和五楼) */ // @RequiresPermissions("mes:baseAttachInfo:query") @GetMapping(value = "/getNewestProductPlanDetail") public AjaxResult getNewestProductPlanDetail(MesProductPlanDetail queryProductPlanDetail) { - if (queryProductPlanDetail.getPlanId() == null) { - Long stationId = SecurityUtils.getStationId(); - queryProductPlanDetail.setStationId(stationId); - } +// if (queryProductPlanDetail.getPlanId() == null) { +// Long stationId = SecurityUtils.getStationId(); +// queryProductPlanDetail.setStationId(stationId); +// } return success(productPlanDetailService.selectNewestMesProductPlanDetail(queryProductPlanDetail)); } + /** + * 获取最新的生产计划明细Join图纸信息,在刚登录页面打开时获取根据最新一条派工获取,如果点击生产计划则根据生产计划ID获取(适用于四楼激光切割) + */ +// @RequiresPermissions("mes:baseAttachInfo:query") + @GetMapping(value = "/getNewestProductPlanDetailJoinAttach") + public AjaxResult getNewestProductPlanDetailJoinAttach(MesProductPlanDetail queryProductPlanDetail) { +// if (queryProductPlanDetail.getPlanId() == null) { +// Long stationId = SecurityUtils.getStationId(); +// queryProductPlanDetail.setStationId(stationId); +// } + return success(productPlanDetailService.selectNewestMesProductPlanDetailJoinAttach(queryProductPlanDetail)); + } + /** - * 开始下一生产计划明细(适用于四楼激光切割、折弯焊接和五楼),开始时才生成一条计划明细 + * 开始下一生产计划明细(适用于四楼激光切割),开始时生成一条计划明细 + * 传planId */ @Log(title = "生产计划明细", businessType = BusinessType.START) @PostMapping(("/startNextProductPlanDetail")) @@ -130,5 +144,26 @@ public class MesApiController extends BaseController { return success(productPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail)); } + /** + * 开始下一生产计划明细(适用于四楼激光切割),开始时生成一条计划明细 + * 四楼激光切割机传planId和attachId + */ + @Log(title = "生产计划明细", businessType = BusinessType.START) + @PostMapping(("/startNextProductPlanDetailAttach")) + public AjaxResult startNextProductPlanDetailAttach(@RequestBody MesProductPlanDetailAttachVo mesProductPlanDetailAttachVo) { + MesProductPlanDetail mesProductPlanDetail = new MesProductPlanDetail(); + mesProductPlanDetail.setPlanId(mesProductPlanDetailAttachVo.getPlanId()); + mesProductPlanDetail.setAttachId(mesProductPlanDetailAttachVo.getAttachId()); + return success(productPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail)); + } + /** + * 获取生产派工图纸列表(适用于四楼激光切割) + */ +// @RequiresPermissions("mes:baseAttachInfo:query") + @GetMapping("/getProductPlanDrawings") + public AjaxResult getProductPlanDrawings(MesProductPlan queryProductPlan) { + + return success(productPlanService.getDrawings(queryProductPlan)); + } } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseAttachInfo.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseAttachInfo.java index aa8fb65..737f4b9 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseAttachInfo.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseAttachInfo.java @@ -55,6 +55,12 @@ public class MesBaseAttachInfo extends BaseEntity { @Excel(name = "激活标识") private String activeFlag; + /**附件ID,多个以,隔开*/ + private String attachIdStr; + + /** 是否已下发图纸,下发dispatchFlag为true,下发dispatchFlag为true,默认为false*/ + private boolean dispatchFlag = false; + public void setAttachId(Long attachId) { this.attachId = attachId; } @@ -111,6 +117,22 @@ public class MesBaseAttachInfo extends BaseEntity { return activeFlag; } + public String getAttachIdStr() { + return attachIdStr; + } + + public void setAttachIdStr(String attachIdStr) { + this.attachIdStr = attachIdStr; + } + + public boolean isDispatchFlag() { + return dispatchFlag; + } + + public void setDispatchFlag(boolean dispatchFlag) { + this.dispatchFlag = dispatchFlag; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlanDetail.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlanDetail.java index ba55124..ff017d7 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlanDetail.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlanDetail.java @@ -50,6 +50,8 @@ public class MesProductPlanDetail extends BaseEntity @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd") private Date realEndTime; + private Long attachId; + /** 明细状态:1-未开始;2-已开始;3-已完成 */ @Excel(name = "明细状态:1-未开始;2-已开始;3-已完成") private String planDetailStatus; @@ -60,6 +62,8 @@ public class MesProductPlanDetail extends BaseEntity private Long stationId; + private String attachName; + public void setPlanDetailId(Long planDetailId) { this.planDetailId = planDetailId; @@ -132,6 +136,15 @@ public class MesProductPlanDetail extends BaseEntity { return realEndTime; } + + public Long getAttachId() { + return attachId; + } + + public void setAttachId(Long attachId) { + this.attachId = attachId; + } + public void setPlanDetailStatus(String planDetailStatus) { this.planDetailStatus = planDetailStatus; @@ -159,6 +172,14 @@ public class MesProductPlanDetail extends BaseEntity this.stationId = stationId; } + public String getAttachName() { + return attachName; + } + + public void setAttachName(String attachName) { + this.attachName = attachName; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/vo/MesProductPlanDetailAttachVo.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/vo/MesProductPlanDetailAttachVo.java new file mode 100644 index 0000000..259e257 --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/vo/MesProductPlanDetailAttachVo.java @@ -0,0 +1,25 @@ +package com.hw.mes.domain.vo; + +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * @Description: 生产计划明细VO对象4开始使用(with attach图纸) + * @ClassName: MesProductPlanDetailAttachVo + * @Author : xins + * @Date :2024-03-08 15:51 + * @Version :1.0 + */ +@Data +public class MesProductPlanDetailAttachVo { + + //生产计划ID + @NotNull(message = "生产计划ID必须输入") + private Long planId; + + //生产计划ID + @NotNull(message = "图纸ID必须输入") + private Long attachId; + +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/vo/MesProductPlanDetailCompleteAttachVo.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/vo/MesProductPlanDetailCompleteAttachVo.java new file mode 100644 index 0000000..d528a6c --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/vo/MesProductPlanDetailCompleteAttachVo.java @@ -0,0 +1,25 @@ +package com.hw.mes.domain.vo; + +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * @Description: 生产计划明细VO对象4完成使用(with attach图纸) + * @ClassName: MesProductPlanDetailAttachVo + * @Author : xins + * @Date :2024-03-08 15:51 + * @Version :1.0 + */ +@Data +public class MesProductPlanDetailCompleteAttachVo { + + //生产计划明细ID + @NotNull(message = "生产计划明细ID必须输入") + private Long planDetailId; + + //生产计划ID + @NotNull(message = "图纸ID必须输入") + private Long attachId; + +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductPlanDetailMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductPlanDetailMapper.java index 3cb61e7..9907b9a 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductPlanDetailMapper.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesProductPlanDetailMapper.java @@ -68,4 +68,12 @@ public interface MesProductPlanDetailMapper * @return 生产计划明细 */ public MesProductPlanDetail selectNewestMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail); + + /** + * 查询最新一条生产计划明细,Join attach_info + * + * @param mesProductPlanDetail 生产计划明细 + * @return 生产计划明细 + */ + public MesProductPlanDetail selectNewestMesProductPlanDetailJoin(MesProductPlanDetail mesProductPlanDetail); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanDetailService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanDetailService.java index 321b404..db99e21 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanDetailService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanDetailService.java @@ -96,6 +96,13 @@ public interface IMesProductPlanDetailService { */ public MesProductPlanDetail selectNewestMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail); + /** + * 查询最新生产计划明细,Join attach + * + * @param mesProductPlanDetail 生产计划明细 + * @return 生产计划明细 + */ + public MesProductPlanDetail selectNewestMesProductPlanDetailJoinAttach(MesProductPlanDetail mesProductPlanDetail); /** * 开始下一生产计划明细 diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanService.java index 32c21c2..c46bd45 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanService.java @@ -101,4 +101,12 @@ public interface IMesProductPlanService */ public int productOrderRecall(MesProductOrder mesProductOrder); + + /** + * 获取图纸列表 + * @param mesProductPlan + * @return + */ + public List getDrawings(MesProductPlan mesProductPlan); + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java index 180d9ce..eb36946 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java @@ -168,6 +168,8 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer throw new ServiceException("此生产计划已结束"); } + //todo:在开始生产计划时,更新生产工单状态、开始时间 + Date currentDate = new Date(); String userName = SecurityUtils.getUsername(); Long userId = SecurityUtils.getUserId(); @@ -213,11 +215,18 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer throw new ServiceException("此生产计划已结束"); } - //todo:校验生产计划明细校验信息 + //todo:校验生产计划明细校验信息, 更新生产工单状态、结束时间和完成数量(需要获取所有生产计划,顺序工单是否都已完成等) Date currentDate = new Date(); String userName = SecurityUtils.getUsername(); + BigDecimal planAmount = null; + if (mesProductPlanDetail.getAttachId() != null) {//如果是按图纸生产的 + String attachId = dbProductPlan.getAttachId(); + String[] attachIdArr = attachId.split(","); + planAmount = new BigDecimal(attachIdArr.length); + } else { + planAmount = dbProductPlan.getPlanAmount(); + } - BigDecimal planAmount = dbProductPlan.getPlanAmount(); BigDecimal complementAmount = dbProductPlan.getCompleteAmount() == null ? BigDecimal.ZERO : dbProductPlan.getCompleteAmount(); BigDecimal newComplementAmount = complementAmount.add(BigDecimal.ONE); @@ -250,6 +259,18 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer } + /** + * 查询最新生产计划明细,Join attach + * + * @param mesProductPlanDetail 生产计划明细 + * @return 生产计划明细 + */ + @Override + public MesProductPlanDetail selectNewestMesProductPlanDetailJoinAttach(MesProductPlanDetail mesProductPlanDetail) { + return mesProductPlanDetailMapper.selectNewestMesProductPlanDetailJoin(mesProductPlanDetail); + } + + /** * 开始下一生产计划明细 * @@ -261,7 +282,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer public MesProductPlanDetail startNextMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail) { //根据planId获取最新一条的生产计划明细 MesProductPlanDetail newestPlanDetail = mesProductPlanDetailMapper.selectNewestMesProductPlanDetail(mesProductPlanDetail); - + //todo:在开始生产计划时,更新生产工单状态、开始时间; //如果此计划有最新的计划明细 if (newestPlanDetail != null) { String planDetailStatus = newestPlanDetail.getPlanDetailStatus(); diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanServiceImpl.java index a8b8489..4e9f8a7 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanServiceImpl.java @@ -10,6 +10,8 @@ import com.hw.common.core.utils.uuid.Seq; import com.hw.common.security.utils.SecurityUtils; import com.hw.mes.domain.MesBaseAttachInfo; import com.hw.mes.domain.MesProductOrder; +import com.hw.mes.mapper.MesBaseAttachInfoMapper; +import com.hw.mes.mapper.MesProductPlanDetailMapper; import com.hw.mes.service.IMesBaseAttachInfoService; import com.hw.mes.service.IMesProductOrderService; import org.springframework.beans.factory.annotation.Autowired; @@ -41,6 +43,12 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService { @Autowired private IMesBaseAttachInfoService mesBaseAttachInfoService; + @Autowired + private MesBaseAttachInfoMapper mesBaseAttachInfoMapper; + + @Autowired + private MesProductPlanDetailMapper productPlanDetailMapper; + /** * 查询生产派工 * @@ -227,10 +235,42 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService { @Override public List selectMesProductPlanJoinList(MesProductPlan mesProductPlan) { Long stationId = SecurityUtils.getStationId(); - stationId = 1L; - //todo stationId mesProductPlan.setStationId(stationId); return mesProductPlanMapper.selectMesProductPlanJoinList(mesProductPlan); } + + /** + * 获取图纸列表 + * + * @param mesProductPlan + * @return + */ + @Override + public List getDrawings(MesProductPlan mesProductPlan) { + String attachId = mesProductPlan.getAttachId(); + List baseAttachInfos; + if (attachId != null) { + MesBaseAttachInfo queryBaseAttachInfo = new MesBaseAttachInfo(); + queryBaseAttachInfo.setAttachIdStr(attachId); + baseAttachInfos = mesBaseAttachInfoMapper.selectMesBaseAttachInfoList(queryBaseAttachInfo); + MesProductPlanDetail queryProductPlanDetail = new MesProductPlanDetail(); + queryProductPlanDetail.setPlanId(mesProductPlan.getPlanId()); + List productPlanDetails = productPlanDetailMapper.selectMesProductPlanDetailList(queryProductPlanDetail); + if (productPlanDetails != null && !productPlanDetails.isEmpty() && baseAttachInfos != null && !baseAttachInfos.isEmpty()) { + productPlanDetails.forEach(productPlanDetail -> { + for (MesBaseAttachInfo baseAttachInfo : baseAttachInfos) { + if (productPlanDetail.getAttachId() != null && productPlanDetail.getAttachId().equals(baseAttachInfo.getAttachId())) { + baseAttachInfo.setDispatchFlag(true); + } + } + }); + } + + return baseAttachInfos; + } + + return null; + } + } diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseAttachInfoMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseAttachInfoMapper.xml index 9a276db..c5e3d80 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseAttachInfoMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseAttachInfoMapper.xml @@ -45,6 +45,7 @@ and attach_path = #{attachPath} and process_id = #{processId} and active_flag = #{activeFlag} + and attach_id in (${attachIdStr}) @@ -122,4 +123,4 @@ #{attachId} - \ No newline at end of file + diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanDetailMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanDetailMapper.xml index ffd7896..80791ec 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanDetailMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanDetailMapper.xml @@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -21,10 +22,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - select plan_detail_id, plan_detail_code, plan_id, plan_code, user_id, user_name, real_begin_time, real_end_time, plan_detail_status, is_flag, remark, create_by, create_time, update_by, update_time from mes_product_plan_detail + select plan_detail_id, plan_detail_code, plan_id, plan_code, user_id, user_name, real_begin_time, real_end_time,attach_id, plan_detail_status, is_flag, remark, create_by, create_time, update_by, update_time from mes_product_plan_detail + + diff --git a/hw-modules/hw-qms/src/main/java/com/hw/qms/controller/QmsMobileController.java b/hw-modules/hw-qms/src/main/java/com/hw/qms/controller/QmsMobileController.java index ab41330..bf6f5c5 100644 --- a/hw-modules/hw-qms/src/main/java/com/hw/qms/controller/QmsMobileController.java +++ b/hw-modules/hw-qms/src/main/java/com/hw/qms/controller/QmsMobileController.java @@ -11,10 +11,7 @@ import com.hw.common.security.annotation.RequiresPermissions; import com.hw.qms.domain.*; import com.hw.qms.domain.vo.QmsCheckResultDetailVo; import com.hw.qms.domain.vo.QmsMaterialCheckVo; -import com.hw.qms.service.IMesBaseBarcodeInfoService; -import com.hw.qms.service.IQmsCheckResultDetailService; -import com.hw.qms.service.IQmsCheckResultService; -import com.hw.qms.service.IQmsCheckRuleService; +import com.hw.qms.service.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -38,9 +35,13 @@ public class QmsMobileController extends BaseController { private IQmsCheckResultDetailService qmsCheckResultDetailService; @Autowired private IMesBaseBarcodeInfoService mesBaseBarcodeInfoService; + @Autowired + private IQmsQualityInstanceService qmsQualityInstanceService; + @Autowired + private IQmsCheckInstanceFileService qmsCheckInstanceFileService; /** - * 获取质检结果详情 + * 扫描物料条码或者通过质检结果详情列表页面点击获取质检结果详情 */ // @RequiresPermissions("qms:checkrule:list") @GetMapping("/getCheckResultDetail") @@ -89,7 +90,7 @@ public class QmsMobileController extends BaseController { /** - * 获取质检结果 + * 获取批次质检结果列表 */ // @RequiresPermissions("qms:checkrule:list") @GetMapping("/getCheckResults") @@ -100,7 +101,7 @@ public class QmsMobileController extends BaseController { } /** - * 获取批次质检结果信息 + * 获取批次质检结果详情列表信息 */ // @RequiresPermissions("qms:checkrule:list") @GetMapping("/getCheckResult") @@ -126,7 +127,7 @@ public class QmsMobileController extends BaseController { /** - * 新增质检结果详情 + * 更新质检结果状态 */ // @RequiresPermissions("qms:checkresultdetail:add") @Log(title = "质检结果", businessType = BusinessType.AUDIT) @@ -135,4 +136,45 @@ public class QmsMobileController extends BaseController { return toAjax(qmsCheckResultService.auditQmsCheckResult(qmsCheckResult)); } + /** + * 获取批次质检结果详情列表信息4不合格处置 + */ +// @RequiresPermissions("qms:checkrule:list") + @GetMapping("/getCheckResult4Handle") + public AjaxResult getCheckResult4Handle(QmsCheckResult qmsCheckResult) { + QmsCheckResultDetailVo qmsCheckResultDetailVo = qmsCheckResultDetailService.getCheckResultDetailVo(qmsCheckResult.getCheckResultId()); + int batchAmount = mesBaseBarcodeInfoService.selectBarcodeInfoCountByBatchcode(qmsCheckResult.getMaterialBatch()); + qmsCheckResultDetailVo.setBatchAmount(batchAmount); + qmsCheckResultDetailVo.setCheckMode(qmsCheckResult.getCheckMode()); + qmsCheckResultDetailVo.setCheckSample(qmsCheckResult.getCheckSample()); + qmsCheckResultDetailVo.setMaterialCode(qmsCheckResult.getMaterialCode()); + qmsCheckResultDetailVo.setMaterialName(qmsCheckResult.getMaterialName()); + + QmsQualityInstance qmsQualityInstance = qmsQualityInstanceService.selectQmsQualityInstanceByCheckResultId(qmsCheckResult.getCheckResultId()); + if (qmsQualityInstance != null) { + List qmsQualityInstanceActivities = qmsQualityInstance.getQmsQualityInstanceActivityList(); + qmsCheckResultDetailVo.setQmsQualityInstanceActivities(qmsQualityInstanceActivities); + + QmsCheckInstanceFile queryCheckInstanceFile = new QmsCheckInstanceFile(); + queryCheckInstanceFile.setTargetType("1"); + queryCheckInstanceFile.setTargetId(qmsQualityInstance.getQualityInstanceId()); + List qmsCheckInstanceFiles = qmsCheckInstanceFileService.selectQmsCheckInstanceFileList(queryCheckInstanceFile); + + qmsCheckResultDetailVo.setQmsCheckInstanceFiles(qmsCheckInstanceFiles); + } + + return success(qmsCheckResultDetailVo); + } + + + /** + * 不合格处置保存 + */ +// @RequiresPermissions("qms:checkresultdetail:add") + @Log(title = "质检工单实例", businessType = BusinessType.INSERT) + @PostMapping("/handleQualityInstance") + public AjaxResult handleQualityInstance(@RequestBody QmsQualityInstance qmsQualityInstance) { + System.out.println(qmsQualityInstance.getCheckResultId()); + return success(1); + } } diff --git a/hw-modules/hw-qms/src/main/java/com/hw/qms/controller/QmsQualityInstanceController.java b/hw-modules/hw-qms/src/main/java/com/hw/qms/controller/QmsQualityInstanceController.java new file mode 100644 index 0000000..2456980 --- /dev/null +++ b/hw-modules/hw-qms/src/main/java/com/hw/qms/controller/QmsQualityInstanceController.java @@ -0,0 +1,105 @@ +package com.hw.qms.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.hw.common.log.annotation.Log; +import com.hw.common.log.enums.BusinessType; +import com.hw.common.security.annotation.RequiresPermissions; +import com.hw.qms.domain.QmsQualityInstance; +import com.hw.qms.service.IQmsQualityInstanceService; +import com.hw.common.core.web.controller.BaseController; +import com.hw.common.core.web.domain.AjaxResult; +import com.hw.common.core.utils.poi.ExcelUtil; +import com.hw.common.core.web.page.TableDataInfo; + +/** + * 质检工单Controller + * + * @author xins + * @date 2024-01-23 + */ +@RestController +@RequestMapping("/qualityinstance") +public class QmsQualityInstanceController extends BaseController +{ + @Autowired + private IQmsQualityInstanceService qmsQualityInstanceService; + + /** + * 查询质检工单列表 + */ + @RequiresPermissions("qms:ualityinstance:list") + @GetMapping("/list") + public TableDataInfo list(QmsQualityInstance qmsQualityInstance) + { + startPage(); + List list = qmsQualityInstanceService.selectQmsQualityInstanceList(qmsQualityInstance); + return getDataTable(list); + } + + /** + * 导出质检工单列表 + */ + @RequiresPermissions("qms:ualityinstance:export") + @Log(title = "质检工单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, QmsQualityInstance qmsQualityInstance) + { + List list = qmsQualityInstanceService.selectQmsQualityInstanceList(qmsQualityInstance); + ExcelUtil util = new ExcelUtil(QmsQualityInstance.class); + util.exportExcel(response, list, "质检工单数据"); + } + + /** + * 获取质检工单详细信息 + */ + @RequiresPermissions("qms:ualityinstance:query") + @GetMapping(value = "/{qualityInstanceId}") + public AjaxResult getInfo(@PathVariable("qualityInstanceId") Long qualityInstanceId) + { + return success(qmsQualityInstanceService.selectQmsQualityInstanceByQualityInstanceId(qualityInstanceId)); + } + + /** + * 新增质检工单 + */ + @RequiresPermissions("qms:ualityinstance:add") + @Log(title = "质检工单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody QmsQualityInstance qmsQualityInstance) + { + return toAjax(qmsQualityInstanceService.insertQmsQualityInstance(qmsQualityInstance)); + } + + /** + * 修改质检工单 + */ + @RequiresPermissions("qms:ualityinstance:edit") + @Log(title = "质检工单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody QmsQualityInstance qmsQualityInstance) + { + return toAjax(qmsQualityInstanceService.updateQmsQualityInstance(qmsQualityInstance)); + } + + /** + * 删除质检工单 + */ + @RequiresPermissions("qms:ualityinstance:remove") + @Log(title = "质检工单", businessType = BusinessType.DELETE) + @DeleteMapping("/{qualityInstanceIds}") + public AjaxResult remove(@PathVariable Long[] qualityInstanceIds) + { + return toAjax(qmsQualityInstanceService.deleteQmsQualityInstanceByQualityInstanceIds(qualityInstanceIds)); + } +} diff --git a/hw-modules/hw-qms/src/main/java/com/hw/qms/domain/QmsCheckInstanceFile.java b/hw-modules/hw-qms/src/main/java/com/hw/qms/domain/QmsCheckInstanceFile.java new file mode 100644 index 0000000..792d649 --- /dev/null +++ b/hw-modules/hw-qms/src/main/java/com/hw/qms/domain/QmsCheckInstanceFile.java @@ -0,0 +1,79 @@ +package com.hw.qms.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; + +/** + * 质检文件对象 qms_check_instance_file + * + * @author xins + * @date 2024-01-23 + */ +public class QmsCheckInstanceFile extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键标识 */ + private Long checkInstanceFileId; + + /** 关联类型(1质检工单实例) */ + @Excel(name = "关联类型(1质检工单实例)") + private String targetType; + + /** 关联类型为1时关联质检工单实例ID */ + @Excel(name = "关联类型为1时关联质检工单实例ID") + private Long targetId; + + /** 故障文件地址,一般是图片 */ + @Excel(name = "故障文件地址,一般是图片") + private String faultFile; + + public void setCheckInstanceFileId(Long checkInstanceFileId) + { + this.checkInstanceFileId = checkInstanceFileId; + } + + public Long getCheckInstanceFileId() + { + return checkInstanceFileId; + } + public void setTargetType(String targetType) + { + this.targetType = targetType; + } + + public String getTargetType() + { + return targetType; + } + public void setTargetId(Long targetId) + { + this.targetId = targetId; + } + + public Long getTargetId() + { + return targetId; + } + public void setFaultFile(String faultFile) + { + this.faultFile = faultFile; + } + + public String getFaultFile() + { + return faultFile; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("checkInstanceFileId", getCheckInstanceFileId()) + .append("targetType", getTargetType()) + .append("targetId", getTargetId()) + .append("faultFile", getFaultFile()) + .toString(); + } +} diff --git a/hw-modules/hw-qms/src/main/java/com/hw/qms/domain/QmsQualityInstance.java b/hw-modules/hw-qms/src/main/java/com/hw/qms/domain/QmsQualityInstance.java new file mode 100644 index 0000000..1c3b11f --- /dev/null +++ b/hw-modules/hw-qms/src/main/java/com/hw/qms/domain/QmsQualityInstance.java @@ -0,0 +1,144 @@ +package com.hw.qms.domain; + +import java.util.List; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; + +/** + * 质检工单对象 qms_quality_instance + * + * @author xins + * @date 2024-01-23 + */ +public class QmsQualityInstance extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 质检工单实例ID */ + private Long qualityInstanceId; + + /** 工单流程ID,关联wf_process的wf_process_id;固定流程ID */ + @Excel(name = "工单流程ID,关联wf_process的wf_process_id;固定流程ID") + private Long wfProcessId; + + /** 状态(0:未启动,1:启动,2:执行中,3:结束,4:已撤回,9:已删除) */ + @Excel(name = "状态", readConverterExp = "0=:未启动,1:启动,2:执行中,3:结束,4:已撤回,9:已删除") + private String wfInstanceStatus; + + /** 质检结果ID,关联qms_check_result主键 */ + @Excel(name = "质检结果ID,关联qms_check_result主键") + private Long checkResultId; + + /** 质检描述 */ + @Excel(name = "质检描述") + private String qualityDescription; + + /** 处理开始时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "处理开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date startTime; + + /** 处理结束时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "处理结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date endTime; + + /** 质检工单实例节点信息 */ + private List qmsQualityInstanceActivityList; + + public void setQualityInstanceId(Long qualityInstanceId) + { + this.qualityInstanceId = qualityInstanceId; + } + + public Long getQualityInstanceId() + { + return qualityInstanceId; + } + public void setWfProcessId(Long wfProcessId) + { + this.wfProcessId = wfProcessId; + } + + public Long getWfProcessId() + { + return wfProcessId; + } + public void setWfInstanceStatus(String wfInstanceStatus) + { + this.wfInstanceStatus = wfInstanceStatus; + } + + public String getWfInstanceStatus() + { + return wfInstanceStatus; + } + public void setCheckResultId(Long checkResultId) + { + this.checkResultId = checkResultId; + } + + public Long getCheckResultId() + { + return checkResultId; + } + public void setQualityDescription(String qualityDescription) + { + this.qualityDescription = qualityDescription; + } + + public String getQualityDescription() + { + return qualityDescription; + } + public void setStartTime(Date startTime) + { + this.startTime = startTime; + } + + public Date getStartTime() + { + return startTime; + } + public void setEndTime(Date endTime) + { + this.endTime = endTime; + } + + public Date getEndTime() + { + return endTime; + } + + public List getQmsQualityInstanceActivityList() + { + return qmsQualityInstanceActivityList; + } + + public void setQmsQualityInstanceActivityList(List qmsQualityInstanceActivityList) + { + this.qmsQualityInstanceActivityList = qmsQualityInstanceActivityList; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("qualityInstanceId", getQualityInstanceId()) + .append("wfProcessId", getWfProcessId()) + .append("wfInstanceStatus", getWfInstanceStatus()) + .append("checkResultId", getCheckResultId()) + .append("qualityDescription", getQualityDescription()) + .append("startTime", getStartTime()) + .append("endTime", getEndTime()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("qmsQualityInstanceActivityList", getQmsQualityInstanceActivityList()) + .toString(); + } +} diff --git a/hw-modules/hw-qms/src/main/java/com/hw/qms/domain/QmsQualityInstanceActivity.java b/hw-modules/hw-qms/src/main/java/com/hw/qms/domain/QmsQualityInstanceActivity.java new file mode 100644 index 0000000..6c87bae --- /dev/null +++ b/hw-modules/hw-qms/src/main/java/com/hw/qms/domain/QmsQualityInstanceActivity.java @@ -0,0 +1,212 @@ +package com.hw.qms.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; + +/** + * 质检工单实例节点对象 qms_quality_instance_activity + * + * @author xins + * @date 2024-01-23 + */ +public class QmsQualityInstanceActivity extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 质检工单实例节点ID */ + private Long instanceActivityId; + + /** 质检工单实例ID,关联qms_quality_instance的quality_instance_id */ + @Excel(name = "质检工单实例ID,关联qms_quality_instance的quality_instance_id") + private Long qualityInstanceId; + + /** 工单流程节点ID(关联wf_process_activity的process_activity_id) */ + @Excel(name = "工单流程节点ID", readConverterExp = "关=联wf_process_activity的process_activity_id") + private Long processActivityId; + + /** 处理意见 */ + @Excel(name = "处理意见") + private String processHandleResolution; + + /** 工单处理描述(预留) */ + @Excel(name = "工单处理描述", readConverterExp = "预=留") + private String processHandleDesc; + + /** 状态(0已结束,1执行中,2、待接取,3、已转发) */ + @Excel(name = "状态(0已结束,1执行中,2、待接取,3、已转发)") + private String processHandleStatus; + + /** 工单流程步骤顺序 */ + @Excel(name = "工单流程步骤顺序") + private Long processStepOrder; + + /** 执行开始时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "执行开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date startTime; + + /** 执行结束时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "执行结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date endTime; + + /** 处理人ID(关联sys_user的user_id) */ + @Excel(name = "处理人ID", readConverterExp = "处理人ID(关联sys_user的user_id)") + private Long handleUserId; + + /** 处理人 */ + @Excel(name = "处理人") + private String handleBy; + + /** 处理时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "处理时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date handleTime; + + /** 转单人用户id或转发协助用户id;1、在转发时,生成新的工单节点实例,执行人id为转发的用户,而转单人是刚才转发给此用户的用户id,是否协助工单为0,并且转发后当前工单的状态为已结束此用户的用户id,是否协助工单为0,并且转发后当前工单的状态为已结束此用户的用户id,是否协助工单为0,并且转发后当前工单的状态为已结束此用户的用户id,是否协助工单为0,并且转发后当前工单的状态为已结束2、在添加协助时,生成新的工单节点实例,执行人id为添加协助的用户,而转单人是刚才添加协助此用户的用户id,是否协助工单为1,并且转发后当前工单的状态仍为执行中 */ + @Excel(name = "转单人用户id或转发协助用户id;1、在转发时,生成新的工单节点实例,执行人id为转发的用户,而转单人是刚才转发给此用户的用户id,是否协助工单为0,并且转发后当前工单的状态为已结束此用户的用户id,是否协助工单为0,并且转发后当前工单的状态为已结束此用户的用户id,是否协助工单为0,并且转发后当前工单的状态为已结束此用户的用户id,是否协助工单为0,并且转发后当前工单的状态为已结束2、在添加协助时,生成新的工单节点实例,执行人id为添加协助的用户,而转单人是刚才添加协助此用户的用户id,是否协助工单为1,并且转发后当前工单的状态仍为执行中") + private Long transferUserId; + + public void setInstanceActivityId(Long instanceActivityId) + { + this.instanceActivityId = instanceActivityId; + } + + public Long getInstanceActivityId() + { + return instanceActivityId; + } + public void setQualityInstanceId(Long qualityInstanceId) + { + this.qualityInstanceId = qualityInstanceId; + } + + public Long getQualityInstanceId() + { + return qualityInstanceId; + } + public void setProcessActivityId(Long processActivityId) + { + this.processActivityId = processActivityId; + } + + public Long getProcessActivityId() + { + return processActivityId; + } + public void setProcessHandleResolution(String processHandleResolution) + { + this.processHandleResolution = processHandleResolution; + } + + public String getProcessHandleResolution() + { + return processHandleResolution; + } + public void setProcessHandleDesc(String processHandleDesc) + { + this.processHandleDesc = processHandleDesc; + } + + public String getProcessHandleDesc() + { + return processHandleDesc; + } + public void setProcessHandleStatus(String processHandleStatus) + { + this.processHandleStatus = processHandleStatus; + } + + public String getProcessHandleStatus() + { + return processHandleStatus; + } + public void setProcessStepOrder(Long processStepOrder) + { + this.processStepOrder = processStepOrder; + } + + public Long getProcessStepOrder() + { + return processStepOrder; + } + public void setStartTime(Date startTime) + { + this.startTime = startTime; + } + + public Date getStartTime() + { + return startTime; + } + public void setEndTime(Date endTime) + { + this.endTime = endTime; + } + + public Date getEndTime() + { + return endTime; + } + public void setHandleUserId(Long handleUserId) + { + this.handleUserId = handleUserId; + } + + public Long getHandleUserId() + { + return handleUserId; + } + public void setHandleBy(String handleBy) + { + this.handleBy = handleBy; + } + + public String getHandleBy() + { + return handleBy; + } + public void setHandleTime(Date handleTime) + { + this.handleTime = handleTime; + } + + public Date getHandleTime() + { + return handleTime; + } + public void setTransferUserId(Long transferUserId) + { + this.transferUserId = transferUserId; + } + + public Long getTransferUserId() + { + return transferUserId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("instanceActivityId", getInstanceActivityId()) + .append("qualityInstanceId", getQualityInstanceId()) + .append("processActivityId", getProcessActivityId()) + .append("processHandleResolution", getProcessHandleResolution()) + .append("processHandleDesc", getProcessHandleDesc()) + .append("processHandleStatus", getProcessHandleStatus()) + .append("processStepOrder", getProcessStepOrder()) + .append("startTime", getStartTime()) + .append("endTime", getEndTime()) + .append("handleUserId", getHandleUserId()) + .append("handleBy", getHandleBy()) + .append("handleTime", getHandleTime()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("transferUserId", getTransferUserId()) + .toString(); + } +} diff --git a/hw-modules/hw-qms/src/main/java/com/hw/qms/domain/vo/QmsCheckResultDetailVo.java b/hw-modules/hw-qms/src/main/java/com/hw/qms/domain/vo/QmsCheckResultDetailVo.java index 2f91721..efd0fa7 100644 --- a/hw-modules/hw-qms/src/main/java/com/hw/qms/domain/vo/QmsCheckResultDetailVo.java +++ b/hw-modules/hw-qms/src/main/java/com/hw/qms/domain/vo/QmsCheckResultDetailVo.java @@ -2,7 +2,9 @@ package com.hw.qms.domain.vo; import com.hw.common.core.annotation.Excel; import com.hw.common.core.web.domain.BaseEntity; +import com.hw.qms.domain.QmsCheckInstanceFile; import com.hw.qms.domain.QmsCheckResultDetailProject; +import com.hw.qms.domain.QmsQualityInstanceActivity; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -31,6 +33,14 @@ public class QmsCheckResultDetailVo private BigDecimal checkSample; + private String materialCode; + + private String materialName; + + List qmsQualityInstanceActivities; + + List qmsCheckInstanceFiles; + public int getBatchAmount() { return batchAmount; } @@ -70,4 +80,36 @@ public class QmsCheckResultDetailVo public void setCheckSample(BigDecimal checkSample) { this.checkSample = checkSample; } + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public List getQmsQualityInstanceActivities() { + return qmsQualityInstanceActivities; + } + + public void setQmsQualityInstanceActivities(List qmsQualityInstanceActivities) { + this.qmsQualityInstanceActivities = qmsQualityInstanceActivities; + } + + public List getQmsCheckInstanceFiles() { + return qmsCheckInstanceFiles; + } + + public void setQmsCheckInstanceFiles(List qmsCheckInstanceFiles) { + this.qmsCheckInstanceFiles = qmsCheckInstanceFiles; + } } diff --git a/hw-modules/hw-qms/src/main/java/com/hw/qms/mapper/QmsCheckInstanceFileMapper.java b/hw-modules/hw-qms/src/main/java/com/hw/qms/mapper/QmsCheckInstanceFileMapper.java new file mode 100644 index 0000000..9774e58 --- /dev/null +++ b/hw-modules/hw-qms/src/main/java/com/hw/qms/mapper/QmsCheckInstanceFileMapper.java @@ -0,0 +1,61 @@ +package com.hw.qms.mapper; + +import java.util.List; +import com.hw.qms.domain.QmsCheckInstanceFile; + +/** + * 质检文件Mapper接口 + * + * @author xins + * @date 2024-01-23 + */ +public interface QmsCheckInstanceFileMapper +{ + /** + * 查询质检文件 + * + * @param checkInstanceFileId 质检文件主键 + * @return 质检文件 + */ + public QmsCheckInstanceFile selectQmsCheckInstanceFileByCheckInstanceFileId(Long checkInstanceFileId); + + /** + * 查询质检文件列表 + * + * @param qmsCheckInstanceFile 质检文件 + * @return 质检文件集合 + */ + public List selectQmsCheckInstanceFileList(QmsCheckInstanceFile qmsCheckInstanceFile); + + /** + * 新增质检文件 + * + * @param qmsCheckInstanceFile 质检文件 + * @return 结果 + */ + public int insertQmsCheckInstanceFile(QmsCheckInstanceFile qmsCheckInstanceFile); + + /** + * 修改质检文件 + * + * @param qmsCheckInstanceFile 质检文件 + * @return 结果 + */ + public int updateQmsCheckInstanceFile(QmsCheckInstanceFile qmsCheckInstanceFile); + + /** + * 删除质检文件 + * + * @param checkInstanceFileId 质检文件主键 + * @return 结果 + */ + public int deleteQmsCheckInstanceFileByCheckInstanceFileId(Long checkInstanceFileId); + + /** + * 批量删除质检文件 + * + * @param checkInstanceFileIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQmsCheckInstanceFileByCheckInstanceFileIds(Long[] checkInstanceFileIds); +} diff --git a/hw-modules/hw-qms/src/main/java/com/hw/qms/mapper/QmsQualityInstanceMapper.java b/hw-modules/hw-qms/src/main/java/com/hw/qms/mapper/QmsQualityInstanceMapper.java new file mode 100644 index 0000000..55f2387 --- /dev/null +++ b/hw-modules/hw-qms/src/main/java/com/hw/qms/mapper/QmsQualityInstanceMapper.java @@ -0,0 +1,97 @@ +package com.hw.qms.mapper; + +import java.util.List; +import com.hw.qms.domain.QmsQualityInstance; +import com.hw.qms.domain.QmsQualityInstanceActivity; + +/** + * 质检工单Mapper接口 + * + * @author xins + * @date 2024-01-23 + */ +public interface QmsQualityInstanceMapper +{ + /** + * 查询质检工单 + * + * @param qualityInstanceId 质检工单主键 + * @return 质检工单 + */ + public QmsQualityInstance selectQmsQualityInstanceByQualityInstanceId(Long qualityInstanceId); + + /** + * 查询质检工单列表 + * + * @param qmsQualityInstance 质检工单 + * @return 质检工单集合 + */ + public List selectQmsQualityInstanceList(QmsQualityInstance qmsQualityInstance); + + /** + * 新增质检工单 + * + * @param qmsQualityInstance 质检工单 + * @return 结果 + */ + public int insertQmsQualityInstance(QmsQualityInstance qmsQualityInstance); + + /** + * 修改质检工单 + * + * @param qmsQualityInstance 质检工单 + * @return 结果 + */ + public int updateQmsQualityInstance(QmsQualityInstance qmsQualityInstance); + + /** + * 删除质检工单 + * + * @param qualityInstanceId 质检工单主键 + * @return 结果 + */ + public int deleteQmsQualityInstanceByQualityInstanceId(Long qualityInstanceId); + + /** + * 批量删除质检工单 + * + * @param qualityInstanceIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQmsQualityInstanceByQualityInstanceIds(Long[] qualityInstanceIds); + + /** + * 批量删除质检工单实例节点 + * + * @param qualityInstanceIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQmsQualityInstanceActivityByQualityInstanceIds(Long[] qualityInstanceIds); + + /** + * 批量新增质检工单实例节点 + * + * @param qmsQualityInstanceActivityList 质检工单实例节点列表 + * @return 结果 + */ + public int batchQmsQualityInstanceActivity(List qmsQualityInstanceActivityList); + + + /** + * 通过质检工单主键删除质检工单实例节点信息 + * + * @param qualityInstanceId 质检工单ID + * @return 结果 + */ + public int deleteQmsQualityInstanceActivityByQualityInstanceId(Long qualityInstanceId); + + + + /** + * 查询质检工单 + * + * @param checkResultId 质检结果ID + * @return 质检工单 + */ + public QmsQualityInstance selectQmsQualityInstanceByCheckResultId(Long checkResultId); +} diff --git a/hw-modules/hw-qms/src/main/java/com/hw/qms/service/IQmsCheckInstanceFileService.java b/hw-modules/hw-qms/src/main/java/com/hw/qms/service/IQmsCheckInstanceFileService.java new file mode 100644 index 0000000..79b1816 --- /dev/null +++ b/hw-modules/hw-qms/src/main/java/com/hw/qms/service/IQmsCheckInstanceFileService.java @@ -0,0 +1,61 @@ +package com.hw.qms.service; + +import java.util.List; +import com.hw.qms.domain.QmsCheckInstanceFile; + +/** + * 质检文件Service接口 + * + * @author xins + * @date 2024-01-23 + */ +public interface IQmsCheckInstanceFileService +{ + /** + * 查询质检文件 + * + * @param checkInstanceFileId 质检文件主键 + * @return 质检文件 + */ + public QmsCheckInstanceFile selectQmsCheckInstanceFileByCheckInstanceFileId(Long checkInstanceFileId); + + /** + * 查询质检文件列表 + * + * @param qmsCheckInstanceFile 质检文件 + * @return 质检文件集合 + */ + public List selectQmsCheckInstanceFileList(QmsCheckInstanceFile qmsCheckInstanceFile); + + /** + * 新增质检文件 + * + * @param qmsCheckInstanceFile 质检文件 + * @return 结果 + */ + public int insertQmsCheckInstanceFile(QmsCheckInstanceFile qmsCheckInstanceFile); + + /** + * 修改质检文件 + * + * @param qmsCheckInstanceFile 质检文件 + * @return 结果 + */ + public int updateQmsCheckInstanceFile(QmsCheckInstanceFile qmsCheckInstanceFile); + + /** + * 批量删除质检文件 + * + * @param checkInstanceFileIds 需要删除的质检文件主键集合 + * @return 结果 + */ + public int deleteQmsCheckInstanceFileByCheckInstanceFileIds(Long[] checkInstanceFileIds); + + /** + * 删除质检文件信息 + * + * @param checkInstanceFileId 质检文件主键 + * @return 结果 + */ + public int deleteQmsCheckInstanceFileByCheckInstanceFileId(Long checkInstanceFileId); +} diff --git a/hw-modules/hw-qms/src/main/java/com/hw/qms/service/IQmsQualityInstanceService.java b/hw-modules/hw-qms/src/main/java/com/hw/qms/service/IQmsQualityInstanceService.java new file mode 100644 index 0000000..dd6aca3 --- /dev/null +++ b/hw-modules/hw-qms/src/main/java/com/hw/qms/service/IQmsQualityInstanceService.java @@ -0,0 +1,71 @@ +package com.hw.qms.service; + +import java.util.List; +import com.hw.qms.domain.QmsQualityInstance; + +/** + * 质检工单Service接口 + * + * @author xins + * @date 2024-01-23 + */ +public interface IQmsQualityInstanceService +{ + /** + * 查询质检工单 + * + * @param qualityInstanceId 质检工单主键 + * @return 质检工单 + */ + public QmsQualityInstance selectQmsQualityInstanceByQualityInstanceId(Long qualityInstanceId); + + /** + * 查询质检工单列表 + * + * @param qmsQualityInstance 质检工单 + * @return 质检工单集合 + */ + public List selectQmsQualityInstanceList(QmsQualityInstance qmsQualityInstance); + + /** + * 新增质检工单 + * + * @param qmsQualityInstance 质检工单 + * @return 结果 + */ + public int insertQmsQualityInstance(QmsQualityInstance qmsQualityInstance); + + /** + * 修改质检工单 + * + * @param qmsQualityInstance 质检工单 + * @return 结果 + */ + public int updateQmsQualityInstance(QmsQualityInstance qmsQualityInstance); + + /** + * 批量删除质检工单 + * + * @param qualityInstanceIds 需要删除的质检工单主键集合 + * @return 结果 + */ + public int deleteQmsQualityInstanceByQualityInstanceIds(Long[] qualityInstanceIds); + + /** + * 删除质检工单信息 + * + * @param qualityInstanceId 质检工单主键 + * @return 结果 + */ + public int deleteQmsQualityInstanceByQualityInstanceId(Long qualityInstanceId); + + + + /** + * 查询质检工单 + * + * @param checkResultId 质检结果ID + * @return 质检工单 + */ + public QmsQualityInstance selectQmsQualityInstanceByCheckResultId(Long checkResultId); +} diff --git a/hw-modules/hw-qms/src/main/java/com/hw/qms/service/impl/QmsCheckInstanceFileServiceImpl.java b/hw-modules/hw-qms/src/main/java/com/hw/qms/service/impl/QmsCheckInstanceFileServiceImpl.java new file mode 100644 index 0000000..0dbe3a4 --- /dev/null +++ b/hw-modules/hw-qms/src/main/java/com/hw/qms/service/impl/QmsCheckInstanceFileServiceImpl.java @@ -0,0 +1,93 @@ +package com.hw.qms.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hw.qms.mapper.QmsCheckInstanceFileMapper; +import com.hw.qms.domain.QmsCheckInstanceFile; +import com.hw.qms.service.IQmsCheckInstanceFileService; + +/** + * 质检文件Service业务层处理 + * + * @author xins + * @date 2024-01-23 + */ +@Service +public class QmsCheckInstanceFileServiceImpl implements IQmsCheckInstanceFileService +{ + @Autowired + private QmsCheckInstanceFileMapper qmsCheckInstanceFileMapper; + + /** + * 查询质检文件 + * + * @param checkInstanceFileId 质检文件主键 + * @return 质检文件 + */ + @Override + public QmsCheckInstanceFile selectQmsCheckInstanceFileByCheckInstanceFileId(Long checkInstanceFileId) + { + return qmsCheckInstanceFileMapper.selectQmsCheckInstanceFileByCheckInstanceFileId(checkInstanceFileId); + } + + /** + * 查询质检文件列表 + * + * @param qmsCheckInstanceFile 质检文件 + * @return 质检文件 + */ + @Override + public List selectQmsCheckInstanceFileList(QmsCheckInstanceFile qmsCheckInstanceFile) + { + return qmsCheckInstanceFileMapper.selectQmsCheckInstanceFileList(qmsCheckInstanceFile); + } + + /** + * 新增质检文件 + * + * @param qmsCheckInstanceFile 质检文件 + * @return 结果 + */ + @Override + public int insertQmsCheckInstanceFile(QmsCheckInstanceFile qmsCheckInstanceFile) + { + return qmsCheckInstanceFileMapper.insertQmsCheckInstanceFile(qmsCheckInstanceFile); + } + + /** + * 修改质检文件 + * + * @param qmsCheckInstanceFile 质检文件 + * @return 结果 + */ + @Override + public int updateQmsCheckInstanceFile(QmsCheckInstanceFile qmsCheckInstanceFile) + { + return qmsCheckInstanceFileMapper.updateQmsCheckInstanceFile(qmsCheckInstanceFile); + } + + /** + * 批量删除质检文件 + * + * @param checkInstanceFileIds 需要删除的质检文件主键 + * @return 结果 + */ + @Override + public int deleteQmsCheckInstanceFileByCheckInstanceFileIds(Long[] checkInstanceFileIds) + { + return qmsCheckInstanceFileMapper.deleteQmsCheckInstanceFileByCheckInstanceFileIds(checkInstanceFileIds); + } + + /** + * 删除质检文件信息 + * + * @param checkInstanceFileId 质检文件主键 + * @return 结果 + */ + @Override + public int deleteQmsCheckInstanceFileByCheckInstanceFileId(Long checkInstanceFileId) + { + return qmsCheckInstanceFileMapper.deleteQmsCheckInstanceFileByCheckInstanceFileId(checkInstanceFileId); + } +} diff --git a/hw-modules/hw-qms/src/main/java/com/hw/qms/service/impl/QmsQualityInstanceServiceImpl.java b/hw-modules/hw-qms/src/main/java/com/hw/qms/service/impl/QmsQualityInstanceServiceImpl.java new file mode 100644 index 0000000..fbf4ff0 --- /dev/null +++ b/hw-modules/hw-qms/src/main/java/com/hw/qms/service/impl/QmsQualityInstanceServiceImpl.java @@ -0,0 +1,154 @@ +package com.hw.qms.service.impl; + +import java.util.List; +import com.hw.common.core.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.ArrayList; +import com.hw.common.core.utils.StringUtils; +import org.springframework.transaction.annotation.Transactional; +import com.hw.qms.domain.QmsQualityInstanceActivity; +import com.hw.qms.mapper.QmsQualityInstanceMapper; +import com.hw.qms.domain.QmsQualityInstance; +import com.hw.qms.service.IQmsQualityInstanceService; + +/** + * 质检工单Service业务层处理 + * + * @author xins + * @date 2024-01-23 + */ +@Service +public class QmsQualityInstanceServiceImpl implements IQmsQualityInstanceService +{ + @Autowired + private QmsQualityInstanceMapper qmsQualityInstanceMapper; + + /** + * 查询质检工单 + * + * @param qualityInstanceId 质检工单主键 + * @return 质检工单 + */ + @Override + public QmsQualityInstance selectQmsQualityInstanceByQualityInstanceId(Long qualityInstanceId) + { + return qmsQualityInstanceMapper.selectQmsQualityInstanceByQualityInstanceId(qualityInstanceId); + } + + /** + * 查询质检工单列表 + * + * @param qmsQualityInstance 质检工单 + * @return 质检工单 + */ + @Override + public List selectQmsQualityInstanceList(QmsQualityInstance qmsQualityInstance) + { + return qmsQualityInstanceMapper.selectQmsQualityInstanceList(qmsQualityInstance); + } + + /** + * 新增质检工单 + * + * @param qmsQualityInstance 质检工单 + * @return 结果 + */ + @Transactional + @Override + public int insertQmsQualityInstance(QmsQualityInstance qmsQualityInstance) + { + qmsQualityInstance.setCreateTime(DateUtils.getNowDate()); + int rows = qmsQualityInstanceMapper.insertQmsQualityInstance(qmsQualityInstance); + insertQmsQualityInstanceActivity(qmsQualityInstance); + return rows; + } + + /** + * 修改质检工单 + * + * @param qmsQualityInstance 质检工单 + * @return 结果 + */ + @Transactional + @Override + public int updateQmsQualityInstance(QmsQualityInstance qmsQualityInstance) + { + qmsQualityInstance.setUpdateTime(DateUtils.getNowDate()); + qmsQualityInstanceMapper.deleteQmsQualityInstanceActivityByQualityInstanceId(qmsQualityInstance.getQualityInstanceId()); + insertQmsQualityInstanceActivity(qmsQualityInstance); + return qmsQualityInstanceMapper.updateQmsQualityInstance(qmsQualityInstance); + } + + /** + * 批量删除质检工单 + * + * @param qualityInstanceIds 需要删除的质检工单主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteQmsQualityInstanceByQualityInstanceIds(Long[] qualityInstanceIds) + { + qmsQualityInstanceMapper.deleteQmsQualityInstanceActivityByQualityInstanceIds(qualityInstanceIds); + return qmsQualityInstanceMapper.deleteQmsQualityInstanceByQualityInstanceIds(qualityInstanceIds); + } + + /** + * 删除质检工单信息 + * + * @param qualityInstanceId 质检工单主键 + * @return 结果 + */ + @Transactional + @Override + public int deleteQmsQualityInstanceByQualityInstanceId(Long qualityInstanceId) + { + qmsQualityInstanceMapper.deleteQmsQualityInstanceActivityByQualityInstanceId(qualityInstanceId); + return qmsQualityInstanceMapper.deleteQmsQualityInstanceByQualityInstanceId(qualityInstanceId); + } + + /** + * 新增质检工单实例节点信息 + * + * @param qmsQualityInstance 质检工单对象 + */ + public void insertQmsQualityInstanceActivity(QmsQualityInstance qmsQualityInstance) + { + List qmsQualityInstanceActivityList = qmsQualityInstance.getQmsQualityInstanceActivityList(); + Long qualityInstanceId = qmsQualityInstance.getQualityInstanceId(); + if (StringUtils.isNotNull(qmsQualityInstanceActivityList)) + { + List list = new ArrayList(); + for (QmsQualityInstanceActivity qmsQualityInstanceActivity : qmsQualityInstanceActivityList) + { + qmsQualityInstanceActivity.setQualityInstanceId(qualityInstanceId); + list.add(qmsQualityInstanceActivity); + } + if (list.size() > 0) + { + qmsQualityInstanceMapper.batchQmsQualityInstanceActivity(list); + } + } + } + + + + + + + + + + /** + * 查询质检工单 + * + * @param checkResultId 质检结果ID + * @return 质检工单 + */ + @Override + public QmsQualityInstance selectQmsQualityInstanceByCheckResultId(Long checkResultId) + { + return qmsQualityInstanceMapper.selectQmsQualityInstanceByCheckResultId(checkResultId); + } +} diff --git a/hw-modules/hw-qms/src/main/resources/mapper/qms/QmsCheckInstanceFileMapper.xml b/hw-modules/hw-qms/src/main/resources/mapper/qms/QmsCheckInstanceFileMapper.xml new file mode 100644 index 0000000..15f21bb --- /dev/null +++ b/hw-modules/hw-qms/src/main/resources/mapper/qms/QmsCheckInstanceFileMapper.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + select check_instance_file_id, target_type, target_id, fault_file from qms_check_instance_file + + + + + + + + insert into qms_check_instance_file + + target_type, + target_id, + fault_file, + + + #{targetType}, + #{targetId}, + #{faultFile}, + + + + + update qms_check_instance_file + + target_type = #{targetType}, + target_id = #{targetId}, + fault_file = #{faultFile}, + + where check_instance_file_id = #{checkInstanceFileId} + + + + delete from qms_check_instance_file where check_instance_file_id = #{checkInstanceFileId} + + + + delete from qms_check_instance_file where check_instance_file_id in + + #{checkInstanceFileId} + + + diff --git a/hw-modules/hw-qms/src/main/resources/mapper/qms/QmsQualityInstanceMapper.xml b/hw-modules/hw-qms/src/main/resources/mapper/qms/QmsQualityInstanceMapper.xml new file mode 100644 index 0000000..62ba852 --- /dev/null +++ b/hw-modules/hw-qms/src/main/resources/mapper/qms/QmsQualityInstanceMapper.xml @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select quality_instance_id, wf_process_id, wf_instance_status, check_result_id, quality_description, start_time, end_time, create_by, create_time, update_by, update_time from qms_quality_instance + + + + + + + + insert into qms_quality_instance + + wf_process_id, + wf_instance_status, + check_result_id, + quality_description, + start_time, + end_time, + create_by, + create_time, + update_by, + update_time, + + + #{wfProcessId}, + #{wfInstanceStatus}, + #{checkResultId}, + #{qualityDescription}, + #{startTime}, + #{endTime}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update qms_quality_instance + + wf_process_id = #{wfProcessId}, + wf_instance_status = #{wfInstanceStatus}, + check_result_id = #{checkResultId}, + quality_description = #{qualityDescription}, + start_time = #{startTime}, + end_time = #{endTime}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where quality_instance_id = #{qualityInstanceId} + + + + delete from qms_quality_instance where quality_instance_id = #{qualityInstanceId} + + + + delete from qms_quality_instance where quality_instance_id in + + #{qualityInstanceId} + + + + + delete from qms_quality_instance_activity where quality_instance_id in + + #{qualityInstanceId} + + + + + delete from qms_quality_instance_activity where quality_instance_id = #{qualityInstanceId} + + + + insert into qms_quality_instance_activity( instance_activity_id, quality_instance_id, process_activity_id, process_handle_resolution, process_handle_desc, process_handle_status, process_step_order, start_time, end_time, handle_user_id, handle_by, handle_time, create_by, create_time, transfer_user_id) values + + ( #{item.instanceActivityId}, #{item.qualityInstanceId}, #{item.processActivityId}, #{item.processHandleResolution}, #{item.processHandleDesc}, #{item.processHandleStatus}, #{item.processStepOrder}, #{item.startTime}, #{item.endTime}, #{item.handleUserId}, #{item.handleBy}, #{item.handleTime}, #{item.createBy}, #{item.createTime}, #{item.transferUserId}) + + + + + + + + + + + + + +