Selaa lähdekoodia

Merge remote-tracking branch 'origin/prod' into prod

# Conflicts:
#	.idea/compiler.xml
#	business-service/src/main/java/com/ozs/service/service/MsgAlarmService.java
#	business-service/src/main/java/com/ozs/service/service/impl/MsgAlarmServiceImpl.java
wyyay 10 kuukautta sitten
vanhempi
commit
7ea1f98562
87 muutettua tiedostoa jossa 1172 lisäystä ja 992 poistoa
  1. 1 1
      .idea/compiler.xml
  2. 3 0
      .idea/misc.xml
  3. 31 3
      business-service/src/main/java/com/ozs/service/entity/BaseCameraManagement.java
  4. 0 2
      business-service/src/main/java/com/ozs/service/entity/BaseCameraVersion.java
  5. 0 2
      business-service/src/main/java/com/ozs/service/entity/BaseDept.java
  6. 1 3
      business-service/src/main/java/com/ozs/service/entity/BaseDeviceDynamicManagement.java
  7. 18 5
      business-service/src/main/java/com/ozs/service/entity/BaseRailwayManagement.java
  8. 0 2
      business-service/src/main/java/com/ozs/service/entity/BaseUser.java
  9. 0 2
      business-service/src/main/java/com/ozs/service/entity/BaseVersionCameraParam.java
  10. 7 2
      business-service/src/main/java/com/ozs/service/entity/CameraLogDetail.java
  11. 6 0
      business-service/src/main/java/com/ozs/service/entity/CameraTree.java
  12. 0 2
      business-service/src/main/java/com/ozs/service/entity/CameraUpdateLog.java
  13. 0 3
      business-service/src/main/java/com/ozs/service/entity/MsgAlarm.java
  14. 0 2
      business-service/src/main/java/com/ozs/service/entity/MsgAlarmFrequency.java
  15. 0 2
      business-service/src/main/java/com/ozs/service/entity/MsgAppPush.java
  16. 0 2
      business-service/src/main/java/com/ozs/service/entity/MsgWebPush.java
  17. 0 2
      business-service/src/main/java/com/ozs/service/entity/SvcAddress.java
  18. 0 2
      business-service/src/main/java/com/ozs/service/entity/UserRegistrationid.java
  19. 3 0
      business-service/src/main/java/com/ozs/service/entity/vo/AlarmStatisticResVo.java
  20. 0 2
      business-service/src/main/java/com/ozs/service/entity/vo/BaseCameraManagementHomeVo.java
  21. 4 0
      business-service/src/main/java/com/ozs/service/entity/vo/BaseCameraManagementVo.java
  22. 20 12
      business-service/src/main/java/com/ozs/service/entity/vo/BaseCameraManagementVos.java
  23. 0 3
      business-service/src/main/java/com/ozs/service/entity/vo/BaseCameraVersionVo.java
  24. 3 0
      business-service/src/main/java/com/ozs/service/entity/vo/BaseRailwayManagementVo.java
  25. 56 0
      business-service/src/main/java/com/ozs/service/entity/vo/CameraUpdateLogResVo.java
  26. 8 2
      business-service/src/main/java/com/ozs/service/entity/vo/MsgAlarmResp.java
  27. 2 0
      business-service/src/main/java/com/ozs/service/entity/vo/MsgAlarmVo.java
  28. 4 0
      business-service/src/main/java/com/ozs/service/mapper/BaseRailwayManagementMapper.java
  29. 2 1
      business-service/src/main/java/com/ozs/service/mapper/CameraLogDetailMapper.java
  30. 2 1
      business-service/src/main/java/com/ozs/service/mapper/MsgAlarmMapper.java
  31. 0 4
      business-service/src/main/java/com/ozs/service/params/UserLoginParams.java
  32. 2 0
      business-service/src/main/java/com/ozs/service/service/BaseRailwayManagementService.java
  33. 2 1
      business-service/src/main/java/com/ozs/service/service/CameraLogDetailService.java
  34. 49 19
      business-service/src/main/java/com/ozs/service/service/impl/BaseCameraManagementServiceImpl.java
  35. 4 7
      business-service/src/main/java/com/ozs/service/service/impl/BaseCameraVersionServiceImpl.java
  36. 3 9
      business-service/src/main/java/com/ozs/service/service/impl/BaseDeviceDynamicManagementServiceImpl.java
  37. 5 0
      business-service/src/main/java/com/ozs/service/service/impl/BaseRailwayManagementServiceImpl.java
  38. 3 2
      business-service/src/main/java/com/ozs/service/service/impl/CameraLogDetailServiceImpl.java
  39. 8 4
      business-service/src/main/java/com/ozs/service/service/impl/MsgAppPushServiceImpl.java
  40. 14 8
      business-service/src/main/java/com/ozs/service/service/impl/MsgWebPushServiceImpl.java
  41. 3 3
      business-service/src/main/java/com/ozs/service/service/impl/UserRegistrationidServiceImpl.java
  42. 59 41
      business-service/src/main/java/com/ozs/service/utils/PublishCallback.java
  43. 85 92
      business-service/src/main/java/com/ozs/service/utils/PublishClient.java
  44. 23 0
      business-service/src/main/java/com/ozs/service/utils/RabbitMqConfig.java
  45. 0 94
      business-service/src/main/java/com/ozs/service/utils/SubscribeClient.java
  46. 17 4
      business-service/src/main/resources/mapper/service/BaseCameraManagementMapper.xml
  47. 6 4
      business-service/src/main/resources/mapper/service/BaseDeviceDynamicManagementMapper.xml
  48. 8 0
      business-service/src/main/resources/mapper/service/BaseRailwayManagementMapper.xml
  49. 11 5
      business-service/src/main/resources/mapper/service/CameraLogDetailMapper.xml
  50. 95 0
      business-service/src/main/resources/mapper/service/MsgAlarmMapper.xml
  51. 1 13
      hazard-admin/pom.xml
  52. 212 152
      hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseCameraManagementController.java
  53. 1 7
      hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseCameraVersionController.java
  54. 40 15
      hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseRailwayManagementController.java
  55. 124 86
      hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/MsgAlarmController.java
  56. 0 7
      hazard-admin/src/main/java/com/ozs/web/controller/app/GeoHazardMineController.java
  57. 0 3
      hazard-admin/src/main/java/com/ozs/web/controller/app/JPushAppController.java
  58. 0 2
      hazard-admin/src/main/java/com/ozs/web/controller/home/HomeController.java
  59. 3 4
      hazard-admin/src/main/java/com/ozs/web/controller/monitor/CacheController.java
  60. 23 14
      hazard-admin/src/main/java/com/ozs/web/controller/monitor/CameraUpdateLogController.java
  61. 2 5
      hazard-admin/src/main/java/com/ozs/web/controller/monitor/SysLoginInfoController.java
  62. 2 5
      hazard-admin/src/main/java/com/ozs/web/controller/monitor/SysOperlogController.java
  63. 1 2
      hazard-admin/src/main/java/com/ozs/web/controller/monitor/SysUserOnlineController.java
  64. 3 10
      hazard-admin/src/main/java/com/ozs/web/controller/mqtt/MqttController.java
  65. 3 5
      hazard-admin/src/main/java/com/ozs/web/controller/system/SysConfigController.java
  66. 14 11
      hazard-admin/src/main/java/com/ozs/web/controller/system/SysDeptController.java
  67. 2 7
      hazard-admin/src/main/java/com/ozs/web/controller/system/SysDictDataController.java
  68. 3 7
      hazard-admin/src/main/java/com/ozs/web/controller/system/SysDictTypeController.java
  69. 2 1
      hazard-admin/src/main/java/com/ozs/web/controller/system/SysLoginController.java
  70. 4 12
      hazard-admin/src/main/java/com/ozs/web/controller/system/SysMenuController.java
  71. 2 4
      hazard-admin/src/main/java/com/ozs/web/controller/system/SysNoticeController.java
  72. 2 4
      hazard-admin/src/main/java/com/ozs/web/controller/system/SysPostController.java
  73. 2 3
      hazard-admin/src/main/java/com/ozs/web/controller/system/SysProfileController.java
  74. 14 12
      hazard-admin/src/main/java/com/ozs/web/controller/system/SysRoleController.java
  75. 7 11
      hazard-admin/src/main/java/com/ozs/web/controller/system/SysUserController.java
  76. 14 30
      hazard-admin/src/main/java/com/ozs/web/controller/tool/TestController.java
  77. 9 5
      hazard-admin/src/main/java/com/ozs/web/controller/websocket/WebSocketConteoller.java
  78. 2 1
      hazard-admin/src/main/java/com/ozs/web/controller/websocket/WebSocketServer.java
  79. 0 125
      hazard-admin/src/main/java/com/ozs/web/core/config/SwaggerConfig.java
  80. 41 0
      hazard-admin/src/main/java/com/ozs/web/core/util/CameraUtil.java
  81. 1 1
      hazard-admin/src/main/resources/application-druid.yml
  82. 27 33
      hazard-admin/src/main/resources/application.yml
  83. BIN
      hazard-admin/src/main/resources/template/baseCameraManagement.xlsx
  84. 11 2
      hazard-sdk/src/main/java/com/ozs/controller/upload/GeoHazardMonitorTokenController.java
  85. 1 1
      hazard-sdk/src/main/resources/application-druid.yml
  86. 22 28
      hazard-sdk/src/main/resources/application.yml
  87. 9 9
      hazard-sdk/src/main/resources/logback.xml

+ 1 - 1
.idea/compiler.xml

@@ -7,9 +7,9 @@
         <sourceOutputDir name="target/generated-sources/annotations" />
         <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
         <outputRelativeToContentRoot value="true" />
-        <module name="base-admin" />
         <module name="hazard-admin" />
         <module name="hazard-sdk" />
+        <module name="base-admin" />
         <module name="business-service" />
       </profile>
     </annotationProcessing>

+ 3 - 0
.idea/misc.xml

@@ -12,4 +12,7 @@
     </option>
   </component>
   <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
+  <component name="SuppressionsComponent">
+    <option name="suppComments" value="[]" />
+  </component>
 </project>

+ 31 - 3
business-service/src/main/java/com/ozs/service/entity/BaseCameraManagement.java

@@ -4,13 +4,13 @@ import java.io.Serializable;
 import java.util.Date;
 import java.util.List;
 
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.ozs.common.annotation.Excel;
 import com.ozs.common.core.domain.BaseEntity;
 import com.ozs.common.core.domain.entity.SysMenu;
-import io.swagger.annotations.ApiModel;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -29,8 +29,7 @@ import lombok.NoArgsConstructor;
 @AllArgsConstructor
 @NoArgsConstructor
 @Builder
