1 无工单补报工JOB针对多生产版本场景,默认使用SAP 主数据0001进行补报工
2 无工单报工,根据产线物料号为一个事务去校验生产版本是否存在
dev_temp_xw_202503310000_45843
xiangwei.zhang 4 months ago
parent 5673649ce4
commit 282e8a6b99

@ -54,48 +54,7 @@ public class TestController {
@GetMapping("/reportWorkByPreDayJob")
@ApiOperation(value = "查询设备交互")
public ResultBean queryReworkTaskByPager(String organizeCode) {
try {
//遍历系统参数指定的产线获取对应班次,找到早班的开始时间,
String workCenterCodes = configService.getCfgValue(organizeCode, "MES_PCN_WORK_CENTER_NO");
List<String> workCenterCodeList = Arrays.asList(workCenterCodes.split(","));
String userName = "REPORT_PRE_DAY_JOB";
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
List<MesShift> mesShiftListAll = mesShiftRepository.findByHqlWhere(packBean);
for (String workCenterCode : workCenterCodeList) {
List<MesShift> mesShiftList = mesShiftListAll.stream().filter(s -> s.getWorkCenterCode().equalsIgnoreCase(workCenterCode)).collect(Collectors.toList());
//1.获取生产加工记录production_record表中report_status为待汇报状态的工单
List<MesProductionRecord> mesProductionRecordList = workOrderService.getPreDayReportMesProductionRecord(organizeCode, mesShiftList, workCenterCode);
if (CollectionUtils.isEmpty(mesProductionRecordList)) {
continue;
}
//3.插入生产工单表
List<MesWorkOrder> mesWorkOrders = workOrderService.insertMesWorkOrder(mesProductionRecordList, mesShiftList, organizeCode, userName);
if (CollectionUtils.isEmpty(mesWorkOrders)) {
continue;
}
//4.根据产线+物料产生的工单报工
for (MesWorkOrder mesWorkOrder : mesWorkOrders) {
List<MesProductionRecord> mesProductionRecords = mesProductionRecordList.stream().filter(
w -> w.getWorkCenterCode().equalsIgnoreCase(mesWorkOrder.getWorkCenterCode())
&& w.getPartNo().equalsIgnoreCase(mesWorkOrder.getPartNo())).collect(Collectors.toList());
workOrderService.doPcnJobProductReport(mesProductionRecords, mesShiftList, organizeCode, userName, mesWorkOrder);
}
for (MesProductionRecord mesProductionRecord : mesProductionRecordList) {
mesProductionRecord.setReportStatus(20);
ConvertBean.serviceModelUpdate(mesProductionRecord, userName);
}
productionRecordRao.saveAll(mesProductionRecordList);
}
return ResultBean.success("查询成功").setResultList(null);
} catch (ImppBusiException imppException) {
return ResultBean.fail(imppException);
} catch (Exception e) {
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
return null;
}
@GetMapping("/reportOrder")

Loading…
Cancel
Save