Forráskód Böngészése

Merge remote-tracking branch 'origin/mode-th-merge-01' into mode-th-merge-01

fangpengyuan 3 hónapja
szülő
commit
4bfc5e7749

+ 8 - 0
rw-aps-server/src/main/java/com/rongwei/rwapsserver/aps/taskassigning/service/impl/ProductionScheduleTaServiceImpl.java

@@ -1189,6 +1189,14 @@ public class ProductionScheduleTaServiceImpl implements ProductionScheduleTaServ
             }
             process.setVolumeMetalAndState(process.getVolumeMetal() + (process.getVolumeMetalstate() == null ? "" : process.getVolumeMetalstate()) + process.getProcessType());
             // 可选设备初始化
+            // 调度排程时如果存在历史排程设备,则可选设备直接替换为历史设备
+            if(StrUtil.isNotBlank(process.getLastHistoryEquipmentId()) && "dd".equals(productionScheduleVo.getScheduleType().getScheduleType())
+                    && !"notThMergeBf".equals(productionScheduleVo.getScheduleType().getThMergeMode())){
+                List<String> hisEqIds = new ArrayList<>();
+                hisEqIds.add(process.getLastHistoryEquipmentId());
+                process.setOptionalEquipments(hisEqIds);
+            }
+
             if(process.getOptionalEquipments() != null){
                 List<EquipmentTa> providedEq = new ArrayList<>();
                 for (EquipmentTa equipment : productionScheduleVo.getEquipmentList()) {

+ 1 - 1
rw-aps-server/src/main/java/com/rongwei/rwapsserver/aps/util/StringToJsonUtil.java

@@ -32,7 +32,7 @@ public class StringToJsonUtil {
     }
 
     public static void main(String[] args) throws IOException {
-        String filePath = "E:\\temp\\cx\\logs\\rw-aps-log\\0226\\retjson.txt";
+        String filePath = "E:\\temp\\cx\\logs\\rw-aps-log\\retjson.txt";
         ProductionScheduleRetVo productionScheduleRetVo = readFromJson(filePath);
         List<ProductionProcesses> processes = productionScheduleRetVo.getProcesses().stream().filter(v -> !v.getIfLock() && v.getEquipmentId().equals("0001be252874536843730b100151")).collect(Collectors.toList());
         Collections.sort(processes, Comparator.comparing(pro -> pro.getStartTime()));