|
|
|
@ -462,6 +462,14 @@ public class MesWorkOrderService implements IMesWorkOrderService {
|
|
|
|
|
try {
|
|
|
|
|
List<MesWorkOrder> oldMesWorkOrderList = getMesWorkOrder(productionRecord, organizeCode);
|
|
|
|
|
if (CollectionUtils.isEmpty(oldMesWorkOrderList)) {
|
|
|
|
|
if (Objects.equals(productionRecord.getReportStatus(), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_30.getValue())) {
|
|
|
|
|
LOGGER.warn("报工条码:{}工单为试制单,更新成无需报工", productionRecord.getProductSn());
|
|
|
|
|
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
DdlPreparedPack.getNumEqualPack(productionRecord.getId(), "id", ddlPackBean);
|
|
|
|
|
productionRecordRao.updateByProperties(new String[]{"modifyUser", "modifyDatetime", "reportStatus"},
|
|
|
|
|
new Object[]{userName, TimeTool.getNowTime(true), productionRecord.getReportStatus()},ddlPackBean);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
LOGGER.error("报工条码:{}找不到加工单", productionRecord.getProductSn());
|
|
|
|
|
updateProductionRecord(organizeCode, userName, productionRecord.getId());
|
|
|
|
|
return;
|
|
|
|
@ -782,6 +790,9 @@ public class MesWorkOrderService implements IMesWorkOrderService {
|
|
|
|
|
List<MesWorkOrder> oldMesWorkOrders = workOrderRepository.findByHqlWhere(ddlPackBean);
|
|
|
|
|
if (!CollectionUtils.isEmpty(oldMesWorkOrders)) {
|
|
|
|
|
oldMesWorkOrders = oldMesWorkOrders.stream().filter(mesWorkOrder -> !Objects.equals(MesExtEnumUtil.ORDER_TYPE_IDENTIFICATION.P.getValue(), mesWorkOrder.getOrderFlag())).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtils.isEmpty(oldMesWorkOrders)) {
|
|
|
|
|
productionRecord.setReportStatus(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_30.getValue());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return oldMesWorkOrders;
|
|
|
|
|
}
|
|
|
|
@ -875,7 +886,11 @@ public class MesWorkOrderService implements IMesWorkOrderService {
|
|
|
|
|
DdlPreparedPack.getNotInPack(centerList, "workCenterCode", ddlPackBean);
|
|
|
|
|
}
|
|
|
|
|
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"modifyDatetime"}, ddlPackBean);
|
|
|
|
|
List<MesProductionRecord> mesProductionRecordList = productionRecordRao.findByHqlTopWhere(ddlPackBean, 50);
|
|
|
|
|
|
|
|
|
|
String numStr = configService.getCfgValue(organizeCode, "MES_PCN_REPORT_NUM");
|
|
|
|
|
int num = StringUtils.isEmpty(numStr) ? 50 : Integer.valueOf(numStr);
|
|
|
|
|
|
|
|
|
|
List<MesProductionRecord> mesProductionRecordList = productionRecordRao.findByHqlTopWhere(ddlPackBean, num);
|
|
|
|
|
List<MesProductionRecord> recordList = new ArrayList<>();
|
|
|
|
|
// 根据零件号分组
|
|
|
|
|
/*if(!CollectionUtils.isEmpty(mesProductionRecordList)) {
|
|
|
|
|