From 650f17d152299e8380b9b00bea795c085c75fd76 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期二, 20 八月 2024 17:47:46 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ycl-server/src/main/java/com/ycl/task/ContractTask.java                          |   36 ++++
 ycl-server/src/main/java/com/ycl/platform/service/impl/TContractServiceImpl.java |   96 ++++-------
 ycl-common/src/main/java/enumeration/ContractRule.java                           |   58 +++----
 ycl-server/src/main/java/com/ycl/handler/CustomCellWriteHandler.java             |  153 ++++++++----------
 ycl-pojo/src/main/java/com/ycl/platform/domain/vo/TMonitorVO.java                |   42 +++++
 ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml                     |   12 
 ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java  |   79 ++++++++-
 7 files changed, 284 insertions(+), 192 deletions(-)

diff --git a/ycl-common/src/main/java/enumeration/ContractRule.java b/ycl-common/src/main/java/enumeration/ContractRule.java
index 1e8080b..0ee418a 100644
--- a/ycl-common/src/main/java/enumeration/ContractRule.java
+++ b/ycl-common/src/main/java/enumeration/ContractRule.java
@@ -3,9 +3,7 @@
 import lombok.Getter;
 
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.List;
-import java.util.stream.Collectors;
 
 /**
  * @author gonghl
@@ -14,46 +12,42 @@
 @Getter
 public enum ContractRule {
 
-    CONTRACT_RULE_1("瑙嗛骞冲潎鍦ㄧ嚎鐜�", Arrays.asList("CONTRACT_RULE_2", "CONTRACT_RULE_3", "CONTRACT_RULE_4", "CONTRACT_RULE_5")),
-    CONTRACT_RULE_2("鈮�98%", Collections.EMPTY_LIST),
-    CONTRACT_RULE_3("95%鈮よ棰戝钩鍧囧湪绾跨巼锛�98%", Collections.EMPTY_LIST),
-    CONTRACT_RULE_4("90%鈮よ棰戝钩鍧囧湪绾跨巼锛�95%", Collections.EMPTY_LIST),
-    CONTRACT_RULE_5("锛�90%", Collections.EMPTY_LIST),
-    CONTRACT_RULE_6("鍓嶇鎰熺煡婧愭不鐞嗗伐浣�", Arrays.asList("CONTRACT_RULE_7", "CONTRACT_RULE_8", "CONTRACT_RULE_9")),
-    CONTRACT_RULE_7("鏃堕挓鍚屾锛堣秴杩嚶�3绉掍负涓嶅悎鏍硷級", Collections.EMPTY_LIST),
-    CONTRACT_RULE_8("OSD鏍囪瘑", Collections.EMPTY_LIST),
-    CONTRACT_RULE_9("涓�鏈轰竴妗�", Collections.EMPTY_LIST),
-    CONTRACT_RULE_10("瀛樺偍鏁呴殰", Arrays.asList("CONTRACT_RULE_11", "CONTRACT_RULE_12")),
-    CONTRACT_RULE_11("鍥犲瓨鍌ㄨ澶囥�佷簯瀛樺偍杞欢绛夊紩璧峰钩鍙颁笉鑳芥甯告煡鐪嬪巻鍙插浘鍍忥紝椤诲湪24灏忔椂鎺掗櫎鏁呴殰", Collections.EMPTY_LIST),
-    CONTRACT_RULE_12("鍥犺棰戞垨鑰呭浘鐗囦涪澶卞鑷撮噸瑕佹浜嬩欢涓嶈兘鍥炴斁鎴栨煡鐪�", Collections.EMPTY_LIST),
-    CONTRACT_RULE_13("瀵逛簬鍓嶇鐐逛綅寮傚父鎯呭喌鐨勫鐞�", List.of("CONTRACT_RULE_14")),
-    CONTRACT_RULE_14("闀滃ご鏁呴殰鎴栨薄鏌撴垨鏍戞灊閬尅鎴栨灙鏈鸿瑙掑亸绉绘甯歌搴︽垨琛ュ厜鐏簲浜湭浜�", Collections.EMPTY_LIST),
-    CONTRACT_RULE_15("寤虹珛鏁版嵁鐩戞祴缁存姢鏈哄埗", List.of("CONTRACT_RULE_16")),
-    CONTRACT_RULE_16("涓爣浜哄簲褰撳缓绔嬫暟鎹洃娴嬬淮鎶ゆ満鍒讹紝褰撳彂鐢熸暟鎹紓甯告儏鍐垫椂锛屽簲鍦� 24 灏忔椂鍐呮仮澶嶃�傦紙鏁版嵁寮傚父鍖呮嫭瀹炴椂鐩戞帶鎴栧綍鍍忚棰戞媺娴佸け璐ワ紝鍥剧墖鑾峰彇澶辫触銆佽瑙夎绠楄В鏋愬紓甯哥瓑锛夈��", Collections.EMPTY_LIST),
-    CONTRACT_RULE_17("纭繚褰曞儚瀹屾暣涓嶅畾鏈熷鎵�鏈夌偣浣嶅綍鍍忓畬鏁存�ф娊鏌�", Arrays.asList("CONTRACT_RULE_18", "CONTRACT_RULE_19", "CONTRACT_RULE_20", "CONTRACT_RULE_21", "CONTRACT_RULE_22")),
-    CONTRACT_RULE_18("姣忚矾瑙嗛绱涓㈠け10鍒嗛挓浠ュ唴", Collections.EMPTY_LIST),
-    CONTRACT_RULE_19("涓㈠け10-60 鍒嗛挓", Collections.EMPTY_LIST),
-    CONTRACT_RULE_20("涓㈠け1 灏忔椂-4 灏忔椂锛堝惈锛�", Collections.EMPTY_LIST),
-    CONTRACT_RULE_21("涓㈠け4 灏忔椂-12 灏忔椂锛堝惈锛�", Collections.EMPTY_LIST),
-    CONTRACT_RULE_22("涓㈠け12 灏忔椂浠ヤ笂", Collections.EMPTY_LIST),
-    CONTRACT_RULE_23("纭繚鍥剧墖瀹屾暣涓嶅畾鏈熷鎵�鏈変汉鑴歌溅杈嗕互鍙婃櫤鑳藉墠绔姄鎷嶇殑鍥剧墖瀹屾暣鎬ф娊鏌�", List.of("CONTRACT_RULE_24")),
-    CONTRACT_RULE_24("鍙戠幇鍚庡彴瀛樺偍涓嶈兘璋冨彇鍓嶇璁惧鍥剧墖", Collections.EMPTY_LIST),
+    CONTRACT_RULE_Online(1,"璁惧骞冲潎鍦ㄧ嚎鐜�", 0),
+
+    CONTRACT_RULE_2(2,"鍓嶇鎰熺煡婧愭不鐞嗗伐浣�", 0),
+    CONTRACT_RULE_Time(3,"鏃堕挓鍚屾锛堣秴杩嚶�3绉掍负涓嶅悎鏍硷級", 2),
+    CONTRACT_RULE_OSD(4,"OSD鏍囪瘑", 2),
+    CONTRACT_RULE_OneFile(5,"涓�鏈轰竴妗�", 2),
+
+    CONTRACT_RULE_6(6,"瀛樺偍鏁呴殰", 0),
+    CONTRACT_RULE_7(7,"鍥犲瓨鍌ㄨ澶囥�佷簯瀛樺偍杞欢绛夊紩璧峰钩鍙颁笉鑳芥甯告煡鐪嬪巻鍙插浘鍍忥紝椤诲湪24灏忔椂鎺掗櫎鏁呴殰", 6),
+    CONTRACT_RULE_8(8,"鍥犺棰戞垨鑰呭浘鐗囦涪澶卞鑷撮噸瑕佹浜嬩欢涓嶈兘鍥炴斁鎴栨煡鐪�", 6),
+
+    CONTRACT_RULE_9(9,"瀵逛簬鍓嶇鐐逛綅寮傚父鎯呭喌鐨勫鐞�", 0),
+    CONTRACT_RULE_10(10,"闀滃ご鏁呴殰鎴栨薄鏌撴垨鏍戞灊閬尅鎴栨灙鏈鸿瑙掑亸绉绘甯歌搴︽垨琛ュ厜鐏簲浜湭浜�", 9),
+
+    CONTRACT_RULE_13(13,"纭繚褰曞儚瀹屾暣涓嶅畾鏈熷鎵�鏈夌偣浣嶅綍鍍忓畬鏁存�ф娊鏌�", 0),
+
+    CONTRACT_RULE_19(19,"纭繚鍥剧墖瀹屾暣涓嶅畾鏈熷鎵�鏈変汉鑴歌溅杈嗕互鍙婃櫤鑳藉墠绔姄鎷嶇殑鍥剧墖瀹屾暣鎬ф娊鏌�", 0),
+    CONTRACT_RULE_20(20,"鍙戠幇鍚庡彴瀛樺偍涓嶈兘璋冨彇鍓嶇璁惧鍥剧墖", 19),
+
     ;
-
+    private final Integer id;
     private final String name;
-    private final List<String> children;
+    private final Integer parentId;
 
-    ContractRule(String name, List<String> children) {
+    ContractRule(Integer id, String name, Integer parentId) {
+        this.id = id;
         this.name = name;
-        this.children = children;
+        this.parentId = parentId;
     }
 
     public static List<ContractRule> getParent() {
-        return Arrays.stream(ContractRule.values()).filter(contractRule -> !contractRule.getChildren().isEmpty()).toList();
+        return Arrays.stream(ContractRule.values()).filter(contractRule -> contractRule.parentId ==0).toList();
     }
 
     public static List<ContractRule> getChildren(ContractRule parent) {
-        return parent.getChildren().stream().map(ContractRule::valueOf).collect(Collectors.toList());
+        return Arrays.stream(ContractRule.values()).filter(contractRule -> parent.id.equals(contractRule.parentId)).toList();
     }
 
 }
diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/TMonitorVO.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/TMonitorVO.java
index a916997..45c0ba3 100644
--- a/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/TMonitorVO.java
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/TMonitorVO.java
@@ -5,6 +5,7 @@
 import com.ycl.system.entity.BaseEntity;
 import lombok.Data;
 
+import java.time.LocalDate;
 import java.util.Date;
 import java.util.List;
 
@@ -220,6 +221,47 @@
 
     private Long deptId;
     private String deptName;
+    private Integer provinceTag;
+    private String area;
+    private String error;
+    private String unitName;
+    private LocalDate mongoCreateTime;
+    /**
+     * 褰撴棩鎺ユ敹鍒扮殑褰撴棩鎶撴媿閲�
+     */
+    private Integer dataCount;
+    /**
+     * 鏃堕挓鍑嗙‘鐜�
+     */
+    private Float clockPercent;
+    /**
+     * 澶у浘鍙敤鐜�
+     */
+    private Float bigUsefulPercent;
+    /**
+     * 涓昏灞炴�т竴鑷寸巼
+     */
+    private Float majorConPercent;
+    /**
+     * 閲嶈灞炴�т竴鑷寸巼
+     */
+    private Float importantConPercent;
+    /**
+     * 浜鸿劯鍚堟牸鐜�
+     */
+    private Float faceEligPercent;
+    /**
+     * 鍏抽敭甯ф椂寤�
+     */
+    private Integer ifmDelay;
+    /**
+     * 淇′护鏃跺欢
+     */
+    private Integer sipDelay;
+    /**
+     * 瑙嗛娴佹椂寤�
+     */
+    private Integer videoDelay;
 
     /**
      * 鍔ㄦ�佸垪
diff --git a/ycl-server/src/main/java/com/ycl/handler/CustomCellWriteHandler.java b/ycl-server/src/main/java/com/ycl/handler/CustomCellWriteHandler.java
index 41b9066..5899d2a 100644
--- a/ycl-server/src/main/java/com/ycl/handler/CustomCellWriteHandler.java
+++ b/ycl-server/src/main/java/com/ycl/handler/CustomCellWriteHandler.java
@@ -14,6 +14,7 @@
 import org.apache.poi.ss.util.CellRangeAddressList;
 import org.apache.poi.ss.util.CellReference;
 import org.apache.poi.xssf.usermodel.XSSFDataValidation;
+import org.springframework.util.CollectionUtils;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -29,18 +30,17 @@
      * 鎵�浠ヨ兘鍋氱殑鑷畾涔夋搷浣滃緢涓板瘜
      */
     // static class CustomCellWriteHandler {
