Browse Source

修改bug

姚云青 2 years ago
parent
commit
867a87243c

+ 9 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/DemoLine/YunjianConstant.java

@@ -270,5 +270,14 @@ public interface YunjianConstant {
     String YUNJIAN_SHEDULE_FLAG = "YUNJIAN_SHEDULE_FLAG";
 
 
+    String YUNJIAN_CONTROL_STATUS_1="系统监管";
+    String YUNJIAN_CONTROL_STATUS_2="独立运行";
+
+    String YUNJIAN_PRODUCTION_STATUS_1="生产中";
+    String YUNJIAN_PRODUCTION_STATUS_2="离线";
+    String YUNJIAN_PRODUCTION_STATUS_3="空闲";
+    String YUNJIAN_PRODUCTION_STATUS_4="报警";
+
+
 
 }

+ 73 - 24
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/ZZoneServiceImpl.java

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.zuihou.authority.service.common.DictionaryItemService;
 import com.github.zuihou.business.DemoLine.DemoLineConstant;
+import com.github.zuihou.business.DemoLine.YunjianConstant;
 import com.github.zuihou.business.operationManagementCenter.dao.TTaskMapper;
 import com.github.zuihou.business.operationManagementCenter.dao.TaskNodeMapper;
 import com.github.zuihou.business.operationManagementCenter.dao.WorkpieceMapper;
@@ -350,11 +351,13 @@ public class ZZoneServiceImpl extends SuperServiceImpl<ZZoneMapper, ZZone> imple
                 gList.add(lMap);
             }
         }
-        Map m =  new HashMap();
-        String allResourceSQl = productionresourceService.getGatherSQL();
-        m.put("allResourceSQl",allResourceSQl);
-        List<Map>resourceStatusList = productionresourceviewMapper.getResourceStatus(m);
-        Map statusMap = resourceStatusList.get(0);
+//        Map m =  new HashMap();
+//        String allResourceSQl = productionresourceService.getGatherSQL();
+//        m.put("allResourceSQl",allResourceSQl);
+//        List<Map>resourceStatusList = productionresourceviewMapper.getResourceStatus(m);
+        Map statusMap = getStatusMap(resourceList);
+
+
 
 
         returnMap.put("iconGroupList",gList);
@@ -372,6 +375,52 @@ public class ZZoneServiceImpl extends SuperServiceImpl<ZZoneMapper, ZZone> imple
     }
 
 
