15928045575 2 лет назад
Родитель
Сommit
6b2b3349f5
99 измененных файлов с 2720 добавлено и 2281 удалено
  1. 1 1
      pom.xml
  2. 3 3
      slope-common/slope-common-core/src/main/java/com/sckw/core/exception/GlobalSystemExceptionHandler.java
  3. 1 1
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/constant/EnvConstant.java
  4. 1 1
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/constant/NumberConstant.java
  5. 1 1
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/constant/StringConstant.java
  6. 0 40
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/AddressDefaultTypeEnum.java
  7. 1 1
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/AliyunOssFileTypeEnum.java
  8. 0 42
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ApprovalEnum.java
  9. 0 52
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/BannerDistrictEnum.java
  10. 0 186
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CarWaybillEnum.java
  11. 0 164
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CarWaybillQueryEnum.java
  12. 0 45
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CertificateTypeEnum.java
  13. 0 37
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ChargingTypeEnum.java
  14. 0 59
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ClientTypeEnum.java
  15. 0 39
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ContractStatusEnum.java
  16. 0 38
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ContractTrackEnum.java
  17. 0 36
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CooperateApplyTypeEnum.java
  18. 0 44
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CooperateStatusEnum.java
  19. 0 40
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CooperateTypeEnum.java
  20. 1 1
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/DeviceEnum.java
  21. 0 84
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/EntTypeEnum.java
  22. 0 35
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/EntryTypeEnum.java
  23. 5 5
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/FileDisposeLayoutEnum.java
  24. 1 1
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/FileEnum.java
  25. 0 64
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/GlobalTransactionalEnum.java
  26. 0 44
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/LoginMethodEnum.java
  27. 1 1
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/LogisticsOrderEnum.java
  28. 0 36
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/MenuTypeEnum.java
  29. 1 1
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ReportEnum.java
  30. 22 5
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ReportTypeEnum.java
  31. 0 35
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/SigningWayEnum.java
  32. 0 36
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/SystemTypeEnum.java
  33. 0 2
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/TaxRateTypeEnum.java
  34. 1 1
      slope-common/slope-common-core/src/main/java/com/sckw/core/utils/OrderGenerateSeqNoUtils.java
  35. 1 1
      slope-common/slope-common-core/src/main/java/com/sckw/core/web/constant/HttpStatus.java
  36. 1 1
      slope-common/slope-common-excel/src/main/java/com/sckw/excel/config/easyexcel/CustomCellWeightWeightConfig.java
  37. 1 1
      slope-common/slope-common-excel/src/main/java/com/sckw/excel/config/easyexcel/ExcelConverter.java
  38. 1 1
      slope-common/slope-common-excel/src/main/java/com/sckw/excel/utils/ExcelUtil.java
  39. 19 0
      slope-modules/slope-detection/pom.xml
  40. 39 39
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/common/config/MqSendMessageGateWay.java
  41. 207 207
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/common/config/MqttConfig.java
  42. 29 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/CommonController.java
  43. 15 3
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/DeviceController.java
  44. 49 49
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/MqttController.java
  45. 26 11
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/ProjectController.java
  46. 10 3
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/ReportController.java
  47. 61 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/ReportTemplateController.java
  48. 30 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/ThresholdController.java
  49. 0 19
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/KwsDeviceIntegrationMapper.java
  50. 32 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsDeviceIntegrationMapper.java
  51. 5 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsDeviceMapper.java
  52. 16 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsDeviceModelPartMapper.java
  53. 6 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsDictMapper.java
  54. 22 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsMountainCompanyMapper.java
  55. 2 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsProjectMapper.java
  56. 0 2
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsReportTemplateMapper.java
  57. 2 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsDeviceReference.java
  58. 35 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsMountainCompany.java
  59. 10 80
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsProjectArea.java
  60. 4 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsProjectDevice.java
  61. 7 2
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsReportTemplate.java
  62. 7 4
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsThreshold.java
  63. 25 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/DeviceElementDTO.java
  64. 38 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/DeviceLocationDTO.java
  65. 5 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/HeaderData.java
  66. 14 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/IsEnableDTO.java
  67. 9 2
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/ProjectAddDTO.java
  68. 14 1
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/ProjectUpdateDTO.java
  69. 47 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/ReportTemplateAddDTO.java
  70. 49 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/ReportTemplateUpdateDTO.java
  71. 70 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/ThresholdSelectDTO.java
  72. 5 2
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/DeviceQuery.java
  73. 30 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/ThresholdDetailQuery.java
  74. 25 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/ThresholdQuery.java
  75. 42 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/AffiliationDeviceVO.java
  76. 90 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/KwsReportTemplateVO.java
  77. 36 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/ProjectAffiliationDeviceVO.java
  78. 7 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/ProjectDeviceVO.java
  79. 12 1
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/ProjectVo.java
  80. 42 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/QueryDictTypePageReqVo.java
  81. 45 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/ThresholdDetailVO.java
  82. 22 1
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/CommonService.java
  83. 23 5
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/DeviceService.java
  84. 103 20
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ProjectService.java
  85. 18 2
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ReportService.java
  86. 132 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ReportTemplateService.java
  87. 158 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ThresholdService.java
  88. 2 0
      slope-modules/slope-detection/src/main/resources/bootstrap.yml
  89. 32 1
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceIntegrationMapper.xml
  90. 242 184
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceMapper.xml
  91. 61 0
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceModelPartMapper.xml
  92. 173 159
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceReferenceMapper.xml
  93. 18 0
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDictMapper.xml
  94. 96 0
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsMountainCompanyMapper.xml
  95. 1 2
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsProjectAreaMapper.xml
  96. 2 1
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsProjectDeviceMapper.xml
  97. 145 93
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsProjectMapper.xml
  98. 11 22
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsReportTemplateMapper.xml
  99. 199 181
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsThresholdMapper.xml

+ 1 - 1
pom.xml

@@ -15,7 +15,7 @@
     <modules>
         <module>slope-common</module>
         <module>slope-modules</module>
-<!--        <module>slope-modules-api</module>-->
+        <module>slope-modules-api</module>
     </modules>
     <packaging>pom</packaging>
 

+ 3 - 3
slope-common/slope-common-core/src/main/java/com/sckw/core/exception/GlobalSystemExceptionHandler.java

@@ -80,7 +80,7 @@ public class GlobalSystemExceptionHandler {
     @ExceptionHandler(MissingServletRequestParameterException.class)
     public HttpResult noArgs(MissingServletRequestParameterException ex) {
         String format = "参数:[%s]不能为空";
-        return HttpResult.error(HttpStatus.PARAMETERS_PATTERN_ERROR_CODE, String.format(format, ex.getParameterName()));
+        return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, String.format(format, ex.getParameterName()));
     }
 
     /**
@@ -106,7 +106,7 @@ public class GlobalSystemExceptionHandler {
         }
         String errMsg = sb.toString();
         log.error("参数校验异常:{}", errMsg);
-        return HttpResult.error(HttpStatus.PARAMETERS_PATTERN_ERROR_CODE, errMsg);
+        return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, errMsg);
     }
 
     @ResponseBody
@@ -125,7 +125,7 @@ public class GlobalSystemExceptionHandler {
                 first = false;
             }
         }
-        return HttpResult.error(HttpStatus.PARAMETERS_PATTERN_ERROR_CODE, sb.toString());
+        return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_MESSAGE, sb.toString());
     }
 
     /**

+ 1 - 1
slope-common/slope-common-core/src/main/java/com/sckw/core/common/EnvConstant.java → slope-common/slope-common-core/src/main/java/com/sckw/core/model/constant/EnvConstant.java

@@ -1,4 +1,4 @@
-package com.sckw.core.common.enums;
+package com.sckw.core.model.constant;
 
 /**
  * @desc: 环境常量

+ 1 - 1
slope-common/slope-common-core/src/main/java/com/sckw/core/common/NumberConstant.java → slope-common/slope-common-core/src/main/java/com/sckw/core/model/constant/NumberConstant.java

@@ -1,4 +1,4 @@
-package com.sckw.core.common.enums;
+package com.sckw.core.model.constant;
 
 import java.math.BigDecimal;
 

+ 1 - 1
slope-common/slope-common-core/src/main/java/com/sckw/core/common/StringConstant.java → slope-common/slope-common-core/src/main/java/com/sckw/core/model/constant/StringConstant.java

@@ -1,4 +1,4 @@
-package com.sckw.core.common.enums;
+package com.sckw.core.model.constant;
 
 import java.time.format.DateTimeFormatter;
 

+ 0 - 40
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/AddressDefaultTypeEnum.java

@@ -1,40 +0,0 @@
-package com.sckw.core.model.enums;
-
-import lombok.Getter;
-
-/**
- * @author czh
- * @desc 默认地址类型
- * @date 2023/6/15
- */
-@Getter
-public enum AddressDefaultTypeEnum {
-
-    //普通
-    NO(0, ""),
-    //装货地址
-    SHIPMENT(1, "装货"),
-    //收货地址
-    TAKE(2, "卸货"),
-    //装/卸
-    BOTH(3, "装/卸");
-
-    private final int code;
-
-    private final String name;
-
-    AddressDefaultTypeEnum(int code, String name){
-        this.code = code;
-        this.name = name;
-    }
-
-    public static AddressDefaultTypeEnum getName(int code){
-        for (AddressDefaultTypeEnum addressDefaultTypeEnum : values()) {
-            if (addressDefaultTypeEnum.getCode() == code) {
-                return addressDefaultTypeEnum;
-            }
-        }
-        return null;
-    }
-
-}

+ 1 - 1
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/AliyunOssFileTypeEnum.java → slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/AliyunOssFileTypeEnum.java

@@ -1,4 +1,4 @@
-package com.sckw.core.common.enums.enums;
+package com.sckw.core.model.enums;
 
 /**
  * @author lfdc

+ 0 - 42
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ApprovalEnum.java

@@ -1,42 +0,0 @@
-package com.sckw.core.model.enums;
-
-import lombok.Getter;
-
-/**
- * @author czh
- * @desc 审批状态枚举
- * @date 2023/6/15
- */
-@Getter
-public enum ApprovalEnum {
-
-    //未审批
-    NO(0, "待认证"),
-    //通过
-    OK(1, "已认证"),
-    //未通过
-    PASS(2, "已驳回"),
-    //审批中
-    PROCESS(3, "待审批"),
-    //更新中,待审批
-    REFRESH(4, "更新中");
-
-    private final int code;
-
-    private final String name;
-
-    ApprovalEnum(int code, String name){
-        this.code = code;
-        this.name = name;
-    }
-
-    public static String getName(int code){
-        for (ApprovalEnum approvalEnum : values()) {
-            if (approvalEnum.getCode() == code) {
-                return approvalEnum.getName();
-            }
-        }
-        return null;
-    }
-
-}

+ 0 - 52
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/BannerDistrictEnum.java

@@ -1,52 +0,0 @@
-package com.sckw.core.model.enums;
-
-import lombok.Getter;
-
-/**
- * @author sky
- * @desc 默认地址类型
- * @date 2023/6/15
- */
-@Getter
-public enum BannerDistrictEnum {
-
-    //首页
-    BANNER_ZERO(0, "首页"),
-    //建材市场
-    BANNER_ONE(1, "建材市场"),
-    //求购大厅
-    BANNER_TWO(2, "求购大厅"),
-    //运需广场
-    BANNER_THREE(3, "运需广场"),
-    //运力大厅
-    BANNER_FOUR(4, "运力大厅"),
-    //金融服务
-    BANNER_FIVE(5, "金融服务"),
-    //车后服务
-    BANNER_SIX(6,"车后服务"),
-    //绿智新能
-    BANNER_SEVEN(7,"绿智新能");
-
-
-
-    
-
-    private final int code;
-
-    private final String name;
-
-    BannerDistrictEnum(int code, String name){
-        this.code = code;
-        this.name = name;
-    }
-
-    public static BannerDistrictEnum getName(int code){
-        for (BannerDistrictEnum addressDefaultTypeEnum : values()) {
-            if (addressDefaultTypeEnum.getCode() == code) {
-                return addressDefaultTypeEnum;
-            }
-        }
-        return null;
-    }
-
-}

+ 0 - 186
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CarWaybillEnum.java

