From 254687ff810e6a3fbea8b4e61ee69c969f02f1a1 Mon Sep 17 00:00:00 2001 From: jun Date: Sat, 12 Oct 2024 15:38:31 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E5=8A=A0=E5=B7=A5=E8=AE=B0=E5=BD=95=EF=BC=8C=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=A0=87=E8=AF=86=E5=BA=94=E8=AF=A5=E4=B8=BA2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceimpl/step/MesProductionRecordGenerateStepService.java | 3 ++- .../estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionRecordGenerateStepService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionRecordGenerateStepService.java index 8460bd5..6d0e1a2 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionRecordGenerateStepService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/step/MesProductionRecordGenerateStepService.java @@ -5,6 +5,7 @@ import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionDispatchContextStepSer import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService; import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionRecordService; import cn.estsh.i3plus.ext.mes.pcn.pojo.context.*; +import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords; import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService; import cn.estsh.i3plus.platform.common.convert.ConvertBean; import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; @@ -119,7 +120,7 @@ public class MesProductionRecordGenerateStepService extends BaseStepService { MesProdRuleContext prodRuleContext = CollectionUtils.isEmpty(prMap) ? null : prMap.get(productionPsOutContext.getForeignKey()); MesProductionRecord productionRecord = new MesProductionRecord(); - BeanUtils.copyProperties(productionPsOutContext, productionRecord); + BeanUtils.copyProperties(productionPsOutContext, productionRecord, MesPcnExtConstWords.BASE_BEAN_FIELDS); productionRecord.setMouldNo(mouldNo); productionRecord.setEquipmentCode(cellEquipContext.getEquipmentCode()); diff --git a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java index 54fb717..f083de1 100644 --- a/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java +++ b/modules/i3plus-ext-mes-pcn-pojo/src/main/java/cn/estsh/i3plus/ext/mes/pcn/pojo/util/MesPcnExtConstWords.java @@ -65,6 +65,8 @@ public class MesPcnExtConstWords { public static final String USER_INFO = "userInfo"; // 同步标志 public static final String SYSTEM_SYNC_STATUS = "systemSyncStatus"; + // 同步时间 + public static final String SYSTEM_SYNC_DATE_TIME = "systemSyncDatetime"; // 零件编码 public static final String PART_NO = "partNo"; // 零件名称 @@ -177,6 +179,12 @@ public class MesPcnExtConstWords { public static final String COLOR = "color"; // 设备计数点位固定二级变量 public static final String SHOT_COUNTER = "shot_counter"; + //描述 + public static final String DESCRIPTION = "description"; + //描述 + public static final String REMARK = "remark"; + //BaseBean字段不包含工厂, 用于对象复制剔除属性BeanUtils.copyProperties(Object source, Object target, String... ignoreProperties) + public static final String[] BASE_BEAN_FIELDS = {ID, IS_DELETED, IS_VALID, CREATE_DATE_TIME, CREATE_USER, MODIFY_DATE_TIME, MODIFY_USER, DESCRIPTION, REMARK, SYSTEM_SYNC_DATE_TIME, SYSTEM_SYNC_STATUS}; // 时间格式 public static final String DATE_FORMAT_SSS = "yyyy-MM-dd HH:mm:ss.SSS"; From aff7c237e933f3ba3d2078a969c7255ebf61ea42 Mon Sep 17 00:00:00 2001 From: "xiangwei.zhang" <752558143@qq.com> Date: Wed, 16 Oct 2024 16:17:25 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=81=9C=E6=9C=BA?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../function/MesFunctionEquDowntimeService.java | 41 +++++++++------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/function/MesFunctionEquDowntimeService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/function/MesFunctionEquDowntimeService.java index cd23149..a5ad1d3 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/function/MesFunctionEquDowntimeService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/function/MesFunctionEquDowntimeService.java @@ -82,32 +82,23 @@ public class MesFunctionEquDowntimeService extends BaseSwsService implements IFs if (!StringUtil.isEmpty(type)) { DdlPreparedPack.getStringEqualPack(type, "reasonTypeCode", ddlPackBeanDowntime); } - MesDowntimeRecord mesDowntimeRecordDao = mesDowntimeRecordRDao.getByProperty(ddlPackBeanDowntime); - if (StringUtil.isEmpty(mesDowntimeRecordDao)) { - //新增设备停机记录 - MesDowntimeRecord mesDowntimeRecord = new MesDowntimeRecord(); - mesDowntimeRecord.setOrganizeCode(organizeCode); - mesDowntimeRecord.setEquipId(mesEquipment.getEquipId()); - mesDowntimeRecord.setEquipmentCode(mesEquipment.getEquipmentCode()); - mesDowntimeRecord.setAreaCode(reqBean.getAreaCode()); - mesDowntimeRecord.setWorkCenterCode(reqBean.getWorkCenterCode()); - mesDowntimeRecord.setWorkCellCode(reqBean.getWorkCellCode()); - mesDowntimeRecord.setReasonCode(StringUtil.isEmpty(reason) ? "" : reason); - mesDowntimeRecord.setReasonTypeCode(StringUtil.isEmpty(type) ? "" : type); - ConvertBean.serviceModelInitialize(mesDowntimeRecord, userInfo); + //新增设备停机记录 + MesDowntimeRecord mesDowntimeRecord = new MesDowntimeRecord(); + mesDowntimeRecord.setOrganizeCode(organizeCode); + mesDowntimeRecord.setEquipId(mesEquipment.getEquipId()); + mesDowntimeRecord.setEquipmentCode(mesEquipment.getEquipmentCode()); + mesDowntimeRecord.setAreaCode(reqBean.getAreaCode()); + mesDowntimeRecord.setWorkCenterCode(reqBean.getWorkCenterCode()); + mesDowntimeRecord.setWorkCellCode(reqBean.getWorkCellCode()); + mesDowntimeRecord.setReasonCode(StringUtil.isEmpty(reason) ? "" : reason); + mesDowntimeRecord.setReasonTypeCode(StringUtil.isEmpty(type) ? "" : type); + ConvertBean.serviceModelInitialize(mesDowntimeRecord, userInfo); + mesDowntimeRecord.setModifyDatetime(null); + mesDowntimeRecordRDao.insert(mesDowntimeRecord); + - mesDowntimeRecordRDao.insert(mesDowntimeRecord); -// //将当前新增数据的create_date_time时间些到上一条记录的modify_date_time字段 -// DdlPackBean ddlPackBeanOt = DdlPackBean.getDdlPackBean(organizeCode); -// DdlPreparedPack.getStringEqualPack(mesEquipment.getEquipmentCode(), "equipmentCode", ddlPackBeanOt); -// ddlPackBeanOt.setWhereAppend(ddlPackBeanOt.getWhereAppend() + " order by createDatetime desc "); -// MesDowntimeRecord mesDowntimeRecordOt = mesDowntimeRecordRDao.getByProperty(ddlPackBeanOt); -// if (StringUtil.isEmpty(mesDowntimeRecordOt)) { -// mesDowntimeRecordOt.setModifyDatetime(mesDowntimeRecord.getCreateDatetime()); -// mesDowntimeRecordOt.setModifyUser(userInfo); -// mesDowntimeRecordRDao.update(mesDowntimeRecordOt); -// } - } else { + MesDowntimeRecord mesDowntimeRecordDao = mesDowntimeRecordRDao.getByProperty(ddlPackBeanDowntime); + if (!StringUtil.isEmpty(mesDowntimeRecordDao)) { ConvertBean.serviceModelUpdate(mesDowntimeRecordDao, "MesDowntimeRecordJob"); mesDowntimeRecordRDao.update(mesDowntimeRecordDao); } From bd26b7762b97bfab4ca61ebc17d459f2dda127c5 Mon Sep 17 00:00:00 2001 From: "xiangwei.zhang" <752558143@qq.com> Date: Fri, 18 Oct 2024 11:22:14 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=81=9C=E6=9C=BA?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apiservice/serviceimpl/busi/MesWorkOrderService.java | 4 ++-- .../station/function/MesFunctionEquDowntimeService.java | 15 ++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) 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 99972c0..97d3934 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 @@ -904,7 +904,7 @@ public class MesWorkOrderService implements IMesWorkOrderService { List centerList = Arrays.asList(workCenterCodes.split(",")); DdlPreparedPack.getInPack(centerList, "workCenterCode", ddlPackBean); }*/ - DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"modifyDatetime"}, ddlPackBean); + DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"modifyDatetime"}, ddlPackBean); String numStr = configService.getCfgValue(organizeCode, "MES_PCN_REPORT_NUM"); int num = StringUtils.isEmpty(numStr) ? 50 : Integer.valueOf(numStr); @@ -936,7 +936,7 @@ public class MesWorkOrderService implements IMesWorkOrderService { List centerList = Arrays.asList(workCenterCodes.split(",")); DdlPreparedPack.getNotInPack(centerList, "workCenterCode", ddlPackBean); } - DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"modifyDatetime"}, ddlPackBean); + DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"modifyDatetime"}, ddlPackBean); String numStr = configService.getCfgValue(organizeCode, "MES_PCN_REPORT_NUM"); int num = StringUtils.isEmpty(numStr) ? 50 : Integer.valueOf(numStr); diff --git a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/function/MesFunctionEquDowntimeService.java b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/function/MesFunctionEquDowntimeService.java index a5ad1d3..8822731 100644 --- a/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/function/MesFunctionEquDowntimeService.java +++ b/modules/i3plus-ext-mes-pcn-apiservice/src/main/java/cn/estsh/i3plus/ext/mes/pcn/apiservice/serviceimpl/station/function/MesFunctionEquDowntimeService.java @@ -82,6 +82,16 @@ public class MesFunctionEquDowntimeService extends BaseSwsService implements IFs if (!StringUtil.isEmpty(type)) { DdlPreparedPack.getStringEqualPack(type, "reasonTypeCode", ddlPackBeanDowntime); } + DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue()}, new String[]{"createDatetime"}, ddlPackBeanDowntime); + MesDowntimeRecord mesDowntimeRecordDao = mesDowntimeRecordRDao.getByProperty(ddlPackBeanDowntime); + if (!StringUtil.isEmpty(mesDowntimeRecordDao)) { + // 如果有停机结束时间,则不需要修改,否则需要 + if (StringUtil.isEmpty(mesDowntimeRecordDao.getModifyDatetime())) { + ConvertBean.serviceModelUpdate(mesDowntimeRecordDao, "MesDowntimeRecordJob"); + mesDowntimeRecordRDao.update(mesDowntimeRecordDao); + } + } + //新增设备停机记录 MesDowntimeRecord mesDowntimeRecord = new MesDowntimeRecord(); mesDowntimeRecord.setOrganizeCode(organizeCode); @@ -97,11 +107,6 @@ public class MesFunctionEquDowntimeService extends BaseSwsService implements IFs mesDowntimeRecordRDao.insert(mesDowntimeRecord); - MesDowntimeRecord mesDowntimeRecordDao = mesDowntimeRecordRDao.getByProperty(ddlPackBeanDowntime); - if (!StringUtil.isEmpty(mesDowntimeRecordDao)) { - ConvertBean.serviceModelUpdate(mesDowntimeRecordDao, "MesDowntimeRecordJob"); - mesDowntimeRecordRDao.update(mesDowntimeRecordDao); - } return true; } else { DdlPackBean packBean = DdlPackBean.getDdlPackBean(reqBean.getOrganizeCode());