-
-        @Override
-        public void afterCellDispose(CellWriteHandlerContext context) {
-            // 褰撳墠鐨� cell
-            Cell cell = context.getCell();
-            // 杩欓噷鍙互瀵筩ell杩涜浠讳綍鎿嶄綔
-            // 杩欓噷灏辫鑰冭檻 浣犺閽堝鍝竴鍒楄繘琛屼釜鎬у寲澶勭悊  涓�瀹氳璁板緱鍔犲垽鏂�  鍥犱负姣忎釜 cell 閮戒細鎵ц鍒拌繖閲� 鎵�浠ヨ璁板緱鍖哄垎
-            if (BooleanUtils.isTrue(context.getHead()) && cell.getColumnIndex() == 1) {
-                // 1 琛ㄧず 鐪侀偅涓�鍒� 瑕佸鐪佸競鍖鸿繘琛岃仈鍔ㄤ笅鎷夊鐞�
-                ExcelAreaUtil.writeAreaInfo(context, 0);
-            }
+    @Override
+    public void afterCellDispose(CellWriteHandlerContext context) {
+        // 褰撳墠鐨� cell
+        Cell cell = context.getCell();
+        // 杩欓噷鍙互瀵筩ell杩涜浠讳綍鎿嶄綔
+        // 杩欓噷灏辫鑰冭檻 浣犺閽堝鍝竴鍒楄繘琛屼釜鎬у寲澶勭悊  涓�瀹氳璁板緱鍔犲垽鏂�  鍥犱负姣忎釜 cell 閮戒細鎵ц鍒拌繖閲� 鎵�浠ヨ璁板緱鍖哄垎
+        if (BooleanUtils.isTrue(context.getHead()) && cell.getColumnIndex() == 1) {
+            // 1 琛ㄧず 鐪侀偅涓�鍒� 瑕佸鐪佸競鍖鸿繘琛岃仈鍔ㄤ笅鎷夊鐞�
+            ExcelAreaUtil.writeAreaInfo(context, 0);
         }
+    }
     // }
 
     public static class ExcelAreaUtil {
@@ -76,7 +76,7 @@
             // 鍑嗗鐐规暟鎹�
             List<AreaInfo> provinceList = new ArrayList<>();
             for (ContractRule contractRule : ContractRule.getParent()) {
-                provinceList.add(new AreaInfo(contractRule.getName(), ContractRule.getChildren(contractRule).stream().map(ContractRule::getName).toList()));
+                provinceList.add(new AreaInfo(contractRule.getName(), CollectionUtils.isEmpty(ContractRule.getChildren(contractRule)) ? null : ContractRule.getChildren(contractRule).stream().map(ContractRule::getName).toList()));
             }
 
             // 鑾峰彇鍒板綋鍓嶇殑 excel 鍥犱负瑕佸垱寤洪殣钘忕殑 sheet 涔熷氨鏄渷甯傚尯鐨勫疄闄呭唴瀹归兘鏉ヨ嚜浜庨殣钘忕殑 sheet
@@ -96,23 +96,24 @@
             for (AreaInfo pro : provinceList) {
                 String pName = pro.getName();
                 List<String> cList = pro.getAreaList();
-                Row cRow = hideSheet.createRow(rowId++);
-                cRow.createCell(0).setCellValue(pName);
-                for (int j = 0; j < cList.size(); j++) {
-                    String cInfo = cList.get(j);
-                    Cell cCell = cRow.createCell(j + 1);
-                    cCell.setCellValue(cInfo);
+                if (!CollectionUtils.isEmpty(cList)) {
+                    Row cRow = hideSheet.createRow(rowId++);
+                    cRow.createCell(0).setCellValue(pName);
+                    for (int j = 0; j < cList.size(); j++) {
+                        String cInfo = cList.get(j);
+                        Cell cCell = cRow.createCell(j + 1);
+                        cCell.setCellValue(cInfo);
+                    }
+
+                    // 娣诲姞鍚嶇О绠$悊鍣�
+                    String range = getRange(1, rowId, cList.size());
+                    Name name = workbook.createName();
+                    // key涓嶅彲閲嶅
+                    name.setNameName(pName);
+                    String formula = "area!" + range;
+                    name.setRefersToFormula(formula);
                 }
-
-                // 娣诲姞鍚嶇О绠$悊鍣�
-                String range = getRange(1, rowId, cList.size());
-                Name name = workbook.createName();
-                // key涓嶅彲閲嶅
-                name.setNameName(pName);
-                String formula = "area!" + range;
-                name.setRefersToFormula(formula);
             }
-
             // 缁欑渷娣诲姞涓嬫媺
             int lastRow = 100;
             setDataValidation(sheet, 1, lastRow, startIndex, startIndex);
@@ -134,7 +135,7 @@
             CellRangeAddressList provRangeAddressList = new CellRangeAddressList(firstRow, lastRow, firstCol, lastCol);
             DataValidation provinceDataValidation = dvHelper.createValidation(provConstraint, provRangeAddressList);
             // 楠岃瘉
-            provinceDataValidation.createErrorBox("error", "璇烽�夋嫨姝g‘鐨勭渷浠�");
+            provinceDataValidation.createErrorBox("error", "璇烽�夋嫨姝g‘鐨勮鍒�");
             provinceDataValidation.setShowErrorBox(true);
             provinceDataValidation.setSuppressDropDownArrow(true);
             sheetPro.addValidationData(provinceDataValidation);
@@ -196,63 +197,45 @@
 
     private static List<CalculateRule> getExcelData() {
         ArrayList<CalculateRule> list = new ArrayList<>();
-        CalculateRule calculateRule1 = new CalculateRule();
-        calculateRule1.setId(1);
-        calculateRule1.setRuleName("瑙嗛骞冲潎鍦ㄧ嚎鐜�");
-        calculateRule1.setRuleCondition("鈮�98%");
-        calculateRule1.setMax(98D);
-        calculateRule1.setDeductCategory(RuleDeductCategoryEnum.DEDUCT_POINTS);
-        calculateRule1.setCalcFraction(0.00);
-        list.add(calculateRule1);
-        CalculateRule calculateRule2 = new CalculateRule();
-        calculateRule2.setRuleName("瑙嗛骞冲潎鍦ㄧ嚎鐜�");
-        calculateRule2.setRuleCondition("95%鈮よ棰戝钩鍧囧湪绾跨巼锛�98%");
-        calculateRule2.setMax(97D);
-        calculateRule2.setMin(95D);
-        calculateRule2.setDeductCategory(RuleDeductCategoryEnum.DEDUCT_POINTS);
-        calculateRule2.setCalcFraction(5.00);
-        list.add(calculateRule2);
-        CalculateRule calculateRule3 = new CalculateRule();
-        calculateRule3.setRuleName("瑙嗛骞冲潎鍦ㄧ嚎鐜�");
-        calculateRule3.setRuleCondition("90%鈮よ棰戝钩鍧囧湪绾跨巼锛�95%");
-        calculateRule3.setMax(94D);
-        calculateRule3.setMin(90D);
-        calculateRule3.setDeductCategory(RuleDeductCategoryEnum.DEDUCT_POINTS);
-        calculateRule3.setCalcFraction(10.00);
-        list.add(calculateRule3);
-        CalculateRule calculateRule33 = new CalculateRule();
-        calculateRule33.setRuleName("瑙嗛骞冲潎鍦ㄧ嚎鐜�");
-        calculateRule33.setRuleCondition("锛�90%");
-        calculateRule33.setMin(89D);
-        calculateRule33.setDeductCategory(RuleDeductCategoryEnum.DEDUCT_POINTS);
-        calculateRule33.setCalcFraction(10.00);
-        list.add(calculateRule33);
-        CalculateRule calculateRule4 = new CalculateRule();
-        calculateRule4.setId(2);
-        calculateRule4.setRuleName("鍓嶇鎰熺煡婧愭不鐞嗗伐浣�");
-        calculateRule4.setRuleCondition("鏃堕挓鍚屾锛堣秴杩嚶�3绉掍负涓嶅悎鏍硷級");
-        calculateRule4.setDeductCategory(RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY);
-        calculateRule4.setCalcFraction(0.1);
-        list.add(calculateRule4);
-        CalculateRule calculateRule7 = new CalculateRule();
-        calculateRule7.setRuleName("鍓嶇鎰熺煡婧愭不鐞嗗伐浣�");
-        calculateRule7.setRuleCondition("OSD鏍囪瘑");
-        list.add(calculateRule7);
-        CalculateRule calculateRule6 = new CalculateRule();
-        calculateRule6.setRuleName("鍓嶇鎰熺煡婧愭不鐞嗗伐浣�");
-        calculateRule6.setRuleCondition("涓�鏈轰竴妗�");
-        list.add(calculateRule6);
-        CalculateRule calculateRule5 = new CalculateRule();
-        calculateRule5.setId(3);
-        calculateRule5.setRuleName("鍚庡彴绯荤粺鐨勪繚闅�");
-        calculateRule5.setRuleCondition("鍗曟鏁呴殰鏃堕暱鑻ヨ秴鍑�72灏忔椂涓嶈冻144灏忔椂鐨勶紝姣忚秴鍑�12灏忔椂锛堜笉瓒�12灏忔椂鎸�12灏忔椂璁★級");
-        calculateRule5.setMax(144D);
-        calculateRule5.setMin(72D);
-        calculateRule5.setDeductCategory(RuleDeductCategoryEnum.MULTIPLY_POINTS_AFTER_DIVIDING_QUANTITY);
-        calculateRule5.setCalcFraction(2.00);
-        calculateRule5.setCalcUnit(12);
-        list.add(calculateRule5);
+
+        setTemplateRule(list,1,"璁惧骞冲潎鍦ㄧ嚎鐜�","鈮�98%",null,98D,RuleDeductCategoryEnum.DEDUCT_POINTS,0.00);
+        setTemplateRule(list,null,"璁惧骞冲潎鍦ㄧ嚎鐜�","95%鈮よ澶囧钩鍧囧湪绾跨巼锛�98%",97D,95D,RuleDeductCategoryEnum.DEDUCT_POINTS,5.00);
+        setTemplateRule(list,null,"璁惧骞冲潎鍦ㄧ嚎鐜�","90%鈮よ澶囧钩鍧囧湪绾跨巼锛�95%",94D,90D,RuleDeductCategoryEnum.DEDUCT_POINTS,10.00);
+        setTemplateRule(list,null,"璁惧骞冲潎鍦ㄧ嚎鐜�","锛�90%",89D,null,RuleDeductCategoryEnum.DEDUCT_POINTS,20.00);
+
+        setTemplateRule(list,2,"鍓嶇鎰熺煡婧愭不鐞嗗伐浣�","鏃堕挓鍚屾锛堣秴杩嚶�3绉掍负涓嶅悎鏍硷級",null,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.1);
+        setTemplateRule(list,null,"鍓嶇鎰熺煡婧愭不鐞嗗伐浣�","OSD鏍囪瘑",null,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.1);
+        setTemplateRule(list,null,"鍓嶇鎰熺煡婧愭不鐞嗗伐浣�","涓�鏈轰竴妗�",null,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.1);
+
+        setTemplateRule(list,3,"瀛樺偍鏁呴殰","鍥犲瓨鍌ㄨ澶囥�佷簯瀛樺偍杞欢绛夊紩璧峰钩鍙颁笉鑳芥甯告煡鐪嬪巻鍙插浘鍍�,鍗曟鏁呴殰鏃堕暱鍦�24灏忔椂浠ュ唴鐨�",24D,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.5);
+        setTemplateRule(list,null,"瀛樺偍鏁呴殰","鍥犲瓨鍌ㄨ澶囥�佷簯瀛樺偍杞欢绛夊紩璧峰钩鍙颁笉鑳芥甯告煡鐪嬪巻鍙插浘鍍�,鍗曟鏁呴殰鏃堕暱鑻ヨ秴鍑�24灏忔椂浠ヤ笂銆�",null,24D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,1.0);
+        setTemplateRule(list,null,"瀛樺偍鏁呴殰","鍥犺棰戞垨鑰呭浘鐗囦涪澶卞鑷撮噸瑕佹浜嬩欢涓嶈兘鍥炴斁鎴栨煡鐪�",null,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,2.0);
+
+        setTemplateRule(list,4,"瀵逛簬鍓嶇鐐逛綅寮傚父鎯呭喌鐨勫鐞�","闀滃ご鏁呴殰鎴栨薄鏌撴垨鏍戞灊閬尅鎴栨灙鏈鸿瑙掑亸绉绘甯歌搴︽垨琛ュ厜鐏簲浜湭浜�,24灏忔椂鍚庢湭淇鐨�",null,24D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.5);
+        setTemplateRule(list,null,"瀵逛簬鍓嶇鐐逛綅寮傚父鎯呭喌鐨勫鐞�","闀滃ご鏁呴殰鎴栨薄鏌撴垨鏍戞灊閬尅鎴栨灙鏈鸿瑙掑亸绉绘甯歌搴︽垨琛ュ厜鐏簲浜湭浜�,48灏忔椂鍚庢湭淇鐨�",null,48D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,1.0);
+
+        setTemplateRule(list,5,"纭繚褰曞儚瀹屾暣涓嶅畾鏈熷鎵�鏈夌偣浣嶅綍鍍忓畬鏁存�ф娊鏌�","姣忚矾瑙嗛绱涓㈠け10鍒嗛挓浠ュ唴",10D,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.2);
+        setTemplateRule(list,null,"纭繚褰曞儚瀹屾暣涓嶅畾鏈熷鎵�鏈夌偣浣嶅綍鍍忓畬鏁存�ф娊鏌�","涓㈠け10-60 鍒嗛挓",10D,60D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.5);
+        setTemplateRule(list,null,"纭繚褰曞儚瀹屾暣涓嶅畾鏈熷鎵�鏈夌偣浣嶅綍鍍忓畬鏁存�ф娊鏌�","涓㈠け1 灏忔椂-4 灏忔椂锛堝惈锛�",60D,240D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,1.0);
+        setTemplateRule(list,null,"纭繚褰曞儚瀹屾暣涓嶅畾鏈熷鎵�鏈夌偣浣嶅綍鍍忓畬鏁存�ф娊鏌�","涓㈠け4 灏忔椂-12 灏忔椂锛堝惈锛�",240D,720D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,1.5);
+        setTemplateRule(list,null,"纭繚褰曞儚瀹屾暣涓嶅畾鏈熷鎵�鏈夌偣浣嶅綍鍍忓畬鏁存�ф娊鏌�","涓㈠け12 灏忔椂浠ヤ笂",null,720D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,2.0);
+
+        setTemplateRule(list,6,"纭繚鍥剧墖瀹屾暣涓嶅畾鏈熷鎵�鏈変汉鑴歌溅杈嗕互鍙婃櫤鑳藉墠绔姄鎷嶇殑鍥剧墖瀹屾暣鎬ф娊鏌�","鍙戠幇鍚庡彴瀛樺偍涓嶈兘璋冨彇鍓嶇璁惧鍥剧墖",null,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,2.0);
+
+
         return list;
     }
 
-}
\ No newline at end of file
+    private static void setTemplateRule(ArrayList<CalculateRule> list,Integer id,String ruleName,String condition,Double max,Double min,RuleDeductCategoryEnum deductCategoryEnum,Double calcFraction) {
+        CalculateRule calculateRule = new CalculateRule();
+        calculateRule.setId(id);
+        calculateRule.setRuleName(ruleName);
+        calculateRule.setRuleCondition(condition);
+        calculateRule.setMax(max);
+        calculateRule.setMin(min);
+        calculateRule.setDeductCategory(deductCategoryEnum);
+        calculateRule.setCalcFraction(calcFraction);
+        list.add(calculateRule);
+    }
+
+}
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/TContractServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/TContractServiceImpl.java
index 747dd0e..03bc5de 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/TContractServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/TContractServiceImpl.java
@@ -79,69 +79,43 @@
 
     private List<CalculateRule> getExcelData() {
         ArrayList<CalculateRule> list = new ArrayList<>();
-        CalculateRule calculateRule1 = new CalculateRule();
-        calculateRule1.setId(1);
-        calculateRule1.setRuleName("瑙嗛骞冲潎鍦ㄧ嚎鐜�");
-        calculateRule1.setRuleCondition("鈮�98%");
-        calculateRule1.setMax(98D);
-        calculateRule1.setDeductCategory(RuleDeductCategoryEnum.DEDUCT_POINTS);
-        calculateRule1.setCalcFraction(0.00);
-        list.add(calculateRule1);
-        CalculateRule calculateRule2 = new CalculateRule();
-        calculateRule2.setRuleName("瑙嗛骞冲潎鍦ㄧ嚎鐜�");
-        calculateRule2.setRuleCondition("95%鈮よ棰戝钩鍧囧湪绾跨巼锛�98%");
-        calculateRule2.setMax(97D);
-        calculateRule2.setMin(95D);
-        calculateRule2.setDeductCategory(RuleDeductCategoryEnum.DEDUCT_POINTS);
-        calculateRule2.setCalcFraction(5.00);
-        list.add(calculateRule2);
-        CalculateRule calculateRule3 = new CalculateRule();
-        calculateRule3.setRuleName("瑙嗛骞冲潎鍦ㄧ嚎鐜�");
-        calculateRule3.setRuleCondition("90%鈮よ棰戝钩鍧囧湪绾跨巼锛�95%");
-        calculateRule3.setMax(94D);
-        calculateRule3.setMin(90D);
-        calculateRule3.setDeductCategory(RuleDeductCategoryEnum.DEDUCT_POINTS);
-        calculateRule3.setCalcFraction(10.00);
-        list.add(calculateRule3);
-        CalculateRule calculateRule33 = new CalculateRule();
-        calculateRule33.setRuleName("瑙嗛骞冲潎鍦ㄧ嚎鐜�");
-        calculateRule33.setRuleCondition("锛�90%");
-        calculateRule33.setMin(89D);
-        calculateRule33.setDeductCategory(RuleDeductCategoryEnum.DEDUCT_POINTS);
-        calculateRule33.setCalcFraction(10.00);
-        list.add(calculateRule33);
-        CalculateRule calculateRule4 = new CalculateRule();
-        calculateRule4.setId(2);
-        calculateRule4.setRuleName("鍓嶇鎰熺煡婧愭不鐞嗗伐浣�");
-        calculateRule4.setRuleCondition("鏃堕挓鍚屾锛堣秴杩嚶�3绉掍负涓嶅悎鏍硷級");
-        calculateRule4.setDeductCategory(RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY);
-        calculateRule4.setCalcFraction(0.1);
-        list.add(calculateRule4);
-        CalculateRule calculateRule7 = new CalculateRule();
-        calculateRule7.setRuleName("鍓嶇鎰熺煡婧愭不鐞嗗伐浣�");
-        calculateRule7.setRuleCondition("OSD鏍囪瘑");
-        calculateRule7.setDeductCategory(RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY);
-        calculateRule7.setCalcFraction(0.1);
-        list.add(calculateRule7);
-        CalculateRule calculateRule6 = new CalculateRule();
-        calculateRule6.setRuleName("鍓嶇鎰熺煡婧愭不鐞嗗伐浣�");
-        calculateRule6.setRuleCondition("涓�鏈轰竴妗�");
-        calculateRule6.setDeductCategory(RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY);
-        calculateRule6.setCalcFraction(0.1);
-        list.add(calculateRule6);
-        CalculateRule calculateRule5 = new CalculateRule();
-        calculateRule5.setId(3);
-        calculateRule5.setRuleName("鍚庡彴绯荤粺鐨勪繚闅�");
-        calculateRule5.setRuleCondition("鍗曟鏁呴殰鏃堕暱鑻ヨ秴鍑�72灏忔椂涓嶈冻144灏忔椂鐨勶紝姣忚秴鍑�12灏忔椂锛堜笉瓒�12灏忔椂鎸�12灏忔椂璁★級");
-        calculateRule5.setMax(144D);
-        calculateRule5.setMin(72D);
-        calculateRule5.setDeductCategory(RuleDeductCategoryEnum.MULTIPLY_POINTS_AFTER_DIVIDING_QUANTITY);
-        calculateRule5.setCalcFraction(2.00);
-        calculateRule5.setCalcUnit(12);
-        list.add(calculateRule5);
+        setTemplateRule(list,1,"璁惧骞冲潎鍦ㄧ嚎鐜�","鈮�98%",null,98D,RuleDeductCategoryEnum.DEDUCT_POINTS,0.00);
+        setTemplateRule(list,null,"璁惧骞冲潎鍦ㄧ嚎鐜�","95%鈮よ澶囧钩鍧囧湪绾跨巼锛�98%",97D,95D,RuleDeductCategoryEnum.DEDUCT_POINTS,5.00);
+        setTemplateRule(list,null,"璁惧骞冲潎鍦ㄧ嚎鐜�","90%鈮よ澶囧钩鍧囧湪绾跨巼锛�95%",94D,90D,RuleDeductCategoryEnum.DEDUCT_POINTS,10.00);
+        setTemplateRule(list,null,"璁惧骞冲潎鍦ㄧ嚎鐜�","锛�90%",89D,null,RuleDeductCategoryEnum.DEDUCT_POINTS,20.00);
+
+        setTemplateRule(list,2,"鍓嶇鎰熺煡婧愭不鐞嗗伐浣�","鏃堕挓鍚屾锛堣秴杩嚶�3绉掍负涓嶅悎鏍硷級",null,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.1);
+        setTemplateRule(list,null,"鍓嶇鎰熺煡婧愭不鐞嗗伐浣�","OSD鏍囪瘑",null,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.1);
+        setTemplateRule(list,null,"鍓嶇鎰熺煡婧愭不鐞嗗伐浣�","涓�鏈轰竴妗�",null,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.1);
+
+        setTemplateRule(list,3,"瀛樺偍鏁呴殰","鍥犲瓨鍌ㄨ澶囥�佷簯瀛樺偍杞欢绛夊紩璧峰钩鍙颁笉鑳芥甯告煡鐪嬪巻鍙插浘鍍�,鍗曟鏁呴殰鏃堕暱鍦�24灏忔椂浠ュ唴鐨�",24D,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.5);
+        setTemplateRule(list,null,"瀛樺偍鏁呴殰","鍥犲瓨鍌ㄨ澶囥�佷簯瀛樺偍杞欢绛夊紩璧峰钩鍙颁笉鑳芥甯告煡鐪嬪巻鍙插浘鍍�,鍗曟鏁呴殰鏃堕暱鑻ヨ秴鍑�24灏忔椂浠ヤ笂銆�",null,24D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,1.0);
+        setTemplateRule(list,null,"瀛樺偍鏁呴殰","鍥犺棰戞垨鑰呭浘鐗囦涪澶卞鑷撮噸瑕佹浜嬩欢涓嶈兘鍥炴斁鎴栨煡鐪�",null,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,2.0);
+
+        setTemplateRule(list,4,"瀵逛簬鍓嶇鐐逛綅寮傚父鎯呭喌鐨勫鐞�","闀滃ご鏁呴殰鎴栨薄鏌撴垨鏍戞灊閬尅鎴栨灙鏈鸿瑙掑亸绉绘甯歌搴︽垨琛ュ厜鐏簲浜湭浜�,24灏忔椂鍚庢湭淇鐨�",null,24D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.5);
+        setTemplateRule(list,null,"瀵逛簬鍓嶇鐐逛綅寮傚父鎯呭喌鐨勫鐞�","闀滃ご鏁呴殰鎴栨薄鏌撴垨鏍戞灊閬尅鎴栨灙鏈鸿瑙掑亸绉绘甯歌搴︽垨琛ュ厜鐏簲浜湭浜�,48灏忔椂鍚庢湭淇鐨�",null,48D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,1.0);
+
+        setTemplateRule(list,5,"纭繚褰曞儚瀹屾暣涓嶅畾鏈熷鎵�鏈夌偣浣嶅綍鍍忓畬鏁存�ф娊鏌�","姣忚矾瑙嗛绱涓㈠け10鍒嗛挓浠ュ唴",10D,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.2);
+        setTemplateRule(list,null,"纭繚褰曞儚瀹屾暣涓嶅畾鏈熷鎵�鏈夌偣浣嶅綍鍍忓畬鏁存�ф娊鏌�","涓㈠け10-60 鍒嗛挓",60D,10D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,0.5);
+        setTemplateRule(list,null,"纭繚褰曞儚瀹屾暣涓嶅畾鏈熷鎵�鏈夌偣浣嶅綍鍍忓畬鏁存�ф娊鏌�","涓㈠け1 灏忔椂-4 灏忔椂锛堝惈锛�",240D,60D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,1.0);
+        setTemplateRule(list,null,"纭繚褰曞儚瀹屾暣涓嶅畾鏈熷鎵�鏈夌偣浣嶅綍鍍忓畬鏁存�ф娊鏌�","涓㈠け4 灏忔椂-12 灏忔椂锛堝惈锛�",720D,240D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,1.5);
+        setTemplateRule(list,null,"纭繚褰曞儚瀹屾暣涓嶅畾鏈熷鎵�鏈夌偣浣嶅綍鍍忓畬鏁存�ф娊鏌�","涓㈠け12 灏忔椂浠ヤ笂",null,720D,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,2.0);
+
+        setTemplateRule(list,6,"纭繚鍥剧墖瀹屾暣涓嶅畾鏈熷鎵�鏈変汉鑴歌溅杈嗕互鍙婃櫤鑳藉墠绔姄鎷嶇殑鍥剧墖瀹屾暣鎬ф娊鏌�","鍙戠幇鍚庡彴瀛樺偍涓嶈兘璋冨彇鍓嶇璁惧鍥剧墖",null,null,RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY,2.0);
+
         return list;
     }
-
+    private static void setTemplateRule(ArrayList<CalculateRule> list,Integer id,String ruleName,String condition,Double max,Double min,RuleDeductCategoryEnum deductCategoryEnum,Double calcFraction) {
+        CalculateRule calculateRule = new CalculateRule();
+        calculateRule.setId(id);
+        calculateRule.setRuleName(ruleName);
+        calculateRule.setRuleCondition(condition);
+        calculateRule.setMax(max);
+        calculateRule.setMin(min);
+        calculateRule.setDeductCategory(deductCategoryEnum);
+        calculateRule.setCalcFraction(calcFraction);
+        list.add(calculateRule);
+    }
     @Override
     @Transactional
     @SneakyThrows
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java
index a895a82..b91b2b4 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java
@@ -2,14 +2,16 @@
 
 import annotation.DataScope;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.pagehelper.Page;
-import com.github.pagehelper.PageHelper;
 import com.ycl.platform.domain.entity.TMonitor;
 import com.ycl.platform.domain.query.DashboardQuery;
 import com.ycl.platform.domain.query.DataCenterQuery;
 import com.ycl.platform.domain.query.HomeQuery;
+import com.ycl.platform.domain.result.HK.FaceDeviceInspectionResult;
+import com.ycl.platform.domain.result.HK.FaceDeviceSamplingResult;
+import com.ycl.platform.domain.result.HK.VehicleDeviceInspectionResult;
+import com.ycl.platform.domain.result.HK.VehicleDeviceSamplingResult;
+import com.ycl.platform.domain.result.UY.VideoOnlineResult;
 import com.ycl.platform.domain.vo.TMonitorVO;
 import com.ycl.platform.domain.vo.screen.MonitorRateVO;
 import com.ycl.platform.domain.vo.screen.MonitorTotalVO;
@@ -19,9 +21,11 @@
 import com.ycl.system.page.PageUtil;
 import com.ycl.system.service.ISysConfigService;
 import com.ycl.utils.StringUtils;
-import com.ycl.utils.redis.RedisCache;
 import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.mongodb.core.MongoTemplate;
+import org.springframework.data.mongodb.core.query.Criteria;
+import org.springframework.data.mongodb.core.query.Query;
 import org.springframework.stereotype.Service;
 
 import java.util.HashMap;
@@ -43,7 +47,7 @@
     @Autowired
     private ISysConfigService configService;
     @Autowired
-    private RedisCache redisCache;
+    private MongoTemplate mongoTemplate;
 
     /**
      * 鏌ヨ璁惧璧勪骇
@@ -65,10 +69,10 @@
      */
     @Override
     @DataScope(deptAlias = "d",userAlias = "u")
-    public List<TMonitorVO> selectTMonitorList(TMonitorVO tMonitor)
-    {
+    public List<TMonitorVO> selectTMonitorList(TMonitorVO tMonitor) {
         List<TMonitorVO> monitors = tMonitorMapper.selectTMonitorList(tMonitor);
-        if (Objects.equals(tMonitor.getRecovery(), 1)) {
+        // 寮傚父璁惧
+        if (Objects.equals(tMonitor.getRecovery(), 1L)) {
             String time = configService.selectConfigByKey("abnormal.equipment.continuous.attention.time");
             if (StringUtils.isBlank(time)) {
                 throw new RuntimeException("璇烽厤缃紓甯歌澶囪繛缁叧娉ㄦ椂闂�");
@@ -76,6 +80,65 @@
             List<TMonitorVO> recoveryMonitors = tMonitorMapper.selectRecoveryMonitor(time);
             monitors.addAll(recoveryMonitors);
         }
+        // 瑙嗛鐩戞帶璁惧
+        if (Objects.equals(tMonitor.getCameraFunType(), "1")) {
+            monitors.forEach(monitor -> {
+                Query query = new Query();
+                query.addCriteria(Criteria.where("deviceId").is(monitor.getSerialNumber())
+                        // .and("mongoCreateTime").is(LocalDate.now())
+                );
+                VideoOnlineResult one = mongoTemplate.findOne(query, VideoOnlineResult.class);
+                if (one != null) {
+                    monitor.setIfmDelay(one.getIfmDelay());
+                    monitor.setSipDelay(one.getSipDelay());
+                    monitor.setVideoDelay(one.getVideoDelay());
+                    monitor.setMongoCreateTime(one.getMongoCreateTime());
+                }
+            });
+        }
+        // 杞﹁締鐩戞帶璁惧
+        if (Objects.equals(tMonitor.getCameraFunType(), "2")) {
+            monitors.forEach(monitor -> {
+                Query query = new Query();
+                query.addCriteria(Criteria.where("externalIndexCode").is(monitor.getSerialNumber())
+                        // .and("mongoCreateTime").is(LocalDate.now())
+                );
+                VehicleDeviceInspectionResult one = mongoTemplate.findOne(query, VehicleDeviceInspectionResult.class);
+                VehicleDeviceSamplingResult two = mongoTemplate.findOne(query, VehicleDeviceSamplingResult.class);
+                if (one != null) {
+                    monitor.setDataCount(one.getDataCount());
+                    monitor.setClockPercent(Objects.nonNull(one.getSnapClock()) ? one.getSnapClock().getClockPercent() : null);
+                    monitor.setMongoCreateTime(one.getMongoCreateTime());
+                }
+                if (two != null) {
+                    monitor.setBigUsefulPercent(Objects.nonNull(two.getBigUseful()) ? two.getBigUseful().getBigUsefulPercent() : null);
+                    monitor.setMajorConPercent(Objects.nonNull(two.getVehDiff()) ? two.getVehDiff().getMajorConPercent() : null);
+                    monitor.setImportantConPercent(Objects.nonNull(two.getVehDiff()) ? two.getVehDiff().getImportantConPercent() : null);
+                    monitor.setMongoCreateTime(two.getMongoCreateTime());
+                }
+            });
+        }
+        // 浜鸿劯鐩戞帶璁惧
+        if (Objects.equals(tMonitor.getCameraFunType(), "3")) {
+            monitors.forEach(monitor -> {
+                Query query = new Query();
+                query.addCriteria(Criteria.where("externalIndexCode").is(monitor.getSerialNumber())
+                        // .and("mongoCreateTime").is(LocalDate.now())
+                );
+                FaceDeviceInspectionResult one = mongoTemplate.findOne(query, FaceDeviceInspectionResult.class);
+                FaceDeviceSamplingResult two = mongoTemplate.findOne(query, FaceDeviceSamplingResult.class);
+                if (one != null) {
+                    monitor.setDataCount(one.getDataCount());
+                    monitor.setClockPercent(Objects.nonNull(one.getSnapClock()) ? one.getSnapClock().getClockPercent() : null);
+                    monitor.setMongoCreateTime(one.getMongoCreateTime());
+                }
+                if (two != null) {
+                    monitor.setBigUsefulPercent(Objects.nonNull(two.getBigUseful())? two.getBigUseful().getBigUsefulPercent() : null);
+                    monitor.setFaceEligPercent(Objects.nonNull(two.getFaceEligibility()) ? two.getFaceEligibility().getFaceEligPercent() : null);
+                    monitor.setMongoCreateTime(two.getMongoCreateTime());
+                }
+            });
+        }
         return monitors;
     }
 
diff --git a/ycl-server/src/main/java/com/ycl/task/ContractTask.java b/ycl-server/src/main/java/com/ycl/task/ContractTask.java
new file mode 100644
index 0000000..bb95a81
--- /dev/null
+++ b/ycl-server/src/main/java/com/ycl/task/ContractTask.java
@@ -0,0 +1,36 @@
+package com.ycl.task;
+
+
+import com.ycl.platform.mapper.TContractMapper;
+import com.ycl.platform.mapper.TMonitorMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.mongodb.core.MongoTemplate;
+import org.springframework.stereotype.Component;
+
+/**
+ * 鍚堝悓鑰冩牳瀹氭椂浠诲姟
+ */
+@Slf4j
+@Component("contractTask")
+public class ContractTask {
+    @Autowired
+    private MongoTemplate mongoTemplate;
+    @Autowired
+    private TMonitorMapper monitorMapper;
+    @Autowired
+    private TContractMapper contractMapper;
+
+    /**
+     * 鍚堝悓鑰冩牳 鍦ㄧ嚎鐜囨瘡鏃ヤ换鍔℃娴�
+     * 鏌ョ敓鏁堢殑鍚堝悓鍏宠仈鐨勫叕鍙革紝鑾峰彇unitId闆嗗悎
+     * 鏍规嵁unitId鏌ヨ瀵瑰簲鐐逛綅鑾峰彇鍚勪釜鍏徃绠$悊鐨勮澶嘔ds
+     * 鏌ヨ涓夌璁惧鍦ㄧ嚎涓嶅湪绾挎儏鍐碉紝灏佽涓轰竴涓猰ap<鍥芥爣鐮�,鍦ㄧ嚎鐘舵��>
+     * 璁$畻姣忔棩姣忓鍏徃鐨勫湪绾跨巼瀛樺叆redis
+     * 鏈堝簳璁$畻骞冲潎鍊硷紝鏍规嵁鍦ㄧ嚎鐜囧拰鍚堝悓鏍囧噯鎵e噺鍒嗘暟
+     */
+    public void onlineCheck() {
+//        contractMapper.selectByRuleName();
+    }
+
+}
diff --git a/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
index 8bf9143..62aac3b 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
@@ -89,12 +89,12 @@
 
     <select id="selectTMonitorList" resultType="com.ycl.platform.domain.vo.TMonitorVO">
         select m.id, m.serial_number, name, site_type, mac_addr, ip, camera_fun_type, longitude, latitude,
-        camera_capture_area, on_state, civil_code, integrated_device, camera_brand, address, net_working,
-        public_security, installed_time, management_unit, mu_contact_info, storage_days
-        , monitor_azimuth, scene_photo_addr, model, site_vulgo, camera_type, camera_light_type, encoded_format,
-        camera_dept, hybm, lxbm,d.dept_id, d.dept_name from t_monitor m
-        left join t_yw_point p on m.serial_number = p.serial_number
-        left join sys_dept d on p.dept_id = d.dept_id
+        camera_capture_area, on_state, civil_code, d.dept_id, d.dept_name, d.area, p.province_tag,
+        IF(COUNT(w.id) OVER() > 0, '鏄�', '鍚�') AS error, u.unit_name from t_monitor m
+        left join t_yw_point p on m.serial_number = p.serial_number and p.deleted = 0
+        left join sys_dept d on p.dept_id = d.dept_id and d.del_flag = 0
+        left join t_work_order w on m.serial_number = w.serial_number and w.deleted = 0
+        left join t_yw_unit u on p.unit_id = u.id and u.deleted = 0
         <where>
             <if test="serialNumber != null  and serialNumber != ''">and m.serial_number = #{serialNumber}</if>
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>

--
Gitblit v1.8.0