|
|
|
@ -145,6 +145,35 @@ public class MesProductionRecordService implements IMesProductionRecordService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void updateProductionRecordList(String organizeCode, String userName, List<Long> ids, String errorMsg) {
|
|
|
|
|
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
DdlPreparedPack.getInPackList(ids, "id", ddlPackBean);
|
|
|
|
|
|
|
|
|
|
List<MesProductionRecord> mesProductionRecordList = productionRecordRepository.findByHqlWhere(ddlPackBean);
|
|
|
|
|
|
|
|
|
|
List<Long> failList = new ArrayList<>();
|
|
|
|
|
List<Long> noFailList = new ArrayList<>();
|
|
|
|
|
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());
|
|
|
|
|
if (!CollectionUtils.isEmpty(failList)) {
|
|
|
|
|
DdlPackBean failPackBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
DdlPreparedPack.getInPackList(failList, "id", failPackBean);
|
|
|
|
|
|
|
|
|
|
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}, failPackBean);
|
|
|
|
|
}
|
|
|
|
|
if (!CollectionUtils.isEmpty(noFailList)) {
|
|
|
|
|
DdlPackBean nofailPackBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
DdlPreparedPack.getInPackList(noFailList, "id", nofailPackBean);
|
|
|
|
|
|
|
|
|
|
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 }, nofailPackBean);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public ResultBean queryMesProductionRecordReport(String organizeCode, String productSn) {
|
|
|
|
|
|
|
|
|
|