|
|
|
@ -89,20 +89,22 @@ public class MesReportWorkByPreDayJob extends BaseMesScheduleJob {
|
|
|
|
|
w -> w.getWorkCenterCode().equalsIgnoreCase(mesWorkOrder.getWorkCenterCode())
|
|
|
|
|
&& w.getPartNo().equalsIgnoreCase(mesWorkOrder.getPartNo())).collect(Collectors.toList());
|
|
|
|
|
workOrderService.doPcnJobProductReport(mesProductionRecords, mesShiftList, wmsJobParamModel.getOrganizeCode(), userName, mesWorkOrder);
|
|
|
|
|
}
|
|
|
|
|
for (MesProductionRecord mesProductionRecord : mesProductionRecordList) {
|
|
|
|
|
if(StringUtil.isEmpty(mesProductionRecord.getWorkOrderNo())){
|
|
|
|
|
List<MesWorkOrder> collect = mesWorkOrders.stream().filter(w -> w.getWorkCenterCode().equalsIgnoreCase(mesProductionRecord.getWorkCenterCode())
|
|
|
|
|
&& w.getPartNo().equalsIgnoreCase(mesProductionRecord.getPartNo())).collect(Collectors.toList());
|
|
|
|
|
if (!CollectionUtils.isEmpty(collect)){
|
|
|
|
|
mesProductionRecord.setWorkOrderNo(collect.get(0).getWorkOrderNo());
|
|
|
|
|
|
|
|
|
|
for (MesProductionRecord mesProductionRecord : mesProductionRecords) {
|
|
|
|
|
if(StringUtil.isEmpty(mesProductionRecord.getWorkOrderNo())){
|
|
|
|
|
List<MesWorkOrder> collect = mesWorkOrders.stream().filter(w -> w.getWorkCenterCode().equalsIgnoreCase(mesProductionRecord.getWorkCenterCode())
|
|
|
|
|
&& w.getPartNo().equalsIgnoreCase(mesProductionRecord.getPartNo())).collect(Collectors.toList());
|
|
|
|
|
if (!CollectionUtils.isEmpty(collect)){
|
|
|
|
|
mesProductionRecord.setWorkOrderNo(collect.get(0).getWorkOrderNo());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
mesProductionRecord.setReportStatus(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_20.getValue());
|
|
|
|
|
mesProductionRecord.setSystemSyncStatus(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
|
|
|
|
|
ConvertBean.serviceModelUpdate(mesProductionRecord, userName);
|
|
|
|
|
}
|
|
|
|
|
mesProductionRecord.setReportStatus(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_20.getValue());
|
|
|
|
|
mesProductionRecord.setSystemSyncStatus(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
|
|
|
|
|
ConvertBean.serviceModelUpdate(mesProductionRecord, userName);
|
|
|
|
|
productionRecordRao.saveAll(mesProductionRecords);
|
|
|
|
|
}
|
|
|
|
|
productionRecordRao.saveAll(mesProductionRecordList);
|
|
|
|
|
|
|
|
|
|
} catch (ImppBusiException e) {
|
|
|
|
|
LOGGER.error("产线:{}报工失败:{}", workCenterCode, e.getErrorDetail());
|
|
|
|
|
}
|
|
|
|
|