Kaynağa Gözat

Merge remote-tracking branch 'origin/master'

LLL 2 ay önce
ebeveyn
işleme
d5fea45e74

+ 2 - 2
jeecg-module-interlock/src/main/java/org/jeecg/modules/dashboardInterface/controller/CurrentInterlockStatusController.java

@@ -105,11 +105,11 @@ public class CurrentInterlockStatusController {
         String str1 = "2024-06-13";
         Date data1 = format.parse(str1);
 
-        String[] v1 = new String[]{String.valueOf(total),data1.getTime()+""};
+        String[] v1 = new String[]{String.valueOf(total)};
         strings1.add(v1);
         result1.setDatapoints(strings1);
 
-        String[] v2 = new String[]{String.valueOf(wty),data1.getTime()+""};
+        String[] v2 = new String[]{String.valueOf(wty)};
         strings2.add(v2);
         result2.setDatapoints(strings2);
 

+ 95 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/dashboardInterface/controller/CurrentSystemStatusController.java

@@ -0,0 +1,95 @@
+package org.jeecg.modules.dashboardInterface.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.modules.base.service.IInterlockBaseService;
+import org.jeecg.modules.dashboardInterface.entity.InterlockAndYbStatus;
+import org.jeecg.modules.dashboardInterface.service.IDashboardINterfaceService;
+import org.jeecg.modules.iotedgeCollectData.entity.ResultD;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author dzc
+ * @date 2024/7/5 10:55
+ * @package org.jeecg.modules.dashboardInterface.controller
+ * @project interlock_server
+ * @des
+ */
+@RestController
+@RequestMapping("/dashboard/currentSystemStatus")
+@Slf4j
+public class CurrentSystemStatusController {
+    @Autowired
+    @SuppressWarnings("all")
+    private IDashboardINterfaceService dashboardService;
+    @Autowired
+    @SuppressWarnings("all")
+    private IInterlockBaseService baseService;
+
+    @GetMapping(value = "/")
+    public JSONObject testConnect() {
+        log.info("检查服务成功");
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("status",200);
+        return jsonObject;
+    }
+
+    @PostMapping(value = "/search")
+    public String search(@RequestBody JSONObject request) {
+        log.info("调用search接口:{}", JSON.toJSONString(request));
+
+        List<String> list = dashboardService.getDeviceSystem();
+
+        return JSON.toJSONString(list);
+    }
+
+    @PostMapping(value = "/query")
+    public String query(@RequestBody JSONObject request) throws Exception {
+        log.info("调用query接口:{}", JSON.toJSONString(request));
+
+        List<Map<String, Object>> targets = (List<Map<String, Object>>) request.get("targets");
+        String deviceName = "";
+        String sysName = "";
+        for (Map<String, Object> map : targets) {
+            String refId = (String) map.get("refId");
+            if ("A".equals(refId)) {
+                deviceName = map.get("target").toString();
+            }
+            if ("B".equals(refId)) {
+                sysName = map.get("target").toString();
+            }
+        }
+
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+
+        ArrayList<ResultD> list = new ArrayList<>();
+
+        String systemStatus = dashboardService.getSystemStatus(deviceName, sysName);
+
+
+        ResultD<String[]> result1 = new ResultD<>();
+        result1.setTarget("状态");
+
+        ArrayList<String[]> strings1 = new ArrayList<>();
+
+
+        String str1 = "2024-06-13";
+        Date data1 = format.parse(str1);
+
+        String[] v1 = new String[]{systemStatus};
+        strings1.add(v1);
+        result1.setDatapoints(strings1);
+
+        list.add(result1);
+
+        return JSON.toJSONString(list);
+    }
+}

+ 1 - 1
jeecg-module-interlock/src/main/java/org/jeecg/modules/dashboardInterface/controller/HistroyTylController.java

@@ -84,7 +84,7 @@ public class HistroyTylController {
         List<InterlockTyl> tylList = dashboardService.getTylBySysNameTime(deviceName,sysName,beginDate,endDate);
 
         ResultD<String[]> d = new ResultD<>();
-        d.setTarget(sysName);
+        d.setTarget("投用率");
         ArrayList<String[]> strings = new ArrayList<>();
 
 

+ 1 - 1
jeecg-module-interlock/src/main/java/org/jeecg/modules/dashboardInterface/service/impl/IDashboardINterfaceServiceImpl.java

@@ -179,7 +179,7 @@ public class IDashboardINterfaceServiceImpl implements IDashboardINterfaceServic
     public String getSystemStatus(String deviceName, String systemName) {
         InterlockBase base1 = getBaseInfo(deviceName);
         InterlockBase base2 = getBaseInfo(systemName);
-        return null;
+        return countDayService.getSystemStatus(base1.getId(), base2.getId());
     }
 
     /**

+ 8 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/interlockCountDay/service/IInterlockCountDayService.java

@@ -55,4 +55,12 @@ public interface IInterlockCountDayService extends IService<InterlockCountDay> {
     *   date: 2024/7/4
     */
     List<InterlockAndYbStatus> getYbStatus(String deviceId, String systemId);
+
+    /**
+    *   author: dzc
+    *   version: 1.0
+    *   des: 查询 当前系统状态(相同系统的系统状态就是MP状态 ,该系统下的所有的联锁用的是同一个MP状态点位)
+    *   date: 2024/7/5
+    */
+    String getSystemStatus(String deviceId, String systemId);
 }

+ 25 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/interlockCountDay/service/impl/InterlockCountDayServiceImpl.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.interlockCountDay.service.impl;
 
+import cn.hutool.core.util.ObjectUtil;
 import org.jeecg.modules.base.entity.InterlockBase;
 import org.jeecg.modules.base.service.IInterlockBaseService;
 import org.jeecg.modules.dashboardInterface.entity.InterlockAndYbStatus;
@@ -153,6 +154,30 @@ public class InterlockCountDayServiceImpl extends ServiceImpl<InterlockCountDayM
         return resultList;
     }
 
+    @Override
+    public String getSystemStatus(String deviceId, String systemId) {
+        String mpStatus = "";
+        InterlockBase base = baseService.getById(systemId);
+        String controlSystemStatusNormalValue = base.getControlSystemStatusNormal();
+        String mpStatusValue = "0";
+        List<InterlockSummary> summaryList =  mapper.getSummaryList(deviceId, systemId);
+        for (InterlockSummary summary : summaryList) {
+            // 查询该联锁下的联锁条件
+            List<InterlockDetail> detailList = mapper.getDetailList(summary.getId());
+            for (InterlockDetail detail : detailList) {
+                if (ObjectUtil.isNotNull(detail.getMpStatus())){
+                    mpStatusValue = detail.getMpStatus();
+                }
+            }
+        }
+        if (controlSystemStatusNormalValue.equals(mpStatusValue)){
+            mpStatus = base.getControlSystemStatusNormalName();
+        }else {
+            mpStatus = base.getControlSystemStatusAbnormalName();
+        }
+        return mpStatus;
+    }
+
     /**
      *   author: dzc
      *   version: 1.0

+ 1 - 1
jeecg-module-system/jeecg-system-start/Dockerfile

@@ -8,7 +8,7 @@ RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
 
 WORKDIR /jeecg-boot
 
-EXPOSE 8080
+EXPOSE 8520
 
 #ADD ./src/main/resources/jeecg ./config/jeecg
 ADD ./target/jeecg-system-start-3.4.3.jar ./