修复产品加工记录 数据覆盖 没有新增的问题

tags/yfai-pcn-ext-v2.3
王杰 7 months ago
parent c0feb1dde4
commit 84436a5b0f

@ -85,9 +85,8 @@ public class MesAssemblyExtService implements IMesAssemblyExtService {
//【排序线】获取生产工单装配件清单 //【排序线】获取生产工单装配件清单
List<MesWorkOrderAssembly> workOrderAssemblyList = filterWorkOrderAssemblyList(getWorkOrderAssemblyList(prodRuleContext), prodRuleContext.getEquipmentCode()); List<MesWorkOrderAssembly> workOrderAssemblyList = filterWorkOrderAssemblyList(getWorkOrderAssemblyList(prodRuleContext), prodRuleContext.getEquipmentCode());
// 显示前道所有工序装配件工步: 不携带工位 // 搜集非已装配的数据
workOrderAssemblyList = !StringUtils.isEmpty(prodRuleContext.getWorkCellCode()) ? workOrderAssemblyList : workOrderAssemblyList = workOrderAssemblyList.stream().filter(o -> (null != o && o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) != 0)).collect(Collectors.toList());
workOrderAssemblyList.stream().filter(o -> (null != o && o.getAssemblyStatus().compareTo(MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_10.getValue()) != 0)).collect(Collectors.toList());
if (CollectionUtils.isEmpty(workOrderAssemblyList)) return null; if (CollectionUtils.isEmpty(workOrderAssemblyList)) return null;

