diff --git a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesBoxingErrorProofingService.java b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesBoxingErrorProofingService.java index b65bcd5..73a62ce 100644 --- a/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesBoxingErrorProofingService.java +++ b/modules/i3plus-ext-mes-pcn-api/src/main/java/cn/estsh/i3plus/ext/mes/pcn/api/busi/IMesBoxingErrorProofingService.java @@ -35,5 +35,5 @@ public interface IMesBoxingErrorProofingService { void updateMesPackageDetails(MesPackageDetail mesPackage); @ApiOperation(value = "解锁") - void unLock(String organizeCode, String userName, String pwd); + void unLock(String organizeCode, String pwd); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesBoxingErrorProofingController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesBoxingErrorProofingController.java index e893cf7..a736dc1 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesBoxingErrorProofingController.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesBoxingErrorProofingController.java @@ -17,6 +17,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -38,7 +39,7 @@ public class MesBoxingErrorProofingController { try { ValidatorBean.checkNotNull(mesPackage.getPackageNo(), "箱条码不能为空"); - mesPackage.setOrganizeCode(AuthUtil.getOrganizeCode()); + mesPackage.setOrganizeCode(!StringUtils.isEmpty(mesPackage.getOrganizeCode())?mesPackage.getOrganizeCode():AuthUtil.getOrganizeCode()); ListPager partInspectionListPager = mesBoxingErrorProofingService.queryMesPackageDetailByPager(mesPackage, pager); return ResultBean.success("查询成功").setListPager(partInspectionListPager); } catch (ImppBusiException imppException) { @@ -55,8 +56,8 @@ public class MesBoxingErrorProofingController { try { ValidatorBean.checkNotNull(mesPackageDetail.getPackageNo(), "箱条码不能为空"); - mesPackageDetail.setOrganizeCode(AuthUtil.getOrganizeCode()); - ConvertBean.serviceModelInitialize(mesPackageDetail, AuthUtil.getSessionUser().getUserName()); + mesPackageDetail.setOrganizeCode(!StringUtils.isEmpty(mesPackageDetail.getOrganizeCode())?mesPackageDetail.getOrganizeCode():AuthUtil.getOrganizeCode()); + ConvertBean.serviceModelInitialize(mesPackageDetail,!StringUtils.isEmpty(mesPackageDetail.getModifyUser())?mesPackageDetail.getModifyUser():AuthUtil.getSessionUser().getUserName()); MesPackage mesPackage = mesBoxingErrorProofingService.doScan(mesPackageDetail); return ResultBean.success("扫描成功").setResultObject(mesPackage); } catch (ImppBusiException imppException) { @@ -75,7 +76,8 @@ public class MesBoxingErrorProofingController { mesPackageDetailList.forEach(mesPackageDetail -> { ValidatorBean.checkNotNull(mesPackageDetail.getPackageNo(), "箱条码不能为空"); }); - String userName = AuthUtil.getSessionUser().getUserName(); + MesPackageDetail next = mesPackageDetailList.iterator().next(); + String userName = !StringUtils.isEmpty(next.getModifyUser())?next.getModifyUser():AuthUtil.getSessionUser().getUserName(); MesPackage mesPackage = mesBoxingErrorProofingService.saveMesPackageDetails(mesPackageDetailList, userName); return ResultBean.success("保存成功").setResultObject(mesPackage); } catch (ImppBusiException imppException) { @@ -94,8 +96,8 @@ public class MesBoxingErrorProofingController { ValidatorBean.checkNotNull(mesPackage.getPackageNo(), "箱条码不能为空"); ValidatorBean.checkNotNull(mesPackage.getIsSealed(), "是否封箱不能为空"); - mesPackage.setOrganizeCode(AuthUtil.getOrganizeCode()); - ConvertBean.serviceModelUpdate(mesPackage, AuthUtil.getSessionUser().getUserName()); + mesPackage.setOrganizeCode(!StringUtils.isEmpty(mesPackage.getOrganizeCode())?mesPackage.getOrganizeCode():AuthUtil.getOrganizeCode()); + ConvertBean.serviceModelUpdate(mesPackage, !StringUtils.isEmpty(mesPackage.getModifyUser())?mesPackage.getModifyUser():AuthUtil.getSessionUser().getUserName()); return mesBoxingErrorProofingService.updateMesPackage(mesPackage); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); @@ -114,7 +116,7 @@ public class MesBoxingErrorProofingController { ValidatorBean.checkNotNull(mesPackage.getSerialNumber(), "替换条码不能为空"); ValidatorBean.checkNotNull(mesPackage.getOldSerialNumber(), "替换源条码不能为空"); - ConvertBean.serviceModelUpdate(mesPackage, AuthUtil.getSessionUser().getUserName()); + ConvertBean.serviceModelUpdate(mesPackage, !StringUtils.isEmpty(mesPackage.getModifyUser())?mesPackage.getModifyUser():AuthUtil.getSessionUser().getUserName()); mesBoxingErrorProofingService.updateMesPackageDetails(mesPackage); return ResultBean.success("保存成功"); } catch (ImppBusiException imppException) { @@ -126,12 +128,11 @@ public class MesBoxingErrorProofingController { @GetMapping("/unLock") @ApiOperation(value = "解锁") - public ResultBean unLock(String pwd) { + public ResultBean unLock(String pwd,String organizeCode) { try { //属性校验 ValidatorBean.checkNotNull(pwd, "密码不能为空"); - - mesBoxingErrorProofingService.unLock(AuthUtil.getOrganizeCode(), AuthUtil.getSessionUser().getUserName(), pwd); + mesBoxingErrorProofingService.unLock(!StringUtils.isEmpty(organizeCode)?organizeCode:AuthUtil.getOrganizeCode(),pwd); return ResultBean.success("解锁成功"); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesDowntimeReasonTypeController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesDowntimeReasonTypeController.java index f434f8e..2f18c10 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesDowntimeReasonTypeController.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesDowntimeReasonTypeController.java @@ -11,6 +11,7 @@ import cn.estsh.impp.framework.boot.exception.ImppBusiException; import cn.estsh.impp.framework.boot.util.ResultBean; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -35,7 +36,7 @@ public class MesDowntimeReasonTypeController { @ApiOperation(value = "查询设备停机类型和原因") public ResultBean findMesDowntimeTypeReason(MesDowntimeReasonType mesDowntimeReasontype, Pager pager) { try { - mesDowntimeReasontype.setOrganizeCode(AuthUtil.getOrganizeCode()); + mesDowntimeReasontype.setOrganizeCode(!StringUtils.isEmpty(mesDowntimeReasontype.getOrganizeCode())?mesDowntimeReasontype.getOrganizeCode():AuthUtil.getOrganizeCode()); //查询汇总工单数量 List mesDowntimeReasonTypes = downtimeReasonTypeService.findMesDowntimeTypeReason(mesDowntimeReasontype, pager); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesEnumDetailController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesEnumDetailController.java index d2b5d55..d03486a 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesEnumDetailController.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesEnumDetailController.java @@ -9,6 +9,7 @@ import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder; import cn.estsh.impp.framework.boot.util.ResultBean; import cn.estsh.impp.framework.boot.util.ValidatorBean; import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -35,7 +36,7 @@ public class MesEnumDetailController { public ResultBean findMesEnumDetail(MesEnumDetail mesEnumDetail) { try { ValidatorBean.checkNotNull(mesEnumDetail.getEnumCode(), "枚举代码不能为空"); - mesEnumDetail.setOrganizeCode(AuthUtil.getOrganizeCode()); + mesEnumDetail.setOrganizeCode(!StringUtils.isEmpty(mesEnumDetail.getOrganizeCode())?mesEnumDetail.getOrganizeCode():AuthUtil.getOrganizeCode()); List mesEnumDetailList = mesEnumDetailService.findMesEnumDetail(mesEnumDetail); return ResultBean.success("查询成功").setResultList(mesEnumDetailList); } catch (ImppBusiException imppException) { diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesInputDefectRecordController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesInputDefectRecordController.java index 486437b..a30bddf 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesInputDefectRecordController.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesInputDefectRecordController.java @@ -46,7 +46,7 @@ public class MesInputDefectRecordController { @GetMapping("/query-part-type-defect") @ApiOperation(value = "查询零件类型缺陷类型对应关系") - public ResultBean queryPartTypeDefect(String partNo, String defectLocation, boolean flg, Integer frontBack) { + public ResultBean queryPartTypeDefect(String partNo, String defectLocation, boolean flg, Integer frontBack,String organizeCode) { try { // 数据校验 @@ -55,7 +55,7 @@ public class MesInputDefectRecordController { ValidatorBean.checkNotNull(frontBack, "正反面不能为空"); // return ResultBean.success("查询成功").setResultList(inputDefectRecordService.queryPartTypeDefect(partNo, defectLocationCode, flg, frontBack, "2031")); - return ResultBean.success("查询成功").setResultList(inputDefectRecordService.queryPartTypeDefect(partNo, defectLocation, flg, frontBack, AuthUtil.getOrganizeCode())); + return ResultBean.success("查询成功").setResultList(inputDefectRecordService.queryPartTypeDefect(partNo, defectLocation, flg, frontBack,!StringUtils.isEmpty(organizeCode)?organizeCode:AuthUtil.getOrganizeCode())); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); } catch (Exception e) { @@ -76,7 +76,7 @@ public class MesInputDefectRecordController { } // inputDefectRecordService.savePartInspection(model, "CK01"); - inputDefectRecordService.savePartInspection(model, AuthUtil.getOrganizeCode()); + inputDefectRecordService.savePartInspection(model, !StringUtils.isEmpty(model.getOrganizeCode())?model.getOrganizeCode():AuthUtil.getOrganizeCode()); return ResultBean.success("质检已完成,请继续"); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesNcProcessingController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesNcProcessingController.java index 1fc4490..176692b 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesNcProcessingController.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesNcProcessingController.java @@ -53,7 +53,7 @@ public class MesNcProcessingController { try { - partInspection.setOrganizeCode(AuthUtil.getOrganizeCode()); + partInspection.setOrganizeCode(!StringUtils.isEmpty(partInspection.getOrganizeCode())?partInspection.getOrganizeCode():AuthUtil.getOrganizeCode()); return ResultBean.success("查询成功").setResultObject(ncProcessingService.queryPartInspection(partInspection)); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); @@ -64,11 +64,11 @@ public class MesNcProcessingController { @GetMapping("/query-person") @ApiOperation(value = "查询责任人") - public ResultBean queryPerson() { + public ResultBean queryPerson(String organizeCode) { try { - return ResultBean.success("查询成功").setResultList(ncProcessingService.queryPerson(AuthUtil.getOrganizeCode())); + return ResultBean.success("查询成功").setResultList(ncProcessingService.queryPerson(!StringUtils.isEmpty(organizeCode)?organizeCode:AuthUtil.getOrganizeCode())); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); } catch (Exception e) { @@ -102,7 +102,7 @@ public class MesNcProcessingController { if (CollectionUtils.isEmpty(model.getPartInspectionDetailList())) { throw new ImppBusiException(String.format("不存在可疑信息,请检查数据", model.getType())); } - ncProcessingService.saveNc(model, AuthUtil.getOrganizeCode(), false); + ncProcessingService.saveNc(model, !StringUtils.isEmpty(model.getOrganizeCode())? model.getOrganizeCode() : AuthUtil.getOrganizeCode(), false); return ResultBean.success("NC处理成功"); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesPartShippingGroupController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesPartShippingGroupController.java index 929a29c..ef62414 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesPartShippingGroupController.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesPartShippingGroupController.java @@ -11,6 +11,7 @@ import cn.estsh.impp.framework.boot.util.ResultBean; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -40,7 +41,7 @@ public class MesPartShippingGroupController { //默认查询所有 // DdlPackBean listAllPackBean = DdlPackBean.getDdlPackBean("CK01"); - DdlPackBean listAllPackBean = DdlPackBean.getDdlPackBean(AuthUtil.getOrganizeCode()); + DdlPackBean listAllPackBean = DdlPackBean.getDdlPackBean(!StringUtils.isEmpty(partShippingGroup.getOrganizeCode())?partShippingGroup.getOrganizeCode():AuthUtil.getOrganizeCode()); ; return ResultBean.success("查询成功").setResultList(shippingGroupService.findAll(listAllPackBean)); } catch (ImppBusiException imppException) { diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesProduceSnPrintController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesProduceSnPrintController.java index 7952e0b..3b6e679 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesProduceSnPrintController.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesProduceSnPrintController.java @@ -13,6 +13,7 @@ import cn.estsh.impp.framework.boot.util.ValidatorBean; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -88,7 +89,7 @@ public class MesProduceSnPrintController { if (Objects.isNull(mesProduceSnPrintModel.getPrintQty()) || mesProduceSnPrintModel.getPrintQty() <= 0) { MesPcnException.throwMesBusiException("打印数量不能小于等于零"); } - mesProduceSnPrintModel.setUserName(AuthUtil.getSessionUser().getUserName()); + mesProduceSnPrintModel.setUserName(!StringUtils.isEmpty(mesProduceSnPrintModel.getUserName())?mesProduceSnPrintModel.getUserName():AuthUtil.getSessionUser().getUserName()); return ResultBean.success("查询成功").setResultObject(mesProduceSnPrintService.doPrint(mesProduceSnPrintModel)); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesRawPartChargingController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesRawPartChargingController.java index bd6cf3b..33f8a4f 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesRawPartChargingController.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesRawPartChargingController.java @@ -10,6 +10,7 @@ import cn.estsh.impp.framework.boot.util.ResultBean; import cn.estsh.impp.framework.boot.util.ValidatorBean; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; /** @@ -31,8 +32,8 @@ public class MesRawPartChargingController { public ResultBean findMesRawPackagePart(MesRawPartChargingModel mesRawPartChargingModel) { try { ValidatorBean.checkNotNull(mesRawPartChargingModel.getPackageSn(),"料筒条码不能为空"); - mesRawPartChargingModel.setUserName(AuthUtil.getSessionUser().getUserName()); - mesRawPartChargingModel.setOrganizeCode(AuthUtil.getOrganizeCode()); + mesRawPartChargingModel.setUserName(!StringUtils.isEmpty(mesRawPartChargingModel.getUserName())?mesRawPartChargingModel.getUserName():AuthUtil.getSessionUser().getUserName()); + mesRawPartChargingModel.setOrganizeCode(!StringUtils.isEmpty(mesRawPartChargingModel.getOrganizeCode())?mesRawPartChargingModel.getOrganizeCode():AuthUtil.getOrganizeCode()); return ResultBean.success("执行成功").setResultObject(mesRawPartChargingService.findMesRawPackagePart(mesRawPartChargingModel)); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); @@ -46,8 +47,8 @@ public class MesRawPartChargingController { public ResultBean doAction(@RequestBody MesRawPartChargingModel mesRawPartChargingModel) { try { ValidatorBean.checkNotNull(mesRawPartChargingModel.getType(), "操作类型不能为空"); - mesRawPartChargingModel.setUserName(AuthUtil.getSessionUser().getUserName()); - mesRawPartChargingModel.setOrganizeCode(AuthUtil.getOrganizeCode()); + mesRawPartChargingModel.setUserName(!StringUtils.isEmpty(mesRawPartChargingModel.getUserName())?mesRawPartChargingModel.getUserName():AuthUtil.getSessionUser().getUserName()); + mesRawPartChargingModel.setOrganizeCode(!StringUtils.isEmpty(mesRawPartChargingModel.getOrganizeCode())?mesRawPartChargingModel.getOrganizeCode():AuthUtil.getOrganizeCode()); return ResultBean.success("执行成功").setResultObject(mesRawPartChargingService.doAction(mesRawPartChargingModel)); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); 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 7253ad4..28a282d 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 @@ -40,7 +40,7 @@ public class MesReworkTaskController { @ApiOperation(value = "查询所有返工单") public ResultBean queryReworkTaskByPager(MesReworkTask reworkTask, Pager pager) { try { - reworkTask.setOrganizeCode(AuthUtil.getOrganizeCode()); + reworkTask.setOrganizeCode(!StringUtils.isEmpty(reworkTask.getOrganizeCode())?reworkTask.getOrganizeCode():AuthUtil.getOrganizeCode()); ListPager mesReworkTaskListPager = mesReworkTaskService.queryReworkTask(reworkTask, pager); return ResultBean.success("查询成功").setListPager(mesReworkTaskListPager); } catch (ImppBusiException imppException) { @@ -54,7 +54,7 @@ public class MesReworkTaskController { @ApiOperation(value = "根据条码查询返工详情") public ResultBean queryBySn(MesReworkTaskRequestModel requestModel) { try { - requestModel.setOrganizeCode(AuthUtil.getOrganizeCode()); + requestModel.setOrganizeCode(!StringUtils.isEmpty(requestModel.getOrganizeCode())?requestModel.getOrganizeCode():AuthUtil.getOrganizeCode()); MesReworkTaskModel mesReworkTaskModel = mesReworkTaskService.queryReworkTaskModel(requestModel); return ResultBean.success("查询成功").setResultObject(mesReworkTaskModel); } catch (ImppBusiException imppException) { diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesWorkOrderController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesWorkOrderController.java index f1a374a..22bec65 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesWorkOrderController.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/MesWorkOrderController.java @@ -12,6 +12,7 @@ import cn.estsh.impp.framework.boot.util.ResultBean; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -65,7 +66,7 @@ public class MesWorkOrderController { @ApiOperation(value = "生产报工") public ResultBean doProductReport(MesWorkOrder mesWorkOrder) { try { - workOrderService.doProductReport(mesWorkOrder, AuthUtil.getSessionUser().getUserName()); + workOrderService.doProductReport(mesWorkOrder, !StringUtils.isEmpty(mesWorkOrder.getModifyUser())?mesWorkOrder.getModifyUser():AuthUtil.getSessionUser().getUserName()); return ResultBean.success("报工成功") .setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()); } catch (ImppBusiException e) { diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/spot/MesSpotCheckOrderController.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/spot/MesSpotCheckOrderController.java index 3a0875d..7461784 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/spot/MesSpotCheckOrderController.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/controller/busi/spot/MesSpotCheckOrderController.java @@ -32,7 +32,7 @@ public class MesSpotCheckOrderController { @ApiOperation(value = "查询设备点检") public ResultBean findEquipmentSpotCheck(MesEquipmentSpotCheck spotCheckOrder) { try { - spotCheckOrder.setOrganizeCode(AuthUtil.getOrganizeCode()); + spotCheckOrder.setOrganizeCode(!StringUtils.isEmpty(spotCheckOrder.getOrganizeCode())?spotCheckOrder.getOrganizeCode():AuthUtil.getOrganizeCode()); return ResultBean.success("查询成功").setResultList(spotCheckOrderService.findEquipmentSpotCheck(spotCheckOrder)); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); @@ -48,7 +48,7 @@ public class MesSpotCheckOrderController { try { - spotCheckOrder.setOrganizeCode(AuthUtil.getOrganizeCode()); + spotCheckOrder.setOrganizeCode(!StringUtils.isEmpty(spotCheckOrder.getOrganizeCode())?spotCheckOrder.getOrganizeCode():AuthUtil.getOrganizeCode()); return ResultBean.success("查询成功").setResultList(spotCheckOrderService.queryEquipmentSpotCheck(spotCheckOrder)); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); @@ -66,7 +66,7 @@ public class MesSpotCheckOrderController { if (StringUtils.isEmpty(bean)) { throw new ImppBusiException("点检单不能为空"); } - bean.setOrganizeCode(AuthUtil.getOrganizeCode()); + bean.setOrganizeCode(!StringUtils.isEmpty(bean.getOrganizeCode())?bean.getOrganizeCode():AuthUtil.getOrganizeCode()); return ResultBean.success("扫描产品条码成功").setResultObject(spotCheckOrderService.insert(bean)); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); @@ -81,7 +81,7 @@ public class MesSpotCheckOrderController { try { - spotCheckOrder.setOrganizeCode(AuthUtil.getOrganizeCode()); + spotCheckOrder.setOrganizeCode(!StringUtils.isEmpty(spotCheckOrder.getOrganizeCode())?spotCheckOrder.getOrganizeCode():AuthUtil.getOrganizeCode()); return ResultBean.success("查询成功").setListPager(spotCheckOrderService.querySpotCheckOrder(spotCheckOrder, pager)); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); @@ -95,7 +95,7 @@ public class MesSpotCheckOrderController { public ResultBean queryWorkOrderByPager(MesSpotCheckOrder spotCheckOrder) { try { - spotCheckOrder.setOrganizeCode(AuthUtil.getOrganizeCode()); + spotCheckOrder.setOrganizeCode(!StringUtils.isEmpty(spotCheckOrder.getOrganizeCode())?spotCheckOrder.getOrganizeCode():AuthUtil.getOrganizeCode()); return ResultBean.success("查询成功").setResultObject(spotCheckOrderService.querySpotCheckOrderResult(spotCheckOrder)); } catch (ImppBusiException imppException) { @@ -120,7 +120,7 @@ public class MesSpotCheckOrderController { if (CollectionUtils.isEmpty(model.getOrderPartList())) { throw new ImppBusiException("点检明细零件不能为空"); } - return ResultBean.success("扫描产品条码成功").setResultObject(spotCheckOrderService.scanProduceSn(model, AuthUtil.getOrganizeCode())); + return ResultBean.success("扫描产品条码成功").setResultObject(spotCheckOrderService.scanProduceSn(model, !StringUtils.isEmpty(model.getOrganizeCode())?model.getOrganizeCode():AuthUtil.getOrganizeCode())); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); } catch (Exception e) { @@ -141,7 +141,7 @@ public class MesSpotCheckOrderController { if (CollectionUtils.isEmpty(model.getOrderResultList())) { throw new ImppBusiException("点检单明细不能为空"); } - return ResultBean.success("点检结果获取成功").setResultObject(spotCheckOrderService.queryEquipInfo(model, AuthUtil.getOrganizeCode())); + return ResultBean.success("点检结果获取成功").setResultObject(spotCheckOrderService.queryEquipInfo(model, !StringUtils.isEmpty(model.getOrganizeCode())?model.getOrganizeCode():AuthUtil.getOrganizeCode())); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); } catch (Exception e) { @@ -163,7 +163,7 @@ public class MesSpotCheckOrderController { throw new ImppBusiException("点检单明细不能为空"); } - spotCheckOrderService.saveCheck(model, AuthUtil.getOrganizeCode()); + spotCheckOrderService.saveCheck(model, !StringUtils.isEmpty(model.getOrganizeCode())?model.getOrganizeCode():AuthUtil.getOrganizeCode()); return ResultBean.success("完成点检成功"); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); @@ -183,7 +183,7 @@ public class MesSpotCheckOrderController { } - spotCheckOrderService.saveReCheck(model, AuthUtil.getOrganizeCode()); + spotCheckOrderService.saveReCheck(model, !StringUtils.isEmpty(model.getOrganizeCode())?model.getOrganizeCode():AuthUtil.getOrganizeCode()); return ResultBean.success("重新点检成功"); } catch (ImppBusiException imppException) { return ResultBean.fail(imppException); 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 a7a0f52..4548a16 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 @@ -78,8 +78,8 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService { @Override public ListPager queryReworkTask(MesReworkTask mesReworkTask, Pager pager) { - - DdlPackBean packBean = DdlPackBean.getDdlPackBean(AuthUtil.getOrganizeCode()); + String organizeCode = !StringUtils.isEmpty(mesReworkTask.getOrganizeCode())?mesReworkTask.getOrganizeCode():AuthUtil.getOrganizeCode(); + DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode); if (mesReworkTask.getSn() != null) { DdlPreparedPack.getStringEqualPack(mesReworkTask.getSn(), "sn", 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 d3bb7b1..26a5b45 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 @@ -238,7 +238,7 @@ public class MesBoxingErrorProofingService implements IMesBoxingErrorProofingSer } @Override - public void unLock(String organizeCode, String userName, String pwd) { + public void unLock(String organizeCode, String pwd) { String cfgValue = configService.getCfgValue(organizeCode, MesCommonConstant.BOXING_ERROR_PROOFING_PWD); if (!Objects.equals(cfgValue, pwd)) { MesPcnException.throwMesBusiException("解锁失败密码错误"); 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 2ff1307..8b51643 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 @@ -632,7 +632,8 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService private MesMove createMove(MesPartInspectionInputModel model, String source, String target, String org, String workCenterCode) { GenSerialNoModel serialNoModel = new GenSerialNoModel("INPUT_DEFECT_ZRSUM"); serialNoModel.setPartNo(model.getPart().getPartNo()); - ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, AuthUtil.getSessionUser().getUserName(), org, 1); +// ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, AuthUtil.getSessionUser().getUserName(), org, 1); + ResultBean rb = syncFuncService.syncSerialNo(serialNoModel, "系统", org, 1); String zrsum = ""; if (null != rb && !CollectionUtils.isEmpty(rb.getResultList())) { zrsum = (rb.getResultList().get(0)).toString(); @@ -653,7 +654,8 @@ public class MesInputDefectRecordService implements IMesInputDefectRecordService move.setMoveType(MesExtEnumUtil.MOVE_TYPE.SUSPICIOUS_MOVE.getValue()); move.setProductSn(model.getSn()); move.setWorkCenter(prodOrgExtService.getErpWorkCenterCode(org, workCenterCode)); - ConvertBean.serviceModelInitialize(move, AuthUtil.getSessionUser().getUserName()); +// ConvertBean.serviceModelInitialize(move, AuthUtil.getSessionUser().getUserName()); + ConvertBean.serviceModelInitialize(move, "系统"); return move; } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesShippingLoadingCheckService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesShippingLoadingCheckService.java index 2664963..7363961 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesShippingLoadingCheckService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesShippingLoadingCheckService.java @@ -66,6 +66,7 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS //若生成装车单,则一定有装车单明细 DdlPackBean orderDetailPackBean = DdlPackBean.getDdlPackBean(loadingList.getOrganizeCode()); DdlPreparedPack.getNumEqualPack(loadingListResult.getId(), "pid", orderDetailPackBean); + DdlPreparedPack.getNumberSmallerPack(MesExtEnumUtil.LOADING_ORDER_DETAIL_SHIPPING_STATUS.CLOSE.getValue(),"status",orderDetailPackBean); DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"seq"}, orderDetailPackBean); List detailList = vehiclesOrderDetailRepository.findByHqlWhere(orderDetailPackBean); @@ -80,7 +81,7 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS } MesShippingLoadingCheckModel model = new MesShippingLoadingCheckModel(); - Long count = detailList.stream().filter(k -> k.getStatus() == MesExtEnumUtil.LOADING_ORDER_DETAIL_SHIPPING_STATUS.SHIPPINGED.getValue()).count(); + Long count = detailList.stream().filter(k -> k.getStatus() == MesExtEnumUtil.LOADING_ORDER_DETAIL_SHIPPING_STATUS.SHIPPINGED.getValue() || k.getStatus() == MesExtEnumUtil.LOADING_ORDER_DETAIL_SHIPPING_STATUS.SKIP.getValue()).count(); model.setIsScanCount(count.intValue()); model.setOrderCode(loadingList.getOrderCode()); @@ -96,7 +97,7 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS } detailList.forEach(k -> { - if (k.getStatus() == MesExtEnumUtil.LOADING_ORDER_DETAIL_SHIPPING_STATUS.SHIPPINGED.getValue()){ + if (k.getStatus() == MesExtEnumUtil.LOADING_ORDER_DETAIL_SHIPPING_STATUS.SHIPPINGED.getValue() || k.getStatus() == MesExtEnumUtil.LOADING_ORDER_DETAIL_SHIPPING_STATUS.SKIP.getValue()){ k.setScanSn(k.getShippingCode()); k.setTempStatus(MesCommonConstant.TRUE_INTEGER); k.setTempStatusVal("扫描完成"); @@ -235,7 +236,9 @@ public class MesShippingLoadingCheckService implements IMesShippingLoadingCheckS } private void updateLoadingListDetail(MesShippingLoadingCheckModel model, String userInfo, MesLoadingList loadingList, MesLoadingListDetail loadingListDetail, String tempStatusVal, Integer status) { - loadingListDetail.setScanSn(model.getShippingCode()); + if(MesExtEnumUtil.LOADING_ORDER_DETAIL_SHIPPING_STATUS.SHIPPINGED.getValue() == status){ + loadingListDetail.setScanSn(model.getShippingCode()); + } loadingListDetail.setTempStatus(MesCommonConstant.TRUE_INTEGER); loadingListDetail.setTempStatusVal(tempStatusVal); 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 56c3411..ba5e294 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 @@ -179,11 +179,12 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService DdlPackBean orderDetailPackBean = DdlPackBean.getDdlPackBean(shippingOrderManagement.getOrganizeCode()); DdlPreparedPack.getNumEqualPack(orderManagement.getId(), "pid", orderDetailPackBean); + DdlPreparedPack.getNumberSmallerPack(MesExtEnumUtil.SHIPPING_ORDER_DETAIL_SHIPPING_STATUS.CLOSE.getValue(),"status",orderDetailPackBean); DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"custInfoSeq"}, orderDetailPackBean); List detailList = shippingOrderManagementDetailRepository.findByHqlWhere(orderDetailPackBean); detailList.forEach(k -> { - if (!StringUtils.isEmpty(k.getBarcode())) { + if (k.getStatus() == MesExtEnumUtil.SHIPPING_ORDER_DETAIL_SHIPPING_STATUS.SHIPPINGED.getValue() || k.getStatus() == MesExtEnumUtil.SHIPPING_ORDER_DETAIL_SHIPPING_STATUS.SKIP.getValue()){ k.setIsScanFlg(MesCommonConstant.TRUE_INTEGER); } }); @@ -230,7 +231,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService MesProduceSn produceSn = checkSn(model, organizeCode); boolean scanFlg = false; for (MesShippingOrderManagementDetail detail : model.getDetailList()) { - if (detail.getPartNo().equals(produceSn.getPartNo()) && StringUtils.isEmpty(detail.getBarcode())) { + if (detail.getPartNo().equals(produceSn.getPartNo()) && StringUtils.isEmpty(detail.getBarcode()) && !Objects.equals(detail.getIsScanFlg(), MesCommonConstant.TRUE_INTEGER)) { //校验发运单明细顺序 if(!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(); @@ -261,7 +262,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService } - Long count = model.getDetailList().stream().filter(k -> k.getIsScanFlg() == MesCommonConstant.TRUE_INTEGER).count(); + Long count = model.getDetailList().stream().filter(k -> Objects.equals(k.getIsScanFlg(), MesCommonConstant.TRUE_INTEGER)).count(); model.setIsScanCount(count.intValue()); //当前发运单全部扫描完成 并且不需要扫位置码 @@ -275,7 +276,9 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService } private void updateOrderManagementDetails(String userInfo, MesProduceSn produceSn, MesShippingOrderManagement orderManagement, MesShippingOrderManagementDetail detail,Integer status,String remark) { - detail.setBarcode(produceSn.getProductSn()); + if(MesExtEnumUtil.SHIPPING_ORDER_DETAIL_SHIPPING_STATUS.SHIPPINGED.getValue() == status){ + detail.setBarcode(produceSn.getProductSn()); + } if (StringUtils.isEmpty(orderManagement.getCheckSeqCode())) { detail.setIsScanFlg(MesCommonConstant.TRUE_INTEGER); @@ -396,7 +399,7 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService } private MesShippingOrderManagementDetail getMesShippingOrderManagementDetail(MesSortShippingCheckModel model, String org) { - List detailList = model.getDetailList().stream().filter(k -> !StringUtils.isEmpty(k.getCustPartNo()) && model.getSn().startsWith(k.getCustPartNo()) && StringUtils.isEmpty(k.getBarcode())).collect(Collectors.toList()); + List detailList = model.getDetailList().stream().filter(k -> !StringUtils.isEmpty(k.getCustPartNo()) && model.getSn().startsWith(k.getCustPartNo()) && StringUtils.isEmpty(k.getBarcode()) && !Objects.equals(k.getIsScanFlg(), MesCommonConstant.TRUE_INTEGER)).collect(Collectors.toList()); MesShippingOrderManagementDetail mesShippingOrderManagementDetail = null; for (MesShippingOrderManagementDetail managementDetail : detailList) { DdlPackBean packBean = DdlPackBean.getDdlPackBean(org); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnCheckNosortStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnCheckNosortStepService.java index d0b1472..b430d49 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnCheckNosortStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnCheckNosortStepService.java @@ -119,35 +119,54 @@ public class MesProductSnCheckNosortStepService extends BaseStepService { String suffixMsg = !StringUtils.isEmpty(stepResult.getMsg()) ? stepResult.getMsg() + MesPcnExtConstWords.SEMICOLON : MesPcnExtConstWords.EMPTY; - List standardList = produceSnList.stream().filter(o -> (null != o && o.getSnStatus().compareTo(MesExtEnumUtil.PRODUCE_SN_STATUS.UNKNOW.getValue()) != 0)).sorted(Comparator.comparing(MesProduceSn::getCreateDatetime).reversed()).collect(Collectors.toList()); - List unknowList = produceSnList.stream().filter(o -> (null != o && o.getSnStatus().compareTo(MesExtEnumUtil.PRODUCE_SN_STATUS.UNKNOW.getValue()) == 0)).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(unknowList) && unknowList.size() > 1) { + return stepResult.isCompleted(false).msg(String.format("%s主条码[%s]信息异常,存在[%s]条[未知]状态的记录", suffixMsg, equipVariableCollectContext.getEquipVariableValue(), unknowList.size())); + } + if (!CollectionUtils.isEmpty(unknowList) && checkAllowUnknowCenterCfg(reqBean) && (unknowList.size() > 1 || (!unknowList.get(0).getWorkCenterCode().equals(reqBean.getWorkCenterCode()) || !unknowList.get(0).getWorkCellCode().equals(reqBean.getWorkCellCode())))) { return stepResult.isCompleted(false).msg(String.format("%s主条码[%s]信息条码状态已被%s标记[未知]", suffixMsg, equipVariableCollectContext.getEquipVariableValue(), unknowList.stream().filter(o -> null != o).map(o -> new StringJoiner(MesPcnExtConstWords.AND).add(o.getWorkCenterCode()).add(o.getWorkCellCode()).toString()).collect(Collectors.joining(MesPcnExtConstWords.SEMICOLON)))); } - if (CollectionUtils.isEmpty(standardList)) { + produceSnList = produceSnList.stream().filter(o -> null != o).sorted(Comparator.comparing(MesProduceSn::getCreateDatetime).reversed()).collect(Collectors.toList()); + + MesProduceSn produceSn = produceSnList.get(0); + + if (produceSn.getQcStatus().compareTo(MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue()) != 0 && produceSn.getQcStatus().compareTo(MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS_TO_QUALIFIED.getValue()) != 0) + return stepResult.isCompleted(false).msg(String.format("%s主条码[%s]质量状态[%s]", suffixMsg, equipVariableCollectContext.getEquipVariableValue(), MesExtEnumUtil.PRODUCE_QC_STATUS.valueOfDescription(produceSn.getQcStatus()))); + + if (produceSn.getSnStatus().compareTo(MesExtEnumUtil.PRODUCE_SN_STATUS.ASSEMBLY_BACK.getValue()) > 0) + return stepResult.isCompleted(false).msg(String.format("%s主条码[%s]条码状态[%s]", suffixMsg, equipVariableCollectContext.getEquipVariableValue(), MesExtEnumUtil.PRODUCE_SN_STATUS.valueOfDescription(produceSn.getSnStatus()))); - productionPsInContextList.add(new MesProductionPsInContext( - reqBean.getOrganizeCode(), equipVariableCollectContext.getEquipVariableValue()).messageSource(equipVariableCollectContext.getMessageSource()).relateId(unknowList.get(0).getId(), unknowList.get(0).getProcessCode(), unknowList.get(0).getCraftCode())); + //正常条码 + if (produceSn.getSnStatus().compareTo(MesExtEnumUtil.PRODUCE_SN_STATUS.UNKNOW.getValue()) != 0) { - } else { + productionPsInContextList.add(new MesProductionPsInContext(workCell, produceSn).messageSource(equipVariableCollectContext.getMessageSource())); - if (MesExtEnumUtil.PRODUCE_QC_STATUS.QUALIFIED.getValue() != standardList.get(0).getQcStatus() && - MesExtEnumUtil.PRODUCE_QC_STATUS.SUSPICIOUS_TO_QUALIFIED.getValue() != standardList.get(0).getQcStatus()) - return stepResult.isCompleted(false).msg(String.format("%s主条码[%s]质量状态[%s]", suffixMsg, equipVariableCollectContext.getEquipVariableValue(), MesExtEnumUtil.PRODUCE_QC_STATUS.valueOfDescription(standardList.get(0).getQcStatus()))); + return stepResult; + } + + //未知条码【工序为空 代表新做的工序没有加工完成】 + if (StringUtils.isEmpty(produceSn.getProcessCode()) && produceSnList.size() > 1) { + + productionPsInContextList.add(new MesProductionPsInContext(workCell, produceSnList.get(1)).messageSource(equipVariableCollectContext.getMessageSource()).relateId(produceSn.getId())); - if (MesExtEnumUtil.PRODUCE_SN_STATUS.ASSEMBLY_BACK.getValue() < standardList.get(0).getSnStatus()) - return stepResult.isCompleted(false).msg(String.format("%s主条码[%s]条码状态[%s]", suffixMsg, equipVariableCollectContext.getEquipVariableValue(), MesExtEnumUtil.PRODUCE_SN_STATUS.valueOfDescription(standardList.get(0).getSnStatus()))); + return stepResult; + } + + //未知条码【工序为空 代表新做的工序没有加工完成】【只有一条条码记录 代表是打印的条码自进自出直接被标记为未知】 + if (StringUtils.isEmpty(produceSn.getProcessCode())) { - MesProductionPsInContext productionPsInContext = new MesProductionPsInContext(workCell, standardList.get(0)).messageSource(equipVariableCollectContext.getMessageSource()); - if (!CollectionUtils.isEmpty(unknowList)) productionPsInContext.relateId(unknowList.get(0).getId(), unknowList.get(0).getProcessCode(), unknowList.get(0).getCraftCode()); - productionPsInContextList.add(productionPsInContext); + productionPsInContextList.add(new MesProductionPsInContext(reqBean.getOrganizeCode(), equipVariableCollectContext.getEquipVariableValue()).messageSource(equipVariableCollectContext.getMessageSource()).relateId(produceSn.getId())); + return stepResult; } + //未知条码【工序不为空 代表已完成的工序被重做后没有加工完成】 + productionPsInContextList.add(new MesProductionPsInContext(workCell, produceSn).messageSource(equipVariableCollectContext.getMessageSource()).relateId(produceSn.getId())); + return stepResult; } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnCheckSortStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnCheckSortStepService.java index b8fc600..9489aa0 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnCheckSortStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnCheckSortStepService.java @@ -90,7 +90,7 @@ public class MesProductSnCheckSortStepService extends BaseStepService { //封装 读/扫主条件信息到进料主条码数据信息中 List productionPsInContextList = new ArrayList<>(); - if (!CollectionUtils.isEmpty(productSnList)) equipVariableCollectContextList.stream().filter(o -> null != o).forEach(o -> productionPsInContextList.add(new MesProductionPsInContext(workCell, produceSnMap.get(o.getEquipVariableValue()).get(0)).messageSource(o.getMessageSource()).queueId(queueOrderMap.get(o).get(0).getId()))); + if (!CollectionUtils.isEmpty(productSnList)) equipVariableCollectContextList.stream().filter(o -> null != o).forEach(o -> productionPsInContextList.add(new MesProductionPsInContext(workCell, produceSnMap.get(o.getEquipVariableValue()).get(0)).messageSource(o.getMessageSource()).relateId(queueOrderMap.get(o).get(0).getId()))); //获取进料主条码数据信息 List productionPsInContext = productionDispatchContextStepService.getProductionPsInContext(reqBean); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnGenerateStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnGenerateStepService.java index 4303e76..bd08357 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnGenerateStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductSnGenerateStepService.java @@ -14,6 +14,7 @@ import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil; import cn.estsh.i3plus.pojo.mes.bean.MesPart; import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn; +import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell; import cn.estsh.i3plus.pojo.mes.bean.MesWorkCenter; import cn.estsh.i3plus.pojo.mes.model.GenSerialNoModel; import cn.estsh.i3plus.pojo.mes.model.StationRequestBean; @@ -29,8 +30,10 @@ 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.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.UUID; import java.util.stream.Collectors; /** @@ -113,6 +116,8 @@ public class MesProductSnGenerateStepService extends BaseStepService { List partNoList = (prodRuleContextList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getOutPartNo()))).map(MesProdRuleContext::getOutPartNo).collect(Collectors.toList())).stream().filter(o -> !StringUtils.isEmpty(o)).distinct().collect(Collectors.toList()); firstMouldNoReadStepService.savePartDataMap(reqBean, resultBean, stepResult, partNoList, false); + //从上下文中取出工位对象 + MesWorkCell workCell = productionProcessContext.getWorkCell(); //获取上下文加工结果 String productResult = productionDispatchContextStepService.getProductResultContext(reqBean); @@ -123,7 +128,7 @@ public class MesProductSnGenerateStepService extends BaseStepService { //循环生成零件条码,并写入产出零件 List productionPsOutContextList = new ArrayList<>(); prodRuleContextList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getForeignKey()) && !StringUtils.isEmpty(o.getOutPartNo()))).forEach(o -> { - MesProductionPsOutContext productionPsOutContext = insertProduceSnData(reqBean, resultBean, stepResult, productionProcessContext, o, ppMap, psMap, partMap, prodShiftContext, productResult); + MesProductionPsOutContext productionPsOutContext = insertProduceSnData(reqBean, resultBean, stepResult, productionProcessContext, workCell, o, ppMap, psMap, partMap, prodShiftContext, productResult); if (null != productionPsOutContext) productionPsOutContextList.add(productionPsOutContext); }); @@ -135,7 +140,7 @@ public class MesProductSnGenerateStepService extends BaseStepService { } //生成零件条码 - private MesProductionPsOutContext insertProduceSnData(StationRequestBean reqBean, StationResultBean resultBean, StepResult stepResult, MesProductionProcessContext productionProcessContext, MesProdRuleContext prodRuleContext, + private MesProductionPsOutContext insertProduceSnData(StationRequestBean reqBean, StationResultBean resultBean, StepResult stepResult, MesProductionProcessContext productionProcessContext, MesWorkCell workCell, MesProdRuleContext prodRuleContext, Map ppMap, Map psMap, Map partMap, MesProdShiftContext prodShiftContext, String productResult) { //产出零件数据信息 @@ -147,6 +152,8 @@ public class MesProductSnGenerateStepService extends BaseStepService { //加工规则中进料零件与产出零件是否一致 Boolean isSamePart = isSamePart(productionPsInContext, productionPartContext); + //工位是否不累计工单完成数 + Boolean isCellNoCalcQty = isCellNoCalcQty(workCell.getNoCalcOrderQty()); MesProduceSn produceSn; //进出一致, 不累计工单完成数量 在显示装配件工步中已经验证了 进出一致 进出存在工单则必须一致 @@ -205,7 +212,7 @@ public class MesProductSnGenerateStepService extends BaseStepService { produceSn = produceSnExtService.insert(produceSn); } else produceSnExtService.updateNoSync(produceSn); - return new MesProductionPsOutContext().copy(produceSn, prodRuleContext.getForeignKey()).isCalcCompleteQty(!StringUtils.isEmpty(produceSn.getWorkOrderNo()) && !isSamePart); + return new MesProductionPsOutContext().copy(produceSn, prodRuleContext.getForeignKey()).isCalcCompleteQty(isCalcCompleteQty(isCellNoCalcQty, produceSn.getWorkOrderNo(), isSamePart, productionPartContext, productionPsInContext)); } @@ -230,6 +237,7 @@ public class MesProductSnGenerateStepService extends BaseStepService { return part.getProductMatchRule(); } + //加工规则中进料零件与产出零件是否一致 private Boolean isSamePart(MesProductionPsInContext productionPsInContext, MesProductionPartContext productionPartContext) { if (null == productionPsInContext) return false; if (StringUtils.isEmpty(productionPsInContext.getPartNo())) return false; @@ -238,4 +246,26 @@ public class MesProductSnGenerateStepService extends BaseStepService { return true; } + //工位是否不累计工单完成数 + private Boolean isCellNoCalcQty(Integer noCalcOrderQty) { + return (!StringUtils.isEmpty(noCalcOrderQty) && noCalcOrderQty.compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0) ? true : false; + } + + //判断是否累计工单完成数 + private Boolean isCalcCompleteQty(Boolean isCellNoCalcQty, String workOrderNo, Boolean isSamePart, MesProductionPartContext productionPartContext, MesProductionPsInContext productionPsInContext) { + if (isCellNoCalcQty) return false; + if (StringUtils.isEmpty(workOrderNo)) return false; + if (checkIsSameWorkOrder(isSamePart, productionPartContext, productionPsInContext)) return false; + return true; + } + + //进出一致的情况下判断进出是否都存在工单 + private Boolean checkIsSameWorkOrder(Boolean isSamePart, MesProductionPartContext productionPartContext, MesProductionPsInContext productionPsInContext) { + if (!isSamePart) return false; + //进出零件一致则无需验证进出的对象为空 + if (StringUtils.isEmpty(productionPartContext.getWorkOrderNo()) || StringUtils.isEmpty(productionPsInContext.getWorkOrderNo())) return false; + //无需验证进出的工单是否一致,在匹配加工规则的时候已经验证了必须一致 + return true; + } + } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/resources/application.properties b/modules/i3plus-ext-mes-pcn-apiservice/src/main/resources/application.properties index ccbee59..47d2f62 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/resources/application.properties +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/resources/application.properties @@ -1,5 +1,5 @@ #\u4F7F\u7528\u914D\u7F6E -spring.profiles.active=71 +spring.profiles.active=docker #\u9879\u76EE\u63CF\u8FF0\u4FE1\u606F\uFF08swagger\u4E2D\u663E\u5F0F\uFF09\uFF0C\u4E2D\u6587\u4F7F\u7528uncode\u8F6C\u7801 desc.application.name=\u751F\u4EA7\u4E2D\u5FC3\u8282\u70B9 ######### \u81EA\u5B9A\u4E49\u53C2\u6570 ######### @@ -13,7 +13,7 @@ spring.message.encoding=UTF-8 #\u542F\u52A8\u65F6\u52A0\u8F7D\uFF0C\u9884\u52A0\u8F7Dcontroller spring.mvc.servlet.load-on-startup=1 #\u662F\u5426\u5141\u8BB8\u524D\u7AEF\u8DE8\u57DF\u63D0\u4EA4impp.web.cross.hosts -impp.web.cross=trueWorkCellCacheDataRedisFilterService +impp.web.cross=true #\u4E0A\u4F20\u5355\u4E2A\u6587\u4EF6\u5927\u5C0F spring.servlet.multipart.max-file-size=10MB #request\u8BF7\u6C42\u5168\u90E8\u6570\u636E\u6700\u5927\u9650\u5236 diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionPsInContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionPsInContext.java index 5306ec5..3fcb6f7 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionPsInContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionPsInContext.java @@ -105,15 +105,8 @@ public class MesProductionPsInContext implements Serializable { return this; } - public MesProductionPsInContext relateId(Long relateId, String processCode, String craftCode) { + public MesProductionPsInContext relateId(Long relateId) { this.relateId = relateId; - if (!StringUtils.isEmpty(processCode)) this.processCode = processCode; - if (!StringUtils.isEmpty(craftCode)) this.craftCode = craftCode; - return this; - } - - public MesProductionPsInContext queueId(Long queueId) { - this.relateId = queueId; return this; } diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesNcProcessingInputModel.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesNcProcessingInputModel.java index 0e89103..28f0f95 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesNcProcessingInputModel.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesNcProcessingInputModel.java @@ -41,6 +41,9 @@ public class MesNcProcessingInputModel { @ApiParam("版本号") private String productVersion; + @ApiParam + private String organizeCode; + @ApiParam("NC-零件检测详情") private List partInspectionDetailList; diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesSpotCheckOrderModel.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesSpotCheckOrderModel.java index 2cdccc3..e2d041e 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesSpotCheckOrderModel.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesSpotCheckOrderModel.java @@ -31,5 +31,8 @@ public class MesSpotCheckOrderModel { @ApiParam("扫描条码") private String produceSn; + @ApiParam("工厂代码") + private String organizeCode; + }