@@ -1,186 +0,0 @@
-package com.sckw.core.model.enums;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author lfdc
- * @description 车辆运单状态枚举
- * @date 2023-07-14 14:07:23
- */
-public enum CarWaybillEnum {
-    /**
-     * 待接单
-     */
-    PENDING_ORDER(1, "pendingOrder", "1", "待接单"),
-    /**
-     * 待出车
-     */
-    PENDING_VEHICLE(2, "pendingVehicle", "2", "待出车"),
-    /**
-     * 已出车
-     */
-    EXIT_COMPLETED(3, "exitCompleted", "3", "已出车"),
-    /**
-     * 到达装货点
-     */
-    WAIT_LOADING(4, "waitLoading", "4", "到达装货点"),
-    /**
-     * 已装货
-     */
-    COMPLETION_LOADING(5, "completionLoading", "5", "已装货"),
-    /**
-     * 到达卸货点
-     */
-    WAIT_UNLOADING(6, "waitUnloading", "6", "到达卸货点"),
-    /**
-     * 已卸货
-     */
-    COMPLETION_UNLOADING(7, "completionUnloading", "7", "已卸货"),
-    /**
-     * 已核-通过
-     */
-    APPROVAL_PASS(8, "approvalPass", "8", "审核通过"),
-    /**
-     * 拒接单
-     */
-    REJECT_ORDER(9, "rejectOrder", "9", "拒接单"),
-    /**
-     * 拒出车
-     */
-    REFUSE_TRAFFIC(10, "refuseTraffic", "10", "拒出车"),
-    /**
-     * 已撤销
-     */
-    REVOKED(11, "revoked", "11", "撤回"),
-    /**
-     * 已核单-不通过[审核不通过]
-     */
-    APPROVAL_NO_PASS(12, "revoked", "12", "核单驳回"),
-    /**
-     * 单证更新审核中
-     */
-    APPROVAL_IN(13, "approvalIn", "13", "单证更新审核中"),
-    ;
-
-    private final Integer code;
-    private final String value;
-    private final String status;
-    private final String destination;
-
-    public Integer getCode() {
-        return code;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public String getDestination() {
-        return destination;
-    }
-
-    CarWaybillEnum(Integer code, String value, String status, String destination) {
-        this.code = code;
-        this.value = value;
-        this.status = status;
-        this.destination = destination;
-    }
-
-    public static String getLogisticsOrderValue(Integer code) {
-        for (CarWaybillEnum waybillEnum : CarWaybillEnum.values()) {
-            if (waybillEnum.getCode().equals(code)) {
-                return waybillEnum.getValue();
-            }
-        }
-        return null;
-    }
-
-    public static String getWaybillOrderDestination(String status) {
-        for (CarWaybillEnum waybillEnum : CarWaybillEnum.values()) {
-            if (waybillEnum.getStatus().equals(status)) {
-                return waybillEnum.getDestination();
-            }
-        }
-        return null;
-    }
-
-    public static String getName(Integer code) {
-        for (CarWaybillEnum waybillEnum : CarWaybillEnum.values()) {
-            if (waybillEnum.getCode().equals(code)) {
-                return waybillEnum.getDestination();
-            }
-        }
-        return null;
-    }
-
-    public static List<Integer> getCodes() {
-        List<Integer> codes = new ArrayList<>();
-        for (CarWaybillEnum waybillEnum : CarWaybillEnum.values()) {
-            codes.add(waybillEnum.getCode());
-        }
-        return codes;
-    }
-
-    public static List<String> getStringCodes() {
-        List<String> codes = new ArrayList<>();
-        for (CarWaybillEnum waybillEnum : CarWaybillEnum.values()) {
-            codes.add(waybillEnum.getStatus());
-        }
-        return codes;
-    }
-
-    /**
-     * @param code 状态码
-     * @desc 是否可以变更司机
-     * @author zk
-     * @date 2023/8/2
-     **/
-    public static boolean changeDriver(int code) {
-        if (code == CarWaybillEnum.COMPLETION_UNLOADING.getCode()
-                || code == CarWaybillEnum.APPROVAL_PASS.getCode()
-                || code == CarWaybillEnum.REJECT_ORDER.getCode()
-                || code == CarWaybillEnum.REFUSE_TRAFFIC.getCode()
-                || code == CarWaybillEnum.REVOKED.getCode()
-                || code == CarWaybillEnum.APPROVAL_NO_PASS.getCode()) {
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * @param code 状态码
-     * @desc 是否可以变更司机/车辆
-     * @author zk
-     * @date 2023/8/2
-     **/
-    public static boolean changeTruck(int code) {
-        if (code == CarWaybillEnum.PENDING_ORDER.getCode()
-                || code == CarWaybillEnum.PENDING_VEHICLE.getCode()) {
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * 获取编码以及注释
-     *
-     * @return
-     */
-    public static String getCodeAndDestination() {
-        StringBuilder sb = new StringBuilder();
-        for (CarWaybillEnum value : CarWaybillEnum.values()) {
-            sb.append(value.getCode()+":").append(value.destination).append(";");
-        }
-        return sb.toString();
-    }
-
-    public static void main(String[] args) {
-        String codeAndDestination = getCodeAndDestination();
-        System.out.println(codeAndDestination);
-    }
-}

+ 0 - 164
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CarWaybillQueryEnum.java

@@ -1,164 +0,0 @@
-package com.sckw.core.model.enums;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author lfdc
- * @description 车辆运单状态枚举[仅查询使用]
- * @date 2023-07-14 14:07:23
- */
-public enum CarWaybillQueryEnum {
-    /**
-     * 待接单
-     */
-    PENDING_ORDER(1, "pendingOrder", "1", "待接单"),
-    /**
-     * 待出车
-     */
-    PENDING_VEHICLE(2, "pendingVehicle", "2", "待出车"),
-    /**
-     * 已出车
-     */
-    EXIT_COMPLETED(3, "exitCompleted", "3", "已出车"),
-    /**
-     * 到达装货点
-     */
-    WAIT_LOADING(4, "waitLoading", "4", "到达装货点"),
-    /**
-     * 已装货
-     */
-    COMPLETION_LOADING(5, "completionLoading", "5", "已装货"),
-    /**
-     * 到达卸货点
-     */
-    WAIT_UNLOADING(6, "waitUnloading", "6", "到达卸货点"),
-    /**
-     * 已卸货
-     */
-    COMPLETION_UNLOADING(7, "completionUnloading", "7", "已卸货"),
-    /**
-     * 已核-通过
-     */
-    APPROVAL_PASS(8, "approvalPass", "8", "审核通过"),
-    /**
-     * 拒接单
-     */
-    REJECT_ORDER(9, "rejectOrder", "9", "拒接单"),
-    /**
-     * 拒出车
-     */
-    REFUSE_TRAFFIC(10, "refuseTraffic", "10", "拒出车"),
-    /**
-     * 已撤销
-     */
-    REVOKED(11, "revoked", "11", "单趟撤回"),
-    /**
-     * 已核单-不通过[审核不通过]
-     */
-    APPROVAL_NO_PASS(12, "revoked", "12", "核单驳回"),
-    /**
-     * 单证更新审核中
-     */
-    APPROVAL_IN(13, "approvalIn", "13", "单证更新审核中"),
-
-    /**
-     * 单证审核
-     */
-    DOCUMENT_CHECK(100, "documentCheck", "100", "单证审核"),
-
-    /**
-     * 已作废
-     */
-    ABROGATE(200, "abrogate", "200", "已作废"),
-    ;
-
-    private final Integer code;
-    private final String value;
-    private final String status;
-    private final String destination;
-
-    public Integer getCode() {
-        return code;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public String getDestination() {
-        return destination;
-    }
-
-    CarWaybillQueryEnum(Integer code, String value, String status, String destination) {
-        this.code = code;
-        this.value = value;
-        this.status = status;
-        this.destination = destination;
-    }
-
-    public static String getLogisticsOrderValue(Integer code) {
-        for (CarWaybillQueryEnum waybillEnum : CarWaybillQueryEnum.values()) {
-            if (waybillEnum.getCode().equals(code)) {
-                return waybillEnum.getValue();
-            }
-        }
-        return null;
-    }
-
-    public static String getWaybillOrderDestination(String status) {
-        for (CarWaybillQueryEnum waybillEnum : CarWaybillQueryEnum.values()) {
-            if (waybillEnum.getStatus().equals(status)) {
-                return waybillEnum.getDestination();
-            }
-        }
-        return null;
-    }
-
-    public static String getName(Integer code) {
-        for (CarWaybillQueryEnum waybillEnum : CarWaybillQueryEnum.values()) {
-            if (waybillEnum.getCode().equals(code)) {
-                return waybillEnum.getDestination();
-            }
-        }
-        return null;
-    }
-
-    public static List<Integer> getCodes() {
-        List<Integer> codes = new ArrayList<>();
-        for (CarWaybillQueryEnum waybillEnum : CarWaybillQueryEnum.values()) {
-            codes.add(waybillEnum.getCode());
-        }
-        return codes;
-    }
-
-    public static List<String> getStringCodes() {
-        List<String> codes = new ArrayList<>();
-        for (CarWaybillQueryEnum waybillEnum : CarWaybillQueryEnum.values()) {
-            codes.add(waybillEnum.getStatus());
-        }
-        return codes;
-    }
-
-    /**
-     * @param code 状态码
-     * @desc 是否可以变更司机/车辆
-     * @author zk
-     * @date 2023/8/2
-     **/
-    public static boolean changeDriverAndTruck(int code) {
-        if (code == CarWaybillQueryEnum.COMPLETION_UNLOADING.getCode()
-                || code == CarWaybillQueryEnum.APPROVAL_PASS.getCode()
-                || code == CarWaybillQueryEnum.REJECT_ORDER.getCode()
-                || code == CarWaybillQueryEnum.REFUSE_TRAFFIC.getCode()
-                || code == CarWaybillQueryEnum.REVOKED.getCode()
-                || code == CarWaybillQueryEnum.APPROVAL_NO_PASS.getCode()) {
-            return false;
-        }
-        return true;
-    }
-}

+ 0 - 45
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CertificateTypeEnum.java

@@ -1,45 +0,0 @@
-package com.sckw.core.model.enums;
-
-import lombok.Getter;
-
-/**
- * @author czh
- * @desc 证照类型枚举
- * @date 2023/6/15
- */
-@Getter
-public enum CertificateTypeEnum {
-
-    //联系人身份证
-    CONTACTS_IDCARD(1, "联系人身份证"),
-    //法人身份证
-    CORPORATION_IDCARD(2, "法人身份证"),
-    //营业执照
-    BUSINESSLICENSE(3, "营业执照"),
-    //道路运输许可证
-    ROADLICENSE(4, "道路运输许可证"),
-    //开户许可证号
-    ACCOUNT(5, "开户许可证号"),
-    //授权证书
-    AUTHORIZE(6, "授权证书"),
-    //电子签章授权书
-    SIGNATURES(7, "电子签章授权书");
-
-    private final int code;
-
-    private final String name;
-
-    CertificateTypeEnum(int code, String name){
-        this.code = code;
-        this.name = name;
-    }
-
-    public static CertificateTypeEnum getName(int code){
-        for (CertificateTypeEnum certificateTypeEnum : values()) {
-            if (certificateTypeEnum.getCode() == code) {
-                return certificateTypeEnum;
-            }
-        }
-        return null;
-    }
-}

+ 0 - 37
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ChargingTypeEnum.java

@@ -1,37 +0,0 @@
-package com.sckw.core.model.enums;
-
-import lombok.Getter;
-
-/**
- * @author czh
- * @desc 计费方式枚举
- * @date 2023/7/14
- */
-@Getter
-public enum ChargingTypeEnum {
-
-    //装货量
-    ON(1, "装货量"),
-    //卸货量
-    OFF(2, "卸货量"),
-    //车次
-    CAR(3, "车次");
-
-    private final int code;
-
-    private final String name;
-
-    ChargingTypeEnum(int code, String name){
-        this.code = code;
-        this.name = name;
-    }
-
-    public static ChargingTypeEnum getName(int code){
-        for (ChargingTypeEnum chargingTypeEnum : values()) {
-            if (chargingTypeEnum.getCode() == code) {
-                return chargingTypeEnum;
-            }
-        }
-        return null;
-    }
-}

+ 0 - 59
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ClientTypeEnum.java

@@ -1,59 +0,0 @@
-package com.sckw.core.model.enums;
-
-import com.sckw.core.model.constant.Global;
-
-/**
- * @Description 客户端类型枚举
- * @Author dengyinghui
- * @Date 2019/4/16
- */
-public enum ClientTypeEnum {
-    //浏览器-官网
-    pc("浏览器", "pc"),
-    app("app", "app"),
-    //苹果设备
-    ios("苹果设备", "ios"),
-    //安卓设备
-    android("安卓设备",  "android"),
-    //移动设备
-    mobile("移动端", "mobile"),
-    //第三方API调用
-    api("API调用", "api"),
-    //所有终端
-    terminal("终端", "terminal");
-
-    private String name;
-
-    private String value;
-
-    private ClientTypeEnum(String name, String value){
-        this.name = name;
-        this.value = value;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-    public static int expireTime(String clientType) {
-        if (clientType.equals(pc.getValue())) {
-            return Global.PC_TOKEN_EXPIRE;
-        } else if (clientType.equals(ios.getValue()) || clientType.equals(android.getValue())) {
-            return Global.APP_TOKEN_EXPIRE;
-        } else {
-            return Global.COMMON_EXPIRE;
-        }
-    }
-}

+ 0 - 39
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ContractStatusEnum.java

@@ -1,39 +0,0 @@
-package com.sckw.core.model.enums;
-
-import lombok.Getter;
-
-/**
- * @author czh
- * @desc 合同状态
- * @date 2023/7/14
- */
-@Getter
-public enum ContractStatusEnum {
-    //已签约
-    SIGNED(0, "已签约"),
-    //已完结
-    COMPLETE(2, "已完结"),
-    //已保存
-    SAVE(3, "已保存"),
-    //签约中
-    SUBMIT(1, "待签约");
-
-    private final int code;
-
-    private final String name;
-
-    ContractStatusEnum(int code, String name) {
-        this.code = code;
-        this.name = name;
-    }
-
-    public static ContractStatusEnum getName(int code) {
-        for (ContractStatusEnum contractTrackEnum : values()) {
-            if (contractTrackEnum.getCode() == code) {
-                return contractTrackEnum;
-            }
-        }
-        return null;
-    }
-
-}

+ 0 - 38
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ContractTrackEnum.java

@@ -1,38 +0,0 @@
-package com.sckw.core.model.enums;
-
-import lombok.Getter;
-
-/**
- * @author czh
- * @desc 合同审批状态
- * @date 2023/7/14
- */
-@Getter
-public enum ContractTrackEnum {
-
-    //签约中
-    SIGNING(1, "发起签约"),
-    //已签约
-    SIGNED(0, "已签约"),
-    //已完结
-    OVER(2, "已完结");
-
-    private final int code;
-
-    private final String name;
-
-    ContractTrackEnum(int code, String name) {
-        this.code = code;
-        this.name = name;
-    }
-
-    public static ContractTrackEnum getName(int code) {
-        for (ContractTrackEnum contractTrackEnum : values()) {
-            if (contractTrackEnum.getCode() == code) {
-                return contractTrackEnum;
-            }
-        }
-        return null;
-    }
-
-}

+ 0 - 36
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CooperateApplyTypeEnum.java

@@ -1,36 +0,0 @@
-package com.sckw.core.model.enums;
-
-import lombok.Getter;
-
-/**
- * @author czh
- * @desc 合作单位申请类型枚举
- * @date 2023/6/15
- */
-@Getter
-public enum CooperateApplyTypeEnum {
-
-    //我方发起
-    US(1, "我方发起"),
-    //对方发起
-    TARGET(2, "对方发起");
-
-    private final int code;
-
-    private final String name;
-
-    CooperateApplyTypeEnum(int code, String name){
-        this.code = code;
-        this.name = name;
-    }
-
-    public static CooperateApplyTypeEnum getName(int code) {
-        for (CooperateApplyTypeEnum cooperateApplyTypeEnum : values()) {
-            if (cooperateApplyTypeEnum.getCode() == code) {
-                return cooperateApplyTypeEnum;
-            }
-        }
-        return null;
-    }
-
-}

+ 0 - 44
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CooperateStatusEnum.java

@@ -1,44 +0,0 @@
-package com.sckw.core.model.enums;
-
-import lombok.Getter;
-
-import java.util.Map;
-
-/**
- * @author czh
- * @desc 合作状态
- * @date 2023/6/15
- */
-@Getter
-public enum CooperateStatusEnum {
-
-    //审核中
-    PROCESS(0, "审核中"),
-    //合作中
-    OK(1, "合作中"),
-    //已解除
-    PASS(2, "已解除"),
-    //已拒绝
-    REFUSE(3, "已驳回"),
-    //已撤销
-    CANCEL(4, "已撤销");
-
-    private final int code;
-
-    private final String name;
-
-    CooperateStatusEnum(int code, String name) {
-        this.code = code;
-        this.name = name;
-    }
-
-    public static String getName(int code) {
-        for (CooperateStatusEnum cooperateStatusEnum : values()) {
-            if (cooperateStatusEnum.getCode() == code) {
-                return cooperateStatusEnum.getName();
-            }
-        }
-        return null;
-    }
-
-}

+ 0 - 40
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/CooperateTypeEnum.java

@@ -1,40 +0,0 @@
-package com.sckw.core.model.enums;
-
-import lombok.Getter;
-
-/**
- * @author czh
- * @desc 合作类型
- * @date 2023/6/15
- */
-@Getter
-public enum CooperateTypeEnum {
-
-    //供应商
-    SUPPLIER(1, "供应商"),
-    //采购商
-    PURCHASER(2, "采购商"),
-    //托运商
-    CONSIGN(3, "托运商"),
-    //承运商
-    CARRIAGE(4, "承运商");
-
-    private final int code;
-
-    private final String name;
-
-    CooperateTypeEnum(int code, String name){
-        this.code = code;
-        this.name = name;
-    }
-
-    public static CooperateTypeEnum getName(int code){
-        for (CooperateTypeEnum cooperateStatusEnum : values()) {
-            if (cooperateStatusEnum.getCode() == code) {
-                return cooperateStatusEnum;
-            }
-        }
-        return null;
-    }
-
-}

+ 1 - 1
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/DeviceEnum.java

@@ -27,7 +27,7 @@ public enum DeviceEnum {
     /**
      * 已基准
      */
-    ALREADY_REFERRED_TO(4, "5", "已基准"),
+    ALREADY_REFERRED_TO(4, "4", "已基准"),
     ;
 
     public Integer getCode() {

+ 0 - 84
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/EntTypeEnum.java

@@ -1,84 +0,0 @@
-package com.sckw.core.model.enums;
-
-import com.sckw.core.model.constant.Global;
-import com.sckw.core.utils.StringUtils;
-import lombok.Getter;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author czh
- * @desc 企业类型枚举
- * @date 2023/6/15
- */
-@Getter
-public enum EntTypeEnum {
-
-    //供应商
-    SUPPLIER(1, "供应商"),
-    //采购商
-    PURCHASER(2, "采购商"),
-    //4PL物流  托运 承运
-    LOGISTICS3(3, "4PL物流"),
-    //3PL物流  承运
-    LOGISTICS4(4, "3PL物流");
-
-    private final int code;
-
-    private final String name;
-
-    EntTypeEnum(int code, String name){
-        this.code = code;
-        this.name = name;
-    }
-
-    public static EntTypeEnum getName(int code) {
-        for (EntTypeEnum entTypeEnum : values()) {
-            if (entTypeEnum.getCode() == code) {
-                return entTypeEnum;
-            }
-        }
-        return null;
-    }
-
-    public static String getNames(String entTypes) {
-        List entNames = new ArrayList();
-        EntTypeEnum [] entTypeEnums = EntTypeEnum.values();
-        for (EntTypeEnum entTypeEnum:entTypeEnums) {
-            if (entTypes.contains(String.valueOf(entTypeEnum.getCode()))) {
-                entNames.add(entTypeEnum.getName());
-            }
-        }
-        return String.join(Global.COMMA, entNames);
-    }
-
-    /**
-     * @param entTypes 企业属性
-     * @desc 校验企业是否为托运单位(供应商、采购商、4P物流)
-     * @author zk
-     * @date 2023/10/7
-     **/
-    public static Boolean check(String entTypes) {
-        if (StringUtils.isBlank(entTypes)) {
-            return null;
-        }
-        return entTypes.contains(String.valueOf(EntTypeEnum.SUPPLIER.getCode()))
-                || entTypes.contains(String.valueOf(EntTypeEnum.PURCHASER.getCode()))
-                || entTypes.contains(String.valueOf(EntTypeEnum.LOGISTICS3.getCode()));
-    }
-
-    /**
-     * @param entTypes 企业属性
-     * @desc 校验企业是否为承运单位(4P物流、3P物流)
-     * @author zk
-     * @date 2023/10/7
-     **/
-    public static Boolean carrier(String entTypes) {
-        if (StringUtils.isBlank(entTypes)) {
-            return null;
-        }
-        return entTypes.contains(String.valueOf(EntTypeEnum.LOGISTICS3.getCode()))
-                || entTypes.contains(String.valueOf(EntTypeEnum.LOGISTICS4.getCode()));
-    }
-}

+ 0 - 35
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/EntryTypeEnum.java

@@ -1,35 +0,0 @@
-package com.sckw.core.model.enums;
-
-import lombok.Getter;
-
-/**
- * @author czh
- * @desc 企业入驻方式
- * @date 2023/6/15
- */
-@Getter
-public enum EntryTypeEnum {
-
-    //自主入驻
-    SELF(1, "自主入驻"),
-    //平台接入
-    PLATFORM(2, "平台接入");
-
-    private final int code;
-
-    private final String name;
-
-    EntryTypeEnum(int code, String name){
-        this.code = code;
-        this.name = name;
-    }
-
-    public static EntryTypeEnum getName(int code) {
-        for (EntryTypeEnum entryTypeEnum : values()) {
-            if (entryTypeEnum.getCode() == code) {
-                return entryTypeEnum;
-            }
-        }
-        return null;
-    }
-}

+ 5 - 5
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/FileDisposeLayoutEnum.java → slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/FileDisposeLayoutEnum.java

@@ -1,4 +1,4 @@
-package com.sckw.core.common.enums.enums;
+package com.sckw.core.model.enums;
 
 /**
  * @author lfdc
@@ -16,20 +16,20 @@ public enum FileDisposeLayoutEnum {
     /**
      * oss裁剪比例大小-左
      */
-    OSS_ABBREVIATE_LEFT(com.sckw.core.common.enums.enums.FileEnum.FILE_STORE_TYPE_OSS.getFileType(), "?x-oss-process=image/resize,m_lfit,h_", "OSS设置文件大小"),
+    OSS_ABBREVIATE_LEFT(FileEnum.FILE_STORE_TYPE_OSS.getFileType(), "?x-oss-process=image/resize,m_lfit,h_", "OSS设置文件大小"),
 
     /**
      * oss裁剪比例大小-右
      */
-    OSS_ABBREVIATE_RIGHT(com.sckw.core.common.enums.enums.FileEnum.FILE_STORE_TYPE_OSS.getFileType(), ",w_", "OSS设置文件大小"),
+    OSS_ABBREVIATE_RIGHT(FileEnum.FILE_STORE_TYPE_OSS.getFileType(), ",w_", "OSS设置文件大小"),
     /**
      * oss按照比例缩放
      */
-    OSS_LESSEN(com.sckw.core.common.enums.enums.FileEnum.FILE_STORE_TYPE_OSS.getFileType(), "?x-oss-process=image/resize,p_", "按百分比缩放"),
+    OSS_LESSEN(FileEnum.FILE_STORE_TYPE_OSS.getFileType(), "?x-oss-process=image/resize,p_", "按百分比缩放"),
     /**
      * 七牛云缩略图
      */
-    KODO_ABBREVIATE(com.sckw.core.common.enums.enums.FileEnum.FILE_STORE_TYPE_ALIYUN.getFileType(), "-indexthumb", "缩略图"),
+    KODO_ABBREVIATE(FileEnum.FILE_STORE_TYPE_ALIYUN.getFileType(), "-indexthumb", "缩略图"),
     ;
 
     private final String type;

+ 1 - 1
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/FileEnum.java → slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/FileEnum.java

@@ -1,4 +1,4 @@
-package com.sckw.core.common.enums.enums;
+package com.sckw.core.model.enums;
 /**
  * @author lfdc
  * @version 1.0

+ 0 - 64
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/GlobalTransactionalEnum.java

@@ -1,64 +0,0 @@
-package com.sckw.core.model.enums;
-
-import org.springframework.util.ObjectUtils;
-
-/**
- * @author lfdc
- * @version 1.0
- * @className GlobalTransactionalEnum
- * @description 全局事务枚举值
- * @company sckw
- * @date 2023-06-05 13:06:54
- */
-public enum GlobalTransactionalEnum {
-    /**
-     * 默认全局事务
-     */
-    DEFAULT_TX_GROUP(1, "default_tx_group"),
-    /**
-     * 对应系统服务全局事务
-     */
-    SCKW_SYSTEM_SEATA_SERVICE_GROUP(2, "sckw-system-seata-service-group"),
-    /**
-     * 对应报表服务全局事务
-     */
-    SCKW_REPORT_SEATA_SERVICE_GROUP(3, "sckw-report-seata-service-group"),
-    /**
-     * 对应运输服务全局事务
-     */
-    SCKW_TRANSPORT_SEATA_SERVICE_GROUP(4, "sckw-transport-seata-service-group"),
-    ;
-
-    private final Integer code;
-    private final String name;
-
-    GlobalTransactionalEnum(Integer code, String name) {
-        this.code = code;
-        this.name = name;
-    }
-    public Integer getCode() {
-        return code;
-    }
-    public String getName() {
-        return name;
-    }
-    public static String getValue(Integer code) {
-        for (GlobalTransactionalEnum ele : GlobalTransactionalEnum.values()) {
-            if (ele.getCode().equals(code)) {
-                return ele.getName();
-            }
-        }
-        return null;
-    }
-    String getGlobalTransactionalEnum(Integer code) {
-        if (ObjectUtils.isEmpty(code)) {
-            return null;
-        }
-        for (GlobalTransactionalEnum globalTransactionalEnum : GlobalTransactionalEnum.values()) {
-            if (globalTransactionalEnum.getCode().equals(code)) {
-                return globalTransactionalEnum.getName();
-            }
-        }
-        return null;
-    }
-}

+ 0 - 44
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/LoginMethodEnum.java

@@ -1,44 +0,0 @@
-package com.sckw.core.model.enums;
-
-/**
- * @Description 登录类型枚举
- * @Author zk
- * @Date 2020/06/15
- */
-public enum LoginMethodEnum {
-    ORDINARY(1, "账号密码登录"),
-    SMS(2,  "短信登录"),
-    ACCOUNT(3,  "账号登录");
-
-    private int value;
-
-    private String name;
-
-    /**
-     * @description 构造方法
-     * @author zk
-     * @date 2020/6/08 11:28
-     * @param value 键 name 值
-     * @return
-     **/
-    private LoginMethodEnum(int value, String name){
-        this.name = name;
-        this.value = value;
-    }
-
-    public int getValue() {
-        return value;
-    }
-
-    public void setValue(int value) {
-        this.value = value;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-}

+ 1 - 1
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/LogisticsOrderEnum.java

@@ -1,6 +1,6 @@
 package com.sckw.core.model.enums;
 
-import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.model.constant.NumberConstant;
 import lombok.Getter;
 
 import java.util.ArrayList;

+ 0 - 36
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/MenuTypeEnum.java

@@ -1,36 +0,0 @@
-package com.sckw.core.model.enums;
-
-import lombok.Getter;
-
-/**
- * @author czh
- * @desc 菜单类型
- * @date 2023/6/15
- */
-@Getter
-public enum MenuTypeEnum {
-
-    //菜单
-    DIRECTORY(1, "菜单"),
-    //通过
-    BUTTON(2, "按钮");
-
-    private final int code;
-
-    private final String name;
-
-    MenuTypeEnum(int code, String name){
-        this.code = code;
-        this.name = name;
-    }
-
-    public static MenuTypeEnum getName(int code){
-        for (MenuTypeEnum menuTypeEnum : values()) {
-            if (menuTypeEnum.getCode() == code) {
-                return menuTypeEnum;
-            }
-        }
-        return null;
-    }
-
-}

+ 1 - 1
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/ReportEnum.java → slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ReportEnum.java

@@ -1,4 +1,4 @@
-package com.sckw.core.common.enums;
+package com.sckw.core.model.enums;
 
 /**
  * @author lfdc

+ 22 - 5
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/ReportTypeEnum.java → slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ReportTypeEnum.java

@@ -1,4 +1,4 @@
-package com.sckw.core.common.enums;
+package com.sckw.core.model.enums;
 
 /**
  * @author lfdc
@@ -9,26 +9,43 @@ public enum ReportTypeEnum {
     /**
      * 日
      */
-    DAY(1, "1", "日报表"),
+    DAY(1, "1", "日报表", "每日0时"),
 
     /**
      * 周
      */
-    WEEK(2, "2", "周报表"),
+    WEEK(2, "2", "周报表", "每周一0时"),
 
     /**
      * 月
      */
-    MONTH(3, "3", "月报表");
+    MONTH(3, "3", "月报表", "每月1号0时");
 
     private final String status;
     private final Integer code;
     private final String description;
+    private final String value;
 
-    ReportTypeEnum(Integer code, String status, String description) {
+    public String getStatus() {
+        return status;
+    }
+    public String getValue() {
+        return value;
+    }
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    ReportTypeEnum(Integer code, String status, String description,String value) {
         this.code = code;
         this.status = status;
         this.description = description;
+        this.value = value;
     }
 
     public static String getDescription(Integer code) {

+ 0 - 35
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/SigningWayEnum.java

@@ -1,35 +0,0 @@
-package com.sckw.core.model.enums;
-
-import lombok.Getter;
-
-/**
- * @author czh
- * @desc 签约方式
- * @date 2023/7/14
- */
-@Getter
-public enum SigningWayEnum {
-
-    //线上签约
-    ONLINE(1, "线上签约"),
-    //线下签约
-    OFFLINE(2, "线下签约");
-
-    private final int code;
-
-    private final String name;
-
-    SigningWayEnum(int code, String name){
-        this.code = code;
-        this.name = name;
-    }
-
-    public static SigningWayEnum getName(int code){
-        for (SigningWayEnum signingWayEnum : values()) {
-            if (signingWayEnum.getCode() == code) {
-                return signingWayEnum;
-            }
-        }
-        return null;
-    }
-}

+ 0 - 36
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/SystemTypeEnum.java

@@ -1,36 +0,0 @@
-package com.sckw.core.model.enums;
-
-import lombok.Getter;
-
-/**
- * @author czh
- * @desc 系统类型枚举
- * @date 2023/6/15
- */
-@Getter
-public enum SystemTypeEnum {
-    //运营端
-    MANAGE(1, "运营端"),
-    //企业开户
-    COMPANY(2, "企业端"),
-    //司机
-    DRIVER(3, "司机端");
-
-    private final Integer code;
-
-    private final String name;
-
-    SystemTypeEnum(Integer code, String name){
-        this.code = code;
-        this.name = name;
-    }
-
-    public static SystemTypeEnum getName(Integer code){
-        for (SystemTypeEnum systemTypeEnum : values()) {
-            if (systemTypeEnum.getCode().equals(code)) {
-                return systemTypeEnum;
-            }
-        }
-        return null;
-    }
-}

+ 0 - 2
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/TaxRateTypeEnum.java

@@ -1,7 +1,5 @@
 package com.sckw.core.model.enums;
 
-import lombok.Data;
-
 /**
  * desc 合理损耗单位
  * author zk

+ 1 - 1
slope-common/slope-common-core/src/main/java/com/sckw/core/utils/OrderGenerateSeqNoUtils.java

@@ -1,6 +1,6 @@
 package com.sckw.core.utils;
 
-import com.sckw.core.common.enums.StringConstant;
+import com.sckw.core.model.constant.StringConstant;
 import com.sckw.core.model.enums.OrderRuleEnum;
 import com.sckw.core.model.enums.RedisOrderGenerateEnum;
 import com.sckw.redis.utils.RedissonUtils;

+ 1 - 1
slope-common/slope-common-core/src/main/java/com/sckw/core/web/constant/HttpStatus.java

@@ -47,7 +47,7 @@ public class HttpStatus {
     public static final String ADDRESS_EXISTS = "地点已存在,不可重复!";
 
     /**其他自定义状态码*/
-    public static final int CODE_60603 = 60603;
+    public static final int CODE_60603 = 603;
     public static final String ENTCERTIFICATES_INVAILD = "您的企业资质已失效,暂没有权限访问,请尽快更新资质";
     public static final String ENTCERTIFICATES_NOT_REGISTER = "您未做企业资质认证,暂没有权限访问";
     public static final String ENTCERTIFICATES_NOT_PASS = "您的企业资质认证还在审核中,暂没有权限访问";

+ 1 - 1
slope-common/slope-common-excel/src/main/java/com/sckw/excel/config/easyexcel/CustomCellWeightWeightConfig.java

@@ -6,8 +6,8 @@ import com.alibaba.excel.metadata.data.CellData;
 import com.alibaba.excel.metadata.data.WriteCellData;
 import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
 import com.alibaba.excel.write.style.column.AbstractColumnWidthStyleStrategy;
-import com.sckw.core.common.enums.NumberConstant;
 import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.constant.NumberConstant;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.CellType;
 import org.apache.poi.ss.usermodel.Sheet;

+ 1 - 1
slope-common/slope-common-excel/src/main/java/com/sckw/excel/config/easyexcel/ExcelConverter.java

@@ -5,7 +5,7 @@ import com.alibaba.excel.enums.CellDataTypeEnum;
 import com.alibaba.excel.metadata.GlobalConfiguration;
 import com.alibaba.excel.metadata.data.WriteCellData;
 import com.alibaba.excel.metadata.property.ExcelContentProperty;
-import com.sckw.core.common.enums.NumberConstant;
+import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.excel.annotation.EasyExcel;
 import lombok.extern.slf4j.Slf4j;
 

+ 1 - 1
slope-common/slope-common-excel/src/main/java/com/sckw/excel/utils/ExcelUtil.java

@@ -6,8 +6,8 @@ import com.alibaba.excel.annotation.ExcelProperty;
 import com.alibaba.excel.write.metadata.WriteSheet;
 import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
 import com.alibaba.fastjson.JSONObject;
-import com.sckw.core.common.enums.NumberConstant;
 import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.annotation.ExcelContext;
 import com.sckw.excel.annotation.ExcelSelected;

+ 19 - 0
slope-modules/slope-detection/pom.xml

@@ -67,4 +67,23 @@
             <artifactId>spring-web</artifactId>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <mainClass>com.sckw.slope.detection.SlopeDetectionApplication</mainClass>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>

+ 39 - 39
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/common/config/MqSendMessageGateWay.java

@@ -1,39 +1,39 @@
-package com.sckw.slope.detection.common.config;
-
-import org.springframework.integration.annotation.MessagingGateway;
-import org.springframework.integration.mqtt.support.MqttHeaders;
-import org.springframework.messaging.handler.annotation.Header;
-import org.springframework.stereotype.Component;
-
-/**
- * @author lfdc
- * @description
- * @date 2023-10-26 11:10:01
- */
-@Component
-@MessagingGateway(defaultRequestChannel = MqttConfig.CHANNEL_NAME_OUT)
-public interface MqSendMessageGateWay {
-    /**
-     * 默认的消息机制
-     *
-     * @param data
-     */
-    void sendToMqtt(String data);
-
-    /**
-     * 发送消息 向mqtt指定topic发送消息
-     *
-     * @param topic
-     * @param payload
-     */
-    void sendToMqtt(@Header(MqttHeaders.TOPIC) String topic, String payload);
-
-    /**
-     * 发送消息 向mqtt指定topic发送消息
-     *
-     * @param topic 主题
-     * @param qos   机制
-     * @param payload   消息
-     */
-    void sendToMqtt(@Header(MqttHeaders.TOPIC) String topic, @Header(MqttHeaders.QOS) int qos, String payload);
-}
+//package com.sckw.slope.detection.common.config;
+//
+//import org.springframework.integration.annotation.MessagingGateway;
+//import org.springframework.integration.mqtt.support.MqttHeaders;
+//import org.springframework.messaging.handler.annotation.Header;
+//import org.springframework.stereotype.Component;
+//
+///**
+// * @author lfdc
+// * @description
+// * @date 2023-10-26 11:10:01
+// */
+//@Component
+//@MessagingGateway(defaultRequestChannel = MqttConfig.CHANNEL_NAME_OUT)
+//public interface MqSendMessageGateWay {
+//    /**
+//     * 默认的消息机制
+//     *
+//     * @param data
+//     */
+//    void sendToMqtt(String data);
+//
+//    /**
+//     * 发送消息 向mqtt指定topic发送消息
+//     *
+//     * @param topic
+//     * @param payload
+//     */
+//    void sendToMqtt(@Header(MqttHeaders.TOPIC) String topic, String payload);
+//
+//    /**
+//     * 发送消息 向mqtt指定topic发送消息
+//     *
+//     * @param topic 主题
+//     * @param qos   机制
+//     * @param payload   消息
+//     */
+//    void sendToMqtt(@Header(MqttHeaders.TOPIC) String topic, @Header(MqttHeaders.QOS) int qos, String payload);
+//}

+ 207 - 207
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/common/config/MqttConfig.java

@@ -1,207 +1,207 @@
-package com.sckw.slope.detection.common.config;
-
-import com.sckw.slope.detection.consumer.MqttCallbackHandler;
-import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.integration.annotation.ServiceActivator;
-import org.springframework.integration.channel.DirectChannel;
-import org.springframework.integration.core.MessageProducer;
-import org.springframework.integration.mqtt.core.DefaultMqttPahoClientFactory;
-import org.springframework.integration.mqtt.core.MqttPahoClientFactory;
-import org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter;
-import org.springframework.integration.mqtt.outbound.MqttPahoMessageHandler;
-import org.springframework.integration.mqtt.support.DefaultPahoMessageConverter;
-import org.springframework.messaging.MessageChannel;
-import org.springframework.messaging.MessageHandler;
-
-/**
- * @author lfdc
- * @description MQTT配置,生产者
- * @date 2023-10-26 10:10:59
- */
-@Configuration
-public class MqttConfig {
-
-    private static final byte[] WILL_DATA;
-
-    static {
-        WILL_DATA = "offline".getBytes();
-    }
-
-    /**
-     * mqtt订阅者使用信道名称
-     */
-    public static final String CHANNEL_NAME_IN = "mqttInboundChannel";
-    /**
-     * mqtt发布者信道名称
-     */
-    public static final String CHANNEL_NAME_OUT = "mqttOutboundChannel";
-    /**
-     * mqtt发送者用户名
-     */
-    @Value("${mqtt.send.username}")
-    private String username;
-
-    /**
-     * mqtt发送者密码
-     */
-    @Value("${mqtt.send.password}")
-    private String password;
-
-    /**
-     * mqtt发送者url
-     */
-    @Value("${mqtt.send.url}")
-    private String hostUrl;
-    /**
-     * mqtt发送者客户端id
-     */
-    @Value("${mqtt.send.clientId}")
-    private String clientId;
-    /**
-     * mqtt发送者主题
-     */
-    @Value("${mqtt.send.topic}")
-    private String msgTopic;
-
-    /**
-     * mqtt发送者主题
-     */
-    @Value("${mqtt.receive.topic}")
-    private String msgReceiveTopic;
-
-    /**
-     * mqtt发送者超时时间
-     */
-    @Value("${mqtt.send.completionTimeout}")
-    private int completionTimeout;
-
-    @Value("${mqtt.send.keepAliveInterval}")
-    private int keepAliveInterval;
-
-    @Value("${mqtt.send.connectionTimeout}")
-    private int connectionTimeout;
-
-    @Autowired
-    private MqttCallbackHandler mqttCallbackHandler;
-
-
-    /**
-     * 新建MqttConnectionOptionsBean  MQTT连接器选项
-     * @return
-     */
-    @Bean
-    public MqttConnectOptions getSenderMqttConnectOptions() {
-        MqttConnectOptions options = new MqttConnectOptions();
-        // 设置连接的用户名
-        if (!username.trim().equals("")) {
-            //将用户名去掉前后空格
-            options.setUserName(username);
-        }
-        // 设置连接的密码
-        options.setPassword(password.toCharArray());
-        // 转化连接的url地址
-        String[] uris = {hostUrl};
-        // 设置连接的地址
-        options.setServerURIs(uris);
-        // 设置超时时间 单位为秒
-        options.setConnectionTimeout(completionTimeout);
-        // 设置会话心跳时间 单位为秒 服务器会每隔1.5*20秒的时间向客户端发送心跳判断客户端是否在线
-        // 但这个方法并没有重连的机制
-        options.setKeepAliveInterval(keepAliveInterval);
-        // 设置“遗嘱”消息的话题,若客户端与服务器之间的连接意外中断,服务器将发布客户端的“遗嘱”消息。
-        //设置超时时间
-        options.setConnectionTimeout(connectionTimeout);
-        options.setCleanSession(true);
-        options.setAutomaticReconnect(true);
-        return options;
-    }
-
-    /**
-     * 创建MqttPathClientFactoryBean
-     */
-    @Bean
-    public MqttPahoClientFactory senderMqttClientFactory() {
-        //创建mqtt客户端工厂
-        DefaultMqttPahoClientFactory factory = new DefaultMqttPahoClientFactory();
-        //设置mqtt的连接设置
-        factory.setConnectionOptions(getSenderMqttConnectOptions());
-        return factory;
-    }
-
-    /**
-     * 发布者-MQTT信息通道(生产者)
-     */
-    @Bean(name = CHANNEL_NAME_OUT)
-    public MessageChannel mqttOutboundChannel() {
-        return new DirectChannel();
-    }
-
-
-    /**
-     * 发布者-MQTT消息处理器(生产者)  将channel绑定到MqttClientFactory上
-     *
-     * @return {@link org.springframework.messaging.MessageHandler}
-     */
-    @Bean
-    @ServiceActivator(inputChannel = CHANNEL_NAME_OUT)
-    public MessageHandler mqttOutbound() {
-        //创建消息处理器
-        MqttPahoMessageHandler messageHandler = new MqttPahoMessageHandler(
-                clientId + "_pub",
-                senderMqttClientFactory());
-        //设置消息处理类型为异步
-        messageHandler.setAsync(true);
-        //设置消息的默认主题
-        messageHandler.setDefaultTopic(msgTopic);
-        messageHandler.setDefaultRetained(false);
-        //1.重新连接MQTT服务时,不需要接收该主题最新消息,设置retained为false;
-        //2.重新连接MQTT服务时,需要接收该主题最新消息,设置retained为true;
-        return messageHandler;
-    }
-
-
-    /************                             消费者,订阅者的消费信息                               *****/
-
-    /**
-     * MQTT信息通道(消费者)
-     */
-    @Bean(name = CHANNEL_NAME_IN)
-    public MessageChannel mqttInboundChannel() {
-        return new DirectChannel();
-    }
-
-    /**
-     * MQTT消息订阅绑定(消费者)
-     */
-    @Bean
-    public MessageProducer inbound() {
-//        System.out.println("topics:" + msgTopic);
-        // 可以同时消费(订阅)多个Topic
-        MqttPahoMessageDrivenChannelAdapter adapter =
-                new MqttPahoMessageDrivenChannelAdapter(
-                        clientId + "_sub", senderMqttClientFactory(), msgReceiveTopic.split(","));
-        adapter.setCompletionTimeout(5000);
-        adapter.setConverter(new DefaultPahoMessageConverter());
-        adapter.setQos(0);
-        // 设置订阅通道
-        adapter.setOutputChannel(mqttInboundChannel());
-        return adapter;
-    }
-
-    /**
-     * MQTT消息处理器(消费者)
-     */
-    @Bean
-    @ServiceActivator(inputChannel = CHANNEL_NAME_IN)
-    public MessageHandler handler() {
-        return message -> {
-            String topic = message.getHeaders().get("mqtt_receivedTopic").toString();
-            String payload = message.getPayload().toString();
-            mqttCallbackHandler.handle(topic, payload);
-        };
-    }
-}
+//package com.sckw.slope.detection.common.config;
+//
+//import com.sckw.slope.detection.consumer.MqttCallbackHandler;
+//import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//import org.springframework.integration.annotation.ServiceActivator;
+//import org.springframework.integration.channel.DirectChannel;
+//import org.springframework.integration.core.MessageProducer;
+//import org.springframework.integration.mqtt.core.DefaultMqttPahoClientFactory;
+//import org.springframework.integration.mqtt.core.MqttPahoClientFactory;
+//import org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter;
+//import org.springframework.integration.mqtt.outbound.MqttPahoMessageHandler;
+//import org.springframework.integration.mqtt.support.DefaultPahoMessageConverter;
+//import org.springframework.messaging.MessageChannel;
+//import org.springframework.messaging.MessageHandler;
+//
+///**
+// * @author lfdc
+// * @description MQTT配置,生产者
+// * @date 2023-10-26 10:10:59
+// */
+//@Configuration
+//public class MqttConfig {
+//
+//    private static final byte[] WILL_DATA;
+//
+//    static {
+//        WILL_DATA = "offline".getBytes();
+//    }
+//
+//    /**
+//     * mqtt订阅者使用信道名称
+//     */
+//    public static final String CHANNEL_NAME_IN = "mqttInboundChannel";
+//    /**
+//     * mqtt发布者信道名称
+//     */
+//    public static final String CHANNEL_NAME_OUT = "mqttOutboundChannel";
+//    /**
+//     * mqtt发送者用户名
+//     */
+//    @Value("${mqtt.send.username}")
+//    private String username;
+//
+//    /**
+//     * mqtt发送者密码
+//     */
+//    @Value("${mqtt.send.password}")
+//    private String password;
+//
+//    /**
+//     * mqtt发送者url
+//     */
+//    @Value("${mqtt.send.url}")
+//    private String hostUrl;
+//    /**
+//     * mqtt发送者客户端id
+//     */
+//    @Value("${mqtt.send.clientId}")
+//    private String clientId;
+//    /**
+//     * mqtt发送者主题
+//     */
+//    @Value("${mqtt.send.topic}")
+//    private String msgTopic;
+//
+//    /**
+//     * mqtt发送者主题
+//     */
+//    @Value("${mqtt.receive.topic}")
+//    private String msgReceiveTopic;
+//
+//    /**
+//     * mqtt发送者超时时间
+//     */
+//    @Value("${mqtt.send.completionTimeout}")
+//    private int completionTimeout;
+//
+//    @Value("${mqtt.send.keepAliveInterval}")
+//    private int keepAliveInterval;
+//
+//    @Value("${mqtt.send.connectionTimeout}")
+//    private int connectionTimeout;
+//
+//    @Autowired
+//    private MqttCallbackHandler mqttCallbackHandler;
+//
+//
+//    /**
+//     * 新建MqttConnectionOptionsBean  MQTT连接器选项
+//     * @return
+//     */
+//    @Bean
+//    public MqttConnectOptions getSenderMqttConnectOptions() {
+//        MqttConnectOptions options = new MqttConnectOptions();
+//        // 设置连接的用户名
+//        if (!username.trim().equals("")) {
+//            //将用户名去掉前后空格
+//            options.setUserName(username);
+//        }
+//        // 设置连接的密码
+//        options.setPassword(password.toCharArray());
+//        // 转化连接的url地址
+//        String[] uris = {hostUrl};
+//        // 设置连接的地址
+//        options.setServerURIs(uris);
+//        // 设置超时时间 单位为秒
+//        options.setConnectionTimeout(completionTimeout);
+//        // 设置会话心跳时间 单位为秒 服务器会每隔1.5*20秒的时间向客户端发送心跳判断客户端是否在线
+//        // 但这个方法并没有重连的机制
+//        options.setKeepAliveInterval(keepAliveInterval);
+//        // 设置“遗嘱”消息的话题,若客户端与服务器之间的连接意外中断,服务器将发布客户端的“遗嘱”消息。
+//        //设置超时时间
+//        options.setConnectionTimeout(connectionTimeout);
+//        options.setCleanSession(true);
+//        options.setAutomaticReconnect(true);
+//        return options;
+//    }
+//
+//    /**
+//     * 创建MqttPathClientFactoryBean
+//     */
+//    @Bean
+//    public MqttPahoClientFactory senderMqttClientFactory() {
+//        //创建mqtt客户端工厂
+//        DefaultMqttPahoClientFactory factory = new DefaultMqttPahoClientFactory();
+//        //设置mqtt的连接设置
+//        factory.setConnectionOptions(getSenderMqttConnectOptions());
+//        return factory;
+//    }
+//
+//    /**
+//     * 发布者-MQTT信息通道(生产者)
+//     */
+//    @Bean(name = CHANNEL_NAME_OUT)
+//    public MessageChannel mqttOutboundChannel() {
+//        return new DirectChannel();
+//    }
+//
+//
+//    /**
+//     * 发布者-MQTT消息处理器(生产者)  将channel绑定到MqttClientFactory上
+//     *
+//     * @return {@link org.springframework.messaging.MessageHandler}
+//     */
+//    @Bean
+//    @ServiceActivator(inputChannel = CHANNEL_NAME_OUT)
+//    public MessageHandler mqttOutbound() {
+//        //创建消息处理器
+//        MqttPahoMessageHandler messageHandler = new MqttPahoMessageHandler(
+//                clientId + "_pub",
+//                senderMqttClientFactory());
+//        //设置消息处理类型为异步
+//        messageHandler.setAsync(true);
+//        //设置消息的默认主题
+//        messageHandler.setDefaultTopic(msgTopic);
+//        messageHandler.setDefaultRetained(false);
+//        //1.重新连接MQTT服务时,不需要接收该主题最新消息,设置retained为false;
+//        //2.重新连接MQTT服务时,需要接收该主题最新消息,设置retained为true;
+//        return messageHandler;
+//    }
+//
+//
+//    /************                             消费者,订阅者的消费信息                               *****/
+//
+//    /**
+//     * MQTT信息通道(消费者)
+//     */
+//    @Bean(name = CHANNEL_NAME_IN)
+//    public MessageChannel mqttInboundChannel() {
+//        return new DirectChannel();
+//    }
+//
+//    /**
+//     * MQTT消息订阅绑定(消费者)
+//     */
+//    @Bean
+//    public MessageProducer inbound() {
+////        System.out.println("topics:" + msgTopic);
+//        // 可以同时消费(订阅)多个Topic
+//        MqttPahoMessageDrivenChannelAdapter adapter =
+//                new MqttPahoMessageDrivenChannelAdapter(
+//                        clientId + "_sub", senderMqttClientFactory(), msgReceiveTopic.split(","));
+//        adapter.setCompletionTimeout(5000);
+//        adapter.setConverter(new DefaultPahoMessageConverter());
+//        adapter.setQos(0);
+//        // 设置订阅通道
+//        adapter.setOutputChannel(mqttInboundChannel());
+//        return adapter;
+//    }
+//
+//    /**
+//     * MQTT消息处理器(消费者)
+//     */
+//    @Bean
+//    @ServiceActivator(inputChannel = CHANNEL_NAME_IN)
+//    public MessageHandler handler() {
+//        return message -> {
+//            String topic = message.getHeaders().get("mqtt_receivedTopic").toString();
+//            String payload = message.getPayload().toString();
+//            mqttCallbackHandler.handle(topic, payload);
+//        };
+//    }
+//}

+ 29 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/CommonController.java

@@ -0,0 +1,29 @@
+package com.sckw.slope.detection.controller;
+
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.slope.detection.model.vo.QueryDictTypePageReqVo;
+import com.sckw.slope.detection.service.CommonService;
+import jakarta.validation.Valid;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author lfdc
+ * @description 公共字典查询
+ * @date 2023-11-02 17:11:09
+ */
+@RestController
+@RequestMapping("/common")
+public class CommonController {
+
+    @Autowired
+    CommonService commonService;
+
+    @RequestMapping(value = "/getDict",method = RequestMethod.POST)
+    public HttpResult getDict(@RequestBody @Valid QueryDictTypePageReqVo queryDictTypePageReqVo){
+        return  HttpResult.ok(commonService.getDict(queryDictTypePageReqVo));
+    }
+}

+ 15 - 3
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/DeviceController.java

@@ -1,5 +1,6 @@
 package com.sckw.slope.detection.controller;
 
+import com.alibaba.fastjson2.JSONObject;
 import com.sckw.core.annotation.Log;
 import com.sckw.core.annotation.RepeatSubmit;
 import com.sckw.core.web.response.HttpResult;
@@ -7,6 +8,10 @@ import com.sckw.slope.detection.model.param.DeviceAdd;
 import com.sckw.slope.detection.model.param.DeviceQuery;
 import com.sckw.slope.detection.service.DeviceService;
 import jakarta.servlet.http.HttpServletRequest;
+import com.sckw.slope.detection.model.dto.DeviceLocationDTO;
+import com.sckw.slope.detection.service.DeviceService;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.validation.Valid;
 import jakarta.validation.constraints.NotBlank;
 import jakarta.validation.constraints.NotNull;
 import lombok.extern.slf4j.Slf4j;
@@ -15,7 +20,7 @@ import org.springframework.web.bind.annotation.*;
 import com.alibaba.fastjson2.JSONObject;
 import jakarta.validation.Valid;
 import org.apache.http.HttpResponse;
-
+import java.util.List;
 
 /**
  * @author lfdc
@@ -32,14 +37,14 @@ public class DeviceController {
 
     @Log(description = "设备删除")
     @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
-    @RequestMapping(name = "设备删除", value = "/dels", method = RequestMethod.DELETE)
+    @RequestMapping(name = "设备删除", value = "/dels", method = RequestMethod.GET)
     public HttpResult dels(@RequestParam("ids") @NotBlank(message = "设备id不能为空") String ids) {
         log.info("设备删除 delete param:{}", ids);
         return deviceService.dels(ids);
     }
 
     @Log(description = "所属设备查询")
-    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RequestMapping(name = "所属设备查询", value = "/deviceAll", method = RequestMethod.GET)
     public HttpResult deviceAll(@RequestParam("projectId") String projectId) {
         log.info("所属设备查询 deviceAll param :{}",projectId);
@@ -69,4 +74,11 @@ public class DeviceController {
         log.info("设备 detail param:{}", id);
         return deviceService.detail(id, response);
     }
+    @Log(description = "设备位置配置")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    @RequestMapping(name = "设备位置配置", value = "/locationSet", method = RequestMethod.POST)
+    public HttpResult locationSet(@RequestBody @Valid List<DeviceLocationDTO> list, HttpServletRequest request) {
+        log.info("设备位置配置 locationSet param :{}", JSONObject.toJSONString(list));
+        return deviceService.locationSet(list,request);
+    }
 }

+ 49 - 49
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/MqttController.java

@@ -1,49 +1,49 @@
-package com.sckw.slope.detection.controller;
-
-import com.sckw.slope.detection.common.config.MqSendMessageGateWay;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @author lfdc
- * @description
- * @date 2023-10-25 17:10:36
- */
-@RestController
-@RequestMapping("/sun/mqtt")
-public class MqttController {
-
-    @Autowired
-    private MqSendMessageGateWay mqSendMessageGateWay;
-
-    @RequestMapping("/send")
-    @ResponseBody
-    private ResponseEntity<String> send() {
-        String data = "我是springboot发送的数据";
-        System.out.println(data);
-        mqSendMessageGateWay.sendToMqtt(data);
-        return new ResponseEntity<>("OK", HttpStatus.OK);
-    }
-
-
-
-    /**
-     * 动态增加主题
-     *
-     * @param
-     * @param
-     */
-    @ResponseBody
-    @RequestMapping("/sendToTopic")
-    private ResponseEntity<String> sendToTopic() {
-        String topic = "sharjeck/ai/test/out";
-        String data = "这是出的主题";
-        System.out.println(data);
-        mqSendMessageGateWay.sendToMqtt(topic, data);
-        return new ResponseEntity<>("OK", HttpStatus.OK);
-    }
-}
+//package com.sckw.slope.detection.controller;
+//
+//import com.sckw.slope.detection.common.config.MqSendMessageGateWay;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.http.HttpStatus;
+//import org.springframework.http.ResponseEntity;
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import org.springframework.web.bind.annotation.ResponseBody;
+//import org.springframework.web.bind.annotation.RestController;
+//
+///**
+// * @author lfdc
+// * @description
+// * @date 2023-10-25 17:10:36
+// */
+//@RestController
+//@RequestMapping("/sun/mqtt")
+//public class MqttController {
+//
+//    @Autowired
+//    private MqSendMessageGateWay mqSendMessageGateWay;
+//
+//    @RequestMapping("/send")
+//    @ResponseBody
+//    private ResponseEntity<String> send() {
+//        String data = "我是springboot发送的数据";
+//        System.out.println(data);
+//        mqSendMessageGateWay.sendToMqtt(data);
+//        return new ResponseEntity<>("OK", HttpStatus.OK);
+//    }
+//
+//
+//
+//    /**
+//     * 动态增加主题
+//     *
+//     * @param
+//     * @param
+//     */
+//    @ResponseBody
+//    @RequestMapping("/sendToTopic")
+//    private ResponseEntity<String> sendToTopic() {
+//        String topic = "sharjeck/ai/test/out";
+//        String data = "这是出的主题";
+//        System.out.println(data);
+//        mqSendMessageGateWay.sendToMqtt(topic, data);
+//        return new ResponseEntity<>("OK", HttpStatus.OK);
+//    }
+//}

+ 26 - 11
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/ProjectController.java

@@ -2,7 +2,6 @@ package com.sckw.slope.detection.controller;
 
 import com.alibaba.fastjson2.JSONObject;
 import com.sckw.core.annotation.Log;
-import com.sckw.core.annotation.RepeatSubmit;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.slope.detection.model.dto.BindDevice;
 import com.sckw.slope.detection.model.dto.ProjectAddDTO;
@@ -31,15 +30,15 @@ public class ProjectController {
     ProjectService projectService;
 
     @Log(description = "项目查询-分页")
-    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RequestMapping(name = "项目查询-分页", value = "/select", method = RequestMethod.POST)
     public HttpResult select(@Valid @RequestBody ProjectQuery projectQueryDto, HttpServletRequest response) {
-        log.info("项目新增 select param:{}", JSONObject.toJSONString(projectQueryDto));
+        log.info("项目查询-分页 select param:{}", JSONObject.toJSONString(projectQueryDto));
         return HttpResult.ok(projectService.select(projectQueryDto, response));
     }
 
     @Log(description = "项目新增")
-    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RequestMapping(name = "项目新增", value = "/add", method = RequestMethod.POST)
     public HttpResult projectAdd(@Valid @RequestBody ProjectAddDTO projectAddDto, HttpServletRequest response) {
         log.info("项目新增 add param:{}", JSONObject.toJSONString(projectAddDto));
@@ -47,7 +46,7 @@ public class ProjectController {
     }
 
     @Log(description = "项目详情")
-    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RequestMapping(name = "项目详情", value = "/detail", method = RequestMethod.GET)
     public HttpResult detail(@RequestParam("id") @NotBlank(message = "数据id不能为空") String id, HttpServletRequest response) {
         log.info("项目详情 detail param:{}", id);
@@ -55,7 +54,7 @@ public class ProjectController {
     }
 
     @Log(description = "项目编辑")
-    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RequestMapping(name = "项目编辑", value = "/update", method = RequestMethod.POST)
     public HttpResult update(@Valid @RequestBody ProjectUpdateDTO projectAddDto, HttpServletRequest response) {
         log.info("项目编辑 update param:{}", JSONObject.toJSONString(projectAddDto));
@@ -63,15 +62,15 @@ public class ProjectController {
     }
 
     @Log(description = "项目删除")
-    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
-    @RequestMapping(name = "项目删除", value = "/dels", method = RequestMethod.DELETE)
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    @RequestMapping(name = "项目删除", value = "/dels", method = RequestMethod.GET)
     public HttpResult dels(@RequestParam("ids") @NotBlank(message = "数据id不能为空") String ids, HttpServletRequest request) {
         log.info("项目删除 delete param:{}", ids);
         return projectService.dels(ids, request);
     }
 
     @Log(description = "项目监测要素项")
-    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RequestMapping(name = "项目监测要素项", value = "/monitorItem", method = RequestMethod.GET)
     public HttpResult monitorItem(@RequestParam("id") @NotBlank(message = "数据id不能为空") String id, HttpServletRequest request) {
         log.info("项目监测要素项 select param:{}", id);
@@ -79,18 +78,34 @@ public class ProjectController {
     }
 
     @Log(description = "设备组网查询")
-    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RequestMapping(name = "设备组网查询", value = "/selectDevice", method = RequestMethod.POST)
     public HttpResult selectDevice(@RequestBody @Valid  DeviceQuery deviceQuery) {
         log.info("设备组网查询 select param:{}", JSONObject.toJSONString(deviceQuery));
         return HttpResult.ok(projectService.selectDevice(deviceQuery));
     }
 
+    @Log(description = "新增组网设备-关联设备-查询")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    @RequestMapping(name = "新增组网设备-关联设备-查询", value = "/deviceBindSelect", method = RequestMethod.POST)
+    public HttpResult deviceBindSelect(@RequestBody @Valid DeviceQuery bindDevice, HttpServletRequest request) {
+        log.info("新增组网设备-关联设备-查询 deviceBindSelect param:{}", JSONObject.toJSONString(bindDevice));
+        return HttpResult.ok(projectService.deviceBindSelect(bindDevice, request));
+    }
+
     @Log(description = "新增组网设备-关联设备")
-    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RequestMapping(name = "新增组网设备-关联设备", value = "/deviceBind", method = RequestMethod.POST)
     public HttpResult deviceBind(@RequestBody @Valid BindDevice bindDevice, HttpServletRequest request) {
         log.info("新增组网设备-关联设备 deviceBind param:{}", JSONObject.toJSONString(bindDevice));
         return projectService.deviceBind(bindDevice, request);
     }
+
+    @Log(description = "项目设备查询")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    @RequestMapping(name = "项目设备查询", value = "/deviceFind", method = RequestMethod.POST)
+    public HttpResult deviceFind(@RequestBody @Valid DeviceQuery deviceQuery, HttpServletRequest request) {
+        log.info("项目设备查询 deviceFind param:{}", JSONObject.toJSONString(deviceQuery));
+        return projectService.deviceFind(deviceQuery, request);
+    }
 }

+ 10 - 3
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/ReportController.java

@@ -2,7 +2,6 @@ package com.sckw.slope.detection.controller;
 
 import com.alibaba.fastjson2.JSONObject;
 import com.sckw.core.annotation.Log;
-import com.sckw.core.annotation.RepeatSubmit;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.slope.detection.model.param.StatementQuery;
 import com.sckw.slope.detection.service.ReportService;
@@ -27,7 +26,7 @@ public class ReportController {
     ReportService reportService;
 
     @Log(description = "报表查询")
-    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RequestMapping(name = "报表查询", value = "/select", method = RequestMethod.POST)
     public HttpResult select(@RequestBody @Valid StatementQuery query, HttpServletRequest request) {
         log.info("报表查询 select param:{}", JSONObject.toJSONString(query));
@@ -35,10 +34,18 @@ public class ReportController {
     }
 
     @Log(description = "模版详情")
-    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RequestMapping(name = "模版详情", value = "/detail", method = RequestMethod.GET)
     public HttpResult detail(@RequestParam("id") @NotBlank(message = "id不能为空") String id, HttpServletRequest request) {
         log.info("模版详情 detail param:{}", id);
         return reportService.detail(id, request);
     }
+
+    @Log(description = "报表删除")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    @RequestMapping(name = "报表删除", value = "/dels", method = RequestMethod.GET)
+    public HttpResult dels(@RequestParam("id") @NotBlank(message = "id不能为空") String id, HttpServletRequest request) {
+        log.info("报表删除 dels param:{}", id);
+        return reportService.dels(id, request);
+    }
 }

+ 61 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/ReportTemplateController.java

@@ -0,0 +1,61 @@
+package com.sckw.slope.detection.controller;
+
+import com.alibaba.fastjson2.JSONObject;
+import com.sckw.core.annotation.Log;
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.slope.detection.model.dto.IsEnableDTO;
+import com.sckw.slope.detection.model.dto.ReportTemplateAddDTO;
+import com.sckw.slope.detection.model.dto.ReportTemplateUpdateDTO;
+import com.sckw.slope.detection.service.ReportTemplateService;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.validation.Valid;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author lfdc
+ * @description 报表模板Controller
+ * @date 2023-10-30 17:10:27
+ */
+@Slf4j
+@RestController
+@RequestMapping("/reportTemplate")
+public class ReportTemplateController {
+
+    @Autowired
+    ReportTemplateService reportTemplateService;
+
+    @Log(description = "模版新增")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    @RequestMapping(name = "模版新增", value = "/add", method = RequestMethod.POST)
+    public HttpResult add(@RequestBody @Valid ReportTemplateAddDTO reportTemplateDTO, HttpServletRequest request) {
+        log.info("模版新增 add param:{}", JSONObject.toJSONString(reportTemplateDTO));
+        return reportTemplateService.add(reportTemplateDTO, request);
+    }
+
+    @Log(description = "模版详情")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    @RequestMapping(name = "模版详情", value = "/detail", method = RequestMethod.POST)
+    public HttpResult detail(@RequestParam("id") String id, HttpServletRequest request) {
+        log.info("模版详情 detail param:{}", id);
+        return reportTemplateService.detail(id, request);
+    }
+
+    @Log(description = "修改模版")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    @RequestMapping(name = "修改模版", value = "/update", method = RequestMethod.POST)
+    public HttpResult update(@RequestBody @Valid ReportTemplateUpdateDTO reportTemplateUpdateDTO, HttpServletRequest request) {
+        log.info("修改模版 update param:{}", JSONObject.toJSONString(reportTemplateUpdateDTO));
+        return reportTemplateService.update(reportTemplateUpdateDTO, request);
+    }
+
+    @Log(description = "模版启用")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    @RequestMapping(name = "模版启用", value = "/enable", method = RequestMethod.GET)
+    public HttpResult enable(@RequestBody @Valid IsEnableDTO isEnable, HttpServletRequest request) {
+        log.info("模版启用 enable param:{}", JSONObject.toJSONString(isEnable));
+        return reportTemplateService.enable(isEnable, request);
+    }
+
+}

+ 30 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/ThresholdController.java

@@ -1,7 +1,18 @@
 package com.sckw.slope.detection.controller;
 
+import com.alibaba.fastjson2.JSONObject;
+import com.sckw.core.annotation.Log;
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.slope.detection.model.param.ThresholdDetailQuery;
+import com.sckw.slope.detection.model.param.ThresholdQuery;
+import com.sckw.slope.detection.service.ThresholdService;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.validation.Valid;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 /**
@@ -14,4 +25,23 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("/threshold")
 public class ThresholdController {
 
+    @Autowired
+    ThresholdService thresholdService;
+
+    @Log(description = "阈值查询-分页")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    @RequestMapping(name = "阈值查询-分页", value = "/select", method = RequestMethod.POST)
+    public HttpResult select(@Valid @RequestBody ThresholdQuery thresholdQuery, HttpServletRequest request) {
+        log.info("阈值查询-分页 select param:{}", JSONObject.toJSONString(thresholdQuery));
+        return HttpResult.ok(thresholdService.select(thresholdQuery, request));
+    }
+
+    @Log(description = "阈值详情")
+    //@RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    @RequestMapping(name = "阈值详情", value = "/detail", method = RequestMethod.POST)
+    public HttpResult detail(@Valid @RequestBody ThresholdDetailQuery thresholdQuery, HttpServletRequest request) {
+        log.info("阈值详情 detail param:{}", JSONObject.toJSONString(thresholdQuery));
+        return thresholdService.detail(thresholdQuery, request);
+    }
+
 }

+ 0 - 19
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/KwsDeviceIntegrationMapper.java

@@ -1,19 +0,0 @@
-package com.sckw.slope.detection.dao;
-
-import com.sckw.slope.detection.model.dos.mysql.KwsDeviceIntegration;
-import org.apache.ibatis.annotations.Mapper;
-
-@Mapper
-public interface KwsDeviceIntegrationMapper {
-    int deleteByPrimaryKey(Long id);
-
-    int insert(KwsDeviceIntegration record);
-
-    int insertSelective(KwsDeviceIntegration record);
-
-    KwsDeviceIntegration selectByPrimaryKey(Long id);
-
-    int updateByPrimaryKeySelective(KwsDeviceIntegration record);
-
-    int updateByPrimaryKey(KwsDeviceIntegration record);
-}

+ 32 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsDeviceIntegrationMapper.java

@@ -0,0 +1,32 @@
+package com.sckw.slope.detection.dao.mysql;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sckw.slope.detection.model.dos.mysql.KwsDeviceIntegration;
+import com.sckw.slope.detection.model.dto.DeviceElementDTO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+@DS("mysql")
+public interface KwsDeviceIntegrationMapper extends BaseMapper<KwsDeviceIntegration> {
+    int deleteByPrimaryKey(Long id);
+
+    int insert(KwsDeviceIntegration record);
+
+    int insertSelective(KwsDeviceIntegration record);
+
+    KwsDeviceIntegration selectByPrimaryKey(Long id);
+
+    int updateByPrimaryKeySelective(KwsDeviceIntegration record);
+
+    int updateByPrimaryKey(KwsDeviceIntegration record);
+
+    List<DeviceElementDTO> selectIntegratedElement(@Param("projectId") String projectId,
+                                                   @Param("mountainId") String mountainId,
+                                                   @Param("status") List<Integer> status,
+                                                   @Param("deviceId") Long deviceId
+                                                   );
+}

+ 5 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsDeviceMapper.java

@@ -4,6 +4,8 @@ import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sckw.slope.detection.model.dos.mysql.KwsDevice;
 import com.sckw.slope.detection.model.dto.DeviceDataDTO;
+import com.sckw.slope.detection.model.dto.ThresholdSelectDTO;
+import com.sckw.slope.detection.model.vo.AffiliationDeviceVO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import com.sckw.slope.detection.model.vo.DeviceVo;
@@ -30,4 +32,7 @@ public interface KwsDeviceMapper extends BaseMapper<KwsDevice> {
 
     List<DeviceVo> selectByDeviceParam(@Param("deviceQuery") DeviceQuery deviceQuery);
 
+    List<AffiliationDeviceVO> selectDeviceAllAndProjectData(@Param("projectId") String projectId);
+
+    List<ThresholdSelectDTO> selectDeviceAllByProjectAndMountainId(@Param("projectId") String projectId, @Param("mountainId") String mountainId, @Param("status") List<Integer> status);
 }

+ 16 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsDeviceModelPartMapper.java

@@ -3,7 +3,11 @@ package com.sckw.slope.detection.dao.mysql;
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sckw.slope.detection.model.dos.mysql.KwsDeviceModelPart;
+import com.sckw.slope.detection.model.dto.DeviceElementDTO;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 @Mapper
 @DS("mysql")
@@ -19,4 +23,16 @@ public interface KwsDeviceModelPartMapper extends BaseMapper<KwsDeviceModelPart>
     int updateByPrimaryKeySelective(KwsDeviceModelPart record);
 
     int updateByPrimaryKey(KwsDeviceModelPart record);
+
+    List<DeviceElementDTO> selectElementList(@Param("projectId") String projectId, @Param("mountainId") String mountainId,
+                                             @Param("status") List<Integer> status, @Param("deviceId") Long deviceId);
+
+    /**
+     * 查询项目下所有的设备
+     * @param projectId
+     * @param mountainId
+     * @param status
+     * @return
+     */
+    List<DeviceElementDTO> selectElementAllList(@Param("projectId") String projectId, @Param("mountainId") String mountainId, @Param("status") List<Integer> status);
 }

+ 6 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsDictMapper.java

@@ -3,7 +3,11 @@ package com.sckw.slope.detection.dao.mysql;
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sckw.slope.detection.model.dos.mysql.KwsDict;
+import com.sckw.slope.detection.model.vo.QueryDictTypePageReqVo;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 @Mapper
 @DS("mysql")
@@ -19,4 +23,6 @@ public interface KwsDictMapper extends BaseMapper<KwsDict> {
     int updateByPrimaryKeySelective(KwsDict record);
 
     int updateByPrimaryKey(KwsDict record);
+
+    List<QueryDictTypePageReqVo> selectListAll(@Param("reqVo") QueryDictTypePageReqVo reqVo);
 }

+ 22 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsMountainCompanyMapper.java

@@ -0,0 +1,22 @@
+package com.sckw.slope.detection.dao.mysql;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sckw.slope.detection.model.dos.mysql.KwsMountainCompany;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+@DS("mysql")
+public interface KwsMountainCompanyMapper extends BaseMapper<KwsMountainCompany> {
+    int deleteByPrimaryKey(Long id);
+
+    int insert(KwsMountainCompany record);
+
+    int insertSelective(KwsMountainCompany record);
+
+    KwsMountainCompany selectByPrimaryKey(Long id);
+
+    int updateByPrimaryKeySelective(KwsMountainCompany record);
+
+    int updateByPrimaryKey(KwsMountainCompany record);
+}

+ 2 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsProjectMapper.java

@@ -27,4 +27,6 @@ public interface KwsProjectMapper extends BaseMapper<KwsProject> {
     List<ProjectDeviceVO> selectDeviceByProjectId(@Param("projectId") Long projectId);
 
     List<ProjectDeviceVO> selectDeviceList(@Param("deviceQuery") DeviceQuery deviceQuery);
+
+    List<ProjectDeviceVO> selectDeviceNotBindList(@Param("deviceQuery") DeviceQuery deviceQuery);
 }

+ 0 - 2
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsReportTemplateMapper.java

@@ -16,8 +16,6 @@ import java.util.List;
 public interface KwsReportTemplateMapper extends BaseMapper<KwsReportTemplate> {
     int deleteByPrimaryKey(Long id);
 
-    int insert(KwsReportTemplate record);
-
     int insertSelective(KwsReportTemplate record);
 
     KwsReportTemplate selectByPrimaryKey(Long id);

+ 2 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsDeviceReference.java

@@ -34,6 +34,8 @@ public class KwsDeviceReference implements Serializable {
     */
     private String item;
 
+    private String mountainId;
+
     /**
     * 基准值
     */

+ 35 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsMountainCompany.java

@@ -0,0 +1,35 @@
+package com.sckw.slope.detection.model.dos.mysql;
+
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 矿山-公司关联关系
+ */
+@Data
+@TableName("kws_mountain_company")
+public class KwsMountainCompany implements Serializable {
+
+    private Long id;
+
+    /**
+     * 矿山id
+     */
+//    @Size(max = 64,message = "矿山id最大长度要小于 64")
+    private String mountainId;
+
+    /**
+     * 公司id
+     */
+//    @Size(max = 64,message = "公司id最大长度要小于 64")
+    private String companyId;
+
+    @TableLogic(value = "0")
+    private int delFlag;
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 10 - 80
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsProjectArea.java

@@ -1,11 +1,12 @@
 package com.sckw.slope.detection.model.dos.mysql;
 
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
-import java.util.Date;
+import java.time.LocalDateTime;
 
 /**
  * @author lfdc
@@ -22,10 +23,10 @@ public class KwsProjectArea implements Serializable {
      */
     private Long projectId;
 
-    /**
-     * 企业id
-     */
-    private String companyId;
+//    /**
+//     * 企业id
+//     */
+//    private String companyId;
 
     /**
      * 选中区域
@@ -45,7 +46,7 @@ public class KwsProjectArea implements Serializable {
     /**
      * 创建时间
      */
-    private Date createTime;
+    private LocalDateTime createTime;
 
     /**
      * 修改人
@@ -55,84 +56,13 @@ public class KwsProjectArea implements Serializable {
     /**
      * 修改时间
      */
-    private Date updateTime;
+    private LocalDateTime updateTime;
 
     /**
      * 删除标识
      */
-    private Byte delFlag;
+    @TableLogic(value = "0")
+    private int delFlag;
 
     private static final long serialVersionUID = 1L;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getProjectId() {
-        return projectId;
-    }
-
-    public void setProjectId(Long projectId) {
-        this.projectId = projectId;
-    }
-
-    public String getFence() {
-        return fence;
-    }
-
-    public void setFence(String fence) {
-        this.fence = fence;
-    }
-
-    public BigDecimal getArea() {
-        return area;
-    }
-
-    public void setArea(BigDecimal area) {
-        this.area = area;
-    }
-
-    public Long getCreateBy() {
-        return createBy;
-    }
-
-    public void setCreateBy(Long createBy) {
-        this.createBy = createBy;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public Long getUpdateBy() {
-        return updateBy;
-    }
-
-    public void setUpdateBy(Long updateBy) {
-        this.updateBy = updateBy;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public Byte getDelFlag() {
-        return delFlag;
-    }
-
-    public void setDelFlag(Byte delFlag) {
-        this.delFlag = delFlag;
-    }
 }

+ 4 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsProjectDevice.java

@@ -27,6 +27,10 @@ public class KwsProjectDevice implements Serializable {
      * 企业id
      */
     private String companyId;
+    /**
+     * 矿山id
+     */
+    private String mountainId;
 
     /**
      * 设备id

+ 7 - 2
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsReportTemplate.java

@@ -1,11 +1,11 @@
 package com.sckw.slope.detection.model.dos.mysql;
 
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 
 import java.io.Serializable;
 import java.time.LocalDateTime;
-import java.util.Date;
 
 
 /**
@@ -18,6 +18,10 @@ import java.util.Date;
 public class KwsReportTemplate implements Serializable {
     private Long id;
 
+    /**
+     * 项目id
+     */
+    private String projectId;
     /**
      * 模版名称
      */
@@ -71,11 +75,12 @@ public class KwsReportTemplate implements Serializable {
     /**
      * 修改时间
      */
-    private Date updateTime;
+    private LocalDateTime updateTime;
 
     /**
      * 删除标识
      */
+    @TableLogic(value = "0")
     private int delFlag;
 
     private static final long serialVersionUID = 1L;

+ 7 - 4
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsThreshold.java

@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 
 import java.io.Serializable;
-import java.util.Date;
+import java.time.LocalDateTime;
 
 /**
  * @author lfdc
@@ -30,6 +30,8 @@ public class KwsThreshold implements Serializable {
      * 企业id
      */
     private String companyId;
+    private String mountainId;
+    private String setting;
 
     /**
      * 阈值等级
@@ -64,22 +66,23 @@ public class KwsThreshold implements Serializable {
     /**
      * 创建时间
      */
-    private Date createTime;
+    private LocalDateTime createTime;
 
     /**
      * 修改人
      */
     private Long updateBy;
+    private String updateName;
 
     /**
      * 修改时间
      */
-    private Date updateTime;
+    private LocalDateTime updateTime;
 
     /**
      * 删除标识
      */
-    private Byte delFlag;
+    private int delFlag;
 
     private static final long serialVersionUID = 1L;
 }

+ 25 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/DeviceElementDTO.java

@@ -0,0 +1,25 @@
+package com.sckw.slope.detection.model.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/**
+ * @author lfdc
+ * @description 设备要素
+ * @date 2023-11-02 09:11:27
+ */
+@Data
+public class DeviceElementDTO {
+    private String deviceId;
+    private String name;
+    private String deviceModelId;
+    private String element;
+    private String phones;
+    private String integrationElement;
+    private String updateName;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime updateTime;
+
+}

+ 38 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/DeviceLocationDTO.java

@@ -0,0 +1,38 @@
+package com.sckw.slope.detection.model.dto;
+
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * @author lfdc
+ * @description 设备位置配置
+ * @date 2023-11-01 13:11:46
+ */
+@NoArgsConstructor
+@Data
+public class DeviceLocationDTO implements Serializable {
+
+    /**
+     * 设备ID
+     */
+    @NotBlank(message = "设备id不能为空")
+    private String deviceId;
+    /**
+     * 逻辑经度(测点布设的值)
+     */
+    @NotBlank(message = "逻辑经度不能为空")
+    private String logicLng;
+    /**
+     * 逻辑纬度(测点布设的值)
+     */
+    @NotBlank(message = "逻辑纬度不能为空")
+    private String logicLat;
+    /**
+     * 逻辑海拔(测点布设的值)
+     */
+    @NotBlank(message = "逻辑海拔不能为空")
+    private String logicAlt;
+}

+ 5 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/HeaderData.java

@@ -36,5 +36,10 @@ public class HeaderData implements Serializable {
      */
     private String updateName;
 
+    /**
+     * 矿山id
+     */
+    private String mountainId;
+
 
 }

+ 14 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/IsEnableDTO.java

@@ -0,0 +1,14 @@
+package com.sckw.slope.detection.model.dto;
+
+import lombok.Data;
+
+/**
+ * @author lfdc
+ * @description 模板是否启用
+ * @date 2023-11-01 14:11:58
+ */
+@Data
+public class IsEnableDTO {
+    private String id;
+    private boolean flag;
+}

+ 9 - 2
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/ProjectAddDTO.java

@@ -1,10 +1,11 @@
 package com.sckw.slope.detection.model.dto;
 
+import jakarta.validation.constraints.Max;
 import jakarta.validation.constraints.NotBlank;
-import lombok.Builder;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 
 /**
  * @author lfdc
@@ -12,7 +13,7 @@ import java.io.Serializable;
  * @date 2023-10-30 13:10:38
  */
 @Data
-@Builder
+//@Builder
 public class ProjectAddDTO implements Serializable {
 
     /**
@@ -27,6 +28,11 @@ public class ProjectAddDTO implements Serializable {
     @NotBlank(message = "项目区域不能为空")
     private String fence;
 
+    /**
+     * 项目预计面积
+     */
+    private BigDecimal area;
+
     /**
      * 所属矿山id
      */
@@ -84,5 +90,6 @@ public class ProjectAddDTO implements Serializable {
     /**
      * 备注
      */
+    @Max(value = 200, message = "请输入不超过{value}个字符")
     private String remark;
 }

+ 14 - 1
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/ProjectUpdateDTO.java

@@ -1,9 +1,13 @@
 package com.sckw.slope.detection.model.dto;
 
+import jakarta.validation.constraints.DecimalMin;
+import jakarta.validation.constraints.Digits;
 import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 
 /**
  * @author lfdc
@@ -16,7 +20,8 @@ public class ProjectUpdateDTO implements Serializable {
     /**
      * 项目id
      */
-    private  String id;
+    @NotBlank(message = "项目id不能为空")
+    private String id;
     /**
      * 项目名
      */
@@ -29,6 +34,14 @@ public class ProjectUpdateDTO implements Serializable {
     @NotBlank(message = "项目区域不能为空")
     private String fence;
 
+    /**
+     * 项目面积
+     */
+    @NotNull(message = "项目面积不能为空")
+    @Digits(integer = 20, fraction = 2, message = "项目面积格式错误")
+    @DecimalMin(value = "0.00", message = "面积最小为{value}")
+    private BigDecimal area;
+
     /**
      * 所属矿山id
      */

+ 47 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/ReportTemplateAddDTO.java

@@ -0,0 +1,47 @@
+package com.sckw.slope.detection.model.dto;
+
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author lfdc
+ * @description 新增模板dto
+ * @date 2023-11-01 14:11:04
+ */
+@Data
+public class ReportTemplateAddDTO implements Serializable {
+
+    /**
+     * 项目ID
+     */
+    @NotBlank(message = "项目id不能为空")
+    private String projectId;
+    /**
+     * 项目名
+     */
+    @NotBlank(message = "项目名不能为空")
+    private String name;
+    /**
+     * 类型
+     */
+    @NotBlank(message = "类型不能为空")
+    private String type;
+    /**
+     * 要素名字符串
+     */
+    @NotBlank(message = "要素名字符串不能为空")
+    private String partNames;
+    /**
+     * 集成分析方案名字符串
+     */
+    @NotBlank(message = "集成分析方案名字符串不能为空")
+    private String intergrationNames;
+    /**
+     * 生效状态
+     */
+    @NotBlank(message = "生效状态不能为空")
+    private String status;
+
+}

+ 49 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/ReportTemplateUpdateDTO.java

@@ -0,0 +1,49 @@
+package com.sckw.slope.detection.model.dto;
+
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author lfdc
+ * @description 新增模板dto
+ * @date 2023-11-01 14:11:04
+ */
+@Data
+public class ReportTemplateUpdateDTO implements Serializable {
+
+    @NotBlank(message = "id不能为空")
+    private String id;
+    /**
+     * 项目ID
+     */
+    @NotBlank(message = "项目id不能为空")
+    private String projectId;
+    /**
+     * 模板名
+     */
+    @NotBlank(message = "模板名不能为空")
+    private String name;
+    /**
+     * 类型
+     */
+    @NotBlank(message = "类型不能为空")
+    private String type;
+    /**
+     * 要素名字符串
+     */
+    @NotBlank(message = "要素名字符串不能为空")
+    private String partNames;
+    /**
+     * 集成分析方案名字符串
+     */
+    @NotBlank(message = "集成分析方案名字符串不能为空")
+    private String intergrationNames;
+    /**
+     * 生效状态
+     */
+    @NotBlank(message = "生效状态不能为空")
+    private String status;
+
+}

+ 70 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/ThresholdSelectDTO.java

@@ -0,0 +1,70 @@
+package com.sckw.slope.detection.model.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * @author lfdc
+ * @description 阈值查询dto
+ * @date 2023-11-02 11:11:26
+ */
+@Data
+public class ThresholdSelectDTO implements Serializable {
+
+    private Long deviceId;
+
+    private String deviceAlias;
+
+    /**
+     * 项目主键ID
+     */
+    private String id;
+
+    private String deviceName;
+    /**
+     * 监测项(字典value)
+     */
+    private String itemName;
+    /**
+     * 设备设置基准总数
+     */
+    private String deviceTotal;
+    /**
+     * 已设置阈值设备总数
+     */
+    private int deviceSetTotal;
+    /**
+     * 状态
+     */
+    private String status;
+    /**
+     * 状态名称
+     */
+    private String statusName;
+    /**
+     * 联系电话,多个用分隔符
+     */
+    private String phones;
+    /**
+     * 创建人
+     */
+    private String createByName;
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime createTime;
+    /**
+     * 更新人
+     */
+    private String updateByName;
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime updateTime;
+
+}

+ 5 - 2
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/DeviceQuery.java

@@ -10,8 +10,6 @@ import lombok.Data;
  */
 @Data
 public class DeviceQuery {
-
-
     /**
      * id
      */
@@ -22,6 +20,11 @@ public class DeviceQuery {
      */
     private String projectName;
 
+    /**
+     * 项目名称
+     */
+    private String projectId;
+
     /**
      * 厂商
      */

+ 30 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/ThresholdDetailQuery.java

@@ -0,0 +1,30 @@
+package com.sckw.slope.detection.model.param;
+
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author lfdc
+ * @description 阈值详情查询
+ * @date 2023-11-02 16:11:27
+ */
+@Data
+public class ThresholdDetailQuery implements Serializable {
+
+    /**
+     * 设备ID
+     */
+    @NotBlank(message = "设备id不能为空")
+    private String deviceId;
+    /**
+     * 项目id
+     */
+    private String projectId;
+    /**
+     * 监测项(字典value)
+     */
+    @NotBlank(message = "监测项不能为空")
+    private String itemName;
+}

+ 25 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/ThresholdQuery.java

@@ -0,0 +1,25 @@
+package com.sckw.slope.detection.model.param;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author lfdc
+ * @description 阈值查询
+ * @date 2023-11-01 16:11:48
+ */
+@Data
+public class ThresholdQuery implements Serializable {
+
+    private String projectId;
+
+    private int page;
+
+    private int pageSize;
+
+    /**
+     * 检测项
+     */
+    private String itemName;
+}

+ 42 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/AffiliationDeviceVO.java

@@ -0,0 +1,42 @@
+package com.sckw.slope.detection.model.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author lfdc
+ * @description
+ * @date 2023-11-01 11:11:22
+ */
+@Data
+public class AffiliationDeviceVO implements Serializable {
+    /**
+     * 设备ID
+     */
+    private String deviceId;
+    /**
+     * 视频设备、监测设备等
+     */
+    private String attribute;
+    /**
+     * 设备名称
+     */
+    private String name;
+    /**
+     * 设备别名
+     */
+    private String alias;
+    /**
+     * 逻辑经度(测点布设的值)
+     */
+    private String logicLng;
+    /**
+     * 逻辑纬度(测点布设的值)
+     */
+    private String logicLat;
+    /**
+     * 逻辑海拔(测点布设的值)
+     */
+    private String logicAlt;
+}

+ 90 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/KwsReportTemplateVO.java

@@ -0,0 +1,90 @@
+package com.sckw.slope.detection.model.vo;
+
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+
+/**
+ * @author lfdc
+ * @description 报表配置模型(不要在零点汇聚数据)
+ * @date 2023-10-25 13:46:12
+ */
+@Data
+public class KwsReportTemplateVO implements Serializable {
+    private Long id;
+
+    /**
+     * 项目id
+     */
+    private String projectId;
+
+    /**
+     * 模版名称
+     */
+    private String name;
+
+    /**
+     * 企业id
+     */
+    private String companyId;
+
+    /**
+     * 制表时间
+     */
+    private String tabulationTime;
+
+    /**
+     * 模版类型
+     */
+    private Integer type;
+
+    /**
+     * 要素名字符串
+     */
+    private String partNames;
+
+    /**
+     * 集成分析方案名字符串
+     */
+    private String intergrationNames;
+
+    /**
+     * 状态
+     */
+    private int status;
+
+    /**
+     * 创建人
+     */
+    private Long createBy;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private LocalDateTime createTime;
+
+    /**
+     * 修改人
+     */
+    private Long updateBy;
+
+    /**
+     * 修改时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private LocalDateTime updateTime;
+
+    /**
+     * 删除标识
+     */
+    @TableLogic(value = "0")
+    private int delFlag;
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 36 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/ProjectAffiliationDeviceVO.java

@@ -0,0 +1,36 @@
+package com.sckw.slope.detection.model.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author lfdc
+ * @description 归属项目的设备信息
+ * @date 2023-10-31 09:10:54
+ */
+//@NoArgsConstructor
+@Data
+public class ProjectAffiliationDeviceVO implements Serializable {
+
+    /**
+     * 选中区域
+     */
+    private String fence;
+
+    /**
+     * 项目id
+     */
+    private String projectId;
+
+    /**
+     * 项目名称
+     */
+    private String projectName;
+
+    /**
+     * 所属设备
+     */
+    private List<AffiliationDeviceVO> deviceList;
+}

+ 7 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/ProjectDeviceVO.java

@@ -20,15 +20,22 @@ public class ProjectDeviceVO implements Serializable {
      * 设备型号主键ID
      */
     private String id;
+
     /**
      * 设备名称
      */
     private String name;
 
+    /**
+     * 状态
+     */
+    private String status;
+
     /**
      * 项目ID
      */
     private String projectId;
+
     /**
      * 项目名称
      */

+ 12 - 1
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/ProjectVo.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableLogic;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 
 /**
@@ -20,10 +21,20 @@ public class ProjectVo implements Serializable {
      */
     private String name;
 
+    /**
+     * 区域
+     */
+    private String fence;
+
+    /**
+     * 面积
+     */
+    private BigDecimal area;
+
     /**
      * 设备数量
      */
-    private Long deviceTotal;
+    private int deviceTotal;
 
     /**
      * 所属矿山id

+ 42 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/QueryDictTypePageReqVo.java

@@ -0,0 +1,42 @@
+package com.sckw.slope.detection.model.vo;
+
+import com.sckw.core.model.page.PageRequest;
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @author czh
+ * @desc 查字典类型
+ * @date 2023/7/6
+ */
+@Data
+public class QueryDictTypePageReqVo extends PageRequest implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -3459808558841183248L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 字典key
+     */
+    private String value;
+
+    /**
+     * 字典值
+     */
+    private String label;
+
+    /**
+     * 类型code
+     */
+    @NotBlank(message = "类型code不能为空")
+    private String typeCode;
+
+}

+ 45 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/ThresholdDetailVO.java

@@ -0,0 +1,45 @@
+package com.sckw.slope.detection.model.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @author lfdc
+ * @description 阈值详情查询vo
+ * @date 2023-11-02 16:11:37
+ */
+@Data
+public class ThresholdDetailVO implements Serializable {
+
+    /**
+     * phones : 联系电话,多个用分隔符
+     * threshold : [{"level":"等级","max":"阈值配置最大值","min":"阈值配置最小值"}]
+     * itemName : 监测项(字典value)
+     * itemValue : 监测项(字典value)-具体的值(基准值)
+     * variation : 变化量
+     * deviceId : 设备ID
+     */
+
+    private String phones;
+    private String itemName;
+    private String deviceId;
+    private BigDecimal itemValue;
+    private String variation;
+    private List<ThresholdBean> threshold;
+
+    @Data
+    public static class ThresholdBean implements Serializable{
+        /**
+         * level : 等级
+         * max : 阈值配置最大值
+         * min : 阈值配置最小值
+         */
+
+        private String level;
+        private String max;
+        private String min;
+    }
+}

+ 22 - 1
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/CommonService.java

@@ -1,14 +1,21 @@
 package com.sckw.slope.detection.service;
 
 import com.alibaba.fastjson2.JSONObject;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.BusinessException;
+import com.sckw.core.model.page.PageRes;
+import com.sckw.slope.detection.dao.mysql.KwsDictMapper;
 import com.sckw.slope.detection.model.dto.HeaderData;
+import com.sckw.slope.detection.model.vo.QueryDictTypePageReqVo;
 import jakarta.servlet.http.HttpServletRequest;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.Base64;
+import java.util.List;
 
 /**
  * @author lfdc
@@ -19,8 +26,15 @@ import java.util.Base64;
 @Service
 public class CommonService {
 
+    @Autowired
+    KwsDictMapper dictMapper;
+
     public HeaderData getHeaderData(HttpServletRequest request) {
-        String uInfo = request.getHeader("u_info");
+        /**
+         * {"companyId":"198","companyName":"四川金顶集团","createBy":"2","createName":"600678","updateBy":"2","updateName":"600678","mountainId":"198"}
+         */
+//        String uInfo = request.getHeader("u_info");
+        String uInfo = "eyJjb21wYW55SWQiOiIxOTgiLCJjb21wYW55TmFtZSI6IuWbm+W3nemHkemhtumbhuWboiIsImNyZWF0ZUJ5IjoiMiIsImNyZWF0ZU5hbWUiOiI2MDA2NzgiLCJ1cGRhdGVCeSI6IjIiLCJ1cGRhdGVOYW1lIjoiNjAwNjc4IiwibW91bnRhaW5JZCI6IjE5OCJ9";
         if (StringUtils.isBlank(uInfo)) {
             throw new BusinessException("数据请求异常!");
         }
@@ -28,4 +42,11 @@ public class CommonService {
         HeaderData headerData = JSONObject.parseObject(message, HeaderData.class);
         return headerData;
     }
+
+    public PageRes getDict(QueryDictTypePageReqVo queryDictTypePageReqVo) {
+        PageHelper.startPage(queryDictTypePageReqVo.getPage(), queryDictTypePageReqVo.getPageSize());
+        List<QueryDictTypePageReqVo> list = dictMapper.selectListAll(queryDictTypePageReqVo);
+        PageInfo<QueryDictTypePageReqVo> info = new PageInfo<>();
+        return PageRes.build(info, list);
+    }
 }

+ 23 - 5
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/DeviceService.java

@@ -2,10 +2,9 @@ package com.sckw.slope.detection.service;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.sckw.core.common.enums.NumberConstant;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.page.PageRes;
-import com.sckw.core.utils.IdWorker;
+import com.sckw.core.model.enums.DeviceEnum;
 import com.sckw.core.utils.StringUtils;
 import com.sckw.core.model.enums.AlarmTypeEnum;
 import com.sckw.core.model.enums.DeviceEnum;
@@ -23,6 +22,8 @@ import com.sckw.slope.detection.model.dto.ProjectAddDTO;
 import com.sckw.slope.detection.model.param.DeviceAdd;
 import com.sckw.slope.detection.model.param.DeviceQuery;
 import com.sckw.slope.detection.model.vo.ProjectVo;
+import com.sckw.slope.detection.model.dto.DeviceLocationDTO;
+import com.sckw.slope.detection.model.dto.HeaderData;
 import jakarta.servlet.http.HttpServletRequest;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
@@ -48,6 +49,9 @@ import java.util.Map;
 @Service
 public class DeviceService {
 
+    @Autowired
+    CommonService commonService;
+
     @Autowired
     KwsDeviceMapper deviceMapper;
 
@@ -57,8 +61,6 @@ public class DeviceService {
     @Autowired
     KwsDeviceModelMapper deviceModelMapper;
 
-    @Autowired
-    CommonService commonService;
 
     @Transactional
     public HttpResult dels(String ids) {
@@ -149,5 +151,21 @@ public class DeviceService {
         return HttpResult.ok(vo);
     }
 
-
+    @Transactional
+    public HttpResult locationSet(List<DeviceLocationDTO> list, HttpServletRequest request) {
+        HeaderData headerData = commonService.getHeaderData(request);
+        if (!CollectionUtils.isEmpty(list)) {
+            list.forEach(device -> {
+                deviceMapper.update(null, new LambdaUpdateWrapper<KwsDevice>()
+                        .set(KwsDevice::getLogicLng, device.getLogicLng())
+                        .set(KwsDevice::getLogicLat, device.getLogicLat())
+                        .set(KwsDevice::getLogicAlt, device.getLogicAlt())
+                        .set(KwsDevice::getUpdateBy, headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()))
+                        .set(KwsDevice::getStatus, DeviceEnum.BE_CHECKING)
+                        .eq(KwsDevice::getId, device.getDeviceId())
+                );
+            });
+        }
+        return HttpResult.ok();
+    }
 }

+ 103 - 20
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ProjectService.java

@@ -5,25 +5,21 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
-import com.sckw.core.common.enums.NumberConstant;
 import com.sckw.core.exception.BusinessException;
+import com.sckw.core.model.constant.NumberConstant;
+import com.sckw.core.model.enums.DeviceEnum;
 import com.sckw.core.model.page.PageRes;
 import com.sckw.core.utils.IdWorker;
+import com.sckw.core.utils.RegularUtils;
 import com.sckw.core.utils.StringUtils;
+import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
-import com.sckw.slope.detection.dao.mysql.KwsDeviceReferenceMapper;
-import com.sckw.slope.detection.dao.mysql.KwsDeviceRelationMapper;
-import com.sckw.slope.detection.dao.mysql.KwsProjectDeviceMapper;
-import com.sckw.slope.detection.dao.mysql.KwsProjectMapper;
-import com.sckw.slope.detection.model.dos.mysql.KwsDeviceRelation;
-import com.sckw.slope.detection.model.dos.mysql.KwsProject;
-import com.sckw.slope.detection.model.dos.mysql.KwsProjectDevice;
+import com.sckw.slope.detection.dao.mysql.*;
+import com.sckw.slope.detection.model.dos.mysql.*;
 import com.sckw.slope.detection.model.dto.*;
 import com.sckw.slope.detection.model.param.DeviceQuery;
 import com.sckw.slope.detection.model.param.ProjectQuery;
-import com.sckw.slope.detection.model.vo.IntegrationItemVO;
-import com.sckw.slope.detection.model.vo.ProjectDeviceVO;
-import com.sckw.slope.detection.model.vo.ProjectVo;
+import com.sckw.slope.detection.model.vo.*;
 import com.sckw.slope.detection.service.repository.KwsDeviceRelationRepository;
 import com.sckw.slope.detection.service.repository.KwsProjectDeviceRepository;
 import jakarta.servlet.http.HttpServletRequest;
@@ -54,20 +50,29 @@ public class ProjectService {
     KwsProjectMapper projectMapper;
 
     @Autowired
-    KwsProjectDeviceMapper projectDeviceMapper;
+    KwsProjectAreaMapper projectAreaMapper;
 
     @Autowired
-    KwsProjectDeviceRepository projectDeviceRepository;
+    KwsDeviceMapper deviceMapper;
+
+    @Autowired
+    KwsProjectDeviceMapper projectDeviceMapper;
 
     @Autowired
     KwsDeviceReferenceMapper deviceReferenceMapper;
 
+    @Autowired
+    KwsMountainCompanyMapper mountainCompanyMapper;
+
     @Autowired
     KwsDeviceRelationMapper deviceRelationMapper;
 
     @Autowired
     KwsDeviceRelationRepository deviceRelationRepository;
 
+    @Autowired
+    KwsProjectDeviceRepository projectDeviceRepository;
+
     /**
      * 新增项目
      *
@@ -77,10 +82,21 @@ public class ProjectService {
      */
     @Transactional
     public HttpResult add(ProjectAddDTO projectAddDto, HttpServletRequest request) {
+        if (org.apache.commons.lang3.StringUtils.isNotBlank(projectAddDto.getBuildPhone())) {
+            if (!RegularUtils.matchs(RegularUtils.PHONE_REG, projectAddDto.getBuildPhone())) {
+                return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, "施工单位联系电话格式不正确,请检查并重新输入!");
+            }
+        }
+        if (org.apache.commons.lang3.StringUtils.isNotBlank(projectAddDto.getDesignPhone())) {
+            if (!RegularUtils.matchs(RegularUtils.PHONE_REG, projectAddDto.getDesignPhone())) {
+                return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, "设计单位联系电话格式不正确,请检查并重新输入!");
+            }
+        }
         HeaderData headerData = commonService.getHeaderData(request);
         KwsProject project = new KwsProject();
         BeanUtils.copyProperties(projectAddDto, project);
-        project.setId(new IdWorker(NumberConstant.ONE).nextId());
+        long id = new IdWorker(NumberConstant.ONE).nextId();
+        project.setId(id);
         project.setStatus(NumberConstant.ZERO);
         project.setCreateBy(Long.parseLong(headerData.getCreateBy()));
         LocalDateTime now = LocalDateTime.now();
@@ -89,6 +105,22 @@ public class ProjectService {
         project.setUpdateTime(now);
         project.setCompanyId(headerData.getCompanyId());
         projectMapper.insert(project);
+        KwsProjectArea area = new KwsProjectArea();
+        area.setId(new IdWorker(NumberConstant.ONE).nextId());
+        area.setProjectId(id);
+        area.setArea(projectAddDto.getArea());
+//        area.setCompanyId(headerData.getCompanyId());
+        area.setFence(projectAddDto.getFence());
+        area.setCreateBy(headerData.getCreateBy() == null ? null : Long.parseLong(headerData.getCreateBy()));
+        area.setCreateTime(now);
+        area.setUpdateBy(headerData.getCreateBy() == null ? null : Long.parseLong(headerData.getCreateBy()));
+        area.setUpdateTime(now);
+        projectAreaMapper.insert(area);
+        KwsMountainCompany company = new KwsMountainCompany();
+        company.setId(new IdWorker(NumberConstant.ONE).nextId());
+        company.setMountainId(headerData.getMountainId());
+        company.setCompanyId(headerData.getCompanyId());
+        mountainCompanyMapper.insert(company);
         return HttpResult.ok();
     }
 
@@ -107,17 +139,23 @@ public class ProjectService {
             return PageRes.build(pageInfo, list);
         }
         for (ProjectVo vo : list) {
-            vo.setDeviceTotal(projectDeviceMapper.selectCount(new LambdaQueryWrapper<KwsProjectDevice>().eq(KwsProjectDevice::getProjectId, vo.getId())));
+            vo.setDeviceTotal(projectDeviceMapper.selectCount(new LambdaQueryWrapper<KwsProjectDevice>().eq(KwsProjectDevice::getProjectId, vo.getId())).intValue());
+            KwsProjectArea area = projectAreaMapper.selectOne(new LambdaQueryWrapper<KwsProjectArea>().eq(KwsProjectArea::getProjectId, vo.getId()));
+            vo.setFence(area == null ? null : area.getFence());
+            vo.setArea(area == null ? null : area.getArea());
         }
         return PageRes.build(pageInfo, list);
     }
 
     public HttpResult detail(String id, HttpServletRequest response) {
         KwsProject project = projectMapper.selectOne(new LambdaQueryWrapper<KwsProject>()
-                .eq(KwsProject::getId, id)
-                .eq(KwsProject::getCompanyId, commonService.getHeaderData(response).getCompanyId()));
+                        .eq(KwsProject::getId, id)
+                /**.eq(KwsProject::getCompanyId, commonService.getHeaderData(response).getCompanyId())*/);
         ProjectVo vo = new ProjectVo();
         BeanUtils.copyProperties(project, vo);
+        KwsProjectArea area = projectAreaMapper.selectOne(new LambdaQueryWrapper<KwsProjectArea>().eq(KwsProjectArea::getProjectId, vo.getId()));
+        vo.setFence(area == null ? null : area.getFence());
+        vo.setArea(area == null ? null : area.getArea());
         return HttpResult.ok(vo);
     }
 
@@ -125,14 +163,18 @@ public class ProjectService {
     public HttpResult update(ProjectUpdateDTO projectAddDto, HttpServletRequest response) {
         KwsProject project = new KwsProject();
         BeanUtils.copyProperties(projectAddDto, project);
-        project.setId(new IdWorker(NumberConstant.ONE).nextId());
+        project.setId(Long.parseLong(projectAddDto.getId()));
         project.setStatus(NumberConstant.ZERO);
-        project.setCreateBy(0L);
         LocalDateTime now = LocalDateTime.now();
-        project.setCreateTime(now);
         project.setUpdateBy(Long.parseLong(commonService.getHeaderData(response).getUpdateBy()));
         project.setUpdateTime(now);
         projectMapper.updateById(project);
+        String fence = projectAddDto.getFence();
+        projectAreaMapper.update(null, new LambdaUpdateWrapper<KwsProjectArea>()
+                .eq(KwsProjectArea::getProjectId, projectAddDto.getId())
+                .set(KwsProjectArea::getFence, fence)
+                .set(KwsProjectArea::getArea, projectAddDto.getArea())
+        );
         return HttpResult.ok();
     }
 
@@ -216,6 +258,47 @@ public class ProjectService {
                 device.setCompanyId(headerData.getCompanyId());
             });
         }
+        //设备修改状态
+        if (!CollectionUtils.isEmpty(list)) {
+            list.forEach(id -> {
+                deviceMapper.update(null, new LambdaUpdateWrapper<KwsDevice>()
+                        .eq(KwsDevice::getId, id)
+                        .set(KwsDevice::getStatus, DeviceEnum.BE_CHECKING.getCode())
+                        .set(KwsDevice::getUpdateTime, LocalDateTime.now())
+                        .set(KwsDevice::getUpdateBy, headerData.getUpdateBy() == null ? Long.parseLong(headerData.getCreateBy()) : Long.parseLong(headerData.getUpdateBy()))
+                );
+            });
+        }
         return HttpResult.ok();
     }
+
+    public PageRes deviceBindSelect(DeviceQuery deviceQuery, HttpServletRequest request) {
+        PageHelper.startPage(deviceQuery.getPage(), deviceQuery.getPageSize());
+        List<ProjectDeviceVO> list = projectMapper.selectDeviceNotBindList(deviceQuery);
+        PageInfo<ProjectDeviceVO> info = new PageInfo<>(list);
+        if (CollectionUtils.isEmpty(list)) {
+            return PageRes.build(info, list);
+        }
+//        后期要数据翻译产品类型
+//        for (ProjectDeviceDTO projectDeviceDTO : list) {
+//
+//        }
+        return PageRes.build(info, list);
+    }
+
+    public HttpResult deviceFind(DeviceQuery deviceQuery, HttpServletRequest request) {
+        String projectId = deviceQuery.getProjectId();
+        KwsProject project = projectMapper.selectOne(new LambdaQueryWrapper<KwsProject>().eq(KwsProject::getId, Long.parseLong(projectId)));
+        if (project == null) {
+            throw new BusinessException("项目查询错误!");
+        }
+        KwsProjectArea area = projectAreaMapper.selectOne(new LambdaQueryWrapper<KwsProjectArea>().eq(KwsProjectArea::getProjectId, Long.parseLong(projectId)));
+        List<AffiliationDeviceVO> list = deviceMapper.selectDeviceAllAndProjectData(projectId);
+        ProjectAffiliationDeviceVO vo = new ProjectAffiliationDeviceVO();
+        vo.setFence(area == null ? null : area.getFence());
+        vo.setProjectId(projectId);
+        vo.setProjectName(project.getName());
+        vo.setDeviceList(list);
+        return HttpResult.ok(vo);
+    }
 }

+ 18 - 2
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ReportService.java

@@ -1,13 +1,17 @@
 package com.sckw.slope.detection.service;
 
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
-import com.sckw.core.common.enums.ReportEnum;
-import com.sckw.core.common.enums.ReportTypeEnum;
+import com.sckw.core.model.constant.NumberConstant;
+import com.sckw.core.model.enums.ReportEnum;
+import com.sckw.core.model.enums.ReportTypeEnum;
 import com.sckw.core.model.page.PageRes;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.slope.detection.dao.mysql.KwsReportDataMapper;
 import com.sckw.slope.detection.dao.mysql.KwsReportTemplateMapper;
+import com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate;
+import com.sckw.slope.detection.model.dto.HeaderData;
 import com.sckw.slope.detection.model.param.StatementQuery;
 import com.sckw.slope.detection.model.vo.ReportDetailVO;
 import com.sckw.slope.detection.model.vo.ReportStatementVO;
@@ -17,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
+import java.time.LocalDateTime;
 import java.util.List;
 
 /**
@@ -59,4 +64,15 @@ public class ReportService {
         }
         return HttpResult.ok(vo);
     }
+
+    public HttpResult dels(String id, HttpServletRequest request) {
+        HeaderData headerData = commonService.getHeaderData(request);
+        reportTemplateMapper.update(null, new LambdaUpdateWrapper<KwsReportTemplate>()
+                .eq(KwsReportTemplate::getId, Long.parseLong(id))
+                .set(KwsReportTemplate::getUpdateTime, LocalDateTime.now())
+                .set(KwsReportTemplate::getUpdateBy, (headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy())))
+                .set(KwsReportTemplate::getStatus, NumberConstant.ONE)
+        );
+        return HttpResult.ok("删除成功");
+    }
 }

+ 132 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ReportTemplateService.java

@@ -0,0 +1,132 @@
+package com.sckw.slope.detection.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.sckw.core.exception.BusinessException;
+import com.sckw.core.model.constant.NumberConstant;
+import com.sckw.core.model.enums.ReportTypeEnum;
+import com.sckw.core.utils.IdWorker;
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.slope.detection.dao.mysql.KwsReportTemplateMapper;
+import com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate;
+import com.sckw.slope.detection.model.dto.HeaderData;
+import com.sckw.slope.detection.model.dto.IsEnableDTO;
+import com.sckw.slope.detection.model.dto.ReportTemplateAddDTO;
+import com.sckw.slope.detection.model.dto.ReportTemplateUpdateDTO;
+import com.sckw.slope.detection.model.vo.KwsReportTemplateVO;
+import jakarta.servlet.http.HttpServletRequest;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.time.LocalDateTime;
+
+/**
+ * @author lfdc
+ * @description
+ * @date 2023-11-01 14:11:07
+ */
+@Slf4j
+@Service
+public class ReportTemplateService {
+
+    @Autowired
+    CommonService commonService;
+
+    @Autowired
+    KwsReportTemplateMapper reportTemplateMapper;
+
+    @Transactional
+    public HttpResult add(ReportTemplateAddDTO reportTemplateDTO, HttpServletRequest request) {
+        HeaderData headerData = commonService.getHeaderData(request);
+        String projectId = reportTemplateDTO.getProjectId();
+        KwsReportTemplate template = new KwsReportTemplate();
+        long id = new IdWorker(NumberConstant.ONE).nextId();
+        template.setId(id);
+        template.setName(reportTemplateDTO.getName());
+        template.setCompanyId(headerData.getCompanyId());
+        String type = reportTemplateDTO.getType();
+        String tabulationTime = "";
+        if (ReportTypeEnum.DAY.getStatus().equals(type)) {
+            tabulationTime = ReportTypeEnum.DAY.getValue();
+        } else if (ReportTypeEnum.WEEK.getStatus().equals(type)) {
+            tabulationTime = ReportTypeEnum.WEEK.getValue();
+        } else if (ReportTypeEnum.MONTH.getStatus().equals(type)) {
+            tabulationTime = ReportTypeEnum.MONTH.getValue();
+        } else {
+            throw new BusinessException("报表类型错误");
+        }
+        template.setTabulationTime(tabulationTime);
+        template.setType(Integer.valueOf(reportTemplateDTO.getType()));
+        template.setPartNames(reportTemplateDTO.getPartNames());
+        template.setIntergrationNames(reportTemplateDTO.getIntergrationNames());
+        template.setStatus(Integer.valueOf(reportTemplateDTO.getStatus()));
+        template.setCreateBy(headerData.getCreateBy() == null ? null : Long.parseLong(headerData.getCreateBy()));
+        LocalDateTime now = LocalDateTime.now();
+        template.setCreateTime(now);
+        template.setUpdateTime(now);
+        reportTemplateMapper.insert(template);
+        return HttpResult.ok();
+    }
+
+    public HttpResult detail(String id, HttpServletRequest request) {
+        KwsReportTemplate template = reportTemplateMapper.selectOne(new LambdaQueryWrapper<KwsReportTemplate>().eq(KwsReportTemplate::getId, id));
+        if (template == null) {
+            return HttpResult.ok(new KwsReportTemplate());
+        }
+        KwsReportTemplateVO vo = new KwsReportTemplateVO();
+        BeanUtils.copyProperties(template, vo);
+
+        return HttpResult.ok(vo);
+    }
+
+    @Transactional
+    public HttpResult update(ReportTemplateUpdateDTO reportTemplateUpdateDTO, HttpServletRequest request) {
+        HeaderData headerData = commonService.getHeaderData(request);
+        String id = reportTemplateUpdateDTO.getId();
+        KwsReportTemplate template = reportTemplateMapper.selectOne(new LambdaQueryWrapper<KwsReportTemplate>().eq(KwsReportTemplate::getId, id));
+        if (template == null) {
+            return HttpResult.ok(new KwsReportTemplate());
+        }
+//        template.setProjectId();
+        template.setName(reportTemplateUpdateDTO.getName());
+//        template.setCompanyId();
+        String type = reportTemplateUpdateDTO.getType();
+        String tabulationTime = "";
+        if (ReportTypeEnum.DAY.getStatus().equals(type)) {
+            tabulationTime = ReportTypeEnum.DAY.getValue();
+        } else if (ReportTypeEnum.WEEK.getStatus().equals(type)) {
+            tabulationTime = ReportTypeEnum.WEEK.getValue();
+        } else if (ReportTypeEnum.MONTH.getStatus().equals(type)) {
+            tabulationTime = ReportTypeEnum.MONTH.getValue();
+        } else {
+            throw new BusinessException("报表类型错误");
+        }
+        template.setTabulationTime(tabulationTime);
+        template.setType(Integer.valueOf(type));
+        template.setPartNames(reportTemplateUpdateDTO.getPartNames());
+        template.setIntergrationNames(reportTemplateUpdateDTO.getIntergrationNames());
+        template.setStatus(Integer.parseInt(reportTemplateUpdateDTO.getStatus()));
+        template.setUpdateBy(headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
+        template.setUpdateTime(LocalDateTime.now());
+        return HttpResult.ok();
+    }
+
+    @Transactional
+    public HttpResult enable(IsEnableDTO isEnable, HttpServletRequest request) {
+        HeaderData headerData = commonService.getHeaderData(request);
+        String status = "0";
+        if (!isEnable.isFlag()) {
+            status = "1";
+        }
+        reportTemplateMapper.update(null, new LambdaUpdateWrapper<KwsReportTemplate>()
+                .set(KwsReportTemplate::getStatus, status)
+                .set(KwsReportTemplate::getUpdateTime, LocalDateTime.now())
+                .set(KwsReportTemplate::getUpdateBy, (headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy())))
+                .eq(KwsReportTemplate::getId, isEnable.getId())
+        );
+        return HttpResult.ok("修改成功");
+    }
+}

+ 158 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ThresholdService.java

@@ -0,0 +1,158 @@
+package com.sckw.slope.detection.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.sckw.core.model.constant.NumberConstant;
+import com.sckw.core.model.enums.DeviceEnum;
+import com.sckw.core.model.page.PageRes;
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.slope.detection.dao.mysql.*;
+import com.sckw.slope.detection.model.dos.mysql.KwsDeviceReference;
+import com.sckw.slope.detection.model.dos.mysql.KwsThreshold;
+import com.sckw.slope.detection.model.dto.DeviceElementDTO;
+import com.sckw.slope.detection.model.dto.HeaderData;
+import com.sckw.slope.detection.model.dto.ThresholdSelectDTO;
+import com.sckw.slope.detection.model.param.ThresholdDetailQuery;
+import com.sckw.slope.detection.model.param.ThresholdQuery;
+import com.sckw.slope.detection.model.vo.ThresholdDetailVO;
+import jakarta.servlet.http.HttpServletRequest;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @author lfdc
+ * @description 阈值service
+ * @date 2023-11-01 16:11:03
+ */
+@Slf4j
+@Service
+public class ThresholdService {
+
+    @Autowired
+    CommonService commonService;
+
+    @Autowired
+    KwsDeviceModelPartMapper deviceModelPartMapper;
+
+    @Autowired
+    KwsDeviceMapper deviceMapper;
+
+    @Autowired
+    KwsDeviceIntegrationMapper deviceIntegrationMapper;
+
+    @Autowired
+    KwsThresholdMapper thresholdMapper;
+
+    @Autowired
+    KwsDeviceReferenceMapper deviceReferenceMapper;
+
+    public PageRes select(ThresholdQuery thresholdQuery, HttpServletRequest request) {
+        PageHelper.startPage(thresholdQuery.getPage(), thresholdQuery.getPageSize());
+        HeaderData headerData = commonService.getHeaderData(request);
+        List<Integer> status = new ArrayList<>();
+        status.add(DeviceEnum.ALREADY_REFERRED_TO.getCode());
+        List<ThresholdSelectDTO> dtoList = deviceMapper.selectDeviceAllByProjectAndMountainId(thresholdQuery.getProjectId(), headerData.getMountainId(), status);
+        PageInfo<ThresholdSelectDTO> info = new PageInfo<>(dtoList);
+        if (CollectionUtils.isEmpty(dtoList)) {
+            return PageRes.build(info, dtoList);
+        }
+        for (ThresholdSelectDTO dto : dtoList) {
+            Long deviceId = dto.getDeviceId();
+            //基本要素
+            List<DeviceElementDTO> basiclElementList = deviceModelPartMapper.selectElementList(thresholdQuery.getProjectId(),
+                    headerData.getMountainId(), status, deviceId);
+            //集成要素
+            List<DeviceElementDTO> integratedElementList = deviceIntegrationMapper.selectIntegratedElement(thresholdQuery.getProjectId(),
+                    headerData.getMountainId(), status, deviceId);
+            List<KwsThreshold> kwsThresholds = thresholdMapper.selectList(new LambdaQueryWrapper<KwsThreshold>()
+                    .eq(KwsThreshold::getDeviceId, deviceId)
+                    .eq(KwsThreshold::getMountainId, headerData.getMountainId())
+                    .eq(KwsThreshold::getDelFlag, NumberConstant.ZERO)
+                    .orderByDesc(KwsThreshold::getUpdateTime)
+            );
+            String setting = "0";
+            String statusName = "未设置";
+            if (!CollectionUtils.isEmpty(kwsThresholds)) {
+                setting = kwsThresholds.get(0).getSetting();
+                if ("1".equals(setting)) {
+                    statusName = "部分设置";
+                } else {
+                    setting = "2";
+                    statusName = "已设置";
+                }
+            }
+            dto.setId(thresholdQuery.getProjectId());
+            StringBuilder phones = new StringBuilder();
+            if (!CollectionUtils.isEmpty(kwsThresholds)) {
+                for (int i = 0; i < kwsThresholds.size(); i++) {
+                    if (i != (kwsThresholds.size() - 1)) {
+                        phones.append(kwsThresholds.get(i).getPhones()).append(",");
+                    } else {
+                        phones.append(kwsThresholds.get(i).getPhones());
+                    }
+                }
+            }
+            //翻译
+            List<String> collect = basiclElementList.stream().map(DeviceElementDTO::getElement).collect(Collectors.toList());
+            List<String> collect1 = integratedElementList.stream().map(DeviceElementDTO::getIntegrationElement).collect(Collectors.toList());
+            dto.setItemName(collect.toString() + collect1.toString());
+//            dto.setDeviceTotal();
+            int deviceSetTotal = 0;
+            if (!CollectionUtils.isEmpty(kwsThresholds)) {
+                deviceSetTotal = kwsThresholds.stream().map(KwsThreshold::getItemName).distinct().collect(Collectors.toList()).size();
+            }
+            dto.setDeviceSetTotal(deviceSetTotal);
+            dto.setDeviceName(dto.getDeviceName());
+            dto.setStatus(setting);
+            dto.setStatusName(statusName);
+            dto.setPhones(phones.toString());
+            dto.setUpdateByName(CollectionUtils.isEmpty(kwsThresholds) ? null : kwsThresholds.get(0).getUpdateName());
+            dto.setUpdateTime(CollectionUtils.isEmpty(kwsThresholds) ? null : kwsThresholds.get(0).getUpdateTime());
+        }
+        return PageRes.build(info, dtoList);
+    }
+
+    public HttpResult detail(ThresholdDetailQuery thresholdQuery, HttpServletRequest request) {
+        String deviceId = thresholdQuery.getDeviceId();
+        String itemName = thresholdQuery.getItemName();
+        HeaderData headerData = commonService.getHeaderData(request);
+        String mountainId = headerData.getMountainId();
+        List<KwsThreshold> kwsThreshold = thresholdMapper.selectList(new LambdaQueryWrapper<KwsThreshold>()
+                .eq(KwsThreshold::getDeviceId, Long.parseLong(deviceId))
+                .eq(KwsThreshold::getItemName, itemName)
+                .eq(KwsThreshold::getMountainId, mountainId)
+                .eq(KwsThreshold::getDelFlag, NumberConstant.ZERO)
+        );
+        KwsDeviceReference deviceReference = deviceReferenceMapper.selectOne(new LambdaQueryWrapper<KwsDeviceReference>()
+                .eq(KwsDeviceReference::getMountainId, mountainId)
+                .eq(KwsDeviceReference::getDeviceId, deviceId)
+                .eq(KwsDeviceReference::getItem, itemName)
+        );
+        ThresholdDetailVO vo = new ThresholdDetailVO();
+        if (!CollectionUtils.isEmpty(kwsThreshold)) {
+            vo.setPhones(kwsThreshold.get(0).getPhones());
+            vo.setItemName(itemName);
+            vo.setDeviceId(deviceId);
+            vo.setItemValue(deviceReference == null ? null : deviceReference.getValue());
+            //查询td获取数据
+//            vo.setVariation();
+            List<ThresholdDetailVO.ThresholdBean> beanList = new ArrayList<>();
+            for (KwsThreshold threshold : kwsThreshold) {
+                ThresholdDetailVO.ThresholdBean bean = new ThresholdDetailVO.ThresholdBean();
+                bean.setLevel(threshold.getLevel().toString());
+                bean.setMax(threshold.getMax());
+                bean.setMin(threshold.getMin());
+                beanList.add(bean);
+            }
+            vo.setThreshold(beanList);
+        }
+        return HttpResult.ok(vo);
+    }
+}

+ 2 - 0
slope-modules/slope-detection/src/main/resources/bootstrap.yml

@@ -6,7 +6,9 @@ spring:
     name: slope-detection
 #    name: slope-detection
   profiles:
+
     active: sky
+    #active: ${DEPLOY_MODE:dev}
   main:
     allow-bean-definition-overriding: true
     allow-circular-references: true

+ 32 - 1
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceIntegrationMapper.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.sckw.slope.detection.dao.KwsDeviceIntegrationMapper">
+<mapper namespace="com.sckw.slope.detection.dao.mysql.KwsDeviceIntegrationMapper">
     <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsDeviceIntegration">
         <!--@mbg.generated-->
         <!--@Table kws_device_integration-->
@@ -156,4 +156,35 @@
             del_flag       = #{delFlag,jdbcType=TINYINT}
         where id = #{id,jdbcType=BIGINT}
     </update>
+
+    <select id="selectIntegratedElement" resultType="com.sckw.slope.detection.model.dto.DeviceElementDTO">
+        SELECT a.id             as deviceId,
+               c.`name`,
+               c.alias,
+               e.integration_id as element
+        FROM kws_project a
+                 LEFT JOIN kws_project_device b ON a.id = b.project_id
+                 LEFT JOIN kws_device c ON b.device_id = c.id
+                 LEFT JOIN kws_device_integration e ON c.id = e.device_id
+        WHERE a.del_flag = 0
+          and e.del_flag = 0
+          and b.del_flag = 0
+          and c.del_flag = 0
+          and a.mountain_id = c.mountain_id
+        <if test="status != null and status.size() > 0">
+            and c.status in
+            <foreach collection="status" item="status" close=")" open="(" separator=",">
+                #{status}
+            </foreach>
+        </if>
+        <if test="projectId != null and projectId != ''">
+            and a.project_id = #{projectId}
+        </if>
+        <if test="mountainId != null and mountainId != ''">
+            and a.mountain_id = #{mountainId}
+        </if>
+        <if test="deviceId != null  and deviceId != ''">
+            and b.device_id = #{deviceId}
+        </if>
+    </select>
 </mapper>

+ 242 - 184
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceMapper.xml

@@ -51,11 +51,6 @@
       </if>
     </where>
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
-    <!--@mbg.generated-->
-    delete from kws_device
-    where id = #{id,jdbcType=BIGINT}
-  </delete>
   <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDevice">
     <!--@mbg.generated-->
     insert into kws_device (id, `attribute`, `name`, 
@@ -71,184 +66,247 @@
       #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, 
       #{delFlag,jdbcType=TINYINT},#{related,jdbcType=BIGINT})
   </insert>
-  <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDevice">
-    <!--@mbg.generated-->
-    insert into kws_device
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
-      <if test="attribute != null">
-        `attribute`,
-      </if>
-      <if test="name != null">
-        `name`,
-      </if>
-      <if test="alias != null">
-        `alias`,
-      </if>
-      <if test="snCode != null">
-        sn_code,
-      </if>
-      <if test="modelId != null">
-        model_id,
-      </if>
-      <if test="validTime != null">
-        valid_time,
-      </if>
-      <if test="secretKey != null">
-        secret_key,
-      </if>
-      <if test="interFace != null">
-        interface,
-      </if>
-      <if test="remark != null">
-        remark,
-      </if>
-      <if test="status != null">
-        `status`,
-      </if>
-      <if test="createBy != null">
-        create_by,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-      <if test="updateBy != null">
-        update_by,
-      </if>
-      <if test="updateTime != null">
-        update_time,
-      </if>
-      <if test="delFlag != null">
-        del_flag,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=BIGINT},
-      </if>
-      <if test="attribute != null">
-        #{attribute,jdbcType=INTEGER},
-      </if>
-      <if test="name != null">
-        #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="alias != null">
-        #{alias,jdbcType=VARCHAR},
-      </if>
-      <if test="snCode != null">
-        #{snCode,jdbcType=VARCHAR},
-      </if>
-      <if test="modelId != null">
-        #{modelId,jdbcType=BIGINT},
-      </if>
-      <if test="validTime != null">
-        #{validTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="secretKey != null">
-        #{secretKey,jdbcType=VARCHAR},
-      </if>
-      <if test="interFace != null">
-        #{interFace,jdbcType=VARCHAR},
-      </if>
-      <if test="remark != null">
-        #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        #{status,jdbcType=TINYINT},
-      </if>
-      <if test="createBy != null">
-        #{createBy,jdbcType=BIGINT},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        #{updateBy,jdbcType=BIGINT},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        #{delFlag,jdbcType=TINYINT},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDevice">
-    <!--@mbg.generated-->
-    update kws_device
-    <set>
-      <if test="attribute != null">
-        `attribute` = #{attribute,jdbcType=INTEGER},
-      </if>
-      <if test="name != null">
-        `name` = #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="alias != null">
-        `alias` = #{alias,jdbcType=VARCHAR},
-      </if>
-      <if test="snCode != null">
-        sn_code = #{snCode,jdbcType=VARCHAR},
-      </if>
-      <if test="modelId != null">
-        model_id = #{modelId,jdbcType=BIGINT},
-      </if>
-      <if test="validTime != null">
-        valid_time = #{validTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="secretKey != null">
-        secret_key = #{secretKey,jdbcType=VARCHAR},
-      </if>
-      <if test="interFace != null">
-        inter_face = #{interFace,jdbcType=VARCHAR},
-      </if>
-      <if test="remark != null">
-        remark = #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        `status` = #{status,jdbcType=TINYINT},
-      </if>
-      <if test="createBy != null">
-        create_by = #{createBy,jdbcType=BIGINT},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        update_by = #{updateBy,jdbcType=BIGINT},
-      </if>
-      <if test="updateTime != null">
-        update_time = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        del_flag = #{delFlag,jdbcType=TINYINT},
-      </if>
-    </set>
-    where id = #{id,jdbcType=BIGINT}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDevice">
-    <!--@mbg.generated-->
-    update kws_device
-    set `attribute` = #{attribute,jdbcType=INTEGER},
-      `name` = #{name,jdbcType=VARCHAR},
-      `alias` = #{alias,jdbcType=VARCHAR},
-      sn_code = #{snCode,jdbcType=VARCHAR},
-      model_id = #{modelId,jdbcType=BIGINT},
-      valid_time = #{validTime,jdbcType=TIMESTAMP},
-      secret_key = #{secretKey,jdbcType=VARCHAR},
-      inter_face = #{interFace,jdbcType=VARCHAR},
-      remark = #{remark,jdbcType=VARCHAR},
-      `status` = #{status,jdbcType=TINYINT},
-      create_by = #{createBy,jdbcType=BIGINT},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      update_by = #{updateBy,jdbcType=BIGINT},
-      update_time = #{updateTime,jdbcType=TIMESTAMP},
-      del_flag = #{delFlag,jdbcType=TINYINT}
-    where id = #{id,jdbcType=BIGINT}
-  </update>
 
-  <select id="selectDeviceAllNotDeviceRelation" resultType="com.sckw.slope.detection.model.dto.DeviceDataDTO">
-  
-  </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+        <!--@mbg.generated-->
+        delete
+        from kws_device
+        where id = #{id,jdbcType=BIGINT}
+    </delete>
+
+    <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDevice">
+        <!--@mbg.generated-->
+        insert into kws_device
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                id,
+            </if>
+            <if test="attribute != null">
+                `attribute`,
+            </if>
+            <if test="name != null">
+                `name`,
+            </if>
+            <if test="alias != null">
+                `alias`,
+            </if>
+            <if test="snCode != null">
+                sn_code,
+            </if>
+            <if test="modelId != null">
+                model_id,
+            </if>
+            <if test="validTime != null">
+                valid_time,
+            </if>
+            <if test="secretKey != null">
+                secret_key,
+            </if>
+            <if test="interFace != null">
+                interface,
+            </if>
+            <if test="remark != null">
+                remark,
+            </if>
+            <if test="status != null">
+                `status`,
+            </if>
+            <if test="createBy != null">
+                create_by,
+            </if>
+            <if test="createTime != null">
+                create_time,
+            </if>
+            <if test="updateBy != null">
+                update_by,
+            </if>
+            <if test="updateTime != null">
+                update_time,
+            </if>
+            <if test="delFlag != null">
+                del_flag,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=BIGINT},
+            </if>
+            <if test="attribute != null">
+                #{attribute,jdbcType=INTEGER},
+            </if>
+            <if test="name != null">
+                #{name,jdbcType=VARCHAR},
+            </if>
+            <if test="alias != null">
+                #{alias,jdbcType=VARCHAR},
+            </if>
+            <if test="snCode != null">
+                #{snCode,jdbcType=VARCHAR},
+            </if>
+            <if test="modelId != null">
+                #{modelId,jdbcType=BIGINT},
+            </if>
+            <if test="validTime != null">
+                #{validTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="secretKey != null">
+                #{secretKey,jdbcType=VARCHAR},
+            </if>
+            <if test="interFace != null">
+                #{interFace,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null">
+                #{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="status != null">
+                #{status,jdbcType=TINYINT},
+            </if>
+            <if test="createBy != null">
+                #{createBy,jdbcType=BIGINT},
+            </if>
+            <if test="createTime != null">
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateBy != null">
+                #{updateBy,jdbcType=BIGINT},
+            </if>
+            <if test="updateTime != null">
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="delFlag != null">
+                #{delFlag,jdbcType=TINYINT},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDevice">
+        <!--@mbg.generated-->
+        update kws_device
+        <set>
+            <if test="attribute != null">
+                `attribute` = #{attribute,jdbcType=INTEGER},
+            </if>
+            <if test="name != null">
+                `name` = #{name,jdbcType=VARCHAR},
+            </if>
+            <if test="alias != null">
+                `alias` = #{alias,jdbcType=VARCHAR},
+            </if>
+            <if test="snCode != null">
+                sn_code = #{snCode,jdbcType=VARCHAR},
+            </if>
+            <if test="modelId != null">
+                model_id = #{modelId,jdbcType=BIGINT},
+            </if>
+            <if test="validTime != null">
+                valid_time = #{validTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="secretKey != null">
+                secret_key = #{secretKey,jdbcType=VARCHAR},
+            </if>
+            <if test="interFace != null">
+                inter_face = #{interFace,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null">
+                remark = #{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="status != null">
+                `status` = #{status,jdbcType=TINYINT},
+            </if>
+            <if test="createBy != null">
+                create_by = #{createBy,jdbcType=BIGINT},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateBy != null">
+                update_by = #{updateBy,jdbcType=BIGINT},
+            </if>
+            <if test="updateTime != null">
+                update_time = #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="delFlag != null">
+                del_flag = #{delFlag,jdbcType=TINYINT},
+            </if>
+        </set>
+        where id = #{id,jdbcType=BIGINT}
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDevice">
+        <!--@mbg.generated-->
+        update kws_device
+        set `attribute` = #{attribute,jdbcType=INTEGER},
+            `name`      = #{name,jdbcType=VARCHAR},
+            `alias`     = #{alias,jdbcType=VARCHAR},
+            sn_code     = #{snCode,jdbcType=VARCHAR},
+            model_id    = #{modelId,jdbcType=BIGINT},
+            valid_time  = #{validTime,jdbcType=TIMESTAMP},
+            secret_key  = #{secretKey,jdbcType=VARCHAR},
+            inter_face  = #{interFace,jdbcType=VARCHAR},
+            remark      = #{remark,jdbcType=VARCHAR},
+            `status`    = #{status,jdbcType=TINYINT},
+            create_by   = #{createBy,jdbcType=BIGINT},
+            create_time = #{createTime,jdbcType=TIMESTAMP},
+            update_by   = #{updateBy,jdbcType=BIGINT},
+            update_time = #{updateTime,jdbcType=TIMESTAMP},
+            del_flag    = #{delFlag,jdbcType=TINYINT}
+        where id = #{id,jdbcType=BIGINT}
+    </update>
+
+    <select id="selectDeviceAllNotDeviceRelation" resultType="com.sckw.slope.detection.model.dto.DeviceDataDTO">
+        SELECT c.id     AS deviceId,
+               c.alias  as deviceAlias,
+               c.`name` AS deviceName
+        FROM kws_project a
+                 LEFT JOIN kws_device c ON a.mountain_id = c.mountain_id
+                 LEFT JOIN kws_device_model d ON c.model_id = d.id
+        WHERE a.del_flag = 0
+          AND c.del_flag = 0
+          AND d.del_flag = 0
+          AND c.id NOT in (SELECT DISTINCT a.relate_device_id
+                           FROM kws_device_relation a
+                                    LEFT JOIN kws_project b ON a.mountain_id = b.mountain_id)
+          AND c.id NOT in (SELECT DISTINCT a.device_id
+                           FROM kws_device_relation a
+                                    LEFT JOIN kws_project b ON a.mountain_id = b.mountain_id)
+        <if test="projectId != null and projectId != ''">
+            AND a.id = #{projectId}
+        </if>
+    </select>
+
+    <select id="selectDeviceAllAndProjectData"
+            resultType="com.sckw.slope.detection.model.vo.AffiliationDeviceVO">
+        SELECT a.id        as deviceId,
+               a.`name`    as name,
+               a.attribute as attribute,
+               a.alias     as alias,
+               a.logic_alt as logicAlt,
+               a.logic_lat as logicLat,
+               a.logic_lng as logicLng
+        FROM kws_device a
+                 LEFT JOIN kws_project_device b ON a.id = b.device_id
+                 LEFT JOIN kws_project c ON b.project_id = c.id
+        WHERE c.id = #{projectId}
+    </select>
+
+    <select id="selectDeviceAllByProjectAndMountainId" resultType="com.sckw.slope.detection.model.dto.ThresholdSelectDTO">
+        SELECT b.id     AS deviceId,
+               b.alias  AS deviceAlias,
+               b.`name` AS deviceName
+        FROM kws_project_device a
+                 LEFT JOIN kws_device b ON a.device_id = b.id
+        WHERE a.del_flag = 0
+          AND b.del_flag = 0
+          AND a.mountain_id = b.mountain_id
+        <if test="projectId != null and projectId != ''">
+            and a.project_id = #{projectId}
+        </if>
+        <if test="mountainId != null and mountainId != ''">
+            and a.mountain_id = #{mountainId}
+        </if>
+        <if test="status != null and status.size() > 0">
+            and b.status in
+            <foreach collection="status" separator="," open="(" close=")" item="status">
+                #{status}
+            </foreach>
+        </if>
+    </select>
 </mapper>

+ 61 - 0
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceModelPartMapper.xml

@@ -148,4 +148,65 @@
       del_flag = #{delFlag,jdbcType=TINYINT}
     where id = #{id,jdbcType=BIGINT}
   </update>
+
+  <select id="selectElementList" resultType="com.sckw.slope.detection.model.dto.DeviceElementDTO">
+      SELECT b.id              as deviceId,
+             b.name,
+             b.alias,
+             d.device_model_id as deviceModelId,
+             d.part_name       as element
+      FROM kws_project_device a
+               LEFT JOIN kws_device b ON a.device_id = b.id
+               LEFT JOIN kws_device_model c ON b.model_id = c.id
+               LEFT JOIN kws_device_model_part d ON c.id = d.device_model_id
+      WHERE a.del_flag = 0
+        and b.del_flag = 0
+        and c.del_flag = 0
+        and d.del_flag = 0
+      <if test="status != null and status.size() > 0">
+          and b.status in
+          <foreach collection="status" separator="," open="(" close=")" item="status">
+              #{status}
+          </foreach>
+      </if>
+      <if test="mountainId != null and mountainId != ''">
+          and a.mountain_id = #{mountainId}
+      </if>
+      <if test="projectId != null and projectId != ''">
+          and a.project_id = #{projectId}
+      </if>
+      <if test="deviceId != null and deviceId != ''">
+          and b.device_id = #{deviceId}
+      </if>
+  </select>
+
+  <select id="selectElementAllList" resultType="com.sckw.slope.detection.model.dto.DeviceElementDTO">
+      SELECT a.id              as deviceId,
+      b.name,
+      b.alias,
+      e.phones as phones,
+      d.device_model_id as deviceModelId,
+      d.part_name       as element,
+      e.integration_id       as integrationElement,
+      e.update_name       as updateName,
+      e.update_time       as updatTime,
+      FROM kws_project_device a
+      LEFT JOIN kws_device b ON a.device_id = b.id
+      LEFT JOIN kws_device_model c ON b.model_id = c.id
+      LEFT JOIN kws_device_model_part d ON c.id = d.device_model_id
+      LEFT JOIN kws_threshold e ON b.id = e.device_id
+      WHERE a.del_flag = 0
+      and b.del_flag = 0
+      and c.del_flag = 0
+      and d.del_flag = 0
+      and e.del_flag = 0
+      <if test="status != null and status.size() > 0">
+          and b.status in
+          <foreach collection="status" separator="," open="(" close=")" item="status">
+              #{status}
+          </foreach>
+      </if>
+      and a.mountain_id = #{mountainId}
+      and a.project_id = #{projectId}
+    </select>
 </mapper>

+ 173 - 159
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceReferenceMapper.xml

@@ -1,174 +1,188 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.sckw.slope.detection.dao.mysql.KwsDeviceReferenceMapper">
-  <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsDeviceReference">
-    <!--@mbg.generated-->
-    <!--@Table kws_device_reference-->
-    <id column="id" jdbcType="BIGINT" property="id" />
-    <result column="device_id" jdbcType="BIGINT" property="deviceId" />
-    <result column="item" jdbcType="VARCHAR" property="item" />
-    <result column="value" jdbcType="DECIMAL" property="value" />
-    <result column="offset" jdbcType="DECIMAL" property="offset" />
-    <result column="status" jdbcType="TINYINT" property="status" />
-      <result column="company_id" jdbcType="VARCHAR" property="companyId" />
-    <result column="create_by" jdbcType="BIGINT" property="createBy" />
-    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="update_by" jdbcType="BIGINT" property="updateBy" />
-    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
-    <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
-  </resultMap>
-  <sql id="Base_Column_List">
-    <!--@mbg.generated-->
-    id, device_id, item, `value`, `offset`, `status`, create_by, create_time, update_by, 
-    update_time, del_flag,company_id
-  </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
-    <!--@mbg.generated-->
-    select 
-    <include refid="Base_Column_List" />
-    from kws_device_reference
-    where id = #{id,jdbcType=BIGINT}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
-    <!--@mbg.generated-->
-    delete from kws_device_reference
-    where id = #{id,jdbcType=BIGINT}
-  </delete>
-  <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceReference">
-    <!--@mbg.generated-->
-    insert into kws_device_reference (id, device_id, item, 
-      `value`, `offset`, `status`, 
-      create_by, create_time, update_by, 
-      update_time, del_flag)
-    values (#{id,jdbcType=BIGINT}, #{deviceId,jdbcType=BIGINT}, #{item,jdbcType=VARCHAR}, 
-      #{value,jdbcType=DECIMAL}, #{offset,jdbcType=DECIMAL}, #{status,jdbcType=TINYINT}, 
-      #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT}, 
-      #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT})
-  </insert>
-  <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceReference">
-    <!--@mbg.generated-->
-    insert into kws_device_reference
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
+    <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsDeviceReference">
+        <!--@mbg.generated-->
+        <!--@Table kws_device_reference-->
+        <id column="id" jdbcType="BIGINT" property="id"/>
+        <result column="device_id" jdbcType="BIGINT" property="deviceId"/>
+        <result column="item" jdbcType="VARCHAR" property="item"/>
+        <result column="value" jdbcType="DECIMAL" property="value"/>
+        <result column="offset" jdbcType="DECIMAL" property="offset"/>
+        <result column="status" jdbcType="TINYINT" property="status"/>
+        <result column="company_id" jdbcType="VARCHAR" property="companyId"/>
+        <result column="mountain_id" jdbcType="VARCHAR" property="mountainId"/>
+        <result column="create_by" jdbcType="BIGINT" property="createBy"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="update_by" jdbcType="BIGINT" property="updateBy"/>
+        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
+        <result column="del_flag" jdbcType="TINYINT" property="delFlag"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
         id,
-      </if>
-      <if test="deviceId != null">
         device_id,
-      </if>
-      <if test="item != null">
+        mountain_id,
         item,
-      </if>
-      <if test="value != null">
         `value`,
-      </if>
-      <if test="offset != null">
         `offset`,
-      </if>
-      <if test="status != null">
         `status`,
-      </if>
-      <if test="createBy != null">
         create_by,
-      </if>
-      <if test="createTime != null">
         create_time,
-      </if>
-      <if test="updateBy != null">
         update_by,
-      </if>
-      <if test="updateTime != null">
         update_time,
-      </if>
-      <if test="delFlag != null">
         del_flag,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=BIGINT},
-      </if>
-      <if test="deviceId != null">
-        #{deviceId,jdbcType=BIGINT},
-      </if>
-      <if test="item != null">
-        #{item,jdbcType=VARCHAR},
-      </if>
-      <if test="value != null">
-        #{value,jdbcType=DECIMAL},
-      </if>
-      <if test="offset != null">
-        #{offset,jdbcType=DECIMAL},
-      </if>
-      <if test="status != null">
-        #{status,jdbcType=TINYINT},
-      </if>
-      <if test="createBy != null">
-        #{createBy,jdbcType=BIGINT},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        #{updateBy,jdbcType=BIGINT},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        #{delFlag,jdbcType=TINYINT},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceReference">
-    <!--@mbg.generated-->
-    update kws_device_reference
-    <set>
-      <if test="deviceId != null">
-        device_id = #{deviceId,jdbcType=BIGINT},
-      </if>
-      <if test="item != null">
-        item = #{item,jdbcType=VARCHAR},
-      </if>
-      <if test="value != null">
-        `value` = #{value,jdbcType=DECIMAL},
-      </if>
-      <if test="offset != null">
-        `offset` = #{offset,jdbcType=DECIMAL},
-      </if>
-      <if test="status != null">
-        `status` = #{status,jdbcType=TINYINT},
-      </if>
-      <if test="createBy != null">
-        create_by = #{createBy,jdbcType=BIGINT},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        update_by = #{updateBy,jdbcType=BIGINT},
-      </if>
-      <if test="updateTime != null">
-        update_time = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        del_flag = #{delFlag,jdbcType=TINYINT},
-      </if>
-    </set>
-    where id = #{id,jdbcType=BIGINT}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceReference">
-    <!--@mbg.generated-->
-    update kws_device_reference
-    set device_id = #{deviceId,jdbcType=BIGINT},
-      item = #{item,jdbcType=VARCHAR},
-      `value` = #{value,jdbcType=DECIMAL},
-      `offset` = #{offset,jdbcType=DECIMAL},
-      `status` = #{status,jdbcType=TINYINT},
-      create_by = #{createBy,jdbcType=BIGINT},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      update_by = #{updateBy,jdbcType=BIGINT},
-      update_time = #{updateTime,jdbcType=TIMESTAMP},
-      del_flag = #{delFlag,jdbcType=TINYINT}
-    where id = #{id,jdbcType=BIGINT}
-  </update>
+        company_id
+    </sql>
+    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+        <!--@mbg.generated-->
+        select
+        <include refid="Base_Column_List"/>
+        from kws_device_reference
+        where id = #{id,jdbcType=BIGINT}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+        <!--@mbg.generated-->
+        delete
+        from kws_device_reference
+        where id = #{id,jdbcType=BIGINT}
+    </delete>
+    <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceReference">
+        <!--@mbg.generated-->
+        insert into kws_device_reference (id, device_id, item,
+                                          `value`, `offset`, `status`,
+                                          create_by, create_time, update_by,
+                                          update_time, del_flag)
+        values (#{id,jdbcType=BIGINT}, #{deviceId,jdbcType=BIGINT}, #{item,jdbcType=VARCHAR},
+                #{value,jdbcType=DECIMAL}, #{offset,jdbcType=DECIMAL}, #{status,jdbcType=TINYINT},
+                #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT},
+                #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT})
+    </insert>
+    <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceReference">
+        <!--@mbg.generated-->
+        insert into kws_device_reference
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                id,
+            </if>
+            <if test="deviceId != null">
+                device_id,
+            </if>
+            <if test="item != null">
+                item,
+            </if>
+            <if test="value != null">
+                `value`,
+            </if>
+            <if test="offset != null">
+                `offset`,
+            </if>
+            <if test="status != null">
+                `status`,
+            </if>
+            <if test="createBy != null">
+                create_by,
+            </if>
+            <if test="createTime != null">
+                create_time,
+            </if>
+            <if test="updateBy != null">
+                update_by,
+            </if>
+            <if test="updateTime != null">
+                update_time,
+            </if>
+            <if test="delFlag != null">
+                del_flag,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=BIGINT},
+            </if>
+            <if test="deviceId != null">
+                #{deviceId,jdbcType=BIGINT},
+            </if>
+            <if test="item != null">
+                #{item,jdbcType=VARCHAR},
+            </if>
+            <if test="value != null">
+                #{value,jdbcType=DECIMAL},
+            </if>
+            <if test="offset != null">
+                #{offset,jdbcType=DECIMAL},
+            </if>
+            <if test="status != null">
+                #{status,jdbcType=TINYINT},
+            </if>
+            <if test="createBy != null">
+                #{createBy,jdbcType=BIGINT},
+            </if>
+            <if test="createTime != null">
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateBy != null">
+                #{updateBy,jdbcType=BIGINT},
+            </if>
+            <if test="updateTime != null">
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="delFlag != null">
+                #{delFlag,jdbcType=TINYINT},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective"
+            parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceReference">
+        <!--@mbg.generated-->
+        update kws_device_reference
+        <set>
+            <if test="deviceId != null">
+                device_id = #{deviceId,jdbcType=BIGINT},
+            </if>
+            <if test="item != null">
+                item = #{item,jdbcType=VARCHAR},
+            </if>
+            <if test="value != null">
+                `value` = #{value,jdbcType=DECIMAL},
+            </if>
+            <if test="offset != null">
+                `offset` = #{offset,jdbcType=DECIMAL},
+            </if>
+            <if test="status != null">
+                `status` = #{status,jdbcType=TINYINT},
+            </if>
+            <if test="createBy != null">
+                create_by = #{createBy,jdbcType=BIGINT},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateBy != null">
+                update_by = #{updateBy,jdbcType=BIGINT},
+            </if>
+            <if test="updateTime != null">
+                update_time = #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="delFlag != null">
+                del_flag = #{delFlag,jdbcType=TINYINT},
+            </if>
+        </set>
+        where id = #{id,jdbcType=BIGINT}
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceReference">
+        <!--@mbg.generated-->
+        update kws_device_reference
+        set device_id   = #{deviceId,jdbcType=BIGINT},
+            item        = #{item,jdbcType=VARCHAR},
+            `value`     = #{value,jdbcType=DECIMAL},
+            `offset`    = #{offset,jdbcType=DECIMAL},
+            `status`    = #{status,jdbcType=TINYINT},
+            create_by   = #{createBy,jdbcType=BIGINT},
+            create_time = #{createTime,jdbcType=TIMESTAMP},
+            update_by   = #{updateBy,jdbcType=BIGINT},
+            update_time = #{updateTime,jdbcType=TIMESTAMP},
+            del_flag    = #{delFlag,jdbcType=TINYINT}
+        where id = #{id,jdbcType=BIGINT}
+    </update>
 </mapper>

+ 18 - 0
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDictMapper.xml

@@ -183,4 +183,22 @@
       del_flag = #{delFlag,jdbcType=TINYINT}
     where id = #{id,jdbcType=BIGINT}
   </update>
+
+  <select id="selectListAll" resultType="com.sckw.slope.detection.model.vo.QueryDictTypePageReqVo">
+      select id,
+             value,
+             label,
+             type_code as typeCode
+      from kws_dict
+      where del_flag = 0
+      <if test="reqVo.label != null and reqVo.label != ''">
+          and label = #{reqVo.label}
+      </if>
+      <if test="reqVo.typeCode != null and reqVo.typeCode != ''">
+          and type_code = #{reqVo.typeCode}
+      </if>
+      <if test="reqVo.value != null and reqVo.value != ''">
+          and value = #{reqVo.value,jdbcType=VARCHAR}
+      </if>
+  </select>
 </mapper>

+ 96 - 0
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsMountainCompanyMapper.xml

@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.sckw.slope.detection.dao.KwsMountainCompanyMapper">
+    <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsMountainCompany">
+        <!--@mbg.generated-->
+        <!--@Table kws_mountain_company-->
+        <id column="id" jdbcType="BIGINT" property="id"/>
+        <result column="mountain_id" jdbcType="VARCHAR" property="mountainId"/>
+        <result column="company_id" jdbcType="VARCHAR" property="companyId"/>
+        <result column="del_flag" jdbcType="TINYINT" property="delFlag"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
+        id,
+        mountain_id,
+        company_id,
+        del_flag
+    </sql>
+    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+        <!--@mbg.generated-->
+        select
+        <include refid="Base_Column_List"/>
+        from kws_mountain_company
+        where id = #{id,jdbcType=BIGINT}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+        <!--@mbg.generated-->
+        delete
+        from kws_mountain_company
+        where id = #{id,jdbcType=BIGINT}
+    </delete>
+    <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsMountainCompany">
+        <!--@mbg.generated-->
+        insert into kws_mountain_company (id, mountain_id, company_id,
+                                          del_flag)
+        values (#{id,jdbcType=BIGINT}, #{mountainId,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR},
+                #{delFlag,jdbcType=TINYINT})
+    </insert>
+    <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsMountainCompany">
+        <!--@mbg.generated-->
+        insert into kws_mountain_company
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                id,
+            </if>
+            <if test="mountainId != null">
+                mountain_id,
+            </if>
+            <if test="companyId != null">
+                company_id,
+            </if>
+            <if test="delFlag != null">
+                del_flag,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=BIGINT},
+            </if>
+            <if test="mountainId != null">
+                #{mountainId,jdbcType=VARCHAR},
+            </if>
+            <if test="companyId != null">
+                #{companyId,jdbcType=VARCHAR},
+            </if>
+            <if test="delFlag != null">
+                #{delFlag,jdbcType=TINYINT},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective"
+            parameterType="com.sckw.slope.detection.model.dos.mysql.KwsMountainCompany">
+        <!--@mbg.generated-->
+        update kws_mountain_company
+        <set>
+            <if test="mountainId != null">
+                mountain_id = #{mountainId,jdbcType=VARCHAR},
+            </if>
+            <if test="companyId != null">
+                company_id = #{companyId,jdbcType=VARCHAR},
+            </if>
+            <if test="delFlag != null">
+                del_flag = #{delFlag,jdbcType=TINYINT},
+            </if>
+        </set>
+        where id = #{id,jdbcType=BIGINT}
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsMountainCompany">
+        <!--@mbg.generated-->
+        update kws_mountain_company
+        set mountain_id = #{mountainId,jdbcType=VARCHAR},
+            company_id  = #{companyId,jdbcType=VARCHAR},
+            del_flag    = #{delFlag,jdbcType=TINYINT}
+        where id = #{id,jdbcType=BIGINT}
+    </update>
+</mapper>

+ 1 - 2
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsProjectAreaMapper.xml

@@ -11,13 +11,12 @@
     <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_by" jdbcType="BIGINT" property="updateBy" />
-      <result column="company_id" jdbcType="VARCHAR" property="companyId" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
   </resultMap>
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
-    id, project_id, fence, area, create_by, create_time, update_by, update_time, del_flag,company_id
+    id, project_id, fence, area, create_by, create_time, update_by, update_time, del_flag<!--,company_id-->
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->

+ 2 - 1
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsProjectDeviceMapper.xml

@@ -7,6 +7,7 @@
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="project_id" jdbcType="BIGINT" property="projectId" />
     <result column="device_id" jdbcType="BIGINT" property="deviceId" />
+    <result column="mountain_id" jdbcType="BIGINT" property="mountainId" />
     <result column="status" jdbcType="TINYINT" property="status" />
     <result column="create_by" jdbcType="BIGINT" property="createBy" />
       <result column="company_id" jdbcType="VARCHAR" property="companyId" />
@@ -18,7 +19,7 @@
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
     id, project_id, device_id, `status`, create_by, create_time, update_by, update_time, 
-    del_flag,company_id
+    del_flag,company_id,mountain_id
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->

+ 145 - 93
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsProjectMapper.xml

@@ -1,99 +1,151 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.sckw.slope.detection.dao.mysql.KwsProjectMapper">
-  <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsProject">
-    <!--@mbg.generated-->
-    <!--@Table kws_project-->
-    <id column="id" jdbcType="BIGINT" property="id" />
-    <result column="name" jdbcType="VARCHAR" property="name" />
-    <result column="mountain_id" jdbcType="VARCHAR" property="mountainId" />
-      <result column="company_id" jdbcType="VARCHAR" property="companyId" />
-    <result column="mountain_name" jdbcType="VARCHAR" property="mountainName" />
-    <result column="platform_name" jdbcType="VARCHAR" property="platformName" />
-    <result column="platform_address" jdbcType="VARCHAR" property="platformAddress" />
-    <result column="design_company" jdbcType="VARCHAR" property="designCompany" />
-    <result column="design_contacts" jdbcType="VARCHAR" property="designContacts" />
-    <result column="design_phone" jdbcType="VARCHAR" property="designPhone" />
-    <result column="build_company" jdbcType="VARCHAR" property="buildCompany" />
-    <result column="build_contacts" jdbcType="VARCHAR" property="buildContacts" />
-    <result column="build_phone" jdbcType="VARCHAR" property="buildPhone" />
-    <result column="remark" jdbcType="VARCHAR" property="remark" />
-    <result column="status" jdbcType="TINYINT" property="status" />
-    <result column="create_by" jdbcType="BIGINT" property="createBy" />
-    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="update_by" jdbcType="BIGINT" property="updateBy" />
-    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
-    <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
-  </resultMap>
-  <sql id="Base_Column_List">
-    <!--@mbg.generated-->
-    id, `name`, mountain_id, mountain_name, platform_name, platform_address, design_company,
-    design_contacts, design_phone, build_company, build_contacts, build_phone, remark,
-    `status`, create_by, create_time, update_by, update_time, del_flag,company_id
-  </sql>
-  <select id="selectByProjectParam" resultType="com.sckw.slope.detection.model.vo.ProjectVo">
-      select
-      <include refid="Base_Column_List">
-      </include>
-      from kws_project
-      <where>
-          <if test="companyId != null and companyId !=''">
-              and company_id=#{companyId,jdbcType=VARCHAR}
-          </if>
-          <if test="projectQueryDto.name != null and projectQueryDto.name != ''">
-              and name like concat('%', #{projectQueryDto.name}, '%')
-          </if>
-      </where>
-  </select>
+    <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsProject">
+        <!--@mbg.generated-->
+        <!--@Table kws_project-->
+        <id column="id" jdbcType="BIGINT" property="id"/>
+        <result column="name" jdbcType="VARCHAR" property="name"/>
+        <result column="mountain_id" jdbcType="VARCHAR" property="mountainId"/>
+        <result column="company_id" jdbcType="VARCHAR" property="companyId"/>
+        <result column="mountain_name" jdbcType="VARCHAR" property="mountainName"/>
+        <result column="platform_name" jdbcType="VARCHAR" property="platformName"/>
+        <result column="platform_address" jdbcType="VARCHAR" property="platformAddress"/>
+        <result column="design_company" jdbcType="VARCHAR" property="designCompany"/>
+        <result column="design_contacts" jdbcType="VARCHAR" property="designContacts"/>
+        <result column="design_phone" jdbcType="VARCHAR" property="designPhone"/>
+        <result column="build_company" jdbcType="VARCHAR" property="buildCompany"/>
+        <result column="build_contacts" jdbcType="VARCHAR" property="buildContacts"/>
+        <result column="build_phone" jdbcType="VARCHAR" property="buildPhone"/>
+        <result column="remark" jdbcType="VARCHAR" property="remark"/>
+        <result column="status" jdbcType="TINYINT" property="status"/>
+        <result column="create_by" jdbcType="BIGINT" property="createBy"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="update_by" jdbcType="BIGINT" property="updateBy"/>
+        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
+        <result column="del_flag" jdbcType="TINYINT" property="delFlag"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
+        id,
+        `name`,
+        mountain_id,
+        mountain_name,
+        platform_name,
+        platform_address,
+        design_company,
+        design_contacts,
+        design_phone,
+        build_company,
+        build_contacts,
+        build_phone,
+        remark,
+        `status`,
+        create_by,
+        create_time,
+        update_by,
+        update_time,
+        del_flag,
+        company_id
+    </sql>
+    <select id="selectByProjectParam" resultType="com.sckw.slope.detection.model.vo.ProjectVo">
+        select
+        <include refid="Base_Column_List">
+        </include>
+        from kws_project
+        where del_flag = 0
+        <if test="companyId != null and companyId != ''">
+            and company_id = #{companyId,jdbcType=VARCHAR}
+        </if>
+        <if test="projectQueryDto.name != null and projectQueryDto.name != ''">
+            and name like concat('%', #{projectQueryDto.name}, '%')
+        </if>
+    </select>
 
-  <select id="selectDeviceByProjectId" resultType="com.sckw.slope.detection.model.vo.ProjectDeviceVO">
-      SELECT a.id           AS projectId,
-             a.`name`       AS projectName,
-             c.id           AS id,
-             c.`name`       AS NAME,
-             d.device_type  AS deviceType,
-             d.manufacturer AS manufacturer,
-             d.`name`       AS modelName,
-             c.create_time  AS createTime
-      FROM kws_project a
-               LEFT JOIN kws_project_device b ON a.id = b.project_id
-               LEFT JOIN kws_device c ON b.device_id = c.id
-               LEFT JOIN kws_device_model d ON c.model_id = d.id
-      WHERE a.del_flag = 0
-        AND b.del_flag = 0
-        AND c.del_flag = 0
-        AND d.del_flag = 0
-        AND a.id = #{projectId,jdbcType=BIGINT}
-  </select>
+    <select id="selectDeviceByProjectId" resultType="com.sckw.slope.detection.model.vo.ProjectDeviceVO">
+        SELECT a.id           AS projectId,
+               a.`name`       AS projectName,
+               c.id           AS id,
+               c.`name`       AS NAME,
+               d.device_type  AS deviceType,
+               d.manufacturer AS manufacturer,
+               d.`name`       AS modelName,
+               c.create_time  AS createTime
+        FROM kws_project a
+                 LEFT JOIN kws_project_device b ON a.id = b.project_id
+                 LEFT JOIN kws_device c ON b.device_id = c.id
+                 LEFT JOIN kws_device_model d ON c.model_id = d.id
+        WHERE a.del_flag = 0
+          AND b.del_flag = 0
+          AND c.del_flag = 0
+          AND d.del_flag = 0
+          AND a.id = #{projectId,jdbcType=BIGINT}
+    </select>
 
-  <select id="selectDeviceList" resultType="com.sckw.slope.detection.model.vo.ProjectDeviceVO">
-      SELECT a.id           AS projectId,
-             a.`name`       AS projectName,
-             c.id           AS id,
-             c.`name`       AS NAME,
-             d.device_type  AS deviceType,
-             d.manufacturer AS manufacturer,
-             d.`name`       AS modelName,
-             c.create_time  AS createTime
-      FROM kws_project a
-               LEFT JOIN kws_project_device b ON a.id = b.project_id
-               LEFT JOIN kws_device c ON b.device_id = c.id
-               LEFT JOIN kws_device_model d ON c.model_id = d.id
-      WHERE a.del_flag = 0
-        AND b.del_flag = 0
-        AND c.del_flag = 0
-        AND d.del_flag = 0
-      <if test="deviceQuery.projectId != null and deviceQuery.projectId != ''">
-          AND a.id = #{deviceQuery.projectId,jdbcType=BIGINT}
-      </if>
-      <if test="deviceQuery.manufacturer != null and deviceQuery.manufacturer != ''">
-          and d.manufacturer like concat('%', #{deviceQuery.manufacturer}, '%')
-      </if>
-      <if test="deviceQuery.deviceType != null and deviceQuery.deviceType != ''">
-          and d.device_type like concat('%', #{deviceQuery.deviceType}, '%')
-      </if>
-      <if test="deviceQuery.name  != null and deviceQuery.name != ''">
-          and d.name like concat('%', #{deviceQuery.name}, '%')
-      </if>
-  </select>
+    <select id="selectDeviceList" resultType="com.sckw.slope.detection.model.vo.ProjectDeviceVO">
+        SELECT a.id           AS projectId,
+               a.`name`       AS projectName,
+               c.id           AS id,
+               c.`name`       AS NAME,
+               d.device_type  AS deviceType,
+               d.manufacturer AS manufacturer,
+               d.`name`       AS modelName,
+               c.create_time  AS createTime
+        FROM kws_project a
+                 LEFT JOIN kws_project_device b ON a.id = b.project_id
+                 LEFT JOIN kws_device c ON b.device_id = c.id
+                 LEFT JOIN kws_device_model d ON c.model_id = d.id
+        WHERE a.del_flag = 0
+          AND b.del_flag = 0
+          AND c.del_flag = 0
+          AND d.del_flag = 0
+        <if test="deviceQuery.projectId != null and deviceQuery.projectId != ''">
+            AND a.id = #{deviceQuery.projectId}
+        </if>
+        <if test="deviceQuery.manufacturer != null and deviceQuery.manufacturer != ''">
+            and d.manufacturer like concat('%', #{deviceQuery.manufacturer}, '%')
+        </if>
+        <if test="deviceQuery.deviceType != null and deviceQuery.deviceType != ''">
+            and d.device_type like concat('%', #{deviceQuery.deviceType}, '%')
+        </if>
+        <if test="deviceQuery.name != null and deviceQuery.name != ''">
+            and d.name like concat('%', #{deviceQuery.name}, '%')
+        </if>
+    </select>
+
+    <select id="selectDeviceNotBindList" resultType="com.sckw.slope.detection.model.vo.ProjectDeviceVO">
+        SELECT a.id           AS projectId,
+               a.`name`       AS projectName,
+               c.id           AS id,
+               c.`status`     as status,
+               c.`name`       AS NAME,
+               d.device_type  AS deviceType,
+               d.manufacturer AS manufacturer,
+               d.`name`       AS modelName,
+               c.create_time  AS createTime
+        FROM kws_project a
+                 LEFT JOIN kws_device c ON a.mountain_id = c.mountain_id
+                 LEFT JOIN kws_device_model d ON c.model_id = d.id
+        WHERE a.del_flag = 0
+          AND c.del_flag = 0
+          AND d.del_flag = 0
+          AND c.id NOT in (SELECT DISTINCT a.relate_device_id
+                           FROM kws_device_relation a
+                                    LEFT JOIN kws_project b ON a.mountain_id = b.mountain_id)
+          AND c.id NOT in (SELECT DISTINCT a.device_id
+                           FROM kws_device_relation a
+                                    LEFT JOIN kws_project b ON a.mountain_id = b.mountain_id)
+        <if test="deviceQuery.projectId != null and deviceQuery.projectId != ''">
+            AND a.id = #{deviceQuery.projectId}
+        </if>
+        <if test="deviceQuery.manufacturer != null and deviceQuery.manufacturer != ''">
+            and d.manufacturer like concat('%', #{deviceQuery.manufacturer}, '%')
+        </if>
+        <if test="deviceQuery.deviceType != null and deviceQuery.deviceType != ''">
+            and d.device_type like concat('%', #{deviceQuery.deviceType}, '%')
+        </if>
+        <if test="deviceQuery.name != null and deviceQuery.name != ''">
+            and d.name like concat('%', #{deviceQuery.name}, '%')
+        </if>
+    </select>
 </mapper>

+ 11 - 22
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsReportTemplateMapper.xml

@@ -8,6 +8,7 @@
         <result column="name" jdbcType="VARCHAR" property="name"/>
         <result column="type" jdbcType="INTEGER" property="type"/>
         <result column="company_id" jdbcType="VARCHAR" property="companyId"/>
+        <result column="project_id" jdbcType="VARCHAR" property="projectId"/>
         <result column="part_names" jdbcType="VARCHAR" property="partNames"/>
         <result column="tabulation_time" jdbcType="VARCHAR" property="tabulationTime"/>
         <result column="intergration_names" jdbcType="VARCHAR" property="intergrationNames"/>
@@ -24,6 +25,7 @@
         `name`,
         `type`,
         part_names,
+        project_id,
         intergration_names,
         `status`,
         create_by,
@@ -47,17 +49,6 @@
         from kws_report_template
         where id = #{id,jdbcType=BIGINT}
     </delete>
-    <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate">
-        <!--@mbg.generated-->
-        insert into kws_report_template (id, `name`, `type`,
-                                         part_names, intergration_names, `status`,
-                                         create_by, create_time, update_by,
-                                         update_time, del_flag)
-        values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
-                #{partNames,jdbcType=VARCHAR}, #{intergrationNames,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT},
-                #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT},
-                #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT})
-    </insert>
     <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate">
         <!--@mbg.generated-->
         insert into kws_report_template
@@ -187,20 +178,18 @@
 
     <select id="selectListByReportNameAndProjectIdAndCompany"
             resultType="com.sckw.slope.detection.model.vo.ReportStatementVO">
-        SELECT
-            STATUS,
-            `name` AS reportName,
-            type AS reportType,
-            project_id AS projectId,
-            create_time AS createTime
-        FROM
-            kws_report_template
-        WHERE
+        SELECT STATUS,
+               `name`      AS reportName,
+               type        AS reportType,
+               project_id  AS projectId,
+               create_time AS createTime
+        FROM kws_report_template
+        WHERE del_flag = 0
         <if test="query.projectId != null and query.projectId != ''">
-            and project_id =#{query.projectId}
+            and project_id = #{query.projectId}
         </if>
         <if test="companyId != null and companyId != ''">
-            and company_id=#{companyId,jdbcType=VARCHAR}
+            and company_id = #{companyId,jdbcType=VARCHAR}
         </if>
     </select>
 

+ 199 - 181
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsThresholdMapper.xml

@@ -1,198 +1,216 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.sckw.slope.detection.dao.mysql.KwsThresholdMapper">
-  <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsThreshold">
-    <!--@mbg.generated-->
-    <!--@Table kws_threshold-->
-    <id column="id" jdbcType="BIGINT" property="id" />
-    <result column="device_id" jdbcType="BIGINT" property="deviceId" />
-    <result column="item_name" jdbcType="VARCHAR" property="itemName" />
-    <result column="level" jdbcType="INTEGER" property="level" />
-      <result column="company_id" jdbcType="VARCHAR" property="companyId" />
-    <result column="max" jdbcType="VARCHAR" property="max" />
-    <result column="min" jdbcType="VARCHAR" property="min" />
-    <result column="phones" jdbcType="VARCHAR" property="phones" />
-    <result column="status" jdbcType="TINYINT" property="status" />
-    <result column="create_by" jdbcType="BIGINT" property="createBy" />
-    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="update_by" jdbcType="BIGINT" property="updateBy" />
-    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
-    <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
-  </resultMap>
-  <sql id="Base_Column_List">
-    <!--@mbg.generated-->
-    id, device_id, item_name, `level`, `max`, `min`, phones, `status`, create_by, create_time, 
-    update_by, update_time, del_flag,company_id
-  </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
-    <!--@mbg.generated-->
-    select 
-    <include refid="Base_Column_List" />
-    from kws_threshold
-    where id = #{id,jdbcType=BIGINT}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
-    <!--@mbg.generated-->
-    delete from kws_threshold
-    where id = #{id,jdbcType=BIGINT}
-  </delete>
-  <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsThreshold">
-    <!--@mbg.generated-->
-    insert into kws_threshold (id, device_id, item_name, 
-      `level`, `max`, `min`, phones, 
-      `status`, create_by, create_time, 
-      update_by, update_time, del_flag
-      )
-    values (#{id,jdbcType=BIGINT}, #{deviceId,jdbcType=BIGINT}, #{itemName,jdbcType=VARCHAR}, 
-      #{level,jdbcType=INTEGER}, #{max,jdbcType=VARCHAR}, #{min,jdbcType=VARCHAR}, #{phones,jdbcType=VARCHAR}, 
-      #{status,jdbcType=TINYINT}, #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{updateBy,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}
-      )
-  </insert>
-  <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsThreshold">
-    <!--@mbg.generated-->
-    insert into kws_threshold
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
+    <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsThreshold">
+        <!--@mbg.generated-->
+        <!--@Table kws_threshold-->
+        <id column="id" jdbcType="BIGINT" property="id"/>
+        <result column="device_id" jdbcType="BIGINT" property="deviceId"/>
+        <result column="item_name" jdbcType="VARCHAR" property="itemName"/>
+        <result column="level" jdbcType="INTEGER" property="level"/>
+        <result column="company_id" jdbcType="VARCHAR" property="companyId"/>
+        <result column="mountain_id" jdbcType="VARCHAR" property="mountainId"/>
+        <result column="setting" jdbcType="VARCHAR" property="setting"/>
+        <result column="max" jdbcType="VARCHAR" property="max"/>
+        <result column="min" jdbcType="VARCHAR" property="min"/>
+        <result column="phones" jdbcType="VARCHAR" property="phones"/>
+        <result column="status" jdbcType="TINYINT" property="status"/>
+        <result column="create_by" jdbcType="BIGINT" property="createBy"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="update_by" jdbcType="BIGINT" property="updateBy"/>
+        <result column="update_name" jdbcType="VARCHAR" property="updateName"/>
+        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
+        <result column="del_flag" jdbcType="TINYINT" property="delFlag"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
         id,
-      </if>
-      <if test="deviceId != null">
         device_id,
-      </if>
-      <if test="itemName != null">
+        setting,
+        mountain_id,
+        update_name,
         item_name,
-      </if>
-      <if test="level != null">
         `level`,
-      </if>
-      <if test="max != null">
         `max`,
-      </if>
-      <if test="min != null">
         `min`,
-      </if>
-      <if test="phones != null">
         phones,
-      </if>
-      <if test="status != null">
         `status`,
-      </if>
-      <if test="createBy != null">
         create_by,
-      </if>
-      <if test="createTime != null">
+        update_name,
         create_time,
-      </if>
-      <if test="updateBy != null">
         update_by,
-      </if>
-      <if test="updateTime != null">
         update_time,
-      </if>
-      <if test="delFlag != null">
         del_flag,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=BIGINT},
-      </if>
-      <if test="deviceId != null">
-        #{deviceId,jdbcType=BIGINT},
-      </if>
-      <if test="itemName != null">
-        #{itemName,jdbcType=VARCHAR},
-      </if>
-      <if test="level != null">
-        #{level,jdbcType=INTEGER},
-      </if>
-      <if test="max != null">
-        #{max,jdbcType=VARCHAR},
-      </if>
-      <if test="min != null">
-        #{min,jdbcType=VARCHAR},
-      </if>
-      <if test="phones != null">
-        #{phones,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        #{status,jdbcType=TINYINT},
-      </if>
-      <if test="createBy != null">
-        #{createBy,jdbcType=BIGINT},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        #{updateBy,jdbcType=BIGINT},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        #{delFlag,jdbcType=TINYINT},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsThreshold">
-    <!--@mbg.generated-->
-    update kws_threshold
-    <set>
-      <if test="deviceId != null">
-        device_id = #{deviceId,jdbcType=BIGINT},
-      </if>
-      <if test="itemName != null">
-        item_name = #{itemName,jdbcType=VARCHAR},
-      </if>
-      <if test="level != null">
-        `level` = #{level,jdbcType=INTEGER},
-      </if>
-      <if test="max != null">
-        `max` = #{max,jdbcType=VARCHAR},
-      </if>
-      <if test="min != null">
-        `min` = #{min,jdbcType=VARCHAR},
-      </if>
-      <if test="phones != null">
-        phones = #{phones,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        `status` = #{status,jdbcType=TINYINT},
-      </if>
-      <if test="createBy != null">
-        create_by = #{createBy,jdbcType=BIGINT},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        update_by = #{updateBy,jdbcType=BIGINT},
-      </if>
-      <if test="updateTime != null">
-        update_time = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        del_flag = #{delFlag,jdbcType=TINYINT},
-      </if>
-    </set>
-    where id = #{id,jdbcType=BIGINT}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsThreshold">
-    <!--@mbg.generated-->
-    update kws_threshold
-    set device_id = #{deviceId,jdbcType=BIGINT},
-      item_name = #{itemName,jdbcType=VARCHAR},
-      `level` = #{level,jdbcType=INTEGER},
-      `max` = #{max,jdbcType=VARCHAR},
-      `min` = #{min,jdbcType=VARCHAR},
-      phones = #{phones,jdbcType=VARCHAR},
-      `status` = #{status,jdbcType=TINYINT},
-      create_by = #{createBy,jdbcType=BIGINT},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      update_by = #{updateBy,jdbcType=BIGINT},
-      update_time = #{updateTime,jdbcType=TIMESTAMP},
-      del_flag = #{delFlag,jdbcType=TINYINT}
-    where id = #{id,jdbcType=BIGINT}
-  </update>
+        company_id
+    </sql>
+    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+        <!--@mbg.generated-->
+        select
+        <include refid="Base_Column_List"/>
+        from kws_threshold
+        where id = #{id,jdbcType=BIGINT}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+        <!--@mbg.generated-->
+        delete
+        from kws_threshold
+        where id = #{id,jdbcType=BIGINT}
+    </delete>
+    <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsThreshold">
+        <!--@mbg.generated-->
+        insert into kws_threshold (id, device_id, item_name,
+                                   `level`, `max`, `min`, phones,
+                                   `status`, create_by, create_time,
+                                   update_by, update_time, del_flag)
+        values (#{id,jdbcType=BIGINT}, #{deviceId,jdbcType=BIGINT}, #{itemName,jdbcType=VARCHAR},
+                #{level,jdbcType=INTEGER}, #{max,jdbcType=VARCHAR}, #{min,jdbcType=VARCHAR}, #{phones,jdbcType=VARCHAR},
+                #{status,jdbcType=TINYINT}, #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
+                #{updateBy,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT})
+    </insert>
+    <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsThreshold">
+        <!--@mbg.generated-->
+        insert into kws_threshold
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                id,
+            </if>
+            <if test="deviceId != null">
+                device_id,
+            </if>
+            <if test="itemName != null">
+                item_name,
+            </if>
+            <if test="level != null">
+                `level`,
+            </if>
+            <if test="max != null">
+                `max`,
+            </if>
+            <if test="min != null">
+                `min`,
+            </if>
+            <if test="phones != null">
+                phones,
+            </if>
+            <if test="status != null">
+                `status`,
+            </if>
+            <if test="createBy != null">
+                create_by,
+            </if>
+            <if test="createTime != null">
+                create_time,
+            </if>
+            <if test="updateBy != null">
+                update_by,
+            </if>
+            <if test="updateTime != null">
+                update_time,
+            </if>
+            <if test="delFlag != null">
+                del_flag,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=BIGINT},
+            </if>
+            <if test="deviceId != null">
+                #{deviceId,jdbcType=BIGINT},
+            </if>
+            <if test="itemName != null">
+                #{itemName,jdbcType=VARCHAR},
+            </if>
+            <if test="level != null">
+                #{level,jdbcType=INTEGER},
+            </if>
+            <if test="max != null">
+                #{max,jdbcType=VARCHAR},
+            </if>
+            <if test="min != null">
+                #{min,jdbcType=VARCHAR},
+            </if>
+            <if test="phones != null">
+                #{phones,jdbcType=VARCHAR},
+            </if>
+            <if test="status != null">
+                #{status,jdbcType=TINYINT},
+            </if>
+            <if test="createBy != null">
+                #{createBy,jdbcType=BIGINT},
+            </if>
+            <if test="createTime != null">
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateBy != null">
+                #{updateBy,jdbcType=BIGINT},
+            </if>
+            <if test="updateTime != null">
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="delFlag != null">
+                #{delFlag,jdbcType=TINYINT},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsThreshold">
+        <!--@mbg.generated-->
+        update kws_threshold
+        <set>
+            <if test="deviceId != null">
+                device_id = #{deviceId,jdbcType=BIGINT},
+            </if>
+            <if test="itemName != null">
+                item_name = #{itemName,jdbcType=VARCHAR},
+            </if>
+            <if test="level != null">
+                `level` = #{level,jdbcType=INTEGER},
+            </if>
+            <if test="max != null">
+                `max` = #{max,jdbcType=VARCHAR},
+            </if>
+            <if test="min != null">
+                `min` = #{min,jdbcType=VARCHAR},
+            </if>
+            <if test="phones != null">
+                phones = #{phones,jdbcType=VARCHAR},
+            </if>
+            <if test="status != null">
+                `status` = #{status,jdbcType=TINYINT},
+            </if>
+            <if test="createBy != null">
+                create_by = #{createBy,jdbcType=BIGINT},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateBy != null">
+                update_by = #{updateBy,jdbcType=BIGINT},
+            </if>
+            <if test="updateTime != null">
+                update_time = #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="delFlag != null">
+                del_flag = #{delFlag,jdbcType=TINYINT},
+            </if>
+        </set>
+        where id = #{id,jdbcType=BIGINT}
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsThreshold">
+        <!--@mbg.generated-->
+        update kws_threshold
+        set device_id   = #{deviceId,jdbcType=BIGINT},
+            item_name   = #{itemName,jdbcType=VARCHAR},
+            `level`     = #{level,jdbcType=INTEGER},
+            `max`       = #{max,jdbcType=VARCHAR},
+            `min`       = #{min,jdbcType=VARCHAR},
+            phones      = #{phones,jdbcType=VARCHAR},
+            `status`    = #{status,jdbcType=TINYINT},
+            create_by   = #{createBy,jdbcType=BIGINT},
+            create_time = #{createTime,jdbcType=TIMESTAMP},
+            update_by   = #{updateBy,jdbcType=BIGINT},
+            update_time = #{updateTime,jdbcType=TIMESTAMP},
+            del_flag    = #{delFlag,jdbcType=TINYINT}
+        where id = #{id,jdbcType=BIGINT}
+    </update>
 </mapper>