Browse Source

托板去掉产线逻辑,设备状态查询接口加上tryctach

yejian 3 years ago
parent
commit
40f58e5d95

+ 16 - 16
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionReadyCenter/service/impl/PlateServiceImpl.java

@@ -63,22 +63,22 @@ public class PlateServiceImpl extends SuperServiceImpl<PlateMapper, Plate> imple
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Plate save(PlateSaveDTO data) {
-        if(StringUtil.isEmpty(data.getZoneId())){//如果是舱体或框体人员。会根据当前角色获取对应的舱体或框体ID
-            //获取用户ID
-            if(StringUtil.isNotEmpty(data.getUserId())){
-                List<Role> roleList=  roleService.findRoleByUserId(Long.parseLong(data.getUserId()));
-                if(CollectionUtil.isNotEmpty(roleList)){
-                    String roles = roleList.stream().map(e -> e.getName()).collect(Collectors.joining(","));
-                    ZZone zZone = new ZZone();
-                    if(roles.indexOf("舱体")>=0){
-                        zZone = zoneService.getOne(Wraps.<ZZone>lbQ().like(ZZone::getName, "舱体"));
-                    }else{
-                        zZone = zoneService.getOne(Wraps.<ZZone>lbQ().like(ZZone::getName, "框体"));
-                    }
-                    data.setZoneId(zZone.getId().toString());
-                }
-            }
-        }
+//        if(StringUtil.isEmpty(data.getZoneId())){//如果是舱体或框体人员。会根据当前角色获取对应的舱体或框体ID
+//            //获取用户ID
+//            if(StringUtil.isNotEmpty(data.getUserId())){
+//                List<Role> roleList=  roleService.findRoleByUserId(Long.parseLong(data.getUserId()));
+//                if(CollectionUtil.isNotEmpty(roleList)){
+//                    String roles = roleList.stream().map(e -> e.getName()).collect(Collectors.joining(","));
+//                    ZZone zZone = new ZZone();
+//                    if(roles.indexOf("舱体")>=0){
+//                        zZone = zoneService.getOne(Wraps.<ZZone>lbQ().like(ZZone::getName, "舱体"));
+//                    }else{
+//                        zZone = zoneService.getOne(Wraps.<ZZone>lbQ().like(ZZone::getName, "框体"));
+//                    }
+//                    data.setZoneId(zZone.getId().toString());
+//                }
+//            }
+//        }
         Plate module = BeanPlusUtil.toBean(data, Plate.class);
 
         //根据编码规则

+ 1 - 1
imcs-admin-boot/imcs-common/src/main/java/com/github/zuihou/common/constant/DictionaryKey.java

@@ -16,7 +16,7 @@ public interface DictionaryKey {
     //线边库最大库位数
     final Integer RESOURCE_MAX_NUM = 20;
     //指定接口URL地址
-    final String INSTRUCTION_URL = "http://106.15.38.8:8090/";
+    final String INSTRUCTION_URL = "http://192.168.10.161:5200/";
     //PLC
     String INTERFACETYPE_PLC = "01";
     //生产加工接口

+ 20 - 16
imcs-admin-boot/imcs-tenant-biz/src/main/java/com/github/zuihou/tenant/service/impl/ProductionresourceServiceImpl.java

@@ -1081,28 +1081,32 @@ public class ProductionresourceServiceImpl extends SuperCacheServiceImpl<Product
      */
     @Override
     public Map getEquipListByInterface() {
+        Map<String,Map>returnMap = new HashMap<>();
         HttpHeaders headers = new HttpHeaders();
         headers.setContentType(MediaType.parseMediaType("application/json;charset=UTF-8"));
         HttpEntity<String> formEntity = new HttpEntity<String>("", headers);
         String instructionUrl = DictionaryKey.INSTRUCTION_URL + "/api/getEquipment" ;
-        String returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
-        //TODO
-        Map<String,Map>returnMap = new HashMap<>();
-        if(StringUtil.isNotEmpty(returnData)){
-            JSONArray jsonArray = JSONArray.parseArray(returnData);
-            for(Object obj:jsonArray){
-                if(obj!=null){
-                    JSONObject jsonObject = (JSONObject)obj;
-                    String no = jsonObject.getString("SerialNo");
-                    String status = jsonObject.getString("Status");
-                    String controlStatus = jsonObject.getString("ControlStatus");
-                    Map childMap = new HashMap();
-                    childMap.put("no",no);
-                    childMap.put("status",status);
-                    childMap.put("controlStatus",controlStatus);
-                    returnMap.put(no,childMap);
+        try{
+            String returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
+            //TODO
+            if(StringUtil.isNotEmpty(returnData)){
+                JSONArray jsonArray = JSONArray.parseArray(returnData);
+                for(Object obj:jsonArray){
+                    if(obj!=null){
+                        JSONObject jsonObject = (JSONObject)obj;
+                        String no = jsonObject.getString("SerialNo");
+                        String status = jsonObject.getString("Status");
+                        String controlStatus = jsonObject.getString("ControlStatus");
+                        Map childMap = new HashMap();
+                        childMap.put("no",no);
+                        childMap.put("status",status);
+                        childMap.put("controlStatus",controlStatus);
+                        returnMap.put(no,childMap);
+                    }
                 }
             }
+        }catch (Exception e){
+            e.printStackTrace();
         }
         return returnMap;
     }