|
@@ -77,7 +77,7 @@ public class WODispatchPlanTmDoBizFun {
|
|
}
|
|
}
|
|
|
|
|
|
private static ResponseCode handleProduceCmd(String planId, long checkTm){
|
|
private static ResponseCode handleProduceCmd(String planId, long checkTm){
|
|
- if(planId.equals("PLP2A012D8D2E815028Y8")){
|
|
|
|
|
|
+ if(planId.equals("PLP29FC0FC6BFC01462QO")){
|
|
System.out.println(111);
|
|
System.out.println(111);
|
|
}
|
|
}
|
|
ResponseCode code = ResponseCode.RESULT_BAD;
|
|
ResponseCode code = ResponseCode.RESULT_BAD;
|
|
@@ -514,6 +514,8 @@ public class WODispatchPlanTmDoBizFun {
|
|
}
|
|
}
|
|
}else if(model.getPlanType()==1){
|
|
}else if(model.getPlanType()==1){
|
|
//TODO 日计划
|
|
//TODO 日计划
|
|
|
|
+ //TODO 日计划时,如果oTm不等于空,那么说明不能再用添加或修改时的cylse
|
|
|
|
+ model.setCycles("[\"" + TimeTool.convertUTC2DateStr(TimeTool.getCurMsUTC(), "yyyy-MM-dd") + "\"]");
|
|
boolean isToDay = false;//生效时间是否小于等于当前时刻
|
|
boolean isToDay = false;//生效时间是否小于等于当前时刻
|
|
for (DispatchCmdBatchItemNextTimeModel item:newList){
|
|
for (DispatchCmdBatchItemNextTimeModel item:newList){
|
|
Instant nowTime = Instant.ofEpochMilli(
|
|
Instant nowTime = Instant.ofEpochMilli(
|
|
@@ -530,7 +532,8 @@ public class WODispatchPlanTmDoBizFun {
|
|
.collect(Collectors.toList()).get(0).getHandleStartTimeLimit()));
|
|
.collect(Collectors.toList()).get(0).getHandleStartTimeLimit()));
|
|
LocalDateTime dateTime1 = endTime.atZone(ZoneId.systemDefault()).toLocalDateTime();
|
|
LocalDateTime dateTime1 = endTime.atZone(ZoneId.systemDefault()).toLocalDateTime();
|
|
LocalDateTime dateTimeNow = Instant.now().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
|
LocalDateTime dateTimeNow = Instant.now().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
|
- if(Instant.now().isBefore(nowTime)||Instant.now().equals(nowTime)){
|
|
|
|
|
|
+ if(Instant.now().isBefore(nowTime)||Instant.now().equals(nowTime)
|
|
|
|
+ ||Instant.now().isBefore(endTime)||Instant.now().equals(endTime)){
|
|
isToDay = true;
|
|
isToDay = true;
|
|
if(model.getDispatchLeadTime()==0) {
|
|
if(model.getDispatchLeadTime()==0) {
|
|
nextTakeTime = nowTime.toEpochMilli();
|
|
nextTakeTime = nowTime.toEpochMilli();
|
|
@@ -583,7 +586,8 @@ public class WODispatchPlanTmDoBizFun {
|
|
//TODO 如果当前时间大于生效时间,说明生效时间过期,则加一天
|
|
//TODO 如果当前时间大于生效时间,说明生效时间过期,则加一天
|
|
LocalDateTime localNext = LocalDateTime.ofInstant(Instant.ofEpochMilli(nextTakeTime), ZoneId.systemDefault())
|
|
LocalDateTime localNext = LocalDateTime.ofInstant(Instant.ofEpochMilli(nextTakeTime), ZoneId.systemDefault())
|
|
.minusMinutes(model.getDispatchLeadTime());
|
|
.minusMinutes(model.getDispatchLeadTime());
|
|
- if(limitNextTakeTime<TimeTool.getCurMsUTC()){
|
|
|
|
|
|
+ if(limitNextTakeTime<TimeTool.getCurMsUTC()
|
|
|
|
+ ||(nextTakeTime<=TimeTool.getCurMsUTC()&&limitNextTakeTime<TimeTool.getCurMsUTC())){
|
|
nextTakeTime = Instant.ofEpochMilli(nextTakeTime)
|
|
nextTakeTime = Instant.ofEpochMilli(nextTakeTime)
|
|
.plus(1, ChronoUnit.DAYS).toEpochMilli();
|
|
.plus(1, ChronoUnit.DAYS).toEpochMilli();
|
|
limitNextTakeTime = Instant.ofEpochMilli(limitNextTakeTime).toEpochMilli();
|
|
limitNextTakeTime = Instant.ofEpochMilli(limitNextTakeTime).toEpochMilli();
|
|
@@ -592,8 +596,10 @@ public class WODispatchPlanTmDoBizFun {
|
|
){
|
|
){
|
|
//TODO 连续时需考虑
|
|
//TODO 连续时需考虑
|
|
//TODO 如果传递了对比值, 则说明当前计算的时间与old不符合条件,则再加一算一次
|
|
//TODO 如果传递了对比值, 则说明当前计算的时间与old不符合条件,则再加一算一次
|
|
- nextTakeTime = Instant.ofEpochMilli(nextTakeTime)
|
|
|
|
- .plus(1, ChronoUnit.DAYS).toEpochMilli();
|
|
|
|
|
|
+ nextTakeTime = localNext.minusDays(-1).minusMinutes(-model.getDispatchLeadTime())
|
|
|
|
+ .atZone(ZoneId.systemDefault())
|
|
|
|
+ .toInstant()
|
|
|
|
+ .toEpochMilli();
|
|
limitNextTakeTime = Instant.ofEpochMilli(limitNextTakeTime).plus(1, ChronoUnit.DAYS).toEpochMilli();
|
|
limitNextTakeTime = Instant.ofEpochMilli(limitNextTakeTime).plus(1, ChronoUnit.DAYS).toEpochMilli();
|
|
map.put("ifRestNextTakeTime",1L);
|
|
map.put("ifRestNextTakeTime",1L);
|
|
}
|
|
}
|