-@ApiModel("相机台账管理表")
-public class BaseCameraManagement extends BaseEntity implements Serializable {
+public class BaseCameraManagement extends BaseEntity implements Serializable ,Comparable<BaseCameraManagement>{
 
     private static final long serialVersionUID = 1L;
 
@@ -41,6 +40,13 @@ public class BaseCameraManagement extends BaseEntity implements Serializable {
     @Excel(name = "监控相机安装里程位置(单位KM)")
     private String installMiles;
 
+    /**
+     * 测点名称
+     */
+    @Excel(name = "测点名称")
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private String measurePointName;
+
     /**
      *线路名称
      */
@@ -68,6 +74,11 @@ public class BaseCameraManagement extends BaseEntity implements Serializable {
     @Excel(name = "监控范围开始里程位置(单位KM)")
     private String beginMiles;
 
+    @TableField(exist = false)
+    private String beginString;
+    @TableField(exist = false)
+    private String endString;
+
     /**
      * 监控范围结束里程位置字符串形式
      */
@@ -79,12 +90,14 @@ public class BaseCameraManagement extends BaseEntity implements Serializable {
      * 监视相机经度
      */
     @Excel(name = "监视相机经度")
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
     private String installLongitude;
 
     /**
      * 监视相机纬度
      */
     @Excel(name = "监视相机纬度")
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
     private String installLatitude;
     
     /**
@@ -118,11 +131,13 @@ public class BaseCameraManagement extends BaseEntity implements Serializable {
     /**
      * 监控范围开始里程位置
      */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
     private Integer beginMile;
 
     /**
      * 监控范围结束里程位置
      */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
     private Integer endMile;
 
     /**
@@ -186,7 +201,20 @@ public class BaseCameraManagement extends BaseEntity implements Serializable {
      */
     @TableField(exist = false)
     private Integer isStartRecording;
+
+    /**
+     * 相机序列号
+     */
+    @Excel(name = "序列号")
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private String cameraSn;
     
     @Excel(name = "备注")
     private String remark;
+
+    @Override
+    public int compareTo(BaseCameraManagement o) {
+        int i =o.getRailwayName().compareTo(o.railwayName);
+        return i;
+    }
 }

+ 0 - 2
business-service/src/main/java/com/ozs/service/entity/BaseCameraVersion.java

@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ozs.common.core.domain.BaseEntity;
-import io.swagger.annotations.ApiModel;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -22,7 +21,6 @@ import java.util.List;
 @AllArgsConstructor
 @NoArgsConstructor
 @Builder
-@ApiModel("相机版本管理表")
 public class BaseCameraVersion {
     /**
      * 摄像头系统参数

+ 0 - 2
business-service/src/main/java/com/ozs/service/entity/BaseDept.java

@@ -1,6 +1,5 @@
 package com.ozs.service.entity;
 
-import io.swagger.annotations.ApiModel;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -15,7 +14,6 @@ import java.io.Serializable;
 @AllArgsConstructor
 @NoArgsConstructor
 @Builder
-@ApiModel("Base部门表")
 public class BaseDept implements Serializable {
 
     private static final long serialVersionUID = 1L;

+ 1 - 3
business-service/src/main/java/com/ozs/service/entity/BaseDeviceDynamicManagement.java

@@ -7,7 +7,6 @@ import java.io.Serializable;
 import java.util.Date;
 
 import com.ozs.common.core.domain.BaseEntity;
-import io.swagger.annotations.ApiModel;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -26,7 +25,6 @@ import lombok.NoArgsConstructor;
 @AllArgsConstructor
 @NoArgsConstructor
 @Builder
-@ApiModel("设备动态管理表")
 public class BaseDeviceDynamicManagement extends BaseEntity implements Serializable{
 
     private static final long serialVersionUID = 1L;
@@ -73,7 +71,7 @@ public class BaseDeviceDynamicManagement extends BaseEntity implements Serializa
     private String remark;
 
     /**
-     * 是否开启录像(1开启2不开启)
+     * 相机状态(1在线2离线)
      */
     private Integer isDisable;
 }

+ 18 - 5
business-service/src/main/java/com/ozs/service/entity/BaseRailwayManagement.java

@@ -10,7 +10,6 @@ import java.util.Date;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ozs.common.annotation.Excel;
 import com.ozs.common.core.domain.BaseEntity;
-import io.swagger.annotations.ApiModel;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -28,11 +27,19 @@ import lombok.NoArgsConstructor;
 @AllArgsConstructor
 @NoArgsConstructor
 @Builder
-@ApiModel("线路管理表")
-public class BaseRailwayManagement extends BaseEntity implements Serializable {
+public class BaseRailwayManagement extends BaseEntity implements Serializable ,Comparable<BaseRailwayManagement>{
 
     private static final long serialVersionUID = 1L;
-
+    /**
+     * 工务段ID
+     */
+    @TableField(exist = false)
+    private String deptId;
+    /**
+     * 工务段名称
+     */
+    @TableField(exist = false)
+    private String deptName;
     /**
      * 主键ID
      */
@@ -48,7 +55,7 @@ public class BaseRailwayManagement extends BaseEntity implements Serializable {
     /**
      * 线路类型(普铁/高铁 )
      */
-    @Excel(name = "线路类型",readConverterExp = "1=高铁,2=普")
+    @Excel(name = "线路类型",readConverterExp = "1=高铁,2=普")
     private Integer railwayType;
 
     /**
@@ -73,4 +80,10 @@ public class BaseRailwayManagement extends BaseEntity implements Serializable {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
+
+    @Override
+    public int compareTo(BaseRailwayManagement o) {
+        int i =o.getRailwayName().compareTo(o.railwayName);
+        return i;
+    }
 }

+ 0 - 2
business-service/src/main/java/com/ozs/service/entity/BaseUser.java

@@ -5,7 +5,6 @@ import com.ozs.common.annotation.Excel;
 import com.ozs.common.annotation.Excels;
 import com.ozs.common.core.domain.entity.SysDept;
 import com.ozs.common.core.domain.entity.SysRole;
-import io.swagger.annotations.ApiModel;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -20,7 +19,6 @@ import java.io.Serializable;
 @AllArgsConstructor
 @NoArgsConstructor
 @Builder
-@ApiModel("Base用户表")
 public class BaseUser implements Serializable {
 
     private static final long serialVersionUID = 1L;

+ 0 - 2
business-service/src/main/java/com/ozs/service/entity/BaseVersionCameraParam.java

@@ -3,7 +3,6 @@ package com.ozs.service.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.annotations.ApiModel;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -19,7 +18,6 @@ import java.util.Date;
 @AllArgsConstructor
 @NoArgsConstructor
 @Builder
-@ApiModel("摄像头系统参数")
 public class BaseVersionCameraParam {
 
     /**

+ 7 - 2
business-service/src/main/java/com/ozs/service/entity/CameraLogDetail.java

@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ozs.common.annotation.Excel;
-import io.swagger.annotations.ApiModel;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -23,7 +22,6 @@ import java.util.Date;
 @AllArgsConstructor
 @NoArgsConstructor
 @Builder
-@ApiModel("相机升级日志详情表")
 public class CameraLogDetail implements Serializable {
 
     /**
@@ -43,6 +41,13 @@ public class CameraLogDetail implements Serializable {
     @Excel(name = "相机编码", width = 30)
     private String cameraCode;
 
+    /**
+     * 序列号
+     */
+    @Excel(name = "序列号")
+    @TableField(exist = false)
+    private String cameraSn;
+
     /**
      * 升级状态
      */

+ 6 - 0
business-service/src/main/java/com/ozs/service/entity/CameraTree.java

@@ -1,5 +1,6 @@
 package com.ozs.service.entity;
 
+import com.ozs.common.annotation.Excel;
 import lombok.Builder;
 import lombok.Data;
 import sun.reflect.generics.tree.Tree;
@@ -19,6 +20,11 @@ public class CameraTree implements Serializable,Comparable<CameraTree> {
     String name;
     boolean flay;
     Integer mileage;
+    /**
+     * 所属工务段
+     */
+    @Excel(name = "所属工务段")
+    private String publicWorksSection;
     List<CameraTree> children;
 
     @Override

+ 0 - 2
business-service/src/main/java/com/ozs/service/entity/CameraUpdateLog.java

@@ -7,7 +7,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ozs.common.annotation.Excel;
 import com.ozs.common.core.domain.BaseEntity;
 import com.ozs.common.core.domain.BaseEntityExp;
-import io.swagger.annotations.ApiModel;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -25,7 +24,6 @@ import java.util.Date;
 @AllArgsConstructor
 @NoArgsConstructor
 @Builder
-@ApiModel("相机升级日志表")
 public class CameraUpdateLog implements Serializable {
     private static final long serialVersionUID = 1L;
 

+ 0 - 3
business-service/src/main/java/com/ozs/service/entity/MsgAlarm.java

@@ -11,8 +11,6 @@ import java.util.List;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ozs.common.annotation.Excel;
 import com.ozs.common.core.domain.BaseEntity;
-import io.swagger.annotations.ApiModel;
-import io.swagger.models.auth.In;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -30,7 +28,6 @@ import lombok.NoArgsConstructor;
 @AllArgsConstructor
 @NoArgsConstructor
 @Builder
-@ApiModel("报警信息表")
 public class MsgAlarm extends BaseEntity implements Serializable {
 
     private static final long serialVersionUID = 1L;

+ 0 - 2
business-service/src/main/java/com/ozs/service/entity/MsgAlarmFrequency.java

@@ -10,7 +10,6 @@ import java.util.Date;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ozs.common.core.domain.BaseEntity;
-import io.swagger.annotations.ApiModel;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -29,7 +28,6 @@ import lombok.NoArgsConstructor;
 @AllArgsConstructor
 @NoArgsConstructor
 @Builder
-@ApiModel("预报警频次表")
 public class MsgAlarmFrequency extends BaseEntity implements Serializable {
 
     private static final long serialVersionUID = 1L;

+ 0 - 2
business-service/src/main/java/com/ozs/service/entity/MsgAppPush.java

@@ -3,7 +3,6 @@ package com.ozs.service.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.ozs.common.core.domain.BaseEntity;
-import io.swagger.annotations.ApiModel;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -21,7 +20,6 @@ import java.util.Date;
 @AllArgsConstructor
 @NoArgsConstructor
 @Builder
-@ApiModel("app推送报警信息记录表")
 public class MsgAppPush extends BaseEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 

+ 0 - 2
business-service/src/main/java/com/ozs/service/entity/MsgWebPush.java

@@ -3,7 +3,6 @@ package com.ozs.service.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.ozs.common.core.domain.BaseEntity;
-import io.swagger.annotations.ApiModel;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -19,7 +18,6 @@ import java.util.Date;
 @Builder
 @AllArgsConstructor
 @NoArgsConstructor
-@ApiModel("Web推送报警信息记录表")
 public class MsgWebPush extends BaseEntity {
 
     /**

+ 0 - 2
business-service/src/main/java/com/ozs/service/entity/SvcAddress.java

@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.TableId;
 
 import java.io.Serializable;
 
-import io.swagger.annotations.ApiModel;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -24,7 +23,6 @@ import lombok.NoArgsConstructor;
 @AllArgsConstructor
 @NoArgsConstructor
 @Builder
-@ApiModel("报警消息访问令牌参数验证表")
 public class SvcAddress implements Serializable {
 
     private static final long serialVersionUID = 1L;

+ 0 - 2
business-service/src/main/java/com/ozs/service/entity/UserRegistrationid.java

@@ -1,6 +1,5 @@
 package com.ozs.service.entity;
 
-import io.swagger.annotations.ApiModel;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -14,7 +13,6 @@ import lombok.NoArgsConstructor;
 @AllArgsConstructor
 @NoArgsConstructor
 @Builder
-@ApiModel("用户RegistrationID表")
 public class UserRegistrationid {
     private String userId;
     private String registrationId;

+ 3 - 0
business-service/src/main/java/com/ozs/service/entity/vo/AlarmStatisticResVo.java

@@ -4,6 +4,7 @@ import com.ozs.common.vo.PageVo;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.util.List;
 
 /**
  * 统计管理页面强求参数
@@ -33,4 +34,6 @@ public class AlarmStatisticResVo extends PageVo implements Serializable {
      * 灾害类型
      */
     private String alarmType;
+
+    private List<Long> ids;
 }

+ 0 - 2
business-service/src/main/java/com/ozs/service/entity/vo/BaseCameraManagementHomeVo.java

@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.ozs.common.annotation.Excel;
 import com.ozs.common.core.domain.BaseEntity;
-import io.swagger.annotations.ApiModel;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -25,7 +24,6 @@ import java.io.Serializable;
 @AllArgsConstructor
 @NoArgsConstructor
 @Builder
-@ApiModel("相机台账管理表")
 public class BaseCameraManagementHomeVo extends BaseEntity implements Serializable {
 
     private static final long serialVersionUID = 1L;

+ 4 - 0
business-service/src/main/java/com/ozs/service/entity/vo/BaseCameraManagementVo.java

@@ -5,6 +5,7 @@ import com.ozs.common.annotation.Excel;
 import com.ozs.common.vo.PageVo;
 import lombok.Data;
 import java.io.Serializable;
+import java.util.List;
 
 /**
  * <p>
@@ -56,4 +57,7 @@ public class BaseCameraManagementVo extends PageVo implements Serializable {
      * 监控范围结束里程位置字符串形式
      */
     private String endMiles;
+
+    private List<Long> ids;
+    private String cameraCode;
 }

+ 20 - 12
business-service/src/main/java/com/ozs/service/entity/vo/BaseCameraManagementVos.java

@@ -1,11 +1,6 @@
 package com.ozs.service.entity.vo;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
 import com.ozs.common.annotation.Excel;
-import com.ozs.common.core.domain.BaseEntity;
-import io.swagger.annotations.ApiModel;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -25,12 +20,11 @@ import java.io.Serializable;
 @AllArgsConstructor
 @NoArgsConstructor
 @Builder
-@ApiModel("相机台账管理表")
 public class BaseCameraManagementVos implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
-   
+
     /**
      * 相机编码
      */
@@ -42,7 +36,7 @@ public class BaseCameraManagementVos implements Serializable {
      */
     @Excel(name = "通道编号")
     private String channel;
-    
+
 
     /**
      * 行别(1上行2下行)
@@ -61,13 +55,13 @@ public class BaseCameraManagementVos implements Serializable {
      */
     @Excel(name = "监视相机纬度")
     private String installLatitude;
-    
+
     /**
      * 物联网卡号
      */
     @Excel(name = "物联网卡号")
     private String cardNum;
-    
+
     /**
      *所属工务段名称
      */
@@ -97,7 +91,21 @@ public class BaseCameraManagementVos implements Serializable {
      */
     @Excel(name = "线路名称")
     private String railwayName;
-    
+
+
     @Excel(name = "备注")
     private String remark;
-}
+
+    /**
+     * 相机序列号
+     */
+    @Excel(name = "序列号")
+    private String cameraSn;
+
+    /**
+     * 测点名称
+     */
+    @Excel(name = "测点名称")
+    private String measurePointName;
+
+}

+ 0 - 3
business-service/src/main/java/com/ozs/service/entity/vo/BaseCameraVersionVo.java

@@ -7,7 +7,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ozs.common.annotation.Excel;
 import com.ozs.common.vo.PageVo;
 import com.ozs.service.entity.BaseVersionCameraParam;
-import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.util.Date;
@@ -19,9 +18,7 @@ import java.util.List;
  */
 @Data
 public class BaseCameraVersionVo {
-    @ApiModelProperty("页数")
     private Long pageNum;
-    @ApiModelProperty("页大小")
     private Long pageSize;
 
     /**

+ 3 - 0
business-service/src/main/java/com/ozs/service/entity/vo/BaseRailwayManagementVo.java

@@ -5,6 +5,7 @@ import com.ozs.common.annotation.Excel;
 import com.ozs.common.vo.PageVo;
 import lombok.Data;
 import java.io.Serializable;
+import java.util.List;
 
 /**
  * <p>
@@ -30,4 +31,6 @@ public class BaseRailwayManagementVo extends PageVo implements Serializable {
      */
     @Excel(name = "编码")
     private String railwayCode;
+
+    private List<Long> ids;
 }

+ 56 - 0
business-service/src/main/java/com/ozs/service/entity/vo/CameraUpdateLogResVo.java

@@ -0,0 +1,56 @@
+package com.ozs.service.entity.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author wyy
+ * @subject
+ * @creat 2023/5/29
+ */
+@Data
+public class CameraUpdateLogResVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 版本号
+     */
+    private String versionNum;
+
+    /**
+     * 版本名称
+     */
+    private String versionName;
+
+    /**
+     * 升级类型
+     */
+    private String upgradeType;
+
+    /**
+     * 相机编码
+     */
+    private String cameraCode;
+
+    /**
+     * 升级状态
+     */
+    private Integer status;
+
+    /**
+     * 时间(年)
+     */
+    private Integer currentYear;
+
+    /**
+     * 关联升级日志id
+     */
+    private Long logId;
+
+    /**
+     * 复选框选中id
+     */
+    private List<Long> ids;
+}

+ 8 - 2
business-service/src/main/java/com/ozs/service/entity/vo/MsgAlarmResp.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ozs.common.annotation.Excel;
 import com.ozs.common.core.domain.BaseEntity;
-import io.swagger.annotations.ApiModel;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -151,7 +150,14 @@ public class MsgAlarmResp implements Serializable {
      * 1已报警2未报警
      */
     private Integer failureToAlarm;
-    
 
+    /**
+     * 测点名称
+     */
+    private String measurePointName;
+
+    private String cardNum;
+
+    private String cameraSn;
 
 }

+ 2 - 0
business-service/src/main/java/com/ozs/service/entity/vo/MsgAlarmVo.java

@@ -93,4 +93,6 @@ public class MsgAlarmVo extends PageVo implements Serializable {
      * 解除报警类型1实报2误报
      */
     private Integer releasedType;
+
+    private List<Long> ids;
 }

+ 4 - 0
business-service/src/main/java/com/ozs/service/mapper/BaseRailwayManagementMapper.java

@@ -5,6 +5,8 @@ import com.ozs.service.entity.BaseRailwayManagement;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * <p>
  *   线路管理表 Mapper 接口
@@ -17,4 +19,6 @@ import org.apache.ibatis.annotations.Param;
 public interface BaseRailwayManagementMapper extends BaseMapper<BaseRailwayManagement> {
 
     String getCameraNameByCameraCode(@Param("cameraCode") String cameraCode);
+
+    List<BaseRailwayManagement> listRailway();
 }

+ 2 - 1
business-service/src/main/java/com/ozs/service/mapper/CameraLogDetailMapper.java

@@ -2,6 +2,7 @@ package com.ozs.service.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ozs.service.entity.CameraLogDetail;
+import com.ozs.service.entity.vo.CameraUpdateLogResVo;
 import com.ozs.service.entity.vo.CameraUpdateLogResp;
 import org.apache.ibatis.annotations.Mapper;
 
@@ -14,5 +15,5 @@ import java.util.List;
  */
 @Mapper
 public interface CameraLogDetailMapper extends BaseMapper<CameraLogDetail> {
-    List<CameraLogDetail> selectDetail(CameraUpdateLogResp cameraUpdateLogResp);
+    List<CameraLogDetail> selectDetail(CameraUpdateLogResVo cameraUpdateLogResVo);
 }

+ 2 - 1
business-service/src/main/java/com/ozs/service/mapper/MsgAlarmMapper.java

@@ -37,7 +37,6 @@ public interface MsgAlarmMapper extends BaseMapper<MsgAlarm> {
 
     MsgAlarm selectByCameraCode(@Param("cameraCode") String cameraCode);
 
-
     List<MsgAlarm> selectMsgAlarmList(MsgAlarmVo msgAlarmVo);
 
     MsgAlarm getByAlarmId(@Param("alarmId") String alarmId);
@@ -49,4 +48,6 @@ public interface MsgAlarmMapper extends BaseMapper<MsgAlarm> {
     Integer countWJC(MsgAlarmVo msgAlarmVo);
 
     List<MsgAlarm> queryAlarmInfoByAfterTenMinute();
+
+    List<MsgAlarm> selectMsgAlarmListHome(MsgAlarmVo msgAlarmVo);
 }

+ 0 - 4
business-service/src/main/java/com/ozs/service/params/UserLoginParams.java

@@ -1,6 +1,5 @@
 package com.ozs.service.params;
 
-import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -11,18 +10,15 @@ public class UserLoginParams {
     /**
      * 用户名
      */
-    @ApiModelProperty("用户名")
     private String username;
 
     /**
      * 密码
      */
-    @ApiModelProperty("密码")
     private String password;
 
     /**
      * 验证码
      */
-    @ApiModelProperty("验证码")
     private String securityCode;
 }

+ 2 - 0
business-service/src/main/java/com/ozs/service/service/BaseRailwayManagementService.java

@@ -25,4 +25,6 @@ public interface BaseRailwayManagementService extends IService<BaseRailwayManage
     String importBaseLineManagement(List<BaseRailwayManagement> accountManageList, boolean updateSupport,String userId);
 
     String getCameraNameByCameraCode(String cameraCode);
+
+    List<BaseRailwayManagement> listRailway();
 }

+ 2 - 1
business-service/src/main/java/com/ozs/service/service/CameraLogDetailService.java

@@ -3,6 +3,7 @@ package com.ozs.service.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ozs.service.entity.CameraLogDetail;
+import com.ozs.service.entity.vo.CameraUpdateLogResVo;
 import com.ozs.service.entity.vo.CameraUpdateLogResp;
 
 import java.util.List;
@@ -15,5 +16,5 @@ import java.util.List;
 public interface CameraLogDetailService extends IService<CameraLogDetail> {
     void updateAccessories(String deviceSn, Integer code,String remark);
     IPage listToPage(List list, int pageNum, int pageSize);
-    List<CameraLogDetail> selectDetail(CameraUpdateLogResp cameraUpdateLogResp);
+    List<CameraLogDetail> selectDetail(CameraUpdateLogResVo cameraUpdateLogResVo);
 }

+ 49 - 19
business-service/src/main/java/com/ozs/service/service/impl/BaseCameraManagementServiceImpl.java

@@ -14,12 +14,9 @@ import com.ozs.service.entity.*;
 import com.ozs.service.entity.vo.BaseCameraManagementHomeVo;
 import com.ozs.service.entity.vo.BaseCameraManagementVo;
 import com.ozs.service.entity.vo.BaseCameraManagementVos;
-import com.ozs.service.mapper.BaseCameraManagementMapper;
+import com.ozs.service.entity.vo.BaseCameraVersionVo;
+import com.ozs.service.mapper.*;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ozs.service.mapper.BaseDeptMapper;
-import com.ozs.service.mapper.BaseDeviceDynamicManagementMapper;
-import com.ozs.service.mapper.BaseUserMapper;
-import com.ozs.service.mapper.MsgAlarmMapper;
 import com.ozs.service.service.BaseCameraManagementService;
 import com.ozs.service.service.BaseRailwayManagementService;
 import com.ozs.service.service.BaseUserService;
@@ -30,7 +27,9 @@ import org.springframework.util.ObjectUtils;
 
 import javax.annotation.Resource;
 import javax.validation.Validator;
+import java.math.BigDecimal;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -59,6 +58,10 @@ public class BaseCameraManagementServiceImpl extends ServiceImpl<BaseCameraManag
     private BaseDeptMapper baseDeptMapper;
     @Autowired
     private BaseRailwayManagementService baseRailwayManagementService;
+    @Autowired
+    private CameraLogDetailMapper cameraLogDetailMapper;
+    @Autowired
+    private CameraUpdateLogMapper cameraUpdateLogMapper;
 
     /**
      * 相机台账管理表导入
@@ -100,18 +103,32 @@ public class BaseCameraManagementServiceImpl extends ServiceImpl<BaseCameraManag
                         }
                         BaseRailwayManagement baseRailwayManagement = baseRailwayManagementService.getOne(queryWrapper);
                         if (!ObjectUtils.isEmpty(baseRailwayManagement)) {
-                            if (!accountManagement.getBeginMiles().matches(PATTERN) || !accountManagement.getInstallMiles().matches(PATTERN) || !accountManagement.getEndMiles().matches(PATTERN)) {
+                            if (!accountManagement.getInstallMiles().matches(PATTERN)) {
                                 failureNum++;
-                                failureMsg.append(failureNum + "、相机编码为: " + accountManagement.getCameraCode() + "的数据,里程位置填写格式不正确,请填写数字");
+                                failureMsg.append(failureNum + "、相机编码为: " + accountManagement.getCameraCode() + "的数据,安装里程位置填写格式不正确,请填写数字");
                             } else {
-                                Double install =Double.valueOf(accountManagement.getInstallMiles());
-                                Double end = Double.valueOf( accountManagement.getEndMiles());
-                                Double begin = Double.valueOf(accountManagement.getBeginMiles());
+                                BigDecimal install = new BigDecimal(accountManagement.getInstallMiles());
                                 accountManagement.setRailwayCode(baseRailwayManagement.getRailwayCode());
-                                accountManagement.setInstallMile((int) (install * 1000));
-                                accountManagement.setEndMile((int) (end * 1000));
-                                accountManagement.setBeginMile((int) (begin * 1000));
-                                if (accountManagement.getBeginMile() < accountManagement.getEndMile()) {
+                                accountManagement.setInstallMile( install.multiply(BigDecimal.valueOf(1000)).intValue());
+                                if (!ObjectUtils.isEmpty(accountManagement.getBeginMiles()) && !ObjectUtils.isEmpty(accountManagement.getEndMiles())) {
+                                    BigDecimal end = new BigDecimal(accountManagement.getEndMiles());
+                                    BigDecimal begin =new BigDecimal(accountManagement.getBeginMiles());
+                                    accountManagement.setEndMile(end.multiply(BigDecimal.valueOf(1000)).intValue());
+                                    accountManagement.setBeginMile(begin.multiply(BigDecimal.valueOf(1000)).intValue());
+                                    if (!accountManagement.getBeginMiles().matches(PATTERN) || !accountManagement.getEndMiles().matches(PATTERN)) {
+                                        failureNum++;
+                                        failureMsg.append(failureNum + "、相机编码为: " + accountManagement.getCameraCode() + "的数据,监控范围里程位置填写格式不正确,请填写数字");
+                                    } else {
+                                            baseCameraManagementMapper.insert(accountManagement);
+                                            BaseDeviceDynamicManagement baseDeviceDynamicManagement = new BaseDeviceDynamicManagement();
+                                            baseDeviceDynamicManagement.setCameraCode(accountManagement.getCameraCode());
+                                            baseDeviceDynamicManagement.setUpdateBy(userId);
+                                            baseDeviceDynamicManagement.setCreateBy(userId);
+                                            baseDeviceDynamicManagementMapper.insert(baseDeviceDynamicManagement);
+                                            successNum++;
+                                            successMsg.append(successNum + "、相机编码 " + accountManagement.getCameraCode() + " 导入成功");
+                                    }
+                                } else {
                                     baseCameraManagementMapper.insert(accountManagement);
                                     BaseDeviceDynamicManagement baseDeviceDynamicManagement = new BaseDeviceDynamicManagement();
                                     baseDeviceDynamicManagement.setCameraCode(accountManagement.getCameraCode());
@@ -120,9 +137,6 @@ public class BaseCameraManagementServiceImpl extends ServiceImpl<BaseCameraManag
                                     baseDeviceDynamicManagementMapper.insert(baseDeviceDynamicManagement);
                                     successNum++;
                                     successMsg.append(successNum + "、相机编码 " + accountManagement.getCameraCode() + " 导入成功");
-                                } else {
-                                    failureNum++;
-                                    failureMsg.append(failureNum + "、相机编码为: " + accountManagement.getCameraCode() + "的数据,监控范围开始里程位置不能大于监控范围结束里程位置");
                                 }
                             }
                         } else {
@@ -174,7 +188,7 @@ public class BaseCameraManagementServiceImpl extends ServiceImpl<BaseCameraManag
             }
         }
         if (failureNum > 0) {
-            failureMsg.insert(0, "很抱歉!需导入数据共有"+accountManageList.size()+"条。数据导入成功共 " + successNum + " 条。数据导入失败共 " + failureNum + " 条。错误如下:");
+            failureMsg.insert(0, "很抱歉!需导入数据共有" + accountManageList.size() + "条。数据导入成功共 " + successNum + " 条。数据导入失败共 " + failureNum + " 条。错误如下:");
             throw new ServiceException(failureMsg.toString());
         } else {
             successMsg.insert(0, "恭喜您!数据已全部导入成功!共 " + successNum + " 条。");
@@ -320,10 +334,26 @@ public class BaseCameraManagementServiceImpl extends ServiceImpl<BaseCameraManag
         if (!StringUtils.isEmptySunhh(baseCameraManagement) && !StringUtils.isEmptySunhh(baseCameraManagement.getCameraCode())) {
             wrapper.like(BaseCameraManagement::getCameraCode, baseCameraManagement.getCameraCode());
         }
+        if (!StringUtils.isEmptySunhh(baseCameraManagement) && !StringUtils.isEmptySunhh(baseCameraManagement.getDeptId())) {
+            wrapper.eq(BaseCameraManagement::getDeptId, baseCameraManagement.getDeptId());
+        }
+        if (!StringUtils.isEmptySunhh(baseCameraManagement) && !StringUtils.isEmptySunhh(baseCameraManagement.getRailwayCode())) {
+            wrapper.like(BaseCameraManagement::getRailwayCode, baseCameraManagement.getRailwayCode());
+        }
         if (!StringUtils.isEmptySunhh(baseCameraManagement) && !StringUtils.isEmptySunhh(baseCameraManagement.getVersionId())) {
-            wrapper.ne(BaseCameraManagement::getVersionId, baseCameraManagement.getVersionId());
+//            wrapper.ne(BaseCameraManagement::getVersionId, baseCameraManagement.getVersionId());
+            wrapper.and((wp) -> {
+                wp.isNull(BaseCameraManagement::getVersionId).or().ne(BaseCameraManagement::getVersionId, baseCameraManagement.getVersionId());
+            });
         }
         List<BaseCameraManagement> baseCameraManagements = baseCameraManagementMapper.selectList(wrapper);
+        if (!StringUtils.isEmptySunhh(baseCameraManagements) && baseCameraManagements.size() > 0) {
+            for (BaseCameraManagement baseCameraManagement1 : baseCameraManagements) {
+                if (!StringUtils.isEmptySunhh(baseCameraManagement1) && !StringUtils.isEmptySunhh(baseCameraManagement1.getInstallMile())) {
+                    baseCameraManagement1.setInstallMiles(AppendUtils.stringAppend(baseCameraManagement1.getInstallMile()));
+                }
+            }
+        }
         return baseCameraManagements;
     }
 }

+ 4 - 7
business-service/src/main/java/com/ozs/service/service/impl/BaseCameraVersionServiceImpl.java

@@ -1,7 +1,6 @@
 package com.ozs.service.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.PageHelper;
 import com.ozs.common.core.domain.AjaxResult;
@@ -14,23 +13,22 @@ import com.ozs.service.service.BaseCameraVersionService;
 import com.ozs.service.service.BaseDeviceDynamicManagementService;
 import com.ozs.service.service.CameraLogDetailService;
 import com.ozs.service.utils.PublishClient;
-import com.ozs.service.utils.SubscribeClient;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.ObjectUtils;
 
 import javax.annotation.Resource;
 import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
-import java.util.stream.Collectors;
 
 /**
  * @Author : sunhh
  * @create 2023/4/24 11:22
  */
 @Service
+@Slf4j
 public class BaseCameraVersionServiceImpl extends ServiceImpl<BaseCameraVersionMapper, BaseCameraVersion> implements BaseCameraVersionService {
 
     @Autowired
@@ -155,24 +153,23 @@ public class BaseCameraVersionServiceImpl extends ServiceImpl<BaseCameraVersionM
             queryWrapper.eq(BaseDeviceDynamicManagement::getCameraCode,value);
             BaseDeviceDynamicManagement one = baseDeviceDynamicManagementService.getOne(queryWrapper);
             if (one.getIsDisable()==2){
+                log.info("cameraVersionUpgrade--------相机已下线");
                 cameraLogDetailService.updateAccessories(one.getCameraCode(),400,"相机已下线");
                 it.remove();
             }
         }
         if ("3".equals(baseCameraVersionVo.getUpgradeType())){
+            log.info("cameraVersionUpgrade--------3");
             List<BaseVersionCameraParam> baseVersionCameraParamList = baseCameraVersionVo.getBaseVersionCameraParamList();
             for (BaseVersionCameraParam baseVersionCameraParam : baseVersionCameraParamList) {
                 if ("threshold".equals(baseVersionCameraParam.getParamKey())) {
                     PublishClient.confidenceCoefficient(baseCameraVersionVo, baseVersionCameraParam.getParamValue());
-                    new SubscribeClient("config", "config").start();
                 } else if ("fps".equals(baseVersionCameraParam.getParamKey())) {
                     PublishClient.configFrameRate(baseCameraVersionVo, baseVersionCameraParam.getParamValue());
-                    new SubscribeClient("config", "config").start();
                 }
             }
         }
         PublishClient.updateDeviceSn(baseCameraVersionVo);
-        new SubscribeClient("update", "update").start();
         return AjaxResult.success("已经为您提交升级申请,请您到“日志管理>相机升级日志”页面查看升级结果。");
     }
 }

+ 3 - 9
business-service/src/main/java/com/ozs/service/service/impl/BaseDeviceDynamicManagementServiceImpl.java

@@ -49,9 +49,9 @@ public class BaseDeviceDynamicManagementServiceImpl extends ServiceImpl<BaseDevi
                         .code(o.getRailwayCode())
                         .name(o.getRailwayName())
                         .flay(true)
+                        .publicWorksSection(o.getPublicWorksSection())
                         .children(new ArrayList<>())
                         .build();
-
                 if (!cameraTree.getChildren().stream()
                         .map(CameraTree::getCode)
                         .collect(Collectors.toList())
@@ -59,18 +59,16 @@ public class BaseDeviceDynamicManagementServiceImpl extends ServiceImpl<BaseDevi
                     cameraTree.getChildren().add(build);
                     map.put(o.getRailwayCode(), build);
                 }
-
                 // 里程
                 String mils = AppendUtils.stringAppend(o.getInstallMile());
                 CameraTree build1 = CameraTree.builder()
                         .code(mils + "-" + (o.getLineDir().equals("1") ? "上行" : "下行"))
                         .name(mils + "-" + (o.getLineDir().equals("1") ? "上行" : "下行"))
                         .flay(true)
+                        .publicWorksSection(o.getPublicWorksSection())
                         .mileage(o.getInstallMile())
                         .children(new ArrayList<>())
                         .build();
-
-
                 if (!ObjectUtils.isEmpty(map.get(o.getRailwayCode()))) {
                     CameraTree cameraTree1 = map.get(o.getRailwayCode()+"-"+o.getInstallMile() + "-" + (o.getLineDir().equals("1") ? "上行" : "下行"));
                     if (ObjectUtils.isEmpty(cameraTree1)) {
@@ -78,23 +76,19 @@ public class BaseDeviceDynamicManagementServiceImpl extends ServiceImpl<BaseDevi
                         map.get(o.getRailwayCode()).getChildren().add(build1);
                     }
                 }
-
                 // 摄像头
                 CameraTree build2 = CameraTree.builder()
                         .code(o.getCameraCode())
                         .name(o.getCameraCode())
                         .flay(true)
+                        .publicWorksSection(o.getPublicWorksSection())
                         .children(new ArrayList<>())
                         .build();
-
-
                 if (!ObjectUtils.isEmpty(map.get(o.getRailwayCode()+"-"+o.getInstallMile() + "-" + (o.getLineDir().equals("1") ? "上行" : "下行")))) {
                     map.get(o.getRailwayCode()+"-"+o.getInstallMile() + "-" + (o.getLineDir().equals("1") ? "上行" : "下行")).getChildren().add(build2);
                 }
             }
         }
-
-
         return cameraTree;
     }
 }

+ 5 - 0
business-service/src/main/java/com/ozs/service/service/impl/BaseRailwayManagementServiceImpl.java

@@ -102,4 +102,9 @@ public class BaseRailwayManagementServiceImpl extends ServiceImpl<BaseRailwayMan
     public String getCameraNameByCameraCode(String cameraCode) {
         return baseRailwayManagementMapper.getCameraNameByCameraCode(cameraCode);
     }
+
+    @Override
+    public List<BaseRailwayManagement> listRailway() {
+        return baseRailwayManagementMapper.listRailway();
+    }
 }

+ 3 - 2
business-service/src/main/java/com/ozs/service/service/impl/CameraLogDetailServiceImpl.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ozs.service.entity.CameraLogDetail;
 import com.ozs.service.entity.CameraUpdateLog;
+import com.ozs.service.entity.vo.CameraUpdateLogResVo;
 import com.ozs.service.entity.vo.CameraUpdateLogResp;
 import com.ozs.service.mapper.CameraLogDetailMapper;
 import com.ozs.service.mapper.CameraUpdateLogMapper;
@@ -28,8 +29,8 @@ public class CameraLogDetailServiceImpl extends ServiceImpl<CameraLogDetailMappe
     CameraLogDetailMapper cameraLogDetailMapper;
 
     @Override
-    public List<CameraLogDetail> selectDetail(CameraUpdateLogResp cameraUpdateLogResp) {
-        List<CameraLogDetail> list = cameraLogDetailMapper.selectDetail(cameraUpdateLogResp);
+    public List<CameraLogDetail> selectDetail(CameraUpdateLogResVo cameraUpdateLogResVo) {
+        List<CameraLogDetail> list = cameraLogDetailMapper.selectDetail(cameraUpdateLogResVo);
         return list;
     }
 

+ 8 - 4
business-service/src/main/java/com/ozs/service/service/impl/MsgAppPushServiceImpl.java

@@ -63,10 +63,14 @@ public class MsgAppPushServiceImpl extends ServiceImpl<MsgAppPushMapper, MsgAppP
                 o.setRailwayName(baseRailwayManagement.getRailwayName());
                 String mils = AppendUtils.stringAppend(cameraManagement.getInstallMile());
                 o.setAlarmMiles(mils);
-                String end = AppendUtils.stringAppend(cameraManagement.getEndMile());
-                o.setEndMile(end);
-                String begin = AppendUtils.stringAppend(cameraManagement.getBeginMile());
-                o.setBeginMile(begin);
+                if (!ObjectUtils.isEmpty(cameraManagement.getEndMile())) {
+                    String end = AppendUtils.stringAppend(cameraManagement.getEndMile());
+                    o.setEndMile(end);
+                }
+                if (!ObjectUtils.isEmpty(cameraManagement.getBeginMile())) {
+                    String begin = AppendUtils.stringAppend(cameraManagement.getBeginMile());
+                    o.setBeginMile(begin);
+                }
                 // o.setAlarmCount((int) msgAlarmFrequencyService.count()+1);
                 return o;
             }).collect(Collectors.toList());

+ 14 - 8
business-service/src/main/java/com/ozs/service/service/impl/MsgWebPushServiceImpl.java

@@ -69,10 +69,12 @@ public class MsgWebPushServiceImpl extends ServiceImpl<MsgWebPushMapper, MsgWebP
                 BeanUtils.copyProperties(msgAlarm, msgAlarmResp);
                 msgAlarmResp.setRailwayName(baseRailwayManagement.getRailwayName());
                 msgAlarmResp.setDeptId(baseCameraManagement.getDeptId());
-                String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
-                String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
-                String endMile = begin + "-" + end;
-                msgAlarmResp.setBeginMile(endMile);
+                if (!ObjectUtils.isEmpty(baseCameraManagement.getBeginMile())&&!ObjectUtils.isEmpty(baseCameraManagement.getEndMile())) {
+                    String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
+                    String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
+                    String endMile = begin + "-" + end;
+                    msgAlarmResp.setBeginMile(endMile);
+                }
                 String mile = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
                 msgAlarmResp.setAlarmMile(mile);
                 msgAlarmResp.setInstallLongitude(baseCameraManagement.getInstallLongitude() + "," + baseCameraManagement.getInstallLatitude());
@@ -113,10 +115,14 @@ public class MsgWebPushServiceImpl extends ServiceImpl<MsgWebPushMapper, MsgWebP
                 o.setRailwayName(baseRailwayManagement.getRailwayName());
                 String mils = AppendUtils.stringAppend(cameraManagement.getInstallMile());
                 o.setAlarmMiles(mils);
-                String end = AppendUtils.stringAppend(cameraManagement.getEndMile());
-                o.setEndMile(end);
-                String begin = AppendUtils.stringAppend(cameraManagement.getBeginMile());
-                o.setBeginMile(begin);
+                if (!ObjectUtils.isEmpty(cameraManagement.getEndMile())) {
+                    String end = AppendUtils.stringAppend(cameraManagement.getEndMile());
+                    o.setEndMile(end);
+                }
+                if (!ObjectUtils.isEmpty(cameraManagement.getBeginMile())) {
+                    String begin = AppendUtils.stringAppend(cameraManagement.getBeginMile());
+                    o.setBeginMile(begin);
+                }
                 // o.setAlarmCount((int) msgAlarmFrequencyService.count()+1);
                 return o;
             }).collect(Collectors.toList());

+ 3 - 3
business-service/src/main/java/com/ozs/service/service/impl/UserRegistrationidServiceImpl.java

@@ -29,9 +29,9 @@ public class UserRegistrationidServiceImpl extends ServiceImpl<UserRegistrationi
         if (!ObjectUtils.isEmpty(userRegistrationid.getUserId())) {
             lw.in(UserRegistrationid::getUserId, userRegistrationid.getUserId());
         }
