44673 datasync同步与报工JOB同一秒执行同一条加工记录,导致云端为等待汇报,边端已经汇报完成

tags/yfai-pcn-ext-v2.8
xiangwei.zhang 5 months ago
parent f71fb409d9
commit df366ba46b

@ -36,6 +36,7 @@ import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import cn.estsh.impp.framework.boot.auth.AuthUtil; import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException; import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.util.SpringContextsUtil; import cn.estsh.impp.framework.boot.util.SpringContextsUtil;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.map.HashedMap; import org.apache.commons.collections.map.HashedMap;
@ -383,7 +384,7 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService {
DdlPreparedPack.getStringEqualPack(sn.getPartNo(),"partNo",packBean); DdlPreparedPack.getStringEqualPack(sn.getPartNo(),"partNo",packBean);
//更新加工记录 //更新加工记录
mesProductionRecordRepository.updateByProperties(new String[]{"modifyUser", "modifyDatetime", "productSn", "description", "systemSyncStatus"}, mesProductionRecordRepository.updateByProperties(new String[]{"modifyUser", "modifyDatetime", "productSn", "description", "systemSyncStatus"},
new Object[]{userName, TimeTool.getNowTime(true), sn.getProductSn(), sn.getDescription(), CommonEnumUtil.FALSE}, packBean); new Object[]{userName, DateUtil.format(new Date(), MesPcnExtConstWords.DATE_FORMAT_SSS), sn.getProductSn(), sn.getDescription(), CommonEnumUtil.FALSE}, packBean);
//更新装配记录 //更新装配记录
mesProductionAssemblyRepository.updateByProperties(new String[]{"modifyUser", "modifyDatetime", "productSn", "description", "systemSyncStatus"}, mesProductionAssemblyRepository.updateByProperties(new String[]{"modifyUser", "modifyDatetime", "productSn", "description", "systemSyncStatus"},
new Object[]{userName, TimeTool.getNowTime(true), sn.getProductSn(), sn.getDescription(), CommonEnumUtil.FALSE}, packBean); new Object[]{userName, TimeTool.getNowTime(true), sn.getProductSn(), sn.getDescription(), CommonEnumUtil.FALSE}, packBean);

@ -14,6 +14,7 @@ import cn.estsh.i3plus.pojo.mes.bean.MesProductionRecord;
import cn.estsh.i3plus.pojo.mes.repository.*; import cn.estsh.i3plus.pojo.mes.repository.*;
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil; import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import cn.estsh.impp.framework.boot.util.ResultBean; import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.hutool.core.date.DateUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@ -118,7 +119,7 @@ public class MesProductionRecordService implements IMesProductionRecordService {
DdlPreparedPack.getStringEqualPack(sn, "productSn", ddlPackBean); DdlPreparedPack.getStringEqualPack(sn, "productSn", ddlPackBean);
productionRecordRepository.updateByProperties(new String[]{"modifyUser", "modifyDatetime","reportStatus"}, productionRecordRepository.updateByProperties(new String[]{"modifyUser", "modifyDatetime","reportStatus"},
new Object[]{userName, TimeTool.getNowTime(true), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_20.getValue() },ddlPackBean); new Object[]{userName, DateUtil.format(new Date(), MesPcnExtConstWords.DATE_FORMAT_SSS), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_20.getValue() },ddlPackBean);
} }
@Override @Override
public void updateProductionRecord(String organizeCode, String userName, Long id, String errorMsg) { public void updateProductionRecord(String organizeCode, String userName, Long id, String errorMsg) {
@ -126,7 +127,7 @@ public class MesProductionRecordService implements IMesProductionRecordService {
DdlPreparedPack.getNumEqualPack(id, "id", ddlPackBean); DdlPreparedPack.getNumEqualPack(id, "id", ddlPackBean);
// DdlPreparedPack.getStringEqualPack(sn, "productSn", ddlPackBean); // DdlPreparedPack.getStringEqualPack(sn, "productSn", ddlPackBean);
productionRecordRepository.updateByProperties(new String[]{"modifyUser", "modifyDatetime","reportStatus", "remark"}, productionRecordRepository.updateByProperties(new String[]{"modifyUser", "modifyDatetime","reportStatus", "remark"},
new Object[]{userName, TimeTool.getNowTime(true), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_40.getValue(), errorMsg },ddlPackBean); new Object[]{userName, DateUtil.format(new Date(), MesPcnExtConstWords.DATE_FORMAT_SSS), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_40.getValue(), errorMsg },ddlPackBean);
} }
@Override @Override

@ -415,7 +415,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
DdlPreparedPack.getNumEqualPack(id, "id", ddlPackBean); DdlPreparedPack.getNumEqualPack(id, "id", ddlPackBean);
// DdlPreparedPack.getStringEqualPack(sn, "custSn", ddlPackBean); // DdlPreparedPack.getStringEqualPack(sn, "custSn", ddlPackBean);
productionRecordRao.updateByPropertiesNoSync(new String[]{"modifyUser", "modifyDatetime"}, productionRecordRao.updateByPropertiesNoSync(new String[]{"modifyUser", "modifyDatetime"},
new Object[]{userName, TimeTool.getNowTime(true)}, ddlPackBean); new Object[]{userName, DateUtil.format(new Date(), MesPcnExtConstWords.DATE_FORMAT_SSS)}, ddlPackBean);
} }
@Override @Override
@ -432,7 +432,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode); DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(productionRecord.getId(), "id", ddlPackBean); DdlPreparedPack.getNumEqualPack(productionRecord.getId(), "id", ddlPackBean);
productionRecordRao.updateByProperties(new String[]{"modifyUser", "modifyDatetime", "reportStatus"}, productionRecordRao.updateByProperties(new String[]{"modifyUser", "modifyDatetime", "reportStatus"},
new Object[]{userName, TimeTool.getNowTime(true), productionRecord.getReportStatus()}, ddlPackBean); new Object[]{userName, DateUtil.format(new Date(), MesPcnExtConstWords.DATE_FORMAT_SSS), productionRecord.getReportStatus()}, ddlPackBean);
return; return;
} }
LOGGER.error("报工条码:{}找不到加工单", productionRecord.getProductSn()); LOGGER.error("报工条码:{}找不到加工单", productionRecord.getProductSn());
@ -577,7 +577,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
propertyMap.put(MesPcnExtConstWords.WORK_ORDER_STATUS, MesExtEnumUtil.ORDER_STATUS.COMPLETE.getValue()); propertyMap.put(MesPcnExtConstWords.WORK_ORDER_STATUS, MesExtEnumUtil.ORDER_STATUS.COMPLETE.getValue());
} else { } else {
propertyMap.put(MesPcnExtConstWords.WORK_ORDER_STATUS, oldMesWorkOrder.getWorkOrderStatus()); propertyMap.put(MesPcnExtConstWords.WORK_ORDER_STATUS, MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue());
} }
} }
@ -678,8 +678,11 @@ public class MesWorkOrderService implements IMesWorkOrderService {
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode); DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumEqualPack(productionRecord.getId(), "id", packBean); DdlPreparedPack.getNumEqualPack(productionRecord.getId(), "id", packBean);
DdlPreparedPack.getStringEqualPack(productionRecord.getModifyDatetime(), "modifyDatetime", 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, DateUtil.format(new Date(), MesPcnExtConstWords.DATE_FORMAT_SSS), oldMesWorkOrder.getWorkOrderNo(), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_20.getValue()}, packBean);
LOGGER.info("条码【{}】报工成功,报工工单【{}】", productionRecord.getProductSn(), oldMesWorkOrder.getWorkOrderNo()); LOGGER.info("条码【{}】报工成功,报工工单【{}】", productionRecord.getProductSn(), oldMesWorkOrder.getWorkOrderNo());

Loading…
Cancel
Save