Browse Source

根节点ID

fangpy 3 tháng trước cách đây
mục cha
commit
6cfabff435

+ 3 - 0
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/fegin/RwApsServer.java

@@ -19,4 +19,7 @@ public interface RwApsServer {
     @PostMapping("/apsSchedule/productionLzDdSchedule")
     ProductionScheduleRetVo productionLzDdSchedule(@RequestBody ProductionScheduleVo productionScheduleVo);
 
+    @PostMapping("/apsSchedule/productionThTaSchedule")
+    ProductionScheduleRetVo productionThDdSchedule(@RequestBody ProductionScheduleVo productionScheduleVo);
+
 }

+ 13 - 7
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsServiceImpl.java

@@ -788,9 +788,12 @@ public class ApsServiceImpl implements ApsService {
             logger.info("排程数据:" + JSONUtil.toJsonStr(apsProductionSchedule, jsonConfig));
             // APS平台排程接口调用
             ProductionScheduleRetVo productionScheduleRetVo;
-            if (apsType.getConstraintMode() != null && apsType.getConstraintMode().equals("lz")) {
+            if (apsType.getConstraintMode() != null && apsType.getConstraintMode().equals("lz") && "dd".equals(apsType.getScheduleType())) {
                 productionScheduleRetVo = rwApsServer.productionLzDdSchedule(apsProductionSchedule);
-            } else {
+            }else if("dd".equals(apsType.getScheduleType()) && "thMergeBf".equals(apsType.getThMergeMode())){
+//                productionScheduleRetVo = rwApsServer.productionThDdSchedule(apsProductionSchedule);
+                productionScheduleRetVo = rwApsServer.productionSchedule(apsProductionSchedule);
+            }else {
                 productionScheduleRetVo = rwApsServer.productionSchedule(apsProductionSchedule);
             }
             saveRes(productionScheduleRetVo,
@@ -1246,14 +1249,17 @@ public class ApsServiceImpl implements ApsService {
                                            List<ApsEquipmentCalendarDo> baseEquipmentCalendarList) {
         // 当前工序排程开始时间
         Date apsPlanStartDate = productionScheduleVo.getApsPlanStartDate();
-        if (productionScheduleVo.getProcesses() != null && productionScheduleVo.getProcesses().size() > 0) {
-            List<ProductionProcesses> bsProcess = productionScheduleVo.getProcesses().stream().filter(v -> v.getBsProcessesId().get(0).equals(operationDo.getId())).collect(Collectors.toList());
-            if (bsProcess != null && bsProcess.size() > 0) {
-                if (bsProcess.get(0).getApsOverallConfig() != null && bsProcess.get(0).getApsOverallConfig().getStartTime() != null) {
-                    apsPlanStartDate = Date.from(bsProcess.get(0).getApsOverallConfig().getStartTime().atZone(ZoneId.systemDefault()).toInstant());
+        if(!"dd".equals(apsType.getScheduleType())){
+            if (productionScheduleVo.getProcesses() != null && productionScheduleVo.getProcesses().size() > 0) {
+                List<ProductionProcesses> bsProcess = productionScheduleVo.getProcesses().stream().filter(v -> v.getBsProcessesId().get(0).equals(operationDo.getId())).collect(Collectors.toList());
+                if (bsProcess != null && bsProcess.size() > 0) {
+                    if (bsProcess.get(0).getApsOverallConfig() != null && bsProcess.get(0).getApsOverallConfig().getStartTime() != null) {
+                        apsPlanStartDate = Date.from(bsProcess.get(0).getApsOverallConfig().getStartTime().atZone(ZoneId.systemDefault()).toInstant());
+                    }
                 }
             }
         }
+
         String apsPlanStartDateStr = DateUtil.formatDateTime(apsPlanStartDate);
         // 设备列表
         List<String> optionalEquipments = new ArrayList<>();

+ 32 - 0
cx-aps/cx-aps-server/src/main/java/com/rongwei/bsserver/controller/ApsAgentController.java

@@ -0,0 +1,32 @@
+package com.rongwei.bsserver.controller;
+
+import com.rongwei.bscommon.sys.service.ApsCustomerManagementService;
+import com.rongwei.bscommon.sys.utils.StringUtil;
+import com.rongwei.bsentity.domain.ApsCustomerManagementDo;
+import com.rongwei.rwcommon.base.R;
+import com.rongwei.rwcommon.utils.SecurityUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@Slf4j
+@RestController
+@RequestMapping("/apsAgent")
+public class ApsAgentController {
+
+    @Autowired
+    private ApsCustomerManagementService apsCustomerManagementService;
+
+    @PostMapping("/customerAdd")
+    public R customerAdd(@RequestBody ApsCustomerManagementDo customerManagementDo){
+        if(StringUtil.isBlank(customerManagementDo.getId())){
+            customerManagementDo.setId(SecurityUtil.getUUID());
+        }
+        apsCustomerManagementService.save(customerManagementDo);
+        return R.ok();
+    }
+
+}