-        if (!ObjectUtils.isEmpty(userRegistrationid.getRegistrationId())) {
-            lw.in(UserRegistrationid::getRegistrationId, userRegistrationid.getRegistrationId());
-        }
+//        if (!ObjectUtils.isEmpty(userRegistrationid.getRegistrationId())) {
+//            lw.in(UserRegistrationid::getRegistrationId, userRegistrationid.getRegistrationId());
+//        }
         log.info("userRegistrationids111111111111111:--------" + userRegistrationid.getUserId());
         log.info("userRegistrationids222222222222222:--------" + userRegistrationid.getRegistrationId());
         List<UserRegistrationid> userRegistrationids = userRegistrationidMapper.selectList(lw);

+ 59 - 41
business-service/src/main/java/com/ozs/service/utils/PublishCallback.java

@@ -10,6 +10,8 @@ import com.ozs.service.service.impl.CameraUpdateLogServiceImpl;
 import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
 import org.eclipse.paho.client.mqttv3.MqttCallback;
 import org.eclipse.paho.client.mqttv3.MqttMessage;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -21,13 +23,14 @@ import java.util.List;
  * @author Administrator
  */
 public class PublishCallback implements MqttCallback {
-    
+
+    public static final Logger logger = LoggerFactory.getLogger(PublishCallback.class);
 
     //在断开连接时调用
     @Override
     public void connectionLost(Throwable cause) {
         // 连接丢失后,一般在这里面进行重连
-//        System.out.println("连接断开,可以做重连");
+        System.out.println("连接断开,可以做重连" + cause);
     }
 
     //接收到已经发布的 QoS 1 或 QoS 2 消息的传递令牌时调用
@@ -40,56 +43,71 @@ public class PublishCallback implements MqttCallback {
     @Override
     public void messageArrived(String topic, MqttMessage message) throws Exception {
         String sign = null;
-        String deviceSn=null;
-        Integer code=null;
+        String deviceSn = null;
+        Integer code = null;
         // subscribe后得到的消息会执行到这里面
+        logger.info("接收消息主题 : {}", topic);
+        logger.info("接收消息内容 : {}", new String(message.getPayload()));
         System.out.println("接收消息主题 : " + topic);
         System.out.println("接收消息Qos : " + message.getQos());
         if ("heart".equals(topic)) {
-            String s = new String(message.getPayload());
-            s = "[" + s + "]";
-            JSONArray jsonArray = JSONArray.parseArray(s);
-            for (int i = 0; i < jsonArray.size(); i++) {
-                JSONObject object = jsonArray.getJSONObject(i);
-                sign = (String) object.get("sign");
-                deviceSn = (String) object.get("device_sn");
+            try {
+                String s = new String(message.getPayload());
+                s = "[" + s + "]";
+                JSONArray jsonArray = JSONArray.parseArray(s);
+                for (int i = 0; i < jsonArray.size(); i++) {
+                    JSONObject object = jsonArray.getJSONObject(i);
+                    sign = (String) object.get("sign");
+                    deviceSn = (String) object.get("device_sn");
+                }
+                CallbackUtil.heart(deviceSn);
+                PublishClient.pull(sign, deviceSn);
+            } catch (Exception e) {
+                logger.error(e.getMessage());
             }
-            CallbackUtil.heart(deviceSn);
-            PublishClient.pull(sign,deviceSn);
         }
         if ("update".equals(topic)) {
-            String s = new String(message.getPayload());
-            s = "[" + s + "]";
-            JSONArray jsonArray = JSONArray.parseArray(s);
-            for (int i = 0; i < jsonArray.size(); i++) {
-                JSONObject object = jsonArray.getJSONObject(i);
-                code = (Integer) object.get("code");
-                deviceSn = (String) object.get("device_sn");
+            try {
+                String s = new String(message.getPayload());
+                s = "[" + s + "]";
+                JSONArray jsonArray = JSONArray.parseArray(s);
+                for (int i = 0; i < jsonArray.size(); i++) {
+                    JSONObject object = jsonArray.getJSONObject(i);
+                    code = (Integer) object.get("code");
+                    deviceSn = (String) object.get("device_sn");
+                }
+                if (code == 200) {
+                    CallbackUtil.callback(deviceSn, code, "");
+                } else {
+                    CallbackUtil.callback(deviceSn, code, "固件升级失败");
+                }
+            } catch (Exception e) {
+                logger.error(e.getMessage());
             }
-            if (code==200) {
+        }
+        if ("config".equals(topic)) {
+            try {
+                String s = new String(message.getPayload());
+                s = "[" + s + "]";
+                JSONArray jsonArray = JSONArray.parseArray(s);
+                for (int i = 0; i < jsonArray.size(); i++) {
+                    JSONObject object = jsonArray.getJSONObject(i);
+                    code = (Integer) object.get("code");
+                    deviceSn = (String) object.get("device_sn");
+                    sign = (String) object.get("sign");
+                }
+                if (sign.startsWith("rate") && code == 400) {
+                    CallbackUtil.callback(deviceSn, code, "帧率升级失败");
+                }
+                if (sign.startsWith("cien") && code == 400) {
+                    CallbackUtil.callback(deviceSn, code, "置信度升级失败");
+                }
                 CallbackUtil.callback(deviceSn, code, "");
-            }else {
-                CallbackUtil.callback(deviceSn, code, "固件升级失败");
-            }
-        }if ("config".equals(topic)){
-            String s = new String(message.getPayload());
-            s = "[" + s + "]";
-            JSONArray jsonArray = JSONArray.parseArray(s);
-            for (int i = 0; i < jsonArray.size(); i++) {
-                JSONObject object = jsonArray.getJSONObject(i);
-                code = (Integer) object.get("code");
-                deviceSn = (String) object.get("device_sn");
-                sign =(String) object.get("sign");
+            } catch (Exception e) {
+                logger.error(e.getMessage());
             }
-            if (sign.startsWith("rate")&&code==400){
-                CallbackUtil.callback(deviceSn,code,"帧率升级失败");
-            }
-            if (sign.startsWith("cien")&&code==400){
-                CallbackUtil.callback(deviceSn,code,"置信度升级失败");
-            }
-            CallbackUtil.callback(deviceSn,code,"");
         }
         System.out.println("接收消息内容 : " + new String(message.getPayload()));
-        
+
     }
 }

+ 85 - 92
business-service/src/main/java/com/ozs/service/utils/PublishClient.java

@@ -13,6 +13,7 @@ import com.ozs.service.entity.vo.Param;
 import com.ozs.service.entity.vo.Svp;
 import com.ozs.service.entity.vo.UpdateDeviceSn;
 import com.ozs.service.entity.vo.Venc0;
+import lombok.extern.slf4j.Slf4j;
 import org.eclipse.paho.client.mqttv3.MqttClient;
 import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
 import org.eclipse.paho.client.mqttv3.MqttDeliveryToken;
@@ -21,8 +22,11 @@ import org.eclipse.paho.client.mqttv3.MqttMessage;
 import org.eclipse.paho.client.mqttv3.MqttPersistenceException;
 import org.eclipse.paho.client.mqttv3.MqttTopic;
 import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
 
+import javax.annotation.PostConstruct;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Map;
@@ -34,79 +38,29 @@ import java.util.UUID;
  *
  * @author Administrator
  */
+@Slf4j
+@Component
 public class PublishClient {
+
     /**
      * mqtt服务器地址
      */
-    public static final String HOST = "tcp://124.70.58.209:1883";
-    /**
-     * 主题
-     */
-    private final String topic;
+    public static String HOST;
+    public static String USER_NAME;
+    public static String PASS_WORD;
+    private static String clientId;
     /**
      * 客户端实例
      */
-    private final MqttClient client;
-    /**
-     * 主题实例
-     */
-    private MqttTopic topic11;
-    private static final String USER_NAME = "guest";
-    private static final String PASS_WORD = "guest";
-    private MqttMessage message;
+    private static MqttClient client;
+    @Autowired
+    private RabbitMqConfig rabbitMqConfig;
 
     /**
-     * 初始化客户端实例
-     *
-     * @param topic
-     * @param clientId
-     * @throws MqttException
+     * 获取 MqttTopic
      */
-    public PublishClient(String topic, String clientId) throws MqttException {
-        /**
-         * mqtt 客户机ID
-         * heart_DEVICESN
-         */
-        this.topic = topic;
-        /**
-         * MemoryPersistence设置clientId的保存形式,默认为以内存保存
-         */
-        client = new MqttClient(HOST, clientId, new MemoryPersistence());
-        connect();
-    }
-
-    /**
-     * 连接服务器
-     */
-    private void connect() {
-        /**
-         * 连接配置
-         */
-        MqttConnectOptions options = new MqttConnectOptions();
-        /**
-         * 不保存,每次重启新client
-         */
-        options.setCleanSession(true);
-        options.setUserName(USER_NAME);
-        options.setPassword(PASS_WORD.toCharArray());
-        /**
-         * 设置超时时间
-         */
-        options.setConnectionTimeout(10);
-        /**
-         * 设置会话心跳时间
-         */
-        options.setKeepAliveInterval(20);
-        try {
-            /**
-             * 设置发布回调
-             */
-            client.setCallback(new PublishCallback());
-            client.connect(options);
-            topic11 = client.getTopic(topic);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
+    public static MqttTopic getMqttTopic(String topic) {
+        return client.getTopic(topic);
     }
 
     /**
@@ -117,18 +71,17 @@ public class PublishClient {
      * @throws MqttPersistenceException
      * @throws MqttException
      */
-    public void publish(MqttTopic topic, MqttMessage message) throws MqttPersistenceException,
+    public static void publish(MqttTopic topic, MqttMessage message) throws MqttPersistenceException,
             MqttException {
         MqttDeliveryToken token = topic.publish(message);
         token.waitForCompletion();
         System.out.println("message is published completely! " + token.isComplete());
     }
 
-    public static void pull(String sign, String deviceSn) throws MqttException, InterruptedException {
+    public static void pull(String sign, String deviceSn) throws MqttException {
         /**
          * 发布客户端
          */
-        PublishClient server = new PublishClient("heart_" + deviceSn, "heart_" + deviceSn);
         Heartbeat test = new Heartbeat();
         test.setName("HeartResponse");
         Data data = new Data();
@@ -138,11 +91,11 @@ public class PublishClient {
         test.setCode(200);
         test.setSign(sign);
         String s = JSON.toJSONString(test);
-        server.message = new MqttMessage();
+        MqttMessage message = new MqttMessage();
         /**
          * 保证消息能到达一次
          */
-        server.message.setQos(1);
+        message.setQos(1);
         /**
          * 消息保留
          */
@@ -150,20 +103,21 @@ public class PublishClient {
         /**
          * 消息内容
          */
-        server.message.setPayload(s.getBytes());
+        message.setPayload(s.getBytes());
         /**
          * 发布
          */
-        server.publish(server.topic11, server.message);
+        publish(getMqttTopic("heart_" + deviceSn), message);
     }
 
     public static void updateDeviceSn(BaseCameraVersionVo baseCameraVersionVo) {
         /**
          * 发布客户端
          */
+        log.info("updateDeviceSn---start");
         for (String code : baseCameraVersionVo.getCameraCodeList()) {
             try {
-                PublishClient server = new PublishClient("update_" + code, "update_" + code);
+                log.info("update_" + code);
                 UpdateDeviceSn updateDeviceSn = new UpdateDeviceSn();
                 updateDeviceSn.setName("UpdateRequest");
                 updateDeviceSn.setType(Integer.valueOf(baseCameraVersionVo.getUpgradeType()));
@@ -171,11 +125,11 @@ public class PublishClient {
                 updateDeviceSn.setSign(IdUtils.fastSimpleUUID());
                 updateDeviceSn.setUrl(baseCameraVersionVo.getVersionAddress());
                 String s = JSON.toJSONString(updateDeviceSn);
-                server.message = new MqttMessage();
+                MqttMessage message = new MqttMessage();
                 /**
                  * 保证消息能到达一次
                  */
-                server.message.setQos(1);
+                message.setQos(1);
                 /**
                  * 消息保留
                  */
@@ -183,24 +137,24 @@ public class PublishClient {
                 /**
                  * 消息内容
                  */
-                server.message.setPayload(s.getBytes());
+                message.setPayload(s.getBytes());
                 /**
                  * 发布
                  */
-                server.publish(server.topic11, server.message);
+                publish(getMqttTopic("update_" + code), message);
+                log.info("updateDeviceSn---end");
             } catch (MqttException e) {
-                System.out.println(e.getMessage());
+                System.out.println("updateDeviceSn-------" + e.getMessage());
             }
         }
     }
 
-    public static void confidenceCoefficient(BaseCameraVersionVo baseCameraVersionVo,String value) {
+    public static void confidenceCoefficient(BaseCameraVersionVo baseCameraVersionVo, String value) {
         /**
          * 发布客户端
          */
         for (String code : baseCameraVersionVo.getCameraCodeList()) {
             try {
-                PublishClient server = new PublishClient("config_" + code, "config_" + code);
                 JSONObject res = new JSONObject();
                 res.put("Name", "ConfigRequest");
                 Svp svp = new Svp();
@@ -210,39 +164,38 @@ public class PublishClient {
                 Map<String, Object> map = new HashMap<>();
                 map.put("svp", svp);
                 res.put("data", map);
-                res.put("sign", "cien"+IdUtils.fastSimpleUUID());
+                res.put("sign", "cien" + IdUtils.fastSimpleUUID());
                 String s = JSONObject.toJSONString(res);
 
-                server.message = new MqttMessage();
+                MqttMessage message = new MqttMessage();
                 /**
                  * 保证消息能到达一次
                  */
-                server.message.setQos(1);
+                message.setQos(1);
                 /**
                  * 消息保留
                  */
-//                server.message.setRetained(false);
+//               message.setRetained(false);
                 /**
                  * 消息内容
                  */
-                server.message.setPayload(s.getBytes());
+                message.setPayload(s.getBytes());
                 /**
                  * 发布
                  */
-                server.publish(server.topic11, server.message);
+                publish(getMqttTopic("config_" + code), message);
             } catch (MqttException e) {
                 System.out.println(e.getMessage());
             }
         }
     }
 
-    public static void configFrameRate(BaseCameraVersionVo baseCameraVersionVo,String value) {
+    public static void configFrameRate(BaseCameraVersionVo baseCameraVersionVo, String value) {
         /**
          * 发布客户端
          */
         for (String code : baseCameraVersionVo.getCameraCodeList()) {
             try {
-                PublishClient server = new PublishClient("config_" + code, "config_" + code);
                 JSONObject res = new JSONObject();
                 res.put("Name", "ConfigRequest");
                 Codec codec = new Codec();
@@ -252,29 +205,69 @@ public class PublishClient {
                 Map<String, Object> map = new HashMap<>();
                 map.put("codec", codec);
                 res.put("data", map);
-                res.put("sign", "rate"+IdUtils.fastSimpleUUID());
+                res.put("sign", "rate" + IdUtils.fastSimpleUUID());
                 String s = JSONObject.toJSONString(res);
 
-                server.message = new MqttMessage();
+                MqttMessage message = new MqttMessage();
                 /**
                  * 保证消息能到达一次
                  */
-                server.message.setQos(1);
+                message.setQos(1);
                 /**
                  * 消息保留
                  */
-//                server.message.setRetained(false);
+//              message.setRetained(false);
                 /**
                  * 消息内容
                  */
-                server.message.setPayload(s.getBytes());
+                message.setPayload(s.getBytes());
                 /**
                  * 发布
                  */
-                server.publish(server.topic11, server.message);
+                publish(getMqttTopic("config_" + code), message);
             } catch (MqttException e) {
                 System.out.println(e.getMessage());
             }
         }
     }
+
+    @PostConstruct
+    public void init() {
+        HOST = rabbitMqConfig.getHost();
+        USER_NAME = rabbitMqConfig.getUserName();
+        PASS_WORD = rabbitMqConfig.getPassword();
+        clientId = rabbitMqConfig.getClientId();
+        /**
+         * 连接配置
+         */
+        MqttConnectOptions options = new MqttConnectOptions();
+        /**
+         * 不保存,每次重启新client
+         */
+        options.setCleanSession(true);
+        options.setUserName(USER_NAME);
+        options.setPassword(PASS_WORD.toCharArray());
+        /**
+         * 设置超时时间
+         */
+        options.setConnectionTimeout(10);
+        /**
+         * 设置会话心跳时间
+         */
+        options.setKeepAliveInterval(20);
+        try {
+            /**
+             * 设置发布回调
+             */
+            client = new MqttClient(HOST, clientId, new MemoryPersistence());
+
+            client.setCallback(new PublishCallback());
+            client.connect(options);
+            int[] Qos = {1};
+            String[] topic1 = {"config", "update", "heart", "test"};
+            client.subscribe(topic1);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
 }

+ 23 - 0
business-service/src/main/java/com/ozs/service/utils/RabbitMqConfig.java

@@ -0,0 +1,23 @@
+package com.ozs.service.utils;
+
+import lombok.Data;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+@Data
+public class RabbitMqConfig {
+
+
+    @Value("${mqtt.host:tcp://124.70.58.209:1883}")
+    private String host;
+
+    @Value("${mqtt.userName:guest}")
+    private String userName;
+
+    @Value("${mqtt.passWord:guest}")
+    private String password;
+
+    @Value("${mqtt.clientId:HAZARD-CAMERA-CLIENTID-123}")
+    private String clientId;
+}

+ 0 - 94
business-service/src/main/java/com/ozs/service/utils/SubscribeClient.java

@@ -1,94 +0,0 @@
-package com.ozs.service.utils;
-
-import org.eclipse.paho.client.mqttv3.MqttClient;
-import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
-import org.eclipse.paho.client.mqttv3.MqttException;
-import org.eclipse.paho.client.mqttv3.MqttTopic;
-import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.stereotype.Component;
-
-import java.util.concurrent.ScheduledExecutorService;
-
-/**
- * 订阅客户端
- *
- * @author Administrator
- */
-public class SubscribeClient {
-    /**
-     * mqtt服务器ip
-     */
-    public static  final String HOST="tcp://124.70.58.209:1883";
-    /**
-     * 主题
-     */
-    public String topic;
-    /**
-     * mqtt 客户机ID
-     */
-    private final String clientId;
-    private static final String USER_NAME = "guest";
-    private static final String PASS_WORD = "guest";
-    @SuppressWarnings("unused")
-    private ScheduledExecutorService scheduler;
-
-    public SubscribeClient(String clientId, String topic) {
-        this.clientId = clientId;
-        this.topic = topic;
-    }
-
-    public void start() {
-        try {
-            /**
-             *  host为主机名,clientId即连接MQTT的客户端ID,一般以唯一标识符表示,MemoryPersistence设置clientId的保存形式,默认为以内存保存
-             */
-            MqttClient client = new MqttClient(HOST, this.clientId, new MemoryPersistence());
-            /**
-             * MQTT的连接设置
-             */
-            MqttConnectOptions options = new MqttConnectOptions();
-            /**
-             *  设置是否清空session,这里如果设置为false表示服务器会保留客户端的连接记录,设置为true表示每次连接到服务器都以新的身份连接
-             */
-            options.setCleanSession(true);
-            /**
-             * 设置连接的用户名
-             */
-            options.setUserName(USER_NAME);
-            /**
-             * 设置连接的密码
-             */
-            options.setPassword(PASS_WORD.toCharArray());
-            /**
-             * 设置超时时间 单位为秒
-             */
-            options.setConnectionTimeout(10);
-            /**
-             *  设置会话心跳时间 单位为秒 服务器会每隔1.5*20秒的时间向客户端发送个消息判断客户端是否在线,但这个方法并没有重连的机制
-             */
-            options.setKeepAliveInterval(20);
-            /**
-             * 设置回调
-             */
-            client.setCallback(new PublishCallback());
-            MqttTopic topic = client.getTopic(this.topic);
-            /**
-             * setWill方法,如果项目中需要知道客户端是否掉线可以调用该方法。设置最终端口的通知消息
-             *  遗嘱
-             */
-            options.setWill(topic, "close".getBytes(), 2, true);
-            client.connect(options);
-            /**
-             * 订阅消息
-             */
-            int[] Qos = {1};
-            String[] topic1 = {this.topic};
-            client.subscribe(topic1, Qos);
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-}

+ 17 - 4
business-service/src/main/resources/mapper/service/BaseCameraManagementMapper.xml

@@ -25,13 +25,18 @@
         a.version_num AS versionNum,
         a.version_name AS versionName,
         a.last_version_num AS lastVersionNum,
-        a.remark AS remark
+        a.measure_point_name AS measurePointName,
+        a.camera_sn AS cameraSn
         FROM
-        base_camera_management a
+        base_camera_management a join base_railway_management r
+        on a.railway_code=r.railway_code
         <where>
             <if test="railwayCode != null and railwayCode != ''">
                 and a.railway_code=#{railwayCode}
             </if>
+            <if test="cameraCode != null and cameraCode != ''">
+                and a.camera_code like concat('%', #{cameraCode}, '%')
+            </if>
             <if test="lineDir != null and lineDir != 0">
                 and a.line_dir =#{lineDir}
             </if>
@@ -39,14 +44,20 @@
                 and a.dept_id =#{deptId}
             </if>
             <if test="beginMile != null and beginMile != 0">
-                and a.begin_mile &gt;=#{beginMile}
+                and a.install_mile &gt;=#{beginMile}
             </if>
             <if test="endMile != null and endMile != 0">
-                and a.end_mile &lt;=#{endMile}
+                and a.install_mile &lt;=#{endMile}
             </if>
             <if test="installMile != null and installMile != 0">
                 and a.install_mile =#{installMile}
             </if>
+            <if test="ids != null and ids.size>0">
+                and a.id in
+                <foreach item="items" collection="ids" separator="," open="(" close=")" index="">
+                    #{items}
+                </foreach>
+            </if>
             <if test="!dsFlay">
                 and
                 <trim prefix="(" prefixOverrides="or" suffix=")">
@@ -65,6 +76,8 @@
                 </trim>
             </if>
         </where>
+        ORDER BY
+        CONVERT (r.railway_name USING gbk),a.install_mile
     </select>
 
     <select id="countCamera" parameterType="com.ozs.service.entity.vo.MsgAlarmVo" resultType="java.lang.Integer">

+ 6 - 4
business-service/src/main/resources/mapper/service/BaseDeviceDynamicManagementMapper.xml

@@ -9,10 +9,12 @@
 			a.camera_code AS cameraCode, 
 			a.line_dir AS lineDir, 
 			a.install_mile AS installMile, 
-			a.id AS id
-		FROM
-		    base_camera_management AS a inner join
-		    base_railway_management AS l on a.railway_code = l.railway_code
+			a.id AS id,
+			a.dept_id,
+			d.dept_name as publicWorksSection
+		FROM base_camera_management AS a
+		    inner join sys_dept as d on a.dept_id = d.dept_id
+		    inner join base_railway_management AS l on a.railway_code = l.railway_code
 		<where>
 			<if test="railwayCode != null and railwayCode !=''">
 				and concat(l.railway_name,a.camera_code,a.railway_code) like concat("%",#{railwayCode},"%")

+ 8 - 0
business-service/src/main/resources/mapper/service/BaseRailwayManagementMapper.xml

@@ -5,4 +5,12 @@
     <select id="getCameraNameByCameraCode" resultType="java.lang.String" parameterType="java.lang.String">
         select railway_name railwayName from base_railway_management where railway_code = #{cameraCode}
     </select>
+
+    <select id="listRailway" resultType="com.ozs.service.entity.BaseRailwayManagement">
+        select a.dept_id, a.dept_name, c.* from
+            (select dept_id, dept_name from sys_dept) a JOIN
+            (select dept_id, railway_code from base_camera_management) b on a.dept_id = b.dept_id join
+            (select * from base_railway_management) c on b.railway_code = c.railway_code
+        group by c.railway_code, a.dept_id
+    </select>
 </mapper>

+ 11 - 5
business-service/src/main/resources/mapper/service/CameraLogDetailMapper.xml

@@ -12,7 +12,7 @@
         <result column="currentVersionNum" property="currentVersionNum"/>
     </resultMap>
     <select id="selectDetail" resultMap="CameraDetailResult"
-            parameterType="com.ozs.service.entity.vo.CameraUpdateLogResp">
+            parameterType="com.ozs.service.entity.vo.CameraUpdateLogResVo">
         select
         a.id,
         a.camera_code,
@@ -21,10 +21,10 @@
         a.update_time,
         a.remark,
         b.version_num as currentVersionNum,
-        b.last_version_num as lastVersionNum
-        from camera_log_detail as a inner join
-        base_camera_management as b on a.camera_code=b.camera_code
-
+        b.last_version_num as lastVersionNum,
+        b.camera_sn as cameraSn
+        from camera_log_detail as a
+        inner join base_camera_management as b on a.camera_code=b.camera_code
         <where>
             <if test="logId != null and logId != 0">
                 and a.log_id =#{logId}
@@ -41,6 +41,12 @@
             <if test="status != null and status != ''">
                 and UPPER(a.status) like UPPER(CONCAT('%',#{status},'%'))
             </if>
+            <if test="ids != null and ids.size()>0">
+                and a.id in
+                <foreach item="items" collection="ids" separator="," open="(" close=")" index="index">
+                    #{items}
+                </foreach>
+            </if>
         </where>
         order by a.update_time desc
     </select>

+ 95 - 0
business-service/src/main/resources/mapper/service/MsgAlarmMapper.xml

@@ -143,6 +143,12 @@
             <if test="alarmType != null and alarmType != ''">
                 and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
             </if>
+            <if test="ids != null and ids.size>0">
+                and a.id in
+                <foreach item="items" collection="ids" separator="," open="(" close=")" index="">
+                    #{items}
+                </foreach>
+            </if>
             <if test="!dsFlay">
                 and
                 <trim prefix="(" prefixOverrides="or" suffix=")">
@@ -280,6 +286,89 @@
         where camera_code = #{cameraCode}
         order by alarm_time desc limit 1
     </select>
+
+    <select id="selectMsgAlarmListHome" resultType="com.ozs.service.entity.MsgAlarm"
+            parameterType="com.ozs.service.entity.vo.MsgAlarmVo">
+        SELECT
+        a.alarm_id AS alarmId,
+        a.alarm_time AS alarmTime,
+        a.alarm_mile AS alarmMile,
+        a.line_dir AS lineDir,
+        a.alarm_type AS alarmType,
+        a.camera_code AS cameraCode,
+        a.id AS id,
+        a.content AS content,
+        a.alarm_confidence AS alarmConfidence,
+        a.alarm_attr AS alarmAttr,
+        a.image_url AS imageUrl,
+        a.released_by AS releasedBy,
+        a.is_lock AS isLock,
+        a.released_time AS releasedTime,
+        a.released_type AS releasedType,
+        a.released_reason AS releasedReason,
+        a.remark AS remark
+        FROM msg_alarm AS a
+            join base_camera_management AS b on a.camera_code=b.camera_code
+            join base_railway_management AS l on b.railway_code=l.railway_code
+        <where>
+            <if test="railwayCode != null and railwayCode != ''">
+                concat(l.railway_name,l.railway_code)
+                like concat("%",#{railwayCode},"%")
+            </if>
+            <if test="beginMile != null and beginMile != 0">
+                and b.begin_mile &gt;=#{beginMile}
+            </if>
+            <if test="endMile != null and endMile != 0">
+                and b.end_mile &lt;=#{endMile}
+            </if>
+            <if test="ids != null and ids.size>0">
+                and a.id in
+                <foreach item="items" collection="ids" separator="," open="(" close=")" index="">
+                    #{items}
+                </foreach>
+            </if>
+            <if test="!dsFlay">
+                and
+                <trim prefix="(" prefixOverrides="or" suffix=")">
+                    <if test="dsUserId != null and dsUserId != ''">
+                        or a.create_by=#{dsUserId}
+                    </if>
+                    <if test="dsDeptId != null and dsDeptId != 0">
+                        or b.dept_id=#{dsDeptId}
+                    </if>
+                    <if test="dsDeptIds != null">
+                        or b.dept_id in
+                        <foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
+                            #{item}
+                        </foreach>
+                    </if>
+                </trim>
+            </if>
+            <if test="alarmType != null and alarmType != 0">
+                and a.alarm_type=#{alarmType}
+            </if>
+            <if test="alarmMile != null and alarmMile != 0">
+                and a.alarm_mile=#{alarmMile}
+            </if>
+            <if test="isLock != null and isLock != 0">
+                and a.is_lock=#{isLock}
+            </if>
+            <if test="lineDir != null and lineDir != 0">
+                and a.line_dir =#{lineDir}
+            </if>
+            <if test="releasedType != null and releasedType != 0">
+                and a.released_type =#{releasedType}
+            </if>
+            <if test="beginAlarmTime != null and beginAlarmTime != ''">
+                and date_format(a.alarm_time,'%Y-%m-%d') &gt;= date_format(#{beginAlarmTime},'%Y-%m-%d')
+            </if>
+            <if test="endAlarmTime != null and endAlarmTime != ''">
+                AND date_format(a.alarm_time,'%Y-%m-%d') &lt;= date_format(#{endAlarmTime},'%Y-%m-%d')
+            </if>
+        </where>
+        order by a.is_lock desc, a.alarm_time desc
+    </select>
+
     <select id="selectMsgAlarmList" resultType="com.ozs.service.entity.MsgAlarm"
             parameterType="com.ozs.service.entity.vo.MsgAlarmVo">
         SELECT
@@ -315,6 +404,12 @@
             <if test="endMile != null and endMile != 0">
                 and b.end_mile &lt;=#{endMile}
             </if>
+            <if test="ids != null and ids.size>0">
+                and a.id in
+                <foreach item="items" collection="ids" separator="," open="(" close=")" index="">
+                    #{items}
+                </foreach>
+            </if>
             <if test="!dsFlay">
                 and
                 <trim prefix="(" prefixOverrides="or" suffix=")">

+ 1 - 13
hazard-admin/pom.xml

@@ -70,19 +70,7 @@
             <artifactId>spring-boot-devtools</artifactId>
             <optional>true</optional> <!-- 表示依赖不会传递 -->
         </dependency>
-
-        <!-- swagger3-->
-<!--        <dependency>-->
-<!--            <groupId>io.springfox</groupId>-->
-<!--            <artifactId>springfox-boot-starter</artifactId>-->
-<!--        </dependency>-->
-
-        <!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
-        <dependency>
-            <groupId>io.swagger</groupId>
-            <artifactId>swagger-models</artifactId>
-            <version>1.6.2</version>
-        </dependency>
+        
 
          <!-- Mysql驱动包 -->
         <dependency>

+ 212 - 152
hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseCameraManagementController.java

@@ -2,11 +2,13 @@ package com.ozs.web.controller.accountmanagment;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ozs.common.annotation.Log;
 import com.ozs.common.core.controller.BaseController;
 import com.ozs.common.core.domain.AjaxResult;
 import com.ozs.common.core.domain.entity.SysDept;
+import com.ozs.common.core.domain.entity.SysDictData;
 import com.ozs.common.core.redis.RedisCache;
 import com.ozs.common.enums.BusinessType;
 import com.ozs.common.exception.base.BaseException;
@@ -33,9 +35,9 @@ import com.ozs.service.service.BaseUserService;
 import com.ozs.service.service.MsgAlarmService;
 import com.ozs.system.service.DataScoreUtil;
 import com.ozs.system.service.ISysDeptService;
+import com.ozs.system.service.ISysDictTypeService;
 import com.ozs.web.core.config.CaneraConfig;
 import com.ozs.web.core.util.CameraUtil;
-import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -43,11 +45,9 @@ import org.springframework.http.MediaType;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.ObjectUtils;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -58,6 +58,7 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.constraints.NotNull;
 import java.io.InputStream;
+import java.math.BigDecimal;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -96,12 +97,13 @@ public class BaseCameraManagementController extends BaseController {
     private BaseUserService baseUserService;
     @Autowired
     private RedisCache redisCache;
+    @Autowired
+    private ISysDictTypeService dictTypeService;
 
 
     /**
      * 所有相机列表+权限
      */
-    @ApiOperation(value = "相机台账管理")
     @GetMapping("/selectCameraAll")
     @Log(title = "相机台账管理", businessType = BusinessType.SELECT)
     public AjaxResult selectCameraAll() {
@@ -111,7 +113,6 @@ public class BaseCameraManagementController extends BaseController {
     }
 
     @PostMapping(value = "/homeGetInfo")
-    @ApiOperation("根据相机ID、是否解除 获取相机信息、未解除信息")
     @Log(title = "相机台账管理", businessType = BusinessType.SELECT)
     public AjaxResult homeGetInfo(@RequestBody BaseCameraManagementHomeVo baseCameraManagementHomeVo) {
         Integer isLock = baseCameraManagementHomeVo.getIsLock();
@@ -130,10 +131,14 @@ public class BaseCameraManagementController extends BaseController {
             baseCameraManagement.setRailwayName(baseRailwayManagement.getRailwayName());
             String mils = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
             baseCameraManagement.setInstallMiles(mils);
-            String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
-            baseCameraManagement.setEndMiles(end);
-            String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
-            baseCameraManagement.setBeginMiles(begin);
+            if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMile())) {
+                String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
+                baseCameraManagement.setEndMiles(end);
+            }
+            if (!ObjectUtils.isEmpty(baseCameraManagement.getBeginMile())) {
+                String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
+                baseCameraManagement.setBeginMiles(begin);
+            }
             return AjaxResult.success(baseCameraManagement);
         } else if (!StringUtils.isEmpty(isLock) && isLock == 2 && !StringUtils.isEmpty(cameraCode)) {
             MsgAlarm msgAlarm = msgAlarmService.selectByCameraCode(cameraCode);
@@ -151,10 +156,12 @@ public class BaseCameraManagementController extends BaseController {
             BeanUtils.copyProperties(msgAlarm, msgAlarmResp);
             msgAlarmResp.setRailwayName(baseRailwayManagement.getRailwayName());
             msgAlarmResp.setDeptId(baseCameraManagement.getDeptId());
-            String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
-            String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
-            String endMile = begin + "-" + end;
-            msgAlarmResp.setBeginMile(endMile);
+            if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMile()) && !ObjectUtils.isEmpty(baseCameraManagement.getBeginMile())) {
+                String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
+                String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
+                String endMile = begin + "-" + end;
+                msgAlarmResp.setBeginMile(endMile);
+            }
             String mile = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
             msgAlarmResp.setAlarmMile(mile);
             msgAlarmResp.setInstallLongitude(baseCameraManagement.getInstallLongitude() + "," + baseCameraManagement.getInstallLatitude());
@@ -172,7 +179,6 @@ public class BaseCameraManagementController extends BaseController {
      * @param baseCameraManagementVo
      * @return
      */
-    @ApiOperation(value = "相机台账管理分页")
     @PostMapping("/list")
     @Log(title = "相机台账管理", businessType = BusinessType.SELECT)
     public AjaxResult selectBaseAccountManagement(@RequestBody BaseCameraManagementVo baseCameraManagementVo) {
@@ -201,13 +207,19 @@ public class BaseCameraManagementController extends BaseController {
                 BaseRailwayManagement baseRailwayManagement = baseRailwayManagementService.getOne(queryWrapper);
                 SysDept sysDept = deptService.selectDeptById(o.getDeptId());
                 o.setDeptName(sysDept.getDeptName());
-                o.setRailwayName(baseRailwayManagement.getRailwayName());
+                if (!StringUtils.isEmptySunhh(baseRailwayManagement) && !StringUtils.isEmptySunhh(baseRailwayManagement.getRailwayName())) {
+                    o.setRailwayName(baseRailwayManagement.getRailwayName());
+                }
                 String mils = AppendUtils.stringAppend(o.getInstallMile());
                 o.setInstallMiles(mils);
-                String end = AppendUtils.stringAppend(o.getEndMile());
-                o.setEndMiles(end);
-                String begin = AppendUtils.stringAppend(o.getBeginMile());
-                o.setBeginMiles(begin);
+                if (!ObjectUtils.isEmpty(o.getEndMile())) {
+                    String end = AppendUtils.stringAppend(o.getEndMile());
+                    o.setEndMiles(end);
+                }
+                if (!ObjectUtils.isEmpty(o.getBeginMile())) {
+                    String begin = AppendUtils.stringAppend(o.getBeginMile());
+                    o.setBeginMiles(begin);
+                }
                 if (roleKey.size() > 0 || "admin".equals(baseUser.getUserName())) {
                     o.setIsStartRecording(1);
                     for (String s : roleKey) {
@@ -232,8 +244,7 @@ public class BaseCameraManagementController extends BaseController {
      * @param accountManagementIds
      * @return
      */
-    @DeleteMapping("/{accountManagementIds}")
-    @ApiOperation("删除相机台账管理信息")
+    @RequestMapping("/remove/{accountManagementIds}")
     @Log(title = "相机台账管理", businessType = BusinessType.DELETE)
     @Transactional
     public AjaxResult removeAccountManagement(@PathVariable List<Long> accountManagementIds) {
@@ -256,7 +267,6 @@ public class BaseCameraManagementController extends BaseController {
      * @return
      */
     @PostMapping("/saveAccountManagement")
-    @ApiOperation("新增相机台账管理信息")
     @Transactional
     @Log(title = "相机台账管理", businessType = BusinessType.INSERT)
     public AjaxResult saveAccountManagement(@RequestBody BaseCameraManagement baseCameraManagement) {
@@ -282,26 +292,27 @@ public class BaseCameraManagementController extends BaseController {
             if (!ObjectUtils.isEmpty(one)) {
                 return error("设备动态管理表该相机编码已存在,不能重复添加");
             }
-            if (!baseCameraManagement.getBeginMiles().matches(PATTERN)) {
-                return error("监控范围开始里程位置填写格式不正确");
-            } else {
-                double begin = Double.parseDouble(baseCameraManagement.getBeginMiles());
-                baseCameraManagement.setBeginMile((int) (begin * 1000));
+            if (!ObjectUtils.isEmpty(baseCameraManagement.getBeginMiles())) {
+                if (!baseCameraManagement.getBeginMiles().matches(PATTERN)) {
+                    return error("监控范围开始里程位置填写格式不正确");
+                } else {
+                    BigDecimal begin = new BigDecimal(baseCameraManagement.getBeginMiles());
+                    baseCameraManagement.setBeginMile(begin.multiply(BigDecimal.valueOf(1000)).intValue());
+                }
             }
             if (!baseCameraManagement.getInstallMiles().matches(PATTERN)) {
                 return error("监控相机安装里程位置填写格式不正确");
             } else {
-                double install = Double.parseDouble(baseCameraManagement.getInstallMiles());
-                baseCameraManagement.setInstallMile((int) (install * 1000));
-            }
-            if (!baseCameraManagement.getEndMiles().matches(PATTERN)) {
-                return error("监控范围结束里程位置填写格式不正确");
-            } else {
-                double end = Double.parseDouble(baseCameraManagement.getEndMiles());
-                baseCameraManagement.setEndMile((int) (end * 1000));
+                BigDecimal install = new BigDecimal(baseCameraManagement.getInstallMiles());
+                baseCameraManagement.setInstallMile(install.multiply(BigDecimal.valueOf(1000)).intValue());
             }
-            if (baseCameraManagement.getBeginMile() > baseCameraManagement.getEndMile()) {
-                return error("监控范围开始里程位置不能大于监控范围结束里程位置");
+            if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMiles())) {
+                if (!baseCameraManagement.getEndMiles().matches(PATTERN)) {
+                    return error("监控范围结束里程位置填写格式不正确");
+                } else {
+                    BigDecimal end = new BigDecimal(baseCameraManagement.getEndMiles());
+                    baseCameraManagement.setEndMile(end.multiply(BigDecimal.valueOf(1000)).intValue());
+                }
             }
             baseCameraManagement.setCreateBy(getUserId());
             baseCameraManagement.setUpdateBy(getUserId());
@@ -309,12 +320,15 @@ public class BaseCameraManagementController extends BaseController {
             baseDynamicManagement.setCameraCode(baseCameraManagement.getCameraCode());
             baseDynamicManagement.setUpdateBy(getUserId());
             baseDynamicManagement.setCreateBy(getUserId());
-            String start = HttpUtils.sendGet(CameraUtil.startRecording(baseCameraManagement.getCameraCode(), baseCameraManagement.getChannel()));
-            if (start.startsWith(baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel())) {
-                baseCameraManagement.setStartRecording(1);
-                baseCameraManagement.setTaskId(start);
-            } else {
-                baseCameraManagement.setStartRecording(2);
+            List<SysDictData> data = dictTypeService.selectDictDataByType("management_transcribe_switch");
+            if (data.get(0).getDictValue().equals("true")) {
+                String start = HttpUtils.sendGet(CameraUtil.startRecording(baseCameraManagement.getCameraCode(), baseCameraManagement.getChannel()));
+                if (start.startsWith(baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel())) {
+                    baseCameraManagement.setStartRecording(1);
+                    baseCameraManagement.setTaskId(start);
+                } else {
+                    baseCameraManagement.setStartRecording(2);
+                }
             }
             if (baseCameraManagementService.save(baseCameraManagement) && baseDeviceDynamicManagementService.save(baseDynamicManagement)) {
                 return AjaxResult.success();
@@ -335,8 +349,7 @@ public class BaseCameraManagementController extends BaseController {
      * @param baseCameraManagement
      * @return
      */
-    @PutMapping("/editAccountManagement")
-    @ApiOperation("修改相机台账管理信息")
+    @PostMapping("/editAccountManagement")
     @Log(title = "相机台账管理", businessType = BusinessType.UPDATE)
     public AjaxResult editAccountManagement(@RequestBody BaseCameraManagement baseCameraManagement) {
         LambdaQueryWrapper<BaseCameraManagement> lw = new LambdaQueryWrapper<BaseCameraManagement>();
@@ -347,26 +360,31 @@ public class BaseCameraManagementController extends BaseController {
         if (!ObjectUtils.isEmpty(cameraManagement) && !cameraManagement.getId().equals(baseCameraManagement.getId())) {
             return error("相机编码已存在,不能进行修改操作");
         }
-        if (!baseCameraManagement.getBeginMiles().matches(PATTERN)) {
-            return error("监控范围开始里程位置填写格式不正确");
-        } else {
-            double begin = Double.parseDouble(baseCameraManagement.getBeginMiles());
-            baseCameraManagement.setBeginMile((int) (begin * 1000));
+        if (!ObjectUtils.isEmpty(baseCameraManagement.getBeginMiles())) {
+            if (!baseCameraManagement.getBeginMiles().matches(PATTERN)) {
+                return error("监控范围开始里程位置填写格式不正确");
+            } else {
+                BigDecimal begin = new BigDecimal(baseCameraManagement.getBeginMiles());
+                baseCameraManagement.setBeginMile(begin.multiply(BigDecimal.valueOf(1000)).intValue());
+            }
+        }else {
+            baseCameraManagement.setBeginMile(null);
         }
         if (!baseCameraManagement.getInstallMiles().matches(PATTERN)) {
             return error("监控相机安装里程位置填写格式不正确");
         } else {
-            double install = Double.parseDouble(baseCameraManagement.getInstallMiles());
-            baseCameraManagement.setInstallMile((int) (install * 1000));
-        }
-        if (!baseCameraManagement.getEndMiles().matches(PATTERN)) {
-            return error("监控范围结束里程位置填写格式不正确");
-        } else {
-            double end = Double.parseDouble(baseCameraManagement.getEndMiles());
-            baseCameraManagement.setEndMile((int) (end * 1000));
+            BigDecimal install = new BigDecimal(baseCameraManagement.getInstallMiles());
+            baseCameraManagement.setInstallMile(install.multiply(BigDecimal.valueOf(1000)).intValue());
         }
-        if (baseCameraManagement.getBeginMile() > baseCameraManagement.getEndMile()) {
-            return error("监控范围开始里程位置不能大于监控范围结束里程位置");
+        if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMiles())) {
+            if (!baseCameraManagement.getEndMiles().matches(PATTERN)) {
+                return error("监控范围结束里程位置填写格式不正确");
+            } else {
+                BigDecimal end = new BigDecimal(baseCameraManagement.getEndMiles());
+                baseCameraManagement.setEndMile(end.multiply(BigDecimal.valueOf(1000)).intValue());
+            }
+        }else {
+            baseCameraManagement.setEndMile(null);
         }
         BaseCameraManagement management = baseCameraManagementService.getById(baseCameraManagement.getId());
         baseCameraManagement.setUpdateBy(getUserId());
@@ -381,14 +399,15 @@ public class BaseCameraManagementController extends BaseController {
             return error("设备动态管理表没有该相机编码");
         }
         one.setCameraCode(baseCameraManagement.getCameraCode());
-        if (baseCameraManagementService.updateById(baseCameraManagement) && baseDeviceDynamicManagementService.updateById(one)) {
+        LambdaUpdateWrapper<BaseCameraManagement> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(BaseCameraManagement::getId,baseCameraManagement.getId());
+        if (baseCameraManagementService.update(baseCameraManagement,wrapper) && baseDeviceDynamicManagementService.updateById(one)) {
             return AjaxResult.success();
         }
         return AjaxResult.error();
     }
 
     @GetMapping(value = "/{id}")
-    @ApiOperation("根据相机ID获取相机台账管理信息")
     @Log(title = "相机台账管理", businessType = BusinessType.MESSAGE)
     public AjaxResult getInfo(@PathVariable Long id) {
         BaseCameraManagement baseCameraManagement = baseCameraManagementService.getById(id);
@@ -402,8 +421,6 @@ public class BaseCameraManagementController extends BaseController {
         baseCameraManagement.setRailwayName(baseRailwayManagement.getRailwayName());
 
         Double install = (double) baseCameraManagement.getInstallMile() / 1000;
-        Double end = (double) baseCameraManagement.getEndMile() / 1000;
-        Double begin = (double) baseCameraManagement.getBeginMile() / 1000;
         String[] split = install.toString().split("\\.");
         int number = Integer.parseInt(split[1]);
         if (number == 0) {
@@ -411,25 +428,35 @@ public class BaseCameraManagementController extends BaseController {
         } else {
             baseCameraManagement.setInstallMiles(install.toString());
         }
-        String[] ends = end.toString().split("\\.");
-        int numbers = Integer.parseInt(ends[1]);
-        if (numbers == 0) {
-            baseCameraManagement.setEndMiles(ends[0]);
-        } else {
-            baseCameraManagement.setEndMiles(end.toString());
+        if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMile())) {
+            Double end = (double) baseCameraManagement.getEndMile() / 1000;
+            String[] ends = end.toString().split("\\.");
+            int numbers = Integer.parseInt(ends[1]);
+            if (numbers == 0) {
+                baseCameraManagement.setEndMiles(ends[0]);
+            } else {
+                baseCameraManagement.setEndMiles(end.toString());
+            }
         }
-        String[] begins = begin.toString().split("\\.");
-        int numberss = Integer.parseInt(begins[1]);
-        if (numberss == 0) {
-            baseCameraManagement.setBeginMiles(begins[0]);
-        } else {
-            baseCameraManagement.setBeginMiles(begin.toString());
+        if (!ObjectUtils.isEmpty(baseCameraManagement.getBeginMile())) {
+            Double begin = (double) baseCameraManagement.getBeginMile() / 1000;
+            String[] begins = begin.toString().split("\\.");
+            int numberss = Integer.parseInt(begins[1]);
+            if (numberss == 0) {
+                baseCameraManagement.setBeginMiles(begins[0]);
+            } else {
+                baseCameraManagement.setBeginMiles(begin.toString());
+            }
         }
         String mils = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
         baseCameraManagement.setInstalls(mils);
-        String en = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
-        String beg = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
-        baseCameraManagement.setBegins(beg + "~" + en);
+        if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMile())&&!ObjectUtils.isEmpty(baseCameraManagement.getBeginMile())) {
+            String en = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
+            String beg = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
+            baseCameraManagement.setBeginString(beg);
+            baseCameraManagement.setEndString(en);
+            baseCameraManagement.setBegins(beg + "~" + en);
+        }
         BaseUser baseUser = baseUserService.getUser(baseCameraManagement.getCreateBy());
         baseCameraManagement.setCreateBy(baseUser.getUserName());
         BaseUser user = baseUserService.getUser(baseCameraManagement.getUpdateBy());
@@ -438,7 +465,6 @@ public class BaseCameraManagementController extends BaseController {
     }
 
     @GetMapping("/getDate/{cameraCode}")
-    @ApiOperation("视频上方显示的数据")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult getDate(@PathVariable String cameraCode) {
         LambdaQueryWrapper<BaseCameraManagement> lw = new LambdaQueryWrapper<BaseCameraManagement>();
@@ -474,6 +500,7 @@ public class BaseCameraManagementController extends BaseController {
         list.add(baseCameraManagement.getLineDir());
         list.add(baseCameraManagement.getCameraCode());
         list.add(baseDeviceDynamicManagement.getElectricity());
+        list.add(baseCameraManagement.getMeasurePointName());
         if (list1.size() <= 0) {
             list.add(1);
         } else {
@@ -491,14 +518,28 @@ public class BaseCameraManagementController extends BaseController {
      * @return
      * @throws Exception
      */
-    @ApiOperation("相机台账管理信息导入")
     @PostMapping("/importBaseAccountManagement")
     @Log(title = "相机台账管理", businessType = BusinessType.IMPORT)
     public AjaxResult importBaseAccountManagement(MultipartFile file, boolean updateSupport) throws Exception {
-        ExcelUtil<BaseCameraManagementVos> util = new ExcelUtil<BaseCameraManagementVos>(BaseCameraManagementVos.class);
-        List<BaseCameraManagementVos> accountManageList = util.importExcel(file.getInputStream());
-        String message = baseCameraManagementService.importBaseAccountManagement(accountManageList, updateSupport, getUserId());
-        return AjaxResult.success(message);
+        try {
+            List<BaseCameraManagementVos> accountManageList;
+            ExcelUtil<BaseCameraManagementVos> util = new ExcelUtil<BaseCameraManagementVos>(BaseCameraManagementVos.class);
+            ExcelUtil<String> utils = new ExcelUtil<String>(String.class);
+            InputStream resourceAsStream = this.getClass().getResourceAsStream("/template/baseCameraManagement.xlsx");
+            List<String> accountManage = utils.importExcels(StringUtils.EMPTY, file.getInputStream(),0);
+            List<String> accountManageLists = utils.importExcels(StringUtils.EMPTY, resourceAsStream,0);
+            boolean stats = accountManage.stream().sorted().collect(Collectors.joining())
+                    .equals(accountManageLists.stream().sorted().collect(Collectors.joining()));
+            if (stats) {
+                 accountManageList = util.importExcel(file.getInputStream());
+            }else {
+                return AjaxResult.error("表头格式不正确,请按照模板样式编写");
+            }
+            String message = baseCameraManagementService.importBaseAccountManagement(accountManageList, updateSupport, getUserId());
+            return AjaxResult.success(message);
+        } catch (Exception exception) {
+           return AjaxResult.error(exception.getMessage());
+        }
     }
 
     /**
@@ -506,7 +547,6 @@ public class BaseCameraManagementController extends BaseController {
      *
      * @param response
      */
-    @ApiOperation("导出相机台账管理信息")
     @PostMapping("/exportBaseAccountManagement")
     @Log(title = "相机台账管理", businessType = BusinessType.EXPORT)
     public void exportBaseAccountManagement(HttpServletResponse response, @RequestBody BaseCameraManagementVo baseCameraManagementVo) {
@@ -529,17 +569,34 @@ public class BaseCameraManagementController extends BaseController {
             baseCameraManagement.setRailwayName(baseRailwayManagement.getRailwayName());
             String mils = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
             baseCameraManagement.setInstallMiles(mils);
-            String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
-            baseCameraManagement.setEndMiles(end);
-            String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
-            baseCameraManagement.setBeginMiles(begin);
+            if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMile())) {
+                String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
+                baseCameraManagement.setEndMiles(end);
+            }
+            if (!ObjectUtils.isEmpty(baseCameraManagement.getBeginMile())) {
+                String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
+                baseCameraManagement.setBeginMiles(begin);
+            }
         }
+        baseCameraManagementList.sort(new Comparator<BaseCameraManagement>() {
+            @Override
+            public int compare(BaseCameraManagement o1, BaseCameraManagement o2) {
+                String name1 = ChineseToPingyin.convertHanziToPinyin(o1.getRailwayName());
+                String substring1 = name1.substring(0, 1);
+                String name2 = ChineseToPingyin.convertHanziToPinyin(o2.getRailwayName());
+                String substring2 = name2.substring(0, 1);
+                int i = substring1.compareTo(substring2);
+                if (i == 0) {
+                    return o1.getInstallMile() - o2.getInstallMile();
+                }
+                return i;
+            }
+        });
         ExcelUtil<BaseCameraManagement> util = new ExcelUtil<>(BaseCameraManagement.class);
         util.exportExcel(response, baseCameraManagementList, "台账管理相机数据");
     }
 
 
-    @ApiOperation("相机台账管理信息模板下载")
     @GetMapping("/downloaExcel")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public void downloadZip(HttpServletResponse response) {
@@ -553,7 +610,6 @@ public class BaseCameraManagementController extends BaseController {
         }
     }
 
-    @ApiOperation("查询录像")
     @GetMapping("/api/records/{cameraCode}")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult apiRecords(@PathVariable @NotNull(message = "相机编码不能为空") String cameraCode) {
@@ -566,7 +622,6 @@ public class BaseCameraManagementController extends BaseController {
         return new AjaxResult(200, "ok", CameraUtil.getPlayFlv(cameraCode, one.getChannel()));
     }
 
-    @ApiOperation("查询录像")
     @GetMapping("/api/records/{cameraCode}/{flay}")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult apiRecords(@PathVariable @NotNull(message = "相机编码不能为空") String cameraCode,
@@ -580,7 +635,6 @@ public class BaseCameraManagementController extends BaseController {
         return new AjaxResult(200, "ok", CameraUtil.getPlayFlv(cameraCode, one.getChannel(), flay));
     }
 
-    @ApiOperation("查询录像")
     @GetMapping("/api/records/{cameraCode}/{flay}/{format}")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult apiRecords(@PathVariable @NotNull(message = "相机编码不能为空") String cameraCode,
@@ -595,7 +649,6 @@ public class BaseCameraManagementController extends BaseController {
         return new AjaxResult(200, "ok", CameraUtil.getPlayFlv(cameraCode, one.getChannel(), flay, format));
     }
 
-    @ApiOperation("批量查询录像")
     @GetMapping("/api/recordsList")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult apiRecordsList(@RequestBody
@@ -622,7 +675,6 @@ public class BaseCameraManagementController extends BaseController {
     }
 
 
-    @ApiOperation("播放回放-废弃")
     @PostMapping("/api/invite")
     public AjaxResult apiInvite(@Validated @RequestBody BaseCameraResVo vo) {
         LambdaQueryWrapper<BaseCameraManagement> lw = new LambdaQueryWrapper<BaseCameraManagement>();
@@ -635,7 +687,6 @@ public class BaseCameraManagementController extends BaseController {
         return success();
     }
 
-    @ApiOperation("播放回放")
     @PostMapping("/api/play")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult play(@Validated @RequestBody BaseCameraResVo vo) {
@@ -653,7 +704,6 @@ public class BaseCameraManagementController extends BaseController {
 //        return success(CameraUtil.historyPlayList(one.getChannel(), vo.getStartTime(), vo.getEntTime()));
     }
 
-    @ApiOperation("视频服务设备数量")
     @GetMapping("/totalNumberOfDevices")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult totalNumberOfDevices() {
@@ -669,7 +719,6 @@ public class BaseCameraManagementController extends BaseController {
      * @param
      * @return
      */
-    @ApiOperation("视频服务树形结构")
     @PostMapping("/cameraTree")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult cameraTree(@RequestBody CameraTreeVo cameraTreeVo) {
@@ -690,8 +739,6 @@ public class BaseCameraManagementController extends BaseController {
                 return substring1.compareTo(substring2);
             }
         });
-
-
         for (CameraTree child : children) {
             List<CameraTree> children1 = child.getChildren();
             children1.sort(new Comparator<CameraTree>() {
@@ -724,64 +771,71 @@ public class BaseCameraManagementController extends BaseController {
         return success(cameraTree);
     }
 
-    @ApiOperation("关闭视频录制")
     @GetMapping("/endRecording/{id}")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult endRecording(@PathVariable Long id) {
-        BaseCameraManagement baseCameraManagement = baseCameraManagementService.getById(id);
-        if (ObjectUtils.isEmpty(baseCameraManagement)) {
-            return error("查不到该ID的相机台账数据!!!");
-        }
-        log.info("endRecording------------" + baseCameraManagement.getTaskId());
-        String start = HttpUtils.sendGet(CameraUtil.endRecording(baseCameraManagement.getCameraCode(), baseCameraManagement.getChannel()));
-        log.info("endRecording------------" + start);
-        if ("success".equals(start)) {
-            baseCameraManagement.setStartRecording(2);
-            baseCameraManagement.setTaskId("");
-            baseCameraManagement.setUpdateBy(getUserId());
-        } else {
-            baseCameraManagement.setStartRecording(2);
-            baseCameraManagement.setTaskId("");
-            baseCameraManagement.setUpdateBy(getUserId());
-            log.error("关闭视频录制异常日志如下:" + start);
-        }
-        if (baseCameraManagementService.updateById(baseCameraManagement)) {
-            return success();
+        List<SysDictData> data = dictTypeService.selectDictDataByType("management_transcribe_switch");
+        if (data.get(0).getDictValue().equals("true")) {
+            BaseCameraManagement baseCameraManagement = baseCameraManagementService.getById(id);
+            if (ObjectUtils.isEmpty(baseCameraManagement)) {
+                return error("查不到该ID的相机台账数据!!!");
+            }
+            log.info("endRecording------------" + baseCameraManagement.getTaskId());
+            String start = HttpUtils.sendGet(CameraUtil.endRecording(baseCameraManagement.getCameraCode(), baseCameraManagement.getChannel()));
+            log.info("endRecording------------" + start);
+            if ("success".equals(start)) {
+                baseCameraManagement.setStartRecording(2);
+                baseCameraManagement.setTaskId("");
+                baseCameraManagement.setUpdateBy(getUserId());
+            } else {
+                baseCameraManagement.setStartRecording(2);
+                baseCameraManagement.setTaskId("");
+                baseCameraManagement.setUpdateBy(getUserId());
+                log.error("关闭视频录制异常日志如下:" + start);
+            }
+            if (baseCameraManagementService.updateById(baseCameraManagement)) {
+                return success();
+            }
+            return error();
+        }else {
+            return error("已自动开启录制,关闭按钮已失效");
         }
-        return error();
     }
 
 
-    @ApiOperation("开启视频录制")
     @GetMapping("/startRecording/{id}")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult startRecording(@PathVariable Long id) throws Exception {
-        BaseCameraManagement baseCameraManagement = baseCameraManagementService.getById(id);
-        log.info("startRecording------CameraCode------" + baseCameraManagement.getCameraCode());
-        log.info("startRecording------Channel------" + baseCameraManagement.getChannel());
-        String start = HttpClientUtil.gets(CameraUtil.startRecording(baseCameraManagement.getCameraCode(), baseCameraManagement.getChannel()));
-        log.info("startRecording------------" + start);
-        if (start.startsWith(baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel())) {
-            log.info("startRecording 返回成功!!1");
-            baseCameraManagement.setStartRecording(1);
-            baseCameraManagement.setTaskId(start);
-            baseCameraManagement.setUpdateBy(getUserId());
-        } else if (start.startsWith("recorder")) {
-            baseCameraManagement.setStartRecording(1);
-            baseCameraManagement.setTaskId(baseCameraManagement.getCameraCode()+"/"+baseCameraManagement.getChannel()+"/flv");
-            baseCameraManagementService.updateById(baseCameraManagement);
-        } else if (start.startsWith("Stream")) {
-            return error("开启视频录制失败:流不存在");
-        }
-        if (baseCameraManagementService.updateById(baseCameraManagement)) {
-            return success();
-        } else {
-            return error("开启视频录制失败");
+        List<SysDictData> data = dictTypeService.selectDictDataByType("management_transcribe_switch");
+        if (data.get(0).getDictValue().equals("true")) {
+            BaseCameraManagement baseCameraManagement = baseCameraManagementService.getById(id);
+            log.info("startRecording------CameraCode------" + baseCameraManagement.getCameraCode());
+            log.info("startRecording------Channel------" + baseCameraManagement.getChannel());
+            String start = HttpClientUtil.gets(CameraUtil.startRecording(baseCameraManagement.getCameraCode(), baseCameraManagement.getChannel()));
+            log.info("startRecording------------" + start);
+            if (start.startsWith(baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel())) {
+                log.info("startRecording 返回成功!!1");
+                baseCameraManagement.setStartRecording(1);
+                baseCameraManagement.setTaskId(start);
+                baseCameraManagement.setUpdateBy(getUserId());
+            } else if (start.startsWith("recorder")) {
+                baseCameraManagement.setStartRecording(1);
+                baseCameraManagement.setTaskId(baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel() + "/flv");
+                baseCameraManagementService.updateById(baseCameraManagement);
+            } else if (start.startsWith("Stream")) {
+                return error("开启视频录制失败:流不存在");
+            }
+            if (baseCameraManagementService.updateById(baseCameraManagement)) {
+                return success();
+            } else {
+                return error("开启视频录制失败");
+            }
+        }else {
+            return error("已自动开启录制,无需按钮再次开启录制");
         }
     }
 
     @GetMapping(value = "/getAlarm/{cameraCode}")
-    @ApiOperation("根据视频ID获取详细信息")
     @Log(title = "相机台账管理", businessType = BusinessType.MESSAGE)
     public AjaxResult getAlarm(@PathVariable String cameraCode) {
         LambdaQueryWrapper<BaseCameraManagement> queryWrapper = new LambdaQueryWrapper<BaseCameraManagement>();
@@ -839,16 +893,24 @@ public class BaseCameraManagementController extends BaseController {
             BeanUtils.copyProperties(baseCameraManagement, msgAlarmResp);
             msgAlarmResp.setRailwayName(baseRailwayManagement.getRailwayName());
             msgAlarmResp.setDeptId(baseCameraManagement.getDeptId());
-            String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
-            String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
-            String endMile = "[" + begin + "]-[" + end + "]";
-            msgAlarmResp.setBeginMile(endMile);
+            if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMile())&&!ObjectUtils.isEmpty(baseCameraManagement.getBeginMile())) {
+                String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
+                String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
+                String endMile =   begin + "~" + end ;
+                msgAlarmResp.setBeginMile(endMile);
+            }
             String mile = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
             msgAlarmResp.setAlarmMile(mile);
-            msgAlarmResp.setInstallLongitude(baseCameraManagement.getInstallLongitude() + "," + baseCameraManagement.getInstallLatitude());
+            if (!ObjectUtils.isEmpty(baseCameraManagement.getInstallLongitude())&&!ObjectUtils.isEmpty(baseCameraManagement.getInstallLatitude())) {
+                msgAlarmResp.setInstallLongitude(baseCameraManagement.getInstallLongitude() + "," + baseCameraManagement.getInstallLatitude());
+            }else {
+                msgAlarmResp.setInstallLongitude(null);
+            }
             msgAlarmResp.setLineDir(baseCameraManagement.getLineDir());
             SysDept sysDept = deptService.selectDeptById(baseCameraManagement.getDeptId());
             msgAlarmResp.setDeptName(sysDept.getDeptName());
+            msgAlarmResp.setCardNum(baseCameraManagement.getCardNum());
+            msgAlarmResp.setCameraSn(baseCameraManagement.getCameraSn());
             return AjaxResult.success(msgAlarmResp);
         } else {
             return error("该相机编码在相机台账表中不存在");
@@ -856,7 +918,6 @@ public class BaseCameraManagementController extends BaseController {
     }
 
 
-    @ApiOperation("播放回放-new")
     @PostMapping("/api/record")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult record(@Validated @RequestBody BaseCameraResVo vo) {
@@ -869,7 +930,6 @@ public class BaseCameraManagementController extends BaseController {
         return new AjaxResult(200, "ok", CameraUtil.getRecordList(one.getChannel(), vo.getStartTime(), vo.getEntTime()));
     }
 
-    @ApiOperation("查询回放视频根据报警ID")
     @GetMapping("/api/getRecordByAlarmId")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult getRecordByAlarmId(@RequestParam("alarmId") String alarmId) {

+ 1 - 7
hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseCameraVersionController.java

@@ -17,7 +17,6 @@ import com.ozs.service.service.BaseCameraManagementService;
 import com.ozs.service.service.BaseCameraVersionService;
 import com.ozs.service.service.BaseVersionCameraParamService;
 import com.ozs.system.service.ISysDictDataService;
-import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.ObjectUtils;
@@ -52,7 +51,6 @@ public class BaseCameraVersionController extends BaseController {
      * @param baseCameraVersion
      * @return
      */
-    @ApiOperation(value = "相机版本管理 版本升级")
     @PostMapping("/cameraVersionUpgrade")
     @Log(title = "相机版本管理", businessType = BusinessType.INSERT)
     public AjaxResult cameraVersionUpgrade(@RequestBody BaseCameraVersionVo baseCameraVersion) {
@@ -71,7 +69,6 @@ public class BaseCameraVersionController extends BaseController {
      * @param baseCameraManagement
      * @return
      */
-    @ApiOperation(value = "相机列表")
     @PostMapping("/cameraAllList")
     @Log(title = "相机版本管理", businessType = BusinessType.SELECT)
     public AjaxResult cameraAllList(@RequestBody BaseCameraManagement baseCameraManagement) {
@@ -88,7 +85,6 @@ public class BaseCameraVersionController extends BaseController {
      * @param baseCameraVersionVo
      * @return
      */
-    @ApiOperation(value = "相机版本管理 分页查询")
     @PostMapping("/cameraVersionList")
     @Log(title = "相机版本管理", businessType = BusinessType.SELECT)
     public AjaxResult cameraVersionList(@RequestBody BaseCameraVersionVo baseCameraVersionVo) {
@@ -126,7 +122,6 @@ public class BaseCameraVersionController extends BaseController {
      * @param baseCameraVersion
      * @return
      */
-    @ApiOperation(value = "相机版本管理 新增")
     @PostMapping("/cameraVersionAdd")
     @Log(title = "相机版本管理", businessType = BusinessType.INSERT)
     public AjaxResult cameraVersionAdd(@RequestBody BaseCameraVersion baseCameraVersion) {
@@ -144,8 +139,7 @@ public class BaseCameraVersionController extends BaseController {
      * @param ids
      * @return
      */
-    @ApiOperation(value = "相机版本管理 删除")
-    @DeleteMapping("/cameraVersionDelete/{ids}")
+    @RequestMapping("/cameraVersionDelete/{ids}")
     @Log(title = "相机版本管理", businessType = BusinessType.DELETE)
     public AjaxResult cameraVersionDelete(@PathVariable List<Long> ids) {
         if (StringUtils.isEmptySunhh(ids)) {

+ 40 - 15
hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseRailwayManagementController.java

@@ -11,6 +11,7 @@ import com.ozs.common.core.domain.entity.SysDept;
 import com.ozs.common.core.domain.entity.SysDictData;
 import com.ozs.common.enums.BusinessType;
 import com.ozs.common.utils.AppendUtils;
+import com.ozs.common.utils.ChineseToPingyin;
 import com.ozs.common.utils.IdempotenceUtils;
 import com.ozs.common.utils.StringUtils;
 import com.ozs.common.utils.file.FileUtils;
@@ -22,16 +23,13 @@ import com.ozs.service.service.BaseCameraManagementService;
 import com.ozs.service.service.BaseRailwayManagementService;
 import com.ozs.system.service.ISysDictDataService;
 import com.ozs.system.service.ISysDictTypeService;
-import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
 import org.springframework.util.ObjectUtils;
-import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -40,6 +38,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import java.io.InputStream;
+import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -71,7 +70,6 @@ public class BaseRailwayManagementController extends BaseController {
      * @param baseRailwayManagementVo
      * @return
      */
-    @ApiOperation(value = "线路管理表分页")
     @PostMapping("/list")
     @Log(title = "线路台账管理", businessType = BusinessType.SELECT)
     public AjaxResult selectBaseLineManagement(@RequestBody BaseRailwayManagementVo baseRailwayManagementVo) {
@@ -104,8 +102,7 @@ public class BaseRailwayManagementController extends BaseController {
      * @param lineIds
      * @return
      */
-    @DeleteMapping("/{lineIds}")
-    @ApiOperation("删除线路管理表信息")
+    @RequestMapping("/remove/{lineIds}")
     @Log(title = "线路台账管理", businessType = BusinessType.DELETE)
     public AjaxResult removeLineManagement(@PathVariable List<Long> lineIds) {
         for (Long lineId : lineIds) {
@@ -133,7 +130,6 @@ public class BaseRailwayManagementController extends BaseController {
      * @return
      */
     @PostMapping("/saveRailwayManagement")
-    @ApiOperation("新增线路管理表信息")
     @Log(title = "线路台账管理", businessType = BusinessType.INSERT)
     public AjaxResult saveLineManagement(@RequestBody BaseRailwayManagement baseRailwayManagement) {
         try {
@@ -180,8 +176,7 @@ public class BaseRailwayManagementController extends BaseController {
      * @param baseRailwayManagement
      * @return
      */
-    @PutMapping("/editRailwayManagement")
-    @ApiOperation("修改线路管理表信息")
+    @RequestMapping("/editRailwayManagement")
     @Log(title = "线路台账管理", businessType = BusinessType.UPDATE)
     public AjaxResult editLineManagement(@RequestBody BaseRailwayManagement baseRailwayManagement) {
         BaseRailwayManagement baseRailwayManagement1 = baseRailwayManagementService.getById(baseRailwayManagement.getId());
@@ -220,7 +215,6 @@ public class BaseRailwayManagementController extends BaseController {
     }
 
     @GetMapping(value = "/{id}")
-    @ApiOperation("根据台账ID获取线路管理表详细信息")
     @Log(title = "线路台账管理", businessType = BusinessType.MESSAGE)
     public AjaxResult getInfo(@PathVariable Long id) {
         BaseRailwayManagement baseRailwayManagement = baseRailwayManagementService.getById(id);
@@ -241,7 +235,6 @@ public class BaseRailwayManagementController extends BaseController {
      * @return
      * @throws Exception
      */
-    @ApiOperation("线路管理表信息导入")
     @PostMapping("/importBaseLineManagement")
     @Log(title = "线路台账管理", businessType = BusinessType.IMPORT)
     public AjaxResult importBaseLineManagement(MultipartFile file, boolean updateSupport) throws Exception {
@@ -259,7 +252,6 @@ public class BaseRailwayManagementController extends BaseController {
      *
      * @param response
      */
-    @ApiOperation("导出线路管理表信息")
     @PostMapping("/exportBaseLineManagement")
     @Log(title = "线路台账管理", businessType = BusinessType.EXPORT)
     public void exportBaseLineManagement(HttpServletResponse response, @RequestBody BaseRailwayManagementVo baseRailwayManagementVo) {
@@ -270,12 +262,14 @@ public class BaseRailwayManagementController extends BaseController {
         if (!ObjectUtils.isEmpty(baseRailwayManagementVo.getRailwayType())) {
             lw.eq(BaseRailwayManagement::getRailwayType, baseRailwayManagementVo.getRailwayType());
         }
+        if (baseRailwayManagementVo.getIds().size()>0){
+            lw.in(BaseRailwayManagement::getId,baseRailwayManagementVo.getIds());
+        }
         List<BaseRailwayManagement> list = baseRailwayManagementService.list(lw);
         ExcelUtil<BaseRailwayManagement> util = new ExcelUtil<>(BaseRailwayManagement.class);
         util.exportExcel(response, list, "线路台账数据");
     }
 
-    @ApiOperation("线路管理表信息模板下载")
     @GetMapping("/downloaExcel")
     @Log(title = "线路台账管理", businessType = BusinessType.OTHER)
     public void downloadZip(HttpServletResponse response) {
@@ -292,11 +286,42 @@ public class BaseRailwayManagementController extends BaseController {
     /**
      * 线路下拉
      */
-    @ApiOperation(value = "线路下拉")
     @GetMapping("/query")
     @Log(title = "线路台账管理", businessType = BusinessType.SELECT)
     public AjaxResult query() {
-        return AjaxResult.success(baseRailwayManagementService.list());
+        // List<BaseRailwayManagement> list = baseRailwayManagementService.list();
+        List<BaseRailwayManagement> list = baseRailwayManagementService.listRailway();
+        list.sort(new Comparator<BaseRailwayManagement>() {
+            @Override
+            public int compare(BaseRailwayManagement o1, BaseRailwayManagement o2) {
+                String name1 = ChineseToPingyin.convertHanziToPinyin(o1.getRailwayName());
+                String substring1 = name1.substring(0, 1);
+                String name2 = ChineseToPingyin.convertHanziToPinyin(o2.getRailwayName());
+                String substring2 = name2.substring(0, 1);
+                return substring1.compareTo(substring2);
+            }
+        });
+        return AjaxResult.success(list);
+    }
+
+    /**
+     * 相机线路下拉
+     */
+    @GetMapping("/pullDown")
+    @Log(title = "线路台账管理", businessType = BusinessType.SELECT)
+    public AjaxResult pullDown() {
+         List<BaseRailwayManagement> list = baseRailwayManagementService.list();
+        list.sort(new Comparator<BaseRailwayManagement>() {
+            @Override
+            public int compare(BaseRailwayManagement o1, BaseRailwayManagement o2) {
+                String name1 = ChineseToPingyin.convertHanziToPinyin(o1.getRailwayName());
+                String substring1 = name1.substring(0, 1);
+                String name2 = ChineseToPingyin.convertHanziToPinyin(o2.getRailwayName());
+                String substring2 = name2.substring(0, 1);
+                return substring1.compareTo(substring2);
+            }
+        });
+        return AjaxResult.success(list);
     }
 
 

+ 124 - 86
hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/MsgAlarmController.java

@@ -26,9 +26,6 @@ import com.ozs.system.service.ISysDeptService;
 import com.ozs.system.service.ISysDictDataService;
 import com.ozs.system.service.ISysDictTypeService;
 import com.ozs.web.core.util.CameraUtil;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
 
 import org.apache.poi.hssf.usermodel.HSSFCell;
 import org.apache.poi.hssf.usermodel.HSSFRow;
@@ -48,9 +45,7 @@ import org.springframework.util.ObjectUtils;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestHeader;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
@@ -105,7 +100,6 @@ public class MsgAlarmController extends BaseController {
      * web更多消息-总数,已读数
      */
     @PostMapping("/messageMoreNum")
-    @ApiOperation("更多消息--总数,已读数")
     @Log(title = "报警信息管理", businessType = BusinessType.SELECT)
     public AjaxResult messageMoreNum(@RequestBody MsgAlarmVo msgAlarmVo) {
         // MsgAlarmVo msgAlarmVo1 = (MsgAlarmVo) dataScoreUtil.setDataScore(getUserId(), msgAlarmVo);
@@ -117,7 +111,6 @@ public class MsgAlarmController extends BaseController {
      * web更多消息
      */
     @PostMapping("/messageMore")
-    @ApiOperation("更多消息")
     @Log(title = "报警信息管理", businessType = BusinessType.SELECT)
     public AjaxResult messageMore(@RequestBody MsgAlarmVo msgAlarmVo) {
         // MsgAlarmVo msgAlarmVo1 = (MsgAlarmVo) dataScoreUtil.setDataScore(getUserId(), msgAlarmVo);
@@ -133,7 +126,6 @@ public class MsgAlarmController extends BaseController {
      * web报警未读消息个数+未读消息列表
      */
     @GetMapping("/webAlarm")
-    @ApiOperation("app报警推送次数")
     @Log(title = "报警信息管理", businessType = BusinessType.SELECT)
     public AjaxResult webAlarmNum() {
         // MsgAlarmVo msgAlarm = (MsgAlarmVo) dataScoreUtil.setDataScore(getUserId(), new MsgAlarmVo());
@@ -145,7 +137,6 @@ public class MsgAlarmController extends BaseController {
      * web消息全部已读
      */
     @PostMapping("/readAll")
-    @ApiOperation(value = "web消息全部已读")
     @Log(title = "报警信息管理", businessType = BusinessType.SELECT)
     public AjaxResult readAll() {
         return toAjax(msgWebPushService.readAll(getUserId()));
@@ -155,7 +146,6 @@ public class MsgAlarmController extends BaseController {
      * web消息已读
      */
     @PostMapping("/read")
-    @ApiOperation(value = "web消息已读")
     @Log(title = "报警信息管理", businessType = BusinessType.SELECT)
     public AjaxResult read(@RequestBody MsgWebPush msgWebPush) {
 //        if (StringUtils.isEmpty(msgWebPush) || ObjectUtils.isEmpty(msgWebPush.getPushId())) {
@@ -164,13 +154,86 @@ public class MsgAlarmController extends BaseController {
         return toAjax(msgWebPushService.read(msgWebPush));
     }
 
+    /**
+     * 首页报警信息列表
+     * 首页左侧报警默认为全部,先按照未解除、已解除排序,然后再按照时间倒序排序
+     *
+     * @param msgAlarmVo
+     * @return
+     */
+    @PostMapping("/listHome")
+    @Log(title = "首页", businessType = BusinessType.SELECT)
+    public AjaxResult selectMsgAlarmHome(@RequestBody MsgAlarmVo msgAlarmVo) {
+        msgAlarmVo = (MsgAlarmVo) dataScoreUtil.setDataScore(getUserId(), msgAlarmVo);
+        if (!ObjectUtils.isEmpty(msgAlarmVo.getAlarmMile())) {
+            msgAlarmVo.setAlarmMile(msgAlarmVo.getAlarmMile() * 1000);
+        }
+        if (!ObjectUtils.isEmpty(msgAlarmVo.getBeginMile())) {
+            msgAlarmVo.setBeginMile(msgAlarmVo.getBeginMile() * 1000);
+        }
+        if (!ObjectUtils.isEmpty(msgAlarmVo.getEndMile())) {
+            msgAlarmVo.setEndMile(msgAlarmVo.getEndMile() * 1000);
+        }
+        IPage<MsgAlarm> page = msgAlarmService.queryPageHome(msgAlarmVo);
+        page.setTotal(page.getTotal());
+        page.setCurrent(page.getCurrent());
+        page.setPages(page.getPages());
+        if (!ObjectUtils.isEmpty(page) && page.getRecords().size() > 0) {
+            List<MsgAlarm> dto1 = page.getRecords().stream().map(o -> {
+                String[] split = o.getImageUrl().split(";");
+                ArrayList<String> objects = new ArrayList<>(Arrays.asList(split));
+                o.setImageUrls(objects);
+                LambdaQueryWrapper<BaseCameraManagement> cameraManagementLambdaQueryWrapper = new LambdaQueryWrapper<BaseCameraManagement>();
+                if (!ObjectUtils.isEmpty(o.getCameraCode())) {
+                    cameraManagementLambdaQueryWrapper.eq(BaseCameraManagement::getCameraCode, o.getCameraCode());
+                }
+                BaseCameraManagement cameraManagement = baseCameraManagementService.getOne(cameraManagementLambdaQueryWrapper);
+                LambdaQueryWrapper<BaseRailwayManagement> queryWrapper = new LambdaQueryWrapper<BaseRailwayManagement>();
+                if (!ObjectUtils.isEmpty(cameraManagement.getRailwayCode())) {
+                    queryWrapper.eq(BaseRailwayManagement::getRailwayCode, cameraManagement.getRailwayCode());
+                }
+                BaseRailwayManagement baseRailwayManagement = baseRailwayManagementService.getOne(queryWrapper);
+                o.setRailwayName(baseRailwayManagement.getRailwayName());
+                if (StringUtils.isNotEmpty(o.getReleasedBy())) {
+                    BaseUser user = baseUserService.getUser(o.getReleasedBy());
+                    o.setReleasedByName(user.getNickName());
+                }
+                String mils = AppendUtils.stringAppend(cameraManagement.getInstallMile());
+                o.setAlarmMiles(mils);
+                if (!ObjectUtils.isEmpty(cameraManagement.getEndMile())) {
+                    String end = AppendUtils.stringAppend(cameraManagement.getEndMile());
+                    o.setEndMile(end);
+                }
+                if (!ObjectUtils.isEmpty(cameraManagement.getBeginMile())) {
+                    String begin = AppendUtils.stringAppend(cameraManagement.getBeginMile());
+                    o.setBeginMile(begin);
+                }
+                LambdaQueryWrapper<MsgAlarmFrequency> wrapper = new LambdaQueryWrapper<MsgAlarmFrequency>();
+                if (!ObjectUtils.isEmpty(o.getAlarmId())) {
+                    wrapper.eq(MsgAlarmFrequency::getAlarmId, o.getAlarmId());
+                }
+                o.setAlarmCount((int) msgAlarmFrequencyService.count(wrapper));
+                if (!ObjectUtils.isEmpty(o.getReleasedType())) {
+                    o.setReleasedTypeName(o.getReleasedType() == 1 ? "实报" : "误报");
+                }
+                String[] split1 = o.getAlarmAttr().split(",");
+                String stringBuilder = "画面,大小为" + split1[0] + "×" + split1[1] + "," +
+                        "泥石流范围为左上角坐标(" + split1[2] + "," + split1[3] + ")" +
+                        "大小" + split1[4] + "×" + split1[5];
+                o.setAlarmAttr(stringBuilder);
+                return o;
+            }).collect(Collectors.toList());
+            page.setRecords(dto1);
+        }
+        return AjaxResult.success(page);
+    }
+
     /**
      * 报警信息分页
      *
      * @param msgAlarmVo
      * @return
      */
-    @ApiOperation(value = "报警信息分页")
     @PostMapping("/list")
     @Log(title = "报警信息管理", businessType = BusinessType.SELECT)
     public AjaxResult selectMsgAlarm(@RequestBody MsgAlarmVo msgAlarmVo) {
@@ -211,10 +274,14 @@ public class MsgAlarmController extends BaseController {
                 }
                 String mils = AppendUtils.stringAppend(cameraManagement.getInstallMile());
                 o.setAlarmMiles(mils);
-                String end = AppendUtils.stringAppend(cameraManagement.getEndMile());
-                o.setEndMile(end);
-                String begin = AppendUtils.stringAppend(cameraManagement.getBeginMile());
-                o.setBeginMile(begin);
+                if (!ObjectUtils.isEmpty(cameraManagement.getEndMile())) {
+                    String end = AppendUtils.stringAppend(cameraManagement.getEndMile());
+                    o.setEndMile(end);
+                }
+                if (!ObjectUtils.isEmpty(cameraManagement.getBeginMile())) {
+                    String begin = AppendUtils.stringAppend(cameraManagement.getBeginMile());
+                    o.setBeginMile(begin);
+                }
                 LambdaQueryWrapper<MsgAlarmFrequency> wrapper = new LambdaQueryWrapper<MsgAlarmFrequency>();
                 if (!ObjectUtils.isEmpty(o.getAlarmId())) {
                     wrapper.eq(MsgAlarmFrequency::getAlarmId, o.getAlarmId());
@@ -240,7 +307,6 @@ public class MsgAlarmController extends BaseController {
      *
      * @param response
      */
-    @ApiOperation("导出报警消息")
     @PostMapping("/exportMsgAlarm")
     @Log(title = "报警信息管理", businessType = BusinessType.EXPORT)
     public void exportMsgAlarm(HttpServletResponse response, @RequestBody MsgAlarmVo msgAlarmVo) {
@@ -276,10 +342,14 @@ public class MsgAlarmController extends BaseController {
             }
             String mils = AppendUtils.stringAppend(cameraManagement.getInstallMile());
             msgAlarm.setAlarmMiles(mils);
-            String end = AppendUtils.stringAppend(cameraManagement.getEndMile());
-            msgAlarm.setEndMile(end);
-            String begin = AppendUtils.stringAppend(cameraManagement.getBeginMile());
-            msgAlarm.setBeginMile(begin);
+            if (!ObjectUtils.isEmpty(cameraManagement.getEndMile())) {
+                String end = AppendUtils.stringAppend(cameraManagement.getEndMile());
+                msgAlarm.setEndMile(end);
+            }
+            if (!ObjectUtils.isEmpty(cameraManagement.getBeginMile())) {
+                String begin = AppendUtils.stringAppend(cameraManagement.getBeginMile());
+                msgAlarm.setBeginMile(begin);
+            }
             LambdaQueryWrapper<MsgAlarmFrequency> wrapper = new LambdaQueryWrapper<MsgAlarmFrequency>();
             if (!ObjectUtils.isEmpty(msgAlarm.getAlarmId())) {
                 wrapper.eq(MsgAlarmFrequency::getAlarmId, msgAlarm.getAlarmId());
@@ -306,7 +376,6 @@ public class MsgAlarmController extends BaseController {
     }
 
     @GetMapping(value = "/getByAlarmId/{alarmId}")
-    @ApiOperation("根据报警信息ID获取详细信息-app")
     @Log(title = "报警信息管理", businessType = BusinessType.MESSAGE)
     public AjaxResult getByAlarmId(@PathVariable String alarmId) {
         MsgAlarm msgAlarm = msgAlarmService.getByAlarmId(alarmId);
@@ -332,10 +401,12 @@ public class MsgAlarmController extends BaseController {
             BeanUtils.copyProperties(msgAlarm, msgAlarmResp);
             msgAlarmResp.setRailwayName(baseRailwayManagement.getRailwayName());
             msgAlarmResp.setDeptId(baseCameraManagement.getDeptId());
-            String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
-            String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
-            String endMile = begin + "-" + end;
-            msgAlarmResp.setBeginMile(endMile);
+            if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMile())&&!ObjectUtils.isEmpty(baseCameraManagement.getBeginMile())) {
+                String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
+                String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
+                String endMile = begin + "-" + end;
+                msgAlarmResp.setBeginMile(endMile);
+            }
             String mile = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
             msgAlarmResp.setAlarmMile(mile);
             if (!ObjectUtils.isEmpty(msgAlarm.getReleasedType())) {
@@ -349,7 +420,6 @@ public class MsgAlarmController extends BaseController {
     }
 
     @GetMapping(value = "/{id}")
-    @ApiOperation("根据报警信息ID获取详细信息")
     @Log(title = "报警信息管理", businessType = BusinessType.MESSAGE)
     public AjaxResult getInfo(@PathVariable Long id) {
         MsgAlarm msgAlarm = msgAlarmService.getById(id);
@@ -378,10 +448,12 @@ public class MsgAlarmController extends BaseController {
             BeanUtils.copyProperties(msgAlarm, msgAlarmResp);
             msgAlarmResp.setRailwayName(baseRailwayManagement.getRailwayName());
             msgAlarmResp.setDeptId(baseCameraManagement.getDeptId());
-            String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
-            String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
-            String endMile = "[" + begin + "]-[" + end + "]";
-            msgAlarmResp.setBeginMile(endMile);
+            if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMile())&&!ObjectUtils.isEmpty(baseCameraManagement.getBeginMile())) {
+                String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
+                String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
+                String endMile = "[" + begin + "]-[" + end + "]";
+                msgAlarmResp.setBeginMile(endMile);
+            }
             String mile = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
             msgAlarmResp.setAlarmMile(mile);
             msgAlarmResp.setInstallLongitude(baseCameraManagement.getInstallLongitude() + "," + baseCameraManagement.getInstallLatitude());
@@ -392,6 +464,8 @@ public class MsgAlarmController extends BaseController {
                     "泥石流范围为左上角坐标(" + split1[2] + "," + split1[3] + ")" +
                     "大小" + split1[4] + "×" + split1[5];
             msgAlarmResp.setAlarmAttrName(stringBuilder);
+            msgAlarmResp.setCardNum(baseCameraManagement.getCardNum());
+            msgAlarmResp.setCameraSn(baseCameraManagement.getCameraSn());
             return AjaxResult.success(msgAlarmResp);
         } else {
             return success("无报警信息数据");
@@ -399,8 +473,7 @@ public class MsgAlarmController extends BaseController {
     }
 
     // todo  需要测试 验证 是否合成视频
-    @PutMapping(value = "/updateIsLock")
-    @ApiOperation("根据报警信息ID解除报警")
+    @RequestMapping(value = "/updateIsLock")
     @Log(title = "报警信息管理", businessType = BusinessType.UPDATE)
     @Transactional
     public AjaxResult updateIsLock(@RequestParam(value = "id") Long id,
@@ -424,17 +497,17 @@ public class MsgAlarmController extends BaseController {
         LambdaQueryWrapper<BaseCameraManagement> base = new LambdaQueryWrapper<>();
         base.eq(BaseCameraManagement::getCameraCode, msgAlarm.getCameraCode());
         BaseCameraManagement baseCameraManagement = baseCameraManagementService.getOne(base);
-        String url = null;
-        try {
-            url = CameraUtil.historyPlayListStr(baseCameraManagement.getChannel(),
-                    msgAlarm.getAlarmTime(),
-                    msgAlarm.getReleasedTime(),
-                    true);
-        } catch (Exception exception) {
-            log.error(exception.getMessage());
-        }
-        log.info("updateIsLock-------url" + url);
-        msgAlarm.setReleasedUrl(url);
+//        String url = null;
+//        try {
+//            url = CameraUtil.historyPlayListStr(baseCameraManagement.getChannel(),
+//                    msgAlarm.getAlarmTime(),
+//                    msgAlarm.getReleasedTime(),
+//                    true);
+//        } catch (Exception exception) {
+//            log.error(exception.getMessage());
+//        }
+//        log.info("updateIsLock-------url" + url);
+//        msgAlarm.setReleasedUrl(url);
         log.info("updateIsLock----------msgAlarm" + msgAlarm);
         boolean b = msgAlarmService.updateById(msgAlarm);
 //        LambdaQueryWrapper<MsgAppPush> wrapper = new LambdaQueryWrapper<>();
@@ -456,7 +529,6 @@ public class MsgAlarmController extends BaseController {
     }
 
     @GetMapping(value = "/alarmHistoricalAlarm/{alarmId}")
-    @ApiOperation("报警消息详情历史报警次数信息")
     @Log(title = "报警信息管理", businessType = BusinessType.SELECT)
     public AjaxResult alarmHistoricalAlarm(@PathVariable String alarmId) {
         QueryWrapper<MsgAlarm> queryWrapper = new QueryWrapper<>();
@@ -490,25 +562,19 @@ public class MsgAlarmController extends BaseController {
     }
 
     @GetMapping(value = "/videoHistoricalAlarm/{cameraCode}")
-    @ApiOperation("视频服务历史报警信息")
     @Log(title = "报警信息管理", businessType = BusinessType.SELECT)
     public AjaxResult videoHistoricalAlarm(@PathVariable String cameraCode) {
         QueryWrapper<MsgAlarm> wrapper = new QueryWrapper<>();
         wrapper.eq("camera_code", cameraCode);
         wrapper.orderByDesc("alarm_time");
         List<MsgAlarm> list = msgAlarmService.list(wrapper);
-        if (list.size() > 0) {
-            for (MsgAlarm msgAlarm : list) {
-                msgAlarm.setFailureToAlarm(1);
-            }
-            return AjaxResult.success(list);
-        } else {
-            List<MsgAlarm> msgAlarmList = new ArrayList<>();
-            MsgAlarm msgAlarm = new MsgAlarm();
-            msgAlarm.setFailureToAlarm(2);
-            msgAlarmList.add(msgAlarm);
-            return AjaxResult.success(msgAlarmList);
-        }
+//        if (list.size() > 0) {
+//            for (MsgAlarm msgAlarm : list) {
+//                msgAlarm.setFailureToAlarm(1);
+//            }
+//            return AjaxResult.success(list);
+//        } 
+        return AjaxResult.success(list);
     }
 
     /**
@@ -519,13 +585,6 @@ public class MsgAlarmController extends BaseController {
      */
     @Log(title = "报警信息管理", businessType = BusinessType.OTHER)
     @PostMapping("/dataStatistic")
-    @ApiOperation(value = "web数据统计 报警数据详情")
-    @ApiImplicitParams(value = {
-            @ApiImplicitParam(paramType = "query", name = "railwayCode", value = "线路编码"),
-            @ApiImplicitParam(paramType = "query", name = "currentYear", value = "当前年份"),
-            @ApiImplicitParam(paramType = "query", name = "currentMonth", value = "当前月份"),
-            @ApiImplicitParam(paramType = "query", name = "alarmType", value = "灾害类型"),
-    })
     public AjaxResult dataStatistic(@RequestBody AlarmStatisticResVo alarmStatisticResVo) {
         alarmStatisticResVo = (AlarmStatisticResVo) dataScoreUtil.setDataScore(getUserId(), alarmStatisticResVo);
         IPage<AlarmStatisticVo> page = msgAlarmService.list(alarmStatisticResVo);
@@ -562,7 +621,7 @@ public class MsgAlarmController extends BaseController {
                 }
                 return o;
             }).collect(Collectors.toList());
-            page.setRecords(dto1);
+                        page.setRecords(dto1);
         }
         return AjaxResult.success(page);
     }
@@ -575,13 +634,6 @@ public class MsgAlarmController extends BaseController {
      */
     @Log(title = "报警信息管理", businessType = BusinessType.OTHER)
     @PostMapping("/alarmMonthStatistic")
-    @ApiOperation(value = "web数据统计 报警月统计数据")
-    @ApiImplicitParams(value = {
-            @ApiImplicitParam(paramType = "query", name = "railwayCode", value = "线路编码"),
-            @ApiImplicitParam(paramType = "query", name = "currentYear", value = "当前年份"),
-            @ApiImplicitParam(paramType = "query", name = "currentMonth", value = "当前月份"),
-            @ApiImplicitParam(paramType = "query", name = "alarmType", value = "灾害类型"),
-    })
     public AjaxResult alarmMonthStatistic(@RequestBody AlarmStatisticResVo alarmStatisticResVo) {
         alarmStatisticResVo = (AlarmStatisticResVo) dataScoreUtil.setDataScore(getUserId(), alarmStatisticResVo);
         List<Integer> numbs = new ArrayList<>();
@@ -641,13 +693,6 @@ public class MsgAlarmController extends BaseController {
      */
     @Log(title = "报警信息管理", businessType = BusinessType.EXPORT)
     @PostMapping("/exportDataStatistic")
-    @ApiOperation(value = "web数据统计-数据导出")
-    @ApiImplicitParams(value = {
-            @ApiImplicitParam(paramType = "query", name = "railwayCode", value = "线路编码"),
-            @ApiImplicitParam(paramType = "query", name = "currentYear", value = "当前年份"),
-            @ApiImplicitParam(paramType = "query", name = "currentMonth", value = "当前月份"),
-            @ApiImplicitParam(paramType = "query", name = "alarmType", value = "灾害类型"),
-    })
     public void exportDataStatistic(HttpServletResponse response, @RequestBody AlarmStatisticResVo alarmStatisticResVo) {
         alarmStatisticResVo = (AlarmStatisticResVo) dataScoreUtil.setDataScore(getUserId(), alarmStatisticResVo);
         try {
@@ -703,13 +748,6 @@ public class MsgAlarmController extends BaseController {
      */
     @Log(title = "报警信息管理", businessType = BusinessType.EXPORT)
     @PostMapping("/exportDataStatisticMonth")
-    @ApiOperation(value = "报警月统计数据导出")
-    @ApiImplicitParams(value = {
-            @ApiImplicitParam(paramType = "query", name = "railwayCode", value = "线路编码"),
-            @ApiImplicitParam(paramType = "query", name = "currentYear", value = "当前年份"),
-            @ApiImplicitParam(paramType = "query", name = "currentMonth", value = "当前月份"),
-            @ApiImplicitParam(paramType = "query", name = "alarmType", value = "灾害类型"),
-    })
     public void exportDataStatisticMonth(HttpServletResponse response, @RequestBody AlarmStatisticResVo alarmStatisticResVo) {
         alarmStatisticResVo = (AlarmStatisticResVo) dataScoreUtil.setDataScore(getUserId(), alarmStatisticResVo);
         String sheetName = "报警年统计数据";

+ 0 - 7
hazard-admin/src/main/java/com/ozs/web/controller/app/GeoHazardMineController.java

@@ -23,9 +23,6 @@ import com.ozs.service.entity.vo.MsgAlarmVo;
 import com.ozs.service.entity.vo.MsgAppPushVo;
 import com.ozs.service.service.MsgAppPushService;
 import com.ozs.system.service.ISysUserService;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -68,7 +65,6 @@ public class GeoHazardMineController extends BaseController {
      * 修改头像
      */
     @PostMapping("/updateAvatar")
-    @ApiOperation("app修改头像")
     public AjaxResult updateAvatar(@RequestParam("image") MultipartFile image, @RequestParam("userId") String userId) {
         if (image.isEmpty()) {
             return AjaxResult.error("不能上传空文件哦");
@@ -102,7 +98,6 @@ public class GeoHazardMineController extends BaseController {
      * 修改密码
      */
     @RequestMapping(value = "/updatePassword", method = RequestMethod.POST)
-    @ApiOperation("app修改密码")
     public AjaxResult updatePassword(@RequestBody SysUser user) {
 //        sysUserService.updatePassword(userId, newPwd);
 //        return AjaxResult.success();
@@ -135,7 +130,6 @@ public class GeoHazardMineController extends BaseController {
      * app推送报警信息记录分页显示(全部信息)
      */
     @RequestMapping(value = "/list", method = RequestMethod.POST)
-    @ApiOperation("app推送报警信息记录分页显示(全部信息)")
     public AjaxResult list(@RequestBody MsgAlarmVo msgAlarmVo) {
         String userId = getUserId();
         if (!StringUtils.isEmpty(userId)) {
@@ -149,7 +143,6 @@ public class GeoHazardMineController extends BaseController {
      * app推送报警信息记录修改状态
      */
     @RequestMapping(value = "/update", method = RequestMethod.POST)
-    @ApiOperation("app推送报警信息记录修改状态")
     public AjaxResult update(@RequestBody MsgAppPush msgAppPush) {
         msgAppPush.setUpdateBy(getUsername());
         msgAppPushService.updates(msgAppPush);

+ 0 - 3
hazard-admin/src/main/java/com/ozs/web/controller/app/JPushAppController.java

@@ -10,7 +10,6 @@ import com.ozs.service.service.MsgAlarmService;
 import com.ozs.service.service.MsgAppPushService;
 import com.ozs.service.service.UserRegistrationidService;
 import com.ozs.system.service.DataScoreUtil;
-import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -35,7 +34,6 @@ public class JPushAppController extends BaseController {
      * app报警推送次数
      */
     @GetMapping("/appAlarmNum")
-    @ApiOperation("app报警推送次数")
     public AjaxResult appAlarmNum() {
         MsgAlarmVo msgAlarmVo = (MsgAlarmVo) dataScoreUtil.setDataScore(getUserId(), new MsgAlarmVo());
         Integer appAlarmNum = msgAlarmService.appAlarmNum(msgAlarmVo);
@@ -46,7 +44,6 @@ public class JPushAppController extends BaseController {
      * 存储RegistrationID
      */
     @PostMapping("/addRegistrationID")
-    @ApiOperation("存储RegistrationID")
     public AjaxResult addRegistrationID(@RequestBody UserRegistrationid userRegistrationid) {
         if (StringUtils.isEmpty(userRegistrationid)
                 || StringUtils.isEmpty(userRegistrationid.getUserId())

+ 0 - 2
hazard-admin/src/main/java/com/ozs/web/controller/home/HomeController.java

@@ -11,7 +11,6 @@ import com.ozs.service.entity.vo.MsgAlarmVo;
 import com.ozs.service.service.BaseCameraManagementService;
 import com.ozs.service.service.MsgAlarmService;
 import com.ozs.system.service.DataScoreUtil;
-import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.ObjectUtils;
 import org.springframework.web.bind.annotation.*;
@@ -37,7 +36,6 @@ public class HomeController extends BaseController {
     /**
      * 统计数量
      */
-    @ApiOperation(value = "统计数量")
     @GetMapping("/statisticsNum")
     public AjaxResult statisticsNum() {
         MsgAlarmVo msgAlarmVo = (MsgAlarmVo) dataScoreUtil.setDataScore(getUserId(), new MsgAlarmVo());

+ 3 - 4
hazard-admin/src/main/java/com/ozs/web/controller/monitor/CacheController.java

@@ -11,7 +11,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisCallback;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -93,7 +92,7 @@ public class CacheController
     }
 
     @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
-    @DeleteMapping("/clearCacheName/{cacheName}")
+    @RequestMapping("/clearCacheName/{cacheName}")
     public AjaxResult clearCacheName(@PathVariable String cacheName)
     {
         Collection<String> cacheKeys = redisTemplate.keys(cacheName + "*");
@@ -102,7 +101,7 @@ public class CacheController
     }
 
     @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
-    @DeleteMapping("/clearCacheKey/{cacheKey}")
+    @GetMapping("/clearCacheKey/{cacheKey}")
     public AjaxResult clearCacheKey(@PathVariable String cacheKey)
     {
         redisTemplate.delete(cacheKey);
@@ -110,7 +109,7 @@ public class CacheController
     }
 
     @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
-    @DeleteMapping("/clearCacheAll")
+    @GetMapping("/clearCacheAll")
     public AjaxResult clearCacheAll()
     {
         Collection<String> cacheKeys = redisTemplate.keys("*");

+ 23 - 14
hazard-admin/src/main/java/com/ozs/web/controller/monitor/CameraUpdateLogController.java

@@ -8,23 +8,22 @@ import com.ozs.common.core.controller.BaseController;
 import com.ozs.common.core.domain.AjaxResult;
 import com.ozs.common.enums.BusinessType;
 import com.ozs.common.utils.poi.ExcelUtil;
+import com.ozs.service.entity.BaseCameraManagement;
 import com.ozs.service.entity.BaseUser;
 import com.ozs.service.entity.CameraLogDetail;
 import com.ozs.service.entity.CameraUpdateLog;
+import com.ozs.service.entity.vo.CameraUpdateLogResVo;
 import com.ozs.service.entity.vo.CameraUpdateLogResp;
+import com.ozs.service.service.BaseCameraManagementService;
 import com.ozs.service.service.BaseUserService;
 import com.ozs.service.service.CameraLogDetailService;
 import com.ozs.service.service.CameraUpdateLogService;
 import com.ozs.system.service.ISysDictDataService;
-import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.ObjectUtils;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
@@ -45,6 +44,8 @@ public class CameraUpdateLogController extends BaseController {
     private CameraUpdateLogService cameraUpdateLogService;
     @Autowired
     private CameraLogDetailService cameraLogDetailService;
+    @Resource
+    BaseCameraManagementService baseCameraManagementService;
     @Autowired
     private ISysDictDataService dictDataService;
     @Resource
@@ -56,7 +57,6 @@ public class CameraUpdateLogController extends BaseController {
      * @param cameraUpdateLogResp
      * @return
      */
-    @ApiOperation(value = "获取相机升级日志分页列表")
     @PostMapping("/list")
     public AjaxResult list(@RequestBody CameraUpdateLogResp cameraUpdateLogResp) throws ParseException {
         LambdaQueryWrapper<CameraUpdateLog> wrapper = new LambdaQueryWrapper<CameraUpdateLog>();
@@ -85,20 +85,29 @@ public class CameraUpdateLogController extends BaseController {
         return AjaxResult.success(page);
     }
 
-    @ApiOperation(value = "获取相机升级日志详细")
-    @PostMapping("/detail")
-    public AjaxResult detail(@RequestBody CameraUpdateLogResp cameraUpdateLogResp) {
-        Integer pageNum = cameraUpdateLogResp.getPageNum().intValue();
-        Integer pageSize = cameraUpdateLogResp.getPageSize().intValue();
-        List<CameraLogDetail> list = cameraLogDetailService.selectDetail((cameraUpdateLogResp));
+    @PostMapping("/detail/{pageNum}/{pageSize}")
+    public AjaxResult detail(@RequestBody CameraUpdateLogResVo cameraUpdateLogResVo,@PathVariable Integer pageNum,@PathVariable Integer pageSize) {
+        List<CameraLogDetail> list = cameraLogDetailService.selectDetail((cameraUpdateLogResVo));
+        list.forEach(li -> {
+            LambdaQueryWrapper<BaseCameraManagement> wrapper = new LambdaQueryWrapper<BaseCameraManagement>();
+            wrapper.eq(!ObjectUtils.isEmpty(li.getCameraCode()),BaseCameraManagement::getCameraCode,li.getCameraCode());
+            BaseCameraManagement baseCameraManagement = baseCameraManagementService.getOne(wrapper);
+            li.setLastVersionNum(baseCameraManagement.getLastVersionNum());
+        });
         IPage<CameraLogDetail> page = cameraLogDetailService.listToPage(list, pageNum, pageSize);
         return AjaxResult.success(page);
     }
 
     @Log(title = "相机升级日志", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, @RequestBody CameraUpdateLogResp cameraUpdateLogResp) {
-        List<CameraLogDetail> list = cameraLogDetailService.selectDetail(cameraUpdateLogResp);
+    public void export(HttpServletResponse response, @RequestBody CameraUpdateLogResVo cameraUpdateLogResVo) {
+        List<CameraLogDetail> list = cameraLogDetailService.selectDetail(cameraUpdateLogResVo);
+        list.forEach(li -> {
+            LambdaQueryWrapper<BaseCameraManagement> wrapper = new LambdaQueryWrapper<BaseCameraManagement>();
+            wrapper.eq(!ObjectUtils.isEmpty(li.getCameraCode()),BaseCameraManagement::getCameraCode,li.getCameraCode());
+            BaseCameraManagement baseCameraManagement = baseCameraManagementService.getOne(wrapper);
+            li.setLastVersionNum(baseCameraManagement.getLastVersionNum());
+        });
         ExcelUtil<CameraLogDetail> util = new ExcelUtil<CameraLogDetail>(CameraLogDetail.class);
         util.exportExcel(response, list, "相机升级日志详情");
     }

+ 2 - 5
hazard-admin/src/main/java/com/ozs/web/controller/monitor/SysLoginInfoController.java

@@ -12,7 +12,6 @@ import com.github.pagehelper.PageHelper;
 import com.ozs.common.core.domain.vo.SysLoginInfoResq;
 import com.ozs.common.core.domain.vo.SysLoginInfoVo;
 import com.ozs.common.utils.StringUtils;
-import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.util.ObjectUtils;
@@ -55,7 +54,6 @@ public class SysLoginInfoController extends BaseController {
      * @param sysLoginInfoVo
      * @return
      */
-    @ApiOperation(value = "获取登录日志分页列表")
     @PostMapping("/list")
     @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
     public AjaxResult list(@RequestBody SysLoginInfoVo sysLoginInfoVo) throws ParseException {
@@ -81,7 +79,6 @@ public class SysLoginInfoController extends BaseController {
         return AjaxResult.success(page);
     }
 
-    @ApiOperation(value = "获取登录日志详细")
     @PreAuthorize("@ss.hasPermi('monitor:logininfor:detail')")
     @PostMapping("/detail")
     public AjaxResult remove(Long infoId) {
@@ -100,7 +97,7 @@ public class SysLoginInfoController extends BaseController {
 
     @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
     @Log(title = "登录日志", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{infoIds}")
+    @PostMapping("/{infoIds}")
     public AjaxResult remove(@PathVariable Long[] infoIds)
     {
         return toAjax(logininforService.deleteLogininforByIds(infoIds));
@@ -108,7 +105,7 @@ public class SysLoginInfoController extends BaseController {
 
     @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')")
     @Log(title = "登录日志", businessType = BusinessType.CLEAN)
-    @DeleteMapping("/clean")
+    @PostMapping("/clean")
     public AjaxResult clean()
     {
         logininforService.cleanLogininfor();

+ 2 - 5
hazard-admin/src/main/java/com/ozs/web/controller/monitor/SysOperlogController.java

@@ -12,7 +12,6 @@ import com.ozs.common.core.domain.vo.SysOperlogVo;
 import com.ozs.common.utils.DateUtils;
 import com.ozs.common.utils.StringUtils;
 import com.ozs.system.domain.SysLoginInfo;
-import io.swagger.annotations.ApiOperation;
 import org.apache.poi.ss.usermodel.DateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -54,7 +53,6 @@ public class SysOperlogController extends BaseController {
      * @return
      */
     @PreAuthorize("@ss.hasPermi('monitor:operlog:list')")
-    @ApiOperation(value = "获取操作日志分页列表")
     @PostMapping("/list")
     public AjaxResult list(@RequestBody SysOperlogVo sysOperlogVo) {
         LambdaQueryWrapper<SysOperLog> wrapper = new LambdaQueryWrapper<SysOperLog>();
@@ -81,7 +79,6 @@ public class SysOperlogController extends BaseController {
         return AjaxResult.success(page);
     }
 
-    @ApiOperation(value = "获取操作日志详细")
     @PostMapping("/detail")
     @PreAuthorize("@ss.hasPermi('monitor:operlog:detail')")
     public AjaxResult detail(Long operId) {
@@ -100,7 +97,7 @@ public class SysOperlogController extends BaseController {
 
     @Log(title = "操作日志", businessType = BusinessType.DELETE)
     @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
-    @DeleteMapping("/{operIds}")
+    @PostMapping("/{operIds}")
     public AjaxResult remove(@PathVariable Long[] operIds)
     {
         return toAjax(operLogService.deleteOperLogByIds(operIds));
@@ -108,7 +105,7 @@ public class SysOperlogController extends BaseController {
 
     @Log(title = "操作日志", businessType = BusinessType.CLEAN)
     @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
-    @DeleteMapping("/clean")
+    @GetMapping("/clean")
     public AjaxResult clean()
     {
         operLogService.cleanOperLog();

+ 1 - 2
hazard-admin/src/main/java/com/ozs/web/controller/monitor/SysUserOnlineController.java

@@ -6,7 +6,6 @@ import java.util.Collections;
 import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -83,7 +82,7 @@ public class SysUserOnlineController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')")
     @Log(title = "在线用户", businessType = BusinessType.FORCE)
-    @DeleteMapping("/{tokenId}")
+    @GetMapping("/{tokenId}")
     public AjaxResult forceLogout(@PathVariable String tokenId)
     {
         redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId);

+ 3 - 10
hazard-admin/src/main/java/com/ozs/web/controller/mqtt/MqttController.java

@@ -1,14 +1,7 @@
 package com.ozs.web.controller.mqtt;
 
-import com.ozs.common.annotation.Log;
-import com.ozs.common.core.domain.AjaxResult;
-import com.ozs.common.enums.BusinessType;
-import com.ozs.service.utils.PublishClient;
-import com.ozs.service.utils.SubscribeClient;
 import com.ozs.web.core.util.CameraUtil;
-import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
-import org.eclipse.paho.client.mqttv3.MqttException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.ApplicationArguments;
 import org.springframework.boot.ApplicationRunner;
@@ -28,10 +21,10 @@ public class MqttController implements ApplicationRunner {
 
     @Override
     public void run(ApplicationArguments args) throws Exception {
-        new SubscribeClient("heart", "heart").start();
+//        SubscribeClient.start("heart");
     }
-    
-    
+
+
     @GetMapping("/cs")
     public void cs(){
         cameraUtil.cameraBlockUp();

+ 3 - 5
hazard-admin/src/main/java/com/ozs/web/controller/system/SysConfigController.java

@@ -5,11 +5,9 @@ import javax.servlet.http.HttpServletResponse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -97,7 +95,7 @@ public class SysConfigController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:config:edit')")
     @Log(title = "参数管理", businessType = BusinessType.UPDATE)
-    @PutMapping
+    @RequestMapping
     public AjaxResult edit(@Validated @RequestBody SysConfig config)
     {
         if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
@@ -113,7 +111,7 @@ public class SysConfigController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:config:remove')")
     @Log(title = "参数管理", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{configIds}")
+    @PostMapping("/{configIds}")
     public AjaxResult remove(@PathVariable Long[] configIds)
     {
         configService.deleteConfigByIds(configIds);
@@ -125,7 +123,7 @@ public class SysConfigController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:config:remove')")
     @Log(title = "参数管理", businessType = BusinessType.CLEAN)
-    @DeleteMapping("/refreshCache")
+    @GetMapping("/refreshCache")
     public AjaxResult refreshCache()
     {
         configService.resetConfigCache();

+ 14 - 11
hazard-admin/src/main/java/com/ozs/web/controller/system/SysDeptController.java

@@ -6,17 +6,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.ozs.common.core.domain.entity.SysRole;
 import com.ozs.common.core.domain.vo.SysDeptVo;
 import com.ozs.common.utils.poi.ExcelUtil;
-import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -74,7 +71,6 @@ public class SysDeptController extends BaseController {
      * 获取部门树列表
      */
     @GetMapping("/deptTree")
-    @ApiOperation("获取部门树列表")
     public AjaxResult deptTree(SysDeptVo dept) {
         return success(deptService.selectDeptTreeList(dept));
     }
@@ -130,7 +126,7 @@ public class SysDeptController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:dept:edit')")
     @Log(title = "部门管理", businessType = BusinessType.UPDATE)
-    @PutMapping
+    @RequestMapping("/edit")
     public AjaxResult edit(@Validated @RequestBody SysDept dept) {
         Long deptId = dept.getDeptId();
         //deptService.checkDeptDataScope(deptId);
@@ -148,7 +144,7 @@ public class SysDeptController extends BaseController {
         }
         SysDept sysDept = deptService.getOne(wq);
         if (ObjectUtils.isNotEmpty(sysDept)) {
-            return error("新增部门'" + dept.getDeptCode() + "'失败,部门编码已存在");
+            return error("修改部门'" + dept.getDeptCode() + "'失败,部门编码已存在");
         }
         dept.setUpdateBy(getUserId());
         return toAjax(deptService.updateDept(dept));
@@ -159,7 +155,7 @@ public class SysDeptController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:dept:remove')")
     @Log(title = "部门管理", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{deptId}")
+    @RequestMapping("/remove/{deptId}")
     public AjaxResult remove(@PathVariable Long deptId) {
         if (deptService.hasChildByDeptId(deptId)) {
             return warn("存在下级部门,不允许删除");
@@ -174,11 +170,18 @@ public class SysDeptController extends BaseController {
     @Log(title = "部门导出", businessType = BusinessType.EXPORT)
     @PreAuthorize("@ss.hasPermi('system:role:export')")
     @PostMapping("/export")
-    @ApiOperation("部门导出")
-    public void export(HttpServletResponse response, SysDept dept) {
-        List<SysDept> list = forDeptList(dept);
+    public void export(HttpServletResponse response, @RequestBody SysDept dept) {
+        List<SysDept> depts = deptService.selectDeptListAll(dept);
+        if (!ObjectUtils.isEmpty(depts)) {
+            for (SysDept sysDept : depts) {
+                SysDept current = deptService.selectDeptById(sysDept.getParentId());
+                if (!ObjectUtils.isEmpty(current)) {
+                    sysDept.setParentName(current.getDeptName());
+                }
+            }
+        }
         ExcelUtil<SysDept> util = new ExcelUtil<SysDept>(SysDept.class);
-        util.exportExcel(response, list, "部门数据");
+        util.exportExcel(response, depts, "部门数据");
     }
 
     /**

+ 2 - 7
hazard-admin/src/main/java/com/ozs/web/controller/system/SysDictDataController.java

@@ -9,16 +9,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ozs.common.core.domain.vo.SysDictDataVo;
 import com.ozs.common.utils.DictUtils;
-import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.util.ObjectUtils;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -62,9 +59,7 @@ public class SysDictDataController extends BaseController {
      * @param sysDictDataVo
      * @return
      */
-    @ApiOperation(value = "获取字典类型列表")
     @PostMapping("/list")
-    @PreAuthorize("@ss.hasPermi('system:dict:list')")
     public AjaxResult list(@RequestBody SysDictDataVo sysDictDataVo) {
         LambdaQueryWrapper<SysDictData> wrapper = new LambdaQueryWrapper<SysDictData>();
         if (!ObjectUtils.isEmpty(sysDictDataVo.getDictCode())) {
@@ -149,7 +144,7 @@ public class SysDictDataController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:dict:edit')")
     @Log(title = "字典数据", businessType = BusinessType.UPDATE)
-    @PutMapping
+    @RequestMapping("/edit")
     public AjaxResult edit(@Validated @RequestBody SysDictData dict)
     {
         dict.setUpdateBy(getUsername());
@@ -164,7 +159,7 @@ public class SysDictDataController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:dict:remove')")
     @Log(title = "字典类型", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{dictCodes}")
+    @RequestMapping("remove/{dictCodes}")
     public AjaxResult remove(@PathVariable Long[] dictCodes)
     {
         dictDataService.deleteDictDataByIds(dictCodes);

+ 3 - 7
hazard-admin/src/main/java/com/ozs/web/controller/system/SysDictTypeController.java

@@ -12,16 +12,13 @@ import com.ozs.common.core.domain.entity.SysRole;
 import com.ozs.common.core.domain.entity.SysUser;
 import com.ozs.common.core.domain.vo.SysDictTypeVo;
 import com.ozs.common.core.domain.vo.SysUserVo;
-import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.util.ObjectUtils;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -61,7 +58,6 @@ public class SysDictTypeController extends BaseController {
      * @param sysDictTypeVo
      * @return
      */
-    @ApiOperation(value = "获取字典类型列表")
     @PostMapping("/list")
     @PreAuthorize("@ss.hasPermi('system:dict:list')")
     public AjaxResult list(@RequestBody SysDictTypeVo sysDictTypeVo) {
@@ -127,7 +123,7 @@ public class SysDictTypeController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:dict:edit')")
     @Log(title = "字典类型", businessType = BusinessType.UPDATE)
-    @PutMapping
+    @RequestMapping("/update")
     public AjaxResult edit(@Validated @RequestBody SysDictType dict)
     {
         if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) {
@@ -145,7 +141,7 @@ public class SysDictTypeController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:dict:remove')")
     @Log(title = "字典类型", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{dictIds}")
+    @RequestMapping("/remove/{dictIds}")
     public AjaxResult remove(@PathVariable Long[] dictIds)
     {
         dictTypeService.deleteDictTypeByIds(dictIds);
@@ -157,7 +153,7 @@ public class SysDictTypeController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:dict:remove')")
     @Log(title = "字典类型", businessType = BusinessType.CLEAN)
-    @DeleteMapping("/refreshCache")
+    @GetMapping("/refreshCache")
     public AjaxResult refreshCache()
     {
         dictTypeService.resetDictCache();

+ 2 - 1
hazard-admin/src/main/java/com/ozs/web/controller/system/SysLoginController.java

@@ -83,8 +83,9 @@ public class SysLoginController extends BaseController {
     @PostMapping("/loginApp")
     public AjaxResult loginApp(@RequestBody LoginBody loginBody) {
         AjaxResult ajax = AjaxResult.success();
+        String decrypt = SymmetryTest.decrypt(loginBody.getPassword(), "1234567890abcdef");
         // 生成令牌
-        String token = loginService.loginApp(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
+        String token = loginService.loginApp(loginBody.getUsername(), decrypt, loginBody.getCode(),
                 loginBody.getUuid());
         ajax.put(Constants.TOKEN, token);
         LoginUser loginedUser = tokenService.getLoginedUserByTokenApp(token);

+ 4 - 12
hazard-admin/src/main/java/com/ozs/web/controller/system/SysMenuController.java

@@ -5,15 +5,12 @@ import java.util.List;
 import com.ozs.common.core.domain.entity.SysDept;
 import com.ozs.common.core.domain.model.LoginUser;
 import com.ozs.common.utils.poi.ExcelUtil;
-import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -96,8 +93,6 @@ public class SysMenuController extends BaseController {
     public AjaxResult add(@Validated @RequestBody SysMenu menu) {
         if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) {
             return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
-        } else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) {
-            return error("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
         }
         menu.setCreateBy(getUsername());
         return toAjax(menuService.insertMenu(menu));
@@ -108,13 +103,11 @@ public class SysMenuController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:menu:edit')")
     @Log(title = "菜单管理", businessType = BusinessType.UPDATE)
-    @PutMapping
+    @RequestMapping("/edit")
     public AjaxResult edit(@Validated @RequestBody SysMenu menu) {
         if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) {
             return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
-        } else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) {
-            return error("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
-        } else if (menu.getMenuId().equals(menu.getParentId())) {
+        }else if (menu.getMenuId().equals(menu.getParentId())) {
             return error("修改菜单'" + menu.getMenuName() + "'失败,上级菜单不能选择自己");
         }
         menu.setUpdateBy(getUsername());
@@ -126,7 +119,7 @@ public class SysMenuController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:menu:remove')")
     @Log(title = "菜单管理", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{menuId}")
+    @RequestMapping("/remove/{menuId}")
     public AjaxResult remove(@PathVariable("menuId") Long menuId) {
         if (menuService.hasChildByMenuId(menuId)) {
             return warn("存在子菜单,不允许删除");
@@ -140,8 +133,7 @@ public class SysMenuController extends BaseController {
     @Log(title = "菜单导出", businessType = BusinessType.EXPORT)
     @PreAuthorize("@ss.hasPermi('system:menu:export')")
     @PostMapping("/export")
-    @ApiOperation("菜单导出")
-    public void export(HttpServletResponse response, SysMenu menu) {
+    public void export(HttpServletResponse response, @RequestBody SysMenu menu) {
         LoginUser loginUser = getLoginUser();
         List<SysMenu> list = menuService.selectMenuList(menu, loginUser.getId());
         for (SysMenu menuA : list) {

+ 2 - 4
hazard-admin/src/main/java/com/ozs/web/controller/system/SysNoticeController.java

@@ -4,11 +4,9 @@ import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -71,7 +69,7 @@ public class SysNoticeController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:notice:edit')")
     @Log(title = "通知公告", businessType = BusinessType.UPDATE)
-    @PutMapping
+    @RequestMapping("/edit")
     public AjaxResult edit(@Validated @RequestBody SysNotice notice)
     {
         notice.setUpdateBy(getUsername());
@@ -83,7 +81,7 @@ public class SysNoticeController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:notice:remove')")
     @Log(title = "通知公告", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{noticeIds}")
+    @RequestMapping("/{noticeIds}")
     public AjaxResult remove(@PathVariable Long[] noticeIds)
     {
         return toAjax(noticeService.deleteNoticeByIds(noticeIds));

+ 2 - 4
hazard-admin/src/main/java/com/ozs/web/controller/system/SysPostController.java

@@ -5,11 +5,9 @@ import javax.servlet.http.HttpServletResponse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -92,7 +90,7 @@ public class SysPostController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:post:edit')")
     @Log(title = "岗位管理", businessType = BusinessType.UPDATE)
-    @PutMapping
+    @RequestMapping("/edit")
     public AjaxResult edit(@Validated @RequestBody SysPost post)
     {
         if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
@@ -112,7 +110,7 @@ public class SysPostController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:post:remove')")
     @Log(title = "岗位管理", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{postIds}")
+    @RequestMapping("/remove/{postIds}")
     public AjaxResult remove(@PathVariable Long[] postIds)
     {
         return toAjax(postService.deletePostByIds(postIds));

+ 2 - 3
hazard-admin/src/main/java/com/ozs/web/controller/system/SysProfileController.java

@@ -3,7 +3,6 @@ package com.ozs.web.controller.system;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -57,7 +56,7 @@ public class SysProfileController extends BaseController
      * 修改用户
      */
     @Log(title = "个人信息", businessType = BusinessType.UPDATE)
-    @PutMapping
+    @RequestMapping("/update")
     public AjaxResult updateProfile(@RequestBody SysUser user)
     {
         LoginUser loginUser = getLoginUser();
@@ -92,7 +91,7 @@ public class SysProfileController extends BaseController
      * 重置密码
      */
     @Log(title = "个人信息", businessType = BusinessType.UPDATE)
-    @PutMapping("/updatePwd")
+    @RequestMapping("/updatePwd")
     public AjaxResult updatePwd(String oldPassword, String newPassword)
     {
         LoginUser loginUser = getLoginUser();

+ 14 - 12
hazard-admin/src/main/java/com/ozs/web/controller/system/SysRoleController.java

@@ -16,22 +16,20 @@ import com.ozs.common.core.domain.entity.SysMenu;
 import com.ozs.common.core.domain.vo.SysDeptVo;
 import com.ozs.common.core.domain.vo.SysRoleRequestVo;
 import com.ozs.common.core.domain.vo.SysUserVo;
+import com.ozs.common.exception.ServiceException;
 import com.ozs.service.entity.BaseRailwayManagement;
 import com.ozs.service.entity.BaseUser;
 import com.ozs.service.service.BaseUserService;
 import com.ozs.system.domain.SysRoleMenu;
 import com.ozs.system.service.DataScoreUtil;
 import com.ozs.system.service.ISysMenuService;
-import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.util.ObjectUtils;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -94,7 +92,6 @@ public class SysRoleController extends BaseController {
 
     @PreAuthorize("@ss.hasPermi('system:role:list')")
     @PostMapping("/list")
-    @ApiOperation("根据条件分页查询角色数据")
     @Log(title = "角色管理", businessType = BusinessType.SELECT)
     public AjaxResult page(@NotEmpty(message = "数据为空")
                            @RequestBody SysRoleRequestVo vo) {
@@ -164,7 +161,7 @@ public class SysRoleController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @Log(title = "角色管理", businessType = BusinessType.UPDATE)
-    @PutMapping
+    @RequestMapping("/edit")
     public AjaxResult edit(@Validated @RequestBody SysRole role) {
 //        roleService.checkRoleAllowed(role);
 //        roleService.checkRoleDataScope(role.getRoleId());
@@ -178,6 +175,11 @@ public class SysRoleController extends BaseController {
             }
             return error("超级管理员角色不能修改");
         } else {
+            if ("2".equals(role.getStatus())) {
+                if (roleService.countUserRoleByRoleId(role.getRoleId()) > 0) {
+                    throw new ServiceException(String.format("%1$s已分配,不能禁用", role.getRoleName()));
+                }
+            }
             if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) {
                 return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
             }
@@ -205,7 +207,7 @@ public class SysRoleController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @Log(title = "角色管理", businessType = BusinessType.UPDATE)
-    @PutMapping("/dataScope")
+    @RequestMapping("/dataScope")
     public AjaxResult dataScope(@RequestBody SysRole role) {
         roleService.checkRoleAllowed(role);
         roleService.checkRoleDataScope(role.getRoleId());
@@ -217,7 +219,7 @@ public class SysRoleController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @Log(title = "角色管理", businessType = BusinessType.UPDATE)
-    @PutMapping("/changeStatus")
+    @RequestMapping("/changeStatus")
     public AjaxResult changeStatus(@RequestBody SysRole role) {
         roleService.checkRoleAllowed(role);
         roleService.checkRoleDataScope(role.getRoleId());
@@ -230,7 +232,7 @@ public class SysRoleController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:role:remove')")
     @Log(title = "角色管理", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{roleIds}")
+    @RequestMapping("/remove/{roleIds}")
     public AjaxResult remove(@PathVariable Long[] roleIds) {
         return toAjax(roleService.deleteRoleByIds(roleIds));
     }
@@ -274,7 +276,7 @@ public class SysRoleController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @Log(title = "角色管理", businessType = BusinessType.GRANT)
-    @PutMapping("/authUser/cancel")
+    @RequestMapping("/authUser/cancel")
     public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole) {
         return toAjax(roleService.deleteAuthUser(userRole));
     }
@@ -284,8 +286,8 @@ public class SysRoleController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @Log(title = "角色管理", businessType = BusinessType.GRANT)
-    @PutMapping("/authUser/cancelAll")
-    public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds) {
+    @RequestMapping("/authUser/cancelAll")
+    public AjaxResult cancelAuthUserAll(Long roleId,@RequestBody Long[] userIds) {
         return toAjax(roleService.deleteAuthUsers(roleId, userIds));
     }
 
@@ -294,7 +296,7 @@ public class SysRoleController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @Log(title = "角色管理", businessType = BusinessType.GRANT)
-    @PutMapping("/authUser/selectAll")
+    @RequestMapping("/authUser/selectAll")
     public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds) {
         roleService.checkRoleDataScope(roleId);
         return toAjax(roleService.insertAuthUsers(roleId, userIds));

+ 7 - 11
hazard-admin/src/main/java/com/ozs/web/controller/system/SysUserController.java

@@ -33,7 +33,6 @@ import com.ozs.system.domain.SysUserRole;
 import com.ozs.system.mapper.SysUserRoleMapper;
 import com.ozs.system.service.DataScoreUtil;
 import com.ozs.system.service.ISysDictTypeService;
-import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ArrayUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -114,7 +113,6 @@ public class SysUserController extends BaseController {
      * @param sysUserVo
      * @return
      */
-    @ApiOperation(value = "获取用户列表")
     @PostMapping("/list")
     @PreAuthorize("@ss.hasPermi('system:user:list')")
     @Log(title = "用户管理", businessType = BusinessType.SELECT)
@@ -151,7 +149,7 @@ public class SysUserController extends BaseController {
     @Log(title = "用户管理", businessType = BusinessType.EXPORT)
     @PreAuthorize("@ss.hasPermi('system:user:export')")
     @PostMapping("/export")
-    public void export(HttpServletResponse response, SysUserVo sysUserVo) {
+    public void export(HttpServletResponse response, @RequestBody SysUserVo sysUserVo) {
         List<Long> longs = new ArrayList<>();
         sysUserVo = (SysUserVo) dataScoreUtil.setDataScore(getUserId(), sysUserVo);
         List<SysUser> usetList = userService.usetList(sysUserVo);
@@ -205,7 +203,6 @@ public class SysUserController extends BaseController {
         util.importTemplateExcel(response, "用户数据");
     }
 
-    @ApiOperation("用户管理信息模板下载")
     @GetMapping("/downloaExcel")
     @Log(title = "用户管理", businessType = BusinessType.OTHER)
     public void downloadZip(HttpServletResponse response) {
@@ -271,8 +268,8 @@ public class SysUserController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
-    @RequestMapping(value = "/edit", method = RequestMethod.PUT)
-    public AjaxResult edit(@Validated @RequestBody SysUser user) {
+    @PostMapping("/edit")
+    public AjaxResult edit(@RequestBody SysUser user) {
 //        userService.checkUserAllowed(user);
 //        userService.checkUserDataScope(user.getId());
         BaseUser baseUser = baseUserService.getUserById(user.getId());
@@ -324,7 +321,7 @@ public class SysUserController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:user:remove')")
     @Log(title = "用户管理", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{Ids}")
+    @RequestMapping("/remove/{Ids}")
     public AjaxResult remove(@PathVariable Long[] Ids) {
         if (ArrayUtils.contains(Ids, getId())) {
             return error("当前用户不能删除");
@@ -394,7 +391,7 @@ public class SysUserController extends BaseController {
      * 修改密码
      */
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
-    @PutMapping("/updatePassWord")
+    @RequestMapping("/updatePassWord")
     public AjaxResult updatePassWord(@RequestBody SysUser user) {
         LoginUser loginUser = getLoginUser();
         if (!SecurityUtils.matchesPassword(user.getPassword(), loginUser.getPassword())) {
@@ -423,7 +420,7 @@ public class SysUserController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
-    @PutMapping("/changeStatus")
+    @RequestMapping("/changeStatus")
     public AjaxResult changeStatus(@RequestBody SysUser user) {
 //        userService.checkUserAllowed(user);
 //        userService.checkUserDataScope(user.getId());
@@ -451,7 +448,7 @@ public class SysUserController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "用户管理", businessType = BusinessType.GRANT)
-    @PutMapping("/authRole")
+    @RequestMapping("/authRole")
     public AjaxResult insertAuthRole(Long userId, Long[] roleIds) {
 //        userService.checkUserDataScope(userId);
         userService.insertUserAuth(userId, roleIds);
@@ -473,7 +470,6 @@ public class SysUserController extends BaseController {
      * 数据权限分配
      */
     @GetMapping("/dataPermission/{id}/{dataPermission}")
-    @ApiOperation("数据权限分配")
     @Log(title = "用户管理", businessType = BusinessType.GRANT)
     public AjaxResult dataPermission(@PathVariable("id") Long id, @PathVariable("dataPermission") Integer dataPermission) {
         BaseUser baseUser = baseUserService.getUserById(id);

+ 14 - 30
hazard-admin/src/main/java/com/ozs/web/controller/tool/TestController.java

@@ -7,30 +7,21 @@ import java.util.Map;
 
 import com.ozs.common.utils.SecurityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import com.ozs.common.core.controller.BaseController;
 import com.ozs.common.core.domain.R;
 import com.ozs.common.utils.StringUtils;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import io.swagger.annotations.ApiOperation;
 
 /**
- * swagger 用户测试方法
+ *  用户测试方法
  *
  * @author ruoyi
  */
-@Api("用户信息管理")
 @RestController
 @RequestMapping("/test")
 public class TestController extends BaseController {
@@ -66,6 +57,16 @@ public class TestController extends BaseController {
         return R.ok();
     }
 
+    @GetMapping("/restart")
+    public R<String> restart() {
+        try {
+            cameraUtil.restart();
+        } catch (Exception e) {
+            return R.ok(e.getMessage().toString());
+        }
+        return R.ok();
+    }
+
     @GetMapping("/cmd")
     public R<String> cmd(String cmd) {
 
@@ -92,15 +93,12 @@ public class TestController extends BaseController {
         return R.ok();
     }
 
-    @ApiOperation("获取用户列表")
     @GetMapping("/list")
     public R<List<UserEntity>> userList() {
         List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
         return R.ok(userList);
     }
 
-    @ApiOperation("获取用户详细")
-    @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
     @GetMapping("/{userId}")
     public R<UserEntity> getUser(@PathVariable Integer userId) {
         if (!users.isEmpty() && users.containsKey(userId)) {
@@ -110,13 +108,7 @@ public class TestController extends BaseController {
         }
     }
 
-    @ApiOperation("新增用户")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "userId", value = "用户id", dataType = "Integer", dataTypeClass = Integer.class),
-            @ApiImplicitParam(name = "username", value = "用户名称", dataType = "String", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "password", value = "用户密码", dataType = "String", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "mobile", value = "用户手机", dataType = "String", dataTypeClass = String.class)
-    })
+    
     @PostMapping("/save")
     public R<String> save(UserEntity user) {
         if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) {
@@ -126,8 +118,7 @@ public class TestController extends BaseController {
         return R.ok();
     }
 
-    @ApiOperation("更新用户")
-    @PutMapping("/update")
+    @RequestMapping("/update")
     public R<String> update(@RequestBody UserEntity user) {
         if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) {
             return R.fail("用户ID不能为空");
@@ -140,9 +131,7 @@ public class TestController extends BaseController {
         return R.ok();
     }
 
-    @ApiOperation("删除用户信息")
-    @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
-    @DeleteMapping("/{userId}")
+    @RequestMapping("/{userId}")
     public R<String> delete(@PathVariable Integer userId) {
         if (!users.isEmpty() && users.containsKey(userId)) {
             users.remove(userId);
@@ -153,18 +142,13 @@ public class TestController extends BaseController {
     }
 }
 
-@ApiModel(value = "UserEntity", description = "用户实体")
 class UserEntity {
-    @ApiModelProperty("用户ID")
     private Integer userId;
 
-    @ApiModelProperty("用户名称")
     private String username;
 
-    @ApiModelProperty("用户密码")
     private String password;
 
-    @ApiModelProperty("用户手机")
     private String mobile;
 
     public UserEntity() {

+ 9 - 5
hazard-admin/src/main/java/com/ozs/web/controller/websocket/WebSocketConteoller.java

@@ -123,6 +123,7 @@ public class WebSocketConteoller extends BaseController {
     @ResponseBody
     @PostMapping("/publish")
     public Map publish(@RequestBody MsgAlarm msgAlarm) {
+        String endMile = null;
         log.info("消息推送:" + msgAlarm.toString());
         LambdaQueryWrapper<BaseCameraManagement> wrapper = new LambdaQueryWrapper<BaseCameraManagement>();
         if (!ObjectUtils.isEmpty(msgAlarm.getCameraCode())) {
@@ -137,15 +138,18 @@ public class WebSocketConteoller extends BaseController {
         String[] list = set.toArray(new String[set.size()]);
         List<String> userIdList = new ArrayList<>(set);
         MsgAlarmResp msgAlarmResp = new MsgAlarmResp();
-        String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
-        String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
-        String endMile = begin + "-" + end;
-        msgAlarmResp.setBeginMile(endMile);
+        if (!ObjectUtils.isEmpty(baseCameraManagement.getEndMile())&&!ObjectUtils.isEmpty(baseCameraManagement.getBeginMile())) {
+            String begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
+            String end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
+            endMile = begin + "-" + end;
+            msgAlarmResp.setBeginMile(endMile);
+        }
         msgAlarmResp.setAlarmType(msgAlarm.getAlarmType());
         String mile = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
         msgAlarmResp.setAlarmMile(mile);
         String cameraCode = baseCameraManagement.getCameraCode();
         msgAlarmResp.setCameraCode(cameraCode);
+        
         String cameraName = baseRailwayManagementService.getCameraNameByCameraCode(cameraCode);
         msgAlarmResp.setRailwayName(cameraName != null ? cameraName : "");
         msgAlarmResp.setLineDirStr(baseCameraManagement.getLineDir() == 1 ? "上行" : "下行");
@@ -169,7 +173,7 @@ public class WebSocketConteoller extends BaseController {
         msgAlarmResp.setAlarmId(alarmId);
 
         LambdaQueryWrapper<MsgWebPush> lwMsgWebPush = new LambdaQueryWrapper<MsgWebPush>();
-        if (!ObjectUtils.isEmpty(msgAlarm.getCameraCode())) {
+        if (!ObjectUtils.isEmpty(msgAlarm.getAlarmId())) {
             lwMsgWebPush.eq(MsgWebPush::getAlarmId, msgAlarm.getAlarmId());
         }
         List<MsgWebPush> msgWebPushList = msgWebPushService.list(lwMsgWebPush);

+ 2 - 1
hazard-admin/src/main/java/com/ozs/web/controller/websocket/WebSocketServer.java

@@ -93,7 +93,8 @@ public class WebSocketServer {
         log.error("用户错误,原因:" + error.getMessage());
         log.error("用户错误,原因:" + error.getLocalizedMessage());
         log.error("用户错误,原因sessionsessionsession:" + session.getId());
-        error.printStackTrace();
+        log.error("用户错误,原因 error: {}", error);
+//        error.printStackTrace();
     }
 
     // 此为广播消息

+ 0 - 125
hazard-admin/src/main/java/com/ozs/web/core/config/SwaggerConfig.java

@@ -1,125 +0,0 @@
-package com.ozs.web.core.config;
-
-import java.util.ArrayList;
-import java.util.List;
-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 com.ozs.common.config.BaseConfig;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.models.auth.In;
-import springfox.documentation.builders.ApiInfoBuilder;
-import springfox.documentation.builders.PathSelectors;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.service.ApiInfo;
-import springfox.documentation.service.ApiKey;
-import springfox.documentation.service.AuthorizationScope;
-import springfox.documentation.service.Contact;
-import springfox.documentation.service.SecurityReference;
-import springfox.documentation.service.SecurityScheme;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spi.service.contexts.SecurityContext;
-import springfox.documentation.spring.web.plugins.Docket;
-
-/**
- * Swagger2的接口配置
- *
- * @author hx
- */
-@Configuration
-public class SwaggerConfig
-{
-    /** 系统基础配置 */
-    @Autowired
-    private BaseConfig ruoyiConfig;
-
-    /** 是否开启swagger */
-    @Value("${swagger.enabled}")
-    private boolean enabled;
-
-    /** 设置请求的统一前缀 */
-    @Value("${swagger.pathMapping}")
-    private String pathMapping;
-
-    /**
-     * 创建API
-     */
-    @Bean
-    public Docket createRestApi()
-    {
-        return new Docket(DocumentationType.OAS_30)
-                // 是否启用Swagger
-                .enable(enabled)
-                // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
-                .apiInfo(apiInfo())
-                // 设置哪些接口暴露给Swagger展示
-                .select()
-                // 扫描所有有注解的api,用这种方式更灵活
-                .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
-                // 扫描指定包中的swagger注解
-                // .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger"))
-                // 扫描所有 .apis(RequestHandlerSelectors.any())
-                .paths(PathSelectors.any())
-                .build()
-                /* 设置安全模式,swagger可以设置访问token */
-                .securitySchemes(securitySchemes())
-                .securityContexts(securityContexts())
-                .pathMapping(pathMapping);
-    }
-
-    /**
-     * 安全模式,这里指定token通过Authorization头请求头传递
-     */
-    private List<SecurityScheme> securitySchemes()
-    {
-        List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>();
-        apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue()));
-        return apiKeyList;
-    }
-
-    /**
-     * 安全上下文
-     */
-    private List<SecurityContext> securityContexts()
-    {
-        List<SecurityContext> securityContexts = new ArrayList<>();
-        securityContexts.add(
-                SecurityContext.builder()
-                        .securityReferences(defaultAuth())
-                        .operationSelector(o -> o.requestMappingPattern().matches("/.*"))
-                        .build());
-        return securityContexts;
-    }
-
-    /**
-     * 默认的安全上引用
-     */
-    private List<SecurityReference> defaultAuth()
-    {
-        AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
-        AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
-        authorizationScopes[0] = authorizationScope;
-        List<SecurityReference> securityReferences = new ArrayList<>();
-        securityReferences.add(new SecurityReference("Authorization", authorizationScopes));
-        return securityReferences;
-    }
-
-    /**
-     * 添加摘要信息
-     */
-    private ApiInfo apiInfo()
-    {
-        // 用ApiInfoBuilder进行定制
-        return new ApiInfoBuilder()
-                // 设置标题
-                .title("标题:若依管理系统_接口文档")
-                // 描述
-                .description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
-                // 作者信息
-                .contact(new Contact(ruoyiConfig.getName(), null, null))
-                // 版本
-                .version("版本号:" + ruoyiConfig.getVersion())
-                .build();
-    }
-}

+ 41 - 0
hazard-admin/src/main/java/com/ozs/web/core/util/CameraUtil.java

@@ -695,6 +695,7 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
         if (StringUtils.isBlank(channel)
                 || ObjectUtils.isEmpty(startTm)
                 || ObjectUtils.isEmpty(endTm)) {
+            log.info("channel-----"+channel+"----startTm"+startTm+"-----endTm"+endTm);
             return null;
         }
         Map<Date, Map<String, Object>> m = new HashMap<>();
@@ -706,9 +707,11 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
         // /api/record/flv/list
         String s = HttpUtils.sendGet(webUrl + "/recordpro/api/list", param);
         // 视频拼接
+        log.info("视频拼接s-----"+s);
         if (!StringUtils.isBlank(s) || "null".equals(s)) {
             List<Map<String, Object>> maps = JSON.parseArray(s, Map.class);
             if (ObjectUtils.isEmpty(maps)) {
+                log.info("maps-----"+maps);
                 return null;
             }
             for (Map<String, Object> map : maps) {
@@ -950,6 +953,44 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
 
     }
 
+
+    /**
+     * 重启流媒体
+     */
+    public void restart() {
+        log.info("restart=============");
+        try {
+            Process proc = Runtime.getRuntime().exec("/bin/bash", null, null);
+            BufferedReader in = new BufferedReader(new InputStreamReader(proc.getInputStream()));
+            PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(proc.getOutputStream())), true);
+            String commit = "sh /opt/streams/restartStreams.sh";
+            List<String> commands = new ArrayList<>();
+
+            // 删除
+            commands.add(commit);
+            for (String line : commands) {
+                out.println(line);
+            }
+            out.println("exit");// 这个命令必须执行,否则in流不结束。
+            String rspLine = "";
+            while ((rspLine = in.readLine()) != null) {
+                System.out.println(rspLine);
+
+            }
+            int i = proc.waitFor();
+            log.info("执行结果:{}", i);
+
+            in.close();
+            out.close();
+            proc.destroy();
+        } catch (IOException e) {
+            log.error(e.getMessage());
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+
+    }
+
     public static void main(String[] args) {
 
 //            // 创建一个集合

+ 1 - 1
hazard-admin/src/main/resources/application-druid.yml

@@ -6,7 +6,7 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://${server-ip}:3306/hazard?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                url: jdbc:mysql://10.161.12.48:3306/hazard?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
                 password: UTA1hcycRtgD0c7Y
             # 从库数据源

+ 27 - 33
hazard-admin/src/main/resources/application.yml

@@ -1,5 +1,5 @@
 # 项目相关配置
-server-ip: 10.161.12.50
+server-ip: 10.161.12.60
 
 base:
   # 名称
@@ -20,11 +20,11 @@ base:
   # 摄像头配置
   ffmpegPath: /usr/local/ffmpeg/bin/ffmpeg
   filePath: /opt/streams/record/flv/
-  webUrl: http://${server-ip}:9080
-  bakUrl: http://${server-ip}:9080
-  wsUrl: ws://183.236.39.220:9080
+  webUrl: http://183.236.39.220:8083
+  bakUrl: http://183.236.39.220:8083
+  wsUrl: ws://183.236.39.220:8083
   defaultPassword: yn5aq5Mt.106.tky
-  imgUrl: http://${server-ip}:18801/picbucket
+  imgUrl: http://10.161.12.52:18801/picbucket
   recordUrl: http://183.236.39.220:8083${server.servlet.context-path}
 # 开发环境配置
 server:
@@ -68,11 +68,11 @@ spring:
     active: druid
   # 文件上传
   servlet:
-     multipart:
-       # 单个文件大小
-       max-file-size:  50MB
-       # 设置总上传的文件大小
-       max-request-size:  100MB
+    multipart:
+      # 单个文件大小
+      max-file-size:  50MB
+      # 设置总上传的文件大小
+      max-request-size:  100MB
   # 服务模块
   devtools:
     restart:
@@ -87,7 +87,7 @@ spring:
     # 数据库索引
     database: 0
     # 密码
-    password: tysfrz123
+    password: +xLHQ73t@q
     # 连接超时时间
     timeout: 100s
     lettuce:
@@ -103,12 +103,12 @@ spring:
 
 # token配置
 token:
-    # 令牌自定义标识
-    header: Authorization
-    # 令牌密钥
-    secret: abcdefghijklmnopqrstuvwxyz
-    # 令牌有效期(默认30分钟)
-    expireTime: 120
+  # 令牌自定义标识
+  header: Authorization
+  # 令牌密钥
+  secret: abcdefghijklmnopqrstuvwxyz
+  # 令牌有效期(默认30分钟)
+  expireTime: 120
 # app:token配置
 apptoken:
   # 令牌自定义标识
@@ -120,12 +120,12 @@ apptoken:
 
 # MyBatis配置
 mybatis:
-    # 搜索指定包别名
-    typeAliasesPackage: com.ozs.**.domain
-    # 配置mapper的扫描,找到所有的mapper.xml映射文件
-    mapperLocations: classpath*:mapper/**/*Mapper.xml
-    # 加载全局的配置文件
-    configLocation: classpath:mybatis/mybatis-config.xml
+  # 搜索指定包别名
+  typeAliasesPackage: com.ozs.**.domain
+  # 配置mapper的扫描,找到所有的mapper.xml映射文件
+  mapperLocations: classpath*:mapper/**/*Mapper.xml
+  # 加载全局的配置文件
+  configLocation: classpath:mybatis/mybatis-config.xml
 
 # MyBatis-plus配置
 mybatis-plus:
@@ -140,12 +140,6 @@ pagehelper:
   supportMethodsArguments: true
   params: count=countSql
 
-# Swagger配置
-swagger:
-  # 是否开启swagger
-  enabled: true
-  # 请求前缀
-  pathMapping: /dev-api
 
 # 防止XSS攻击
 xss:
@@ -156,15 +150,15 @@ xss:
   # 匹配链接
   urlPatterns: /system/*,/monitor/*,/tool/*
 minio:
-  endpoint: http://${server-ip}:18801 #Minio服务所在地址
+  endpoint: http://10.161.12.52:18801 #Minio服务所在地址
   bucketName: picbucket #存储桶名称
   accessKey: admin #访问的key
-  secretKey: admin123 #访问的秘钥
+  secretKey: jt73W-+xhd5 #访问的秘钥
 
 mqtt:
   host: tcp://${server-ip}:1883
-  userName: guest
-  passWord: guest
+  userName: camera-update
+  passWord: 05J5+mtYzx.Ry
 
 shot:
   urlAddress: http://${server-ip}:9080/snap/

BIN
hazard-admin/src/main/resources/template/baseCameraManagement.xlsx


+ 11 - 2
hazard-sdk/src/main/java/com/ozs/controller/upload/GeoHazardMonitorTokenController.java

@@ -3,7 +3,10 @@ package com.ozs.controller.upload;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.ozs.common.annotation.SdkLog;
 import com.ozs.common.core.redis.RedisCache;
+import com.ozs.common.enums.BusinessType;
+import com.ozs.common.enums.BusinessTypeSdk;
 import com.ozs.common.utils.ApiTokenUtils;
 import com.ozs.common.utils.HttpClientUtil;
 import com.ozs.common.utils.StringUtils;
@@ -70,6 +73,7 @@ public class GeoHazardMonitorTokenController {
      * @return
      */
     @PostMapping("/token")
+    @SdkLog(title = "获取web访问令牌", businessType = BusinessTypeSdk.TOKEN)
     public String getWebToken(@RequestBody SvcAddress svcAddress) {
         // 生成令牌
         JSONObject jsonObject = new JSONObject();
@@ -84,8 +88,7 @@ public class GeoHazardMonitorTokenController {
         }
         SvcAddress serviceOne = svcAddressService.getOne(lw);
         if (!ObjectUtils.isEmpty(serviceOne)) {
-            String clientSecret = SM4Utils.decryptData_ECB(serviceOne.getClientSecret(), "4370780c9a8c43e5");
-            if (clientSecret.equals(svcAddress.getClientSecret())) {
+            if (serviceOne.getClientSecret().equals(svcAddress.getClientSecret())) {
                 ArrayList<String> objects = apiTokenUtils.createGeoHazardMonitorToken(svcAddress.getGrantType(), svcAddress.getClientId(), svcAddress.getClientSecret());
                 if (objects.size() > 0) {
                     RespGeoHazardMonitorVo respGeoHazardMonitorVo = new RespGeoHazardMonitorVo();
@@ -124,6 +127,7 @@ public class GeoHazardMonitorTokenController {
      */
     @PostMapping("/alarm")
     @Transactional
+    @SdkLog(title = "报警信息数据传输", businessType = BusinessTypeSdk.ALARM)
     public String alarm(@RequestParam("parameter") String parameter, HttpServletRequest request) {
         String token = apiTokenUtils.getGeoHazardMonitorToken(request);
         log.info("token:{}", token);
@@ -281,6 +285,11 @@ public class GeoHazardMonitorTokenController {
             BaseUser admin = baseUserService.getUserName("admin");
             lw.eq(BaseDeviceDynamicManagement::getCameraCode, reqDeviceVo.getCameraCode());
             BaseDeviceDynamicManagement baseDynamicManagement = baseDeviceDynamicManagementService.getOne(lw);
+            if (ObjectUtils.isEmpty(baseDynamicManagement)) {
+                jsonObject.put("resultCode", 0);
+                jsonObject.put("message", "相机编码不存在!");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), "4370780c9a8c43e5");
+            }
             baseDynamicManagement.setElectricity(reqDeviceVo.getElectricity());
             if (reqDeviceVo.getTime().toString().length() == 10) {
                 reqDeviceVo.setTime(reqDeviceVo.getTime() * 1000);

+ 1 - 1
hazard-sdk/src/main/resources/application-druid.yml

@@ -6,7 +6,7 @@ spring:
     druid:
       # 主库数据源
       master:
-        url: jdbc:mysql://${server-ip}:3306/hazard?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        url: jdbc:mysql://10.161.12.48:3306/hazard?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
         username: root
         password: UTA1hcycRtgD0c7Y
       # 从库数据源

+ 22 - 28
hazard-sdk/src/main/resources/application.yml

@@ -1,5 +1,5 @@
 # 项目相关配置
-server-ip: 10.161.12.50
+server-ip: 10.161.12.60
 base:
   # 名称
   name: base
@@ -16,7 +16,7 @@ base:
   # 验证码类型 math 数组计算 char 字符验证
   captchaType: math
   #图片路径前缀
-  imgUrl: http://${server-ip}:18801/picbucket
+  imgUrl: http://183.236.39.220:18801/picbucket
 
 # 开发环境配置
 server:
@@ -60,11 +60,11 @@ spring:
     active: druid
   # 文件上传
   servlet:
-     multipart:
-       # 单个文件大小
-       max-file-size:  10MB
-       # 设置总上传的文件大小
-       max-request-size:  20MB
+    multipart:
+      # 单个文件大小
+      max-file-size:  10MB
+      # 设置总上传的文件大小
+      max-request-size:  20MB
   # 服务模块
   devtools:
     restart:
@@ -79,7 +79,7 @@ spring:
     # 数据库索引
     database: 0
     # 密码
-    password: tysfrz123
+    password: +xLHQ73t@q
     # 连接超时时间
     timeout: 100s
     lettuce:
@@ -95,12 +95,12 @@ spring:
 
 # web:token配置
 token:
-    # 令牌自定义标识
-    header: Authorization
-    # 令牌密钥
-    secret: abcdefghijklmnopqrstuvwxyz
-    # 令牌有效期(默认30分钟)
-    expireTime: 30
+  # 令牌自定义标识
+  header: Authorization
+  # 令牌密钥
+  secret: abcdefghijklmnopqrstuvwxyz
+  # 令牌有效期(默认30分钟)
+  expireTime: 30
 
 # app:token配置
 apptoken:
@@ -113,12 +113,12 @@ apptoken:
 
 # MyBatis配置
 mybatis:
-    # 搜索指定包别名
-    typeAliasesPackage: com.ozs.**.domain
-    # 配置mapper的扫描,找到所有的mapper.xml映射文件
-    mapperLocations: classpath*:mapper/**/*Mapper.xml
-    # 加载全局的配置文件
-    configLocation: classpath:mybatis/mybatis-config.xml
+  # 搜索指定包别名
+  typeAliasesPackage: com.ozs.**.domain
+  # 配置mapper的扫描,找到所有的mapper.xml映射文件
+  mapperLocations: classpath*:mapper/**/*Mapper.xml
+  # 加载全局的配置文件
+  configLocation: classpath:mybatis/mybatis-config.xml
 
 # MyBatis-plus配置
 mybatis-plus:
@@ -133,12 +133,6 @@ pagehelper:
   supportMethodsArguments: true
   params: count=countSql
 
-# Swagger配置
-swagger:
-  # 是否开启swagger
-  enabled: true
-  # 请求前缀
-  pathMapping: /dev-api
 
 # 防止XSS攻击
 xss:
@@ -149,10 +143,10 @@ xss:
   # 匹配链接
   urlPatterns: /system/*,/monitor/*,/tool/*
 minio:
-  endpoint: http://${server-ip}:18801 #Minio服务所在地址
+  endpoint: http://10.161.12.52:18801 #Minio服务所在地址
   bucketName: picbucket #存储桶名称
   accessKey: admin #访问的key
-  secretKey: admin123 #访问的秘钥
+  secretKey: jt73W-+xhd5 #访问的秘钥
 
 sdk:
   publish: http://${server-ip}:8081/hazard/sdk/publish

+ 9 - 9
hazard-sdk/src/main/resources/logback.xml

@@ -1,19 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
     <!-- 日志存放路径 -->
-<!--	<property name="log.path" value="/home/base/logs" />-->
+    <!--	<property name="log.path" value="/home/base/logs" />-->
     <property name="log.path" value="/opt/service/hazard-sdk/logs"/>
     <!-- 日志输出格式 -->
-	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
+    <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
 
-	<!-- 控制台输出 -->
-	<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
-		<encoder>
-			<pattern>${log.pattern}</pattern>
-		</encoder>
-	</appender>
+    <!-- 控制台输出 -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+    </appender>
 
-	<!-- 系统日志输出 -->
+    <!-- 系统日志输出 -->
 	<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
 	    <file>${log.path}/sys-info.log</file>
         <!-- 循环政策:基于时间创建日志文件 -->