|
|
|
@ -74,6 +74,11 @@ public class MesTimeRoundnessService implements IRoundnessStrategy {
|
|
|
|
|
log.info("当前零件生产组:{} 没有到达生产工单的窗口", partProdGroup.getPartProdGroupName());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String lastRunTime = TimeTool.getNowTime(true);
|
|
|
|
|
log.info("当前零件生产组:{},更新本次执行时间:{}",partProdGroup.getPartProdGroupName(),lastRunTime);
|
|
|
|
|
ConvertBean.saveOrUpdate(time, "JOB");
|
|
|
|
|
time.setLastRunTime(lastRunTime);
|
|
|
|
|
windowTimeRao.update(time);
|
|
|
|
|
DateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
|
|
long createSeq = Long.parseLong(dateFormat.format(new Date()));
|
|
|
|
|
Map<String, List<MesCustSortInfo>> sortInfoMap = sortInfoList.stream().collect(Collectors.groupingBy(MesCustSortInfo::getCustPartNo));
|
|
|
|
@ -236,9 +241,7 @@ public class MesTimeRoundnessService implements IRoundnessStrategy {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
ConvertBean.saveOrUpdate(time, "JOB");
|
|
|
|
|
time.setLastRunTime(TimeTool.getNowTime(true));
|
|
|
|
|
windowTimeRao.update(time);
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("创建工单报错:{}", Arrays.toString(e.getStackTrace()));
|
|
|
|
|
}
|
|
|
|
@ -265,7 +268,7 @@ public class MesTimeRoundnessService implements IRoundnessStrategy {
|
|
|
|
|
//使用降序
|
|
|
|
|
List<MesPartProdGroupWindowTime> sortedTime = windowTimeList.stream().sorted(Comparator.comparing(MesPartProdGroupWindowTime::getWindowTime,Comparator.reverseOrder())).collect(Collectors.toList());
|
|
|
|
|
for (MesPartProdGroupWindowTime time : sortedTime) {
|
|
|
|
|
if(Integer.parseInt(time.getWindowTime().replace(":","")) > Integer.parseInt(nowTime.replace(":",""))){
|
|
|
|
|
if (Integer.parseInt(time.getWindowTime().replace(":", "")) > Integer.parseInt(nowTime.replace(":", ""))) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(time.getWindowTime().substring(0, 2)));
|
|
|
|
@ -274,6 +277,7 @@ public class MesTimeRoundnessService implements IRoundnessStrategy {
|
|
|
|
|
if (Objects.isNull(time.getLastRunTime())) {
|
|
|
|
|
return time;
|
|
|
|
|
}
|
|
|
|
|
//校验lastRuntime 是否已经在当前圆整时区已经生成完了工单
|
|
|
|
|
Date lastRunTime = sdf.parse(time.getLastRunTime());
|
|
|
|
|
if (dateCreateOrder.before(lastRunTime)) {
|
|
|
|
|
continue;
|
|
|
|
|