From 10131f750edb4463ccfee49667c5e5c5a9b2e1f4 Mon Sep 17 00:00:00 2001 From: "xiangwei.zhang" <752558143@qq.com> Date: Wed, 15 Jan 2025 14:58:33 +0800 Subject: [PATCH] =?UTF-8?q?44838=20=20MES:=E8=A3=81=E7=89=87=E8=A1=A5?= =?UTF-8?q?=E7=89=87=E9=80=BB=E8=BE=91=E6=9B=B4=E6=96=B0=EF=BC=86=E8=A3=81?= =?UTF-8?q?=E7=89=87=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ext/mes/api/base/IMesWorkOrderCutService.java | 3 ++- .../controller/base/MesWorkOrderCutController.java | 7 +++++-- .../serviceimpl/base/MesWorkOrderCutService.java | 20 +++++++++++++++++--- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/modules/i3plus-ext-mes-api/src/main/java/cn/estsh/i3plus/ext/mes/api/base/IMesWorkOrderCutService.java b/modules/i3plus-ext-mes-api/src/main/java/cn/estsh/i3plus/ext/mes/api/base/IMesWorkOrderCutService.java index 3650596..36f5761 100644 --- a/modules/i3plus-ext-mes-api/src/main/java/cn/estsh/i3plus/ext/mes/api/base/IMesWorkOrderCutService.java +++ b/modules/i3plus-ext-mes-api/src/main/java/cn/estsh/i3plus/ext/mes/api/base/IMesWorkOrderCutService.java @@ -2,6 +2,7 @@ package cn.estsh.i3plus.ext.mes.api.base; import cn.estsh.i3plus.pojo.base.bean.ListPager; import cn.estsh.i3plus.pojo.base.common.Pager; +import cn.estsh.i3plus.pojo.mes.bean.MesCutSchemeFg; import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrderCut; import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrderCutDetail; import io.swagger.annotations.ApiOperation; @@ -18,7 +19,7 @@ public interface IMesWorkOrderCutService extends IBaseMesService workOrderIds, String cutCode, String remark, String organizeCode, - String userName, Integer editionNumber); + String userName, Integer editionNumber, boolean isFree, List mesCutSchemeFgs); @ApiOperation("分页查询裁片工单明细") ListPager queryWorkOrderCutDetailByPager(MesWorkOrderCutDetail workOrderCutDetail, Pager pager); diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/MesWorkOrderCutController.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/MesWorkOrderCutController.java index 344cd69..7996749 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/MesWorkOrderCutController.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/controller/base/MesWorkOrderCutController.java @@ -4,6 +4,7 @@ import cn.estsh.i3plus.ext.mes.api.base.IMesWorkOrderCutService; import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant; import cn.estsh.i3plus.pojo.base.common.Pager; import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil; +import cn.estsh.i3plus.pojo.mes.bean.MesCutSchemeFg; import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrderCut; import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrderCutDetail; import cn.estsh.impp.framework.boot.auth.AuthUtil; @@ -20,6 +21,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.Arrays; +import java.util.List; + /** * 裁片工单 */ @@ -33,14 +36,14 @@ public class MesWorkOrderCutController extends BaseMesController mesCutSchemeFgs) { try { ValidatorBean.checkNotNull(workOrderIds, "工单不存在"); ValidatorBean.checkNotNull(cutCode, "裁片方案不存在"); workOrderCutService.doGenerateCutWorkOrder(Arrays.asList(workOrderIds), cutCode, remark, - AuthUtil.getOrganize().getOrganizeCode(), AuthUtil.getSessionUser().getUserName(), editionNumber); + AuthUtil.getOrganize().getOrganizeCode(), AuthUtil.getSessionUser().getUserName(), editionNumber, isFree, mesCutSchemeFgs); return ResultBean.success("生成成功") .setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()); } catch (ImppBusiException busExcep) { diff --git a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesWorkOrderCutService.java b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesWorkOrderCutService.java index c5462d3..1cffe10 100644 --- a/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesWorkOrderCutService.java +++ b/modules/i3plus-ext-mes-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/apiservice/serviceimpl/base/MesWorkOrderCutService.java @@ -21,6 +21,7 @@ import cn.estsh.i3plus.pojo.mes.model.GenSerialNoModel; import cn.estsh.i3plus.pojo.mes.repository.*; import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; import cn.estsh.impp.framework.boot.util.SpringContextsUtil; +import cn.hutool.core.stream.CollectorUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -80,7 +81,7 @@ public class MesWorkOrderCutService extends BaseMesService impl @Override public void doGenerateCutWorkOrder(List workOrderIds, String cutCode, String remark, String organizeCode, - String userName, Integer editionNumber) { + String userName, Integer editionNumber, boolean isFree, List mesCutSchemeFgs) { List workOrderList = getMesWorkOrders(workOrderIds, organizeCode); @@ -90,7 +91,15 @@ public class MesWorkOrderCutService extends BaseMesService impl List cutSchemeMaterialList = getMesCutSchemeMaterials(cutCode, organizeCode); - List cutSchemeFgList = getMesCutSchemeFgs(cutCode, organizeCode); + List cutSchemeFgList = new ArrayList<>(); + if (!isFree) { + cutSchemeFgList = getMesCutSchemeFgs(cutCode, organizeCode); + } else { + if (CollectionUtils.isEmpty(mesCutSchemeFgs)) { + MesException.throwMesBusiException("未选择裁片成品"); + } + cutSchemeFgList.addAll(mesCutSchemeFgs); + } // 校验工单物料是否已在成品配置中进行维护 checkWorkOrderPartValid(workOrderList, cutSchemeFgList); @@ -125,7 +134,12 @@ public class MesWorkOrderCutService extends BaseMesService impl workOrderCut.setCutWorkOrderNo(cutWorkOrderNo); workOrderCut.setOrganizeCode(organizeCode); - workOrderCut.setPrintStatus(MesExtEnumUtil.PRINT_STATUS.UNPRINT.getValue()); + // 44838 如果isFree 是 默认已打印 + Integer printStatus = MesExtEnumUtil.PRINT_STATUS.UNPRINT.getValue(); + if (isFree) { + printStatus = MesExtEnumUtil.PRINT_STATUS.PRINTED.getValue(); + } + workOrderCut.setPrintStatus(printStatus); workOrderCuttList.add(workOrderCut); for (MesCutSchemeMaterial cutSchemeMaterial : cutSchemeMaterialList) {