|
|
@ -134,11 +134,17 @@ public class MesProductionRecordService implements IMesProductionRecordService {
|
|
|
|
public void updateProductionRecord(String organizeCode, String userName, Long id, String errorMsg) {
|
|
|
|
public void updateProductionRecord(String organizeCode, String userName, Long id, String errorMsg) {
|
|
|
|
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
DdlPreparedPack.getNumEqualPack(id, "id", ddlPackBean);
|
|
|
|
DdlPreparedPack.getNumEqualPack(id, "id", ddlPackBean);
|
|
|
|
// DdlPreparedPack.getStringEqualPack(sn, "productSn", ddlPackBean);
|
|
|
|
|
|
|
|
|
|
|
|
MesProductionRecord mesProductionRecord = productionRecordRepository.getByProperty(ddlPackBean);
|
|
|
|
|
|
|
|
if (mesProductionRecord !=null && Objects.equals(mesProductionRecord.getReportStatus(), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_40.getValue())) {
|
|
|
|
|
|
|
|
productionRecordRepository.updateByPropertiesNoSync(new String[]{"modifyUser", "modifyDatetime","reportStatus", "remark"},
|
|
|
|
|
|
|
|
new Object[]{userName, DateUtil.format(new Date(), MesPcnExtConstWords.DATE_FORMAT_SSS), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_40.getValue(), errorMsg },ddlPackBean);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
productionRecordRepository.updateByProperties(new String[]{"modifyUser", "modifyDatetime","reportStatus", "remark"},
|
|
|
|
productionRecordRepository.updateByProperties(new String[]{"modifyUser", "modifyDatetime","reportStatus", "remark"},
|
|
|
|
new Object[]{userName, DateUtil.format(new Date(), MesPcnExtConstWords.DATE_FORMAT_SSS), 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
|
|
|
|
public ResultBean queryMesProductionRecordReport(String organizeCode, String productSn) {
|
|
|
|
public ResultBean queryMesProductionRecordReport(String organizeCode, String productSn) {
|
|
|
|
|
|
|
|
|
|
|
@ -255,9 +261,16 @@ public class MesProductionRecordService implements IMesProductionRecordService {
|
|
|
|
recordList.forEach(record->{
|
|
|
|
recordList.forEach(record->{
|
|
|
|
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(record.getOrganizeCode());
|
|
|
|
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(record.getOrganizeCode());
|
|
|
|
DdlPreparedPack.getNumEqualPack(record.getId(), "id", ddlPackBean);
|
|
|
|
DdlPreparedPack.getNumEqualPack(record.getId(), "id", ddlPackBean);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MesProductionRecord mesProductionRecord = productionRecordRepository.getByProperty(ddlPackBean);
|
|
|
|
|
|
|
|
if (mesProductionRecord !=null && Objects.equals(mesProductionRecord.getReportStatus(), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_40.getValue())) {
|
|
|
|
|
|
|
|
productionRecordRao.updateByPropertiesNoSync(new String[]{"modifyUser", "modifyDatetime", "reportStatus","remark"},
|
|
|
|
|
|
|
|
new Object[]{userName, DateUtil.format(new Date(), MesPcnExtConstWords.DATE_FORMAT_SSS), reportStatus,msg}, ddlPackBean);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
productionRecordRao.updateByPropertiesNoSync(new String[]{"modifyUser", "modifyDatetime", "reportStatus","remark","systemSyncStatus","systemSyncDatetime"},
|
|
|
|
productionRecordRao.updateByPropertiesNoSync(new String[]{"modifyUser", "modifyDatetime", "reportStatus","remark","systemSyncStatus","systemSyncDatetime"},
|
|
|
|
new Object[]{userName, DateUtil.format(new Date(), MesPcnExtConstWords.DATE_FORMAT_SSS), reportStatus,msg,CommonEnumUtil.FALSE,""}, ddlPackBean);
|
|
|
|
new Object[]{userName, DateUtil.format(new Date(), MesPcnExtConstWords.DATE_FORMAT_SSS), reportStatus,msg,CommonEnumUtil.FALSE,""}, ddlPackBean);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|