Explorar el Código

河南郸城调度计划列表 详情 新增接口初版提交

1037015548@qq.com hace 11 meses
padre
commit
eb339b9a64

+ 12 - 7
src/main/java/com/shkpr/service/aimodelpower/bizmgr/WODispatchPlanTmDoBizFun.java

@@ -15,6 +15,7 @@ import com.shkpr.service.aimodelpower.dbdao.DBMgrProxy;
 import com.shkpr.service.aimodelpower.dbdao.services.intef.WODispatchCmdBatchItemDBService;
 import com.shkpr.service.aimodelpower.dbdao.services.intef.WODispatchCmdInfoDBService;
 import com.shkpr.service.aimodelpower.dbdao.services.intef.WODispatchPlanDBService;
+import com.shkpr.service.aimodelpower.dbdao.tables.WODispatchDatabaseTable;
 import com.shkpr.service.aimodelpower.dbdao.tables.WODispatchPlanInfoTable;
 import com.shkpr.service.aimodelpower.dto.*;
 import com.shkpr.service.aimodelpower.dto.woDispatchPlanModel.*;
@@ -89,6 +90,7 @@ public class WODispatchPlanTmDoBizFun {
             long newLimitNextTakeTime = oldLimitNextTakeTime;
             long newLastTakeTime = model.getLastTakeTime();
             Map<String, Object> andWheres = new HashMap<>();
+            andWheres.put(WODispatchPlanInfoTable.R_INFO.PRIMARY_KEY,planId);
             Map<String, Object> updates = new HashMap<>();
             andWheres.put(WODispatchPlanInfoTable.W_INFO.UNIQUE_ID, planId);
 
@@ -507,13 +509,16 @@ public class WODispatchPlanTmDoBizFun {
                             TimeTool.convertDateStr2UTC
                                     (JSONArray.parseArray(model.getCycles()).getString(0)
                                             +" "+item.getHandleStartTime()));
+                    LocalDateTime dateTime = nowTime.atZone(ZoneId.systemDefault()).toLocalDateTime();
                     Instant endTime = Instant.ofEpochMilli(
                             TimeTool.convertDateStr2UTC
                                     (
                                             JSONArray.parseArray(model.getCycles()).getString(0)
                                                     +" "+
                                                     item.getHandleStartTimeLimit()));
-                    if(nowTime.isBefore(Instant.now()) || nowTime.equals(Instant.now())){
+                    LocalDateTime dateTime1 = endTime.atZone(ZoneId.systemDefault()).toLocalDateTime();
+                    LocalDateTime dateTimeNow = Instant.now().atZone(ZoneId.systemDefault()).toLocalDateTime();
+                    if(Instant.now().isBefore(nowTime)||Instant.now().equals(nowTime)){
                         isToDay = true;
                         if(model.getDispatchLeadTime()==0) {
                             nextTakeTime = nowTime.toEpochMilli();
@@ -533,29 +538,29 @@ public class WODispatchPlanTmDoBizFun {
                         nextTakeTime = Instant.ofEpochMilli(
                                 TimeTool.convertDateStr2UTC
                                         (JSONArray.parseArray(model.getCycles()).getString(0)
-                                                +" "+newList.get(0).getHandleStartTime())).toEpochMilli();
+                                                +" "+newList.get(0).getHandleStartTime())).plus(Duration.ofDays(1)).toEpochMilli();
                         limitNextTakeTime = Instant.ofEpochMilli(
                                 TimeTool.convertDateStr2UTC
                                         (JSONArray.parseArray(model.getCycles()).getString(0)
-                                                +" "+newList.get(0).getHandleStartTimeLimit())).toEpochMilli();
+                                                +" "+newList.get(0).getHandleStartTimeLimit())).plus(Duration.ofDays(1)).toEpochMilli();
                     }else if(model.getDispatchLeadTime()>0){
                         nextTakeTime = Instant.ofEpochMilli(
                                 TimeTool.convertDateStr2UTC
                                         (JSONArray.parseArray(model.getCycles()).getString(0)
-                                                +" "+newList.get(0).getHandleStartTime())).minus(-model.getDispatchLeadTime(), ChronoUnit.MINUTES).toEpochMilli();
+                                                +" "+newList.get(0).getHandleStartTime())).plus(Duration.ofDays(1)).minus(-model.getDispatchLeadTime(), ChronoUnit.MINUTES).toEpochMilli();
                         limitNextTakeTime = Instant.ofEpochMilli(
                                 TimeTool.convertDateStr2UTC
                                         (JSONArray.parseArray(model.getCycles()).getString(0)
-                                                +" "+newList.get(0).getHandleStartTimeLimit())).minus(-model.getDispatchLeadTime(), ChronoUnit.MINUTES).toEpochMilli();
+                                                +" "+newList.get(0).getHandleStartTimeLimit())).plus(Duration.ofDays(1)).minus(-model.getDispatchLeadTime(), ChronoUnit.MINUTES).toEpochMilli();
                     }else if(model.getDispatchLeadTime()<0){
                         nextTakeTime = Instant.ofEpochMilli(
                                 TimeTool.convertDateStr2UTC
                                         (JSONArray.parseArray(model.getCycles()).getString(0)
-                                                +" "+newList.get(0).getHandleStartTime())).minus(Math.abs(model.getDispatchLeadTime()), ChronoUnit.MINUTES).toEpochMilli();
+                                                +" "+newList.get(0).getHandleStartTime())).plus(Duration.ofDays(1)).minus(Math.abs(model.getDispatchLeadTime()), ChronoUnit.MINUTES).toEpochMilli();
                         limitNextTakeTime = Instant.ofEpochMilli(
                                 TimeTool.convertDateStr2UTC
                                         (JSONArray.parseArray(model.getCycles()).getString(0)
-                                                +" "+newList.get(0).getHandleStartTimeLimit())).minus(Math.abs(model.getDispatchLeadTime()), ChronoUnit.MINUTES).toEpochMilli();
+                                                +" "+newList.get(0).getHandleStartTimeLimit())).plus(Duration.ofDays(1)).minus(Math.abs(model.getDispatchLeadTime()), ChronoUnit.MINUTES).toEpochMilli();
                     }
                 }