@ -161,8 +161,7 @@ public class MesProduceSnExtService implements IMesProduceSnExtService {
public void saveProduceSnList(StationRequestBean reqBean, Integer snStatus, List<Long> idList) { public void saveProduceSnList(StationRequestBean reqBean, Integer snStatus, List<Long> idList) {
idList = CollectionUtils.isEmpty(idList) ? idList : idList.stream().filter(o -> !StringUtils.isEmpty(o)).distinct().collect(Collectors.toList()); idList = CollectionUtils.isEmpty(idList) ? idList : idList.stream().filter(o -> !StringUtils.isEmpty(o)).distinct().collect(Collectors.toList());
if (CollectionUtils.isEmpty(idList)) return; if (CollectionUtils.isEmpty(idList)) return;
DdlPackBean packBean = new DdlPackBean(); DdlPackBean packBean = DdlPackBean.getDdlPackBean(reqBean.getOrganizeCode());
DdlPreparedPack.getStringEqualPack(reqBean.getOrganizeCode(), MesPcnExtConstWords.ORGANIZE_CODE, packBean);
if (idList.size() == 1) DdlPreparedPack.getNumEqualPack(idList.get(0), MesPcnExtConstWords.ID, packBean); if (idList.size() == 1) DdlPreparedPack.getNumEqualPack(idList.get(0), MesPcnExtConstWords.ID, packBean);
else DdlPreparedPack.getInPackList(idList, MesPcnExtConstWords.ID, packBean); else DdlPreparedPack.getInPackList(idList, MesPcnExtConstWords.ID, packBean);
produceSnRepository.updateByProperties( produceSnRepository.updateByProperties(

@ -702,14 +702,13 @@ public class MesWorkOrderService implements IMesWorkOrderService {
} }
// 同步工单信息给加工记录、条码信息 // 同步工单信息给加工记录、条码信息
DdlPackBean snDdlPackBean = DdlPackBean.getDdlPackBean(); DdlPackBean snDdlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(productionRecord.getId(), "id", snDdlPackBean); DdlPreparedPack.getNumEqualPack(productionRecord.getId(), "id", snDdlPackBean);
DdlPreparedPack.getStringEqualPack(organizeCode, "organizeCode", snDdlPackBean);
mesProduceSnRao.updateByProperties(new String[]{"modifyUser", "modifyDatetime", "workOrderNo"}, mesProduceSnRao.updateByProperties(new String[]{"modifyUser", "modifyDatetime", "workOrderNo"},
new Object[]{userName, TimeTool.getNowTime(true), oldMesWorkOrder.getWorkOrderNo()}, snDdlPackBean); new Object[]{userName, TimeTool.getNowTime(true), oldMesWorkOrder.getWorkOrderNo()}, snDdlPackBean);
DdlPackBean packBean = DdlPackBean.getDdlPackBean(); DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(productionRecord.getId(), "id", packBean); DdlPreparedPack.getNumEqualPack(productionRecord.getId(), "id", packBean);
productionRecordRao.updateByProperties(new String[]{"modifyUser", "modifyDatetime", "workOrderNo", "reportStatus"}, productionRecordRao.updateByProperties(new String[]{"modifyUser", "modifyDatetime", "workOrderNo", "reportStatus"},
new Object[]{userName, TimeTool.getNowTime(true), oldMesWorkOrder.getWorkOrderNo(), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_20.getValue()}, packBean); new Object[]{userName, TimeTool.getNowTime(true), oldMesWorkOrder.getWorkOrderNo(), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_20.getValue()}, packBean);

@ -179,8 +179,8 @@ public class MesAssemblySaveStepService extends BaseStepService {
private void saveWorkOrderAssembly(StationRequestBean reqBean, MesProductionAssemblyContext productionAssemblyContext) { private void saveWorkOrderAssembly(StationRequestBean reqBean, MesProductionAssemblyContext productionAssemblyContext) {
workOrderAssemblyRepository.updateByProperties( workOrderAssemblyRepository.updateByProperties(
new String[]{MesPcnExtConstWords.ID}, new String[]{MesPcnExtConstWords.ID, MesPcnExtConstWords.ORGANIZE_CODE},
new Object[]{productionAssemblyContext.getSourceId()}, new Object[]{productionAssemblyContext.getSourceId(), reqBean.getOrganizeCode()},
new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.ASSEMBLY_STATUS}, new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.ASSEMBLY_STATUS},
new Object[]{reqBean.getUserInfo(), TimeTool.getNowTime(true), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), productionAssemblyContext.getAssemblyStatus()}); new Object[]{reqBean.getUserInfo(), TimeTool.getNowTime(true), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), productionAssemblyContext.getAssemblyStatus()});
} }

@ -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.IMesProductionProcessContextStepService;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionRecordService; 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.context.*;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService; import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
import cn.estsh.i3plus.platform.common.convert.ConvertBean; import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
@ -123,7 +124,7 @@ public class MesProductionRecordGenerateStepService extends BaseStepService {
MesProdRuleContext prodRuleContext = CollectionUtils.isEmpty(prMap) ? null : prMap.get(productionPsOutContext.getForeignKey()); MesProdRuleContext prodRuleContext = CollectionUtils.isEmpty(prMap) ? null : prMap.get(productionPsOutContext.getForeignKey());
MesProductionRecord productionRecord = new MesProductionRecord(); MesProductionRecord productionRecord = new MesProductionRecord();
BeanUtils.copyProperties(productionPsOutContext, productionRecord); BeanUtils.copyProperties(productionPsOutContext, productionRecord, MesPcnExtConstWords.BASE_BEAN_FIELDS);
productionRecord.setMouldNo(mouldNo); productionRecord.setMouldNo(mouldNo);
productionRecord.setEquipmentCode(cellEquipContext.getEquipmentCode()); productionRecord.setEquipmentCode(cellEquipContext.getEquipmentCode());

@ -105,14 +105,14 @@ public class MesSendCavityGroupParamsCmdStepService extends BaseStepService {
for (MesCavityGroupDetailCfg mesCavityGroupDetailCfg : mesCavityGroupDetailCfgs) { for (MesCavityGroupDetailCfg mesCavityGroupDetailCfg : mesCavityGroupDetailCfgs) {
index ++; index ++;
// 获取加工参数 // 获取加工参数
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(); DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(reqBean.getOrganizeCode());
DdlPreparedPack.getNumEqualPack(mesCavityGroupDetailCfg.getId(), "sourceId", ddlPackBean); DdlPreparedPack.getNumEqualPack(mesCavityGroupDetailCfg.getId(), "sourceId", ddlPackBean);
List<MesEquipmentProdParamCfg> mesEquipmentProdParamCfgs = mesEquipmentProdParamCfgRepository.findByHqlWhere(ddlPackBean); List<MesEquipmentProdParamCfg> mesEquipmentProdParamCfgs = mesEquipmentProdParamCfgRepository.findByHqlWhere(ddlPackBean);
for (MesEquipmentProdParamCfg mesEquipmentProdParamCfg : mesEquipmentProdParamCfgs) {// for (MesEquipmentProdParamCfg mesEquipmentProdParamCfg : mesEquipmentProdParamCfgs) {//
String strategyClass = getStrateClass(mesEquipmentProdParamCfg.getMatchRule()); String strategyClass = getStrateClass(mesEquipmentProdParamCfg.getMatchRule());
AbstractWriteVariableService equipVariableRwExtService = ((AbstractWriteVariableService) SpringContextsUtil.getBean(strategyClass)); AbstractWriteVariableService equipVariableRwExtService = ((AbstractWriteVariableService) SpringContextsUtil.getBean(strategyClass));
DdlPackBean paramPackBean = DdlPackBean.getDdlPackBean(); DdlPackBean paramPackBean = DdlPackBean.getDdlPackBean(reqBean.getOrganizeCode());
DdlPreparedPack.getNumEqualPack(mesEquipmentProdParamCfg.getEquipVariableId(), "id", paramPackBean); DdlPreparedPack.getNumEqualPack(mesEquipmentProdParamCfg.getEquipVariableId(), "id", paramPackBean);
MesEquipmentVariable mesEquipmentVariable = mesEquipmentVariableRepository.getByProperty(paramPackBean); MesEquipmentVariable mesEquipmentVariable = mesEquipmentVariableRepository.getByProperty(paramPackBean);
if (mesEquipmentVariable == null) { if (mesEquipmentVariable == null) {

@ -67,8 +67,8 @@ public class MesWorkOrderQueueSaveStepService extends BaseStepService {
private void saveWorkOrderQueue(StationRequestBean reqBean, MesProductionPsInContext productionPsInContext) { private void saveWorkOrderQueue(StationRequestBean reqBean, MesProductionPsInContext productionPsInContext) {
queueOrderRepository.updateByProperties( queueOrderRepository.updateByProperties(
new String[]{MesPcnExtConstWords.ID}, new String[]{MesPcnExtConstWords.ID, MesPcnExtConstWords.ORGANIZE_CODE},
new Object[]{productionPsInContext.getRelateId()}, new Object[]{productionPsInContext.getRelateId(), reqBean.getOrganizeCode()},
new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.STATUS}, new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.STATUS},
new Object[]{reqBean.getUserInfo(), TimeTool.getNowTime(true), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesExtEnumUtil.QUEUE_ORDER_STATUS.FINISH.getValue()}); new Object[]{reqBean.getUserInfo(), TimeTool.getNowTime(true), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesExtEnumUtil.QUEUE_ORDER_STATUS.FINISH.getValue()});
} }

@ -93,20 +93,20 @@ public class MesWorkOrderSaveSortStepService extends BaseStepService {
if (null == productionPartContext || StringUtils.isEmpty(productionPartContext.getForeignKey())) continue; if (null == productionPartContext || StringUtils.isEmpty(productionPartContext.getForeignKey())) continue;
Boolean isEndWorkCell = (StringUtils.isEmpty(workCell.getIsEndWorkCell()) || workCell.getIsEndWorkCell().compareTo(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) == 0) ? false : true; Boolean isEndWorkCell = (!StringUtils.isEmpty(workCell.getIsEndWorkCell()) && workCell.getIsEndWorkCell().compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) == 0) ? true : false;
if (!isEndWorkCell && productionPartContext.getWorkOrderStatus().compareTo(MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue()) == 0) continue; if (!isEndWorkCell && productionPartContext.getWorkOrderStatus().compareTo(MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue()) == 0) continue;
if (!isEndWorkCell) { if (!isEndWorkCell) {
workOrderRepository.updateByProperties( workOrderRepository.updateByProperties(
new String[]{MesPcnExtConstWords.ID}, new String[]{MesPcnExtConstWords.ID, MesPcnExtConstWords.ORGANIZE_CODE},
new Object[]{productionPartContext.getId()}, new Object[]{productionPartContext.getId(), reqBean.getOrganizeCode()},
new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.WORK_ORDER_STATUS, MesPcnExtConstWords.ONLINE_TIME}, new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.WORK_ORDER_STATUS, MesPcnExtConstWords.ONLINE_TIME},
new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue(), TimeTool.getNowTime(true)}); new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue(), TimeTool.getNowTime(true)});
} else { } else {
workOrderRepository.updateByProperties( workOrderRepository.updateByProperties(
new String[]{MesPcnExtConstWords.ID}, new String[]{MesPcnExtConstWords.ID, MesPcnExtConstWords.ORGANIZE_CODE},
new Object[]{productionPartContext.getId()}, new Object[]{productionPartContext.getId(), reqBean.getOrganizeCode()},
new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.WORK_ORDER_STATUS, MesPcnExtConstWords.COMPLETE_QTY, MesPcnExtConstWords.UN_COMPLETE_QTY, MesPcnExtConstWords.OFFLINE_TIME}, new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.WORK_ORDER_STATUS, MesPcnExtConstWords.COMPLETE_QTY, MesPcnExtConstWords.UN_COMPLETE_QTY, MesPcnExtConstWords.OFFLINE_TIME},
new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesExtEnumUtil.ORDER_STATUS.COMPLETE.getValue(), new Double(1), new Double(0), TimeTool.getNowTime(true)}); new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesExtEnumUtil.ORDER_STATUS.COMPLETE.getValue(), new Double(1), new Double(0), TimeTool.getNowTime(true)});
} }

@ -53,7 +53,7 @@ public class MesProductionAssemblyNosortContext extends MesProductionAssemblyCon
this.partNo = prodRuleContext.getOutPartNo(); this.partNo = prodRuleContext.getOutPartNo();
if (StringUtils.isEmpty(this.routeSeq)) this.routeSeq = MesPcnExtConstWords.ZERO; if (StringUtils.isEmpty(this.routeSeq)) this.routeSeq = MesPcnExtConstWords.ZERO;
if (StringUtils.isEmpty(this.isRepeat)) this.isRepeat = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(); if (StringUtils.isEmpty(this.isRepeat) || this.isRepeat.compareTo(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) != 0) this.isRepeat = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue(); this.assemblyStatus = MesExtEnumUtil.ASSEMBLY_STATUS.ASSEMBLY_STATUS_30.getValue();

Loading…
Cancel
Save