From 92856e6ccf8f3f79b645e0ad96c87cbf5bf91819 Mon Sep 17 00:00:00 2001 From: jason Date: Tue, 17 Jun 2025 09:52:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dspotbugs=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/pcn/apiservice/aspect/PcnPojoAspect.java | 2 - .../busi/MesInputDefectRecordController.java | 2 +- .../apiservice/daoimpl/MesInsertBatchDaoImpl.java | 4 +- .../mes/pcn/apiservice/mqtt/PcnMqttCallback.java | 8 +-- .../ext/mes/pcn/apiservice/mqtt/PcnMqttClient.java | 21 ++++-- .../schedulejob/MesCheckSyncDataJob.java | 6 -- .../apiservice/schedulejob/MesMeterReadingJob.java | 3 +- .../apiservice/schedulejob/MesReportNoSortJob.java | 1 - .../serviceimpl/base/MesEquipmentLogService.java | 2 +- .../serviceimpl/base/MesMaximoServiceImpl.java | 32 +++++----- .../base/MesPojoVersionServiceImpl.java | 4 +- .../serviceimpl/base/MesReworkTaskServiceImpl.java | 72 ++++++++++----------- .../serviceimpl/busi/MesAssemblyExtService.java | 4 +- .../busi/MesBoxingErrorProofingService.java | 1 - .../busi/MesCheckSyncDataServiceImpl.java | 7 -- .../busi/MesEarlyWarningServiceImpl.java | 10 ++- .../busi/MesFengRenBatchReportService.java | 12 ++-- .../serviceimpl/busi/MesNcProcessingService.java | 1 - .../busi/MesNingDeShippingCheckService.java | 11 ++-- .../serviceimpl/busi/MesProduceSnPrintService.java | 4 +- .../busi/MesProductionRecordService.java | 4 +- .../busi/MesSortShippingCheckService.java | 4 +- .../serviceimpl/busi/MesStationServiceImpl.java | 2 +- .../serviceimpl/busi/MesWorkOrderService.java | 41 ++++++------ ...eckVolvoRackNoAndPartNoStrategyServiceImpl.java | 2 +- .../ford/MesFordFetchWebServiceImpl.java | 4 -- .../MesWorkOrderCalcQtyRestoreDispatchService.java | 14 ++-- .../MesWorkOrderOfflineRestoreDispatchService.java | 8 +-- .../MesNoSortCustSnNumberRuleStrategyService.java | 1 - .../ChengDuVolvoShippingPrintStrategyService.java | 1 - .../strategy/ChengDuVolvoPartPrintStrategy.java | 2 +- ...MesNumberRuleMatchRegularExpressionService.java | 2 +- .../rulematch/MesTimeEfficientCfgMatchService.java | 72 ++++++++++----------- .../strategy/OrderWriteVariableService.java | 19 ------ .../strategy/PartWriteVariableService.java | 28 -------- .../MesFunctionPackageProgressService.java | 11 ++-- .../function/MesFunctionQueueOrderPushService.java | 2 +- .../MesProductionCustomContextStepService.java | 2 +- .../MesProductionDispatchContextStepService.java | 2 +- .../MesWorkOrderCheckCompleteQtyStepService.java | 14 ++-- .../pcn/pojo/context/MesAssemblyShowContext.java | 6 +- .../pcn/pojo/context/MesPackageDataContext.java | 2 + .../pcn/pojo/context/MesPackageRuleContext.java | 34 +++++----- .../ext/mes/pcn/pojo/context/MesPartContext.java | 4 +- .../mes/pcn/pojo/context/MesProdRuleContext.java | 12 ++-- .../pcn/pojo/context/MesProdTempDataContext.java | 4 +- .../pojo/context/MesProductionAssemblyContext.java | 74 +++++++++++----------- .../MesProductionAssemblyNosortContext.java | 16 +++-- .../context/MesProductionAssemblySortContext.java | 12 ++-- .../pojo/context/MesProductionProcessContext.java | 32 ++++++---- .../pcn/pojo/context/MesProductionPsInContext.java | 2 +- .../mes/pcn/pojo/model/MesProduceSnPrintModel.java | 3 + pom.xml | 12 ++-- spotbugs-exclude.xml | 16 +++++ 54 files changed, 319 insertions(+), 352 deletions(-) create mode 100644 spotbugs-exclude.xml diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/aspect/PcnPojoAspect.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/aspect/PcnPojoAspect.java index 7f4cc2e..648057e 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/aspect/PcnPojoAspect.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/aspect/PcnPojoAspect.java @@ -41,11 +41,9 @@ public class PcnPojoAspect { @After("controllerPointcut()") public void after(JoinPoint joinPoint){ - Object[] objs = joinPoint.getArgs(); String methodName = joinPoint.getSignature().getName(); if (methodName.startsWith("save") || methodName.startsWith("update")) { Object[] args = joinPoint.getArgs(); - List list = new ArrayList<>(); for (Object arg : args) { if (arg.getClass().isArray()) { int len = Array.getLength(arg); 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 6891cd8..6c11c50 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 @@ -72,7 +72,7 @@ public class MesInputDefectRecordController { ValidatorBean.checkNotNull(model.getOrganizeCode(), "工厂不能为空"); ValidatorBean.checkNotNull(model.getUserInfo(), "操作人不能为空"); if (StringUtils.isEmpty(model.getSn()) && - (StringUtils.isEmpty(model.getPartNo()) || StringUtils.isEmpty(model.getLotNo()) || StringUtils.isEmpty(model.getQty()) || MathOperation.compareTo(model.getQty(), new Double(0)) == 0)) { + (StringUtils.isEmpty(model.getPartNo()) || StringUtils.isEmpty(model.getLotNo()) || model.getQty() == null || MathOperation.compareTo(model.getQty(), 0) == 0)) { throw new ImppBusiException("条码为空或零件号+批次+数量为空"); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/daoimpl/MesInsertBatchDaoImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/daoimpl/MesInsertBatchDaoImpl.java index 6696fc0..8e5a18f 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/daoimpl/MesInsertBatchDaoImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/daoimpl/MesInsertBatchDaoImpl.java @@ -92,8 +92,8 @@ public class MesInsertBatchDaoImpl implements IMesInsertBatchDao { parameterMap.put(new StringJoiner(MesPcnExtConstWords.E_UNDERLINE).add(splitField[j]).add(String.valueOf(i)).toString(), logList.get(i).getTypeCode()); Query queryObject = entityManager.createNativeQuery(insertStr + fieldBuilder.substring(MesPcnExtConstWords.ZERO, fieldBuilder.lastIndexOf(MesPcnExtConstWords.COMMA) - MesPcnExtConstWords.ONE).replaceAll("%s", String.valueOf(i)) + " ); "); //数据填充 - for (String key : parameterMap.keySet()) { - queryObject.setParameter(key, parameterMap.get(key)); + for (Map.Entry entry : parameterMap.entrySet()) { + queryObject.setParameter(entry.getKey(), entry.getValue()); } queryObject.executeUpdate(); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/mqtt/PcnMqttCallback.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/mqtt/PcnMqttCallback.java index a3807b2..2fcdd21 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/mqtt/PcnMqttCallback.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/mqtt/PcnMqttCallback.java @@ -23,7 +23,7 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; @Slf4j -public class PcnMqttCallback implements MqttCallbackExtended { +public final class PcnMqttCallback implements MqttCallbackExtended { private static ExecutorService executorService = new ThreadPoolExecutor(100, 100, 0L, TimeUnit.MILLISECONDS, @@ -113,15 +113,15 @@ public class PcnMqttCallback implements MqttCallbackExtended { */ @Override public void messageArrived(String topic, MqttMessage mqttMessage) { - log.info("== pcnMqttCallback ==> messageArrived 接收消息主题: {},接收消息内容: {}", topic, new String(mqttMessage.getPayload())); + log.info("== pcnMqttCallback ==> messageArrived 接收消息主题: {},接收消息内容: {}", topic, new String(mqttMessage.getPayload(), StandardCharsets.UTF_8)); executorService.execute(() -> saveData(topic, mqttMessage)); } private void saveData(String topic, MqttMessage mqttMessage) { - log.info("== pcnMqttCallback ==> messageArrived 接收消息主题: {},异步处理开始 消息内容: {}", topic, new String(mqttMessage.getPayload())); + log.info("== pcnMqttCallback ==> messageArrived 接收消息主题: {},异步处理开始 消息内容: {}", topic, new String(mqttMessage.getPayload(), StandardCharsets.UTF_8)); try{ - String resStr = new String(mqttMessage.getPayload(), "UTF-8").trim(); + String resStr = new String(mqttMessage.getPayload(), StandardCharsets.UTF_8).trim(); /** * 根据订阅的主题分别处理业务。可以通过if-else或者策略模式来分别处理不同的主题消息。 */ diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/mqtt/PcnMqttClient.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/mqtt/PcnMqttClient.java index 4c6fe2b..010579e 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/mqtt/PcnMqttClient.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/mqtt/PcnMqttClient.java @@ -23,7 +23,7 @@ public class PcnMqttClient { /** * MQTT 客户端 */ - private static MqttClient client; + private static volatile MqttClient client; /** * 服务 @@ -76,7 +76,11 @@ public class PcnMqttClient { */ public void connect() throws MqttException { if (client == null) { - client = new MqttClient(host, clientId, new MemoryPersistence()); + synchronized (PcnMqttClient.class) { + if (client == null) { + client = new MqttClient(host, clientId, new MemoryPersistence()); + } + } // 设置回调 client.setCallback(new PcnMqttCallback(PcnMqttClient.this, equipmentLogService)); } @@ -97,7 +101,11 @@ public class PcnMqttClient { */ public void unconnect() throws MqttException { if (client == null) { - client = new MqttClient(host, clientId, new MemoryPersistence()); + synchronized (PcnMqttClient.class) { + if (client == null) { + client = new MqttClient(host, clientId, new MemoryPersistence()); + } + } // 设置回调 client.setCallback(new PcnMqttCallback(PcnMqttClient.this)); } @@ -131,11 +139,14 @@ public class PcnMqttClient { MqttTopic mqttTopic = PcnMqttClient.getClient().getTopic(topic); if (null == mqttTopic) { log.error("== MyMqttClient ==> topic is not exist"); + return; } MqttDeliveryToken token;//Delivery:配送 - synchronized (this) {//注意:这里一定要同步,否则,在多线程publish的情况下,线程会发生死锁,分析见文章最后补充 + //注意:这里一定要同步,否则,在多线程publish的情况下,线程会发生死锁,分析见文章最后补充 + synchronized (this) { try { - token = mqttTopic.publish(message);//也是发送到执行队列中,等待执行线程执行,将消息发送到消息中间件 + //也是发送到执行队列中,等待执行线程执行,将消息发送到消息中间件 + token = mqttTopic.publish(message); token.waitForCompletion(1000L); } catch (MqttPersistenceException e) { e.printStackTrace(); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/schedulejob/MesCheckSyncDataJob.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/schedulejob/MesCheckSyncDataJob.java index bcef887..a4d005c 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/schedulejob/MesCheckSyncDataJob.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/schedulejob/MesCheckSyncDataJob.java @@ -37,16 +37,10 @@ public class MesCheckSyncDataJob extends BaseMesScheduleJob { String jobParam = this.getJobParam(); JSONObject params= JSONUtil.parseObj(jobParam); String organizeCode = params.getStr("organizeCode"); - String email = params.getStr("email"); if (StringUtils.isEmpty(organizeCode)){ log.info("保存工艺参数JOB --- ERROR --- JOB未配置工厂参数"); return; } - - - - - } } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/schedulejob/MesMeterReadingJob.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/schedulejob/MesMeterReadingJob.java index 582fce3..1bc5fd9 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/schedulejob/MesMeterReadingJob.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/schedulejob/MesMeterReadingJob.java @@ -26,9 +26,10 @@ import java.util.List; @Component @ApiOperation("仪表读数job") public class MesMeterReadingJob extends BaseMesScheduleJob { + private static final long serialVersionUID = 4556321104575284415L; @Autowired - private MesMaximoServiceImpl maximoService; + private transient MesMaximoServiceImpl maximoService; public MesMeterReadingJob() { super(MesMeterReadingJob.class, "仪表读数job"); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/schedulejob/MesReportNoSortJob.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/schedulejob/MesReportNoSortJob.java index 463d866..a6f8881 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/schedulejob/MesReportNoSortJob.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/schedulejob/MesReportNoSortJob.java @@ -93,7 +93,6 @@ public class MesReportNoSortJob extends BaseMesScheduleJob { return; } try { - Map map = new HashMap<>(); for (MesProductionRecord mesProductionRecord : unReportMesProduceSn) { workOrderService.doProductHasOrderReportByRecord(mesProductionRecord, organizeCode, userName); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesEquipmentLogService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesEquipmentLogService.java index f023b9d..ba6de81 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesEquipmentLogService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesEquipmentLogService.java @@ -217,7 +217,7 @@ public class MesEquipmentLogService implements IMesEquipmentLogService { private MesEquipmentVariable getMesEquipmentVariable(EquipLogMqttMsg equipLogMqttMsg) { String variableKey = getVariableKey(equipLogMqttMsg.getPTCode(), "MES_EQUIPMENT_VARIABLE"); Object obj = redisMesPcn.getHash(variableKey, equipLogMqttMsg.getKey()); - MesEquipmentVariable mesEquipmentVariable = new MesEquipmentVariable(); + MesEquipmentVariable mesEquipmentVariable; if (obj == null) { log.info("== mesEquipmentVariable查询开始"); DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesMaximoServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesMaximoServiceImpl.java index 428ca04..b064586 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesMaximoServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesMaximoServiceImpl.java @@ -65,22 +65,22 @@ public class MesMaximoServiceImpl implements IMesMaximoService { private void call(String meterName,String assetNum,String organizeCode,int count , String url){ - String xml = "\n" + - " \n" + - " \n" + - " \n" + - " \n" + - " \n" + - " ?\n" + - " %s\n" + - " %s\n" + - " %s\n" + - " %s\n" + - " %s\n" + - " \n" + - " \n" + - " \n" + - " \n" + + String xml = "%n" + + " %n" + + " %n" + + " %n" + + " %n" + + " %n" + + " ?%n" + + " %s%n" + + " %s%n" + + " %s%n" + + " %s%n" + + " %s%n" + + " %n" + + " %n" + + " %n" + + " %n" + ""; //2024-05-30T11:10:00 LocalDateTime now = LocalDateTime.now(); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesPojoVersionServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesPojoVersionServiceImpl.java index 721ac37..a8af31a 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesPojoVersionServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/base/MesPojoVersionServiceImpl.java @@ -51,7 +51,6 @@ public class MesPojoVersionServiceImpl implements IMesPojoVersionService { @Override public MesPojoVersion getPojoVersion(MesPojoVersion bean) { - DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(bean); return mesPojoVersionRepository.getByProperty(DdlPackBean.getDdlPackBean(bean)); } @@ -146,7 +145,7 @@ public class MesPojoVersionServiceImpl implements IMesPojoVersionService { public void recordPojoVersion(MesPojoVersion afterMesPojoVersion) { MesPojoVersion beforePojoVersion = new MesPojoVersion(); - MesPojoVersionDetail beforePojoVersionDetail = new MesPojoVersionDetail(); + MesPojoVersionDetail beforePojoVersionDetail; Map beforeMap = new HashMap<>(); Map afterMap = JsonUtilTool.decode(afterMesPojoVersion.getBean(), Map.class); MesPojoVersionDetail afterPojoVersionDetail = null; @@ -160,7 +159,6 @@ public class MesPojoVersionServiceImpl implements IMesPojoVersionService { Integer versionNo; // 对象版本 CommonEnumUtil.DAO_OPERATE_TYPE operateType = CommonEnumUtil.DAO_OPERATE_TYPE.INSERT; // 操作类型 Map> mapDiff; // 版本对比 - String userName = StringUtils.isNotBlank(afterMesPojoVersion.getModifyUser()) ? afterMesPojoVersion.getModifyUser() : afterMesPojoVersion.getCreateUser(); Map mapPropDesc = afterMesPojoVersion.getPojoPropDesc(); boolean isInsert = true; 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 ed9c40c..f597f7e 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 @@ -850,7 +850,7 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService { //报工调整 // 2024-11-27 物料报解后AME或者质量如何快速把正确委件返回流?A变B流程怎么走?-物料拆解需要去掉自动负报工接口,待开发 MesWorkOrder mesWorkOrderDb = mesWorkOrderService.findMesWorkOrderList(requestModel.getOrganizeCode(), optional.get().getWorkOrderNo()); - MesProductVersion productVersion = getProductVersion(mesWorkOrderDb); + getProductVersion(mesWorkOrderDb); /* mesWorkOrderDb.setNum(MesPcnExtConstWords.ONE); mesWorkOrderService.doProductReportReversal(mesWorkOrderDb,productVersion, requestModel.getUserName());*/ @@ -1167,41 +1167,41 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService { mesQmsScrapRepository.insert(mesQmsScrap); } - private void doCreateMove(MesWorkCenter mesWorkCenter, String destLocate, MesProductionAssemblyModel assemblyModel,String userName) { - MesMove move = new MesMove(); - move.setMatnr(assemblyModel.getAssemblyPartNo()); - move.setOrganizeCode(mesWorkCenter.getOrganizeCode()); - move.setFactoryCode(mesWorkCenter.getOrganizeCode()); - move.setLgort(mesWorkCenter.getRawLocate()); - move.setUmlgo(destLocate); - move.setMenge(assemblyModel.getScrapQty()); - move.setPostDate(TimeTool.getToday()); - move.setPostTime(TimeTool.getTimeShortWithColon()); - move.setMoveType(MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE.getValue()); - move.setProductSn(assemblyModel.getAssemblySn()); - move.setWorkCenter(mesWorkCenter.getErpWorkCenter()); - ConvertBean.serviceModelInitialize(move, userName); - moveRepository.insert(move); - } - - private void doCreateMove(MesReworkTaskRequestModel requestModel,String srcLocate, String destLocate,String workCenterCode,String partNo) { - MesPartSap mesPartSap = mesPartService.getMesPartSapByPartNo(partNo, requestModel.getOrganizeCode()); - MesMove move = new MesMove(); - move.setMatnr(mesPartSap.getPartNo()); - move.setOrganizeCode(requestModel.getOrganizeCode()); - move.setFactoryCode(requestModel.getOrganizeCode()); - move.setLgort(srcLocate); - move.setUmlgo(destLocate); - move.setMenge(1d); - move.setMeins(mesPartSap.getUnit()); - move.setPostDate(TimeTool.getToday()); - move.setPostTime(TimeTool.getTimeShortWithColon()); - move.setMoveType(MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE.getValue()); - move.setProductSn(requestModel.getSn()); - move.setWorkCenter(workCenterCode); - ConvertBean.serviceModelInitialize(move, requestModel.getUserName()); - moveRepository.insert(move); - } +// private void doCreateMove(MesWorkCenter mesWorkCenter, String destLocate, MesProductionAssemblyModel assemblyModel,String userName) { +// MesMove move = new MesMove(); +// move.setMatnr(assemblyModel.getAssemblyPartNo()); +// move.setOrganizeCode(mesWorkCenter.getOrganizeCode()); +// move.setFactoryCode(mesWorkCenter.getOrganizeCode()); +// move.setLgort(mesWorkCenter.getRawLocate()); +// move.setUmlgo(destLocate); +// move.setMenge(assemblyModel.getScrapQty()); +// move.setPostDate(TimeTool.getToday()); +// move.setPostTime(TimeTool.getTimeShortWithColon()); +// move.setMoveType(MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE.getValue()); +// move.setProductSn(assemblyModel.getAssemblySn()); +// move.setWorkCenter(mesWorkCenter.getErpWorkCenter()); +// ConvertBean.serviceModelInitialize(move, userName); +// moveRepository.insert(move); +// } +// +// private void doCreateMove(MesReworkTaskRequestModel requestModel,String srcLocate, String destLocate,String workCenterCode,String partNo) { +// MesPartSap mesPartSap = mesPartService.getMesPartSapByPartNo(partNo, requestModel.getOrganizeCode()); +// MesMove move = new MesMove(); +// move.setMatnr(mesPartSap.getPartNo()); +// move.setOrganizeCode(requestModel.getOrganizeCode()); +// move.setFactoryCode(requestModel.getOrganizeCode()); +// move.setLgort(srcLocate); +// move.setUmlgo(destLocate); +// move.setMenge(1d); +// move.setMeins(mesPartSap.getUnit()); +// move.setPostDate(TimeTool.getToday()); +// move.setPostTime(TimeTool.getTimeShortWithColon()); +// move.setMoveType(MesExtEnumUtil.MOVE_TYPE.SCRAP_MOVE.getValue()); +// move.setProductSn(requestModel.getSn()); +// move.setWorkCenter(workCenterCode); +// ConvertBean.serviceModelInitialize(move, requestModel.getUserName()); +// moveRepository.insert(move); +// } private void doCreateReworkMove(MesReworkTaskRequestModel requestModel,String srcLocate, String destLocate,String workCenterCode,String partNo,Long partInspectionId) { 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 9f80904..00abcf9 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 @@ -108,8 +108,8 @@ public class MesAssemblyExtService implements IMesAssemblyExtService { if (CollectionUtils.isEmpty(workOrderAssemblyList)) return null; // 搜集非已装配的数据 - List unBindList = workOrderAssemblyList.stream().filter(o -> (null != o && - o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) != 0)).collect(Collectors.toList()); +// List unBindList = workOrderAssemblyList.stream().filter(o -> (null != o && +// o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) != 0)).collect(Collectors.toList()); //获取装配件绑定记录 Map> productionAssemblyMap = groupProductionAssembly(getProductionAssemblySortList(prodRuleContext.getOrganizeCode(), prodRuleContext.getProductSn())); 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 47d942d..5f3e185 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 @@ -624,7 +624,6 @@ public class MesBoxingErrorProofingService implements IMesBoxingErrorProofingSer || StringUtils.isEmpty(split[packingDefine.getSerialIdIndex() - 1])) { MesPcnException.throwMesBusiException("序列号所在位置不存在,请检查数据!"); } - String serialNo = split[packingDefine.getSerialIdIndex() - 1]; } private void checkOrganizeCode(MesPackageDetail mesPackageDetail, MesPackingDefine packingDefine, String[] split) { diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesCheckSyncDataServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesCheckSyncDataServiceImpl.java index 2fc20cb..165f53f 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesCheckSyncDataServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesCheckSyncDataServiceImpl.java @@ -16,12 +16,5 @@ public class MesCheckSyncDataServiceImpl implements IMesCheckSyncDataService { @Override public void doCheckSyncData(String organizeCode, List workCenterCodeList, List workCellCodeList) { - - DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode); - if (workCellCodeList !=null && !workCellCodeList.isEmpty()){ - - } - - } } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesEarlyWarningServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesEarlyWarningServiceImpl.java index 0da7ecf..cf4df13 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesEarlyWarningServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesEarlyWarningServiceImpl.java @@ -160,10 +160,8 @@ public class MesEarlyWarningServiceImpl implements IMesEarlyWarningService { Calendar calendar1 = Calendar.getInstance(); calendar1.setTime(now); - int productCount = kanBan.getProductCount(); int productDay = kanBan.getProductDay(); calendar1.add(Calendar.DATE,-productDay); -// List vehicleNoList = getCLWarning(sdf1.format(calendar1.getTime()), productCount,organizeCode); List vehicleNoList = new ArrayList<>(); //9.汇总数据 return doGetSGMData(kanBan, gmGepicsList, lastCimGmGepics, lastOne, lastWorkOrder, lastOfflineOrder, workCounts, vehicleNoList); @@ -243,9 +241,9 @@ public class MesEarlyWarningServiceImpl implements IMesEarlyWarningService { // List mesWorkOrderAssemblyList = workOrderAssemblyRao.findByHqlWhere(assemblyPackBean); // //todo 有内存溢出风险 调试一下,写hql按照分组查询出workOrderNoList // List workOrderNoList = mesWorkOrderAssemblyList.stream().map(MesWorkOrderAssembly::getWorkOrderNo).distinct().collect(Collectors.toList()); - List orderStatusList = new ArrayList<>(); - orderStatusList.add(MesExtEnumUtil.ORDER_STATUS.CLOSE.getValue()); - orderStatusList.add(MesExtEnumUtil.ORDER_STATUS.DISMANTLE.getValue()); +// List orderStatusList = new ArrayList<>(); +// orderStatusList.add(MesExtEnumUtil.ORDER_STATUS.CLOSE.getValue()); +// orderStatusList.add(MesExtEnumUtil.ORDER_STATUS.DISMANTLE.getValue()); List orderFlagList = new ArrayList<>(); orderFlagList.add(MesExtEnumUtil.ORDER_TYPE_IDENTIFICATION.E.getValue()); @@ -362,7 +360,7 @@ public class MesEarlyWarningServiceImpl implements IMesEarlyWarningService { //需要保留截图 //需要发声音 //需要发送记录信息 当前csnNo进行了跳号 - errorMsg.append(String.format("当前CsnNo:%d进行了跳号;\n",curCsnNo)); + errorMsg.append(String.format("当前CsnNo:%d进行了跳号;%n",curCsnNo)); } } if (errorMsg.length()>0){ diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesFengRenBatchReportService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesFengRenBatchReportService.java index 594a580..d3294bb 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesFengRenBatchReportService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesFengRenBatchReportService.java @@ -108,16 +108,16 @@ public class MesFengRenBatchReportService implements IMesFengRenBatchReportServi MesPcnException.throwBusiException("汇报失败:生产工单[%s]信息当前状态[%s]!", MesExtEnumUtil.ORDER_STATUS.valueOfDescription(workOrderDb.getWorkOrderStatus())); //验证超工单 - Double reportedQty = MathOperation.add(new Double(model.getNum()), workOrderDb.getReportedQty()); - Integer workOrderStatus = MesExtEnumUtil.ORDER_STATUS.COMPLETE.getValue(); + double reportedQty = MathOperation.add(model.getNum().doubleValue(), workOrderDb.getReportedQty()); + int workOrderStatus = MesExtEnumUtil.ORDER_STATUS.COMPLETE.getValue(); if (MathOperation.compareTo(reportedQty, workOrderDb.getQty()) > 0) { MesWorkCenter workCenter = prodOrgExtService.getWorkCenterDb(model.getOrganizeCode(), workOrderDb.getWorkCenterCode()); if (StringUtils.isEmpty(workCenter.getIsCheckOrderQty()) || workCenter.getIsCheckOrderQty().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) != 0) MesPcnException.throwMesBusiException("汇报失败:工单号[%s]计划数量[%s]已报工数量[%s],当前不允许超工单!", workOrderDb.getWorkOrderNo(), workOrderDb.getQty(), workOrderDb.getReportedQty()); - Double rate = MathOperation.div((MathOperation.sub(reportedQty, workOrderDb.getQty())), workOrderDb.getQty()); - if (MathOperation.compareTo(rate, MathOperation.div(workCenter.getOrderRate(), new Double(MesPcnExtConstWords.ONE_HUNDRED))) > 0) + double rate = MathOperation.div((MathOperation.sub(reportedQty, workOrderDb.getQty())), workOrderDb.getQty()); + if (MathOperation.compareTo(rate, MathOperation.div(workCenter.getOrderRate(), MesPcnExtConstWords.ONE_HUNDRED)) > 0) MesPcnException.throwMesBusiException("汇报失败:请检查工单数量,工单号[%s]计划数量[%s]已报工数量[%s]超工单比例[%s]!", workOrderDb.getWorkOrderNo(), workOrderDb.getQty(), workOrderDb.getReportedQty(), workCenter.getOrderRate()); } @@ -163,8 +163,8 @@ public class MesFengRenBatchReportService implements IMesFengRenBatchReportServi MesPackageDataContext packageDataContext = (MesPackageDataContext) queryPackSpecQtyFengRenBatchReport(reqBean, stepResult, model.getPartNo()); //计数 - Double unCompleteQty = MathOperation.sub(workOrderDb.getQty(), reportedQty); - if (MathOperation.compareTo(unCompleteQty, new Double(0)) < 0) unCompleteQty = new Double(0); + double unCompleteQty = MathOperation.sub(workOrderDb.getQty(), reportedQty); + if (MathOperation.compareTo(unCompleteQty, 0) < 0) unCompleteQty = 0; if (MathOperation.compareTo(reportedQty, workOrderDb.getQty()) < 0) workOrderStatus = MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue(); log.info("工厂{}缝纫批量汇报 --- PROCESS_INFO --- MesBomSize:{} --- MesPackageDataContext:{} --- workOrderStatus:{} --- reportedQty:{} --- {}", model.getOrganizeCode(), mesBoms.size(), JSONObject.toJSONString(packageDataContext), workOrderStatus, reportedQty, Thread.currentThread().getName()); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesNcProcessingService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesNcProcessingService.java index 2b993d3..88989a8 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesNcProcessingService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesNcProcessingService.java @@ -1136,7 +1136,6 @@ public class MesNcProcessingService implements IMesNcProcessingService { mesPartInspectionAllList.addAll(mesPartInspectionList); } //获取前一天的所有ncStatus=40报废状态下可疑品缺陷 - DdlPackBean singlePackBean = DdlPackBean.getDdlPackBean(organizeCode); DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.PART_INSPECTION_STATUS.FAIL.getValue(), "inspectionStatus", packBean); DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.PART_INSPECTION_NC_STATUS.SCRAP.getValue(), "ncStatus", packBean); DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue(), "sourceType", packBean); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesNingDeShippingCheckService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesNingDeShippingCheckService.java index f6eb0d2..ce59c9e 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesNingDeShippingCheckService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesNingDeShippingCheckService.java @@ -400,14 +400,14 @@ public class MesNingDeShippingCheckService implements IMesNingDeShippingCheckSer List resultDetails = new ArrayList<>(); Map> detailMap = detailList.stream().collect(Collectors.groupingBy(MesShippingOrderManagementDetail::getCustInfoSeq)); List partTypeList = Arrays.asList(mesPartShippingGroup.getPartType().split(MesPcnExtConstWords.COMMA)); - for (Long seq : detailMap.keySet()) { - List details = detailMap.get(seq); + for (Map.Entry> entry: detailMap.entrySet()) { + List details = entry.getValue(); if (details.size() > MesPcnExtConstWords.ONE) { Map> containsMap = details.stream().filter(t -> partTypeList.contains(t.getPartTypeCode())).collect(Collectors.groupingBy(MesShippingOrderManagementDetail::getPartTypeCode)); List noContains = details.stream().filter(t -> !partTypeList.contains(t.getPartTypeCode())).collect(Collectors.toList()); //按照维护的总成类型显示 for (String type : partTypeList){ - if (!Objects.isNull(containsMap) && containsMap.containsKey(type)){ + if (containsMap.containsKey(type)){ resultDetails.addAll(containsMap.get(type)); } } @@ -473,7 +473,7 @@ public class MesNingDeShippingCheckService implements IMesNingDeShippingCheckSer throw new ImppBusiException(String.format("【%s】条码已进行二次发运扫描,请检查数据!", model.getSn())); } } - MesProduceSn produceSn = checkSecondSn(model); + checkSecondSn(model); //更新明细 MesShippingOrderManagementDetail detail = shippingOrderManagementDetailOptional.get(); detail.setBarcode(model.getSn()); @@ -525,9 +525,6 @@ public class MesNingDeShippingCheckService implements IMesNingDeShippingCheckSer orderManagement.setStatus(MesExtEnumUtil.SHIPPING_ORDER_STATUS.SECOND_SHIPPED.getValue()); orderManagement.setEndScanTime(TimeTool.getNowTime(true)); - //零件发运组 - MesPartShippingGroup shippingGroup = Objects.isNull(model.getMesPartShippingGroup()) ? getMesPartShippingGroup(orderManagement.getOrganizeCode(), orderManagement.getShippingGroupCode()) : model.getMesPartShippingGroup(); - //发运单明细状态修改为校验完成 DdlPackBean orderManagementDetailPackBean = DdlPackBean.getDdlPackBean(organizeCode); DdlPreparedPack.getNumEqualPack(orderManagement.getId(), "pid", orderManagementDetailPackBean); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesProduceSnPrintService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesProduceSnPrintService.java index 1dc41e1..358f413 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesProduceSnPrintService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesProduceSnPrintService.java @@ -357,7 +357,7 @@ public class MesProduceSnPrintService implements IMesProduceSnPrintService { //模板信息丢失抛出异常 if (labelTemplate == null) { - workOrderCutDb.setRemark(String.format("请检查裁片方案,裁片方案[%s]模板代码[%s]无效!", cutScheme.getCutCode(), cutScheme.getTemplateCode())); + workOrderCutDb.setRemark(String.format("请检查裁片方案,裁片方案[%s]模板代码[%s]无效!", cutScheme != null ? cutScheme.getCutCode() : "", cutScheme != null ? cutScheme.getTemplateCode() : "")); workOrderCutDb.setSystemSyncStatus(CommonEnumUtil.FALSE); ConvertBean.serviceModelUpdate(workOrderCutDb, workOrderCut.getModifyUser()); continue; @@ -368,7 +368,7 @@ public class MesProduceSnPrintService implements IMesProduceSnPrintService { //模板信息丢失抛出异常 if (StringUtils.isEmpty(methodCode)) { - workOrderCutDb.setRemark(String.format("裁片方案[%s]模板代码[%s]方法类为空,请配置!", cutScheme.getCutCode(), labelTemplate.getTemplateCode())); + workOrderCutDb.setRemark(String.format("裁片方案[%s]模板代码[%s]方法类为空,请配置!", cutScheme != null ? cutScheme.getCutCode() : "", labelTemplate.getTemplateCode())); workOrderCutDb.setSystemSyncStatus(CommonEnumUtil.FALSE); ConvertBean.serviceModelUpdate(workOrderCutDb, workOrderCut.getModifyUser()); continue; 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 2de51c3..402601b 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 @@ -153,8 +153,8 @@ public class MesProductionRecordService implements IMesProductionRecordService { List mesProductionRecordList = productionRecordRepository.findByHqlWhere(ddlPackBean); - List failList = new ArrayList<>(); - List noFailList = new ArrayList<>(); + List failList; + List noFailList; if (!CollectionUtils.isEmpty(mesProductionRecordList)) { failList = mesProductionRecordList.stream().filter(mesProductionRecord -> Objects.equals(mesProductionRecord.getReportStatus(), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_40.getValue())).map(MesProductionRecord::getId).collect(Collectors.toList()); noFailList = mesProductionRecordList.stream().filter(mesProductionRecord -> !Objects.equals(mesProductionRecord.getReportStatus(), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_40.getValue())).map(MesProductionRecord::getId).collect(Collectors.toList()); 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 a58caa0..5d2e3e0 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 @@ -529,8 +529,8 @@ public class MesSortShippingCheckService implements IMesSortShippingCheckService List resultDetails = new ArrayList<>(); Map> detailMap = detailList.stream().collect(Collectors.groupingBy(MesShippingOrderManagementDetail::getCustInfoSeq)); List partTypeList = Arrays.asList(mesPartShippingGroup.getPartType().split(MesPcnExtConstWords.COMMA)); - for (Long seq : detailMap.keySet()) { - List details = detailMap.get(seq); + for (Map.Entry> entry: detailMap.entrySet()) { + List details = entry.getValue(); if (details.size() > MesPcnExtConstWords.ONE) { Map> containsMap = details.stream().filter(t -> partTypeList.contains(t.getPartTypeCode())).collect(Collectors.groupingBy(MesShippingOrderManagementDetail::getPartTypeCode)); List noContains = details.stream().filter(t -> !partTypeList.contains(t.getPartTypeCode())).collect(Collectors.toList()); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesStationServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesStationServiceImpl.java index 27100d7..15eded4 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesStationServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesStationServiceImpl.java @@ -28,7 +28,7 @@ public class MesStationServiceImpl implements IMesStationService { @Override public MesStation getMesStationByEquipmentCode(String organizeCode, String equipmentCode) { - if (StringUtil.isEmptyAndNull(organizeCode) || StringUtil.isEmptyAndNull(organizeCode)) { + if (StringUtil.isEmptyAndNull(organizeCode) || StringUtil.isEmptyAndNull(equipmentCode)) { return null; } return mesStationRepository.getByProperty( diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesWorkOrderService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesWorkOrderService.java index 3c9bb6f..e95e13f 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesWorkOrderService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/MesWorkOrderService.java @@ -416,18 +416,18 @@ public class MesWorkOrderService implements IMesWorkOrderService { return mesBoms.stream().collect(Collectors.groupingBy(t -> t.getBomCode() + t.getEffStartTime())).get(next.getBomCode() + next.getEffStartTime()); } - private MesProductVersion getMesProductVersion(MesWorkOrder mesWorkOrder) { - DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(mesWorkOrder.getOrganizeCode()); - DdlPreparedPack.getStringEqualPack(mesWorkOrder.getPartNo(), "partNo", ddlPackBean); - DdlPreparedPack.getStringEqualPack(mesWorkOrder.getErpWorkCenter(), "workCenterCode", ddlPackBean); -// DdlPreparedPack.getStringEqualPack(mesWorkOrder.getProductVersion(), "productVersion", ddlPackBean); - MesProductVersion mesProductVersion = mesProductVersionRDao.getByProperty(ddlPackBean); - if (null == mesProductVersion) { - LOGGER.info("物料{}生产版本信息不存在", mesWorkOrder.getPartNo()); - MesPcnException.throwMesBusiException("物料【%s】生产版本信息不存在", mesWorkOrder.getPartNo()); - } - return mesProductVersion; - } +// private MesProductVersion getMesProductVersion(MesWorkOrder mesWorkOrder) { +// DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(mesWorkOrder.getOrganizeCode()); +// DdlPreparedPack.getStringEqualPack(mesWorkOrder.getPartNo(), "partNo", ddlPackBean); +// DdlPreparedPack.getStringEqualPack(mesWorkOrder.getErpWorkCenter(), "workCenterCode", ddlPackBean); +//// DdlPreparedPack.getStringEqualPack(mesWorkOrder.getProductVersion(), "productVersion", ddlPackBean); +// MesProductVersion mesProductVersion = mesProductVersionRDao.getByProperty(ddlPackBean); +// if (null == mesProductVersion) { +// LOGGER.info("物料{}生产版本信息不存在", mesWorkOrder.getPartNo()); +// MesPcnException.throwMesBusiException("物料【%s】生产版本信息不存在", mesWorkOrder.getPartNo()); +// } +// return mesProductVersion; +// } private void updateProductionRecord(String organizeCode, String userName, Long id) { @@ -791,8 +791,6 @@ public class MesWorkOrderService implements IMesWorkOrderService { * @return */ private List getMesWorkOrder(MesProductionRecord productionRecord, String organizeCode) { - MesWorkOrder mesWorkOrder = new MesWorkOrder(); - List workOrders = new ArrayList<>(); /** * 根据产线物料获取所有工单 @@ -802,7 +800,6 @@ public class MesWorkOrderService implements IMesWorkOrderService { return null; } // 获取当前班次 - String shiftCode = productionRecord.getShiftCode(); String workCenterCode = productionRecord.getWorkCenterCode(); //查询工作中心 @@ -818,7 +815,6 @@ public class MesWorkOrderService implements IMesWorkOrderService { if (CollectionUtils.isEmpty(shiftList)) { throw new ImppBusiException(String.format("班次信息未维护,产线=%s",workCenterCode)); } - List shifts = shiftList.stream().filter(mesShift -> Objects.equals(mesShift.getWorkCenterCode(), workCenterCode)).collect(Collectors.toList()); // 获取产品加工记录对应时间的班次 Integer hours = transfer(productionRecord.getCompleteDateTime()).getHours(); @@ -952,6 +948,9 @@ public class MesWorkOrderService implements IMesWorkOrderService { } catch (ParseException e) { e.printStackTrace(); } + if (d == null) { + return ""; + } Calendar cal = Calendar.getInstance(); cal.setTime(d); if (flag == 1) { @@ -984,7 +983,7 @@ public class MesWorkOrderService implements IMesWorkOrderService { DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"modifyDatetime"}, ddlPackBean); String numStr = configService.getCfgValue(organizeCode, "MES_PCN_REPORT_NUM"); - int num = StringUtils.isEmpty(numStr) ? 50 : Integer.valueOf(numStr); + int num = StringUtils.isEmpty(numStr) ? 50 : Integer.parseInt(numStr); List mesProductionRecordList = productionRecordRao.findByHqlTopWhere(ddlPackBean, num); List recordList = new ArrayList<>(); @@ -1016,7 +1015,7 @@ public class MesWorkOrderService implements IMesWorkOrderService { DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"modifyDatetime"}, ddlPackBean); String numStr = configService.getCfgValue(organizeCode, "MES_PCN_REPORT_NUM"); - int num = StringUtils.isEmpty(numStr) ? 50 : Integer.valueOf(numStr); + int num = StringUtils.isEmpty(numStr) ? 50 : Integer.parseInt(numStr); List mesProductionRecordList = productionRecordRao.findByHqlTopWhere(ddlPackBean, num); List recordList = new ArrayList<>(); @@ -1358,10 +1357,9 @@ public class MesWorkOrderService implements IMesWorkOrderService { item.setPlanEndTime(today + " " + mesShift.getEndTime()); //生成工单号 - List orderList = new ArrayList<>(); GenSerialNoModel genSerialNoModel = new GenSerialNoModel("MES_WORK_CENTER_ORDER_NO"); genSerialNoModel.setPartNo(workCenterCode); - orderList = syncFuncService.syncSerialNo(genSerialNoModel, userName, organizeCode, 1).getResultList(); + List orderList = syncFuncService.syncSerialNo(genSerialNoModel, userName, organizeCode, 1).getResultList(); String orderNo = "A-" + orderList.get(0); DdlPackBean orderPackBean = DdlPackBean.getDdlPackBean(item.getOrganizeCode()); @@ -1809,6 +1807,9 @@ public class MesWorkOrderService implements IMesWorkOrderService { } catch (ParseException e) { e.printStackTrace(); } + if (d == null) { + return ""; + } Calendar cal = Calendar.getInstance(); cal.setTime(d); if (flag == 1) { diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingCheckVolvoRackNoAndPartNoStrategyServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingCheckVolvoRackNoAndPartNoStrategyServiceImpl.java index 0f54054..29032d2 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingCheckVolvoRackNoAndPartNoStrategyServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/busi/shippingscan/strategy/MesShippingCheckVolvoRackNoAndPartNoStrategyServiceImpl.java @@ -114,7 +114,7 @@ public class MesShippingCheckVolvoRackNoAndPartNoStrategyServiceImpl implements } MesCustSortInfo custSoftInfo = custSoftInfoRDao.getById(Long.parseLong(workOrder.getWorkOrderSource())); if (custSoftInfo == null || !Objects.equals(detail.getCustInfoSeq(), custSoftInfo.getCustInfoSeq())) { - throw new ImppBusiException(String.format("发运单【%s】启用明细顺序防错,序号【%s】前还有未扫描的发运单明细,请检查数据!", orderManagement.getShippingCode(), custSoftInfo.getCustInfoSeq())); + throw new ImppBusiException(String.format("发运单【%s】启用明细顺序防错,序号【%s】前还有未扫描的发运单明细,请检查数据!", orderManagement.getShippingCode(), custSoftInfo != null ? custSoftInfo.getCustInfoSeq() : "")); } } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/ford/MesFordFetchWebServiceImpl.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/ford/MesFordFetchWebServiceImpl.java index ef45d9c..97aa263 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/ford/MesFordFetchWebServiceImpl.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/ford/MesFordFetchWebServiceImpl.java @@ -73,10 +73,6 @@ public class MesFordFetchWebServiceImpl implements IFordFetchWebService { } MesFordFetchParameter parameter = list.get(0); //尝试登录 - Map paramMap = new HashMap<>(); - paramMap.put("username", parameter.getUid()); - paramMap.put("password", parameter.getPwd()); - paramMap.put("t", String.valueOf(System.currentTimeMillis())); String body = "username="+parameter.getUid()+"&password="+parameter.getPwd()+"&t="+ System.currentTimeMillis(); String loginUrl = parameter.getLoginUrl(); HttpResponse loginResponse = HttpRequest.post(loginUrl).body(body) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/job/MesWorkOrderCalcQtyRestoreDispatchService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/job/MesWorkOrderCalcQtyRestoreDispatchService.java index 34c9f3b..0003bc7 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/job/MesWorkOrderCalcQtyRestoreDispatchService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/job/MesWorkOrderCalcQtyRestoreDispatchService.java @@ -64,9 +64,9 @@ public class MesWorkOrderCalcQtyRestoreDispatchService implements IMesWorkOrderC } //计数 - Double completeQty = !StringUtils.isEmpty(workOrder.getCompleteQty()) ? workOrder.getCompleteQty() : new Double(MesPcnExtConstWords.ZERO); - Double suspiciousPartQty = !StringUtils.isEmpty(workOrder.getSuspiciousPartQty()) ? workOrder.getSuspiciousPartQty() : new Double(MesPcnExtConstWords.ZERO); - Double scrapPartQty = !StringUtils.isEmpty(workOrder.getScrapPartQty()) ? workOrder.getScrapPartQty() : new Double(MesPcnExtConstWords.ZERO); + double completeQty = !StringUtils.isEmpty(workOrder.getCompleteQty()) ? workOrder.getCompleteQty() : MesPcnExtConstWords.ZERO; + double suspiciousPartQty = !StringUtils.isEmpty(workOrder.getSuspiciousPartQty()) ? workOrder.getSuspiciousPartQty() : MesPcnExtConstWords.ZERO; + double scrapPartQty = !StringUtils.isEmpty(workOrder.getScrapPartQty()) ? workOrder.getScrapPartQty() : MesPcnExtConstWords.ZERO; for (MesWorkOrderCalcQtyRecord workOrderCalcQtyRecord : workOrderCalcQtyRecordList) { if (null == workOrderCalcQtyRecord) continue; if (!StringUtils.isEmpty(workOrderCalcQtyRecord.getCompleteQty())) completeQty = MathOperation.add(completeQty, workOrderCalcQtyRecord.getCompleteQty()); @@ -75,9 +75,9 @@ public class MesWorkOrderCalcQtyRestoreDispatchService implements IMesWorkOrderC } //未完成数 - Double unCompleteQty = !StringUtils.isEmpty(workOrder.getUnCompleteQty()) ? workOrder.getUnCompleteQty() : workOrder.getQty(); - unCompleteQty = MathOperation.compareTo(unCompleteQty, new Double(MesPcnExtConstWords.ZERO)) <= MesPcnExtConstWords.ZERO ? new Double(MesPcnExtConstWords.ZERO) : MathOperation.sub(workOrder.getQty(), completeQty); - if (MathOperation.compareTo(unCompleteQty, new Double(MesPcnExtConstWords.ZERO)) < MesPcnExtConstWords.ZERO) unCompleteQty = new Double(MesPcnExtConstWords.ZERO); + double unCompleteQty = !StringUtils.isEmpty(workOrder.getUnCompleteQty()) ? workOrder.getUnCompleteQty() : workOrder.getQty(); + unCompleteQty = MathOperation.compareTo(unCompleteQty, MesPcnExtConstWords.ZERO) <= MesPcnExtConstWords.ZERO ? MesPcnExtConstWords.ZERO : MathOperation.sub(workOrder.getQty(), completeQty); + if (MathOperation.compareTo(unCompleteQty, MesPcnExtConstWords.ZERO) < MesPcnExtConstWords.ZERO) unCompleteQty = MesPcnExtConstWords.ZERO; //状态 Integer workOrderStatus = workOrder.getWorkOrderStatus(); @@ -141,7 +141,7 @@ public class MesWorkOrderCalcQtyRestoreDispatchService implements IMesWorkOrderC String[] propertyName = new String[propertyMap.size()]; Object[] propertyValue = new Object[propertyMap.size()]; - Integer index = 0; + int index = 0; for (Map.Entry innerEntry : propertyMap.entrySet()) { if (null == innerEntry) continue; propertyName[index] = innerEntry.getKey(); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/job/MesWorkOrderOfflineRestoreDispatchService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/job/MesWorkOrderOfflineRestoreDispatchService.java index 52f513b..2a6a06c 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/job/MesWorkOrderOfflineRestoreDispatchService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/job/MesWorkOrderOfflineRestoreDispatchService.java @@ -174,21 +174,21 @@ public class MesWorkOrderOfflineRestoreDispatchService implements IMesWorkOrderO } //工单装配件离线数据根据工位进行分组 - Map> cellMap = CollectionUtils.isEmpty(workOrderAssemblyOfflineList) ? null : - workOrderAssemblyOfflineList.stream().filter(o -> null != o).collect(Collectors.groupingBy(MesWorkOrderAssemblyOffline::getWorkCellCode)); + Map> cellMap = workOrderAssemblyOfflineList.stream().filter(o -> null != o).collect(Collectors.groupingBy(MesWorkOrderAssemblyOffline::getWorkCellCode)); //解析加工记录工位字段信息 拼接新增过的工位加工记录 [{"id":"1","workCellCode":"100-10"},{"id":"2","workCellCode":"100-20"}....] List productionRecordOfflineModelList = StringUtils.isEmpty(workOrderOffline.getProductionRecord()) ? new ArrayList<>() : JSONObject.parseArray(workOrderOffline.getProductionRecord(), MesProductionRecordOfflineModel.class); Map productionRecordOfflineMap = CollectionUtils.isEmpty(productionRecordOfflineModelList) ? null : productionRecordOfflineModelList.stream().filter(o -> null != o).collect(Collectors.toMap(MesProductionRecordOfflineModel::getWorkCellCode, MesProductionRecordOfflineModel::getId)); + for (Map.Entry> entry : cellMap.entrySet()) { if (null == entry) continue; List assemblyOfflineList = entry.getValue(); - Boolean isExistProductionRecord = (CollectionUtils.isEmpty(productionRecordOfflineMap) || !productionRecordOfflineMap.containsKey(entry.getKey())) ? false : true; - Long productionRecordId = !isExistProductionRecord ? snowflakeIdMaker.nextId() : Long.valueOf(productionRecordOfflineMap.get(entry.getKey())); + boolean isExistProductionRecord = (CollectionUtils.isEmpty(productionRecordOfflineMap) || !productionRecordOfflineMap.containsKey(entry.getKey())) ? false : true; + Long productionRecordId = !isExistProductionRecord ? snowflakeIdMaker.nextId() : Long.parseLong(productionRecordOfflineMap.get(entry.getKey())); //写入加工记录 MesProductionRecord productionRecord; diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/numberrule/MesNoSortCustSnNumberRuleStrategyService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/numberrule/MesNoSortCustSnNumberRuleStrategyService.java index 2f31daa..4134c47 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/numberrule/MesNoSortCustSnNumberRuleStrategyService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/numberrule/MesNoSortCustSnNumberRuleStrategyService.java @@ -33,7 +33,6 @@ public class MesNoSortCustSnNumberRuleStrategyService implements INumberRulePack @Override public GenSerialNoModel execute(GenSerialNoModel genSerialNoModel) { - Map dataMap = genSerialNoModel.getDataMap(); final String custPartNo = customerPartService.getCustPartNo(genSerialNoModel.getOrganizeCode(), genSerialNoModel.getPartNo()); if (StringUtils.isEmpty(custPartNo)) { MesPcnException.throwMesBusiException("请检查客户零件信息,零件[%s]客户零件关系未维护", genSerialNoModel.getPartNo()); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/sortshipping/strategy/ChengDuVolvoShippingPrintStrategyService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/sortshipping/strategy/ChengDuVolvoShippingPrintStrategyService.java index 6febc4f..801230e 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/sortshipping/strategy/ChengDuVolvoShippingPrintStrategyService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/sortshipping/strategy/ChengDuVolvoShippingPrintStrategyService.java @@ -94,7 +94,6 @@ public class ChengDuVolvoShippingPrintStrategyService extends SortShippingDispat private ChengDuVolvoShippingPrintModel getPrintData(MesShippingOrderManagement shippingOrder) { final String organizeCode = AuthUtil.getOrganize().getOrganizeCode(); - final String userName = AuthUtil.getSessionUser().getUserName(); ChengDuVolvoShippingPrintModel model = new ChengDuVolvoShippingPrintModel(); DdlPackBean shippingDetailPackBean = DdlPackBean.getDdlPackBean(organizeCode); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/ChengDuVolvoPartPrintStrategy.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/ChengDuVolvoPartPrintStrategy.java index bfb6621..a3fbb1b 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/ChengDuVolvoPartPrintStrategy.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/print/strategy/ChengDuVolvoPartPrintStrategy.java @@ -98,7 +98,7 @@ public class ChengDuVolvoPartPrintStrategy implements IPrintTemplateStrategyServ private Map getPrintContextMap(MesProduceSn produceSn, MesWorkOrder workOrder) { if (workOrder == null || StringUtils.isEmpty(workOrder.getWorkOrderSource())) { - MesPcnException.throwBusiException("客户条码[%s]对应的工单信息缺少来源!", workOrder.getCustSn()); + MesPcnException.throwBusiException("客户条码[%s]对应的工单信息缺少来源!", workOrder != null ? workOrder.getCustSn() : ""); } MesCustSortInfo custSoftInfo = custSoftInfoRDao.getById(Long.parseLong(workOrder.getWorkOrderSource())); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesNumberRuleMatchRegularExpressionService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesNumberRuleMatchRegularExpressionService.java index a3e0898..e2bf7cb 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesNumberRuleMatchRegularExpressionService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesNumberRuleMatchRegularExpressionService.java @@ -76,7 +76,7 @@ public class MesNumberRuleMatchRegularExpressionService implements IMesNumberRul Pattern regex = Pattern.compile(regStr); //end update if (regex.matcher(barcodeNoSpecialChar.toLowerCase()).matches()) return true; - if (rule == barCode) return true; + if (rule.equals(barCode)) return true; } return false; diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesTimeEfficientCfgMatchService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesTimeEfficientCfgMatchService.java index a0d855e..786fb6e 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesTimeEfficientCfgMatchService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/MesTimeEfficientCfgMatchService.java @@ -166,41 +166,41 @@ public class MesTimeEfficientCfgMatchService implements IMesTimeEfficientCfgMatc return true; } - public static void main(String[] args) { - try { - Double minValue = 1d; - Double maxValue = 240d; - SimpleDateFormat sdf = new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT); -// Date now = new Date(); - Date now = sdf.parse("2025-03-21 11:19:06"); - Date productDateTime = sdf.parse("2025-03-21 11:15:06"); - int minDiff = (int) ((now.getTime() - productDateTime.getTime())/(60 * 1000)); - Integer matchRule = 40; - if (MesExtEnumUtil.MATCH_RULE.MATCH_RULE_20.getValue().equals(matchRule)) { - //差值 小于最小时差有效 - if (minDiff >= minValue){ - System.out.println(false); - } - } else if (MesExtEnumUtil.MATCH_RULE.MATCH_RULE_30.getValue().equals(matchRule)) { - // 差值 大于最大时差有效 - if (minDiff <= maxValue){ - System.out.println(false); - } - } else if (MesExtEnumUtil.MATCH_RULE.MATCH_RULE_40.getValue().equals(matchRule)) { - // 差值 最大最小时差有效 在 最大值 最小值之间 - if (minDiff <= minValue || minDiff >= maxValue){ - System.out.println(false); - } - } else if (MesExtEnumUtil.MATCH_RULE.MATCH_RULE_50.getValue().equals(matchRule)) { - // 差值 最大外或最小内有效 - if (minDiff >= minValue && minDiff <= maxValue){ - System.out.println(false); - } - } - System.out.println("执行完成"); - } catch (ParseException e) { - e.printStackTrace(); - } - } +// public static void main(String[] args) { +// try { +// Double minValue = 1d; +// Double maxValue = 240d; +// SimpleDateFormat sdf = new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT); +//// Date now = new Date(); +// Date now = sdf.parse("2025-03-21 11:19:06"); +// Date productDateTime = sdf.parse("2025-03-21 11:15:06"); +// int minDiff = (int) ((now.getTime() - productDateTime.getTime())/(60 * 1000)); +// Integer matchRule = 40; +// if (MesExtEnumUtil.MATCH_RULE.MATCH_RULE_20.getValue().equals(matchRule)) { +// //差值 小于最小时差有效 +// if (minDiff >= minValue){ +// System.out.println(false); +// } +// } else if (MesExtEnumUtil.MATCH_RULE.MATCH_RULE_30.getValue().equals(matchRule)) { +// // 差值 大于最大时差有效 +// if (minDiff <= maxValue){ +// System.out.println(false); +// } +// } else if (MesExtEnumUtil.MATCH_RULE.MATCH_RULE_40.getValue().equals(matchRule)) { +// // 差值 最大最小时差有效 在 最大值 最小值之间 +// if (minDiff <= minValue || minDiff >= maxValue){ +// System.out.println(false); +// } +// } else if (MesExtEnumUtil.MATCH_RULE.MATCH_RULE_50.getValue().equals(matchRule)) { +// // 差值 最大外或最小内有效 +// if (minDiff >= minValue && minDiff <= maxValue){ +// System.out.println(false); +// } +// } +// System.out.println("执行完成"); +// } catch (ParseException e) { +// e.printStackTrace(); +// } +// } } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/strategy/OrderWriteVariableService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/strategy/OrderWriteVariableService.java index ae635a2..8005e84 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/strategy/OrderWriteVariableService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/strategy/OrderWriteVariableService.java @@ -21,10 +21,6 @@ public class OrderWriteVariableService extends AbstractWriteVariableService{ @Autowired private IMesProductionDispatchContextStepService mesProductionDispatchContextStepService; - private Map map = new HashMap<>(); - - private String orderNo; - @Override public String transferValue(StationRequestBean reqBean, String value, Integer foreignKey, Integer index) { @@ -43,19 +39,4 @@ public class OrderWriteVariableService extends AbstractWriteVariableService{ } return null; } - - /* public void addList(String orderNo){ - orderNoList.add(orderNo); - } - - @Override - public void handlerValue() { - orderNoList.add(this.orderNo); - } - - @Override - public void removeValue() { - orderNoList.clear(); - orderNo = null; - }*/ } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/strategy/PartWriteVariableService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/strategy/PartWriteVariableService.java index 972f4e6..d51f1f0 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/strategy/PartWriteVariableService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/rulematch/strategy/PartWriteVariableService.java @@ -21,10 +21,6 @@ public class PartWriteVariableService extends AbstractWriteVariableService{ @Autowired private IMesProductionDispatchContextStepService mesProductionDispatchContextStepService; - private Map map = new HashMap<>(); - - private String orderNo; - @Override public String transferValue(StationRequestBean reqBean, String value, Integer foreignKey, Integer index) { @@ -35,30 +31,6 @@ public class PartWriteVariableService extends AbstractWriteVariableService{ if (mesProductionPartContext != null) { return mesProductionPartContext.getPartNo(); } - /* - for (MesProductionPartContext mesProductionPartContext : productionPartContextList) { - - if (orderNoList.contains(mesProductionPartContext.getWorkOrderNo())) { - continue; - } - orderNo = mesProductionPartContext.getWorkOrderNo(); - return mesProductionPartContext.getWorkOrderNo(); - }*/ return null; } - - /* public void addList(String orderNo){ - orderNoList.add(orderNo); - } - - @Override - public void handlerValue() { - orderNoList.add(this.orderNo); - } - - @Override - public void removeValue() { - orderNoList.clear(); - orderNo = null; - }*/ } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/function/MesFunctionPackageProgressService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/function/MesFunctionPackageProgressService.java index fd34108..bf54398 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/function/MesFunctionPackageProgressService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/function/MesFunctionPackageProgressService.java @@ -68,16 +68,17 @@ public class MesFunctionPackageProgressService extends BaseSwsService implements List resultList = new ArrayList<>(); //封装页面数据 - for (String partNo : packageDataContextMap.keySet()) { + for (Map.Entry entry : packageDataContextMap.entrySet()) { + String partNo = entry.getKey(); if (StringUtils.isEmpty(partNo)) continue; - List packageDataContextList = JSONObject.parseArray(packageDataContextMap.get(partNo), MesPackageDataContext.class); + List packageDataContextList = JSONObject.parseArray(entry.getValue(), MesPackageDataContext.class); packageDataContextList = packageDataContextList.stream().filter(o -> null != o).sorted(Comparator.comparing(MesPackageDataContext::getModifyDatetime).reversed()).collect(Collectors.toList()); //列表展示: 包装条码, 装箱个数, 包装规格数量, 装箱开始时间, 装箱结束时间 resultList.add(new MesPackageDataContext( packageDataContextList.get(0).getPartNo(), packageDataContextList.get(0).getPartName(), - packageDataContextList.get(0).getPackageNo(), new Double(packageDataContextList.size()), packageDataContextList.get(0).getPackSpecQty(), + packageDataContextList.get(0).getPackageNo(), (double) packageDataContextList.size(), packageDataContextList.get(0).getPackSpecQty(), packageDataContextList.get(0).getCreateDatetime(), packageDataContextList.get(0).getModifyDatetime(), packageDataContextList.get(0).getGenerateType()) ); } @@ -96,7 +97,7 @@ public class MesFunctionPackageProgressService extends BaseSwsService implements resultBean.writeDbLog(MesPcnEnumUtil.WORK_CELL_SCAN_MONITOR_LOG_TYPE.PICK.getValue()).scanInfo(packageDataContext.getPackageNo()); - if (null == packageDataContext || StringUtils.isEmpty(packageDataContext.getBusiType())) { + if (StringUtils.isEmpty(packageDataContext.getBusiType())) { return packResultMap(reqBean, resultBean, resultMap, String.format("生产线[%s]工位[%s]打包进度操作按钮执行失败,参数异常!", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode())); } @@ -146,7 +147,7 @@ public class MesFunctionPackageProgressService extends BaseSwsService implements //修改包装信息的数量 packageNoGenerateStepService.savePackageData(reqBean, packageDb, packageDataContext.getQty()); //打包数据更新数量(判断是增加还是减少数量) - if (MathOperation.compareTo(packageDataContext.getQty(), new Double(packageDataContextList.size())) < 0) { + if (MathOperation.compareTo(packageDataContext.getQty(), packageDataContextList.size()) < 0) { packageDataContextList = packageDataContextList.subList(0, packageDataContext.getQty().intValue()); } else { Integer loopTimes = packageDataContext.getQty().intValue() - packageDataContextList.size(); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/function/MesFunctionQueueOrderPushService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/function/MesFunctionQueueOrderPushService.java index b0594f8..5543498 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/function/MesFunctionQueueOrderPushService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/function/MesFunctionQueueOrderPushService.java @@ -193,7 +193,7 @@ public class MesFunctionQueueOrderPushService extends BaseSwsService implements Integer processSeq; if (!StringUtils.isEmpty(paramMap.get(MesPcnExtConstWords.PROCESS_SEQ))) processSeq = Integer.valueOf(paramMap.get(MesPcnExtConstWords.PROCESS_SEQ)); else if (!StringUtils.isEmpty(paramMap.get(MesPcnExtConstWords.PROCESS_SEQ_UP))) processSeq = queueOrderPushService.getQueueOrderPushCalcSeq(reqBean.getOrganizeCode(), optional.get(), Integer.valueOf(paramMap.get(MesPcnExtConstWords.PROCESS_SEQ_UP))); - else processSeq = Integer.valueOf(paramMap.get(MesPcnExtConstWords.PROCESS_SEQ_DOWN)) + 1; + else processSeq = Integer.parseInt(paramMap.get(MesPcnExtConstWords.PROCESS_SEQ_DOWN)) + 1; //根据条件修改生产队列工位推送信息 queueOrderPushService.saveQueueOrderPushByCondition( new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.ID}, diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionCustomContextStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionCustomContextStepService.java index 10bcecb..3a12667 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionCustomContextStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionCustomContextStepService.java @@ -186,7 +186,7 @@ public class MesProductionCustomContextStepService extends BaseStepService imple AtomicReference flag = new AtomicReference<>(false); stationKvBeans.stream().forEach(stationKvBean -> { if (stationKvBean.getKey().contains(mesProdShiftKvBean.getShiftGroup())) { - stationKvBean.setValue(stationKvBean == null ? countStr : String.valueOf(Integer.valueOf(stationKvBean.getValue()) + count)); + stationKvBean.setValue(stationKvBean == null ? countStr : String.valueOf(Integer.parseInt(stationKvBean.getValue()) + count)); amount.set(Integer.valueOf(stationKvBean.getValue())); flag.set(true); } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionDispatchContextStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionDispatchContextStepService.java index 1c18b48..8253a94 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionDispatchContextStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/context/MesProductionDispatchContextStepService.java @@ -423,7 +423,7 @@ public class MesProductionDispatchContextStepService extends BaseStepService imp removeFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), item); return true; } - dispatchFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), item, String.valueOf(Integer.valueOf(endlessLoopReadTimes) + 1)); + dispatchFsmBusiData(reqBean.getOrganizeCode(), getContextKey(reqBean), item, String.valueOf(Integer.parseInt(endlessLoopReadTimes) + 1)); return false; } diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/method/MesWorkOrderCheckCompleteQtyStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/method/MesWorkOrderCheckCompleteQtyStepService.java index f3c01bc..5cd74f4 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/method/MesWorkOrderCheckCompleteQtyStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/method/MesWorkOrderCheckCompleteQtyStepService.java @@ -50,7 +50,7 @@ public class MesWorkOrderCheckCompleteQtyStepService extends BaseStepService { if (!stepResult.isCompleted() || CollectionUtils.isEmpty(productionPartContextList)) return null; //根据产出零件或者腔数拿到需要的加工规则数量, 优先使用产出零件数量 - Integer needQty = !CollectionUtils.isEmpty(productionPartContextList) ? productionPartContextList.size() : productionProcessContext.getCurCellEquip().getCavity(); + int needQty = !CollectionUtils.isEmpty(productionPartContextList) ? productionPartContextList.size() : productionProcessContext.getCurCellEquip().getCavity(); //验证是否满足腔数 if (!CollectionUtils.isEmpty(productionPsInContextList) && productionPsInContextList.size() < needQty) return null; @@ -103,17 +103,17 @@ public class MesWorkOrderCheckCompleteQtyStepService extends BaseStepService { private MesWorkOrderCompleteQtyContext dispatchWorkOrderCompleteQty(StationRequestBean reqBean, StationResultBean resultBean, StepResult stepResult, MesWorkCenter workCenter, Boolean noCalcOrderQty, List productionPartContextList, Map productionPsInContextMap) { - Double calcCompleteQty = new Double(MesPcnExtConstWords.ZERO); + double calcCompleteQty = MesPcnExtConstWords.ZERO; for (MesProductionPartContext productionPartContext : productionPartContextList) { MesProductionPsInContext productionPsInContext = getProductionPsInContext(productionPsInContextMap, productionPartContext.getForeignKey()); //验证进料零件与产出零件是否一致 Boolean isSamePart = isSamePart(productionPsInContext, productionPartContext, null); //验证是否计数 Boolean isCalcCompleteQty = isCalcCompleteQty(isSamePart, productionPsInContext, productionPartContext); - if (isCalcCompleteQty) calcCompleteQty = MathOperation.add(calcCompleteQty, new Double(MesPcnExtConstWords.ONE)); + if (isCalcCompleteQty) calcCompleteQty = MathOperation.add(calcCompleteQty, MesPcnExtConstWords.ONE); } //当前工单无须计算工单完成数 - if (MathOperation.compareTo(calcCompleteQty, new Double(MesPcnExtConstWords.ZERO)) == 0) return null; + if (MathOperation.compareTo(calcCompleteQty, MesPcnExtConstWords.ZERO) == 0) return null; //根据noCalcOrderQty判断维度处理工单完成数上下文[查询]【noCalcOrderQty=true代表工位维度的统计,最终不会实际累加到工单上】【noCalcOrderQty=false代表生产线维度的统计,才会实际累加到工单上】 MesWorkOrderCompleteQtyContext workOrderCompleteQtyContext = productionCustomContextStepService.dispatchWorkOrderCompleteQtyContext(reqBean, noCalcOrderQty, productionPartContextList.get(0)); @@ -171,7 +171,7 @@ public class MesWorkOrderCheckCompleteQtyStepService extends BaseStepService { MesWorkOrderCompleteQtyContext workOrderCompleteQtyContext, Double calcCompleteQty, Boolean noCalcOrderQty) { //当前工序的预计达到的完成数 - Double complateQty = MathOperation.add(workOrderCompleteQtyContext.getCompleteQty(), calcCompleteQty); + double complateQty = MathOperation.add(workOrderCompleteQtyContext.getCompleteQty(), calcCompleteQty); // 如果预完成数量 小于等于工单数量,则直接过 if (MathOperation.compareTo(workOrderCompleteQtyContext.getQty(), complateQty) >= 0) return; //判断不支持超工单生产 @@ -184,8 +184,8 @@ public class MesWorkOrderCheckCompleteQtyStepService extends BaseStepService { return; } //支持超工单生产情况下判断超出比例 - Double rate = MathOperation.div((MathOperation.sub(complateQty, workOrderCompleteQtyContext.getQty())), workOrderCompleteQtyContext.getQty()); - if (MathOperation.compareTo(rate, MathOperation.div(workCenter.getOrderRate(), new Double(MesPcnExtConstWords.ONE_HUNDRED))) > 0) { + double rate = MathOperation.div((MathOperation.sub(complateQty, workOrderCompleteQtyContext.getQty())), workOrderCompleteQtyContext.getQty()); + if (MathOperation.compareTo(rate, MathOperation.div(workCenter.getOrderRate(), MesPcnExtConstWords.ONE_HUNDRED)) > 0) { stepNonCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult.obj(false), String.format("请检查工单数量,工单[%s]计划数量[%s]%s已完成数量[%s]超工单比例[%s]!", workOrderCompleteQtyContext.getWorkOrderNo(), workOrderCompleteQtyContext.getQty().intValue(), noCalcOrderQty ? "当前工位" : MesPcnExtConstWords.EMPTY, workOrderCompleteQtyContext.getCompleteQty().intValue(), workCenter.getOrderRate())); diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesAssemblyShowContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesAssemblyShowContext.java index 915e488..e4c1d1c 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesAssemblyShowContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesAssemblyShowContext.java @@ -45,7 +45,7 @@ public class MesAssemblyShowContext implements Serializable { private Integer matchType; @ApiParam("扫描规则") - public String matchRule; + private String matchRule; @ApiParam("装配零件状态") private String assemblyStatusName; @@ -54,7 +54,7 @@ public class MesAssemblyShowContext implements Serializable { private String matchTypeName; @ApiParam("工位代码") - public String workCellCode; + private String workCellCode; @ApiParam(value = "工艺顺序号") private Integer processSeq; @@ -63,7 +63,7 @@ public class MesAssemblyShowContext implements Serializable { private Integer index; @ApiParam("匹配时间") - public String matchDatetime; + private String matchDatetime; @ApiParam(value = "是否置顶") private Integer isTop = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(); diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesPackageDataContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesPackageDataContext.java index 71c6088..8cfa9eb 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesPackageDataContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesPackageDataContext.java @@ -2,12 +2,14 @@ package cn.estsh.i3plus.ext.mes.pcn.pojo.context; import io.swagger.annotations.ApiParam; import lombok.Data; +import lombok.EqualsAndHashCode; import java.io.Serializable; /** * 生产过程打包数据 */ +@EqualsAndHashCode(callSuper = true) @Data public class MesPackageDataContext extends MesPackageRuleContext implements Serializable { diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesPackageRuleContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesPackageRuleContext.java index 4fb39c6..15f8745 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesPackageRuleContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesPackageRuleContext.java @@ -14,54 +14,54 @@ public class MesPackageRuleContext implements Serializable { private static final long serialVersionUID = 1369218116212836881L; @ApiParam(name = "包装代码") - public String packageCode; + private String packageCode; @ApiParam(name = "行号") - public String lineNo; + private String lineNo; @ApiParam(name = "零件号") - public String partNo; + protected String partNo; @ApiParam(name = "零件名称") - public String partName; + protected String partName; @ApiParam(name = "零件类型") - public String partType; + private String partType; @ApiParam("包装规格数量") - public Double packSpecQty; + protected Double packSpecQty; @ApiParam("最小数量") - public Double minQty; + private Double minQty; @ApiParam("取整数量") - public Double roundnessQty; + private Double roundnessQty; @ApiParam(name = "计量单位") - public String unit; + private String unit; @ApiParam(name = "是否默认包装") - public Integer defaultFlag; + private Integer defaultFlag; @ApiParam(name = "统计方式") - public Integer generateType; + protected Integer generateType; @ApiParam(name = "箱类别代号") - public String packCode; + private String packCode; @ApiParam(name = "包装条码编码规则") - public String packageBarcodeRule; + private String packageBarcodeRule; @ApiParam(name = "包装条码模板") - public String packageTemplate; + private String packageTemplate; @ApiParam(name = "打印机") - public String printer; + private String printer; @ApiParam(name = "同步状态WMS") - public Integer systemSyncStatusWms = 2; + private Integer systemSyncStatusWms = 2; @ApiParam("零件打包加工单号") - public String partPackWorkOrderNo; + private String partPackWorkOrderNo; } diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesPartContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesPartContext.java index 36294d9..3533a7a 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesPartContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesPartContext.java @@ -3,6 +3,7 @@ package cn.estsh.i3plus.ext.mes.pcn.pojo.context; import cn.estsh.i3plus.pojo.mes.bean.MesPart; import io.swagger.annotations.ApiParam; import lombok.Data; +import lombok.EqualsAndHashCode; import org.springframework.beans.BeanUtils; import java.io.Serializable; @@ -10,8 +11,9 @@ import java.io.Serializable; /** * 生产过程上下文对象-零件条码(非排序产出零件条码) */ +@EqualsAndHashCode(callSuper = true) @Data -public class MesPartContext extends MesPart implements Serializable { +public final class MesPartContext extends MesPart implements Serializable { private static final long serialVersionUID = -1221271846639577097L; diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProdRuleContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProdRuleContext.java index b7c9d3b..e9de012 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProdRuleContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProdRuleContext.java @@ -25,7 +25,7 @@ public class MesProdRuleContext implements Serializable { private static final long serialVersionUID = 1522652732930288854L; @ApiParam("组织代码") - public String organizeCode; + private String organizeCode; @ApiParam(name = "数据关联键") private Integer foreignKey; @@ -43,16 +43,16 @@ public class MesProdRuleContext implements Serializable { private String productSn; @ApiParam("装配件绑定清单 [JSON]List") - public String assemblyDataJson; + private String assemblyDataJson; @ApiParam("生产线代码") - public String workCenterCode; + private String workCenterCode; @ApiParam("工位代码") - public String workCellCode; + private String workCellCode; @ApiParam("工序代码") - public String processCode; + private String processCode; @ApiParam("工艺代码") private String craftCode; @@ -63,7 +63,7 @@ public class MesProdRuleContext implements Serializable { //-------以下非排序属性------------- @ApiParam("非排序产品加工规则ID") - public Long pid; + private Long pid; @ApiParam(name = "进料零件号") private String inPartNo; diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProdTempDataContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProdTempDataContext.java index 1c99f65..d16f180 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProdTempDataContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProdTempDataContext.java @@ -14,13 +14,13 @@ public class MesProdTempDataContext implements Serializable { private static final long serialVersionUID = -5184127961206077150L; @ApiParam("组织代码") - public String organizeCode; + private String organizeCode; @ApiParam(name = "数据关联键") private Integer foreignKey; @ApiParam("流水号") - public String serialNo; + private String serialNo; public MesProdTempDataContext() {} diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblyContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblyContext.java index 75a1c0e..1616c56 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblyContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblyContext.java @@ -17,115 +17,115 @@ public class MesProductionAssemblyContext implements Serializable { private static final long serialVersionUID = 2382117884422723639L; @ApiParam("生产工单号") - public String workOrderNo; + private String workOrderNo; @ApiParam("装配件零件编码") - public String assemblyPartNo; + private String assemblyPartNo; @ApiParam("装配件零件名称") - public String assemblyPartName; + private String assemblyPartName; @ApiParam("装配件条码") - public String assemblySn; + protected String assemblySn; @ApiParam("生产工单零件号") - public String partNo; + private String partNo; @ApiParam("生产工单零件名称") - public String partName; + private String partName; @ApiParam("装配零件状态") - public Integer assemblyStatus; + protected Integer assemblyStatus; @ApiParam("是否跳过") - public Integer isSkip = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(); + protected Integer isSkip = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(); @ApiParam("装配件条码确认方式") - public Integer matchType; + protected Integer matchType; @ApiParam("扫描规则") - public String matchRule; + private String matchRule; @ApiParam("不可用规则") - public String prodRuleIgnoreCfg; + protected String prodRuleIgnoreCfg; @ApiParam("自制件ID") - public Long productSnId; + protected Long productSnId; @ApiParam("数据来源") - public Integer dataSource; + protected Integer dataSource; @ApiParam("来源ID") - public Long sourceId; + protected Long sourceId; @ApiParam(value = "排序/非排序产品加工规则ID") - public Long pid; + private Long pid; @ApiParam("最小值") - public Double minValue; + private Double minValue; @ApiParam("最大值") - public Double maxValue; + private Double maxValue; @ApiParam(value = "装备序号") - public Integer routeSeq; + protected Integer routeSeq; @ApiParam(value = "装配爆炸图FID") - public Long imageFileId; + protected Long imageFileId; @ApiParam(value = "音频文件") - public Long audioFileId; + protected Long audioFileId; @ApiParam(value = "装配爆炸图URL") - public String imageFileUrl; + protected String imageFileUrl; @ApiParam(value = "音频文件URL") - public String audioFileUrl; + protected String audioFileUrl; @ApiParam(value = "装配爆炸图URL") - public Integer fileIsFinished = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(); + protected Integer fileIsFinished = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(); @ApiParam("前道工艺代码") - public String preCraftCode; + private String preCraftCode; @ApiParam("组织代码") - public String organizeCode; + private String organizeCode; @ApiParam("区域代码") - public String areaCode; + private String areaCode; @ApiParam("生产线代码") - public String workCenterCode; + private String workCenterCode; @ApiParam("工位代码") - public String workCellCode; + private String workCellCode; @ApiParam("设备代码") - public String equipmentCode; + private String equipmentCode; @ApiParam("工序代码") - public String processCode; + private String processCode; @ApiParam("工序名称") - public String processName; + private String processName; @ApiParam("工艺代码") - public String craftCode; + private String craftCode; @ApiParam("工艺名称") - public String craftName; + private String craftName; @ApiParam(name = "数据关联键") - public Integer foreignKey; + protected Integer foreignKey; @ApiParam(value = "是否可复用条码") - public Integer isRepeat = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(); + private Integer isRepeat = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(); @ApiParam(value = "是否可复用条码是否写入上下文进行复用") - public Integer isRepeat2Cache = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(); + protected Integer isRepeat2Cache = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(); @ApiParam("匹配时间") - public String matchDatetime; + protected String matchDatetime; public String repeatKeyToString() { if (StringUtils.isEmpty(this.equipmentCode) || StringUtils.isEmpty(this.matchType) || (StringUtils.isEmpty(this.matchRule) && StringUtils.isEmpty(this.assemblyPartNo))) return null; diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblyNosortContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblyNosortContext.java index 8cbc7ab..6fc4488 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblyNosortContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblyNosortContext.java @@ -7,6 +7,7 @@ import cn.estsh.i3plus.pojo.mes.bean.MesProductionAssembly; import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; import io.swagger.annotations.ApiParam; import lombok.Data; +import lombok.EqualsAndHashCode; import org.springframework.beans.BeanUtils; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; @@ -19,6 +20,7 @@ import java.util.Map; /** * 生产过程上下文对象-装配件清单信息(非排序) */ +@EqualsAndHashCode(callSuper = true) @Data public class MesProductionAssemblyNosortContext extends MesProductionAssemblyContext implements Serializable { @@ -28,7 +30,7 @@ public class MesProductionAssemblyNosortContext extends MesProductionAssemblyCon private String bomDetailId; @ApiParam(name = "任意装配件扫描错误判断工位isResetScan后是否重新扫描") - public Integer isResetScan = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(); + private Integer isResetScan = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(); @ApiParam(value = "是否忽略回车") private Integer isIgnoreEntry; @@ -50,16 +52,16 @@ public class MesProductionAssemblyNosortContext extends MesProductionAssemblyCon BeanUtils.copyProperties(prodRuleContext, this); - this.dataSource = MesExtEnumUtil.WORK_CENTER_TYPE.NOSORT.getValue(); + setDataSource(MesExtEnumUtil.WORK_CENTER_TYPE.NOSORT.getValue()); - this.sourceId = assemblyNosortCfg.getId(); + setSourceId(assemblyNosortCfg.getId()); - this.partNo = prodRuleContext.getOutPartNo(); + setPartNo(prodRuleContext.getOutPartNo()); - if (StringUtils.isEmpty(this.routeSeq)) this.routeSeq = MesPcnExtConstWords.ZERO; - if (StringUtils.isEmpty(this.isRepeat) || this.isRepeat.compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) != 0) this.isRepeat = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(); + if (StringUtils.isEmpty(this.getRouteSeq())) this.setRouteSeq(MesPcnExtConstWords.ZERO); + if (StringUtils.isEmpty(this.getIsRepeat()) || this.getIsRepeat().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) != 0) this.setIsRepeat(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); - this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue(); + this.setAssemblyStatus(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue()); return this; } diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblySortContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblySortContext.java index 0e2536f..1b6f800 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblySortContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionAssemblySortContext.java @@ -8,6 +8,7 @@ import cn.estsh.i3plus.pojo.mes.bean.MesWorkOrderAssembly; import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; import io.swagger.annotations.ApiParam; import lombok.Data; +import lombok.EqualsAndHashCode; import org.springframework.beans.BeanUtils; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; @@ -20,6 +21,7 @@ import java.util.Map; /** * 生产过程上下文对象-装配件清单信息(排序) */ +@EqualsAndHashCode(callSuper = true) @Data public class MesProductionAssemblySortContext extends MesProductionAssemblyContext implements Serializable { @@ -107,7 +109,7 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte private String productGroupCode; @ApiParam(value = "装配件记录表ID") - public Long id; + private Long id; @ApiParam("开模记录ID") private Long mouldRecordId; @@ -116,16 +118,16 @@ public class MesProductionAssemblySortContext extends MesProductionAssemblyConte private Long productionRecordId; @ApiParam(value = "工单装配件信息备注") - public String woaRemark; + private String woaRemark; @ApiParam(value = "装配件记录信息备注") - public String paRemark; + private String paRemark; @ApiParam(value = "装配件记录表创建时间") - public String createDatetime; + private String createDatetime; @ApiParam(value = "装配件记录表创建人") - public String createUser; + private String createUser; @ApiParam(name = "是否顺序扫描") private Integer isCheckBindSeq; diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionProcessContext.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionProcessContext.java index 99e8d91..b3c115f 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionProcessContext.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/context/MesProductionProcessContext.java @@ -172,9 +172,11 @@ public class MesProductionProcessContext implements Serializable { //上下文赋值生产线对象 public MesProductionProcessContext workCenterJson(MesWorkCenter workCenter) { - if (StringUtils.isEmpty(workCenter.getIsCheckOrderQty())) workCenter.setIsCheckOrderQty(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); - if (StringUtils.isEmpty(workCenter.getIsIgnoreQc())) workCenter.setIsCheckOrderQty(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); - if (StringUtils.isEmpty(workCenter.getIsPushQueue())) workCenter.setIsPushQueue(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); + if (workCenter != null) { + if (StringUtils.isEmpty(workCenter.getIsCheckOrderQty())) workCenter.setIsCheckOrderQty(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); + if (StringUtils.isEmpty(workCenter.getIsIgnoreQc())) workCenter.setIsCheckOrderQty(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); + if (StringUtils.isEmpty(workCenter.getIsPushQueue())) workCenter.setIsPushQueue(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); + } this.workCenterJson = null != workCenter ? JSONObject.toJSONString(workCenter) : null; return this.isNeedCache(); } @@ -188,12 +190,14 @@ public class MesProductionProcessContext implements Serializable { //上下文赋值工位对象 public MesProductionProcessContext workCellJson(MesWorkCell workCell) { - if (StringUtils.isEmpty(workCell.getIsCheckSeq())) workCell.setIsCheckSeq(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); - if (StringUtils.isEmpty(workCell.getIsCheckCraft())) workCell.setIsCheckCraft(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); - if (StringUtils.isEmpty(workCell.getIsSeqScan())) workCell.setIsCheckSeq(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); - if (StringUtils.isEmpty(workCell.getIsResetScan())) workCell.setIsResetScan(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); - if (StringUtils.isEmpty(workCell.getNoCalcOrderQty())) workCell.setNoCalcOrderQty(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); - if (StringUtils.isEmpty(workCell.getIsEndWorkCell())) workCell.setIsEndWorkCell(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); + if (workCell != null) { + if (StringUtils.isEmpty(workCell.getIsCheckSeq())) workCell.setIsCheckSeq(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); + if (StringUtils.isEmpty(workCell.getIsCheckCraft())) workCell.setIsCheckCraft(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); + if (StringUtils.isEmpty(workCell.getIsSeqScan())) workCell.setIsCheckSeq(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); + if (StringUtils.isEmpty(workCell.getIsResetScan())) workCell.setIsResetScan(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); + if (StringUtils.isEmpty(workCell.getNoCalcOrderQty())) workCell.setNoCalcOrderQty(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); + if (StringUtils.isEmpty(workCell.getIsEndWorkCell())) workCell.setIsEndWorkCell(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); + } this.workCellJson = null != workCell ? JSONObject.toJSONString(workCell) : null; return this.isNeedCache(); } @@ -255,10 +259,12 @@ public class MesProductionProcessContext implements Serializable { //上下文赋值工位当前要使用的设备 public MesProductionProcessContext curCellEquipJson(MesCellEquipContext curEquip) { - //未配置则默认1腔 - if (StringUtils.isEmpty(curEquip.getCavity()) || curEquip.getCavity().compareTo(MesPcnExtConstWords.ZERO) == 0) curEquip.setCavity(MesPcnExtConstWords.ONE); - //未配置则默认没有装配件 - if (StringUtils.isEmpty(curEquip.getBindQty())) curEquip.setBindQty(MesPcnExtConstWords.ZERO); + if (curEquip != null) { + //未配置则默认1腔 + if (StringUtils.isEmpty(curEquip.getCavity()) || curEquip.getCavity().compareTo(MesPcnExtConstWords.ZERO) == 0) curEquip.setCavity(MesPcnExtConstWords.ONE); + //未配置则默认没有装配件 + if (StringUtils.isEmpty(curEquip.getBindQty())) curEquip.setBindQty(MesPcnExtConstWords.ZERO); + } this.curCellEquipJson = null != curEquip ? JSONObject.toJSONString(curEquip) : null; return this.isNeedCache(); } 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 1ce12f0..1a0a4c4 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 @@ -15,7 +15,7 @@ import java.io.Serializable; * 生产过程上下文对象-零件条码(非排序进料零件条码/排序工单号) */ @Data -public class MesProductionPsInContext implements Serializable { +public final class MesProductionPsInContext implements Serializable { private static final long serialVersionUID = 4337949265011880288L; diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesProduceSnPrintModel.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesProduceSnPrintModel.java index 6dd7a26..5481bfa 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesProduceSnPrintModel.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/model/MesProduceSnPrintModel.java @@ -2,7 +2,9 @@ package cn.estsh.i3plus.ext.mes.pcn.pojo.model; import cn.estsh.i3plus.pojo.mes.bean.*; import io.swagger.annotations.ApiParam; +import lombok.AccessLevel; import lombok.Data; +import lombok.Getter; import java.util.ArrayList; import java.util.List; @@ -37,6 +39,7 @@ public class MesProduceSnPrintModel { private Integer printQty; @ApiParam("标包数量") + @Getter(AccessLevel.NONE) private Double qty; @ApiParam("打印模板") diff --git a/pom.xml b/pom.xml index e55d478..dee534b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,6 +3,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + + impp.framework + impp-framework + 1.0.1-YZ + i3plus.ext.mes.pcn i3plus-ext-mes-pcn @@ -16,13 +21,6 @@ modules/i3plus-ext-mes-pcn-icloud - - org.springframework.boot - spring-boot-starter-parent - 2.0.3.RELEASE - - - i3plus-ext-mes-pcn 1.8 diff --git a/spotbugs-exclude.xml b/spotbugs-exclude.xml new file mode 100644 index 0000000..e41d746 --- /dev/null +++ b/spotbugs-exclude.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file