|
|
|
@ -426,8 +426,8 @@ public class MesWorkOrderService implements IMesWorkOrderService {
|
|
|
|
|
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(sn, "custSn", ddlPackBean);
|
|
|
|
|
productionRecordRao.updateByProperties(new String[]{"modifyUser", "modifyDatetime","reportStatus"},
|
|
|
|
|
new Object[]{userName, TimeTool.getNowTime(true), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_50.getValue()},ddlPackBean);
|
|
|
|
|
productionRecordRao.updateByProperties(new String[]{"modifyUser", "modifyDatetime"},
|
|
|
|
|
new Object[]{userName, TimeTool.getNowTime(true)},ddlPackBean);
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void doProductReportByRecord(MesProductionRecord productionRecord, String organizeCode, String userName) {
|
|
|
|
@ -436,7 +436,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
|
|
|
|
|
//根据物料获取已发布的工单
|
|
|
|
|
MesWorkOrder oldMesWorkOrder = getMesWorkOrder(productionRecord, organizeCode);
|
|
|
|
|
if (oldMesWorkOrder == null) {
|
|
|
|
|
//updateProductionRecord(organizeCode, userName, productionRecord.getProductSn());
|
|
|
|
|
updateProductionRecord(organizeCode, userName, productionRecord.getProductSn());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -451,7 +451,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
|
|
|
|
|
LOGGER.info("此次报工的条码【{}】,工单【{}】", productionRecord.getProductSn(), productionRecord.getWorkOrderNo());
|
|
|
|
|
List<MesWorkOrder> oldMesWorkOrders = getMesWorkOrders(productionRecord, organizeCode, null);
|
|
|
|
|
if (CollectionUtils.isEmpty(oldMesWorkOrders)) {
|
|
|
|
|
//updateProductionRecord(organizeCode, userName, productionRecord.getProductSn());
|
|
|
|
|
updateProductionRecord(organizeCode, userName, productionRecord.getProductSn());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
report(productionRecord, organizeCode, userName, oldMesWorkOrders.get(0));
|
|
|
|
@ -633,7 +633,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(productionRecord.getWorkOrderNo(), "workOrderNo", ddlPackBean);
|
|
|
|
|
}
|
|
|
|
|
DdlPreparedPack.getInPackList(list, "workOrderStatus", ddlPackBean);
|
|
|
|
|
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"createDatetime"}, ddlPackBean);
|
|
|
|
|
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"modifyDatetime"}, ddlPackBean);
|
|
|
|
|
// 新增班次逻辑
|
|
|
|
|
//DdlPreparedPack.
|
|
|
|
|
List<MesWorkOrder> oldMesWorkOrders = workOrderRepository.findByHqlWhere(ddlPackBean);
|
|
|
|
@ -680,6 +680,7 @@ public class MesWorkOrderService implements IMesWorkOrderService {
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public List<MesProductionRecord> getUnReportMesProduceSn(String organizeCode) {
|
|
|
|
|
|
|
|
|
|
//1.获取生产加工记录production_record表中,report_status为待汇报状态的工单
|
|
|
|
|
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
List<Integer> statusList = Stream.of(MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_10.getValue(), MesExtEnumUtil.REPORT_STATUS.REPORT_STATUS_40.getValue()).collect(Collectors.toList());
|
|
|
|
@ -690,10 +691,17 @@ public class MesWorkOrderService implements IMesWorkOrderService {
|
|
|
|
|
List<String> centerList = Arrays.asList(workCenterCodes.split(","));
|
|
|
|
|
DdlPreparedPack.getInPackList(centerList, "workCenterCode",ddlPackBean);
|
|
|
|
|
|
|
|
|
|
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"createDatetime"}, ddlPackBean);
|
|
|
|
|
List<MesProductionRecord> mesProductionRecordList = productionRecordRao.findByHqlTopWhere(ddlPackBean, 1);
|
|
|
|
|
|
|
|
|
|
return mesProductionRecordList;
|
|
|
|
|
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"modifyDatetime"}, ddlPackBean);
|
|
|
|
|
List<MesProductionRecord> mesProductionRecordList = productionRecordRao.findByHqlTopWhere(ddlPackBean, 10);
|
|
|
|
|
List<MesProductionRecord> recordList = new ArrayList<>();
|
|
|
|
|
// 根据零件号分组
|
|
|
|
|
if(!CollectionUtils.isEmpty(mesProductionRecordList)) {
|
|
|
|
|
Map<String, List<MesProductionRecord>> map = mesProductionRecordList.stream().collect(Collectors.groupingBy(MesProductionRecord::getPartNo));
|
|
|
|
|
map.forEach((k, v) -> {
|
|
|
|
|
recordList.add(v.get(0));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
return recordList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -708,10 +716,17 @@ public class MesWorkOrderService implements IMesWorkOrderService {
|
|
|
|
|
List<String> centerList = Arrays.asList(workCenterCodes.split(","));
|
|
|
|
|
DdlPreparedPack.getInPackList(centerList, "workCenterCode",ddlPackBean);
|
|
|
|
|
|
|
|
|
|
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"createDatetime"}, ddlPackBean);
|
|
|
|
|
List<MesProductionRecord> mesProductionRecordList = productionRecordRao.findByHqlTopWhere(ddlPackBean, 1);
|
|
|
|
|
|
|
|
|
|
return mesProductionRecordList;
|
|
|
|
|
DdlPreparedPack.getOrderByPack(new Object[]{CommonEnumUtil.ASC_OR_DESC.ASC.getValue()}, new String[]{"modifyDatetime"}, ddlPackBean);
|
|
|
|
|
List<MesProductionRecord> mesProductionRecordList = productionRecordRao.findByHqlTopWhere(ddlPackBean, 10);
|
|
|
|
|
List<MesProductionRecord> recordList = new ArrayList<>();
|
|
|
|
|
// 根据零件号分组
|
|
|
|
|
if(!CollectionUtils.isEmpty(mesProductionRecordList)) {
|
|
|
|
|
Map<String, List<MesProductionRecord>> map = mesProductionRecordList.stream().collect(Collectors.groupingBy(MesProductionRecord::getPartNo));
|
|
|
|
|
map.forEach((k, v) -> {
|
|
|
|
|
recordList.add(v.get(0));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
return recordList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|