+    private Map getStatusMap(List<Map> resourceList){
+        Map statusMap = new HashMap();
+        int onlineCount = 0;
+        int offlineCount = 0;
+        int supervisionCount = 0;
+        int independentCount = 0;
+        int workCount = 0;
+        int freeCount = 0;
+        int exceptionCount = 0;
+
+        if(CollectionUtil.isNotEmpty(resourceList)){
+            for(Map map:resourceList){
+                String controlStatusCN = map.get("controlStatusCN")==null?"":map.get("controlStatusCN").toString();
+                String productionStatusCN = map.get("productionStatusCN")==null?"":map.get("productionStatusCN").toString();
+
+                if(YunjianConstant.YUNJIAN_CONTROL_STATUS_1.equals(controlStatusCN)){
+                    supervisionCount++;
+                }
+                if(YunjianConstant.YUNJIAN_CONTROL_STATUS_2.equals(controlStatusCN)){
+                    independentCount++;
+                }
+
+                if(YunjianConstant.YUNJIAN_PRODUCTION_STATUS_1.equals(productionStatusCN)){
+                    workCount++;
+                }
+                if(YunjianConstant.YUNJIAN_PRODUCTION_STATUS_2.equals(productionStatusCN)){
+                    offlineCount++;
+                }
+                if(YunjianConstant.YUNJIAN_PRODUCTION_STATUS_3.equals(productionStatusCN)){
+                    freeCount++;
+                }
+                if(YunjianConstant.YUNJIAN_PRODUCTION_STATUS_4.equals(productionStatusCN)){
+                    exceptionCount++;
+                }
+            }
+            statusMap.put("supervisionCount",supervisionCount);
+            statusMap.put("independentCount",independentCount);
+            statusMap.put("workCount",workCount);
+            statusMap.put("offlineCount",offlineCount);
+            statusMap.put("freeCount",freeCount);
+            statusMap.put("exceptionCount",exceptionCount);
+        }
+        return statusMap;
+    }
+
+
     /**
      * 把生产资源的数据塞入位置相关的数据
      * @param resourceMap
@@ -540,31 +589,31 @@ public class ZZoneServiceImpl extends SuperServiceImpl<ZZoneMapper, ZZone> imple
 
     @Override
     public Map demoLineAllResource() {
-        List <String>list = new ArrayList<String>();
+//        List <String>list = new ArrayList<String>();
         //所有的设备
-        list.add(DemoLineConstant.JBW_A);
-        list.add(DemoLineConstant.SXLZ1);
-        list.add(DemoLineConstant.SXLZ2);
-        list.add(DemoLineConstant.JBW_B);
-        list.add(DemoLineConstant.JBW_D);
-        list.add(DemoLineConstant.JBW_E);
-        list.add(DemoLineConstant.Q3ZUOBIAO);
-        list.add(DemoLineConstant.JQR1);
-        list.add(DemoLineConstant.JBW_F);
-        list.add(DemoLineConstant.JQR2);
-        list.add(DemoLineConstant.DEMOLINE_SUM50_ZNDY);
-        list.add(DemoLineConstant.JBW_H);
-        list.add(DemoLineConstant.JBW_I);
-        list.add(DemoLineConstant.DEMOLINE_SUM50_RXDY4);
-        list.add(DemoLineConstant.JQR3);
-        list.add(DemoLineConstant.DEMOLINE_QINGXIJI);
-        list.add(DemoLineConstant.DEMOLINE_DABIAOJI);
+//        list.add(DemoLineConstant.JBW_A);
+//        list.add(DemoLineConstant.SXLZ1);
+//        list.add(DemoLineConstant.SXLZ2);
+//        list.add(DemoLineConstant.JBW_B);
+//        list.add(DemoLineConstant.JBW_D);
+//        list.add(DemoLineConstant.JBW_E);
+//        list.add(DemoLineConstant.Q3ZUOBIAO);
+//        list.add(DemoLineConstant.JQR1);
+//        list.add(DemoLineConstant.JBW_F);
+//        list.add(DemoLineConstant.JQR2);
+//        list.add(DemoLineConstant.DEMOLINE_SUM50_ZNDY);
+//        list.add(DemoLineConstant.JBW_H);
+//        list.add(DemoLineConstant.JBW_I);
+//        list.add(DemoLineConstant.DEMOLINE_SUM50_RXDY4);
+//        list.add(DemoLineConstant.JQR3);
+//        list.add(DemoLineConstant.DEMOLINE_QINGXIJI);
+//        list.add(DemoLineConstant.DEMOLINE_DABIAOJI);
 
         Map returnMap = new HashMap();
         //查出所有生产资源
         Map queryMap = new HashMap();
         queryMap.put("resourceStatus","1");
-        queryMap.put("codes",StringUtil.changeIdsListToSubQueryStr(list));
+//        queryMap.put("codes",StringUtil.changeIdsListToSubQueryStr(list));
         //生产资源的数据
         List<Map> resourceList = productionresourceService.getList(queryMap);
         //转成map

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

@@ -135,10 +135,10 @@ public class ProductionresourceServiceImpl extends SuperCacheServiceImpl<Product
         //需要查询状态
         String resourceStatus = map.get("resourceStatus")==null?"":map.get("resourceStatus").toString();
         String gatherSql = "";
-        if("1".equals(resourceStatus)){
-            gatherSql = getGatherSQL();
-            map.put("gatherSql",gatherSql);
-        }
+//        if("1".equals(resourceStatus)){
+//            gatherSql = getGatherSQL();
+//            map.put("gatherSql",gatherSql);
+//        }
 
         String getOrgIds = this.getOrgIds();
         if(StringUtil.isNotEmpty(getOrgIds)){
@@ -829,10 +829,15 @@ public class ProductionresourceServiceImpl extends SuperCacheServiceImpl<Product
 //                item.put("linkStatus",buildMap(linkMap.get(linkStatus)));
                     item.put("controlStatus",buildMap(controlMap.get(controlStatus)));
                     item.put("productionStatus",buildMap(productionMap.get(productionStatus)));
+                    //直接存汉字
+                    item.put("controlStatusCN",controlStatus);
+                    item.put("productionStatusCN",productionStatus);
                 }else {
 //                item.put("linkStatus","");
                     item.put("controlStatus","");
                     item.put("productionStatus","");
+                    item.put("controlStatusCN","");
+                    item.put("productionStatusCN","");
                 }
 
                 //item.put("category",categoryMap.get(category));