diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesProdOrgExtService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesProdOrgExtService.java index e9049d1..979e94d 100644 --- a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesProdOrgExtService.java +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesProdOrgExtService.java @@ -50,6 +50,9 @@ public interface IMesProdOrgExtService { @ApiOperation(value = "根据生产线代码,工位代码,关系类型查询主子工位关系信息") List getWorkCellExtendCfgList(String organizeCode, String workCenterCode, String workCellCode, Integer extendType); + @ApiOperation(value = "根据生产线代码,工位代码查询主子工位实虚关系信息[大于等于Bak工位的seq的数据排在前面]") + List getWorkCellExtendCfgRvListSortByBak(String organizeCode, String workCenterCodeBak, String workCellCodeBak); + @ApiOperation(value = "根据生产线代码,工位代码查询主子工位实虚关系信息") List getWorkCellExtendCfgRvListByBak(String organizeCode, String workCenterCodeBak, String workCellCodeBak); diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesReworkTaskService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesReworkTaskService.java index 090521f..ef7c1f3 100644 --- a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesReworkTaskService.java +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/base/IMesReworkTaskService.java @@ -41,8 +41,12 @@ public interface IMesReworkTaskService { void doReworkSuccess(MesReworkTaskRequestModel requestModel); + @ApiOperation(value = "排序拆解") + void doSortOrderDismantle(MesReworkTaskRequestModel requestModel); + MesProduceSnPrintModel doPrint(MesReworkTaskRequestModel requestModel); @ApiOperation(value = "扫描条码替换装配件") void doAssemblySnRepeatByScan(MesReworkTaskRequestModel requestModel); + } diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesAssemblyExtService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesAssemblyExtService.java index 8d5c3eb..086ac76 100644 --- a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesAssemblyExtService.java +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesAssemblyExtService.java @@ -3,6 +3,7 @@ package cn.estsh.i3plus.ext.mes.pcn.api.busi; import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProdRuleContext; import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionAssemblyNosortContext; import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionAssemblySortContext; +import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; import cn.estsh.i3plus.pojo.mes.bean.*; import io.swagger.annotations.ApiOperation; @@ -29,6 +30,9 @@ public interface IMesAssemblyExtService { @ApiOperation(value = "获取装配件规则且唯一绑定记录") List getProductionAssemblyUniqueList(String organizeCode, String assemblySn); + @ApiOperation(value = "根据零件条码或者加工单获取装配件规则且唯一绑定记录") + List getProductionAssemblyUniqueListByProductSn(String organizeCode, String productSn); + @ApiOperation(value = "获取非排序装配件配置信息") List getProductionAssemblyNosortContextList(MesProdRuleContext prodRuleContext); @@ -47,4 +51,16 @@ public interface IMesAssemblyExtService { @ApiOperation(value = "【排序线】获取生产工单装配件清单") List getWorkOrderAssemblyList(String organizeCode, String workCenterCode, String workCellCode, String workOrderNo, List productSnList); + @ApiOperation(value = "获取工单装配件记录") + List getWorkOrderAssemblyList(String organizeCode, String workOrderNo); + + @ApiOperation(value = "根据条件修改装配件绑定记录的装配状态") + void saveProductionAssemblyStatusByDdlPackBean(DdlPackBean packBean, String userInfo, Integer assemblyStatus); + + @ApiOperation(value = "根据条件修改装配件绑定唯一性记录的装配状态") + void saveProductionAssemblyUniqueStatusByDdlPackBean(DdlPackBean packBean, String userInfo, Integer assemblyStatus); + + @ApiOperation(value = "根据条件修改工单装配件记录的装配状态") + void saveWorkOrderAssemblyStatusByDdlPackBean(DdlPackBean packBean, String userInfo, Integer assemblyStatus); + } diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesPartShippingGroupService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesPartShippingGroupService.java index 8599268..b9f9224 100644 --- a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesPartShippingGroupService.java +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesPartShippingGroupService.java @@ -27,4 +27,7 @@ public interface IMesPartShippingGroupService { @ApiOperation(value = "发运组明细") MesPartShippingGroupDetail getMesPartShippingGroupDetail(String organizeCode, String shippingGroupCode, String partNo, String custPartNo); + + @ApiOperation(value = "发运组明细") + MesPartShippingGroupDetail getMesPartShippingGroupDetailByPartNo(String organizeCode, String shippingGroupCode, String partNo); } diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesProduceSnExtService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesProduceSnExtService.java index 6acd2ff..40a8ec5 100644 --- a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesProduceSnExtService.java +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesProduceSnExtService.java @@ -1,5 +1,6 @@ package cn.estsh.i3plus.ext.mes.pcn.api.busi; +import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; import cn.estsh.i3plus.pojo.base.bean.ListPager; import cn.estsh.i3plus.pojo.base.common.Pager; import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn; @@ -23,6 +24,9 @@ public interface IMesProduceSnExtService { @ApiOperation(value = "根据零件条码查询零件条码信息, 创建时间倒序") List getProduceSnListCreateDatetimeDesc(String organizeCode, String productSn); + @ApiOperation(value = "根据产品条码查询零件条码信息[非排序],创建时间最新") + MesProduceSn getProduceSnCreateDatetimeDesc(String organizeCode, String productSn); + @ApiOperation(value = "根据客户条码查询零件条码信息[排序]") MesProduceSn getProduceSnByCustSn(String organizeCode, String custSn); @@ -56,6 +60,9 @@ public interface IMesProduceSnExtService { @ApiOperation(value = "根据零件条码ID修改条码状态,工位") void saveProduceSnList(StationRequestBean reqBean, Integer snStatus, List idList); + @ApiOperation(value = "根据条件修改条码状态") + void saveProduceSntatusByDdlPackBean(DdlPackBean packBean, String userInfo, Integer snStatus); + MesProduceSn insert(MesProduceSn item); void update(MesProduceSn item); @@ -64,4 +71,7 @@ public interface IMesProduceSnExtService { @ApiOperation(value = "根据零件条码信息") ListPager queryMesProduceSn(MesProduceSn mesProduceSn, Pager pager); + + @ApiOperation(value = "根据条码和工厂获取") + String queryPartNoByProduceSn(String productSn,String organizeCode); } diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesProductionRecordService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesProductionRecordService.java index 3717001..c1f213b 100644 --- a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesProductionRecordService.java +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesProductionRecordService.java @@ -19,6 +19,9 @@ public interface IMesProductionRecordService { @ApiOperation(value = "根据零件条码查询加工记录信息") List findProductionRecordList(String organizeCode, String productSn); + @ApiOperation(value = "根据零件条码和工艺查询加工记录") + Integer findFrontProcessProductionRecord(String organizeCode, String productSn,String craftCode); + @ApiOperation(value = "查询加工记录, 根据完成时间倒序") List findProductionRecordListCompleteDateTimeDesc(String organizeCode, String productSn); diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/recyclablepackage/IMesRecyclablePackageBindingService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/recyclablepackage/IMesRecyclablePackageBindingService.java index 2f2d7c9..ade1fea 100644 --- a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/recyclablepackage/IMesRecyclablePackageBindingService.java +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/recyclablepackage/IMesRecyclablePackageBindingService.java @@ -3,6 +3,7 @@ package cn.estsh.i3plus.ext.mes.pcn.api.busi.recyclablepackage; import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesRecyclablePackageBindingModel; import cn.estsh.i3plus.pojo.mes.bean.recyclablepackage.MesRecyclablePackageBinding; import cn.estsh.i3plus.pojo.mes.bean.recyclablepackage.MesRecyclablePackageBindingDetail; +import cn.estsh.impp.framework.boot.util.ResultBean; import io.swagger.annotations.ApiOperation; import java.util.List; @@ -39,7 +40,7 @@ public interface IMesRecyclablePackageBindingService { List findMesRecyclablePackageBindingDetail(MesRecyclablePackageBindingModel mesRecyclablePackageBindingModel); @ApiOperation("扫描信息") - MesRecyclablePackageBinding doScan(MesRecyclablePackageBindingModel mesRecyclablePackageBindingModel); + ResultBean doScan(MesRecyclablePackageBindingModel mesRecyclablePackageBindingModel); @ApiOperation("解绑") void doMesRecyclablePackageUnBinding(MesRecyclablePackageBinding mesRecyclablePackageBinding, List bindingDetailList,String userName); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/base/MesWhiteController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/base/MesWhiteController.java new file mode 100644 index 0000000..c75ac3b --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/base/MesWhiteController.java @@ -0,0 +1,30 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.base; + +import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi.MesProduceSnExtService; +import cn.estsh.impp.framework.boot.util.ResultBean; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/white") +public class MesWhiteController { + + @Autowired + private MesProduceSnExtService mesProduceSnExtService; + + @GetMapping("/mesPartSap/{productSn}/{organizeCode}") + public ResultBean getPartNo(@PathVariable String productSn,@PathVariable String organizeCode){ + + String partNo; + try { + partNo = mesProduceSnExtService.queryPartNoByProduceSn(productSn, organizeCode); + } catch (Exception e) { + return ResultBean.fail("查询失败").setErrorMsg(e.getMessage()); + } + return ResultBean.success("查询成功").setResultObject(partNo); + + } +} diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesReworkTaskController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesReworkTaskController.java index 97d3b31..ac46965 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesReworkTaskController.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesReworkTaskController.java @@ -161,6 +161,22 @@ public class MesReworkTaskController { } } + @PostMapping("/sort-order-dismantle/do") + @ApiOperation(value = "排序拆解") + public ResultBean doSortOrderDismantle(@RequestBody MesReworkTaskRequestModel requestModel) { + try { + ValidatorBean.checkNotNull(requestModel.getReworkOrder(), "返工单不能为空"); + ValidatorBean.checkNotNull(requestModel.getOrganizeCode(), "工厂代码不能为空"); + ValidatorBean.checkNotNull(requestModel.getUserName(), "操作人不能为空"); + mesReworkTaskService.doSortOrderDismantle(requestModel); + return ResultBean.success("排序拆解成功"); + } catch (ImppBusiException imppException) { + return ResultBean.fail(imppException); + } catch (Exception e) { + return ImppExceptionBuilder.newInstance().buildExceptionResult(e); + } + } + @GetMapping("/doPrint") @ApiOperation(value = "打印") public ResultBean doPrint(MesReworkTaskRequestModel requestModel) { diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/recyclablepackage/MesRecyclablePackageBindingController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/recyclablepackage/MesRecyclablePackageBindingController.java index 8f94b5a..c3b3719 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/recyclablepackage/MesRecyclablePackageBindingController.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/recyclablepackage/MesRecyclablePackageBindingController.java @@ -55,7 +55,7 @@ public class MesRecyclablePackageBindingController { ValidatorBean.checkNotNull(mesRecyclablePackageBindingModel.getOrganizeCode(), "工厂代码不能为空"); ValidatorBean.checkNotNull(mesRecyclablePackageBindingModel.getType(), "操作类型不能为空"); ValidatorBean.checkNotNull(mesRecyclablePackageBindingModel.getUserName(), "操作人不能为空"); - return ResultBean.success("操作成功").setResultObject(mesRecyclablePackageBindingService.doScan(mesRecyclablePackageBindingModel)); + return mesRecyclablePackageBindingService.doScan(mesRecyclablePackageBindingModel); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); } catch (Exception e) { diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesProdOrgExtService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesProdOrgExtService.java index 30749c1..c5a840e 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesProdOrgExtService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesProdOrgExtService.java @@ -165,7 +165,7 @@ public class MesProdOrgExtService implements IMesProdOrgExtService { } @Override - public List getWorkCellExtendCfgRvListByBak(String organizeCode, String workCenterCodeBak, String workCellCodeBak) { + public List getWorkCellExtendCfgRvListSortByBak(String organizeCode, String workCenterCodeBak, String workCellCodeBak) { if (StringUtils.isEmpty(organizeCode) || StringUtils.isEmpty(workCenterCodeBak) || StringUtils.isEmpty(workCellCodeBak)) return null; MesWorkCellExtendCfg workCellExtendCfg = getWorkCellExtendCfg(organizeCode, workCenterCodeBak, workCellCodeBak, MesExtEnumUtil.WORK_CELL_EXTEND_TYPE.RV.getValue()); if (null == workCellCodeBak) return null; @@ -176,7 +176,14 @@ public class MesProdOrgExtService implements IMesProdOrgExtService { workCellExtendCfgList.addAll(workCellExtendCfgListAfter); workCellExtendCfgList.addAll(workCellExtendCfgListBefore); return workCellExtendCfgList; + } + @Override + public List getWorkCellExtendCfgRvListByBak(String organizeCode, String workCenterCodeBak, String workCellCodeBak) { + if (StringUtils.isEmpty(organizeCode) || StringUtils.isEmpty(workCenterCodeBak) || StringUtils.isEmpty(workCellCodeBak)) return null; + MesWorkCellExtendCfg workCellExtendCfg = getWorkCellExtendCfg(organizeCode, workCenterCodeBak, workCellCodeBak, MesExtEnumUtil.WORK_CELL_EXTEND_TYPE.RV.getValue()); + if (null == workCellCodeBak) return null; + return getWorkCellExtendCfgList(organizeCode, workCellExtendCfg.getWorkCenterCode(), workCellExtendCfg.getWorkCellCode(), MesExtEnumUtil.WORK_CELL_EXTEND_TYPE.RV.getValue()); } } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesReworkTaskServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesReworkTaskServiceImpl.java index de40469..14c6142 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesReworkTaskServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesReworkTaskServiceImpl.java @@ -48,6 +48,7 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; +import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -202,7 +203,9 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService { .sn(res.getSn()) .mesPartTypePicture(mesPartTypePicture) .mesPartInspection(mesPartInspection) - .mesPartInspectionDetails(mesPartInspectionDetails).build(); + .mesPartInspectionDetails(mesPartInspectionDetails) + .centerType(StringUtils.isEmpty(requestModel.getCenterType()) ? MesExtEnumUtil.WORK_CENTER_TYPE.NOSORT.getValue() : requestModel.getCenterType()) + .build(); return mesReworkTaskModel; @@ -339,6 +342,85 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService { } @Override + public void doSortOrderDismantle(MesReworkTaskRequestModel requestModel) { + + DdlPackBean packBean = DdlPackBean.getDdlPackBean(requestModel.getOrganizeCode()); + DdlPreparedPack.getStringEqualPack(requestModel.getReworkOrder(), MesPcnExtConstWords.REWORK_ORDER, packBean); + DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.REWORK_TASK_STATUS.CREATE.getValue(), MesPcnExtConstWords.STATUS, packBean); + MesReworkTask reworkTask = mesReworkTaskRepository.getByProperty(packBean); + if (null == reworkTask) MesPcnException.throwBusiException(String.format("返工单[%s]信息不存在!", requestModel.getReworkOrder())); + + MesProduceSn produceSn = (MesProduceSn) workOrderExtService.getWorkOrderSort(requestModel.getOrganizeCode(), reworkTask.getSn(), false); + if (null == produceSn) MesPcnException.throwBusiException(String.format("返工单[%s]关联的条码[%s]信息不存在!", requestModel.getReworkOrder(), reworkTask.getSn())); + + MesWorkOrder workOrder = workOrderExtService.getWorkOrder(requestModel.getOrganizeCode(), produceSn.getWorkOrderNo()); + if (null == produceSn) MesPcnException.throwBusiException(String.format("返工单[%s]关联的条码[%s]对应的加工单[%s]信息不存在!", requestModel.getReworkOrder(), reworkTask.getSn(), produceSn.getWorkOrderNo())); + + if (workOrder.getWorkOrderStatus().compareTo(MesExtEnumUtil.ORDER_STATUS.DISMANTLE.getValue()) == 0) + MesPcnException.throwBusiException(String.format("返工单[%s]关联的条码[%s]对应的加工单[%s]信息当前状态已为[%s]!", + requestModel.getReworkOrder(), reworkTask.getSn(), produceSn.getWorkOrderNo(), MesExtEnumUtil.ORDER_STATUS.valueOfDescription(workOrder.getWorkOrderStatus()))); + + //修改返工表状态为完成 + reworkTask.setStatus(MesExtEnumUtil.REWORK_TASK_STATUS.FINISH.getValue()); + ConvertBean.serviceModelUpdate(reworkTask, requestModel.getUserName()); + reworkTask.setSystemSyncStatus(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); + mesReworkTaskRepository.updateNoSync(reworkTask); + + //修改NC-零件检测-单据表 NC状态为拆解; qmsSync状态是否变更待确认 + packBean = DdlPackBean.getDdlPackBean(requestModel.getOrganizeCode()); + DdlPreparedPack.getNumEqualPack(reworkTask.getId(), MesPcnExtConstWords.REWORK_TASK_ID, packBean); + mesPartInspectionRepository.updateByPropertiesNoSync( + new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.NC_STATUS}, + new Object[]{requestModel.getUserName(), TimeTool.getNowTime(true), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesExtEnumUtil.PART_INSPECTION_NC_STATUS.DISASSEMBLY.getValue()}, + packBean); + + //修改工单状态为已拆解 + workOrder.setWorkOrderStatus(MesExtEnumUtil.ORDER_STATUS.DISMANTLE.getValue()); + workOrder.setModifyUser(requestModel.getUserName()); + workOrder.setModifyDatetime((new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date())); + workOrder.setSystemSyncStatus(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); + workOrderRepository.updateNoSync(workOrder); + + //修改条码状态为总成拆解 + packBean = DdlPackBean.getDdlPackBean(requestModel.getOrganizeCode()); + DdlPreparedPack.getStringEqualPack(produceSn.getProductSn(), MesPcnExtConstWords.PRODUCT_SN, packBean); + DdlPreparedPack.getStringEqualPack(produceSn.getWorkOrderNo(), MesPcnExtConstWords.WORK_ORDER_NO, packBean); + produceSnExtService.saveProduceSntatusByDdlPackBean(packBean, requestModel.getUserName(), MesExtEnumUtil.PRODUCE_SN_STATUS.ASSEMBLY_DISASSEMBLY.getValue()); + + //查询装配件绑定记录表 + List productionAssemblyList = mesAssemblyExtService.getProductionAssemblySortList(requestModel.getOrganizeCode(), workOrder.getWorkOrderNo()); + productionAssemblyList = CollectionUtils.isEmpty(productionAssemblyList) ? null : + productionAssemblyList.stream().filter(o -> (null != o && o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_20.getValue()) != 0)).collect(Collectors.toList()); + if (CollectionUtils.isEmpty(productionAssemblyList)) return; + + //将自制件类型的装配件对应的零件条码状态改成已拆解 + for (MesProductionAssembly productionAssembly : productionAssemblyList) { + if (null == productionAssembly) continue; + if (productionAssembly.getMatchType().compareTo(MesExtEnumUtil.ASSEMBLY_MATCH_TYPE.MATCH_TYPE_10.getValue()) != 0) continue; + if (StringUtils.isEmpty(productionAssembly.getAssemblySn()) || StringUtils.isEmpty(productionAssembly.getAssemblyPartNo())) continue; + packBean = DdlPackBean.getDdlPackBean(requestModel.getOrganizeCode()); + DdlPreparedPack.getStringEqualPack(productionAssembly.getAssemblySn(), MesPcnExtConstWords.PRODUCT_SN, packBean); + DdlPreparedPack.getStringEqualPack(productionAssembly.getAssemblyPartNo(), MesPcnExtConstWords.PART_NO, packBean); + DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.PRODUCE_SN_STATUS.ASSEMBLY.getValue(), MesPcnExtConstWords.SN_STATUS, packBean); + produceSnExtService.saveProduceSntatusByDdlPackBean(packBean, requestModel.getUserName(), MesExtEnumUtil.PRODUCE_SN_STATUS.ASSEMBLY_BACK.getValue()); + } + + //将装配件绑定记录表的非解绑状态的记录改为解绑状态 + packBean = DdlPackBean.getDdlPackBean(requestModel.getOrganizeCode()); + DdlPreparedPack.getStringEqualPack(produceSn.getProductSn(), MesPcnExtConstWords.PRODUCT_SN, packBean); + DdlPreparedPack.getNumNOEqualPack(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_20.getValue(), MesPcnExtConstWords.ASSEMBLY_STATUS, packBean); + mesAssemblyExtService.saveProductionAssemblyStatusByDdlPackBean(packBean, requestModel.getUserName(), MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_20.getValue()); + + //将装配件绑定唯一性记录表的非解绑状态的记录改为解绑状态;条件公用 + mesAssemblyExtService.saveProductionAssemblyUniqueStatusByDdlPackBean(packBean, requestModel.getUserName(), MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_20.getValue()); + + //将工单装配件表的非解绑状态的记录改为解绑状态;条件公用,增加工单条件 + DdlPreparedPack.getStringEqualPack(produceSn.getWorkOrderNo(), MesPcnExtConstWords.WORK_ORDER_NO, packBean); + mesAssemblyExtService.saveWorkOrderAssemblyStatusByDdlPackBean(packBean, requestModel.getUserName(), MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_20.getValue()); + + } + + @Override public MesProduceSnPrintModel doPrint(MesReworkTaskRequestModel requestModel) { String organizeCode = requestModel.getOrganizeCode(); String userName = requestModel.getUserName(); @@ -868,10 +950,15 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService { } private MesReworkTask getMesReworkTask(MesReworkTaskRequestModel requestModel) { + String workCenterCode = null; DdlPackBean packBean = DdlPackBean.getDdlPackBean(requestModel.getOrganizeCode()); if (!StringUtils.isEmpty(requestModel.getSn())) { - MesProduceSn produceSn = (MesProduceSn) workOrderExtService.getWorkOrderSort(requestModel.getOrganizeCode(), requestModel.getSn(), false); - if(!StringUtil.isEmpty(produceSn)){ + //根据零件条码查询 + MesProduceSn produceSn = produceSnExtService.getProduceSnCreateDatetimeDesc(requestModel.getOrganizeCode(), requestModel.getSn()); + //不存在则进行二次查询排序条码 + if (null == produceSn) produceSn = (MesProduceSn) workOrderExtService.getWorkOrderSort(requestModel.getOrganizeCode(), requestModel.getSn(), false); + if (null != produceSn) { + workCenterCode = produceSn.getWorkCenterCode(); DdlPreparedPack.getStringEqualPack(produceSn.getProductSn(), "sn", packBean); }else { DdlPreparedPack.getStringEqualPack(requestModel.getSn(), "sn", packBean); @@ -886,6 +973,19 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService { if (res == null) { throw new ImppBusiException("返工单信息不存在"); } + + //选择返工工单场景下 根据返工工单信息里面的条码进行反查生产线 + if (!StringUtils.isEmpty(requestModel.getReworkOrder())) { + MesProduceSn produceSn = produceSnExtService.getProduceSnCreateDatetimeDesc(requestModel.getOrganizeCode(), res.getSn()); + if (null == produceSn) produceSn = (MesProduceSn) workOrderExtService.getWorkOrderSort(requestModel.getOrganizeCode(), res.getSn(), false); + if (null != produceSn) workCenterCode = produceSn.getWorkCenterCode(); + } + + if (!StringUtils.isEmpty(workCenterCode)) { + //获取生产线类型, 用于前端判断, 支持点击 拆解按钮 还是 排序拆解按钮, 同时 返工完成按钮 根据生产线类型调用的接口不一样 + MesWorkCenter workCenter = prodOrgExtService.getWorkCenterDb(requestModel.getOrganizeCode(), workCenterCode); + if (null != workCenter) requestModel.setCenterType(workCenter.getCenterType()); + } return res; } private List getMesReworkTaskDetail(MesReworkTask mesReworkTask) { diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesAssemblyExtService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesAssemblyExtService.java index 0225acd..27c2b03 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesAssemblyExtService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesAssemblyExtService.java @@ -8,6 +8,7 @@ import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProdRuleContext; import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionAssemblyNosortContext; import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionAssemblySortContext; import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; +import cn.estsh.i3plus.platform.common.tool.TimeTool; import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; @@ -169,6 +170,13 @@ public class MesAssemblyExtService implements IMesAssemblyExtService { new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), assemblySn}); } + @Override + public List getProductionAssemblyUniqueListByProductSn(String organizeCode, String productSn) { + return productionAssemblyUniqueRepository.findByProperty( + new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.PRODUCT_SN}, + new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), productSn}); + } + //获取非排序装配件配置信息 @Override public List getProductionAssemblyNosortContextList(MesProdRuleContext prodRuleContext) { @@ -251,6 +259,15 @@ public class MesAssemblyExtService implements IMesAssemblyExtService { return workOrderAssemblyRepository.findByHqlWhere(packBean); } + //获取工单装配件记录【排序】 + @Override + public List getWorkOrderAssemblyList(String organizeCode, String workOrderNo) { + if (StringUtils.isEmpty(organizeCode) || StringUtils.isEmpty(workOrderNo)) return null; + DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode); + DdlPreparedPack.getStringEqualPack(workOrderNo, MesPcnExtConstWords.WORK_ORDER_NO, packBean); + return workOrderAssemblyRepository.findByHqlWhere(packBean); + } + //搜集非排序文件ID集合 private List filterNosortFileIdList(List assemblyNosortCfgList) { if (CollectionUtils.isEmpty(assemblyNosortCfgList)) return null; @@ -292,4 +309,34 @@ public class MesAssemblyExtService implements IMesAssemblyExtService { return CollectionUtils.isEmpty(workCellMap) ? null : workCellMap.get(workCellCode); } + //根据条件修改装配件绑定记录的装配状态 + @Override + public void saveProductionAssemblyStatusByDdlPackBean(DdlPackBean packBean, String userInfo, Integer assemblyStatus) { + if (StringUtils.isEmpty(userInfo) || StringUtils.isEmpty(assemblyStatus)) return; + productionAssemblyRepository.updateByPropertiesNoSync( + new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.ASSEMBLY_STATUS}, + new Object[]{userInfo, TimeTool.getNowTime(true), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), assemblyStatus}, + packBean); + } + + //根据条件修改装配件绑定唯一性记录的装配状态 + @Override + public void saveProductionAssemblyUniqueStatusByDdlPackBean(DdlPackBean packBean, String userInfo, Integer assemblyStatus) { + if (StringUtils.isEmpty(userInfo) || StringUtils.isEmpty(assemblyStatus)) return; + productionAssemblyUniqueRepository.updateByPropertiesNoSync( + new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.ASSEMBLY_STATUS}, + new Object[]{userInfo, TimeTool.getNowTime(true), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), assemblyStatus}, + packBean); + } + + //根据条件修改工单装配件记录的装配状态 + @Override + public void saveWorkOrderAssemblyStatusByDdlPackBean(DdlPackBean packBean, String userInfo, Integer assemblyStatus) { + if (StringUtils.isEmpty(userInfo) || StringUtils.isEmpty(assemblyStatus)) return; + workOrderAssemblyRepository.updateByPropertiesNoSync( + new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.ASSEMBLY_STATUS}, + new Object[]{userInfo, TimeTool.getNowTime(true), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), assemblyStatus}, + packBean); + } + } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesBoxingErrorProofingService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesBoxingErrorProofingService.java index 0ebf7d2..84e1656 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesBoxingErrorProofingService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesBoxingErrorProofingService.java @@ -133,8 +133,14 @@ public class MesBoxingErrorProofingService implements IMesBoxingErrorProofingSer } mesPackage = mesPackageRDao.insert(getMesPackage(mesPackageDetail, mesPart, qty, packingDefine,packageOneCode)); } + mesPackage.setIsPackage(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); return ResultBean.success("箱条码扫描成功,请扫零件条码!").setResultObject(mesPackage); } else { + /** + * 2024-12-23 修复bug 44242 + * 已经关箱的箱条码,如果重复扫描,不需要重置,可以扫描下一个需要装箱的条码。 + * + */ checkNotNull(mesPackageDetail); //校验零件条码是否存在 if (StringUtils.isEmpty(mesPackageDetail.getSerialNumber())) { @@ -143,8 +149,19 @@ public class MesBoxingErrorProofingService implements IMesBoxingErrorProofingSer //校验包装条码信息 MesPackage mesPackage = getMesPackageAndCheck(mesPackageDetail.getPackageNo(), mesPackageDetail.getOrganizeCode()); //校验是否已关闭 - if (CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue() == mesPackage.getIsSealed()) { - MesPcnException.throwMesBusiException("箱条码已封箱,不允许扫描零件条码,请检查数据!"); + if (CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue() == mesPackage.getIsSealed() ) { + List produceSnList = mesProduceSnExtService.getProduceSnList(mesPackageDetail.getOrganizeCode(), mesPackageDetail.getSerialNumber()); + //1.查询包装明细是否包含此零件 + List defineDetails = getMesPackingDefineDetailsNew(mesPackageDetail.getOrganizeCode(), mesPackage.getPackageSn(), mesPackage.getPartNo()); + //确保是自制件和外协件 + if ((produceSnList != null && !produceSnList.isEmpty())|| (defineDetails != null && !defineDetails.isEmpty() && StringUtils.isEmpty(defineDetails.get(0).getPackageBarcodeRule()))) { + MesPcnException.throwMesBusiException("箱条码已封箱,不允许扫描零件条码,请检查数据!"); + }else { + //扫描的是箱条码 + mesPackageDetail.setIsScanPackage(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()); + mesPackageDetail.setPackageNo(mesPackageDetail.getSerialNumber()); + return this.doScan(mesPackageDetail); + } } //校验条码规则 MesPart mesPart = getMesPartNew(mesPackageDetail, mesPackage, packingDefine); @@ -518,7 +535,7 @@ public class MesBoxingErrorProofingService implements IMesBoxingErrorProofingSer if (produceSn.getQcStatus() == MesExtEnumUtil.PRODUCE_QC_STATUS.SCRAP.getValue()){ MesPcnException.throwMesBusiException("扫描条码【%s】零件号【%s】,QC为报废状态,不能包装此零件!", mesPackage.getPackageSn(), partNo); } - //SN 条码状态 + //SN 条码状态 if (produceSn.getSnStatus() == MesExtEnumUtil.PRODUCE_SN_STATUS.UNKNOW.getValue()){ MesPcnException.throwMesBusiException("扫描条码【%s】零件号【%s】,条码状态为未知,不能包装此零件!", mesPackage.getPackageSn(), partNo); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java index bb96e2a..af27561 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesInputDefectRecordService.java @@ -114,6 +114,9 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService @Autowired private IMesPartService mesPartService; + @Autowired + private MesWorkCenterPartRelationRepository workCenterPartRelationRepository; + @Override public MesPartInspectionViewModel queryPartInspection(MesPartInspectionInputModel inputModel, String org) { @@ -225,6 +228,7 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService public void savePartInspection(MesPartInspectionInputModel model, String org) { MesProduceSn produceSn = getProduceSn(model.getSn(), org); + if (null != produceSn && StringUtils.isEmpty(model.getPartNo())) model.setPartNo(produceSn.getPartNo()); //武汉 会输入客户条码 boolean isWorkOrderQcStatus=false; if (!StringUtil.isEmpty(produceSn)){ @@ -469,8 +473,30 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService MesProductVersion version = productVersionRepository.getByProperty(ddlPackBean); if (version != null) { srcLocateNo = version.getReceiveInventoryPoint(); + } else { + //当前为初判, 生产版本不存在的情况下, 取生产线信息的材料库位, 如果没有加工记录,生产线使用产线与零件关系表的唯一生产线 + String workCenterCode; + if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) { + if (null == produceSn || StringUtils.isEmpty(produceSn.getProcessCode())) { + List workCenterPartRelationList = getWorkCenterPartRelation(org, model.getPartNo()); + if (CollectionUtils.isEmpty(workCenterPartRelationList) || workCenterPartRelationList.size() > 1 || StringUtils.isEmpty(workCenterPartRelationList.get(0).getWorkCenterCode())) { + throw new ImppBusiException(String.format("条码[%s]未查询到有效的来源库位!", model.getSn())); + } + workCenterCode = workCenterPartRelationList.get(0).getWorkCenterCode(); + } else { + workCenterCode = produceSn.getWorkCenterCode(); + } + } else { + workCenterCode = model.getWorkCenterCode(); + } + + MesWorkCenter workCenter = prodOrgExtService.getWorkCenterDb(org, workCenterCode); + if (null == workCenter) throw new ImppBusiException(String.format("条码[%s]查询来源库位时获取的生产线代码[%s]信息不存在!", model.getSn(), workCenterCode)); + if (StringUtils.isEmpty(workCenter.getRawLocate())) throw new ImppBusiException(String.format("条码[%s]查询来源库位时获取的生产线代码[%s]信息未维护[材料库位]!", model.getSn(), workCenterCode)); + srcLocateNo = workCenter.getRawLocate(); } } + if (model.getOptType() != 2) { //移库 //移库 @@ -487,8 +513,6 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService } else { - - model.getPartInspection().setInspectionStatus(MesExtEnumUtil.PART_INSPECTION_STATUS.FAIL.getValue()); ConvertBean.serviceModelUpdate(model.getPartInspection(), AuthUtil.getSessionUser().getUserName()); if (model.getOptType() != null && model.getOptType() == 2) { @@ -524,7 +548,6 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService throw new ImppBusiException(String.format("【%s】位置不存在,请检查数据", defectTypeNoExitList)); } - //若是扫描条码 则判定条码可疑 if (model.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) { @@ -583,12 +606,20 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService } } + + private List getWorkCenterPartRelation(String org, String partNo) { + return workCenterPartRelationRepository.findByProperty( + new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.PART_NO}, + new Object[]{org, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), partNo}); + } + public MesWorkOrder getWorkOrder(String organizeCode, String workOrderNo) { if (StringUtils.isEmpty(organizeCode) || StringUtils.isEmpty(workOrderNo)) return null; return workOrderRepository.getByProperty( new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.WORK_ORDER_NO}, new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workOrderNo}); } + private String getDestLocateNo(MesPartInspectionInputModel model, String org) { DdlPackBean packBean = DdlPackBean.getDdlPackBean(org); DdlPreparedPack.getStringEqualPack(model.getSn(), "productSn", packBean); @@ -1055,12 +1086,12 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService DdlPackBean packBean = DdlPackBean.getDdlPackBean(org); DdlPreparedPack.getStringEqualPack(defectTypeCodeStr, "defectTypeCode", packBean); MesDefectType defectType = defectTypeRepository.getByProperty(packBean); + if (null == defectType) MesPcnException.throwBusiException(String.format("未配置[%s]对应的可疑品缺陷类型!", defectTypeCodeStr)); partInspection.setDefectTypeCode(defectType.getDefectTypeCode()); partInspection.setDefectTypeId(defectType.getId()); ConvertBean.serviceModelInitialize(partInspection, model.getUserInfo()); partInspection = partInspectionRepository.insert(partInspection); - log.info("生成的缺陷记录id ={}", partInspection); MesPartInspectionDetail detail = new MesPartInspectionDetail(); @@ -1075,26 +1106,38 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService detail.setOrganizeCode(org); ConvertBean.serviceModelInitialize(detail, model.getUserInfo()); partInspectionDetailRepository.insert(detail); - // - String source = configService.getCfgValue(org, "LGORT"); + //查询来源/目标库位 + MesConfig sourceCfg = configService.getMesConfigNoError(org, "LGORT"); + MesConfig targetCfg = configService.getMesConfigNoError(org, "UMLGO"); + String source = (null != sourceCfg && !StringUtils.isEmpty(sourceCfg.getCfgValue())) ? sourceCfg.getCfgValue() : null; + String target = (null != targetCfg && !StringUtils.isEmpty(targetCfg.getCfgValue())) ? targetCfg.getCfgValue() : null; + if (StringUtils.isEmpty(target)) MesPcnException.throwBusiException(String.format("系统配置缺失目标库位配置[%s]!", "UMLGO")); //移库 String partNo = model.getPartNo(); // 查询生产版本 String workCenterCode = model.getWorkCenterCode(); String productVersion = model.getProductVersion(); - + MesProductVersion version = null; if (!StringUtils.isEmpty(productVersion)) { DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(org); DdlPreparedPack.getStringEqualPack(partNo, "partNo", ddlPackBean); DdlPreparedPack.getStringEqualPack(workCenterCode, "workCenterCode", ddlPackBean); DdlPreparedPack.getStringEqualPack(productVersion, "productVersion", ddlPackBean); - MesProductVersion version = productVersionRepository.getByProperty(ddlPackBean); + version = productVersionRepository.getByProperty(ddlPackBean); if (version != null) { source = version.getShipInventoryPoint(); } } - MesMove move = createMove(model, source, configService.getCfgValue(org, "UMLGO"), org, model.getWorkCenterCode()); + + //生产版本不存在的情况下, 取生产线信息的材料库位 + if (null == version) { + MesWorkCenter workCenter = prodOrgExtService.getWorkCenterDb(org, workCenterCode); + if (null != workCenter && !StringUtils.isEmpty(workCenter.getRawLocate())) source = workCenter.getRawLocate(); + } + + if (StringUtils.isEmpty(source)) MesPcnException.throwBusiException("未找到来源库位!"); + MesMove move = createMove(model, source, target, org, model.getWorkCenterCode()); moveRepository.insert(move); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesPartShippingGroupService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesPartShippingGroupService.java index 9a00b89..22efbbf 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesPartShippingGroupService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesPartShippingGroupService.java @@ -94,4 +94,13 @@ public class MesPartShippingGroupService implements IMesPartShippingGroupService DdlPreparedPack.getStringEqualPack(custPartNo, "custPartNo", packBean); return mesPartShippingGroupDetailRepository.getByProperty(packBean); } + + @Override + public MesPartShippingGroupDetail getMesPartShippingGroupDetailByPartNo(String organizeCode, String shippingGroupCode, String partNo) { + if(StringUtil.isEmpty(organizeCode) || StringUtil.isEmpty(shippingGroupCode) || StringUtil.isEmpty(partNo)) return null; + DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode); + DdlPreparedPack.getStringEqualPack(shippingGroupCode, "shippingGroupCode", packBean); + DdlPreparedPack.getStringEqualPack(partNo, "partNo", packBean); + return mesPartShippingGroupDetailRepository.getByProperty(packBean); + } } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesProduceSnExtService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesProduceSnExtService.java index 751a1ff..0e1dee5 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesProduceSnExtService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesProduceSnExtService.java @@ -79,6 +79,16 @@ public class MesProduceSnExtService implements IMesProduceSnExtService { return produceSnList.stream().filter(o -> null != o).sorted(Comparator.comparing(MesProduceSn::getCreateDatetime).reversed()).collect(Collectors.toList()); } + //根据产品条码查询零件条码信息[非排序],创建时间最新 + @Override + public MesProduceSn getProduceSnCreateDatetimeDesc(String organizeCode, String productSn) { + if (StringUtils.isEmpty(organizeCode) || StringUtils.isEmpty(productSn)) return null; + DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode); + DdlPreparedPack.getStringEqualPack(productSn, MesPcnExtConstWords.PRODUCT_SN, packBean); + DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{MesPcnExtConstWords.CREATE_DATE_TIME}, packBean); + return produceSnRepository.getByProperty(packBean); + } + //根据客户条码查询零件条码信息[排序] @Override public MesProduceSn getProduceSnByCustSn(String organizeCode, String custSn) { @@ -210,7 +220,7 @@ public class MesProduceSnExtService implements IMesProduceSnExtService { DdlPackBean packBean = DdlPackBean.getDdlPackBean(reqBean.getOrganizeCode()); if (idList.size() == 1) DdlPreparedPack.getNumEqualPack(idList.get(0), MesPcnExtConstWords.ID, packBean); else DdlPreparedPack.getInPackList(idList, MesPcnExtConstWords.ID, packBean); - produceSnRepository.updateByProperties( + produceSnRepository.updateByPropertiesNoSync( new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.WORK_CENTER_CODE, MesPcnExtConstWords.WORK_CELL_CODE, MesPcnExtConstWords.SN_STATUS}, new Object[]{reqBean.getUserInfo(), TimeTool.getNowTime(true), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), snStatus}, packBean); @@ -218,6 +228,15 @@ public class MesProduceSnExtService implements IMesProduceSnExtService { } @Override + public void saveProduceSntatusByDdlPackBean(DdlPackBean packBean, String userInfo, Integer snStatus) { + if (StringUtils.isEmpty(userInfo) || StringUtils.isEmpty(snStatus)) return; + produceSnRepository.updateByPropertiesNoSync( + new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.SN_STATUS}, + new Object[]{userInfo, TimeTool.getNowTime(true), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), snStatus}, + packBean); + } + + @Override @MonitorLog public MesProduceSn insert(MesProduceSn item) { return produceSnRepository.insert(item); @@ -245,4 +264,10 @@ public class MesProduceSnExtService implements IMesProduceSnExtService { List resultList = produceSnRepository.findByHqlWherePage(packBean, pager); return new ListPager<>(resultList, pager); } + + @Override + public String queryPartNoByProduceSn(String productSn, String organizeCode) { + MesProduceSn produceSn = getProduceSnCreateDatetimeDesc(organizeCode, productSn); + return null == produceSn ? "" : produceSn.getPartNo(); + } } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesProductionRecordService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesProductionRecordService.java index 916b1e0..847d0d2 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesProductionRecordService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesProductionRecordService.java @@ -68,6 +68,14 @@ public class MesProductionRecordService implements IMesProductionRecordService { new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), productSn}); } + @Override + public Integer findFrontProcessProductionRecord(String organizeCode, String productSn, String craftCode) { + if (StringUtils.isEmpty(organizeCode) || StringUtils.isEmpty(productSn) || StringUtils.isEmpty(craftCode)) return null; + return productionRecordRepository.findByPropertyCount( + new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.PRODUCT_SN, MesPcnExtConstWords.CRAFT_CODE}, + new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), productSn, craftCode}); + } + //查询加工记录, 根据完成时间倒序 @Override public List findProductionRecordListCompleteDateTimeDesc(String organizeCode, String productSn) { diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesSortShippingCheckService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesSortShippingCheckService.java index c96d81a..b3c28d4 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesSortShippingCheckService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesSortShippingCheckService.java @@ -159,6 +159,23 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService skipShippingDetails(model, model.getUserInfo(), orderManagement); //扫描条码 } else { + /** + * 修复bug 44253 by castle 同Pisces,零件发运组/发运组明细可以实现“前道工艺”校验 + * 逻辑: + * + * 1.查询零件发运组 + * + * 2.查询对应零件发运组详情 + * + * 3.根据条码查询有没有在条码表中,用于判断是自制件,有则为自制件 + * + * 4.自制件需要查看明细是否维护了 前道工艺,如果维护了则需要校验前道工艺有没有加工记录;如果明细没有维护,则找零件发运组是否维护了,维护则需要校验;两者都没有维护,则不需要校验 + * + * 5.外协件不需要校验前道工艺 + */ + if(!checkFrontProcess(model, shippingGroup)){ + MesPcnException.throwMesBusiException("条码【%s】前道校验未通过,请检查数据",model.getSn()); + } if (StringUtils.isEmpty(shippingGroup.getConfirmPartType())) { MesPcnException.throwMesBusiException("零件发运组【%s】扫描确认方式未维护,请检查数据!"); } @@ -174,6 +191,41 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService return model; } + private boolean checkFrontProcess(MesSortShippingCheckModel model,MesPartShippingGroup shippingGroup){ + boolean flag = false; + String organizeCode = model.getOrganizeCode(); + //1.首先校验自制件 + DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode); + DdlPreparedPack.getStringEqualPack(model.getSn(), "productSn", packBean); + DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, packBean); + MesProduceSn produceSn = produceSnRepository.getByProperty(packBean); + + if (Objects.isNull(produceSn)) { + //外协件不需要校验前道工艺 + flag = true; + }else{ + //自制件校验前道工艺 零件发运组详情中的优先 + MesPartShippingGroupDetail groupDetail = mesPartShippingGroupService.getMesPartShippingGroupDetailByPartNo(organizeCode, shippingGroup.getShippingGroupCode(), produceSn.getPartNo()); + if (null == groupDetail) return true; + if (!StringUtils.isEmpty(groupDetail.getFrontProcessCode())){ + Integer count = mesProductionRecordService.findFrontProcessProductionRecord(organizeCode, produceSn.getProductSn(), groupDetail.getFrontProcessCode()); + if (count > 0){ + flag = true; + } + }else if (!StringUtils.isEmpty(shippingGroup.getFrontProcessCode())){ + Integer count = mesProductionRecordService.findFrontProcessProductionRecord(organizeCode, produceSn.getProductSn(), shippingGroup.getFrontProcessCode()); + if (count > 0){ + flag = true; + } + }else { + //如果都没有 + flag = true; + } + } + return flag; + } + + @Override public MesSortShippingCheckModel saveSnAndLocationCode(MesSortShippingCheckModel model, String organizeCode, String userInfo) { //校验条码 diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/recyclablepackage/MesRecyclablePackageBindingServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/recyclablepackage/MesRecyclablePackageBindingServiceImpl.java index 108c500..c259f11 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/recyclablepackage/MesRecyclablePackageBindingServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/recyclablepackage/MesRecyclablePackageBindingServiceImpl.java @@ -21,6 +21,7 @@ import cn.estsh.i3plus.pojo.mes.bean.recyclablepackage.*; import cn.estsh.i3plus.pojo.mes.repository.recyclablepackage.MesRecyclablePackageBindingDetailRepository; import cn.estsh.i3plus.pojo.mes.repository.recyclablepackage.MesRecyclablePackageBindingRepository; import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; +import cn.estsh.impp.framework.boot.util.ResultBean; import cn.estsh.impp.framework.boot.util.SpringContextsUtil; import cn.estsh.impp.framework.boot.util.ValidatorBean; import lombok.extern.slf4j.Slf4j; @@ -137,35 +138,40 @@ public class MesRecyclablePackageBindingServiceImpl implements IMesRecyclablePac } @Override - public MesRecyclablePackageBinding doScan(MesRecyclablePackageBindingModel mesRecyclablePackageBindingModel) { + public ResultBean doScan(MesRecyclablePackageBindingModel mesRecyclablePackageBindingModel) { MesRecyclablePackageBinding mesRecyclablePackageBinding = null; + String msg = MesPcnExtConstWords.EMPTY; switch (mesRecyclablePackageBindingModel.getType()) { //扫描包条码 case 10: mesRecyclablePackageBinding = doScanPackageSn(mesRecyclablePackageBindingModel); + msg = String.format("料包条码[%s]扫描成功!", mesRecyclablePackageBindingModel.getPackageSn()); break; //扫描零件条码 case 20: mesRecyclablePackageBinding = doScanProductSn(mesRecyclablePackageBindingModel); + msg = String.format("零件条码[%s]扫描成功!", mesRecyclablePackageBindingModel.getProductSn()); break; //清空 case 30: mesRecyclablePackageBinding = deletedMesRecyclablePackageBindingDetail(mesRecyclablePackageBindingModel, true); + msg = String.format("料包条码[%s]清空成功!", mesRecyclablePackageBindingModel.getPackageSn()); break; //删除 case 40: mesRecyclablePackageBinding = deletedMesRecyclablePackageBindingDetail(mesRecyclablePackageBindingModel, false); + msg = "删除成功!"; break; //关箱 case 50: mesRecyclablePackageBinding = updateClosePackageBinding(mesRecyclablePackageBindingModel); + msg = String.format("料包条码[%s]关箱成功,请扫描下一箱!", mesRecyclablePackageBindingModel.getPackageSn()); break; default: MesPcnException.throwMesBusiException("扫描类型【%s】不存在", mesRecyclablePackageBindingModel.getType()); break; } - return mesRecyclablePackageBinding; - + return ResultBean.success(msg).setResultObject(mesRecyclablePackageBinding); } @Override @@ -201,7 +207,7 @@ public class MesRecyclablePackageBindingServiceImpl implements IMesRecyclablePac //校验箱 MesRecyclablePackageBinding mesRecyclablePackageBinding = getPackageBinding(mesRecyclablePackageBindingModel.getOrganizeCode(), mesRecyclablePackageBindingModel.getPackageSn()); if (MesExtEnumUtil.RECYCLABLE_PACKAGE_PACKAGE_BINDING_STATUS.CLOSED.getValue() == mesRecyclablePackageBinding.getStatus()) { - MesPcnException.throwMesBusiException("包条码【%s】已关箱", mesRecyclablePackageBinding.getPackageSn()); + MesPcnException.throwMesBusiException("料包条码【%s】已关箱", mesRecyclablePackageBinding.getPackageSn()); } //校验零件条码是否扫描 checkIsScan(mesRecyclablePackageBindingModel); @@ -350,10 +356,10 @@ public class MesRecyclablePackageBindingServiceImpl implements IMesRecyclablePac private MesRecyclablePackageBinding updateClosePackageBinding(MesRecyclablePackageBindingModel mesRecyclablePackageBindingModel) { MesRecyclablePackageBinding mesRecyclablePackageBinding = getPackageBinding(mesRecyclablePackageBindingModel.getOrganizeCode(), mesRecyclablePackageBindingModel.getPackageSn()); if (MesExtEnumUtil.RECYCLABLE_PACKAGE_PACKAGE_BINDING_STATUS.CLOSED.getValue() == mesRecyclablePackageBinding.getStatus()) { - MesPcnException.throwMesBusiException("包条码【%s】已关,不能重复关箱,请重新扫描", mesRecyclablePackageBinding.getPackageSn()); + MesPcnException.throwMesBusiException("料包条码【%s】已关,不能重复关箱,请重新扫描", mesRecyclablePackageBinding.getPackageSn()); } if (findMesRecyclablePackageBindingDetailByPidCount(mesRecyclablePackageBinding.getOrganizeCode(), mesRecyclablePackageBinding.getId()) <= MesPcnExtConstWords.ZERO) { - MesPcnException.throwMesBusiException("包条码【%s】明细不能为空,请扫描零件明细", mesRecyclablePackageBinding.getPackageSn()); + MesPcnException.throwMesBusiException("料包条码【%s】明细不能为空,请扫描零件明细", mesRecyclablePackageBinding.getPackageSn()); } //更新未关箱状态 mesRecyclablePackageBinding.setStatus(MesExtEnumUtil.RECYCLABLE_PACKAGE_PACKAGE_BINDING_STATUS.CLOSED.getValue()); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingScanSnStrategyServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingScanSnStrategyServiceImpl.java index d4446d5..64ad98a 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingScanSnStrategyServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingScanSnStrategyServiceImpl.java @@ -92,6 +92,8 @@ public class MesShippingScanSnStrategyServiceImpl implements IMesShippingScanStr } private void checkShippingDetails(MesSortShippingCheckModel model, MesShippingOrderManagement orderManagement, MesPartShippingGroup shippingGroup, MesProduceSn produceSn, MesShippingOrderManagementDetail detail) { + + //校验发运单明细顺序 if (!Objects.isNull(shippingGroup) && !StringUtils.isEmpty(shippingGroup.getIsEnableShippingFailSafe()) && CommonEnumUtil.VALID == shippingGroup.getIsEnableShippingFailSafe()) { Optional first = model.getDetailList().stream().filter(k -> k.getCustInfoSeq().compareTo(detail.getCustInfoSeq()) < 0 && !Objects.equals(k.getIsScanFlg(), MesCommonConstant.TRUE_INTEGER)).findFirst(); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/numberrule/MesDPBarcodeSubStringPartSnParamWhNumberRuleStrategyService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/numberrule/MesDPBarcodeSubStringPartSnParamWhNumberRuleStrategyService.java new file mode 100644 index 0000000..3b4854b --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/numberrule/MesDPBarcodeSubStringPartSnParamWhNumberRuleStrategyService.java @@ -0,0 +1,69 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.numberrule; + +import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException; +import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; +import cn.estsh.i3plus.mes.pcn.api.iservice.base.IPartService; +import cn.estsh.i3plus.mes.pcn.api.iservice.busi.INumberRulePackAttributeStrategyService; +import cn.estsh.i3plus.platform.common.tool.TimeTool; +import cn.estsh.i3plus.pojo.mes.bean.MesPart; +import cn.estsh.i3plus.pojo.mes.model.GenSerialNoModel; +import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import java.util.Date; +import java.util.Map; +import java.util.StringJoiner; + +/** + * @Description : 门板及cnsl总成条码 + * @Reference : + * @Author : junsheng.li + * @CreateDate 2024/9/27 13:23 + * @Modify: + **/ +@Component +public class MesDPBarcodeSubStringPartSnParamWhNumberRuleStrategyService implements INumberRulePackAttributeStrategyService { + + @Autowired + private IPartService partService; + + @Override + public GenSerialNoModel execute(GenSerialNoModel genSerialNoModel) { + + if (null == genSerialNoModel) MesPcnException.throwBusiException("入参缺少[GenSerialNoModel]!"); + + Map dataMap = genSerialNoModel.getDataMap(); + + MesPart part = (!CollectionUtils.isEmpty(dataMap) && dataMap.containsKey(MesPart.class.getSimpleName())) ? + (MesPart)dataMap.get(MesPart.class.getSimpleName()) : partService.getPartByNo(genSerialNoModel.getOrganizeCode(), genSerialNoModel.getPartNo()); + if (null == part) MesPcnException.throwBusiException("请检查零件信息,零件号[%s]信息不存在!", genSerialNoModel.getPartNo()); + if (StringUtils.isEmpty(part.getPartSnParam())) MesPcnException.throwBusiException("请检查零件信息,零件号[%s]未维护零件条码参数!", part.getPartNo()); + if (part.getPartSnParam().length() < 4) MesPcnException.throwBusiException("请检查零件信息,零件号[%s]维护零件条码参数[%s]长度小于4!", part.getPartNo(), part.getPartSnParam()); + if (StringUtils.isEmpty(genSerialNoModel.getShiftCode())) MesPcnException.throwBusiException("入参缺少班次代码!"); + + genSerialNoModel.partSnParam(part.getPartSnParam()) + .dynamicRule(new StringJoiner(MesPcnExtConstWords.COMMA).add(part.getPartSnParam().substring(part.getPartSnParam().length() - 4)).add(genSerialNoModel.getShiftCode()).toString()); + //年月日缩写 + Date date = new Date(); + genSerialNoModel.setYear(getYearShort(date)); + genSerialNoModel.setMonth(getMonthShort(date)); + genSerialNoModel.setDay(getDayShort(date)); + return genSerialNoModel; + } + + private String getYearShort(Date date) { + return MesExtEnumUtil.YEAR_SHORT.valueOfDescription(Integer.parseInt(TimeTool.getYear(date))); + } + + private String getMonthShort(Date date) { + return MesExtEnumUtil.MONTH_SHORT.valueOfDescription(Integer.parseInt(TimeTool.getMonth(date))); + } + + private String getDayShort(Date date) { + return TimeTool.getDay(date); + } + +} diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/numberrule/MesDPBarcodeWhNumberRuleStrategyService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/numberrule/MesDPBarcodeWhNumberRuleStrategyService.java index eb9e35c..78615d8 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/numberrule/MesDPBarcodeWhNumberRuleStrategyService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/numberrule/MesDPBarcodeWhNumberRuleStrategyService.java @@ -1,14 +1,14 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.numberrule; +import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesCustomerPartService; import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException; import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; +import cn.estsh.i3plus.mes.pcn.api.iservice.base.IPartService; import cn.estsh.i3plus.mes.pcn.api.iservice.busi.INumberRulePackAttributeStrategyService; import cn.estsh.i3plus.platform.common.tool.TimeTool; -import cn.estsh.i3plus.pojo.base.bean.DdlPackBean; -import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack; import cn.estsh.i3plus.pojo.mes.bean.MesCustomerPart; +import cn.estsh.i3plus.pojo.mes.bean.MesPart; import cn.estsh.i3plus.pojo.mes.model.GenSerialNoModel; -import cn.estsh.i3plus.pojo.mes.repository.MesCustomerPartRepository; import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -17,7 +17,6 @@ import org.springframework.util.StringUtils; import java.util.Date; import java.util.Map; -import java.util.Objects; import java.util.StringJoiner; /** @@ -31,21 +30,35 @@ import java.util.StringJoiner; public class MesDPBarcodeWhNumberRuleStrategyService implements INumberRulePackAttributeStrategyService { @Autowired - private MesCustomerPartRepository customerPartRepository; + private IPartService partService; + + @Autowired + private IMesCustomerPartService customerPartService; @Override public GenSerialNoModel execute(GenSerialNoModel genSerialNoModel) { - //获取客户零件号 + + if (null == genSerialNoModel) MesPcnException.throwBusiException("入参缺少[GenSerialNoModel]!"); + Map dataMap = genSerialNoModel.getDataMap(); - MesCustomerPart customerPart = (!CollectionUtils.isEmpty(dataMap) && dataMap.containsKey(MesCustomerPart.class.getSimpleName())) ? - (MesCustomerPart) dataMap.get(MesCustomerPart.class.getSimpleName()) : getMesCustomerPart(genSerialNoModel.getOrganizeCode(), genSerialNoModel.getPartNo()); - if (StringUtils.isEmpty(genSerialNoModel.getShiftCode()) || Objects.isNull(customerPart)) { - MesPcnException.throwMesBusiException("班次代码或客户零件号未维护"); - } - genSerialNoModel.setCustPartNo(customerPart.getCustPartNo()); - genSerialNoModel.setDynamicRule(new StringJoiner(MesPcnExtConstWords.COMMA).add(customerPart.getCustPartNo().substring(customerPart.getCustPartNo().length() - 4)).add(genSerialNoModel.getShiftCode()).toString()); - Date date = new Date(); + + MesPart part = (!CollectionUtils.isEmpty(dataMap) && dataMap.containsKey(MesPart.class.getSimpleName())) ? + (MesPart) dataMap.get(MesPart.class.getSimpleName()) : partService.getPartByNo(genSerialNoModel.getOrganizeCode(), genSerialNoModel.getPartNo()); + + MesCustomerPart customerPart = (!CollectionUtils.isEmpty(dataMap) && dataMap.containsKey(MesCustomerPart.class.getSimpleName())) + ? (MesCustomerPart) dataMap.get(MesCustomerPart.class.getSimpleName()) + : customerPartService.getMesCustomerPart(genSerialNoModel.getOrganizeCode(), genSerialNoModel.getPartNo()); + + if (null == part) MesPcnException.throwBusiException("请检查零件信息,零件[%s]信息不存在!", genSerialNoModel.getPartNo()); + if (null == customerPart) MesPcnException.throwBusiException("请检查客户零件信息,零件号[%s]对应的客户零件信息不存在!", genSerialNoModel.getPartNo()); + if (StringUtils.isEmpty(customerPart.getCustPartNo())) MesPcnException.throwBusiException("请检查客户零件信息,零件号[%s]对应的客户零件信息未维护客户零件号!", part.getPartNo()); + if (customerPart.getCustPartNo().length() < 4) MesPcnException.throwBusiException("请检查客户零件信息,零件号[%s]对应的客户零件号[%s]长度小于4!", part.getPartNo(), customerPart.getCustPartNo()); + if (StringUtils.isEmpty(genSerialNoModel.getShiftCode())) MesPcnException.throwBusiException("入参缺少班次代码!"); + + genSerialNoModel.partSnParam(part.getPartSnParam()) + .dynamicRule(new StringJoiner(MesPcnExtConstWords.COMMA).add(customerPart.getCustPartNo().substring(customerPart.getCustPartNo().length() - 4)).add(genSerialNoModel.getShiftCode()).toString()); //年月日缩写 + Date date = new Date(); genSerialNoModel.setYear(getYearShort(date)); genSerialNoModel.setMonth(getMonthShort(date)); genSerialNoModel.setDay(getDayShort(date)); @@ -64,14 +77,4 @@ public class MesDPBarcodeWhNumberRuleStrategyService implements INumberRulePackA return TimeTool.getDay(date); } - private MesCustomerPart getMesCustomerPart(String orgaizeCode, String partNo) { - if (StringUtils.isEmpty(orgaizeCode) || StringUtils.isEmpty(partNo)) return null; - DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(orgaizeCode); - DdlPreparedPack.getStringEqualPack(partNo, MesPcnExtConstWords.ERP_PART_NO, ddlPackBean); - MesCustomerPart customerPart = customerPartRepository.getByProperty(ddlPackBean); - if (Objects.isNull(customerPart)) { - MesPcnException.throwMesBusiException("物料【%s】客户零件关系未维护", partNo); - } - return customerPart; - } } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/MesDPBarcodeSubStringPartSnParamWhPrintStrategy.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/MesDPBarcodeSubStringPartSnParamWhPrintStrategy.java new file mode 100644 index 0000000..e21ac53 --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/MesDPBarcodeSubStringPartSnParamWhPrintStrategy.java @@ -0,0 +1,158 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.print.strategy; + +import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesCustomerPartService; +import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesPrintedSnLogService; +import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.print.IPrintTemplateStrategyService; +import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException; +import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesProduceSnPrintDataModel; +import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesProduceSnPrintModel; +import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; +import cn.estsh.i3plus.mes.pcn.api.iservice.base.IPartService; +import cn.estsh.i3plus.mes.pcn.api.iservice.busi.ISyncFuncService; +import cn.estsh.i3plus.mes.pcn.util.DateUtil; +import cn.estsh.i3plus.platform.common.convert.ConvertBean; +import cn.estsh.i3plus.platform.common.tool.TimeTool; +import cn.estsh.i3plus.pojo.base.codemaker.SnowflakeIdMaker; +import cn.estsh.i3plus.pojo.mes.bean.MesNumberRule; +import cn.estsh.i3plus.pojo.mes.bean.MesPart; +import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn; +import cn.estsh.i3plus.pojo.mes.model.GenSerialNoModel; +import cn.estsh.i3plus.pojo.mes.model.StationRequestBean; +import cn.estsh.i3plus.pojo.mes.model.StepResult; +import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; + +/** + * @Description :门板及cnsl总成条码(单件) + * @Reference : + * @Author : junsheng.li + * @CreateDate 2024/9/26 18:20 + * @Modify: + **/ +@Component +@Slf4j +public class MesDPBarcodeSubStringPartSnParamWhPrintStrategy implements IPrintTemplateStrategyService { + + @Autowired + private ISyncFuncService syncFuncService; + + @Autowired + private SnowflakeIdMaker snowflakeIdMaker; + + @Autowired + private IPartService partService; + + @Autowired + private IMesPrintedSnLogService mesPrintedSnLogService; + + @Autowired + private IMesCustomerPartService mesCustomerPartService; + + @Override + public MesProduceSnPrintModel execute(GenSerialNoModel genSerialNoModel, MesProduceSnPrintModel mesProduceSnPrintModel, MesNumberRule numberRule, StepResult stepResult, StationRequestBean reqBean, Boolean isStep) { + + Map dataMap = null == genSerialNoModel ? null : genSerialNoModel.getDataMap(); + + MesPart part = (!CollectionUtils.isEmpty(dataMap) && dataMap.containsKey(MesPart.class.getSimpleName())) + ? (MesPart)dataMap.get(MesPart.class.getSimpleName()) + : partService.getPartByNo(mesProduceSnPrintModel.getOrganizeCode(), mesProduceSnPrintModel.getPartNo()); + + if (!isStep){ + + if (null == genSerialNoModel) MesPcnException.throwBusiException("入参缺少[GenSerialNoModel]!"); + + if (null == part) MesPcnException.throwBusiException("请检查零件信息,零件号[%s]信息不存在!", genSerialNoModel.getPartNo()); + if (StringUtils.isEmpty(part.getPartSnParam())) MesPcnException.throwBusiException("请检查零件信息,零件号[%s]未维护零件条码参数!", part.getPartNo()); + if (part.getPartSnParam().length() < 4) MesPcnException.throwBusiException("请检查零件信息,零件号[%s]维护零件条码参数[%s]长度小于4!", part.getPartNo(), part.getPartSnParam()); + if (StringUtils.isEmpty(genSerialNoModel.getShiftCode())) MesPcnException.throwBusiException("入参缺少班次代码!"); + + if (CollectionUtils.isEmpty(dataMap) || !dataMap.containsKey(MesPart.class.getSimpleName())) genSerialNoModel.putDataMap(MesPart.class.getSimpleName(), part); + genSerialNoModel.partSnParam(part.getPartSnParam()) + .dynamicRule(new StringJoiner(MesPcnExtConstWords.COMMA).add(part.getPartSnParam().substring(part.getPartSnParam().length() - 4)).add(genSerialNoModel.getShiftCode()).toString()); + //年月日缩写 + Date date = new Date(); + genSerialNoModel.setYear(getYearShort(date)); + genSerialNoModel.setMonth(getMonthShort(date)); + genSerialNoModel.setDay(getDayShort(date)); + + List productSnList = syncFuncService.syncSerialNo(genSerialNoModel, mesProduceSnPrintModel.getUserName(), mesProduceSnPrintModel.getOrganizeCode(), mesProduceSnPrintModel.getPrintQty()).getResultList(); + if (CollectionUtils.isEmpty(productSnList)) MesPcnException.throwBusiException("根据编码规则[%s]生成零件条码失败!", genSerialNoModel.getRuleCode()); + for (Object productSn : productSnList) { + //保存条码信息 + MesProduceSn produceSn = generateMesProduceSn(part, productSn.toString(), mesProduceSnPrintModel.getUserName(), mesProduceSnPrintModel.getQty()); + //封装打印信息 + MesProduceSnPrintDataModel printDataModel = getModel(produceSn, part); + mesProduceSnPrintModel.getMesProduceSnPrintDataModelList().add(printDataModel); + mesProduceSnPrintModel.getMesProduceSnList().add(produceSn); + //保存打印记录 + mesProduceSnPrintModel.getMesPrintedSnLogList().add(mesPrintedSnLogService.getMesPrintedSnLog(mesProduceSnPrintModel.getUserName(), mesProduceSnPrintModel.getOrganizeCode(), printDataModel)); + } + }else{ + MesProduceSn mesProduceSn = mesProduceSnPrintModel.getMesProduceSnList().get(0); + //封装打印信息 + MesProduceSnPrintDataModel printDataModel = getModel(mesProduceSn, part); + mesProduceSnPrintModel.getMesProduceSnPrintDataModelList().add(printDataModel); + //保存打印记录 + mesProduceSnPrintModel.getMesPrintedSnLogList().add(mesPrintedSnLogService.getMesPrintedSnLog(mesProduceSnPrintModel.getUserName(), mesProduceSnPrintModel.getOrganizeCode(), printDataModel)); + } + return mesProduceSnPrintModel; + } + + private MesProduceSn generateMesProduceSn(MesPart mesPart, String sn, String userName, Double qty) { + MesProduceSn mesProduceSn = new MesProduceSn(); + mesProduceSn.setSerialNumber(snowflakeIdMaker.nextId() + ""); + mesProduceSn.setProductSn(sn); + mesProduceSn.setCustSn(sn); + mesProduceSn.setPartNo(mesPart.getPartNo()); + mesProduceSn.setPartName(mesPart.getPartName()); + mesProduceSn.setProcessLabelTemplate(mesPart.getProcessLabelTemplate()); + mesProduceSn.setCustLabelTemplate(mesPart.getCustLabelTemplate()); + mesProduceSn.setProdLabelTemplate(mesPart.getProductLabelTemplate()); + mesProduceSn.setQty(qty); + mesProduceSn.setSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.CREATE.getValue()); + mesProduceSn.setQcStatus(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue()); + mesProduceSn.setLotNo(TimeTool.getToday()); + mesProduceSn.setPrintCount(MesPcnExtConstWords.ONE); + mesProduceSn.setPrintStatus(MesExtEnumUtil.PRINT_STATUS.PRINTED.getValue()); + mesProduceSn.setOrganizeCode(mesPart.getOrganizeCode()); + ConvertBean.serviceModelInitialize(mesProduceSn, userName); + return mesProduceSn; + } + + private MesProduceSnPrintDataModel getModel(MesProduceSn produceSn, MesPart part) { + MesProduceSnPrintDataModel mesProduceSnPrintDataModel = new MesProduceSnPrintDataModel(); + mesProduceSnPrintDataModel.setPartNo(produceSn.getPartNo()); + mesProduceSnPrintDataModel.setPartName(produceSn.getPartName()); + if (null != part && !StringUtils.isEmpty(part.getPartSnParam()) && part.getPartSnParam().length() >= 4) { + mesProduceSnPrintDataModel.setCustPartNo(part.getPartSnParam().substring(0, 4)); + mesProduceSnPrintDataModel.setCustPartNo1(part.getPartSnParam().substring(part.getPartSnParam().length() - 4)); + } + mesProduceSnPrintDataModel.setBarcode(produceSn.getProductSn()); + mesProduceSnPrintDataModel.setPrintDate(TimeTool.getNowTime(true)); + mesProduceSnPrintDataModel.setUserName(produceSn.getCreateUser()); + mesProduceSnPrintDataModel.setProductDate(TimeTool.parseStringFormat(produceSn.getLotNo(), DateUtil.SHORT_FORMAT, "yyyy/MM/dd")); + return mesProduceSnPrintDataModel; + } + + private String getYearShort(Date date) { + return MesExtEnumUtil.YEAR_SHORT.valueOfDescription(Integer.parseInt(TimeTool.getYear(date))); + } + + private String getMonthShort(Date date) { + return MesExtEnumUtil.MONTH_SHORT.valueOfDescription(Integer.parseInt(TimeTool.getMonth(date))); + } + + private String getDayShort(Date date) { + return TimeTool.getDay(date); + } + +} diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/MesDPBarcodeWhPrintStrategy.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/MesDPBarcodeWhPrintStrategy.java index db75b50..e09c2d2 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/MesDPBarcodeWhPrintStrategy.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/MesDPBarcodeWhPrintStrategy.java @@ -1,13 +1,13 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.print.strategy; import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesCustomerPartService; -import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesPartService; import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesPrintedSnLogService; import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.print.IPrintTemplateStrategyService; import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException; import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesProduceSnPrintDataModel; import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesProduceSnPrintModel; import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; +import cn.estsh.i3plus.mes.pcn.api.iservice.base.IPartService; import cn.estsh.i3plus.mes.pcn.api.iservice.busi.ISyncFuncService; import cn.estsh.i3plus.mes.pcn.util.DateUtil; import cn.estsh.i3plus.platform.common.convert.ConvertBean; @@ -27,7 +27,7 @@ import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; -import java.util.Objects; +import java.util.*; /** * @Description :门板及cnsl总成条码(单件) @@ -47,34 +47,58 @@ public class MesDPBarcodeWhPrintStrategy implements IPrintTemplateStrategyServic private SnowflakeIdMaker snowflakeIdMaker; @Autowired - private IMesPartService mesPartService; + private IPartService partService; @Autowired private IMesPrintedSnLogService mesPrintedSnLogService; @Autowired - private IMesCustomerPartService mesCustomerPartService; + private IMesCustomerPartService customerPartService; @Override public MesProduceSnPrintModel execute(GenSerialNoModel genSerialNoModel, MesProduceSnPrintModel mesProduceSnPrintModel, MesNumberRule numberRule, StepResult stepResult, StationRequestBean reqBean, Boolean isStep) { - String organizeCode = mesProduceSnPrintModel.getOrganizeCode(); - //物料信息 - MesPart mesPart = mesPartService.getMesPartByPartNo(mesProduceSnPrintModel.getPartNo(), organizeCode); - MesCustomerPart customerPart = (!Objects.isNull(genSerialNoModel) && !CollectionUtils.isEmpty(genSerialNoModel.getDataMap()) && genSerialNoModel.getDataMap().containsKey(MesCustomerPart.class.getSimpleName())) ? (MesCustomerPart) genSerialNoModel.getDataMap().get(MesCustomerPart.class.getSimpleName()) : mesCustomerPartService.getMesCustomerPart(organizeCode,mesProduceSnPrintModel.getPartNo()); + + Map dataMap = null == genSerialNoModel ? null : genSerialNoModel.getDataMap(); + + MesPart part = (!CollectionUtils.isEmpty(dataMap) && dataMap.containsKey(MesPart.class.getSimpleName())) + ? (MesPart) dataMap.get(MesPart.class.getSimpleName()) + : partService.getPartByNo(mesProduceSnPrintModel.getOrganizeCode(), mesProduceSnPrintModel.getPartNo()); + + MesCustomerPart customerPart = (!CollectionUtils.isEmpty(dataMap) && dataMap.containsKey(MesCustomerPart.class.getSimpleName())) + ? (MesCustomerPart) dataMap.get(MesCustomerPart.class.getSimpleName()) + : customerPartService.getMesCustomerPart(mesProduceSnPrintModel.getOrganizeCode(), mesProduceSnPrintModel.getPartNo()); + if (!isStep){ - if (StringUtils.isEmpty(genSerialNoModel.getShiftCode()) || Objects.isNull(customerPart)) { - MesPcnException.throwMesBusiException("班次代码或客户零件号未维护"); - } - genSerialNoModel.partSnParam(mesPart.getPartSnParam()).setCustPartNo(customerPart.getCustPartNo()); - for (int i = 0; i < mesProduceSnPrintModel.getPrintQty(); i++) { + + if (null == genSerialNoModel) MesPcnException.throwBusiException("入参缺少[GenSerialNoModel]!"); + + if (null == part) MesPcnException.throwBusiException("请检查零件信息,零件号[%s]信息不存在!", genSerialNoModel.getPartNo()); + if (null == customerPart) MesPcnException.throwBusiException("请检查零件信息,零件号[%s]对应的客户零件信息不存在", genSerialNoModel.getPartNo()); + if (StringUtils.isEmpty(customerPart.getCustPartNo())) MesPcnException.throwBusiException("请检查客户零件信息,零件号[%s]对应的客户零件信息未维护客户零件号!", part.getPartNo()); + if (customerPart.getCustPartNo().length() < 4) MesPcnException.throwBusiException("请检查客户零件信息,零件号[%s]对应的客户零件号[%s]长度小于4!", part.getPartNo(), customerPart.getCustPartNo()); + if (StringUtils.isEmpty(genSerialNoModel.getShiftCode())) MesPcnException.throwBusiException("入参缺少班次代码!"); + + if (CollectionUtils.isEmpty(dataMap) || !dataMap.containsKey(MesPart.class.getSimpleName())) genSerialNoModel.putDataMap(MesPart.class.getSimpleName(), part); + if (CollectionUtils.isEmpty(dataMap) || !dataMap.containsKey(MesCustomerPart.class.getSimpleName())) genSerialNoModel.putDataMap(MesCustomerPart.class.getSimpleName(), customerPart); + genSerialNoModel.partSnParam(part.getPartSnParam()) + .dynamicRule(new StringJoiner(MesPcnExtConstWords.COMMA).add(customerPart.getCustPartNo().substring(customerPart.getCustPartNo().length() - 4)).add(genSerialNoModel.getShiftCode()).toString()); + //年月日缩写 + Date date = new Date(); + genSerialNoModel.setYear(getYearShort(date)); + genSerialNoModel.setMonth(getMonthShort(date)); + genSerialNoModel.setDay(getDayShort(date)); + + List productSnList = syncFuncService.syncSerialNo(genSerialNoModel, mesProduceSnPrintModel.getUserName(), mesProduceSnPrintModel.getOrganizeCode(), mesProduceSnPrintModel.getPrintQty()).getResultList(); + if (CollectionUtils.isEmpty(productSnList)) MesPcnException.throwBusiException("根据编码规则[%s]生成零件条码失败!", genSerialNoModel.getRuleCode()); + for (Object productSn : productSnList) { //保存条码信息 - MesProduceSn produceSn = generateMesProduceSn(mesPart, syncFuncService.syncSerialNo(genSerialNoModel, mesProduceSnPrintModel.getUserName(), organizeCode, 1).getResultList().get(0).toString(), mesProduceSnPrintModel.getUserName(), mesProduceSnPrintModel.getQty()); + MesProduceSn produceSn = generateMesProduceSn(part, productSn.toString(), mesProduceSnPrintModel.getUserName(), mesProduceSnPrintModel.getQty()); //封装打印信息 MesProduceSnPrintDataModel printDataModel = getModel(produceSn, customerPart); mesProduceSnPrintModel.getMesProduceSnPrintDataModelList().add(printDataModel); mesProduceSnPrintModel.getMesProduceSnList().add(produceSn); //保存打印记录 - mesProduceSnPrintModel.getMesPrintedSnLogList().add(mesPrintedSnLogService.getMesPrintedSnLog(mesProduceSnPrintModel.getUserName(),organizeCode,printDataModel)); + mesProduceSnPrintModel.getMesPrintedSnLogList().add(mesPrintedSnLogService.getMesPrintedSnLog(mesProduceSnPrintModel.getUserName(), mesProduceSnPrintModel.getOrganizeCode(), printDataModel)); } }else{ MesProduceSn mesProduceSn = mesProduceSnPrintModel.getMesProduceSnList().get(0); @@ -82,7 +106,7 @@ public class MesDPBarcodeWhPrintStrategy implements IPrintTemplateStrategyServic MesProduceSnPrintDataModel printDataModel = getModel(mesProduceSn, customerPart); mesProduceSnPrintModel.getMesProduceSnPrintDataModelList().add(printDataModel); //保存打印记录 - mesProduceSnPrintModel.getMesPrintedSnLogList().add(mesPrintedSnLogService.getMesPrintedSnLog(mesProduceSnPrintModel.getUserName(),organizeCode,printDataModel)); + mesProduceSnPrintModel.getMesPrintedSnLogList().add(mesPrintedSnLogService.getMesPrintedSnLog(mesProduceSnPrintModel.getUserName(), mesProduceSnPrintModel.getOrganizeCode(), printDataModel)); } return mesProduceSnPrintModel; } @@ -112,9 +136,9 @@ public class MesDPBarcodeWhPrintStrategy implements IPrintTemplateStrategyServic MesProduceSnPrintDataModel mesProduceSnPrintDataModel = new MesProduceSnPrintDataModel(); mesProduceSnPrintDataModel.setPartNo(produceSn.getPartNo()); mesProduceSnPrintDataModel.setPartName(produceSn.getPartName()); - if (!Objects.isNull(customerPart)) { - mesProduceSnPrintDataModel.setCustPartNo(customerPart.getCustPartNo().substring(0,customerPart.getCustPartNo().length()-4)); - mesProduceSnPrintDataModel.setCustPartNo1(customerPart.getCustPartNo().substring(customerPart.getCustPartNo().length()-4)); + if (null != customerPart && !StringUtils.isEmpty(customerPart.getCustPartNo()) && customerPart.getCustPartNo().length() >= 4) { + mesProduceSnPrintDataModel.setCustPartNo(customerPart.getCustPartNo().substring(0, 4)); + mesProduceSnPrintDataModel.setCustPartNo1(customerPart.getCustPartNo().substring(customerPart.getCustPartNo().length() - 4)); } mesProduceSnPrintDataModel.setBarcode(produceSn.getProductSn()); mesProduceSnPrintDataModel.setPrintDate(TimeTool.getNowTime(true)); @@ -122,4 +146,17 @@ public class MesDPBarcodeWhPrintStrategy implements IPrintTemplateStrategyServic mesProduceSnPrintDataModel.setProductDate(TimeTool.parseStringFormat(produceSn.getLotNo(), DateUtil.SHORT_FORMAT, "yyyy/MM/dd")); return mesProduceSnPrintDataModel; } + + private String getYearShort(Date date) { + return MesExtEnumUtil.YEAR_SHORT.valueOfDescription(Integer.parseInt(TimeTool.getYear(date))); + } + + private String getMonthShort(Date date) { + return MesExtEnumUtil.MONTH_SHORT.valueOfDescription(Integer.parseInt(TimeTool.getMonth(date))); + } + + private String getDayShort(Date date) { + return TimeTool.getDay(date); + } + } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/WuHanPaintCenterPrint2Strategy.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/WuHanPaintCenterPrint2Strategy.java new file mode 100644 index 0000000..d84f47a --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/WuHanPaintCenterPrint2Strategy.java @@ -0,0 +1,93 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.print.strategy; + +import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesCustomerPartService; +import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesPartService; +import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesPrintedSnLogService; +import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.print.IPrintTemplateStrategyService; +import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException; +import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesProduceSnPrintDataModel; +import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesProduceSnPrintModel; +import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; +import cn.estsh.i3plus.mes.pcn.api.iservice.busi.ISyncFuncService; +import cn.estsh.i3plus.platform.common.tool.TimeTool; +import cn.estsh.i3plus.pojo.base.codemaker.SnowflakeIdMaker; +import cn.estsh.i3plus.pojo.mes.bean.MesNumberRule; +import cn.estsh.i3plus.pojo.mes.bean.MesPart; +import cn.estsh.i3plus.pojo.mes.model.GenSerialNoModel; +import cn.estsh.i3plus.pojo.mes.model.StationRequestBean; +import cn.estsh.i3plus.pojo.mes.model.StepResult; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import java.util.HashMap; +import java.util.Map; + +/** + * @Description : 武汉 油漆线 条码打印2(批量打印) + * @Reference : + * @Author : wangjie + * @CreateDate 2024/9/27 18:25 + * @Modify: + **/ +@Component +@Slf4j +public class WuHanPaintCenterPrint2Strategy implements IPrintTemplateStrategyService { + + @Autowired + private ISyncFuncService syncFuncService; + + @Autowired + private SnowflakeIdMaker snowflakeIdMaker; + + @Autowired + private IMesPartService mesPartService; + + @Autowired + private IMesPrintedSnLogService mesPrintedSnLogService; + + @Autowired + private IMesCustomerPartService mesCustomerPartService; + + private static final String SUPPLIER_CODE_DEFAULT = "V280156"; + + @Override + public MesProduceSnPrintModel execute(GenSerialNoModel genSerialNoModel, MesProduceSnPrintModel mesProduceSnPrintModel, MesNumberRule numberRule, StepResult stepResult, StationRequestBean reqBean, Boolean isStep) { + + if (isStep) return mesProduceSnPrintModel; + + String organizeCode = mesProduceSnPrintModel.getOrganizeCode(); + + MesPart mesPart = (!CollectionUtils.isEmpty(genSerialNoModel.getDataMap()) && genSerialNoModel.getDataMap().containsKey(MesPart.class.getSimpleName())) ? + (MesPart) genSerialNoModel.getDataMap().get(MesPart.class.getSimpleName()) : mesPartService.getMesPartByPartNo(mesProduceSnPrintModel.getPartNo(), organizeCode); + + if (null == mesPart) MesPcnException.throwBusiException("物料[%s]信息不存在!", mesProduceSnPrintModel.getPartNo()); + if (StringUtils.isEmpty(mesPart.getPartSnParam())) MesPcnException.throwBusiException("物料[%s]信息未维护[零件条码参数]!", mesProduceSnPrintModel.getPartNo()); + + String today = TimeTool.getToday(); + for (int i = 0; i < mesProduceSnPrintModel.getPrintQty(); i++) { + Map printTemplateData = new HashMap<>(); + printTemplateData.put(MesPcnExtConstWords.QR_CODE, mesPart.getPartSnParam()); + printTemplateData.put(MesPcnExtConstWords.PART_SN_PARAM, mesPart.getPartSnParam()); + printTemplateData.put(MesPcnExtConstWords.CREATE_DATE_TIME, today.substring(2)); + printTemplateData.put(MesPcnExtConstWords.PART_NAME, mesPart.getPartName()); + mesProduceSnPrintModel.getPrintContextList().add(printTemplateData); + } + + //保存打印记录 + MesProduceSnPrintDataModel printDataModel = new MesProduceSnPrintDataModel(); + printDataModel.setBarcode(mesPart.getPartSnParam()); + printDataModel.setPartNo(mesPart.getPartNo()); + printDataModel.setPartName(mesPart.getPartName()); + printDataModel.setPrintDate(TimeTool.getNowTime(true)); + printDataModel.setProductDate(today); + printDataModel.setUserName(mesProduceSnPrintModel.getUserName()); + printDataModel.setPrintData(String.format("{%s:%s, %s:%s}", MesPcnExtConstWords.QR_CODE, mesPart.getPartSnParam(), MesPcnExtConstWords.QTY, mesProduceSnPrintModel.getPrintQty())); + mesProduceSnPrintModel.getMesPrintedSnLogList().add(mesPrintedSnLogService.getMesPrintedSnLog(mesProduceSnPrintModel.getUserName(), organizeCode, printDataModel)); + + return mesProduceSnPrintModel; + } + +} diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/WuHanPaintCenterPrintStrategy.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/WuHanPaintCenterPrintStrategy.java index cf57237..ec5f1c1 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/WuHanPaintCenterPrintStrategy.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/WuHanPaintCenterPrintStrategy.java @@ -61,7 +61,7 @@ public class WuHanPaintCenterPrintStrategy implements IPrintTemplateStrategyServ String organizeCode = mesProduceSnPrintModel.getOrganizeCode(); MesPart mesPart = (!CollectionUtils.isEmpty(genSerialNoModel.getDataMap()) && genSerialNoModel.getDataMap().containsKey(MesPart.class.getSimpleName())) ? - (MesPart) genSerialNoModel.getDataMap().get(MesPart.class.getSimpleName()) :mesPartService.getMesPartByPartNo(mesProduceSnPrintModel.getPartNo(), organizeCode); + (MesPart) genSerialNoModel.getDataMap().get(MesPart.class.getSimpleName()) : mesPartService.getMesPartByPartNo(mesProduceSnPrintModel.getPartNo(), organizeCode); if (null == mesPart) MesPcnException.throwBusiException("物料[%s]信息不存在!", mesProduceSnPrintModel.getPartNo()); if (StringUtils.isEmpty(mesPart.getPartSnParam())) MesPcnException.throwBusiException("物料[%s]信息未维护[零件条码参数]!", mesProduceSnPrintModel.getPartNo()); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesCountDownShowStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesCountDownShowStepService.java index 45d15a1..22de170 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesCountDownShowStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesCountDownShowStepService.java @@ -55,7 +55,7 @@ public class MesCountDownShowStepService extends BaseStepService { MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getProductionProcessContext(reqBean, false); //获取生产过程上下文对象有异常信息 抛出异常 - if (!productionProcessContext.getSuccess()) return stepResult.msg(productionProcessContext.getMessage()); + if (!productionProcessContext.getSuccess()) stepExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), productionProcessContext.getMessage()); //获取工位信息 MesWorkCell workCell = productionProcessContext.getWorkCell(); @@ -74,7 +74,8 @@ public class MesCountDownShowStepService extends BaseStepService { //解析工位参数 String countDownTime = doCalcCountDownCfg(reqBean, isOpenTimeLock, productionProcessContext.getWorkCell()); - return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), stepResult, String.format("[%sS]倒计时启动!", countDownTime)); + return stepDynamicsCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), + stepResult, true, MesPcnEnumUtil.STATION_BUSI_TYPE.RUNNING_INFO, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT, String.format("[%sS]倒计时启动!", countDownTime)); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellIsVerificationStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellIsVerificationStepService.java index 55260ac..27e4a90 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellIsVerificationStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellIsVerificationStepService.java @@ -39,8 +39,8 @@ public class MesManyCellIsVerificationStepService extends BaseStepService { StepResult stepResult = StepResult.getSuccessComplete(); - //根据生产线代码,工位代码查询主子工位实虚关系信息(排除当前工位) - List workCellExtendCfgList = prodOrgExtService.getWorkCellExtendCfgRvListByBak(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode()); + //根据生产线代码,工位代码查询主子工位实虚关系信息[大于等于Bak工位的seq的数据排在前面] + List workCellExtendCfgList = prodOrgExtService.getWorkCellExtendCfgRvListSortByBak(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode()); if (CollectionUtils.isEmpty(workCellExtendCfgList)) return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("生产线[%s]工位[%s]未配置实虚工位对应关系", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode())); @@ -48,6 +48,7 @@ public class MesManyCellIsVerificationStepService extends BaseStepService { if (null == workCellExtendCfg) continue; + //排除当前工位 if (workCellExtendCfg.getWorkCenterCodeBak().equals(reqBean.getWorkCenterCode()) && workCellExtendCfg.getWorkCellCodeBak().equals(reqBean.getWorkCellCode())) continue; //验证下个工位是否在线 diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellTriggerJumpProcessStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellTriggerJumpProcessStepService.java new file mode 100644 index 0000000..b030fba --- /dev/null +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesManyCellTriggerJumpProcessStepService.java @@ -0,0 +1,92 @@ +package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step; + +import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesProdOrgExtService; +import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; +import cn.estsh.i3plus.mes.pcn.actor.shipping.dispatch.IFsmCommonService; +import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService; +import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.IShippingDispatchService; +import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.IStepService; +import cn.estsh.i3plus.mes.pcn.websocket.StationWebSocket; +import cn.estsh.i3plus.platform.common.util.MesPcnConstWords; +import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; +import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil; +import cn.estsh.i3plus.pojo.mes.bean.MesWorkCellExtendCfg; +import cn.estsh.i3plus.pojo.mes.model.StationRequestBean; +import cn.estsh.i3plus.pojo.mes.model.StationResultBean; +import cn.estsh.i3plus.pojo.mes.model.StepResult; +import cn.estsh.impp.framework.boot.util.SpringContextsUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import java.util.List; + +/** + * @Description : 验证通过后所有分屏强制重置工序工步 + * @Author : wangjie + **/ +@Slf4j +@Service("mesManyCellTriggerJumpProcessStepService") +public class MesManyCellTriggerJumpProcessStepService extends BaseStepService { + + @Autowired + private IFsmCommonService fsmCommonService; + + @Autowired + private IMesProdOrgExtService prodOrgExtService; + + @Autowired + private IShippingDispatchService shippingDispatchService; + + @Override + public StepResult execute(StationRequestBean reqBean) { + + StepResult stepResult = StepResult.getSuccessComplete(); + + if (StringUtils.isEmpty(reqBean.getScanInfo())) return stepResult; + + stepResult.unResetScanInfo(); + + //所有分屏强制跳过工序密码 + String pwd = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.MANY_CELL_TRIGGER_JUMP_PROCESS_PWD); + if (StringUtils.isEmpty(pwd) || !pwd.equals(reqBean.getScanInfo())) return stepResult; + + StationResultBean resultBean = new StationResultBean(); + + //根据生产线代码,工位代码查询主子工位实虚关系信息 + List workCellExtendCfgList = prodOrgExtService.getWorkCellExtendCfgRvListByBak(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode()); + + if (CollectionUtils.isEmpty(workCellExtendCfgList)) return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("生产线[%s]工位[%s]未配置实虚工位对应关系", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode())); + + for (MesWorkCellExtendCfg workCellExtendCfg : workCellExtendCfgList) { + + if (null == workCellExtendCfg) continue; + + //验证工位是否在线,当前工位无须验证 + String clientInfo = shippingDispatchService.getActorClientInfo(reqBean.getOrganizeCode(), workCellExtendCfg.getWorkCenterCodeBak(), workCellExtendCfg.getWorkCellCodeBak()); + if (!workCellExtendCfg.getWorkCenterCodeBak().equals(reqBean.getWorkCenterCode()) || !workCellExtendCfg.getWorkCellCodeBak().equals(reqBean.getWorkCellCode())) { + if (CollectionUtils.isEmpty(StationWebSocket.getStationWebSocketList(clientInfo))) continue; + } + + StationRequestBean stationRequestBean = new StationRequestBean(); + BeanUtils.copyProperties(reqBean, stationRequestBean); + stationRequestBean.setWorkCenterCode(workCellExtendCfg.getWorkCenterCodeBak()); + stationRequestBean.setWorkCellCode(workCellExtendCfg.getWorkCellCodeBak()); + stationRequestBean.setClientInfo(clientInfo); + stationRequestBean.setInterfaceType(MesPcnConstWords.SHIPPING); + stationRequestBean.setBusiType(MesPcnEnumUtil.ACTOR_RECEIVE_STRATEGY.WS_CMD_DO_SCAN.getCode()); + stationRequestBean.setForceJumpProcess(true); + shippingDispatchService.sendScanQueueNextExec(stationRequestBean); + + } + + stepSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), String.format("生产线[%s]工位[%s]触发所有在线分屏重置工序成功!", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode())); + + return stepResult; + + } + +} diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductResultErrorHandleStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductResultErrorHandleStepService.java index d49cf0c..230acbb 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductResultErrorHandleStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductResultErrorHandleStepService.java @@ -9,6 +9,7 @@ import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPartContext; import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesProductionPsOutContext; import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesNcProcessingInputModel; import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesPartInspectionInputModel; +import cn.estsh.i3plus.mes.pcn.actor.shipping.dispatch.IFsmRouteDataService; import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService; import cn.estsh.i3plus.platform.common.convert.ConvertBean; import cn.estsh.i3plus.platform.common.tool.TimeTool; @@ -24,6 +25,7 @@ import cn.estsh.i3plus.pojo.mes.model.StationRequestBean; import cn.estsh.i3plus.pojo.mes.model.StationResultBean; import cn.estsh.i3plus.pojo.mes.model.StepResult; import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; +import cn.estsh.impp.framework.boot.exception.ImppBusiException; import com.google.common.base.Objects; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -59,6 +61,9 @@ public class MesProductResultErrorHandleStepService extends BaseStepService { @Autowired private IMesProductionDispatchContextStepService mesProductionDispatchContextStepService; + @Autowired + private IFsmRouteDataService fsmRouteDataService; + private static final Map refMap = new ConcurrentHashMap<>(200); @Override @@ -68,25 +73,35 @@ public class MesProductResultErrorHandleStepService extends BaseStepService { StationResultBean resultBean = new StationResultBean(); // 获取加工结果 - String result = mesProductionDispatchContextStepService.getProductResultContext(reqBean); + String productResult = mesProductionDispatchContextStepService.getProductResultContext(reqBean); // 如果是报废或者可疑,需要编辑条码状态为不合格、并且nc判定需要新增一条记录 Integer resultInt; try { - resultInt = StringUtils.isEmpty(result) ? MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue() : Integer.valueOf(result); + resultInt = StringUtils.isEmpty(productResult) ? MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue() : Integer.valueOf(productResult); } catch (Exception e) { resultInt = MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue(); } if (resultInt.compareTo(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue()) == 0) return stepResult; - // 获取条码列表 - List mesProduceSns = mesProductionDispatchContextStepService.getProductionPsOutContext(reqBean); + //获取上下文产出条码数据信息集合 + List productionPsOutContextList = mesProductionDispatchContextStepService.getProductionPsOutContext(reqBean); - List productionPartContexts = mesProductionDispatchContextStepService.getProductionPartContext(reqBean); + //获取上下文产出零件信息 + List productionPartContextList = mesProductionDispatchContextStepService.getProductionPartContext(reqBean); - // 保存加工异常记录(NC判断记录) - saveProductResultException(reqBean, mesProduceSns,productionPartContexts, result); + try { + // 保存加工异常记录(NC判断记录) + saveProductResultException(reqBean, productionPsOutContextList, productionPartContextList, resultInt); + } catch (ImppBusiException e) { + stepExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), String.format("加工[%s] NC信息保存失败: %s", MesExtEnumUtil.PRODUCE_QC_STATUS.valueOfDescription(resultInt), e.getErrorDetail())); + } catch (Exception e) { + String webMsg = String.format("加工[%s] NC信息保存失败: %s", MesExtEnumUtil.PRODUCE_QC_STATUS.valueOfDescription(resultInt), fsmRouteDataService.handleFsmCfgOrDefault(reqBean, MesPcnEnumUtil.FSM_CFG.FSM_EXCEPTION_MSG.getCode())); + this.sendMessage(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.ERROR.getValue()), webMsg, MesPcnEnumUtil.STATION_BUSI_TYPE.MESSAGE, MesPcnEnumUtil.STATION_DATA_TYPE.EXP_TEXT); + this.cacheException(reqBean, reqBean.getStepName(), webMsg, e, true); + foundExThrowNoShowMsg(); + } return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), stepResult, String.format("加工[%s] NC信息保存成功!", MesExtEnumUtil.PRODUCE_QC_STATUS.valueOfDescription(resultInt))); } @@ -94,13 +109,13 @@ public class MesProductResultErrorHandleStepService extends BaseStepService { /** * 存加工异常记录 * @param reqBean - * @param mesProduceSns + * @param productionPsOutContextList */ - private void saveProductResultException(StationRequestBean reqBean, List mesProduceSns, List productionPartContexts, String result) { + private void saveProductResultException(StationRequestBean reqBean, List productionPsOutContextList, List productionPartContextList, Integer productResult) { String defectTypeCode = MesEnumUtil.DEFECT_TYPE_CODE.DETERMIND.getValue(); - mesProduceSns.forEach(mesProduceSn -> { + productionPsOutContextList.forEach(mesProduceSn -> { String productVersion = null; - List mesProductionPartContextList = productionPartContexts.stream().filter(mesProductionPartContext -> Objects.equal(mesProduceSn.getForeignKey(),mesProductionPartContext.getForeignKey())).collect(Collectors.toList()); + List mesProductionPartContextList = productionPartContextList.stream().filter(mesProductionPartContext -> Objects.equal(mesProduceSn.getForeignKey(),mesProductionPartContext.getForeignKey())).collect(Collectors.toList()); if (!CollectionUtils.isEmpty(mesProductionPartContextList)) { productVersion = mesProductionPartContextList.get(0).getProductVersion(); } @@ -125,7 +140,7 @@ public class MesProductResultErrorHandleStepService extends BaseStepService { partInspection.setDefectTypeCode(mesDefectType.getDefectTypeCode()); partInspection.setInspectionDate(TimeTool.getToday()); partInspection.setLotNo(mesProduceSn.getLotNo()); - if (Objects.equal(MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.PRODUCT_SCRAP.getValue(), result)) { + if (productResult.compareTo(MesExtEnumUtil.PRODUCE_QC_STATUS.SCRAP.getValue()) == 0) { partInspection.setNcStatus(MesExtEnumUtil.PART_INSPECTION_NC_STATUS.SCRAP.getValue()); } else { partInspection.setNcStatus(MesExtEnumUtil.PART_INSPECTION_NC_STATUS.CREATE.getValue()); @@ -148,7 +163,7 @@ public class MesProductResultErrorHandleStepService extends BaseStepService { model.setType(partInspection.getSourceType()); model.setProductVersion(productVersion); - if (Objects.equal(MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.PRODUCT_SCRAP.getValue(), result)) { + if (Objects.equal(MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.PRODUCT_SCRAP.getValue(), productResult)) { model.setType(MesExtEnumUtil.NC_TYPE.SCRAP.getValue()); } MesPartSap mesPartSap = new MesPartSap(); @@ -156,8 +171,7 @@ public class MesProductResultErrorHandleStepService extends BaseStepService { model.setPart(mesPartSap); model.setPartInspectionDetailList(Arrays.asList(mesPartInspectionDetail)); - if (Objects.equal(MesExtEnumUtil.EQUIP_VARIABLE_CFG_CATEGORY.PRODUCT_SCRAP.getValue(), result)) { - //TODO 有问题 需要修改条码质量状态 + if (productResult.compareTo(MesExtEnumUtil.PRODUCE_QC_STATUS.SCRAP.getValue()) == 0) { ncProcessingService.saveNc(model, reqBean.getOrganizeCode(), true); } else { MesPartInspectionInputModel inspectModel = new MesPartInspectionInputModel(); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnPrintNosortStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnPrintNosortStepService.java index 2d6575d..edda086 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnPrintNosortStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnPrintNosortStepService.java @@ -72,10 +72,10 @@ public class MesProductSnPrintNosortStepService extends BaseStepService { StepResult stepResult = StepResult.getSuccessComplete(); //获取上下文加工结果 - String prodResult = productionDispatchContextStepService.getProductResultContext(reqBean); + String productResult = productionDispatchContextStepService.getProductResultContext(reqBean); //验证加工结果是否满足参数条件: 可疑/报废是否打印 - if (checkIsMatchProdResult(reqBean, prodResult, MesExtEnumUtil.PRODUCT_RESULT_EQUIP_PARAM.PRODUCT_SUSPICIOUS) || checkIsMatchProdResult(reqBean, prodResult, MesExtEnumUtil.PRODUCT_RESULT_EQUIP_PARAM.PRODUCT_SCRAP)) - return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), stepResult, String.format("打印失败:%s!", MesExtEnumUtil.PRODUCT_RESULT_EQUIP_PARAM.codeOfDescription(prodResult))); + if (checkIsMatchProdResult(reqBean, productResult, MesExtEnumUtil.PRODUCT_RESULT_EQUIP_PARAM.PRODUCT_SUSPICIOUS) || checkIsMatchProdResult(reqBean, productResult, MesExtEnumUtil.PRODUCT_RESULT_EQUIP_PARAM.PRODUCT_SCRAP)) + return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PROCESS.getValue()), stepResult, String.format("打印失败:%s!", MesExtEnumUtil.PRODUCT_RESULT_EQUIP_PARAM.codeOfDescription(productResult))); // 根据foreign找出加工规则对应的上下文,判断是否需要打印 List prodRuleDataContext = productionDispatchContextStepService.getProdRuleDataContext(reqBean); @@ -116,6 +116,7 @@ public class MesProductSnPrintNosortStepService extends BaseStepService { mesProduceSnPrintModel.setPartNo(sn.getPartNo()); mesProduceSnPrintModel.setCustPartNo(sn.getCustPartNo()); mesProduceSnPrintModel.setOrganizeCode(organizeCode); + mesProduceSnPrintModel.setUserName(reqBean.getUserInfo()); List snList = new ArrayList<>(); snList.add(sn); mesProduceSnPrintModel.getMesProduceSnList().addAll(snList); @@ -159,9 +160,12 @@ public class MesProductSnPrintNosortStepService extends BaseStepService { for (MesProductionPsOutContext outSn : productionPsOutContextList) { DdlPackBean packBean = DdlPackBean.getDdlPackBean(outSn.getOrganizeCode()); DdlPreparedPack.getNumEqualPack(outSn.getId(), MesPcnExtConstWords.ID, packBean); - mesProduceSnRao.updateByProperties( - new String[]{MesPcnExtConstWords.PRINT_STATUS, MesPcnExtConstWords.PRINT_COUNT, MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME}, - new Object[]{MesExtEnumUtil.PRINT_STATUS.PRINTED.getValue(), MesPcnExtConstWords.ONE, reqBean.getUserInfo(), TimeTool.getNowTime(true)}, packBean); + mesProduceSnRao.updateByPropertiesNoSync( + new String[]{MesPcnExtConstWords.PRINT_STATUS, MesPcnExtConstWords.PRINT_COUNT, MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, + MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.SYSTEM_SYNC_DATE_TIME}, + new Object[]{MesExtEnumUtil.PRINT_STATUS.PRINTED.getValue(), MesPcnExtConstWords.ONE, reqBean.getUserInfo(), TimeTool.getNowTime(true), + CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesPcnExtConstWords.EMPTY}, + packBean); } //保存打印条码记录 snLogRao.saveAll(snLogList); @@ -169,10 +173,10 @@ public class MesProductSnPrintNosortStepService extends BaseStepService { } //验证加工结果是否满足参数条件: 可疑/报废是否打印 - private Boolean checkIsMatchProdResult(StationRequestBean reqBean, String prodResult, MesExtEnumUtil.PRODUCT_RESULT_EQUIP_PARAM prodResultEnum) { + private Boolean checkIsMatchProdResult(StationRequestBean reqBean, String productResult, MesExtEnumUtil.PRODUCT_RESULT_EQUIP_PARAM prodResultEnum) { - if (StringUtils.isEmpty(prodResult)) return false; - if (!prodResult.equals(prodResultEnum.getCode())) return false; + if (StringUtils.isEmpty(productResult)) return false; + if (!productResult.equals(prodResultEnum.getCode())) return false; Optional> stepParamMap = getStepParams(reqBean); String unPrintParam = (null != stepParamMap && stepParamMap.isPresent() && stepParamMap.get().containsKey(prodResultEnum.name())) ? stepParamMap.get().get(prodResultEnum.name()).getParamValue() : null; diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnPrintSortStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnPrintSortStepService.java index e37e7da..14d79cf 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnPrintSortStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnPrintSortStepService.java @@ -139,7 +139,7 @@ public class MesProductSnPrintSortStepService extends BaseStepService { mesProduceSnPrintModel.setPartNo(sn.getPartNo()); mesProduceSnPrintModel.setOrganizeCode(organizeCode); mesProduceSnPrintModel.setSourceData(workOrder); - + mesProduceSnPrintModel.setUserName(reqBean.getUserInfo()); //根据反射获取策略类--封装打印数据 String methodCode = labelTemplate.getMethodCode(); //模板信息丢失抛出异常 diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnSaveStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnSaveStepService.java index 47efa99..cc3f78e 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnSaveStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnSaveStepService.java @@ -30,6 +30,7 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -114,57 +115,97 @@ public class MesProductSnSaveStepService extends BaseStepService { if (null == produceSn) stepExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), String.format("请检查零件条码信息,产出零件条码[%s]ID[%s]信息不存在!", productionPsOutContext.getProductSn(), productionPsOutContext.getId())); - log.info("工厂{}生产线{}工位{}:FSM STATE DISPATCHER --- DO STEP --- {} EXEC --- PS:{} {} --- ID:{} --- QURERY:{}", - reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), - StringUtil.toLowerCaseFirst(this.getClass().getSimpleName()), produceSn.getProductSn(), produceSn.getPartNo(), produceSn.getId(), JSONObject.toJSONString(produceSn)); - //零件信息 MesPart part = partMap.get(produceSn.getPartNo()); + Map propertyMap = new HashMap<>(); + productionPsOutContext.setAreaCode(reqBean.getAreaCode()); + propertyMap.put(MesPcnExtConstWords.AREA_CODE, productionPsOutContext.getAreaCode()); + productionPsOutContext.setWorkCenterCode(reqBean.getWorkCenterCode()); + propertyMap.put(MesPcnExtConstWords.WORK_CENTER_CODE, productionPsOutContext.getWorkCenterCode()); + productionPsOutContext.setWorkCellCode(reqBean.getWorkCellCode()); + propertyMap.put(MesPcnExtConstWords.WORK_CELL_CODE, productionPsOutContext.getWorkCellCode()); productionPsOutContext.setRouteCode(reqBean.getRouteCode()); + propertyMap.put(MesPcnExtConstWords.ROUTE_CODE, productionPsOutContext.getRouteCode()); + productionPsOutContext.setProcessCode(reqBean.getProcessCode()); - productionPsOutContext.setCraftCode(productionProcessContext.getCraftCode()); + propertyMap.put(MesPcnExtConstWords.PROCESS_CODE, productionPsOutContext.getProcessCode()); - productionPsOutContext.setQcStatus(!StringUtils.isEmpty(productResult) ? Integer.valueOf(productResult) : MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue()); + productionPsOutContext.setCraftCode(productionProcessContext.getCraftCode()); + propertyMap.put(MesPcnExtConstWords.CRAFT_CODE, productionPsOutContext.getCraftCode()); productionPsOutContext.setShiftCode(prodShiftContext.getShiftCode()); + propertyMap.put(MesPcnExtConstWords.SHIFT_CODE, productionPsOutContext.getShiftCode()); + productionPsOutContext.setShiftGroup(prodShiftContext.getShiftGroup()); + propertyMap.put(MesPcnExtConstWords.SHIFT_GROUP, productionPsOutContext.getShiftGroup()); productionPsOutContext.setProcessLabelTemplate(part.getProcessLabelTemplate()); + propertyMap.put(MesPcnExtConstWords.PROCESS_LABEL_TEMPLATE, productionPsOutContext.getProcessLabelTemplate()); + productionPsOutContext.setProdLabelTemplate(part.getProductLabelTemplate()); + propertyMap.put(MesPcnExtConstWords.PROD_LABEL_TEMPLATE, productionPsOutContext.getProdLabelTemplate()); + productionPsOutContext.setCustLabelTemplate(part.getCustLabelTemplate()); + propertyMap.put(MesPcnExtConstWords.CUST_LABEL_TEMPLATE, productionPsOutContext.getCustLabelTemplate()); ConvertBean.serviceModelUpdate(productionPsOutContext, reqBean.getUserInfo()); - productionPsOutContext.setLotNo(productionPsOutContext.getModifyDatetime().substring(0, 10)); + propertyMap.put(MesPcnExtConstWords.MODIFY_DATE_TIME, productionPsOutContext.getModifyDatetime()); + propertyMap.put(MesPcnExtConstWords.MODIFY_USER, productionPsOutContext.getModifyUser()); + propertyMap.put(MesPcnExtConstWords.SYSTEM_SYNC_STATUS, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); + propertyMap.put(MesPcnExtConstWords.SYSTEM_SYNC_DATE_TIME, MesPcnExtConstWords.EMPTY); + + if (StringUtils.isEmpty(productionPsOutContext.getLotNo()) || !productionPsOutContext.getLotNo().equals(productionPsOutContext.getModifyDatetime().substring(0, 10))) { + productionPsOutContext.setLotNo(productionPsOutContext.getModifyDatetime().substring(0, 10)); + propertyMap.put(MesPcnExtConstWords.LOT_NO, productionPsOutContext.getLotNo()); + } - if (StringUtils.isEmpty(productionPsOutContext.getInWorkCenterTime())) productionPsOutContext.setInWorkCenterTime(productionPsOutContext.getModifyDatetime()); + if (StringUtils.isEmpty(productionPsOutContext.getInWorkCenterTime())) { + productionPsOutContext.setInWorkCenterTime(productionPsOutContext.getModifyDatetime()); + propertyMap.put(MesPcnExtConstWords.IN_WC_TIME, productionPsOutContext.getInWorkCenterTime()); + } + + if (!StringUtils.isEmpty(productResult) && Integer.valueOf(productResult).compareTo(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue()) != 0) { + productionPsOutContext.setQcStatus(Integer.valueOf(productResult)); + propertyMap.put(MesPcnExtConstWords.QC_STATUS, productionPsOutContext.getQcStatus()); + } //非排序 或者 排序的末道工位 if (workCenter.getCenterType().compareTo(MesExtEnumUtil.WORK_CENTER_TYPE.NOSORT.getValue()) == 0 || (!StringUtils.isEmpty(workCell.getIsEndWorkCell()) && workCell.getIsEndWorkCell().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0)) { productionPsOutContext.setSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.OFFLINE.getValue()); + propertyMap.put(MesPcnExtConstWords.SN_STATUS, productionPsOutContext.getSnStatus()); + productionPsOutContext.setOutWorkCenterTime(productionPsOutContext.getModifyDatetime()); + propertyMap.put(MesPcnExtConstWords.OUT_WC_TIME, productionPsOutContext.getOutWorkCenterTime()); } else { - productionPsOutContext.setSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.PROCESSING.getValue()); + //排序非末道 + if (productionPsOutContext.getSnStatus().compareTo(MesExtEnumUtil.PRODUCE_SN_STATUS.PROCESSING.getValue()) != 0) { + productionPsOutContext.setSnStatus(MesExtEnumUtil.PRODUCE_SN_STATUS.PROCESSING.getValue()); + propertyMap.put(MesPcnExtConstWords.SN_STATUS, productionPsOutContext.getSnStatus()); + } } - produceSnRepository.updateByProperties( - new String[]{MesPcnExtConstWords.ID, MesPcnExtConstWords.ORGANIZE_CODE}, - new Object[]{produceSn.getId(), reqBean.getOrganizeCode()}, - new String[]{MesPcnExtConstWords.AREA_CODE, MesPcnExtConstWords.WORK_CENTER_CODE, MesPcnExtConstWords.WORK_CELL_CODE, MesPcnExtConstWords.ROUTE_CODE, MesPcnExtConstWords.PROCESS_CODE, MesPcnExtConstWords.CRAFT_CODE, - MesPcnExtConstWords.SN_STATUS, MesPcnExtConstWords.QC_STATUS, MesPcnExtConstWords.SHIFT_CODE, MesPcnExtConstWords.SHIFT_GROUP, MesPcnExtConstWords.PROCESS_LABEL_TEMPLATE, MesPcnExtConstWords.PROD_LABEL_TEMPLATE, - MesPcnExtConstWords.CUST_LABEL_TEMPLATE, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.IN_WC_TIME, MesPcnExtConstWords.OUT_WC_TIME, MesPcnExtConstWords.LOT_NO}, - new Object[]{productionPsOutContext.getAreaCode(), productionPsOutContext.getWorkCenterCode(), productionPsOutContext.getWorkCellCode(), productionPsOutContext.getRouteCode(), productionPsOutContext.getProcessCode(), productionPsOutContext.getCraftCode(), - productionPsOutContext.getSnStatus(), productionPsOutContext.getQcStatus(), productionPsOutContext.getShiftCode(), productionPsOutContext.getShiftGroup(), productionPsOutContext.getProcessLabelTemplate(), productionPsOutContext.getProdLabelTemplate(), - productionPsOutContext.getCustLabelTemplate(), productionPsOutContext.getModifyDatetime(), productionPsOutContext.getModifyUser(), productionPsOutContext.getInWorkCenterTime(), productionPsOutContext.getOutWorkCenterTime(), productionPsOutContext.getLotNo()}); - - log.info("工厂{}生产线{}工位{}:FSM STATE DISPATCHER --- DO STEP --- {} EXEC --- PS:{} {} --- ID:{} --- UPDATE:{}", + String[] propertyName = new String[propertyMap.size()]; + Object[] propertyValue = new Object[propertyMap.size()]; + + Integer index = 0; + for (Map.Entry innerEntry : propertyMap.entrySet()) { + if (null == innerEntry) continue; + propertyName[index] = innerEntry.getKey(); + propertyValue[index] = innerEntry.getValue(); + index ++; + } + + produceSnRepository.updateByPropertiesNoSync(new String[]{MesPcnExtConstWords.ID, MesPcnExtConstWords.ORGANIZE_CODE}, new Object[]{produceSn.getId(), reqBean.getOrganizeCode()}, propertyName, propertyValue); + + log.info("工厂{}生产线{}工位{}:FSM STATE DISPATCHER --- DO STEP --- {} EXEC --- PS:{} --- ID:{} --- QUERY:{} --- productResult:{} --- UPDATE:{}", reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), - StringUtil.toLowerCaseFirst(this.getClass().getSimpleName()), productionPsOutContext.getProductSn(), productionPsOutContext.getPartNo(), productionPsOutContext.getId(), JSONObject.toJSONString(productionPsOutContext)); + StringUtil.toLowerCaseFirst(this.getClass().getSimpleName()), productionPsOutContext.getProductSn(), produceSn.getId(), JSONObject.toJSONString(produceSn), productResult, JSONObject.toJSONString(propertyMap)); return productionPsOutContext; diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderCheckNosortStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderCheckNosortStepService.java index 43584fd..3f8afd4 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderCheckNosortStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderCheckNosortStepService.java @@ -131,7 +131,7 @@ public class MesWorkOrderCheckNosortStepService extends MesWorkOrderCheckStepSer } //保存扫描的工单信息上下文 - if (MesExtEnumUtil.CELL_MESSAGE_SOURCE.SCAN.getValue() == equipVariableCollectContextList.get(0).getMessageSource()) { + if (MesExtEnumUtil.CELL_MESSAGE_SOURCE.READ.getValue() != equipVariableCollectContextList.get(0).getMessageSource()) { productionProcessContextStepService.dispatchFunctionChooseCavityOrderContext(reqBean, StationKvBeanUtil.addStationKvBeanList(new ArrayList<>(), new StationKvBean(MesPcnExtConstWords.CAVITY, "腔数", String.valueOf(productionPartContextList.size())), new StationKvBean(MesPcnExtConstWords.CELL_MESSAGE_SOURCE, "工位信息来源", MesExtEnumUtil.CELL_MESSAGE_SOURCE.READ.getValueStr()), @@ -139,6 +139,8 @@ public class MesWorkOrderCheckNosortStepService extends MesWorkOrderCheckStepSer new StationKvBean(MesPcnExtConstWords.WORK_ORDER_NO, "加工单", productionPartContextList.stream().filter(o -> null != o).map(MesProductionPartContext::getWorkOrderNo).collect(Collectors.joining(MesPcnExtConstWords.SEMICOLON))))); } + if (MesExtEnumUtil.CELL_MESSAGE_SOURCE.READ.getValue() == equipVariableCollectContextList.get(0).getMessageSource()) resultBean.setSendBackgroundColor(MesExtEnumUtil.COLOR.UNRESET.getValue()); + String workOrderStr = equipVariableCollectContextList.stream().filter(o -> null != o).map(MesEquipVariableCollectContext::getEquipVariableValue).collect(Collectors.toList()).toString(); return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog().scanInfo(workOrderStr), stepResult, String.format("当前%s加工单%s验证工单状态成功%s!", MesExtEnumUtil.CELL_MESSAGE_SOURCE.valueOfDescription(equipVariableCollectContextList.get(0).getMessageSource()), workOrderStr, diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderSaveNosortStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderSaveNosortStepService.java index 27a0996..3902246 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderSaveNosortStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderSaveNosortStepService.java @@ -98,7 +98,7 @@ public class MesWorkOrderSaveNosortStepService extends BaseStepService { //产出条码 根据生产工单分组 Map> proMap = productionPsOutContextList.stream().filter(Objects::nonNull).collect(Collectors.groupingBy(MesProductionPsOutContext::getWorkOrderNo)); - String prodResult = productionDispatchContextStepService.getProductResultContext(reqBean); + String productResult = productionDispatchContextStepService.getProductResultContext(reqBean); //遍历产出零件信息 for(Map.Entry> entry : ppMap.entrySet()) { @@ -121,10 +121,6 @@ public class MesWorkOrderSaveNosortStepService extends BaseStepService { if (null == workOrder) stepExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), String.format("请检查工单信息,加工单[%s]信息不存在!", entry.getKey())); - log.info("工厂{}生产线{}工位{}:FSM STATE DISPATCHER --- DO STEP --- {} EXEC --- ORDER:{} --- QURERY:{} --- calcCompleteQty:{} --- prodResult:{}", - reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), - StringUtil.toLowerCaseFirst(this.getClass().getSimpleName()), workOrder.getWorkOrderNo(), JSONObject.toJSONString(workOrder), calcCompleteQty, prodResult); - //工单状态分 排序工单 和非排序工单; 现在必须是非排序工单 if (!MesExtEnumUtil.ORDER_STATUS.checkNosortAllowStatus(workOrder.getWorkOrderStatus())) stepExpSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), String.format("请检查工单信息,加工单[%s]信息工单状态[%s]!", entry.getKey(), MesExtEnumUtil.ORDER_STATUS.valueOfDescription(workOrder.getWorkOrderStatus()))); @@ -149,13 +145,13 @@ public class MesWorkOrderSaveNosortStepService extends BaseStepService { * 上下文中 已经按照工单分组了,因为有一模多腔问题 */ - if (!StringUtils.isEmpty(prodResult)) { + if (!StringUtils.isEmpty(productResult)) { //可疑品 - if (Integer.valueOf(prodResult).compareTo(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue()) == 0 && !CollectionUtils.isEmpty(productionPsOutContextList)){ + if (Integer.valueOf(productResult).compareTo(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS.getValue()) == 0 && !CollectionUtils.isEmpty(productionPsOutContextList)){ propertyMap.put(MesPcnExtConstWords.SUSPICIOUS_PART_QTY, MathOperation.add(workOrder.getSuspiciousPartQty(), new Double(productionPsOutContextList.size()))); } //报废数量 - if (Integer.valueOf(prodResult).compareTo(MesExtEnumUtil.PRODUCE_QC_STATUS.SCRAP.getValue()) == 0 && !CollectionUtils.isEmpty(productionPsOutContextList)){ + if (Integer.valueOf(productResult).compareTo(MesExtEnumUtil.PRODUCE_QC_STATUS.SCRAP.getValue()) == 0 && !CollectionUtils.isEmpty(productionPsOutContextList)){ propertyMap.put(MesPcnExtConstWords.SCRAP_PART_QTY, MathOperation.add(workOrder.getScrapPartQty(), new Double(productionPsOutContextList.size()))); } } @@ -168,8 +164,10 @@ public class MesWorkOrderSaveNosortStepService extends BaseStepService { if (CollectionUtils.isEmpty(propertyMap)) continue; - propertyMap.put(MesPcnExtConstWords.MODIFY_DATE_TIME, (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS")).format(new Date())); + propertyMap.put(MesPcnExtConstWords.MODIFY_DATE_TIME, (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date())); propertyMap.put(MesPcnExtConstWords.MODIFY_USER, reqBean.getUserInfo()); + propertyMap.put(MesPcnExtConstWords.SYSTEM_SYNC_STATUS, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); + propertyMap.put(MesPcnExtConstWords.SYSTEM_SYNC_DATE_TIME, MesPcnExtConstWords.EMPTY); String[] propertyName = new String[propertyMap.size()]; Object[] propertyValue = new Object[propertyMap.size()]; @@ -182,11 +180,12 @@ public class MesWorkOrderSaveNosortStepService extends BaseStepService { index ++; } - workOrderRepository.updateByProperties(new String[]{MesPcnExtConstWords.ID, MesPcnExtConstWords.ORGANIZE_CODE}, new Object[]{workOrder.getId(), reqBean.getOrganizeCode()}, propertyName, propertyValue); + workOrderRepository.updateByPropertiesNoSync(new String[]{MesPcnExtConstWords.ID, MesPcnExtConstWords.ORGANIZE_CODE}, new Object[]{workOrder.getId(), reqBean.getOrganizeCode()}, propertyName, propertyValue); - log.info("工厂{}生产线{}工位{}:FSM STATE DISPATCHER --- DO STEP --- {} EXEC --- ORDER:{} --- UPDATE:{}", + log.info("工厂{}生产线{}工位{}:FSM STATE DISPATCHER --- DO STEP --- {} EXEC --- ORDER:{} --- QUERY:{} --- calcCompleteQty:{} --- productResult:{} --- UPDATE:{}", reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode(), - StringUtil.toLowerCaseFirst(this.getClass().getSimpleName()), workOrder.getWorkOrderNo(), JSONObject.toJSONString(propertyMap)); + StringUtil.toLowerCaseFirst(this.getClass().getSimpleName()), workOrder.getWorkOrderNo(), JSONObject.toJSONString(workOrder), calcCompleteQty, productResult, JSONObject.toJSONString(propertyMap)); + } } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderSaveSortStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderSaveSortStepService.java index b49453c..763fdd0 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderSaveSortStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderSaveSortStepService.java @@ -98,22 +98,26 @@ public class MesWorkOrderSaveSortStepService extends BaseStepService { if (!isEndWorkCell && productionPartContext.getWorkOrderStatus().compareTo(MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue()) == 0) continue; if (!isEndWorkCell) { - workOrderRepository.updateByProperties( + workOrderRepository.updateByPropertiesNoSync( new String[]{MesPcnExtConstWords.ID, MesPcnExtConstWords.ORGANIZE_CODE}, new Object[]{productionPartContext.getId(), reqBean.getOrganizeCode()}, - new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, + new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, + MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.SYSTEM_SYNC_DATE_TIME, MesPcnExtConstWords.WORK_ORDER_STATUS, MesPcnExtConstWords.START_TIME, MesPcnExtConstWords.ONLINE_TIME}, - new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), + new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), + CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesPcnExtConstWords.EMPTY, MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue(), productionPartContext.getOnlineTime(), productionPartContext.getOnlineTime()}); } else { productionPartContext.setOfflineTime(TimeTool.getNowTime(true)); - workOrderRepository.updateByProperties( + workOrderRepository.updateByPropertiesNoSync( new String[]{MesPcnExtConstWords.ID, MesPcnExtConstWords.ORGANIZE_CODE}, new Object[]{productionPartContext.getId(), reqBean.getOrganizeCode()}, - new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, + new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, + MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.SYSTEM_SYNC_DATE_TIME, MesPcnExtConstWords.WORK_ORDER_STATUS, MesPcnExtConstWords.COMPLETE_QTY, MesPcnExtConstWords.UN_COMPLETE_QTY, MesPcnExtConstWords.START_TIME, MesPcnExtConstWords.ONLINE_TIME, MesPcnExtConstWords.END_TIME, MesPcnExtConstWords.OFFLINE_TIME}, - new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), + new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), + CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesPcnExtConstWords.EMPTY, MesExtEnumUtil.ORDER_STATUS.COMPLETE.getValue(), new Double(1), new Double(0), productionPartContext.getOnlineTime(), productionPartContext.getOnlineTime(), productionPartContext.getOfflineTime(), productionPartContext.getOfflineTime()}); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderScanStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderScanStepService.java index 4428426..5e5906a 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderScanStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesWorkOrderScanStepService.java @@ -86,6 +86,8 @@ public class MesWorkOrderScanStepService extends BaseStepService { //保存上下文扫/读信息:加工单 productionDispatchContextStepService.dispatchScanWorkOrderNoContext(reqBean, equipVariableCollectContextList); + if (StringUtils.isEmpty(stepResult.getMsg())) return stepResult; + return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.SCAN.getValue()).scanInfo(scanInfo), stepResult, stepResult.getMsg()); } @@ -129,8 +131,6 @@ public class MesWorkOrderScanStepService extends BaseStepService { String scanInfo = chooseCavityOrder.stream().filter(o -> (null != o && !o.getKey().equals(MesPcnExtConstWords.CELL_MESSAGE_SOURCE))).map(o -> o.getName() + MesPcnExtConstWords.SQUARE_BRACKETS_L + o.getValue() + MesPcnExtConstWords.SQUARE_BRACKETS_R).collect(Collectors.joining(MesPcnExtConstWords.SEMICOLON)); productionCustomContextStepService.sendStepContextMessage(reqBean, scanInfo, MesExtEnumUtil.CELL_MESSAGE_SOURCE.getByValue(Integer.valueOf(cellMessageSorce))); - stepResult.msg(String.format("当前%s%s!", MesExtEnumUtil.CELL_MESSAGE_SOURCE.valueOfDescription(Integer.valueOf(cellMessageSorce)), scanInfo)); - return equipVariableCollectContextList; } diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesReworkTaskModel.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesReworkTaskModel.java index 94e2e09..1b32b1a 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesReworkTaskModel.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesReworkTaskModel.java @@ -4,6 +4,7 @@ import cn.estsh.i3plus.pojo.mes.bean.MesPartTypePicture; import cn.estsh.i3plus.pojo.mes.bean.nc.MesPartInspection; import cn.estsh.i3plus.pojo.mes.bean.nc.MesPartInspectionDetail; import cn.estsh.i3plus.pojo.mes.bean.rework.MesReworkTask; +import io.swagger.annotations.ApiModelProperty; import lombok.Builder; import lombok.Data; @@ -38,4 +39,9 @@ public class MesReworkTaskModel { */ private List mesPartInspectionDetails; + /** + * 生产线类型 + */ + private Integer centerType; + } diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesReworkTaskRequestModel.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesReworkTaskRequestModel.java index 9757a7d..0a463c7 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesReworkTaskRequestModel.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesReworkTaskRequestModel.java @@ -64,4 +64,7 @@ public class MesReworkTaskRequestModel { @ApiModelProperty("装配拆解List") private List assemblyModelList; + @ApiModelProperty("生产线类型") + private Integer centerType; + } diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java index d986680..1d20161 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java @@ -307,6 +307,12 @@ public class MesPcnExtConstWords { //MES汇报查询BOM是否携带结束查询条件 public static final String MES_REPORT_FIND_BOM_WITH_EFFENDTIME = "MES_REPORT_FIND_BOM_WITH_EFFENDTIME"; + //返工单 + public static final String REWORK_ORDER = "reworkOrder"; + //返工单ID + public static final String REWORK_TASK_ID = "reworkTaskId"; + //nc状态 + public static final String NC_STATUS = "nc_status"; //BaseBean字段不包含工厂, 用于对象复制剔除属性BeanUtils.copyProperties(Object source, Object target, String... ignoreProperties) @@ -400,6 +406,8 @@ public class MesPcnExtConstWords { public static final String ENDLESS_LOOP_READ_TIMES = "ENDLESS_LOOP_READ_TIMES"; // 死循环读取默认默认次数 public static final String ENDLESS_LOOP_READ_TIMES_DEFAULT = "10"; + // 所有分屏强制跳过工序密码[工位参数] + public static final String MANY_CELL_TRIGGER_JUMP_PROCESS_PWD = "MANY_CELL_TRIGGER_JUMP_PROCESS_PWD"; // 工位/工步 参数按钮事件 public static final String FUNCTION_CMD = "FUNCTION_CMD";