70 次代码提交 5902d5333a ... 37277ccff4

作者 SHA1 备注 提交日期
  zhaojinyu 37277ccff4 注释掉测试页面 3 周之前
  gez 485bfcf267 Merge branch 'han' of uskycloud/usky-modules into master 3 周之前
  hanzhengyi a14f0e724a 解决冲突 4 周之前
  hanzhengyi 14475f1627 Merge branch 'fu-dev' of uskycloud/usky-modules into master 4 周之前
  fuyuchuan 37d280dc5f ids项目代码恢复 4 周之前
  hanzhengyi 32ea8179dc 告警 1 月之前
  hanzhengyi f535b34902 启动文件 1 月之前
  hanzhengyi 802788bae0 停车场代码完善 1 月之前
  hanzhengyi 62e3acff01 巡更系统优化 1 月之前
  hanzhengyi 82e989d6d0 巡更系统优化 1 月之前
  gez c7db12377b Merge branch 'fu-dev' of uskycloud/usky-modules into master 1 月之前
  hanzhengyi 63a8c3301a Merge branch 'fu-normal-push' of uskycloud/usky-modules into master 1 月之前
  fuyuchuan fde79e9c3f 排查修复iot宕机问题 1 月之前
  fuyuchuan 75fd15d0c7 工作报告独立服务 1 月之前
  fuyuchuan d6ff180b69 工作报告独立服务 1 月之前
  fuyuchuan ab2b882f74 工作报告独立服务 1 月之前
  hanzhengyi 373498e0e8 Merge branch 'fu-dev' of uskycloud/usky-modules into master 1 月之前
  fuyuchuan bd455d1cd4 排查修复iot宕机问题 1 月之前
  fuyuchuan bd5fd23dd7 排查修复iot宕机问题 1 月之前
  hanzhengyi a98a3d99ae Merge branch 'fu-dev' of uskycloud/usky-modules into master 1 月之前
  fuyuchuan 9c532773c9 修改定时任务配置,排查iot宕机问题 1 月之前
  James e09b5b4f12 Merge branch 'usky-zyj' of uskycloud/usky-modules into master 1 月之前
  james e7bf064279 优化门禁_设备信息表修改接口,修改绑定人员信息后门禁绑定人员变化 1 月之前
  hanzhengyi 53d4cd4fa1 Merge branch 'usky-zyj' of uskycloud/usky-modules into master 2 月之前
  james a1108722fc 1、优化告警分页接口,先查询设备信息表中未删除的设备信息,然后根据devIdList去过滤刷选告警记录,保证删除后的设备告警信息不做查询,测试接口; 2 月之前
  fuyuchuan 6b59517d50 Merge branch 'fu-dev' of uskycloud/usky-modules into master 2 月之前
  fuyuchuan 8f4f1a002a 修复报告记录查询某用户所有日报未加抄送人判断 2 月之前
  fuyuchuan 1ab131f40f Merge branch 'master' of http://47.111.81.118:3000/uskycloud/usky-modules into fu-dev 2 月之前
  gez 0f400f8e5b Merge branch 'usky-zyj' of uskycloud/usky-modules into master 2 月之前
  james ad35526b93 优化同步设备告警数据定时任务,创建类添加Async,用于异步处理1 2 月之前
  james ef6e07f688 优化同步设备告警数据定时任务,创建类添加Async,用于异步处理 2 月之前
  james 4e1a15f212 优化地理设施-导入接口,全量查询设施类型 2 月之前
  gez 02acd9b2f2 Merge branch 'modules-zjy' of uskycloud/usky-modules into master 2 月之前
  gez 88ffd5264a Merge branch 'usky-zyj' of uskycloud/usky-modules into master 2 月之前
  james 7da1fc2b00 优化门禁_设备信息表-我的门禁接口,去除throw逻辑 2 月之前
  james e8a5dbb674 优化门禁_设备信息表-修改和附加功能更新两个接口,通过id查询设备绑定人员信息,用于数据回显 2 月之前
  james fdbe2330da 优化门禁_设备信息表-修改接口,通过id查询设备绑定人员信息,用于数据回显 2 月之前
  james 126e59b24a 优化门禁_设备信息表-新增接口,增加门禁设备名称唯一性校验逻辑 2 月之前
  hanzhengyi ae778e1874 Merge branch 'usky-zyj' of uskycloud/usky-modules into master 2 月之前
  gez 477eaaf953 Merge branch 'fu-normal-push' of uskycloud/usky-modules into master 2 月之前
  james d3fcec54f1 优化全量设备状态更新定时任务调用超时,将全量设备状态更新接口设置为异步执行,同时封装ApiResult<> 2 月之前
  fuyuchuan 1915e8984d 修复工作报告项目列表、报告填写(填写界面工时统计)未租户隔离问题 2 月之前
  james 5580546279 优化全量设备状态更新定时任务调用超时,将全量设备状态更新接口设置为异步执行 2 月之前
  james 1492cb6184 优化全量设备状态更新接口,调用查询influxdb所有表实时数据RPC接口 2 月之前
  james c697c35deb 优化实时拉取摄像头视频流接口,修改切片时间 2 月之前
  james d196bb39f7 优化实时拉取摄像头视频流接口,修改切片时间,新增接口休眠时间,解决界面调用404 2 月之前
  james 0e7a904147 优化实时拉取摄像头视频流接口,修改切片时间,新增接口休眠时间,解决界面调用404 2 月之前
  hanzhengyi 5397b5a40d 外滩27号调整RTU数据转发 2 月之前
  james 5cd0fe7101 优化实时拉取摄像头视频流接口,修改视频流分辨率1920*1080为640*480 2 月之前
  hanzhengyi a99d237fab 万象城增加告警查询,外滩27号增加数据转发 2 月之前
  gez f6806d9e54 Merge branch 'fu-normal-push' of uskycloud/usky-modules into master 2 月之前
  fuyuchuan 52d13f2656 报告统计接口添加日志注解 2 月之前
  fuyuchuan fd103f4767 报告统计接口添加日志注解 2 月之前
  james 9587ce4080 优化实时拉取摄像头视频流接口,实现界面停止调用后ffmpeg拉流停止的逻辑2 2 月之前
  james 82616a1d8d 优化实时拉取摄像头视频流接口,实现界面停止调用后ffmpeg拉流停止的逻辑 2 月之前
  james 90f47412f6 优化实时拉取摄像头视频流接口,实现界面停止调用后ffmpeg拉流停止的逻辑1 2 月之前
  james f197bf950d 优化实时拉取摄像头视频流接口,实现界面停止调用后ffmpeg拉流停止的逻辑 2 月之前
  james cdab4466b3 开发实时拉取摄像头视频流接口,nacos配置RTMP存储视频服务器地址 2 月之前
  gez d60f9f86fc Merge branch 'modules-zjy' of uskycloud/usky-modules into master 2 月之前
  fuyuchuan 8798a470d0 工作报告提交提醒新增通知人员字段并优化代码 2 月之前
  gez 5e21db5d87 Merge branch 'modules-zjy' of uskycloud/usky-modules into master 2 月之前
  fuyuchuan 170f3afc64 调整OA调用消息中心代码;修复消息提醒审批人设置有误问题 2 月之前
  james f18a34ec4d 优化地理设施系统-设施采集的地理设施信息的导入和导出共用模板,设施编号、创建日期自动生成 2 月之前
  james 17e1a19def 优化地理信息-导出和地理设施-导入两个接口,使得地理设施系统-设施采集的地理设施信息的导入和导出共用一个模板4 3 月之前
  james 91f00bd308 优化地理信息-导出和地理设施-导入两个接口,使得地理设施系统-设施采集的地理设施信息的导入和导出共用一个模板3 3 月之前
  james c43f86278e 优化地理信息-导出和地理设施-导入两个接口,使得地理设施系统-设施采集的地理设施信息的导入和导出共用一个模板2 3 月之前
  james 4941189243 优化地理信息-导出和地理设施-导入两个接口,使得地理设施系统-设施采集的地理设施信息的导入和导出共用一个模板1 3 月之前
  james 8ca0095668 优化地理信息-导出和地理设施-导入两个接口,使得地理设施系统-设施采集的地理设施信息的导入和导出共用一个模板 3 月之前
  fuyuchuan 9b453dabfa OA上线复测问题修复 3 月之前
  fuyuchuan 3f07f06e01 oa代码优化 3 月之前
共有 100 个文件被更改,包括 3162 次插入530 次删除
  1. 4 0
      pom.xml
  2. 3 1
      service-ai/service-ai-biz/src/main/resources/static/dpsk.html
  3. 2 1
      service-ai/service-ai-biz/src/main/resources/static/tyqw.html
  4. 2 0
      service-eg/service-eg-biz/src/main/java/com/usky/eg/service/EgDeviceService.java
  5. 57 25
      service-eg/service-eg-biz/src/main/java/com/usky/eg/service/impl/EgDeviceServiceImpl.java
  6. 2 2
      service-fire/service-fire-biz/src/main/java/com/usky/fire/RuoYiSystemApplication.java
  7. 15 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionSiteController.java
  8. 3 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionSiteService.java
  9. 1 2
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionContentServiceImpl.java
  10. 12 12
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPlanServiceImpl.java
  11. 67 14
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionSiteServiceImpl.java
  12. 51 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/PatrolInspectionSiteImportVo.java
  13. 20 0
      service-ids/pom.xml
  14. 27 0
      service-ids/service-ids-api/pom.xml
  15. 89 0
      service-ids/service-ids-biz/pom.xml
  16. 45 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/RuoYiSystemApplication.java
  17. 109 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/controller/MybatisGeneratorUtils.java
  18. 21 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/controller/web/AccessAlarmController.java
  19. 21 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/controller/web/AccessEntryExitRecordController.java
  20. 39 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/controller/web/IdsParkMapController.java
  21. 141 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/domain/AccessAlarm.java
  22. 86 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/domain/AccessEntryExitRecord.java
  23. 61 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/domain/IdsParkMap.java
  24. 16 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/mapper/AccessAlarmMapper.java
  25. 16 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/mapper/AccessEntryExitRecordMapper.java
  26. 16 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/mapper/IdsParkMapMapper.java
  27. 16 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/service/AccessAlarmService.java
  28. 16 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/service/AccessEntryExitRecordService.java
  29. 24 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/service/IdsParkMapService.java
  30. 20 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/service/impl/AccessAlarmServiceImpl.java
  31. 20 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/service/impl/AccessEntryExitRecordServiceImpl.java
  32. 44 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/service/impl/IdsParkMapServiceImpl.java
  33. 136 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/service/util/HttpClientUtils.java
  34. 25 0
      service-ids/service-ids-biz/src/main/resources/bootstrap.yml
  35. 94 0
      service-ids/service-ids-biz/src/main/resources/logback.xml
  36. 32 0
      service-ids/service-ids-biz/src/main/resources/mapper/ids/AccessAlarmMapper.xml
  37. 21 0
      service-ids/service-ids-biz/src/main/resources/mapper/ids/AccessEntryExitRecordMapper.xml
  38. 16 0
      service-ids/service-ids-biz/src/main/resources/mapper/ids/IdsParkMapMapper.xml
  39. 15 0
      service-ids/service-ids-biz/src/main/resources/smart-doc.json
  40. 3 3
      service-iot/service-iot-api/src/main/java/com/usky/iot/RemoteIotService.java
  41. 0 2
      service-iot/service-iot-api/src/main/java/com/usky/iot/RemoteIotTaskService.java
  42. 40 0
      service-iot/service-iot-api/src/main/java/com/usky/iot/factory/RemoteIotFactory.java
  43. 0 2
      service-iot/service-iot-api/src/main/java/com/usky/iot/factory/RemoteIotTaskFactory.java
  44. 1 1
      service-iot/service-iot-biz/src/main/java/com/usky/iot/RuoYiSystemApplication.java
  45. 2 2
      service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/api/PmTimedSendingApi.java
  46. 34 4
      service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/web/PmTimeConfController.java
  47. 21 0
      service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/web/VcDeviceController.java
  48. 5 0
      service-iot/service-iot-biz/src/main/java/com/usky/iot/domain/PmTimeConf.java
  49. 1 0
      service-iot/service-iot-biz/src/main/java/com/usky/iot/mapper/BaseFacilityTypeMapper.java
  50. 2 1
      service-iot/service-iot-biz/src/main/java/com/usky/iot/mapper/PmWorkContentMapper.java
  51. 13 0
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/PmTimeConfService.java
  52. 5 0
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/VcDeviceService.java
  53. 69 0
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/config/DeviceOperate.java
  54. 4 4
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/config/DingTalkAndMessage.java
  55. 48 49
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/config/ExecutorConfig.java
  56. 126 119
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/BaseAlarmServiceImpl.java
  57. 0 1
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/BaseBuildServiceImpl.java
  58. 12 4
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/BaseGgpFacilityServiceImpl.java
  59. 9 46
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/DmpDeviceInfoServiceImpl.java
  60. 11 26
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/PmProjectServiceImpl.java
  61. 77 0
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/PmTimeConfServiceImpl.java
  62. 21 11
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/PmWorkContentServiceImpl.java
  63. 12 6
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/PmWorkReportServiceImpl.java
  64. 71 3
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/VcDeviceServiceImpl.java
  65. 17 17
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/vo/BaseGgpFacilityExportVo.java
  66. 34 9
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/vo/FacilityImportVo.java
  67. 2 2
      service-iot/service-iot-biz/src/main/resources/logback.xml
  68. 4 0
      service-iot/service-iot-biz/src/main/resources/mapper/iot/BaseFacilityTypeMapper.xml
  69. 3 0
      service-iot/service-iot-biz/src/main/resources/mapper/iot/PmTimeConfMapper.xml
  70. 2 1
      service-iot/service-iot-biz/src/main/resources/mapper/iot/PmWorkContentMapper.xml
  71. 4 0
      service-issue/service-issue-api/src/main/java/com/usky/issue/RemoteIssueTaskService.java
  72. 4 0
      service-issue/service-issue-api/src/main/java/com/usky/issue/factory/RemoteIssueTaskFactory.java
  73. 50 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/config/mqtt/MqttBaseConfig.java
  74. 48 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/config/mqtt/MqttInConfig.java
  75. 86 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/config/mqtt/MqttOutConfig.java
  76. 175 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/job/JgDataForward.java
  77. 55 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/listener/MqttListener.java
  78. 13 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/mqtt/MqttStrategy.java
  79. 25 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/mqtt/SimpleContext.java
  80. 27 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/mqtt/event/event.java
  81. 31 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/mqtt/info/Info.java
  82. 132 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/util/HttpClientUtils.java
  83. 21 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/vo/MqttBaseVO.java
  84. 24 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/vo/RtuAttributeVO.java
  85. 6 0
      service-job/pom.xml
  86. 6 6
      service-job/src/main/java/com/ruoyi/job/task/RyTask.java
  87. 5 11
      service-oa/service-oa-biz/src/main/java/com/usky/oa/service/OaFbdDocumentService.java
  88. 3 3
      service-oa/service-oa-biz/src/main/java/com/usky/oa/service/impl/OaApprovalServiceImpl.java
  89. 6 2
      service-oa/service-oa-biz/src/main/java/com/usky/oa/service/impl/OaDocumentServiceImpl.java
  90. 71 84
      service-oa/service-oa-biz/src/main/java/com/usky/oa/service/impl/OaFbdDocumentServiceImpl.java
  91. 3 0
      service-oa/service-oa-biz/src/main/java/com/usky/oa/service/impl/OaFormDefinitionServiceImpl.java
  92. 24 36
      service-oa/service-oa-biz/src/main/java/com/usky/oa/service/utils/OaApprovalGeneration.java
  93. 32 16
      service-oa/service-oa-biz/src/main/java/com/usky/oa/service/utils/OaSendMessageCenter.java
  94. 20 0
      service-pm/pom.xml
  95. 27 0
      service-pm/service-pm-api/pom.xml
  96. 15 0
      service-pm/service-pm-api/src/main/java/com/usky/pm/RemotePmService.java
  97. 29 0
      service-pm/service-pm-api/src/main/java/com/usky/pm/RemotePmTaskService.java
  98. 105 0
      service-pm/service-pm-api/src/main/java/com/usky/pm/domain/SysUserVO.java
  99. 2 2
      service-pm/service-pm-api/src/main/java/com/usky/pm/factory/RemotePmFactory.java
  100. 59 0
      service-pm/service-pm-api/src/main/java/com/usky/pm/factory/RemotePmTaskFactory.java

+ 4 - 0
pom.xml

@@ -93,6 +93,10 @@
 
     <module>service-ai</module>
 
+    <module>service-pm</module>
+
+    <module>service-ids</module>
+
   </modules>
           
   

+ 3 - 1
service-ai/service-ai-biz/src/main/resources/static/dpsk.html

@@ -1,3 +1,4 @@
+<!--
 <!DOCTYPE html>
 <html lang="en">
 <head>
@@ -146,4 +147,5 @@
     })
 </script>
 </body>
-</html>
+</html>
+-->

+ 2 - 1
service-ai/service-ai-biz/src/main/resources/static/tyqw.html

@@ -1,3 +1,4 @@
+<!--
 <!DOCTYPE html>
 <html lang="en">
 <head>
@@ -146,4 +147,4 @@
     })
 </script>
 </body>
-</html>
+</html>-->

+ 2 - 0
service-eg/service-eg-biz/src/main/java/com/usky/eg/service/EgDeviceService.java

@@ -31,5 +31,7 @@ public interface EgDeviceService extends CrudService<EgDevice> {
 
     boolean checkNameUnique(EgDevice egDevice);
 
+    boolean checkDeviceNameUnique(EgDevice egDevice);
+
     Map<String,Object> control(String productCode, String deviceUuid, String commandCode, String commandValue, String domain, Long userId, String userName);
 }

+ 57 - 25
service-eg/service-eg-biz/src/main/java/com/usky/eg/service/impl/EgDeviceServiceImpl.java

@@ -106,24 +106,27 @@ public class EgDeviceServiceImpl extends AbstractCrudService<EgDeviceMapper, EgD
         long userId = SecurityUtils.getUserId();
         //人员设备权限校验,校验通过,可以下发命令控制设备
         Integer fid = baseMapper.getMeetingFaceData(userId);
-        if(fid == null){
-            throw new BusinessException("人脸卡号信息未注册");
-        }
+//        if(fid == null){
+//            throw new BusinessException("人脸卡号信息未注册");
+//        }
         Integer[] deviceFid = baseMapper.getMeetingFaceDeviceList(fid);
-        if(deviceFid.length == 0){
-            throw new BusinessException("人员未绑定设备,请检查");
-        }
+//        if(deviceFid.length == 0){
+//            throw new BusinessException("人员未绑定设备,请检查");
+//        }
 
         IPage<EgDevice> page = new Page<>(requestVO.getCurrent(),requestVO.getSize());
-        LambdaQueryWrapper<EgDevice> queryWrapper = Wrappers.lambdaQuery();
-        queryWrapper.like(StringUtils.isNotBlank(requestVO.getDeviceName()),EgDevice::getDeviceName,requestVO.getDeviceName())
-                .like(StringUtils.isNotBlank(requestVO.getInstallAddress()),EgDevice::getInstallAddress,requestVO.getInstallAddress())
-                .eq(null != requestVO.getServiceStatus(),EgDevice::getServiceStatus,requestVO.getServiceStatus())
-                .eq(null != requestVO.getId(),EgDevice::getId,requestVO.getId())
-                .in(EgDevice::getId,deviceFid)
-                .eq(EgDevice::getTenantId,SecurityUtils.getTenantId())
-                .orderByDesc(EgDevice::getId);
-        page = this.page(page,queryWrapper);
+        if(deviceFid.length > 0){
+            LambdaQueryWrapper<EgDevice> queryWrapper = Wrappers.lambdaQuery();
+            queryWrapper.like(StringUtils.isNotBlank(requestVO.getDeviceName()),EgDevice::getDeviceName,requestVO.getDeviceName())
+                    .like(StringUtils.isNotBlank(requestVO.getInstallAddress()),EgDevice::getInstallAddress,requestVO.getInstallAddress())
+                    .eq(null != requestVO.getServiceStatus(),EgDevice::getServiceStatus,requestVO.getServiceStatus())
+                    .eq(null != requestVO.getId(),EgDevice::getId,requestVO.getId())
+                    .in(EgDevice::getId,deviceFid)
+                    .eq(EgDevice::getTenantId,SecurityUtils.getTenantId())
+                    .orderByDesc(EgDevice::getId);
+            page = this.page(page,queryWrapper);
+        }
+
 
         return new CommonPage<>(page.getRecords(),page.getTotal(),requestVO.getSize(),requestVO.getCurrent());
     }
@@ -133,6 +136,9 @@ public class EgDeviceServiceImpl extends AbstractCrudService<EgDeviceMapper, EgD
         if(checkNameUnique(egDevice)){
             throw new BusinessException("新增门禁门号设备'"+egDevice.getDeviceId()+","+egDevice.getEgNumber()+"'失败,设备已存在");
         }
+        if(checkDeviceNameUnique(egDevice)){
+            throw new BusinessException("新增门禁设备'"+egDevice.getDeviceName()+"'失败,设备已存在");
+        }
 
         egDevice.setDeviceUuid(UUIDUtils.uuid());
         egDevice.setCreateBy(SecurityUtils.getUsername());
@@ -155,33 +161,49 @@ public class EgDeviceServiceImpl extends AbstractCrudService<EgDeviceMapper, EgD
     }
 
     @Override
-    public void update(EgDevice egDevice){
-        if(checkNameUnique(egDevice)){
-            throw new BusinessException("修改门禁门号设备'"+egDevice.getDeviceId()+","+egDevice.getEgNumber()+"'失败,设备已存在");
-        }
-
-        egDevice.setUpdateBy(SecurityUtils.getUsername());
-        egDevice.setUpdateTime(LocalDateTime.now());
-
-        this.updateById(egDevice);
+    public void update(EgDevice egDevice) {
 
         String[] fids = new String[0];
-        egDeviceMapper.deleteMeetingFaceDevice(egDevice.getId());
         if(Objects.nonNull(egDevice.getBindFace()) || StringUtils.isNotBlank(egDevice.getBindFace())){
             fids = egDevice.getBindFace().split(",");
+
+            egDeviceMapper.deleteMeetingFaceDevice(egDevice.getId());
+        }else{
+            EgDevice one = this.getById(egDevice.getId());
+            egDevice.setBindFace(one.getBindFace());
         }
         if(fids.length > 0){
             for (int i = 0; i < fids.length; i++) {
                 egDeviceMapper.insertMeetingFaceDevice(Integer.parseInt(fids[i]),egDevice.getId());
             }
         }
+
+
+        if(checkNameUnique(egDevice)){
+            throw new BusinessException("修改门禁门号设备'"+egDevice.getDeviceId()+","+egDevice.getEgNumber()+"'失败,设备已存在");
+        }
+        if(checkDeviceNameUnique(egDevice)){
+            throw new BusinessException("新增门禁设备'"+egDevice.getDeviceName()+"'失败,设备已存在");
+        }
+
+        egDevice.setUpdateBy(SecurityUtils.getUsername());
+        egDevice.setUpdateTime(LocalDateTime.now());
+
+        this.updateById(egDevice);
     }
 
     @Override
     public void attachUpdate(EgDevice egDevice){
+
+        EgDevice one = this.getById(egDevice.getId());
+        egDevice.setBindFace(one.getBindFace());
+
         if(checkNameUnique(egDevice)){
             throw new BusinessException("更新门禁设备附加功能'"+egDevice.getDeviceId()+"'失败,设备已存在");
         }
+        if(checkDeviceNameUnique(egDevice)){
+            throw new BusinessException("新增门禁设备'"+egDevice.getDeviceName()+"'失败,设备已存在");
+        }
 
         egDevice.setUpdateBy(SecurityUtils.getUsername());
         egDevice.setUpdateTime(LocalDateTime.now());
@@ -217,6 +239,16 @@ public class EgDeviceServiceImpl extends AbstractCrudService<EgDeviceMapper, EgD
         return null != one && !Objects.equals(one.getId(),id);
     }
 
+    @Override
+    public boolean checkDeviceNameUnique(EgDevice egDevice){
+        Integer id = null == egDevice.getId() ? -1 : egDevice.getId();
+        LambdaQueryWrapper<EgDevice> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(EgDevice::getDeviceName,egDevice.getDeviceName())
+                .eq(EgDevice::getTenantId, SecurityUtils.getTenantId());
+        EgDevice one = this.getOne(queryWrapper);
+        return null != one && !Objects.equals(one.getId(),id);
+    }
+
     @Override
     public Map<String,Object> control(String productCode, String deviceUuid, String commandCode, String commandValue, String domain, Long userId, String userName){
         Integer tenantId;

+ 2 - 2
service-fire/service-fire-biz/src/main/java/com/usky/fire/RuoYiSystemApplication.java

@@ -10,7 +10,7 @@ import org.springframework.context.annotation.ComponentScan;
 
 /**
  * 系统模块
- * 
+ *
  * @author ruoyi
  */
 
@@ -35,4 +35,4 @@ public class RuoYiSystemApplication
                 " |  |  \\    /  \\      /           \n" +
                 " ''-'   `'-'    `-..-'              ");
     }
-}
+}

+ 15 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionSiteController.java

@@ -13,6 +13,7 @@ import com.usky.fire.service.vo.PatrolInspectionAreaVo;
 import com.usky.fire.service.vo.PatrolInspectionSiteExportVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
@@ -156,5 +157,19 @@ public class PatrolInspectionSiteController {
         ExcelUtil<PatrolInspectionSiteExportVo> util = new ExcelUtil<PatrolInspectionSiteExportVo>(PatrolInspectionSiteExportVo.class);
         util.exportExcel(response, list, "巡检地点列表", "巡检地点列表");
     }
+
+    /**
+     * 巡检点位-导入
+     *
+     * @param file 导入文件
+     * @return
+     * @throws Exception
+     */
+    @Log(title = "巡检地点", businessType = BusinessType.IMPORT)
+    @PostMapping("/patrolInspectionSiteImport")
+    public ApiResult<Void> patrolInspectionSiteImport(@RequestParam("file") MultipartFile file){
+        patrolInspectionSiteService.patrolInspectionSiteImport(file);
+        return ApiResult.success();
+    }
 }
 

+ 3 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionSiteService.java

@@ -6,6 +6,7 @@ import com.usky.fire.domain.PatrolInspectionSite;
 import com.usky.fire.domain.PatrolInspectionSiteContent;
 import com.usky.fire.service.vo.PatrolInspectionAreaVo;
 import com.usky.fire.service.vo.PatrolInspectionSiteExportVo;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.util.List;
 
@@ -43,4 +44,6 @@ public interface PatrolInspectionSiteService extends CrudService<PatrolInspectio
      */
     List<Integer> siteIdList(List<Integer> areaIdList);
 
+    void patrolInspectionSiteImport(MultipartFile multipartFile);
+
 }

+ 1 - 2
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionContentServiceImpl.java

@@ -102,8 +102,7 @@ public class PatrolInspectionContentServiceImpl extends AbstractCrudService<Patr
                 PatrolInspectionContentOption contentOption = new PatrolInspectionContentOption();
                 contentOption.setOptionName(patrolInspectionContentVo.getContentOptionList().get(i).getOptionName());
                 contentOption.setContentId(patrolInspectionContentVo.getId());
-                if (patrolInspectionContentVo.getContentOptionList().get(i).getId() != 0 &&
-                        patrolInspectionContentVo.getContentOptionList().get(i).getId() != null) {
+                if (patrolInspectionContentVo.getContentOptionList().get(i).getId() != null && patrolInspectionContentVo.getContentOptionList().get(i).getId() != 0) {
                     contentOption.setId(patrolInspectionContentVo.getContentOptionList().get(i).getId());
                     contentOption.setEnable(1);
                     contentOptionService.updateById(contentOption);

+ 12 - 12
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPlanServiceImpl.java

@@ -291,12 +291,12 @@ public class PatrolInspectionPlanServiceImpl extends AbstractCrudService<PatrolI
     @Override
     @Transactional
     public void updatePatrolInspectionPlan(PatrolInspectionPlanVo patrolInspectionPlanVo) {
-        LambdaQueryWrapper<PatrolInspectionRecord> queryWrapperSix = Wrappers.lambdaQuery();
-        queryWrapperSix.eq(PatrolInspectionRecord::getPlanId, patrolInspectionPlanVo.getId());
-        List<PatrolInspectionRecord> patrolInspectionRecordList = patrolInspectionRecordService.list(queryWrapperSix);
-        if (patrolInspectionRecordList.size() > 0) {
-            throw new BusinessException("巡检计划已执行中不可修改");
-        }
+//        LambdaQueryWrapper<PatrolInspectionRecord> queryWrapperSix = Wrappers.lambdaQuery();
+//        queryWrapperSix.eq(PatrolInspectionRecord::getPlanId, patrolInspectionPlanVo.getId());
+//        List<PatrolInspectionRecord> patrolInspectionRecordList = patrolInspectionRecordService.list(queryWrapperSix);
+//        if (patrolInspectionRecordList.size() > 0) {
+//            throw new BusinessException("巡检计划已执行中不可修改");
+//        }
         Integer planCycle = patrolInspectionPlanVo.getPlanCycle();
         String timeStr = patrolInspectionPlanVo.getStartDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
         Date startDate = OnlineMethod.getDate(timeStr);
@@ -575,12 +575,12 @@ public class PatrolInspectionPlanServiceImpl extends AbstractCrudService<PatrolI
     @Override
     @Transactional
     public void delPatrolInspectionPlan(Integer id) {
-        LambdaQueryWrapper<PatrolInspectionRecord> queryWrapperSix = Wrappers.lambdaQuery();
-        queryWrapperSix.eq(PatrolInspectionRecord::getPlanId, id);
-        List<PatrolInspectionRecord> patrolInspectionRecordList = patrolInspectionRecordService.list(queryWrapperSix);
-        if (patrolInspectionRecordList.size() > 0) {
-            throw new BusinessException("巡检计划已执行中不可删除");
-        }
+//        LambdaQueryWrapper<PatrolInspectionRecord> queryWrapperSix = Wrappers.lambdaQuery();
+//        queryWrapperSix.eq(PatrolInspectionRecord::getPlanId, id);
+//        List<PatrolInspectionRecord> patrolInspectionRecordList = patrolInspectionRecordService.list(queryWrapperSix);
+//        if (patrolInspectionRecordList.size() > 0) {
+//            throw new BusinessException("巡检计划已执行中不可删除");
+//        }
         PatrolInspectionPlan patrolInspectionPlan = new PatrolInspectionPlan();
         patrolInspectionPlan.setId(id);
         patrolInspectionPlan.setEnable(0);

+ 67 - 14
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionSiteServiceImpl.java

@@ -1,12 +1,15 @@
 package com.usky.fire.service.impl;
 
-import com.alibaba.nacos.common.utils.CollectionUtils;
+import cn.afterturn.easypoi.excel.ExcelImportUtil;
+import cn.afterturn.easypoi.excel.entity.ImportParams;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.ruoyi.common.datascope.annotation.DataScope;
 import com.ruoyi.common.datascope.context.DataScopeContextHolder;
 import com.usky.common.core.bean.CommonPage;
 import com.usky.common.core.exception.BusinessException;
+import com.usky.common.core.util.BeanMapperUtils;
 import com.usky.common.mybatis.core.AbstractCrudService;
 import com.usky.common.security.utils.SecurityUtils;
 import com.usky.fire.domain.*;
@@ -19,17 +22,18 @@ import com.usky.fire.service.util.OnlineMethod;
 import com.usky.fire.service.vo.DataCountVo;
 import com.usky.fire.service.vo.PatrolInspectionAreaVo;
 import com.usky.fire.service.vo.PatrolInspectionSiteExportVo;
+import com.usky.fire.service.vo.PatrolInspectionSiteImportVo;
 import com.usky.system.model.LoginUser;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
+import org.springframework.web.multipart.MultipartFile;
 
+import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -194,16 +198,24 @@ public class PatrolInspectionSiteServiceImpl extends AbstractCrudService<PatrolI
     @Override
     @Transactional
     public void addSiteContent(List<PatrolInspectionSiteContent> siteContentList) {
-        LambdaQueryWrapper<PatrolInspectionSiteContent> queryWrapper = Wrappers.lambdaQuery();
-        queryWrapper.eq(PatrolInspectionSiteContent::getSiteId, siteContentList.get(0).getSiteId());
-        List<PatrolInspectionSiteContent> siteContenListOne = siteContentService.list(queryWrapper);
-        if (siteContenListOne.size() > 0) {
-            for (int i = 0; i < siteContenListOne.size(); i++) {
-                siteContentService.removeById(siteContenListOne.get(i).getId());
+        List<Integer> list = new ArrayList<>();
+        List<Integer> list2 = new ArrayList<>();
+        if (siteContentList.size()>0){
+            for (int i = 0; i < siteContentList.size(); i++) {
+                list.add(siteContentList.get(i).getSiteId());
+            }
+            list2 = removeDuplicatesUsingHashSet(list);
+            LambdaQueryWrapper<PatrolInspectionSiteContent> queryWrapper = Wrappers.lambdaQuery();
+            queryWrapper.in(PatrolInspectionSiteContent::getSiteId, list2);
+            List<PatrolInspectionSiteContent> siteContenListOne = siteContentService.list(queryWrapper);
+            if (siteContenListOne.size() > 0) {
+                for (int i = 0; i < siteContenListOne.size(); i++) {
+                    siteContentService.removeById(siteContenListOne.get(i).getId());
+                }
+            }
+            for (int i = 0; i < siteContentList.size(); i++) {
+                siteContentService.save(siteContentList.get(i));
             }
-        }
-        for (int i = 0; i < siteContentList.size(); i++) {
-            siteContentService.save(siteContentList.get(i));
         }
     }
 
@@ -285,4 +297,45 @@ public class PatrolInspectionSiteServiceImpl extends AbstractCrudService<PatrolI
         }
         return siteIdList;
     }
+
+    @Override
+    public void patrolInspectionSiteImport(MultipartFile multipartFile) {
+        ImportParams params = new ImportParams();
+        params.setHeadRows(1);
+        String err="文件导入失败";
+        try {
+            List<PatrolInspectionSiteImportVo> patrolInspectionSiteImportVos =
+                    ExcelImportUtil.importExcel(multipartFile.getInputStream(),
+                    PatrolInspectionSiteImportVo.class, params);
+            if (CollectionUtils.isNotEmpty(patrolInspectionSiteImportVos)){
+                int rot=0;
+                for (PatrolInspectionSiteImportVo patrolInspectionSiteImportVo:patrolInspectionSiteImportVos) {
+                    PatrolInspectionSite patrolInspectionSite = BeanMapperUtils.map(patrolInspectionSiteImportVo, PatrolInspectionSite.class);
+                    patrolInspectionSite.setEnable(1);
+                    patrolInspectionSite.setCreator(SecurityUtils.getUsername());
+                    patrolInspectionSite.setCollector(SecurityUtils.getLoginUser().getSysUser().getNickName());
+                    patrolInspectionSite.setCreateTime(LocalDateTime.now());
+                    patrolInspectionSite.setTenantId(SecurityUtils.getTenantId());
+                    patrolInspectionSite.setSiteType(2);
+                    try{
+                        this.save(patrolInspectionSite);
+                    }catch (Exception e){
+                        int h=rot+2;
+                        err="文件导入失败,第"+h+"行数据导入失败";
+                        throw  new BusinessException(err);
+                    }
+                    rot++;
+                }
+            }else {
+                err="文件不能为空";
+                throw new BusinessException(err);
+            }
+        }catch (Exception e){
+            throw  new BusinessException(e.getMessage());
+        }
+    }
+    public static <T> List<T> removeDuplicatesUsingHashSet(List<T> list) {
+        Set<T> set = new HashSet<>(list);
+        return new ArrayList<>(set);
+    }
 }

+ 51 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/PatrolInspectionSiteImportVo.java

@@ -0,0 +1,51 @@
+package com.usky.fire.service.vo;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author han
+ * @since 2025-04-24
+ */
+@Data
+public class PatrolInspectionSiteImportVo{
+
+    /**
+     * 地点名称
+     */
+    @Excel(name = "地点名称")
+    private String siteName;
+
+    /**
+     * 地点号码
+     */
+    @Excel(name = "地点号码")
+    private String siteNubmber;
+
+    /**
+     * 经度
+     */
+    @Excel(name = "经度")
+    private String longitude;
+
+    /**
+     * 纬度
+     */
+    @Excel(name = "纬度")
+    private String latitude;
+
+    /**
+     * 图片地址
+     */
+    @Excel(name = "图片地址")
+    private String pictureUrl;
+
+}

+ 20 - 0
service-ids/pom.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>usky-modules</artifactId>
+        <groupId>com.usky</groupId>
+        <version>0.0.1</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>service-ids</artifactId>
+
+    <packaging>pom</packaging>
+    <version>0.0.1</version>
+
+    <modules>
+        <module>service-ids-biz</module>
+        <module>service-ids-api</module>
+    </modules>
+</project>

+ 27 - 0
service-ids/service-ids-api/pom.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>service-ids</artifactId>
+        <groupId>com.usky</groupId>
+        <version>0.0.1</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>service-ids-api</artifactId>
+    <!-- SpringCloud Openfeign -->
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.usky</groupId>
+            <artifactId>usky-common-core</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>${project.artifactId}</finalName>
+    </build>
+
+</project>

+ 89 - 0
service-ids/service-ids-biz/pom.xml

@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>service-ids</artifactId>
+        <groupId>com.usky</groupId>
+        <version>0.0.1</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>service-ids-biz</artifactId>
+    <dependencies>
+        <dependency>
+            <groupId>com.usky</groupId>
+            <artifactId>common-cloud-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.afterturn</groupId>
+            <artifactId>easypoi-spring-boot-starter</artifactId>
+            <version>4.1.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-core</artifactId>
+            <version>4.5.16</version>
+        </dependency>
+
+        <!--语音依赖-->
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-dyvmsapi</artifactId>
+            <version>1.2.2</version>
+        </dependency>
+
+        <!--短信依赖-->
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-dysmsapi</artifactId>
+            <version>1.1.0</version>
+        </dependency>
+
+        <!--MQTT依赖-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-integration</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.integration</groupId>
+            <artifactId>spring-integration-mqtt</artifactId>
+        </dependency>
+        <!--websocket依赖-->
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-websocket</artifactId>
+            <version>5.2.8.RELEASE</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>${project.artifactId}</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>com.github.shalousun</groupId>
+                <artifactId>smart-doc-maven-plugin</artifactId>
+                <version>2.1.1</version>
+                <configuration>
+                    <!--指定生成文档的使用的配置文件,配置文件放在自己的项目中-->
+                    <configFile>./src/main/resources/smart-doc.json</configFile>
+                    <!--指定项目名称-->
+                    <projectName>test</projectName>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 45 - 0
service-ids/service-ids-biz/src/main/java/com/usky/ids/RuoYiSystemApplication.java

@@ -0,0 +1,45 @@
+package com.usky.ids;
+
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.core.env.Environment;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+/**
+ * 系统模块
+ * 
+ * @author ruoyi
+ */
+
+
+@EnableFeignClients(basePackages = "com.usky")
+@MapperScan(value = "com.usky.ids.mapper")
+@ComponentScan("com.usky")
+@SpringBootApplication
+public class RuoYiSystemApplication
+{
+    private static final Logger LOGGER = LoggerFactory.getLogger(RuoYiSystemApplication.class);
+
+    public static void main(String[] args) throws UnknownHostException {
+        ConfigurableApplicationContext application = SpringApplication.run(RuoYiSystemApplication.class, args);
+        Environment env = application.getEnvironment();
+        String ip = InetAddress.getLocalHost().getHostAddress();
+        String port = env.getProperty("server.port");
+        String path = env.getProperty("server.servlet.context-path");
+        LOGGER.info("\n----------------------------------------------------------\n\t" +
+                "Application is running! Access URLs:\n\t" +
+                "Local: \t\thttp://localhost:" + port + (null==path?"":path) + "/\n\t" +
+                "External: \thttp://" + ip + ":" + port + (null==path?"":path) + "/\n\t" +
+                "Api: \t\thttp://" + ip + ":" + port + (null==path?"":path) + "/swagger-ui/index.html\n\t" +
+                "----------------------------------------------------------");
+    }
+}

+ 109 - 0
service-ids/service-ids-biz/src/main/java/com/usky/ids/controller/MybatisGeneratorUtils.java

@@ -0,0 +1,109 @@
+package com.usky.ids.controller;//package com.usky.iot.controller;//package com.usky.dm.controller.web.business;
+// package com.usky.dm.controller.web;
+
+
+import com.baomidou.mybatisplus.core.toolkit.StringPool;
+import com.baomidou.mybatisplus.generator.AutoGenerator;
+import com.baomidou.mybatisplus.generator.InjectionConfig;
+import com.baomidou.mybatisplus.generator.config.*;
+import com.baomidou.mybatisplus.generator.config.po.TableInfo;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author han
+ * @date 2025/1/18 13:19
+ */
+public class MybatisGeneratorUtils {
+    public static void main(String[] args) {
+
+            shell("service-ids","service-ids-biz");
+    }
+
+    private static void shell(String parentName,String model) {
+
+        AutoGenerator mpg = new AutoGenerator();
+        //1、全局配置
+        GlobalConfig gc = new GlobalConfig();
+//        File file = new File(model);
+//        String path = file.getAbsolutePath();
+        String projectPath = System.getProperty("user.dir");
+        projectPath+="/"+parentName;
+        projectPath+="/"+model;
+        gc.setOutputDir(projectPath+ "/src/main/java");  //生成路径(一般都是生成在此项目的src/main/java下面)
+        //修改为自己的名字
+        gc.setAuthor("han"); //设置作者
+        gc.setOpen(false);
+        gc.setFileOverride(true); //第二次生成会把第一次生成的覆盖掉
+        gc.setServiceName("%sService"); //生成的service接口名字首字母是否为I,这样设置就没有
+        gc.setBaseResultMap(true); //生成resultMap
+        mpg.setGlobalConfig(gc);
+
+        //2、数据源配置
+        //修改数据源
+        DataSourceConfig dsc = new DataSourceConfig();
+        dsc.setUrl("jdbc:mysql://192.168.10.165:3306/usky-cloud?useUnicode=true&serverTimezone=GMT&useSSL=false&characterEncoding=utf8");
+        dsc.setDriverName("com.mysql.jdbc.Driver");
+        dsc.setUsername("root");
+        dsc.setPassword("yt123456");
+        mpg.setDataSource(dsc);
+
+        // 3、包配置
+        PackageConfig pc = new PackageConfig();
+        pc.setParent("com.usky.ids");
+        pc.setController("controller.web");
+        pc.setEntity("domain");
+        pc.setMapper("mapper");
+        pc.setService("service");
+        pc.setServiceImpl("service.impl");
+//        pc.setXml("mapper.demo");
+        //pc.setModuleName("test");
+        mpg.setPackageInfo(pc);
+
+        // 4、策略配置
+        StrategyConfig strategy = new StrategyConfig();
+        strategy.setNaming(NamingStrategy.underline_to_camel);
+        strategy.setColumnNaming(NamingStrategy.underline_to_camel);
+        strategy.setSuperMapperClass("com.usky.common.mybatis.core.CrudMapper");
+        strategy.setSuperServiceClass("com.usky.common.mybatis.core.CrudService");
+        strategy.setSuperServiceImplClass("com.usky.common.mybatis.core.AbstractCrudService");
+        // strategy.setTablePrefix("t_"); // 表名前缀
+        strategy.setEntityLombokModel(true); //使用lombok
+        //修改自己想要生成的表
+        strategy.setInclude("ids_park_map");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
+        mpg.setStrategy(strategy);
+
+        // 关闭默认 xml 生成,调整生成 至 根目录
+        //修改对应的模块名称
+        TemplateConfig tc = new TemplateConfig();
+        // 自定义配置
+        InjectionConfig cfg = new InjectionConfig() {
+            @Override
+            public void initMap() {
+                // to do nothing
+            }
+        };
+        //如果模板引擎是 velocity
+        String templatePath = "/templates/mapper.xml.vm";
+        // 自定义输出配置
+        List<FileOutConfig> focList = new ArrayList<>();
+        // 自定义配置会被优先输出
+        String finalProjectPath = projectPath;
+        focList.add(new FileOutConfig(templatePath) {
+            @Override
+            public String outputFile(TableInfo tableInfo) {
+                // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
+                return finalProjectPath + "/src/main/resources/mapper/ids" + "/"
+                        + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
+            }
+        });
+        cfg.setFileOutConfigList(focList);
+        mpg.setCfg(cfg);
+        tc.setXml(null);
+        mpg.setTemplate(tc);
+        //5、执行
+        mpg.execute();
+    }
+}

+ 21 - 0
service-ids/service-ids-biz/src/main/java/com/usky/ids/controller/web/AccessAlarmController.java

@@ -0,0 +1,21 @@
+package com.usky.ids.controller.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ * 报警信息表 前端控制器
+ * </p>
+ *
+ * @author han
+ * @since 2025-03-10
+ */
+@Controller
+@RequestMapping("/accessAlarm")
+public class AccessAlarmController {
+
+}
+

+ 21 - 0
service-ids/service-ids-biz/src/main/java/com/usky/ids/controller/web/AccessEntryExitRecordController.java

@@ -0,0 +1,21 @@
+package com.usky.ids.controller.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ * 车辆进出记录 前端控制器
+ * </p>
+ *
+ * @author han
+ * @since 2025-03-26
+ */
+@Controller
+@RequestMapping("/accessEntryExitRecord")
+public class AccessEntryExitRecordController {
+
+}
+

+ 39 - 0
service-ids/service-ids-biz/src/main/java/com/usky/ids/controller/web/IdsParkMapController.java

@@ -0,0 +1,39 @@
+package com.usky.ids.controller.web;
+
+
+import com.usky.common.core.bean.ApiResult;
+import com.usky.common.core.bean.CommonPage;
+import com.usky.ids.domain.IdsParkMap;
+import com.usky.ids.service.IdsParkMapService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author han
+ * @since 2025-01-18
+ */
+@RestController
+@RequestMapping("/idsParkMap")
+public class IdsParkMapController {
+    @Autowired
+    private IdsParkMapService idsParkMapService;
+    /**
+     * 获取车位信息
+     * @return
+     */
+    @GetMapping("mapList")
+    ApiResult<Object> mapList(){
+        return ApiResult.success(idsParkMapService.mapList());
+    }
+}
+

+ 141 - 0
service-ids/service-ids-biz/src/main/java/com/usky/ids/domain/AccessAlarm.java

@@ -0,0 +1,141 @@
+package com.usky.ids.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 报警信息表
+ * </p>
+ *
+ * @author han
+ * @since 2025-03-10
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class AccessAlarm implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 报警ID
+     */
+    @TableId(value = "alarm_id", type = IdType.AUTO)
+    private Long alarmId;
+
+    /**
+     * 报警等级
+     */
+    private String alarmLevel;
+
+    /**
+     * 报警详情
+     */
+    private String alarmDetails;
+
+    /**
+     * 报警位置
+     */
+    private String alarmLocation;
+
+    /**
+     * 报警区域
+     */
+    private String regionIndexCode;
+
+    /**
+     * 监控点名称
+     */
+    private String cameraName;
+
+    /**
+     * 监控点唯一编码
+     */
+    private String cameraIndexCode;
+
+    /**
+     * 报警来源算法类型
+     */
+    private String alarmSourceAlgorithmType;
+
+    /**
+     * 报警图片 
+     */
+    private String alarmPhoto;
+
+    /**
+     * 报警视频 
+     */
+    private String alarmVideo;
+
+    /**
+     * 报警类型(1车辆违停2车辆拥堵 3车辆违停占道 4吸烟 5人员摔倒 6杂物堆放 7人员聚集 8火焰识别算法)
+     */
+    private String alarmType;
+
+    /**
+     * 状态(0未处理 1已处理)
+     */
+    private String alarmStatus;
+
+    /**
+     * 处理时间
+     */
+    private LocalDateTime processTime;
+
+    /**
+     * 拥堵等级(1绿色 2黄色 3红色)
+     */
+    private Integer congestionLevel;
+
+    /**
+     * 报警时间
+     */
+    private LocalDateTime alarmTime;
+
+    /**
+     * 报警消除时间(算法自动识别)
+     */
+    private LocalDateTime cleanAlarmTime;
+
+    /**
+     * 创建者
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更新者
+     */
+    private String updateBy;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 已读状态(0 未读 1 已读)
+     */
+    private String readStatus;
+
+    /**
+     * 已读时间
+     */
+    private LocalDateTime readTime;
+
+
+}

+ 86 - 0
service-ids/service-ids-biz/src/main/java/com/usky/ids/domain/AccessEntryExitRecord.java

@@ -0,0 +1,86 @@
+package com.usky.ids.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 车辆进出记录
+ * </p>
+ *
+ * @author han
+ * @since 2025-03-26
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class AccessEntryExitRecord implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 车辆进出记录ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 车辆颜色
+     */
+    private String carColor;
+
+    /**
+     * 车牌
+     */
+    private String licensePlate;
+
+    /**
+     * 进出场类型(1进 2出)
+     */
+    private String actionDirection;
+
+    /**
+     * 监控点唯一编码
+     */
+    private String cameraIndexCode;
+
+    /**
+     * 监控点名称
+     */
+    private String cameraName;
+
+    /**
+     * 进/出场时间
+     */
+    private LocalDateTime recordTime;
+
+    /**
+     * 创建者
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更新者
+     */
+    private String updateBy;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+
+}

+ 61 - 0
service-ids/service-ids-biz/src/main/java/com/usky/ids/domain/IdsParkMap.java

@@ -0,0 +1,61 @@
+package com.usky.ids.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author han
+ * @since 2025-01-18
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class IdsParkMap implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 楼层车位统计信息
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 楼层名称
+     */
+    private String mapName;
+
+    /**
+     * 使用中数量
+     */
+    private Integer usingCount;
+
+    /**
+     * 空闲数量
+     */
+    private Integer freeCount;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+
+    /**
+     * 部门id
+     */
+    private Long deptId;
+
+    /**
+     * 租户id
+     */
+    private Integer tenantId;
+
+
+}

+ 16 - 0
service-ids/service-ids-biz/src/main/java/com/usky/ids/mapper/AccessAlarmMapper.java

@@ -0,0 +1,16 @@
+package com.usky.ids.mapper;
+
+import com.usky.ids.domain.AccessAlarm;
+import com.usky.common.mybatis.core.CrudMapper;
+
+/**
+ * <p>
+ * 报警信息表 Mapper 接口
+ * </p>
+ *
+ * @author han
+ * @since 2025-03-10
+ */
+public interface AccessAlarmMapper extends CrudMapper<AccessAlarm> {
+
+}

+ 16 - 0
service-ids/service-ids-biz/src/main/java/com/usky/ids/mapper/AccessEntryExitRecordMapper.java

@@ -0,0 +1,16 @@
+package com.usky.ids.mapper;
+
+import com.usky.ids.domain.AccessEntryExitRecord;
+import com.usky.common.mybatis.core.CrudMapper;
+
+/**
+ * <p>
+ * 车辆进出记录 Mapper 接口
+ * </p>
+ *
+ * @author han
+ * @since 2025-03-26
+ */
+public interface AccessEntryExitRecordMapper extends CrudMapper<AccessEntryExitRecord> {
+
+}

+ 16 - 0
service-ids/service-ids-biz/src/main/java/com/usky/ids/mapper/IdsParkMapMapper.java

@@ -0,0 +1,16 @@
+package com.usky.ids.mapper;
+
+import com.usky.ids.domain.IdsParkMap;
+import com.usky.common.mybatis.core.CrudMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author han
+ * @since 2025-01-18
+ */
+public interface IdsParkMapMapper extends CrudMapper<IdsParkMap> {
+
+}

+ 16 - 0
service-ids/service-ids-biz/src/main/java/com/usky/ids/service/AccessAlarmService.java

@@ -0,0 +1,16 @@
+package com.usky.ids.service;
+
+import com.usky.ids.domain.AccessAlarm;
+import com.usky.common.mybatis.core.CrudService;
+
+/**
+ * <p>
+ * 报警信息表 服务类
+ * </p>
+ *
+ * @author han
+ * @since 2025-03-10
+ */
+public interface AccessAlarmService extends CrudService<AccessAlarm> {
+
+}

+ 16 - 0
service-ids/service-ids-biz/src/main/java/com/usky/ids/service/AccessEntryExitRecordService.java

@@ -0,0 +1,16 @@
+package com.usky.ids.service;
+
+import com.usky.ids.domain.AccessEntryExitRecord;
+import com.usky.common.mybatis.core.CrudService;
+
+/**
+ * <p>
+ * 车辆进出记录 服务类
+ * </p>
+ *
+ * @author han
+ * @since 2025-03-26
+ */
+public interface AccessEntryExitRecordService extends CrudService<AccessEntryExitRecord> {
+
+}

+ 24 - 0
service-ids/service-ids-biz/src/main/java/com/usky/ids/service/IdsParkMapService.java

@@ -0,0 +1,24 @@
+package com.usky.ids.service;
+
+import com.usky.ids.domain.IdsParkMap;
+import com.usky.common.mybatis.core.CrudService;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author han
+ * @since 2025-01-18
+ */
+public interface IdsParkMapService extends CrudService<IdsParkMap> {
+    Object mapList();
+//    /**
+//     * 定时同步智泊反寻系统停车场数据到巡检异常记录表中
+//     *
+//     * @return
+//     */
+//    void addPatrolInspectionAbnormalData();
+}

+ 20 - 0
service-ids/service-ids-biz/src/main/java/com/usky/ids/service/impl/AccessAlarmServiceImpl.java

@@ -0,0 +1,20 @@
+package com.usky.ids.service.impl;
+
+import com.usky.ids.domain.AccessAlarm;
+import com.usky.ids.mapper.AccessAlarmMapper;
+import com.usky.ids.service.AccessAlarmService;
+import com.usky.common.mybatis.core.AbstractCrudService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 报警信息表 服务实现类
+ * </p>
+ *
+ * @author han
+ * @since 2025-03-10
+ */
+@Service
+public class AccessAlarmServiceImpl extends AbstractCrudService<AccessAlarmMapper, AccessAlarm> implements AccessAlarmService {
+
+}

+ 20 - 0
service-ids/service-ids-biz/src/main/java/com/usky/ids/service/impl/AccessEntryExitRecordServiceImpl.java

@@ -0,0 +1,20 @@
+package com.usky.ids.service.impl;
+
+import com.usky.ids.domain.AccessEntryExitRecord;
+import com.usky.ids.mapper.AccessEntryExitRecordMapper;
+import com.usky.ids.service.AccessEntryExitRecordService;
+import com.usky.common.mybatis.core.AbstractCrudService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 车辆进出记录 服务实现类
+ * </p>
+ *
+ * @author han
+ * @since 2025-03-26
+ */
+@Service
+public class AccessEntryExitRecordServiceImpl extends AbstractCrudService<AccessEntryExitRecordMapper, AccessEntryExitRecord> implements AccessEntryExitRecordService {
+
+}

+ 44 - 0
service-ids/service-ids-biz/src/main/java/com/usky/ids/service/impl/IdsParkMapServiceImpl.java

@@ -0,0 +1,44 @@
+package com.usky.ids.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.usky.common.security.utils.SecurityUtils;
+import com.usky.ids.domain.IdsParkMap;
+import com.usky.ids.mapper.IdsParkMapMapper;
+import com.usky.ids.service.IdsParkMapService;
+import com.usky.common.mybatis.core.AbstractCrudService;
+import com.usky.ids.service.util.HttpClientUtils;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author han
+ * @since 2025-01-18
+ */
+@Service
+public class IdsParkMapServiceImpl extends AbstractCrudService<IdsParkMapMapper, IdsParkMap> implements IdsParkMapService {
+    @Override
+    public Object mapList(){
+        HashMap map = new HashMap();
+        map.put("key", "A10001");
+        map.put("timestamp", "20241231111111");
+        map.put("version", "v3.20.0.2");
+        map.put("sign", "f1c0a78dddb4f4591f04b32cc2151ea7");
+        String resultString = HttpClientUtils.doPost("http://172.18.0.25:8180/mpgs/api/v3/parkingLot/getParkingLotInfo",map);
+        JSONObject resultVO = JSONObject.parseObject(resultString);
+        String resultData = resultVO.get("data").toString();
+        JSONObject resultVO1 = JSONObject.parseObject(resultData);
+        Object mapList = resultVO1.get("mapList");
+        System.out.println(mapList);
+        return mapList;
+    }
+}

+ 136 - 0
service-ids/service-ids-biz/src/main/java/com/usky/ids/service/util/HttpClientUtils.java

@@ -0,0 +1,136 @@
+package com.usky.ids.service.util;
+
+import org.apache.http.NameValuePair;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.utils.URIBuilder;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.EntityUtils;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ 1. 跨域请求工具类
+ */
+public class HttpClientUtils {
+
+    public static String doGet(String url, Map<String, String> param) {
+
+        // 创建Httpclient对象
+        CloseableHttpClient httpclient = HttpClients.createDefault();
+
+        String resultString = "";
+        CloseableHttpResponse response = null;
+        try {
+            // 创建uri
+            URIBuilder builder = new URIBuilder(url);
+            if (param != null) {
+                for (String key : param.keySet()) {
+                    builder.addParameter(key, param.get(key));
+                }
+            }
+            URI uri = builder.build();
+
+            // 创建http GET请求
+            HttpGet httpGet = new HttpGet(uri);
+
+            // 执行请求
+            response = httpclient.execute(httpGet);
+            // 判断返回状态是否为200
+            if (response.getStatusLine().getStatusCode() == 200) {
+                resultString = EntityUtils.toString(response.getEntity(), "UTF-8");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (response != null) {
+                    response.close();
+                }
+                httpclient.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return resultString;
+    }
+
+    public static String doGet(String url) {
+        return doGet(url, null);
+    }
+
+    public static String doPost(String url, Map<String, String> param) {
+        // 创建Httpclient对象
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        CloseableHttpResponse response = null;
+        String resultString = "";
+        try {
+            // 创建Http Post请求
+            HttpPost httpPost = new HttpPost(url);
+            // 创建参数列表
+            if (param != null) {
+                List<NameValuePair> paramList = new ArrayList<>();
+                for (String key : param.keySet()) {
+                    paramList.add(new BasicNameValuePair(key, param.get(key)));
+                }
+                // 模拟表单
+                UrlEncodedFormEntity entity = new UrlEncodedFormEntity(paramList);
+                httpPost.setEntity(entity);
+            }
+            // 执行http请求
+            response = httpClient.execute(httpPost);
+            resultString = EntityUtils.toString(response.getEntity(), "utf-8");
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                response.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+
+        return resultString;
+    }
+
+    public static String doPost(String url) {
+        return doPost(url, null);
+    }
+
+    public static String doPostJson(String url, String json) {
+        // 创建Httpclient对象
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        CloseableHttpResponse response = null;
+        String resultString = "";
+        try {
+            // 创建Http Post请求
+            HttpPost httpPost = new HttpPost(url);
+            // 创建请求内容
+            StringEntity entity = new StringEntity(json, ContentType.APPLICATION_JSON);
+            httpPost.setEntity(entity);
+            // 执行http请求
+            response = httpClient.execute(httpPost);
+            resultString = EntityUtils.toString(response.getEntity(), "utf-8");
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                response.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+
+        return resultString;
+    }
+}

+ 25 - 0
service-ids/service-ids-biz/src/main/resources/bootstrap.yml

@@ -0,0 +1,25 @@
+# Tomcat
+server:
+  port: 9892
+
+# Spring
+spring: 
+  application:
+    # 应用名称
+    name: service-ids
+  profiles:
+    # 环境配置
+    active: dev
+  cloud:
+    nacos:
+      discovery:
+        # 服务注册地址
+        server-addr: usky-cloud-nacos:8848
+      config:
+        # 配置中心地址
+        server-addr: usky-cloud-nacos:8848
+        # 配置文件格式
+        file-extension: yml
+        # 共享配置
+        shared-configs:
+          - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

+ 94 - 0
service-ids/service-ids-biz/src/main/resources/logback.xml

@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="60 seconds" debug="false">
+    <!-- 日志存放路径 -->
+    <property name="log.path" value="/var/log/uskycloud/service-ids" />
+    <!-- 日志输出格式 -->
+    <property name="log.pattern" value="%d{MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{26}:%line: %msg%n" />
+    <!--    	<property name="log.pattern" value="%gray(%d{MM-dd HH:mm:ss.SSS}) %highlight(%-5level) &#45;&#45; [%gray(%thread)] %cyan(%logger{26}:%line): %msg%n" />-->
+
+
+    <property name="SQL_PACKAGE" value="com.usky.ids.mapper"/>
+
+    <!-- 控制台输出 -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="file_sql" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/sql.log</file>
+        <!-- 循环政策:基于时间创建日志文件 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 日志文件名格式 -->
+            <fileNamePattern>${log.path}/sql.%d{yyyy-MM-dd}.log</fileNamePattern>
+            <!-- 日志最大的历史 60天 -->
+            <maxHistory>3</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+    </appender>
+
+    <!-- 系统日志输出 -->
+    <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/info.log</file>
+        <!-- 循环政策:基于时间创建日志文件 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 日志文件名格式 -->
+            <fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
+            <!-- 日志最大的历史 60天 -->
+            <maxHistory>3</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <!-- 过滤的级别 -->
+            <level>INFO</level>
+            <!-- 匹配时的操作:接收(记录) -->
+            <onMatch>ACCEPT</onMatch>
+            <!-- 不匹配时的操作:拒绝(不记录) -->
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/error.log</file>
+        <!-- 循环政策:基于时间创建日志文件 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 日志文件名格式 -->
+            <fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
+            <!-- 日志最大的历史 60天 -->
+            <maxHistory>60</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <!-- 过滤的级别 -->
+            <level>ERROR</level>
+            <!-- 匹配时的操作:接收(记录) -->
+            <onMatch>ACCEPT</onMatch>
+            <!-- 不匹配时的操作:拒绝(不记录) -->
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <!-- 系统模块日志级别控制  -->
+    <!--	<logger name="com.usky" level="info" />-->
+    <!-- Spring日志级别控制  -->
+    <!--	<logger name="org.springframework" level="warn" />-->
+
+    <logger name="${SQL_PACKAGE}" additivity="false" level="debug">
+        <appender-ref ref="console"/>
+        <appender-ref ref="file_sql"/>
+    </logger>
+
+    <!--系统操作日志-->
+    <root level="info">
+        <appender-ref ref="file_info" />
+        <appender-ref ref="file_error" />
+        <appender-ref ref="console" />
+    </root>
+</configuration>

+ 32 - 0
service-ids/service-ids-biz/src/main/resources/mapper/ids/AccessAlarmMapper.xml

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.usky.ids.mapper.AccessAlarmMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.usky.ids.domain.AccessAlarm">
+        <id column="alarm_id" property="alarmId" />
+        <result column="alarm_level" property="alarmLevel" />
+        <result column="alarm_details" property="alarmDetails" />
+        <result column="alarm_location" property="alarmLocation" />
+        <result column="region_index_code" property="regionIndexCode" />
+        <result column="camera_name" property="cameraName" />
+        <result column="camera_index_code" property="cameraIndexCode" />
+        <result column="alarm_source_algorithm_type" property="alarmSourceAlgorithmType" />
+        <result column="alarm_photo" property="alarmPhoto" />
+        <result column="alarm_video" property="alarmVideo" />
+        <result column="alarm_type" property="alarmType" />
+        <result column="alarm_status" property="alarmStatus" />
+        <result column="process_time" property="processTime" />
+        <result column="congestion_level" property="congestionLevel" />
+        <result column="alarm_time" property="alarmTime" />
+        <result column="clean_alarm_time" property="cleanAlarmTime" />
+        <result column="create_by" property="createBy" />
+        <result column="create_time" property="createTime" />
+        <result column="update_by" property="updateBy" />
+        <result column="update_time" property="updateTime" />
+        <result column="remark" property="remark" />
+        <result column="read_status" property="readStatus" />
+        <result column="read_time" property="readTime" />
+    </resultMap>
+
+</mapper>

+ 21 - 0
service-ids/service-ids-biz/src/main/resources/mapper/ids/AccessEntryExitRecordMapper.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.usky.ids.mapper.AccessEntryExitRecordMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.usky.ids.domain.AccessEntryExitRecord">
+        <id column="id" property="id" />
+        <result column="car_color" property="carColor" />
+        <result column="license_plate" property="licensePlate" />
+        <result column="action_direction" property="actionDirection" />
+        <result column="camera_index_code" property="cameraIndexCode" />
+        <result column="camera_name" property="cameraName" />
+        <result column="record_time" property="recordTime" />
+        <result column="create_by" property="createBy" />
+        <result column="create_time" property="createTime" />
+        <result column="update_by" property="updateBy" />
+        <result column="update_time" property="updateTime" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+</mapper>

+ 16 - 0
service-ids/service-ids-biz/src/main/resources/mapper/ids/IdsParkMapMapper.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.usky.ids.mapper.IdsParkMapMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.usky.ids.domain.IdsParkMap">
+        <id column="id" property="id" />
+        <result column="map_name" property="mapName" />
+        <result column="using_count" property="usingCount" />
+        <result column="free_count" property="freeCount" />
+        <result column="update_time" property="updateTime" />
+        <result column="dept_id" property="deptId" />
+        <result column="tenant_id" property="tenantId" />
+    </resultMap>
+
+</mapper>

+ 15 - 0
service-ids/service-ids-biz/src/main/resources/smart-doc.json

@@ -0,0 +1,15 @@
+{
+  "outPath":"./src/main/resources/doc",
+  "serverUrl": "http:10.23.39.1:9887/",
+  "isStrict": false,
+  "coverOld": true,
+  "allInOne": true,
+  "packageFilters": "com.usky.iot.controller.web",
+  "requestExample":"false",
+  "responseExample":"true",
+  "projectName": "iot项目",
+  "appKey": "20211216921084883495813120",
+  "appToken":"967031b0cc6f474aaf73616cbf2b25c2",
+  "secret": "N@Pd,KXAHki*BW3=zK.XPNykf!=CM79J",
+  "openUrl": "http://101.133.214.75:7700/api"
+}

+ 3 - 3
service-iot/service-iot-api/src/main/java/com/usky/iot/RemotePmService.java → service-iot/service-iot-api/src/main/java/com/usky/iot/RemoteIotService.java

@@ -1,12 +1,12 @@
 package com.usky.iot;
 
 
-import com.usky.iot.factory.RemotePmFactory;
+import com.usky.iot.factory.RemoteIotFactory;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
 
-@FeignClient(contextId = "remoteIotService", value = "service-iot" , fallbackFactory = RemotePmFactory.class)
-public interface RemotePmService {
+@FeignClient(contextId = "remoteIotService", value = "service-iot" , fallbackFactory = RemoteIotFactory.class)
+public interface RemoteIotService {
 
     @GetMapping("/executeTimedSending")
     void executeTimedSending();

+ 0 - 2
service-iot/service-iot-api/src/main/java/com/usky/iot/RemoteIotTaskService.java

@@ -2,8 +2,6 @@ package com.usky.iot;
 
 
 import com.usky.iot.factory.RemoteIotTaskFactory;
-import com.usky.iot.factory.RemotePmFactory;
-import org.apache.ibatis.annotations.Param;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestParam;

+ 40 - 0
service-iot/service-iot-api/src/main/java/com/usky/iot/factory/RemoteIotFactory.java

@@ -0,0 +1,40 @@
+package com.usky.iot.factory;
+
+import com.usky.common.core.exception.FeignBadRequestException;
+import com.usky.iot.RemoteIotService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * 用户服务降级处理
+ *
+ * @author ruoyi
+ */
+@Component
+public class RemoteIotFactory implements FallbackFactory<RemoteIotService>
+{
+    private static final Logger log = LoggerFactory.getLogger(RemoteIotFactory.class);
+
+    @Override
+    public RemoteIotService create(Throwable throwable)
+    {
+        return new RemoteIotService()
+        {
+            @Override
+            public void executeTimedSending() {
+                log.error("工作报告定时发送异常:{}", throwable.getMessage());
+                throw new FeignBadRequestException(500,"工作报告定时发送异常"+throwable.getMessage());
+            }
+
+            @Override
+            public void reportSubmissionReminder() {
+                log.error("工作报告提交提醒发送异常:{}", throwable.getMessage());
+                throw new FeignBadRequestException(500,"工作报告提交提醒发送异常"+throwable.getMessage());
+            }
+
+        };
+    }
+}

+ 0 - 2
service-iot/service-iot-api/src/main/java/com/usky/iot/factory/RemoteIotTaskFactory.java

@@ -2,8 +2,6 @@ package com.usky.iot.factory;
 
 import com.usky.common.core.exception.FeignBadRequestException;
 import com.usky.iot.RemoteIotTaskService;
-import com.usky.iot.RemotePmService;
-import org.apache.ibatis.annotations.Param;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.cloud.openfeign.FallbackFactory;

+ 1 - 1
service-iot/service-iot-biz/src/main/java/com/usky/iot/RuoYiSystemApplication.java

@@ -36,7 +36,7 @@ import java.net.UnknownHostException;
 @ComponentScan("com.usky")
 @SpringBootApplication
 //开启异步
-@EnableAsync
+//@EnableAsync
 //@EnableRabbit
 public class RuoYiSystemApplication
 {

+ 2 - 2
service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/api/PmTimedSendingApi.java

@@ -1,6 +1,6 @@
 package com.usky.iot.controller.api;
 
-import com.usky.iot.RemotePmService;
+import com.usky.iot.RemoteIotService;
 import com.usky.iot.service.PmWorkReportService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RestController;
@@ -15,7 +15,7 @@ import java.time.LocalDateTime;
  * @author f
  */
 @RestController
-public class PmTimedSendingApi implements RemotePmService {
+public class PmTimedSendingApi implements RemoteIotService {
 
     @Autowired
     private PmWorkReportService pmWorkReportService;

+ 34 - 4
service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/web/PmTimeConfController.java

@@ -2,6 +2,8 @@ package com.usky.iot.controller.web;
 
 
 import com.usky.common.core.bean.CommonPage;
+import com.usky.common.log.annotation.Log;
+import com.usky.common.log.enums.BusinessType;
 import com.usky.common.security.utils.SecurityUtils;
 import com.usky.iot.domain.PmTimeConf;
 import com.usky.iot.domain.PmWorkReport;
@@ -9,12 +11,9 @@ import com.usky.iot.service.PmTimeConfService;
 import com.usky.iot.service.vo.PmSubmitCountResponseVO;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.*;
 
 import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
 
 import java.time.LocalDate;
 import java.time.LocalDateTime;
@@ -85,5 +84,36 @@ public class PmTimeConfController {
         return pmTimeConfService.getTimeConf(tenantId);
     }
 
+    /**
+     * 添加配置时间
+     * @param pmTimeConf 配置时间
+     */
+    @Log(title = "新增配置时间", businessType = BusinessType.INSERT)
+    @PostMapping("/addTimeConf")
+    public void addTimeConf(@RequestBody PmTimeConf pmTimeConf) {
+        pmTimeConfService.addOrUpdateTimeConf(pmTimeConf);
+    }
+
+    /**
+     * 修改配置时间
+     * @param pmTimeConf 配置时间
+     */
+    @Log(title = "修改配置时间", businessType = BusinessType.UPDATE)
+    @PutMapping("/updateTimeConf")
+    public void updateTimeConf(@RequestBody PmTimeConf pmTimeConf) {
+        pmTimeConfService.addOrUpdateTimeConf(pmTimeConf);
+    }
+
+    /**
+     * 打开或关闭提醒
+     * @param isOpen 是否开启 0:关闭 1:开启
+     * @param id 配置id
+     */
+    @PutMapping("/isOpen")
+    public void isOpen(@RequestParam(value = "isOpen") Integer isOpen,
+                       @RequestParam(value = "id") Integer id) {
+        pmTimeConfService.isOpen(isOpen, id);
+    }
+
 }
 

+ 21 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/web/VcDeviceController.java

@@ -5,10 +5,13 @@ import com.usky.common.core.bean.ApiResult;
 import com.usky.common.core.bean.CommonPage;
 import com.usky.iot.domain.BaseGgpFacility;
 import com.usky.iot.domain.VcDevice;
+import com.usky.iot.domain.VcStream;
 import com.usky.iot.service.VcDeviceService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
 import java.util.List;
 
 /**
@@ -56,6 +59,24 @@ public class VcDeviceController {
         return ApiResult.success(vcDeviceService.pageList(videoNumber, videoName, groupId, pageNum, pageSize));
     }
 
+    /**
+     * 实时拉取摄像头视频流
+     * @param deviceUuid
+     * @return
+     */
+    @GetMapping("getVcDeviceVideo")
+    public ApiResult<String> getVcDeviceVideo(@RequestParam(value = "deviceUuid") String deviceUuid) {
+        return ApiResult.success(vcDeviceService.getVcDeviceVideo(deviceUuid));
+    }
+
+    /**
+     * 停止拉取摄像头视频流
+     */
+    @GetMapping("stopDeviceVideo")
+    public void stopDeviceVideo(){
+        vcDeviceService.stopDeviceVideo();
+    }
+
     /**
      * 新增
      * @param vcDevice

+ 5 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/domain/PmTimeConf.java

@@ -83,5 +83,10 @@ public class PmTimeConf implements Serializable {
      */
     private Integer tenantId;
 
+    /**
+     * 通知人
+     */
+    private String notifier;
+
 
 }

+ 1 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/mapper/BaseFacilityTypeMapper.java

@@ -19,6 +19,7 @@ import java.util.List;
 @Repository
 public interface BaseFacilityTypeMapper extends CrudMapper<BaseFacilityType> {
     List<BaseGgpFacilityTypeNumVO> typeNumList(@Param("tenantId") Integer tenantId);
+    List<BaseGgpFacilityTypeNumVO> facilitTypeNumList();
     List<BaseGgpFacilityTypeNumVO> typeNormalNumList(@Param("tenantId") Integer tenantId);
     List<BaseGgpFacilityTypeNumVO> typeUpkeepNumList(@Param("tenantId") Integer tenantId);
     List<BaseGgpFacilityTypeNumVO> typeCloseNumList(@Param("tenantId") Integer tenantId);

+ 2 - 1
service-iot/service-iot-biz/src/main/java/com/usky/iot/mapper/PmWorkContentMapper.java

@@ -27,7 +27,8 @@ public interface PmWorkContentMapper extends CrudMapper<PmWorkContent> {
 
     List<PmProjectWorkTimeVo> workTimeCount(@Param("startTime") LocalDateTime startTime,
                                             @Param("endTime") LocalDateTime endTime,
-                                            @Param("userId") Long userId);
+                                            @Param("userId") Long userId,
+                                            @Param("tenantId") Integer tenantId);
 
 /*    List<WorkHoursStatisticsVO> workHoursStatistics(@Param("startTime") LocalDate startTime,
                                                     @Param("endTime") LocalDate endTime,

+ 13 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/PmTimeConfService.java

@@ -42,4 +42,17 @@ public interface PmTimeConfService extends CrudService<PmTimeConf> {
      * @return
      */
     public PmTimeConf getTimeConf(Integer tenantId);
+
+    /**
+     * 添加或修改报告统计时间配置
+     * @param pmTimeConf
+     */
+    public void addOrUpdateTimeConf(PmTimeConf pmTimeConf);
+
+    /**
+     * 获取迟交报告
+     * @param isOpen 是否开启(0:关闭,1:开启)
+     * @param id 配置id
+     */
+    void isOpen(Integer isOpen, Integer id);
 }

+ 5 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/VcDeviceService.java

@@ -4,6 +4,7 @@ import com.usky.common.core.bean.CommonPage;
 import com.usky.iot.domain.BaseGgpFacility;
 import com.usky.iot.domain.VcDevice;
 import com.usky.common.mybatis.core.CrudService;
+import org.springframework.web.bind.annotation.RequestBody;
 
 import java.util.List;
 
@@ -20,6 +21,10 @@ public interface VcDeviceService extends CrudService<VcDevice> {
 
     CommonPage<VcDevice> pageList(String videoNumber, String videoName, Integer groupId ,Integer pageNum, Integer pageSize);
 
+    String getVcDeviceVideo(String deviceUuid);
+
+    void stopDeviceVideo();
+
     boolean add(VcDevice vcDevice);
 
     void update(VcDevice vcDevice);

+ 69 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/config/DeviceOperate.java

@@ -0,0 +1,69 @@
+package com.usky.iot.service.config;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.usky.backend.domain.StatusVO;
+import com.usky.common.core.bean.ApiResult;
+import com.usky.demo.RemoteTsdbProxyService;
+import com.usky.iot.domain.BaseAlarm;
+import com.usky.iot.domain.DmpDeviceInfo;
+import com.usky.iot.domain.DmpDeviceStatus;
+import com.usky.iot.mapper.DmpDeviceStatusMapper;
+import com.usky.iot.service.BaseAlarmService;
+import com.usky.iot.service.DmpDeviceStatusService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.Async;
+
+import java.time.Instant;
+import java.time.LocalDateTime;
+import java.time.ZoneOffset;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+@Slf4j
+@Configuration
+public class DeviceOperate {
+    @Autowired
+    private RemoteTsdbProxyService remoteTsdbProxyService;
+
+    @Autowired
+    DmpDeviceStatusService dmpDeviceStatusService;
+
+    @Async("asyncServiceExecutor")
+    public void updateDeviceStatus(){
+        log.info("定时同步设备状态数据 start");
+        ApiResult<List<Map<String,Object>>> list = remoteTsdbProxyService.getAllDeviceRealTime();
+        List<Map<String,Object>> dataList = list.getData();
+        if(CollectionUtils.isNotEmpty(dataList)){
+            for(int i=0;i<dataList.size();i++){
+                String deviceuuid = dataList.get(i).get("device_uuid").toString();
+                LocalDateTime lTime = Instant.ofEpochMilli(Long.valueOf(dataList.get(i).get("realtime").toString())).atZone(ZoneOffset.ofHours(8)).toLocalDateTime();
+                String date =  lTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+                String currentDate = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+                LambdaUpdateWrapper<DmpDeviceStatus> updateWrapper = Wrappers.lambdaUpdate();
+                if(date.equals(currentDate)){
+                    updateWrapper.set(DmpDeviceStatus::getDeviceStatus,1)  //设备在线
+                            .set(DmpDeviceStatus::getLastOnlineTime,lTime)
+                            .eq(DmpDeviceStatus::getDeviceUuid,deviceuuid);
+
+                }else{
+                    updateWrapper.set(DmpDeviceStatus::getDeviceStatus,2)  //设备离线
+                            .set(DmpDeviceStatus::getLastOnlineTime,lTime)
+                            .eq(DmpDeviceStatus::getDeviceUuid,deviceuuid);
+
+                }
+                dmpDeviceStatusService.update(updateWrapper);
+
+            }
+
+        }
+        log.info("定时同步设备状态数据 end");
+    }
+}

+ 4 - 4
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/config/DingTalkAndMessage.java

@@ -207,8 +207,8 @@ public class DingTalkAndMessage {
         return sysUserMapper.selectOne(phoneQuery);
     }
 
-    @Async// 异步发送
-//    @Async("asyncServiceExecutor")// 异步发送
+    //@Async// 异步发送
+    @Async("asyncServiceExecutor")// 异步发送
     public void sendDingTalkDailyReport(PmWorkReport workReport, List<PmWorkContent> workContents) {
         String userName = workReport.getCreateBy();
         log.info(userName + "的工作报告开始发送钉钉-----------------------------------");
@@ -303,8 +303,8 @@ public class DingTalkAndMessage {
     }
 
 
-    @Async
-//    @Async("asyncServiceExecutor")
+    //@Async
+    @Async("asyncServiceExecutor")
     public void sendAsyncMessage(PmWorkReport newReport) {
         String username = newReport.getCreateBy();
         Long submitterId = newReport.getSubmitterId();

+ 48 - 49
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/config/ExecutorConfig.java

@@ -1,49 +1,48 @@
-//package com.usky.iot.service.config;
-//
-//import lombok.extern.slf4j.Slf4j;
-//import org.springframework.context.annotation.Bean;
-//import org.springframework.context.annotation.Configuration;
-//import org.springframework.scheduling.annotation.EnableAsync;
-//import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-//
-//import java.util.concurrent.Executor;
-//import java.util.concurrent.ThreadPoolExecutor;
-//
-//@Configuration
-//@EnableAsync
-//@Slf4j
-//public class ExecutorConfig {
-//
-//    /** 核心线程数(默认线程数) */
-//    private int corePoolSize = 10;
-//    /** 最大线程数 */
-//    private int maxPoolSize = 20;
-//    /** 允许线程空闲时间(单位:默认为秒) */
-//    private static final int keepAliveTime = 60;
-//    /** 缓冲队列大小 */
-//    private int queueCapacity = 10;
-//
-//    @Bean(name = "asyncServiceExecutor")
-//    public Executor asyncServiceExecutor(){
-//        log.info("start asyncServiceExecutor++++++++++++++++++++++");
-//        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
-//        //配置核心线程数
-//        executor.setCorePoolSize(corePoolSize);
-//        //配置最大线程数
-//        executor.setMaxPoolSize(maxPoolSize);
-//        //配置空闲时间
-//        executor.setKeepAliveSeconds(keepAliveTime);
-//        //配置队列大小
-//        executor.setQueueCapacity(queueCapacity);
-//        //配置线程前缀名
-//        executor.setThreadNamePrefix("async-service-");
-//
-//        // rejection-policy:当pool已经达到max size的时候,如何处理新任务
-//        // CALLER_RUNS:不在新线程中执行任务,而是有调用者所在的线程来执行
-//        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
-//
-//        //执行初始化
-//        executor.initialize();
-//        return executor;
-//    }
-//}
+package com.usky.iot.service.config;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+
+import java.util.concurrent.Executor;
+import java.util.concurrent.ThreadPoolExecutor;
+
+@Configuration
+@EnableAsync
+@Slf4j
+public class ExecutorConfig {
+
+   /** 核心线程数(默认线程数) */
+   private int corePoolSize = 20;
+   /** 最大线程数 */
+   private int maxPoolSize = 100;
+   /** 允许线程空闲时间(单位:默认为秒) */
+   private static final int keepAliveTime = 60;
+   /** 缓冲队列大小 */
+   private int queueCapacity = 100;
+
+   @Bean(name = "asyncServiceExecutor")
+   public Executor asyncServiceExecutor(){
+       ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
+       //配置核心线程数
+       executor.setCorePoolSize(corePoolSize);
+       //配置最大线程数
+       executor.setMaxPoolSize(maxPoolSize);
+       //配置空闲时间
+       executor.setKeepAliveSeconds(keepAliveTime);
+       //配置队列大小
+       executor.setQueueCapacity(queueCapacity);
+       //配置线程前缀名
+       executor.setThreadNamePrefix("async-service-");
+
+       // rejection-policy:当pool已经达到max size的时候,如何处理新任务
+       // CALLER_RUNS:不在新线程中执行任务,而是有调用者所在的线程来执行
+       executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
+
+       //执行初始化
+       executor.initialize();
+       return executor;
+   }
+}

+ 126 - 119
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/BaseAlarmServiceImpl.java

@@ -14,9 +14,6 @@ import com.usky.common.core.bean.ApiResult;
 import com.usky.common.core.bean.CommonPage;
 import com.usky.common.core.exception.BusinessException;
 import com.usky.common.security.utils.SecurityUtils;
-import com.usky.demo.RemoteTsdbProxyService;
-import com.usky.demo.domain.LastInnerQueryVO;
-import com.usky.demo.domain.LastInnerResultVO;
 import com.usky.iot.domain.*;
 import com.usky.iot.mapper.BaseAlarmMapper;
 import com.usky.iot.mapper.DmpDeviceTypeMapper;
@@ -30,6 +27,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
@@ -72,9 +70,6 @@ public class BaseAlarmServiceImpl extends AbstractCrudService<BaseAlarmMapper, B
     @Autowired
     private DataQueryClient dataQueryClient;
 
-    @Autowired
-    private RemoteTsdbProxyService remoteTsdbProxyService;
-
     @Autowired
     private DmpDeviceStatusService dmpDeviceStatusService;
 
@@ -197,75 +192,85 @@ public class BaseAlarmServiceImpl extends AbstractCrudService<BaseAlarmMapper, B
 
     public CommonPage<BaseAlarm> page(BaseAlarmListVO baseAlarmListVO){
         List<BaseAlarm> list = new ArrayList<>();
-        IPage<BaseAlarm> page = new Page<>(baseAlarmListVO.getCurrent(), baseAlarmListVO.getSize());
-        LambdaQueryWrapper<BaseAlarm> queryWrapper = Wrappers.lambdaQuery();
-        queryWrapper.eq(StringUtils.isNotBlank(baseAlarmListVO.getDeviceId()),BaseAlarm::getDeviceId,baseAlarmListVO.getDeviceId())
-                .eq(StringUtils.isNotBlank(baseAlarmListVO.getProductCode()),BaseAlarm::getProductCode,baseAlarmListVO.getProductCode())
-                .in(CollectionUtils.isNotEmpty(baseAlarmListVO.getAlarmType()),BaseAlarm::getAlarmType,
-                        baseAlarmListVO.getAlarmType())
-                .eq(null != baseAlarmListVO.getHandleStatus(),BaseAlarm::getHandleStatus,baseAlarmListVO.getHandleStatus())
-                .between(StringUtils.isNotBlank(baseAlarmListVO.getStartTime()) && StringUtils.isNotBlank(baseAlarmListVO.getEndTime()),BaseAlarm::getAlarmTime,baseAlarmListVO.getStartTime(),baseAlarmListVO.getEndTime())
-                .eq(BaseAlarm::getTenantId,SecurityUtils.getTenantId())
-                .eq(Objects.nonNull(baseAlarmListVO.getId()),BaseAlarm::getId,baseAlarmListVO.getId());
-        if (StringUtils.isNotBlank(baseAlarmListVO.getTypeCode())){
-            if (baseAlarmListVO.getTypeCode().equals("1")){
-                queryWrapper.eq(BaseAlarm::getAlarmGrade,1)
-                        .orderByDesc(BaseAlarm::getId);
-            }else if (baseAlarmListVO.getTypeCode().equals("2")){
-                queryWrapper.ne(BaseAlarm::getAlarmGrade,1)
-                        .orderByDesc(BaseAlarm::getId);
+
+        List<String> devIdList = new ArrayList<>();
+        LambdaQueryWrapper<DmpDeviceInfo> queryWrapper1 = Wrappers.lambdaQuery();
+        queryWrapper1.eq(DmpDeviceInfo::getTenantId,SecurityUtils.getTenantId())
+                .eq(DmpDeviceInfo::getDeleteFlag,0);
+        List<DmpDeviceInfo> deviceInfo = dmpDeviceInfoService.list(queryWrapper1);
+        if(CollectionUtils.isNotEmpty(deviceInfo)){
+            for(int j=0;j<deviceInfo.size();j++){
+                devIdList.add(deviceInfo.get(j).getDeviceId());
             }
-        }else {
-            queryWrapper.orderByDesc(BaseAlarm::getId);
         }
-        page = this.page(page,queryWrapper);
-//        List<BaseAlarm> records = this.list(queryWrapper);
-        if(page.getRecords().size()>0){
-            List<String> devList = new ArrayList<>();
-            for(int i=0;i<page.getRecords().size();i++){
-                devList.add(page.getRecords().get(i).getDeviceId());
+
+        IPage<BaseAlarm> page = new Page<>(baseAlarmListVO.getCurrent(), baseAlarmListVO.getSize());
+        if(CollectionUtils.isNotEmpty(devIdList)){
+            LambdaQueryWrapper<BaseAlarm> queryWrapper = Wrappers.lambdaQuery();
+            queryWrapper.in(BaseAlarm::getDeviceId,devIdList)
+                    .eq(StringUtils.isNotBlank(baseAlarmListVO.getDeviceId()),BaseAlarm::getDeviceId,baseAlarmListVO.getDeviceId())
+                    .eq(StringUtils.isNotBlank(baseAlarmListVO.getProductCode()),BaseAlarm::getProductCode,baseAlarmListVO.getProductCode())
+                    .in(CollectionUtils.isNotEmpty(baseAlarmListVO.getAlarmType()),BaseAlarm::getAlarmType,
+                            baseAlarmListVO.getAlarmType())
+                    .eq(null != baseAlarmListVO.getHandleStatus(),BaseAlarm::getHandleStatus,baseAlarmListVO.getHandleStatus())
+                    .between(StringUtils.isNotBlank(baseAlarmListVO.getStartTime()) && StringUtils.isNotBlank(baseAlarmListVO.getEndTime()),BaseAlarm::getAlarmTime,baseAlarmListVO.getStartTime(),baseAlarmListVO.getEndTime())
+                    .eq(BaseAlarm::getTenantId,SecurityUtils.getTenantId())
+                    .eq(Objects.nonNull(baseAlarmListVO.getId()),BaseAlarm::getId,baseAlarmListVO.getId());
+            if (StringUtils.isNotBlank(baseAlarmListVO.getTypeCode())){
+                if (baseAlarmListVO.getTypeCode().equals("1")){
+                    queryWrapper.eq(BaseAlarm::getAlarmGrade,1)
+                            .orderByDesc(BaseAlarm::getId);
+                }else if (baseAlarmListVO.getTypeCode().equals("2")){
+                    queryWrapper.ne(BaseAlarm::getAlarmGrade,1)
+                            .orderByDesc(BaseAlarm::getId);
+                }
+            }else {
+                queryWrapper.orderByDesc(BaseAlarm::getId);
             }
+            page = this.page(page,queryWrapper);
+//        List<BaseAlarm> records = this.list(queryWrapper);
+            if(page.getRecords().size()>0){
+                List<String> devList = new ArrayList<>();
+                for(int i=0;i<page.getRecords().size();i++){
+                    devList.add(page.getRecords().get(i).getDeviceId());
+                }
 
-            if(devList.size() > 0){
-                LambdaQueryWrapper<DmpDeviceInfo> queryWrapper1 = Wrappers.lambdaQuery();
-                queryWrapper1.in(DmpDeviceInfo::getDeviceId,devList)
-                        .eq(DmpDeviceInfo::getTenantId,SecurityUtils.getTenantId())
-                        .eq(DmpDeviceInfo::getDeleteFlag,0);
-                List<DmpDeviceInfo> deviceInfo = dmpDeviceInfoService.list(queryWrapper1);
-                LambdaQueryWrapper<BaseFacilityDevice> lambdaQuery1 = Wrappers.lambdaQuery();
-                lambdaQuery1.in(BaseFacilityDevice::getDeviceId,devList);
-                List<BaseFacilityDevice> records1 = baseFacilityDeviceService.list(lambdaQuery1);
-                if(CollectionUtils.isNotEmpty(deviceInfo)){
-                    for(int i=0;i<page.getRecords().size();i++){
-                        for(int j=0;j<deviceInfo.size();j++){
-                            if(page.getRecords().get(i).getDeviceId().equals(deviceInfo.get(j).getDeviceId())){
-                                page.getRecords().get(i).setDeviceName(deviceInfo.get(j).getDeviceName());
-                                page.getRecords().get(i).setDeviceType(deviceInfo.get(j).getDeviceType());
-                                break;
+                if(devList.size() > 0){
+                    LambdaQueryWrapper<BaseFacilityDevice> lambdaQuery1 = Wrappers.lambdaQuery();
+                    lambdaQuery1.in(BaseFacilityDevice::getDeviceId,devList);
+                    List<BaseFacilityDevice> records1 = baseFacilityDeviceService.list(lambdaQuery1);
+                    if(CollectionUtils.isNotEmpty(deviceInfo)){
+                        for(int i=0;i<page.getRecords().size();i++){
+                            for(int j=0;j<deviceInfo.size();j++){
+                                if(page.getRecords().get(i).getDeviceId().equals(deviceInfo.get(j).getDeviceId())){
+                                    page.getRecords().get(i).setDeviceName(deviceInfo.get(j).getDeviceName());
+                                    page.getRecords().get(i).setDeviceType(deviceInfo.get(j).getDeviceType());
+                                    break;
+                                }
                             }
-                        }
-                        for(int k=0;k<records1.size();k++){
-                            if(page.getRecords().get(i).getDeviceId().equals(records1.get(k).getDeviceId())){
-                                page.getRecords().get(i).setFacilityId(records1.get(k).getFacilityId());
-                                break;
+                            for(int k=0;k<records1.size();k++){
+                                if(page.getRecords().get(i).getDeviceId().equals(records1.get(k).getDeviceId())){
+                                    page.getRecords().get(i).setFacilityId(records1.get(k).getFacilityId());
+                                    break;
+                                }
                             }
                         }
                     }
                 }
-            }
 
-            List<BaseAlarmType> alarmTypeList = baseMapper.getAlarmTypeList();
-            if(CollectionUtils.isNotEmpty(alarmTypeList)){
-                for(int i=0;i<page.getRecords().size();i++){
-                    for(int j=0;j<alarmTypeList.size();j++){
-                        if(page.getRecords().get(i).getAlarmType().equals(alarmTypeList.get(j).getTypeCode())){
-                            page.getRecords().get(i).setTypeImg(alarmTypeList.get(j).getTypeImg());
-                            break;
+                List<BaseAlarmType> alarmTypeList = baseMapper.getAlarmTypeList();
+                if(CollectionUtils.isNotEmpty(alarmTypeList)){
+                    for(int i=0;i<page.getRecords().size();i++){
+                        for(int j=0;j<alarmTypeList.size();j++){
+                            if(page.getRecords().get(i).getAlarmType().equals(alarmTypeList.get(j).getTypeCode())){
+                                page.getRecords().get(i).setTypeImg(alarmTypeList.get(j).getTypeImg());
+                                break;
+                            }
                         }
                     }
                 }
-            }
 
+            }
         }
 
         if(StringUtils.isNotBlank(baseAlarmListVO.getDeviceName())){
@@ -624,9 +629,67 @@ public class BaseAlarmServiceImpl extends AbstractCrudService<BaseAlarmMapper, B
         }
     }
 
+    @Async("asyncServiceExecutor")
+    public void deviceAlarm(List<StatusVO> list, List<DmpDeviceInfo> devInfoList, List<BaseAlarm> baseUnAlarmList){
+        log.info("定时同步设备告警数据 start");
+        if(CollectionUtils.isNotEmpty(devInfoList)){
+            for(int i=0;i<list.size();i++){
+                String currentDate = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+                if(Objects.nonNull(list.get(i).getTime()) && currentDate.equals(list.get(i).getTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))){
+                    //设备离线告警恢复在线自动默认处理
+                    if(CollectionUtils.isNotEmpty(baseUnAlarmList)){
+                        for(int j=0;j<baseUnAlarmList.size();j++){
+                            if(list.get(i).getDeviceId().equals(baseUnAlarmList.get(j).getDeviceId()) && list.get(i).getProductCode().equals(baseUnAlarmList.get(j).getProductCode())){
+                                LambdaUpdateWrapper<BaseAlarm> updateWrapper1 = Wrappers.lambdaUpdate();
+                                updateWrapper1.set(BaseAlarm::getHandleStatus,1)
+                                        .set(BaseAlarm::getHandleBy,"YT_admin")
+                                        .set(BaseAlarm::getHandleTime,LocalDateTime.now())
+                                        .eq(BaseAlarm::getDeviceId,list.get(i).getDeviceId())
+                                        .eq(BaseAlarm::getHandleStatus,0)
+                                        .eq(BaseAlarm::getProductCode,list.get(i).getProductCode());
+                                this.update(updateWrapper1);
+                                break;
+                            }
+                        }
+                    }
+
+                }else{
+
+                    for(int j=0;j<devInfoList.size();j++){
+                        if(list.get(i).getDeviceId().equals(devInfoList.get(j).getDeviceId()) && list.get(i).getProductCode().equals(devInfoList.get(j).getProductCode())){
+                            int count = 0;
+                            for(int k=0;k<baseUnAlarmList.size();k++){
+                                if(list.get(i).getDeviceId().equals(baseUnAlarmList.get(k).getDeviceId()) && list.get(i).getProductCode().equals(baseUnAlarmList.get(k).getProductCode())){
+                                    count++;
+                                }
+                            }
+                            if(count == 0){
+                                BaseAlarm baseAlarm = new BaseAlarm();
+                                baseAlarm.setDeviceId(list.get(i).getDeviceId());
+                                baseAlarm.setAlarmTime(LocalDateTime.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH"))+":00:00",DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+                                baseAlarm.setAlarmType("001");
+                                baseAlarm.setAlarmObject(devInfoList.get(j).getDeviceName());
+                                baseAlarm.setAlarmData("");
+                                baseAlarm.setAlarmAttribute("离线告警");
+                                baseAlarm.setAlarmContent("设备离线告警");
+                                baseAlarm.setAlarmGrade(1);
+
+                                baseAlarm.setAlarmAddress(devInfoList.get(j).getInstallAddress());
+                                baseAlarm.setProductCode(devInfoList.get(j).getProductCode());
+                                this.add(baseAlarm);
+                            }
+                            break;
+                        }
+                    }
+
+                }
+            }
+        }
+        log.info("定时同步设备告警数据 end");
+    }
+
     @Override
     public void deviceOffLineAlarm(){
-        log.info("定时同步设备告警数据 start");
         List<StatusVO> list = new ArrayList<>();
         List<String> devList = new ArrayList<>();
         LambdaQueryWrapper<DmpDeviceStatus> queryWrapper = Wrappers.lambdaQuery();
@@ -646,69 +709,13 @@ public class BaseAlarmServiceImpl extends AbstractCrudService<BaseAlarmMapper, B
         if(CollectionUtils.isNotEmpty(list)){
             List<DmpDeviceInfo> devInfoList = new ArrayList<>();
             List<BaseAlarm> baseUnAlarmList = new ArrayList<>();
-//            List<BaseAlarm> baseAlarmList = new ArrayList<>();
             if(devList.size() > 0) {
                 devInfoList = baseMapper.getDeviceInfoList(devList);
                 baseUnAlarmList = baseMapper.getUnDeviceAlarmList(devList);
-//                baseAlarmList = baseMapper.getDeviceAlarmList(devList);
-            }
-
-            if(CollectionUtils.isNotEmpty(devInfoList)){
-                for(int i=0;i<list.size();i++){
-                    String currentDate = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
-                    if(Objects.nonNull(list.get(i).getTime()) && currentDate.equals(list.get(i).getTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))){
-                        //设备离线告警恢复在线自动默认处理
-                        if(CollectionUtils.isNotEmpty(baseUnAlarmList)){
-                            for(int j=0;j<baseUnAlarmList.size();j++){
-                                if(list.get(i).getDeviceId().equals(baseUnAlarmList.get(j).getDeviceId()) && list.get(i).getProductCode().equals(baseUnAlarmList.get(j).getProductCode())){
-                                    LambdaUpdateWrapper<BaseAlarm> updateWrapper1 = Wrappers.lambdaUpdate();
-                                    updateWrapper1.set(BaseAlarm::getHandleStatus,1)
-                                            .set(BaseAlarm::getHandleBy,"YT_admin")
-                                            .set(BaseAlarm::getHandleTime,LocalDateTime.now())
-                                            .eq(BaseAlarm::getDeviceId,list.get(i).getDeviceId())
-                                            .eq(BaseAlarm::getHandleStatus,0)
-                                            .eq(BaseAlarm::getProductCode,list.get(i).getProductCode());
-                                    this.update(updateWrapper1);
-                                    break;
-                                }
-                            }
-                        }
-
-                    }else{
-
-                        for(int j=0;j<devInfoList.size();j++){
-                            if(list.get(i).getDeviceId().equals(devInfoList.get(j).getDeviceId()) && list.get(i).getProductCode().equals(devInfoList.get(j).getProductCode())){
-                                int count = 0;
-                                for(int k=0;k<baseUnAlarmList.size();k++){
-                                    if(list.get(i).getDeviceId().equals(baseUnAlarmList.get(k).getDeviceId()) && list.get(i).getProductCode().equals(baseUnAlarmList.get(k).getProductCode())){
-                                        count++;
-                                    }
-                                }
-                                if(count == 0){
-                                    BaseAlarm baseAlarm = new BaseAlarm();
-                                    baseAlarm.setDeviceId(list.get(i).getDeviceId());
-                                    baseAlarm.setAlarmTime(LocalDateTime.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH"))+":00:00",DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
-                                    baseAlarm.setAlarmType("001");
-                                    baseAlarm.setAlarmObject(devInfoList.get(j).getDeviceName());
-                                    baseAlarm.setAlarmData("");
-                                    baseAlarm.setAlarmAttribute("离线告警");
-                                    baseAlarm.setAlarmContent("设备离线告警");
-                                    baseAlarm.setAlarmGrade(1);
-
-                                    baseAlarm.setAlarmAddress(devInfoList.get(j).getInstallAddress());
-                                    baseAlarm.setProductCode(devInfoList.get(j).getProductCode());
-                                    this.add(baseAlarm);
-                                }
-                                break;
-                            }
-                        }
-
-                    }
-                }
             }
 
+            this.deviceAlarm(list,devInfoList,baseUnAlarmList);
         }
-        log.info("定时同步设备告警数据 end");
     }
 
     @Override

+ 0 - 1
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/BaseBuildServiceImpl.java

@@ -22,7 +22,6 @@ import com.usky.iot.service.vo.BuildFacilityStatusVO;
 import org.apache.tomcat.jni.Local;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import sun.security.util.Length;
 
 import java.text.SimpleDateFormat;
 import java.time.LocalDateTime;

+ 12 - 4
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/BaseGgpFacilityServiceImpl.java

@@ -149,13 +149,11 @@ public class BaseGgpFacilityServiceImpl extends AbstractCrudService<BaseGgpFacil
         if (CollectionUtils.isNotEmpty(baseGgpFacilityList)) {
             for (int i = 0; i < baseGgpFacilityList.size(); i++) {
                 BaseGgpFacilityExportVo baseGgpFacilityExportVo = new BaseGgpFacilityExportVo();
-                baseGgpFacilityExportVo.setXh(i + 1);
-                baseGgpFacilityExportVo.setId(baseGgpFacilityList.get(i).getId());
                 baseGgpFacilityExportVo.setFacilityNum(baseGgpFacilityList.get(i).getFacilityNum());
                 baseGgpFacilityExportVo.setFacilityType("未知");
                 if (CollectionUtils.isNotEmpty(typeList)) {
                     for (int j = 0; j < typeList.size(); j++) {
-                        if (baseGgpFacilityList.get(i).getFacilityType().equals(typeList.get(j).getId())) {
+                        if (baseGgpFacilityList.get(i).getFacilityType().equals(typeList.get(j).getTypeCode())) {
                             baseGgpFacilityExportVo.setFacilityType(typeList.get(j).getTypeName());
                         }
                     }
@@ -166,7 +164,9 @@ public class BaseGgpFacilityServiceImpl extends AbstractCrudService<BaseGgpFacil
                 baseGgpFacilityExportVo.setImagesUrl(baseGgpFacilityList.get(i).getImagesUrl());
                 baseGgpFacilityExportVo.setContact(baseGgpFacilityList.get(i).getContact());
                 baseGgpFacilityExportVo.setContactPhone(baseGgpFacilityList.get(i).getContactPhone());
-                baseGgpFacilityExportVo.setStatus(baseGgpFacilityList.get(i).getFacilityStatus());
+                baseGgpFacilityExportVo.setFacilityStatus(baseGgpFacilityList.get(i).getFacilityStatus());
+                baseGgpFacilityExportVo.setLongitude(baseGgpFacilityList.get(i).getLongitude());
+                baseGgpFacilityExportVo.setLatitude(baseGgpFacilityList.get(i).getLatitude());
                 baseGgpFacilityExportVo.setCreateTime(baseGgpFacilityList.get(i).getCreateTime().format(df));
                 list.add(baseGgpFacilityExportVo);
             }
@@ -435,6 +435,14 @@ public class BaseGgpFacilityServiceImpl extends AbstractCrudService<BaseGgpFacil
                 int rot=3;
                 for (FacilityImportVo facilityImportVo:facilityImportVos) {
                     BaseGgpFacility baseGgpFacility = BeanMapperUtils.map(facilityImportVo, BaseGgpFacility.class);
+                    List<BaseGgpFacilityTypeNumVO> typeList = baseFacilityTypeMapper.facilitTypeNumList();
+                    if (CollectionUtils.isNotEmpty(typeList)) {
+                        for (int j = 0; j < typeList.size(); j++) {
+                            if (baseGgpFacility.getFacilityType().equals(typeList.get(j).getTypeName())) {
+                                baseGgpFacility.setFacilityType(typeList.get(j).getTypeCode());
+                            }
+                        }
+                    }
                     if (StringUtils.isBlank(baseGgpFacility.getFacilityType())||StringUtils.isBlank(baseGgpFacility.getFacilityName())||StringUtils.isBlank(baseGgpFacility.getAddress())||StringUtils.isBlank(baseGgpFacility.getLatitude())||StringUtils.isBlank(baseGgpFacility.getLongitude())){
 
                         String tmp = ",第"+rot+"行数据导入失败,必填字段不能为空";

+ 9 - 46
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/DmpDeviceInfoServiceImpl.java

@@ -40,16 +40,17 @@ import com.usky.iot.service.BaseFacilityDeviceService;
 import com.usky.iot.service.DmpDeviceInfoService;
 import com.usky.iot.service.DmpDeviceStatusService;
 import com.usky.iot.service.DmpProductAttributeService;
+import com.usky.iot.service.config.DeviceOperate;
 import com.usky.iot.service.enums.TopicInfo;
 import com.usky.iot.service.vo.*;
 import com.usky.transfer.RemoteTransferService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 import org.springframework.web.multipart.MultipartFile;
-import sun.net.dns.ResolverConfiguration;
 
 import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletResponse;
@@ -97,6 +98,9 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
 	@Autowired
     private DmpProductAttributeMapper dmpProductAttributeMapper;
 
+    @Autowired
+    private DeviceOperate deviceOperate;
+
     private static final String ALARM_HTTP_URL = "/service-alarm/baseAlarm/alarmInfo";
 
 
@@ -425,50 +429,9 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
 
     @Override
     public void deviceStatus(){
-        log.info("定时同步设备状态数据 start");
-        LastInnerQueryVO queryVO = new LastInnerQueryVO();
-        List<String> deviceuuidList = new ArrayList<>();
-        LambdaQueryWrapper<DmpDeviceInfo> queryWrapper = Wrappers.lambdaQuery();
-        queryWrapper.select(DmpDeviceInfo::getDeviceUuid)
-                .eq(DmpDeviceInfo::getDeleteFlag,0)
-                .ne(DmpDeviceInfo::getServiceStatus,3)
-                .orderByDesc(DmpDeviceInfo::getId);
-        List<DmpDeviceInfo> devList = this.list(queryWrapper);
-        if(CollectionUtils.isNotEmpty(devList)){
-            int count = devList.size();
-            for (int i = 0; i < devList.size(); i++) {
-                deviceuuidList.add(devList.get(i).getDeviceUuid());
-            }
-        }
-        queryVO.setDeviceuuid(deviceuuidList);
-
-        List<LastInnerResultVO> list = remoteTsdbProxyService.last(queryVO);
-        if(CollectionUtils.isNotEmpty(list)){
-            for(int i=0;i<list.size();i++){
-                if(Objects.nonNull(list.get(i).getMetrics())){
-                    String deviceuuid = list.get(i).getDeviceuuid();
-                    LocalDateTime lTime = Instant.ofEpochMilli(Long.valueOf(list.get(i).getMetrics().get("time").toString())).atZone(ZoneOffset.ofHours(8)).toLocalDateTime();
-                    String date =  lTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
-                    String currentDate = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
-                    LambdaUpdateWrapper<DmpDeviceStatus> updateWrapper = Wrappers.lambdaUpdate();
-                    if(date.equals(currentDate)){
-                        updateWrapper.set(DmpDeviceStatus::getDeviceStatus,1)  //设备在线
-                                .set(DmpDeviceStatus::getLastOnlineTime,lTime)
-                                .eq(DmpDeviceStatus::getDeviceUuid,deviceuuid);
-
-                    }else{
-                        updateWrapper.set(DmpDeviceStatus::getDeviceStatus,2)  //设备离线
-                                .set(DmpDeviceStatus::getLastOnlineTime,lTime)
-                                .eq(DmpDeviceStatus::getDeviceUuid,deviceuuid);
-
-                    }
-                    dmpDeviceStatusService.update(updateWrapper);
-                }
-
-            }
-
-        }
-        log.info("定时同步设备状态数据 end");
+        log.info("设备状态 start");
+        deviceOperate.updateDeviceStatus();
+        log.info("设备状态 end");
     }
 
     @Override
@@ -478,7 +441,7 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
             for(int i=0;i<list.size();i++){
                 if(Objects.nonNull(list.get(i).getMetrics())){
                     String deviceuuid = list.get(i).getDeviceuuid();
-                    LocalDateTime lTime = Instant.ofEpochMilli(Long.valueOf(list.get(i).getMetrics().get("time").toString())).atZone(ZoneOffset.ofHours(8)).toLocalDateTime();
+                    LocalDateTime lTime = Instant.ofEpochMilli(Long.valueOf(list.get(i).getMetrics().get("realtime").toString())).atZone(ZoneOffset.ofHours(8)).toLocalDateTime();
                     String date =  lTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
                     String currentDate = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
                     LambdaUpdateWrapper<DmpDeviceStatus> updateWrapper = Wrappers.lambdaUpdate();

+ 11 - 26
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/PmProjectServiceImpl.java

@@ -75,7 +75,7 @@ public class PmProjectServiceImpl extends AbstractCrudService<PmProjectMapper, P
         String projectName = project.getProjectName();
         if (StringUtils.isBlank(projectName)) {
             throw new BusinessException("项目名称不能为空!");
-        }else if (projectName.length() > 50) {
+        } else if (projectName.length() > 50) {
             throw new BusinessException("项目名称长度不能超过50个字符!");
         }
 
@@ -88,7 +88,7 @@ public class PmProjectServiceImpl extends AbstractCrudService<PmProjectMapper, P
         Integer projectType = project.getProjectType();
         if (projectType == null) {
             throw new BusinessException("项目类型不能为空且");
-        }else if (projectType < 1 || projectType > 6) {
+        } else if (projectType < 1 || projectType > 6) {
             throw new BusinessException("项目类型传参有误!");
         }
 
@@ -96,7 +96,7 @@ public class PmProjectServiceImpl extends AbstractCrudService<PmProjectMapper, P
         Integer projectStatus = project.getProjectStatus();
         if (projectStatus == null) {
             throw new BusinessException("项目状态不能为空且!");
-        }else if (projectStatus < 1 || projectStatus > 5) {
+        } else if (projectStatus < 1 || projectStatus > 5) {
             throw new BusinessException("项目状态传参有误!");
         }
 
@@ -249,43 +249,26 @@ public class PmProjectServiceImpl extends AbstractCrudService<PmProjectMapper, P
 
         LambdaQueryWrapper<PmProject> lambdaQuery = Wrappers.lambdaQuery();
         lambdaQuery.eq(PmProject::getTenantId, tenantId)
-                .eq(PmProject::getDelFlag, 0)
-                .eq(visibleRange != null, PmProject::getVisibleRange, visibleRange);
+                .eq(PmProject::getDelFlag, 0);
 
         if (projectId != null && projectId != 0) {
             lambdaQuery.eq(PmProject::getId, projectId);
-            page = this.page(page, lambdaQuery);
-            return new CommonPage<>(page.getRecords(), page.getTotal(), pageSize, pageNum);
         }
 
         switch (projectAscription) {
             case 0:
-                if (StringUtils.isNotBlank(projectName) || projectType != null || projectStatus != null) {
-                    lambdaQuery.eq(PmProject::getDelFlag, 0)
-                            .like(StringUtils.isNotBlank(projectName), PmProject::getProjectName, projectName)
-                            .eq(projectType != null, PmProject::getProjectType, projectType)
-                            .eq(projectStatus != null, PmProject::getProjectStatus, projectStatus)
+                if (visibleRange == null) {
+                    lambdaQuery.and(wrapper -> wrapper
                             .and(qw -> qw
                                     .eq(PmProject::getProjectHead, userId)
                                     .or()
                                     .apply("FIND_IN_SET('" + userId + "', project_member) > 0")
                                     .or()
-                                    .eq(PmProject::getCreateBy, username));
-                }
-                if (visibleRange == null) {
-                    lambdaQuery.eq(PmProject::getDelFlag, 0)
-                            .and(wrapper -> wrapper
-                                    .eq(PmProject::getVisibleRange, 2)
-                                    .and(qw -> qw
-                                            .eq(PmProject::getProjectHead, userId)
-                                            .or()
-                                            .apply("FIND_IN_SET('" + userId + "', project_member) > 0")
-                                            .or()
-                                            .eq(PmProject::getCreateBy, username))
+                                    .eq(PmProject::getCreateBy, username)
                             )
                             .or()
                             .eq(PmProject::getVisibleRange, 1)
-                            .eq(PmProject::getDelFlag, 0);
+                    );
                 } else if (visibleRange == 2) {
                     lambdaQuery.and(wrapper -> wrapper
                             .eq(PmProject::getProjectHead, userId)
@@ -314,7 +297,9 @@ public class PmProjectServiceImpl extends AbstractCrudService<PmProjectMapper, P
             default:
                 throw new BusinessException("查询项目列表参数错误");
         }
-        lambdaQuery.orderByDesc(PmProject::getCreateTime);
+
+        lambdaQuery.eq(visibleRange != null, PmProject::getVisibleRange, visibleRange)
+                .orderByDesc(PmProject::getCreateTime);
         List<PmProject> pmProjects = pmProjectMapper.selectList(lambdaQuery);
         if (pmProjects.isEmpty()) {
             return new CommonPage<>(pmProjects, 0, pageSize, pageNum);

+ 77 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/PmTimeConfServiceImpl.java

@@ -15,6 +15,7 @@ import com.usky.common.mybatis.core.AbstractCrudService;
 import com.usky.iot.service.vo.PmReportReadersVO;
 import com.usky.iot.service.vo.PmSubmitCountResponseVO;
 import com.usky.system.domain.SysUser;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -313,6 +314,82 @@ public class PmTimeConfServiceImpl extends AbstractCrudService<PmTimeConfMapper,
         return pmTimeConfMapper.selectOne(timeConfQuery);
     }
 
+    @Override
+    public void addOrUpdateTimeConf(PmTimeConf pmTimeConf) {
+        String username = SecurityUtils.getUsername();
+        Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
+        LocalDateTime now = LocalDateTime.now();
+        if (pmTimeConf.getId() == null) {
+            Integer tenantId = SecurityUtils.getTenantId();
+            verificationTimeConf(pmTimeConf);
+            pmTimeConf.setTenantId(tenantId);
+            pmTimeConf.setCreateBy(username);
+            pmTimeConf.setCreateTime(now);
+            pmTimeConf.setDeptId(deptId);
+            pmTimeConfMapper.insert(pmTimeConf);
+        } else {
+            verificationTimeConf(pmTimeConf);
+            pmTimeConf.setUpdateBy(username);
+            pmTimeConf.setUpdateTime(now);
+            pmTimeConfMapper.updateById(pmTimeConf);
+        }
+    }
+
+    @Override
+    public void isOpen(Integer isOpen, Integer id) {
+        Long userId = SecurityUtils.getUserId();
+        String username = SecurityUtils.getUsername();
+        LocalDateTime now = LocalDateTime.now();
+        PmTimeConf pmTimeConf = pmTimeConfMapper.selectById(id);
+        if (pmTimeConf == null){
+            throw new BusinessException("配置不存在!联系管理员后重试");
+        }
+
+        if (isOpen == 1) {
+            pmTimeConf.setNotifier(pmTimeConf.getNotifier() + "," + userId);
+        } else if (isOpen == 0) {
+            pmTimeConf.setNotifier(pmTimeConf.getNotifier().replace("," + userId, ""));
+        } else {
+            throw new BusinessException("参数异常,报告提醒开关操作失败!");
+        }
+
+        pmTimeConf.setUpdateBy(username);
+        pmTimeConf.setUpdateTime(now);
+        pmTimeConfMapper.updateById(pmTimeConf);
+    }
+
+    private void verificationTimeConf(PmTimeConf pmTimeConf) {
+        if (StringUtils.isBlank(pmTimeConf.getConfName())) {
+            throw new BusinessException("配置名称不能为空!");
+        } else if (pmTimeConf.getConfName().length() > 64) {
+            throw new BusinessException("配置名称长度不能超过64个字符!");
+        }
+
+        if (StringUtils.isBlank(pmTimeConf.getConfType())) {
+            throw new BusinessException("配置类型不能为空!");
+        } else if (pmTimeConf.getConfType().length() > 64) {
+            throw new BusinessException("配置类型长度不能超过64个字符!");
+        }
+
+        if (pmTimeConf.getStartTime() == null) {
+            throw new BusinessException("开始时间不能为空!");
+        } else if (pmTimeConf.getStartTime().isAfter(pmTimeConf.getEndTime())) {
+            throw new BusinessException("开始时间不能大于结束时间!");
+        }
+
+        if (pmTimeConf.getEndTime() == null) {
+            throw new BusinessException("结束时间不能为空!");
+        } else if (pmTimeConf.getEndTime().isBefore(pmTimeConf.getStartTime())) {
+            throw new BusinessException("结束时间不能小于开始时间!");
+        }
+
+        if (pmTimeConf.getOnTime() == null) {
+            throw new BusinessException("准时时间不能为空!");
+        } else if (pmTimeConf.getOnTime().isBefore(pmTimeConf.getStartTime()) || pmTimeConf.getOnTime().isAfter(pmTimeConf.getEndTime())) {
+            throw new BusinessException("准时时间必须在开始时间和结束时间之间!");
+        }
+    }
+
     // 查询用户信息
     private List<SysUser> users(Integer tenantId) {
         LambdaQueryWrapper<SysUser> userQuery = new LambdaQueryWrapper<>();

+ 21 - 11
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/PmWorkContentServiceImpl.java

@@ -465,6 +465,7 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
             }
         }
         Integer tenantId = SecurityUtils.getTenantId();
+        Long nowUserId = SecurityUtils.getUserId();
         LocalDate start = null;
         LocalDate end = null;
         List<Integer> reportIds = new ArrayList<>();
@@ -475,6 +476,8 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
         Set<Integer> reportIdsByProject = new HashSet<>();
         Set<Integer> reportIdsSet = new HashSet<>();
 
+        LambdaQueryWrapper<PmWorkReport> reportQuery = Wrappers.lambdaQuery();
+
         if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)) {
             DateTimeFormatter formatter = null;
             try {
@@ -486,7 +489,6 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
             end = LocalDate.parse(endDate, formatter);
             startDateTime = start.atStartOfDay();
             endDateTime = end.atTime(23, 59, 59);
-            LambdaQueryWrapper<PmWorkReport> reportQuery = Wrappers.lambdaQuery();
             reportQuery.select(PmWorkReport::getId).eq(PmWorkReport::getReportStatus, 1).between(PmWorkReport::getSubmitDate, startDateTime, endDateTime);
             reportIdsByDate = pmWorkReportMapper.selectList(reportQuery).stream().map(PmWorkReport::getId).collect(Collectors.toSet());
         }
@@ -498,8 +500,8 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
         }
 
         if (userId != null) {
-            LambdaQueryWrapper<PmWorkReport> reportQuery = Wrappers.lambdaQuery();
-            reportQuery.eq(PmWorkReport::getSubmitterId, userId);
+            reportQuery.eq(PmWorkReport::getSubmitterId, userId)
+                    .and(wrappers -> wrappers.apply("FIND_IN_SET(" + nowUserId + ", cc_to) > 0"));
             reportIdsByUser = pmWorkReportMapper.selectList(reportQuery).stream().map(PmWorkReport::getId).collect(Collectors.toSet());
             if (reportIdsByProject.isEmpty() && reportIdsByUser.isEmpty()) {
                 return returnPage;
@@ -538,8 +540,16 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
         } else if (!reportIdsByDate.isEmpty()) {
             reportIdsSet.addAll(reportIdsByDate);
         }
+
         reportIds = new ArrayList<>(reportIdsSet);
 
+        if (projectAscription == 1) {
+            LambdaQueryWrapper<PmWorkReport> headerQuery = Wrappers.lambdaQuery();
+            headerQuery.in(!reportIds.isEmpty(), PmWorkReport::getId, reportIds)
+                    .and(wrappers -> wrappers.apply("FIND_IN_SET(" + nowUserId + ", cc_to) > 0"));
+            reportIds = pmWorkReportMapper.selectList(headerQuery).stream().map(PmWorkReport::getId).collect(Collectors.toList());
+        }
+
         List<PmWorkContent> pmWorkContentList = new ArrayList<>();
         Long userId2 = SecurityUtils.getUserId();
         List<Long> userIds = new ArrayList<>();
@@ -588,22 +598,22 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
 
         List<Integer> reportIds2 = pmWorkContentList.stream().distinct().map(PmWorkContent::getReportId).collect(Collectors.toList());
 
-        LambdaQueryWrapper<PmWorkReport> reportQuery = Wrappers.lambdaQuery();
-        reportQuery.eq(PmWorkReport::getTenantId, tenantId).eq(PmWorkReport::getReportStatus, 1);
+        LambdaQueryWrapper<PmWorkReport> reportQuery1 = Wrappers.lambdaQuery();
+        reportQuery1.eq(PmWorkReport::getTenantId, tenantId).eq(PmWorkReport::getReportStatus, 1);
         if (reportId != null && reportId != 0) {
-            reportQuery.eq(PmWorkReport::getId, reportId);
+            reportQuery1.eq(PmWorkReport::getId, reportId);
         } else {
-            reportQuery.in(PmWorkReport::getId, reportIds2);
+            reportQuery1.in(PmWorkReport::getId, reportIds2);
             // 判断上下滑动以及数量
             if (upOrDown != null && slideSum != null && submitDateTime != null) {
                 if (slideSum > 0) {
                     // 向下滑动
                     if (upOrDown == 0) {
-                        reportQuery.lt(PmWorkReport::getSubmitDate, submitDateTime).orderByDesc(PmWorkReport::getSubmitDate);
+                        reportQuery1.lt(PmWorkReport::getSubmitDate, submitDateTime).orderByDesc(PmWorkReport::getSubmitDate);
                     }
                     // 向上滑动
                     else if (upOrDown == 1) {
-                        reportQuery.gt(PmWorkReport::getSubmitDate, submitDateTime).orderByAsc(PmWorkReport::getSubmitDate);
+                        reportQuery1.gt(PmWorkReport::getSubmitDate, submitDateTime).orderByAsc(PmWorkReport::getSubmitDate);
                     } else {
                         throw new BusinessException("上下滑动参数异常");
                     }
@@ -614,11 +624,11 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
                     throw new BusinessException("滑动数量参数必须是大于0正整数");
                 }
             } else {
-                reportQuery.orderByDesc(PmWorkReport::getSubmitDate);
+                reportQuery1.orderByDesc(PmWorkReport::getSubmitDate);
             }
         }
 
-        reportPage = pmWorkReportMapper.selectPage(new Page<>(pageNum, pageSize), reportQuery);
+        reportPage = pmWorkReportMapper.selectPage(new Page<>(pageNum, pageSize), reportQuery1);
         reportList = reportPage.getRecords();
 
         // 查询已读状态

+ 12 - 6
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/PmWorkReportServiceImpl.java

@@ -95,6 +95,9 @@ public class PmWorkReportServiceImpl extends AbstractCrudService<PmWorkReportMap
      */
     @Override
     public List<Map<String, List<PmWorkReport>>> weekWork(String startDate, String endDate, Integer reportId) {
+        Long userId = SecurityUtils.getUserId();
+        Integer tenantId = SecurityUtils.getTenantId();
+
         List<Map<String, List<PmWorkReport>>> returnList = new ArrayList<>();
         List<PmWorkReport> report = new ArrayList<>();
         Map<String, List<PmWorkReport>> weekData = new HashMap<>();
@@ -114,9 +117,10 @@ public class PmWorkReportServiceImpl extends AbstractCrudService<PmWorkReportMap
             dates.add(tempDate);
             tempDate = tempDate.plusDays(1);
         }
+
         // 返回最新的一条数据给前端填充
         LambdaQueryWrapper<PmWorkReport> wrapper2 = Wrappers.lambdaQuery();
-        wrapper2.eq(PmWorkReport::getSubmitterId, SecurityUtils.getUserId())
+        wrapper2.eq(PmWorkReport::getSubmitterId, userId)
                 .orderByDesc(PmWorkReport::getSubmitDate)
                 .last("LIMIT 1");
         report = baseMapper.selectList(wrapper2);
@@ -127,9 +131,11 @@ public class PmWorkReportServiceImpl extends AbstractCrudService<PmWorkReportMap
             List<PmWorkContent> contents1 = pmWorkContentMapper.selectList(wrapper);
             report.get(0).setWorkContents(contents1);
         }
+
         // 固定返回七条数据,没有内容也要设置时间给前端渲染
         LambdaQueryWrapper<PmWorkReport> queryWrapperR = Wrappers.lambdaQuery();
-        queryWrapperR.eq(PmWorkReport::getSubmitterId, SecurityUtils.getUserId())
+        queryWrapperR.eq(PmWorkReport::getTenantId, tenantId)
+    .eq(PmWorkReport::getSubmitterId, userId)
                 .between(reportId == 0, PmWorkReport::getReportDate, startDate1, endDate1)
                 .eq(reportId != 0, PmWorkReport::getId, reportId)
                 .orderByAsc(PmWorkReport::getReportDate);
@@ -174,7 +180,7 @@ public class PmWorkReportServiceImpl extends AbstractCrudService<PmWorkReportMap
         if (reports.size() == 7 || reportId != 0) {
             weekData.put("weekData", reports);
             LambdaQueryWrapper<PmWorkReport> wrapper1 = Wrappers.lambdaQuery();
-            wrapper1.eq(PmWorkReport::getSubmitterId, SecurityUtils.getUserId())
+            wrapper1.eq(PmWorkReport::getSubmitterId, userId)
                     .orderByDesc(PmWorkReport::getReportDate)
                     .last("LIMIT 1");
             report = this.list(wrapper1);
@@ -499,7 +505,7 @@ public class PmWorkReportServiceImpl extends AbstractCrudService<PmWorkReportMap
         LocalDateTime endTime = stringLocalDateTimeMap.get("end");
         BigDecimal totalWorkTime = BigDecimal.ZERO;
 
-        List<PmProjectWorkTimeVo> week = pmWorkContentMapper.workTimeCount(startTime, endTime, SecurityUtils.getUserId());
+        List<PmProjectWorkTimeVo> week = pmWorkContentMapper.workTimeCount(startTime, endTime, SecurityUtils.getUserId(), SecurityUtils.getTenantId());
         if (week.isEmpty()) {
             projectTotalWorkTimeVo.setTotalWorkTime(totalWorkTime);
             projectTotalWorkTimeVo.setProjectWorkTime(week);
@@ -601,7 +607,7 @@ public class PmWorkReportServiceImpl extends AbstractCrudService<PmWorkReportMap
      * @param: [time] 开始时间
      * @return: void
      **/
-    @Async
+    @Async("asyncServiceExecutor")
     @Override
     public void timedSending(LocalDateTime time) {
         log.info("定时报告任务开始---------------------------");
@@ -740,7 +746,7 @@ public class PmWorkReportServiceImpl extends AbstractCrudService<PmWorkReportMap
         return timedReports;
     }
 
-    @Async
+    @Async("asyncServiceExecutor")
     @Override
     public void reportSubmissionReminder() {
         Integer tenantId = SecurityUtils.getTenantId();

+ 71 - 3
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/VcDeviceServiceImpl.java

@@ -6,16 +6,20 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.usky.common.core.bean.CommonPage;
+import com.usky.common.core.exception.BusinessException;
 import com.usky.common.security.utils.SecurityUtils;
-import com.usky.iot.domain.BaseFacilityDevice;
-import com.usky.iot.domain.BaseGgpFacility;
 import com.usky.iot.domain.VcDevice;
 import com.usky.iot.mapper.VcDeviceMapper;
 import com.usky.iot.service.VcDeviceService;
 import com.usky.common.mybatis.core.AbstractCrudService;
-import com.usky.iot.service.vo.BaseFacilityDeviceVO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
 import java.time.LocalDateTime;
 import java.util.List;
 
@@ -27,8 +31,15 @@ import java.util.List;
  * @author han
  * @since 2024-10-22
  */
+@Slf4j
 @Service
 public class VcDeviceServiceImpl extends AbstractCrudService<VcDeviceMapper, VcDevice> implements VcDeviceService {
+
+    @Value("${vc.rtmp-ip}")
+    private String rtmpIp;
+
+    Process process = null;
+
     @Override
     public List<VcDevice> VcDeviceList(Integer groupId){
         LambdaQueryWrapper<VcDevice> queryWrapper = Wrappers.lambdaQuery();
@@ -51,6 +62,63 @@ public class VcDeviceServiceImpl extends AbstractCrudService<VcDeviceMapper, VcD
         return new CommonPage<>(page.getRecords(),page.getTotal(),page.getCurrent(),page.getSize());
     }
 
+    @Override
+    public String getVcDeviceVideo(String deviceUuid){
+        LambdaQueryWrapper<VcDevice> lambdaQuery = Wrappers.lambdaQuery();
+        lambdaQuery.like(StringUtils.isNotBlank(deviceUuid),VcDevice::getVideoNumber,deviceUuid)
+                .eq(VcDevice::getDelFlag,0);
+        VcDevice one = this.getOne(lambdaQuery);
+        if(one==null){
+            throw new BusinessException("未查询到设备信息");
+        }
+        String accountNumber = one.getAccountNumber();
+        String videoPassword = one.getVideoPassword();
+        String videoIp = one.getVideoIp();
+        String videoPort = one.getVideoPort().toString();
+        String command = "ffmpeg -i rtsp://"+accountNumber+":"+videoPassword+"@"+videoIp+":"+videoPort+" -vcodec copy -acodec aac -ar 44100 -c:v libx264 -preset ultrafast -tune zerolatency -strict -2 -ac 1 -r 30 -s 1280x720 -q 10 -f flv -hls_time 1 -hls_list_size 3 -hls_flags delete_segments rtmp://"+rtmpIp+":1935/hls/"+deviceUuid;
+        System.out.println(command);
+
+        try {
+            log.info("【begin】实时拉取摄像头数据流 "+command);
+            // 创建 ProcessBuilder 实例
+            ProcessBuilder processBuilder = new ProcessBuilder(command.split(" "));
+            // 启动进程
+            process = processBuilder.start();
+
+            new Thread(() -> {
+                try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getErrorStream()))) {
+                    String line;
+                    while ((line = reader.readLine()) != null) {
+                        System.out.println(line);
+                    }
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }).start();
+
+            String repDeviceVideo = rtmpIp+":80/hls/"+deviceUuid+".m3u8";
+            return repDeviceVideo;
+
+
+        } catch (IOException e) {
+            e.printStackTrace();
+            return null;
+        }
+
+    }
+
+    @Override
+    public void stopDeviceVideo() {
+        if (process != null && process.isAlive()) {
+            process.destroy();
+            try {
+                process.waitFor();
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
     @Override
     public boolean add(VcDevice vcDevice){
         vcDevice.setCreateBy(SecurityUtils.getUsername());

+ 17 - 17
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/vo/BaseGgpFacilityExportVo.java

@@ -24,18 +24,6 @@ public class BaseGgpFacilityExportVo implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
-    /**
-     * 主键ID
-     */
-    @TableId(value = "id", type = IdType.AUTO)
-    private Integer id;
-
-    /**
-     * 序号
-     */
-    @Excel(name = "序号")
-    private Integer xh;
-
     /**
      * 设施编号
      */
@@ -61,7 +49,7 @@ public class BaseGgpFacilityExportVo implements Serializable {
     private String address;
 
     /**
-     * 图片地址URL
+     * 设施图片
      */
     @Excel(name = "设施图片")
     private String imagesUrl;
@@ -73,19 +61,31 @@ public class BaseGgpFacilityExportVo implements Serializable {
     private String contact;
 
     /**
-     * 联系方式
+     * 联系电话
      */
-    @Excel(name = "联系方式")
+    @Excel(name = "联系电话")
     private String contactPhone;
 
     /**
      * 设施状态
      */
     @Excel(name = "设施状态", readConverterExp = "0=正常,1=维修,2=关闭")
-    private Integer status;
+    private Integer facilityStatus;
+
+    /**
+     * 经度
+     */
+    @Excel(name = "经度")
+    private String longitude;
+
+    /**
+     * 维度
+     */
+    @Excel(name = "维度")
+    private String latitude;
 
     /**
-     * 开始时间
+     * 创建时间
      */
     @Excel(name = "创建时间")
     private String createTime;

+ 34 - 9
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/vo/FacilityImportVo.java

@@ -1,8 +1,12 @@
 package com.usky.iot.service.vo;
 
-import cn.afterturn.easypoi.excel.annotation.Excel;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.time.LocalDateTime;
 
 /**
  * <p>
@@ -13,24 +17,38 @@ import lombok.Data;
  * @since 2023-07-27
  */
 @Data
+@EqualsAndHashCode(callSuper = false)
 public class FacilityImportVo{
+    /**
+     * 设施编号
+     */
+    @Excel(name = "设施编号")
+    private String facilityNum;
+
     /**
      * 设施类型(必填)
      */
-    @Excel(name = "设施类型(必填)")
+    @Excel(name = "设施类型")
     private String facilityType;
 
     /**
      * 设施名称(必填)
      */
-    @Excel(name = "设施名称(必填)")
+    @Excel(name = "设施名称")
     private String facilityName;
 
     /**
      * 设施地址(必填)
      */
-    @Excel(name = "设施地址(必填)")
+    @Excel(name = "设施地址")
     private String address;
+
+    /**
+     * 设施图片
+     */
+    @Excel(name = "设施图片")
+    private String imagesUrl;
+
     /**
      * 联系人
      */
@@ -44,21 +62,28 @@ public class FacilityImportVo{
     private String contactPhone;
 
     /**
-     * 备注
+     * 设施状态
      */
-    @Excel(name = "备注")
-    private String facilityDesc;
+    @Excel(name = "设施状态",replace = {"正常_0", "维修_1", "关闭_2"})
+    private Integer facilityStatus;
 
     /**
      * 经度(必填)
      */
-    @Excel(name = "经度(必填)")
+    @Excel(name = "经度")
     private String longitude;
 
     /**
      * 维度(必填)
      */
-    @Excel(name = "维度(必填)")
+    @Excel(name = "维度")
     private String latitude;
 
+    /**
+     * 创建时间
+     */
+    @Excel(name = "创建时间")
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime createTime;
+
 }

+ 2 - 2
service-iot/service-iot-biz/src/main/resources/logback.xml

@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration scan="true" scanPeriod="60 seconds" debug="false">
     <!-- 日志存放路径 -->
-    <property name="log.path" value="/var/log/uskycloud/service-iot" />
+    <property name="log.path" value="/var/log/uskycloud/service-pm" />
     <!-- 日志输出格式 -->
     <property name="log.pattern" value="%d{MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{26}:%line: %msg%n" />
     <!--    	<property name="log.pattern" value="%gray(%d{MM-dd HH:mm:ss.SSS}) %highlight(%-5level) &#45;&#45; [%gray(%thread)] %cyan(%logger{26}:%line): %msg%n" />-->
 
 
-    <property name="SQL_PACKAGE" value="com.usky.iot.mapper"/>
+    <property name="SQL_PACKAGE" value="com.usky.pm.mapper"/>
 
     <!-- 控制台输出 -->
     <appender name="console" class="ch.qos.logback.core.ConsoleAppender">

+ 4 - 0
service-iot/service-iot-biz/src/main/resources/mapper/iot/BaseFacilityTypeMapper.xml

@@ -32,6 +32,10 @@
         </where>
         GROUP BY d.id
     </select>
+    <select id="facilitTypeNumList" resultType="com.usky.iot.service.vo.BaseGgpFacilityTypeNumVO">
+        SELECT d.id,d.type_name as typeName,d.type_code as typeCode,d.type_img as typeImg
+        FROM base_facility_type d
+    </select>
     <select id="typeNormalNumList" resultType="com.usky.iot.service.vo.BaseGgpFacilityTypeNumVO">
         SELECT d.id,IF(facility_type IS NULL,0,COUNT(*)) AS
         normalFacilityNum

+ 3 - 0
service-iot/service-iot-biz/src/main/resources/mapper/iot/PmTimeConfMapper.xml

@@ -14,6 +14,9 @@
         <result column="update_time" property="updateTime" />
         <result column="dept_id" property="deptId" />
         <result column="tenant_id" property="tenantId" />
+        <result column="conf_name" property="confName" />
+        <result column="conf_type" property="confType" />
+        <result column="notifier" property="notifier" />
     </resultMap>
 
 </mapper>

+ 2 - 1
service-iot/service-iot-biz/src/main/resources/mapper/iot/PmWorkContentMapper.xml

@@ -21,9 +21,10 @@
     <select id="workTimeCount" resultType="com.usky.iot.service.vo.PmProjectWorkTimeVo">
         SELECT pc.project_name, SUM(pc.work_time) as workTime
         FROM pm_work_content pc
-            JOIN pm_work_report pr ON pc.report_id = pr.id
+                 JOIN pm_work_report pr ON pc.report_id = pr.id
         WHERE pr.submitter_id = #{userId}
           AND pr.report_date BETWEEN #{startTime} AND #{endTime}
+          AND pr.tenant_id = #{tenantId}
         GROUP BY pc.project_name
     </select>
 

+ 4 - 0
service-issue/service-issue-api/src/main/java/com/usky/issue/RemoteIssueTaskService.java

@@ -0,0 +1,4 @@
+package com.usky.issue;
+
+public interface RemoteIssueTaskService {
+}

+ 4 - 0
service-issue/service-issue-api/src/main/java/com/usky/issue/factory/RemoteIssueTaskFactory.java

@@ -0,0 +1,4 @@
+package com.usky.issue.factory;
+
+public class RemoteIssueTaskFactory {
+}

+ 50 - 0
service-issue/service-issue-biz/src/main/java/com/usky/issue/service/config/mqtt/MqttBaseConfig.java

@@ -0,0 +1,50 @@
+package com.usky.issue.service.config.mqtt;
+
+import lombok.Data;
+import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.integration.mqtt.core.DefaultMqttPahoClientFactory;
+import org.springframework.integration.mqtt.core.MqttPahoClientFactory;
+import org.springframework.stereotype.Component;
+
+@ConditionalOnProperty(prefix = "mqtt", value = {"enabled"}, havingValue = "true")
+@Data
+@Component
+@ConfigurationProperties(prefix = "mqtt")
+public class MqttBaseConfig {
+
+    @Value("${mqtt.username}")
+    private String username;
+
+    @Value("${mqtt.password}")
+    private String password;
+
+    @Value("${mqtt.url}")
+    private String hostUrl;
+
+    @Value("${mqtt.sub-topics}")
+    private String msgTopic;
+
+    @Value("${mqtt.keep-alive-interval}")
+    //心跳间隔
+    private int keepAliveInterval;
+    @Value("${mqtt.completionTimeout}")
+    //心跳间隔
+    private int completionTimeout;
+
+
+    @Bean
+    public MqttPahoClientFactory mqttClientFactory() {
+        DefaultMqttPahoClientFactory factory = new DefaultMqttPahoClientFactory();
+        MqttConnectOptions options = new MqttConnectOptions();
+        options.setServerURIs(new String[]{this.getHostUrl()});
+        options.setUserName(this.getUsername());
+        options.setPassword(this.getPassword().toCharArray());
+        factory.setConnectionOptions(options);
+        return factory;
+    }
+
+}

+ 48 - 0
service-issue/service-issue-biz/src/main/java/com/usky/issue/service/config/mqtt/MqttInConfig.java

@@ -0,0 +1,48 @@
+package com.usky.issue.service.config.mqtt;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.integration.channel.DirectChannel;
+import org.springframework.integration.core.MessageProducer;
+import org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter;
+import org.springframework.integration.mqtt.support.DefaultPahoMessageConverter;
+import org.springframework.messaging.MessageChannel;
+
+/**
+ * @author han
+ * @date 2025/03/20 14:30
+ */
+@ConditionalOnProperty(prefix = "mqtt", value = {"enabled"}, havingValue = "true")
+@Configuration
+public class MqttInConfig {
+    @Autowired
+    private MqttBaseConfig mqttBaseConfig;
+
+    public static final String CHANNEL_NAME_INPUT = "mqttInputChannel";
+
+    @Bean(name = CHANNEL_NAME_INPUT)
+    public MessageChannel mqttInputChannel() {
+        return new DirectChannel();
+    }
+
+
+    /**
+     * 消息订阅绑定-消费者
+     *
+     * @return
+     */
+    @Bean
+    public MessageProducer inbound() {
+        String[] tops = mqttBaseConfig.getMsgTopic().split(",");
+        String clientId = "h-agbox-mqtt-in-" + System.currentTimeMillis();
+        MqttPahoMessageDrivenChannelAdapter adapter = new MqttPahoMessageDrivenChannelAdapter(clientId,
+                mqttBaseConfig.mqttClientFactory(), tops);
+        adapter.setCompletionTimeout(mqttBaseConfig.getCompletionTimeout());
+        adapter.setConverter(new DefaultPahoMessageConverter());
+        adapter.setQos(2);
+        adapter.setOutputChannel(mqttInputChannel());
+        return adapter;
+    }
+}

+ 86 - 0
service-issue/service-issue-biz/src/main/java/com/usky/issue/service/config/mqtt/MqttOutConfig.java

@@ -0,0 +1,86 @@
+package com.usky.issue.service.config.mqtt;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.integration.annotation.MessagingGateway;
+import org.springframework.integration.annotation.ServiceActivator;
+import org.springframework.integration.channel.DirectChannel;
+import org.springframework.integration.mqtt.outbound.MqttPahoMessageHandler;
+import org.springframework.integration.mqtt.support.MqttHeaders;
+import org.springframework.messaging.MessageChannel;
+import org.springframework.messaging.MessageHandler;
+import org.springframework.messaging.handler.annotation.Header;
+
+/**
+ * @author han
+ * @date 2025/03/20 14:31
+ */
+@ConditionalOnProperty(prefix = "mqtt", value = {"enabled"}, havingValue = "true")
+@Configuration
+public class MqttOutConfig {
+    @Autowired
+    public MqttBaseConfig mqttBaseConfig;
+
+    public static final String CHANNEL_NAME_OUT = "mqttOutboundChannel";
+
+    public static final String MESSAGE_NAME = "messageOut";
+
+    public static final String DEFAULT_TOPIC = "testTopic";
+
+    /**
+     * 连接通道
+     *
+     * @return
+     */
+    @Bean(name = CHANNEL_NAME_OUT)
+    public MessageChannel mqttOutboundChannel() {
+        return new DirectChannel();
+    }
+
+    /**
+     * 发送消息和消费消息Channel可以使用相同MqttPahoClientFactory
+     *
+     * @return
+     */
+    @Bean(name = MESSAGE_NAME)
+    @ServiceActivator(inputChannel = CHANNEL_NAME_OUT)
+    public MessageHandler outbound() {
+        // 在这里进行mqttOutboundChannel的相关设置
+        String clientId = "h-backend-mqtt-in-" + System.currentTimeMillis();
+        MqttPahoMessageHandler messageHandler =
+                new MqttPahoMessageHandler(clientId, mqttBaseConfig.mqttClientFactory());
+        //如果设置成true,发送消息时将不会阻塞。
+        messageHandler.setAsync(true);
+        messageHandler.setDefaultTopic(DEFAULT_TOPIC);
+        return messageHandler;
+    }
+
+    @MessagingGateway(defaultRequestChannel = CHANNEL_NAME_OUT)
+    public interface MqttGateway {
+        /**
+         * 发送消息
+         *
+         * @param payload
+         */
+        void sendToMqtt(String payload);
+
+        /**
+         * 指定top发送消息
+         *
+         * @param topic
+         * @param payload
+         */
+        void sendToMqtt(@Header(MqttHeaders.TOPIC) String topic, String payload);
+
+        /**
+         * 指定队列和qos
+         *
+         * @param topic
+         * @param qos
+         * @param payload
+         */
+        void sendToMqtt(@Header(MqttHeaders.TOPIC) String topic, @Header(MqttHeaders.QOS) int qos, String payload);
+    }
+}

+ 175 - 0
service-issue/service-issue-biz/src/main/java/com/usky/issue/service/job/JgDataForward.java

@@ -0,0 +1,175 @@
+package com.usky.issue.service.job;
+
+import com.alibaba.fastjson.JSONObject;
+import com.usky.issue.service.util.HttpClientUtils;
+import com.usky.issue.service.vo.RtuAttributeVO;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 外滩27号介谷物管家平台消息转发
+ */
+@Component
+public class JgDataForward {
+    public JSONObject addHeart(String requestBody) {
+        String resultString = "";
+        JSONObject map = new JSONObject();
+        JSONObject eventVO = JSONObject.parseObject(requestBody);
+        JSONObject resultVO = new JSONObject();
+        List<Map<String, Object>> devs = (List) JSONObject.parseArray(JSONObject.toJSONString(eventVO.get("devs")));
+        List<Map<String, Object>> dp = (List) JSONObject.parseArray(JSONObject.toJSONString(devs.get(0).get("dp")));
+        String battery = "";
+        String devSignal = "";
+        String waterPressure = "";
+        List<RtuAttributeVO> mapList = new ArrayList<>();
+        RtuAttributeVO rtuAttributeVO1 = new RtuAttributeVO();
+        RtuAttributeVO rtuAttributeVO2 = new RtuAttributeVO();
+        RtuAttributeVO rtuAttributeVO3 = new RtuAttributeVO();
+        RtuAttributeVO rtuAttributeVO4 = new RtuAttributeVO();
+        RtuAttributeVO rtuAttributeVO5 = new RtuAttributeVO();
+        if (devs.get(0).get("deviceType").equals("6")){
+            if (eventVO.get("devId").equals("4023383030393834")){
+                for (int i = 0; i < dp.size(); i++) {
+                    if (dp.get(i).get("serial").equals("601")){
+                        rtuAttributeVO1.setPowerAlarm(dp.get(i).get("value").equals("00")?0:1);
+                        rtuAttributeVO2.setPowerAlarm(dp.get(i).get("value").equals("00")?0:1);
+                    }else if (dp.get(i).get("serial").equals("602")){
+                        rtuAttributeVO1.setManualAct(dp.get(i).get("value").equals("00")?0:1);
+                        rtuAttributeVO2.setManualAct(dp.get(i).get("value").equals("00")?0:1);
+                    }else if (dp.get(i).get("serial").equals("603")){
+                        rtuAttributeVO1.setDevWorking(dp.get(i).get("value").equals("00")?0:1);
+                    }else if (dp.get(i).get("serial").equals("604")){
+                        rtuAttributeVO2.setDevWorking(dp.get(i).get("value").equals("00")?0:1);
+                    }else if (dp.get(i).get("serial").equals("605")){
+                        rtuAttributeVO1.setDevAlarm(dp.get(i).get("value").equals("00")?0:1);
+                    }else if (dp.get(i).get("serial").equals("606")){
+                        rtuAttributeVO2.setDevAlarm(dp.get(i).get("value").equals("00")?0:1);
+                    }else if (dp.get(i).get("serial").equals("607")){
+                        rtuAttributeVO3.setPowerAlarm(dp.get(i).get("value").equals("00")?0:1);
+                        rtuAttributeVO4.setPowerAlarm(dp.get(i).get("value").equals("00")?0:1);
+                    }else if (dp.get(i).get("serial").equals("608")){
+                        rtuAttributeVO3.setManualAct(dp.get(i).get("value").equals("00")?0:1);
+                        rtuAttributeVO4.setManualAct(dp.get(i).get("value").equals("00")?0:1);
+                    }else if (dp.get(i).get("serial").equals("609")){
+                        rtuAttributeVO3.setDevWorking(dp.get(i).get("value").equals("00")?0:1);
+                    }else if (dp.get(i).get("serial").equals("610")){
+                        rtuAttributeVO4.setDevWorking(dp.get(i).get("value").equals("00")?0:1);
+                    }else if (dp.get(i).get("serial").equals("611")){
+                        rtuAttributeVO3.setDevAlarm(dp.get(i).get("value").equals("00")?0:1);
+                    }else if (dp.get(i).get("serial").equals("612")){
+                        rtuAttributeVO4.setDevAlarm(dp.get(i).get("value").equals("00")?0:1);
+                    }
+                }
+                mapList.add(rtuAttributeVO1);
+                mapList.add(rtuAttributeVO2);
+                mapList.add(rtuAttributeVO3);
+                mapList.add(rtuAttributeVO4);
+                for (int j = 0; j < mapList.size(); j++) {
+                    int k = j+1;
+                    map.put("deviceId", "YHYH"+eventVO.get("devId")+k);
+                    map.put("dataJson",
+                            "{\"powerAlarm\":"+mapList.get(j).getPowerAlarm()+",\"devWorking\":"+mapList.get(j).getDevWorking()+
+                                    ",\"manualAct\":"+mapList.get(j).getManualAct()+ "," + "\"devAlarm\":"+mapList.get(j).getDevAlarm()+"}");
+                    resultString = HttpClientUtils.doPostJson("http://adaptor.dbmcloud.tech:8802/dbm/iot/receive/data/all"
+                            ,map.toJSONString());
+                    System.out.print("发送数据"+map.toJSONString());
+                    resultVO = JSONObject.parseObject(resultString);
+                    System.out.print("返回数据"+resultString);
+                }
+            }else if (eventVO.get("devId").equals("4023383030393835")){
+                for (int i = 0; i < dp.size(); i++) {
+                    if (dp.get(i).get("serial").equals("601")){
+                        rtuAttributeVO1.setDevWorking(dp.get(i).get("value").equals("00")?0:1);
+                    }else if (dp.get(i).get("serial").equals("602")){
+                        rtuAttributeVO2.setDevWorking(dp.get(i).get("value").equals("00")?0:1);
+                    }else if (dp.get(i).get("serial").equals("603")){
+                        rtuAttributeVO3.setDevWorking(dp.get(i).get("value").equals("00")?0:1);
+                    }else if (dp.get(i).get("serial").equals("604")){
+                        rtuAttributeVO4.setDevWorking(dp.get(i).get("value").equals("00")?0:1);
+                    }else if (dp.get(i).get("serial").equals("605")){
+                        rtuAttributeVO5.setDevWorking(dp.get(i).get("value").equals("00")?0:1);
+                    }
+                }
+                mapList.add(rtuAttributeVO1);
+                mapList.add(rtuAttributeVO2);
+                mapList.add(rtuAttributeVO3);
+                mapList.add(rtuAttributeVO4);
+                mapList.add(rtuAttributeVO5);
+                for (int j = 0; j < mapList.size(); j++) {
+                    int k = j+1;
+                    map.put("deviceId", "YHYH"+eventVO.get("devId")+k);
+                    map.put("dataJson",
+                            "{\"devWorking\":"+mapList.get(j).getDevWorking()+"}");
+                    resultString = HttpClientUtils.doPostJson("http://adaptor.dbmcloud.tech:8802/dbm/iot/receive/data/all"
+                            ,map.toJSONString());
+                    System.out.print("发送数据"+map.toJSONString());
+                    resultVO = JSONObject.parseObject(resultString);
+                    System.out.print("返回数据"+resultString);
+                }
+            }
+        }else {
+            map.put("deviceId", "YHYH"+eventVO.get("devId"));
+            if (devs.get(0).get("deviceType").equals("2")||devs.get(0).get("deviceType").equals("5")){
+                for (int i = 0; i < dp.size(); i++) {
+                    if (dp.get(i).get("serial").equals("201")){
+                        battery = dp.get(i).get("value").toString();
+                    }else if (dp.get(i).get("serial").equals("202")){
+                        devSignal = dp.get(i).get("value").toString();
+                    }else if (dp.get(i).get("serial").equals("203")){
+                        waterPressure = dp.get(i).get("value").toString();
+                    }
+                }
+                if (devs.get(0).get("deviceType").equals("2")){
+                    map.put("dataJson", "{\"battery\":"+battery+",\"devSignal\":"+devSignal+",\"waterPressure\":"+waterPressure+"," +
+                            "\"devStatus\":"+0+"}");
+                }else {
+                    map.put("dataJson", "{\"battery\":"+battery+",\"devSignal\":"+devSignal+",\"waterLevel\":"+waterPressure+"," +
+                            "\"devStatus\":"+0+"}");
+                }
+            }else if (devs.get(0).get("deviceType").equals("7")){
+                String voltageA = "";
+                String voltageB = "";
+                String voltageC = "";
+                String currentA = "";
+                String currentB = "";
+                String currentC = "";
+                String temperatureA = "";
+                String temperatureB = "";
+                String temperatureC = "";
+                for (int i = 0; i < dp.size(); i++) {
+                    if (dp.get(i).get("serial").equals("65")){
+                        voltageA = dp.get(i).get("value").toString();
+                    }else if (dp.get(i).get("serial").equals("66")){
+                        voltageB = dp.get(i).get("value").toString();
+                    }else if (dp.get(i).get("serial").equals("67")){
+                        voltageC = dp.get(i).get("value").toString();
+                    }else if (dp.get(i).get("serial").equals("68")){
+                        currentA = dp.get(i).get("value").toString();
+                    }else if (dp.get(i).get("serial").equals("69")){
+                        currentB = dp.get(i).get("value").toString();
+                    }else if (dp.get(i).get("serial").equals("70")){
+                        currentC = dp.get(i).get("value").toString();
+                    }else if (dp.get(i).get("serial").equals("71")){
+                        temperatureA = dp.get(i).get("value").toString();
+                    }else if (dp.get(i).get("serial").equals("72")){
+                        temperatureB = dp.get(i).get("value").toString();
+                    }else if (dp.get(i).get("serial").equals("73")){
+                        temperatureC = dp.get(i).get("value").toString();
+                    }
+                }
+                map.put("dataJson", "{\"voltageA\":"+voltageA+",\"voltageB\":"+voltageB+",\"voltageC\":"+voltageC+"," +
+                        "\"currentA\":"+currentA+",\"currentB\":"+currentB+",\"currentC\":"+currentC+",\"temperatureA\":"+temperatureA+",\"temperatureB\":"+temperatureB+",\"temperatureC\":"+temperatureC+"," +
+                        "\"devStatus\":"+0+"}");
+            }
+            resultString = HttpClientUtils.doPostJson("http://adaptor.dbmcloud.tech:8802/dbm/iot/receive/data/all"
+                    ,map.toJSONString());
+            System.out.print("发送数据"+map.toJSONString());
+            resultVO = JSONObject.parseObject(resultString);
+            System.out.print("返回数据"+resultString);
+        }
+        return resultVO;
+    }
+}

+ 55 - 0
service-issue/service-issue-biz/src/main/java/com/usky/issue/service/listener/MqttListener.java

@@ -0,0 +1,55 @@
+package com.usky.issue.service.listener;
+
+import com.usky.issue.service.config.mqtt.MqttInConfig;
+import com.usky.issue.service.mqtt.SimpleContext;
+import com.usky.issue.service.vo.MqttBaseVO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
+import org.springframework.integration.annotation.ServiceActivator;
+import org.springframework.messaging.MessageHandler;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author han
+ * @date 2025/03/20 14:41
+ */
+@ConditionalOnProperty(prefix = "mqtt", value = {"enabled"}, havingValue = "true")
+@Slf4j
+@Component
+public class MqttListener {
+    public static final String MESSAGE_NAME = "messageInput";
+
+    @Autowired
+    private SimpleContext simpleContext;
+
+    /**
+     * 处理消息-消费者
+     *
+     * @return
+     */
+    @Bean(MESSAGE_NAME)
+    @ServiceActivator(inputChannel = MqttInConfig.CHANNEL_NAME_INPUT)
+    public MessageHandler handler() {
+        return message -> {
+            String payload = message.getPayload().toString();
+            //进行接口推送
+            Object mqttReceivedTopic = message.getHeaders().get("mqtt_receivedTopic");
+            if (null != mqttReceivedTopic) {
+                String topic = mqttReceivedTopic.toString();
+                MqttBaseVO mqttBaseVO = new MqttBaseVO();
+                mqttBaseVO.setTopic(topic);
+                if (topic.indexOf("info") != -1 ) {
+                    mqttBaseVO.setDescribe("info");
+                    mqttBaseVO.setData(payload);
+                }else if(topic.indexOf("event") != -1 ) {
+                    mqttBaseVO.setDescribe("event");
+                    mqttBaseVO.setData(payload);
+                }
+                //统一处理数据
+                simpleContext.getResource(mqttBaseVO);
+            }
+        };
+    }
+}

+ 13 - 0
service-issue/service-issue-biz/src/main/java/com/usky/issue/service/mqtt/MqttStrategy.java

@@ -0,0 +1,13 @@
+package com.usky.issue.service.mqtt;
+
+import com.usky.issue.service.vo.MqttBaseVO;
+
+public interface MqttStrategy {
+    /**
+     * 处理消息(策略模式由子类实现)
+     *
+     * @param mqttBaseVO
+     * @return
+     */
+    String disposeMessage(MqttBaseVO mqttBaseVO);
+}

+ 25 - 0
service-issue/service-issue-biz/src/main/java/com/usky/issue/service/mqtt/SimpleContext.java

@@ -0,0 +1,25 @@
+package com.usky.issue.service.mqtt;
+
+import com.usky.issue.service.vo.MqttBaseVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * 中间处理消息转发
+ */
+@Service
+public class SimpleContext {
+    @Autowired
+    private final Map<String, MqttStrategy> strategyMap = new ConcurrentHashMap<>();
+
+    public SimpleContext(Map<String, MqttStrategy> strategyMap) {
+        strategyMap.forEach(this.strategyMap::put);
+    }
+
+    public String getResource(MqttBaseVO mqttBaseVO) {
+        return strategyMap.get(mqttBaseVO.getDescribe()).disposeMessage(mqttBaseVO);
+    }
+}

+ 27 - 0
service-issue/service-issue-biz/src/main/java/com/usky/issue/service/mqtt/event/event.java

@@ -0,0 +1,27 @@
+package com.usky.issue.service.mqtt.event;
+
+import com.alibaba.fastjson.JSONObject;
+import com.usky.issue.service.job.JgDataForward;
+import com.usky.issue.service.mqtt.MqttStrategy;
+import com.usky.issue.service.vo.MqttBaseVO;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class event implements MqttStrategy {
+    @Autowired
+    private JgDataForward jgDataForward;
+
+    //处理下发命令响应消息
+    public String disposeMessage(MqttBaseVO mqttBaseVO) {
+
+        try {
+            JSONObject eventVO1 = JSONObject.parseObject(mqttBaseVO.getData().toString());
+            JSONObject eventVO = new JSONObject();
+            JSONObject eventVO2 = new JSONObject();
+            System.out.println("FEventReceiver消费者收到消息: " + mqttBaseVO.getData().toString());
+        } catch (Exception e){
+            e.printStackTrace();
+        }
+
+        return null;
+    }
+}

+ 31 - 0
service-issue/service-issue-biz/src/main/java/com/usky/issue/service/mqtt/info/Info.java

@@ -0,0 +1,31 @@
+package com.usky.issue.service.mqtt.info;
+
+import com.alibaba.fastjson.JSONObject;
+import com.usky.issue.service.job.JgDataForward;
+import com.usky.issue.service.mqtt.MqttStrategy;
+import com.usky.issue.service.vo.MqttBaseVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author han
+ * @date 2025/03/20 17:56
+ */
+@Service("info")
+public class Info implements MqttStrategy {
+    @Autowired
+    private JgDataForward jgDataForward;
+
+    public String disposeMessage(MqttBaseVO mqttBaseVO) {
+
+        try {
+            JSONObject map_data = JSONObject.parseObject(mqttBaseVO.getData().toString());
+            jgDataForward.addHeart(map_data.toJSONString());
+            System.out.println("FInfoReceiver消费者收到消息: " + mqttBaseVO.getData().toString());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return null;
+    }
+}

+ 132 - 0
service-issue/service-issue-biz/src/main/java/com/usky/issue/service/util/HttpClientUtils.java

@@ -0,0 +1,132 @@
+package com.usky.issue.service.util;
+
+import org.apache.http.NameValuePair;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.utils.URIBuilder;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.EntityUtils;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public class HttpClientUtils {
+    public static String doGet(String url, Map<String, String> param) {
+
+        // 创建Httpclient对象
+        CloseableHttpClient httpclient = HttpClients.createDefault();
+
+        String resultString = "";
+        CloseableHttpResponse response = null;
+        try {
+            // 创建uri
+            URIBuilder builder = new URIBuilder(url);
+            if (param != null) {
+                for (String key : param.keySet()) {
+                    builder.addParameter(key, param.get(key));
+                }
+            }
+            URI uri = builder.build();
+
+            // 创建http GET请求
+            HttpGet httpGet = new HttpGet(uri);
+
+            // 执行请求
+            response = httpclient.execute(httpGet);
+            // 判断返回状态是否为200
+            if (response.getStatusLine().getStatusCode() == 200) {
+                resultString = EntityUtils.toString(response.getEntity(), "UTF-8");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (response != null) {
+                    response.close();
+                }
+                httpclient.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return resultString;
+    }
+
+    public static String doGet(String url) {
+        return doGet(url, null);
+    }
+
+    public static String doPost(String url, Map<String, String> param) {
+        // 创建Httpclient对象
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        CloseableHttpResponse response = null;
+        String resultString = "";
+        try {
+            // 创建Http Post请求
+            HttpPost httpPost = new HttpPost(url);
+            // 创建参数列表
+            if (param != null) {
+                List<NameValuePair> paramList = new ArrayList<>();
+                for (String key : param.keySet()) {
+                    paramList.add(new BasicNameValuePair(key, param.get(key)));
+                }
+                // 模拟表单
+                UrlEncodedFormEntity entity = new UrlEncodedFormEntity(paramList);
+                httpPost.setEntity(entity);
+            }
+            // 执行http请求
+            response = httpClient.execute(httpPost);
+            resultString = EntityUtils.toString(response.getEntity(), "utf-8");
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                response.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+
+        return resultString;
+    }
+
+    public static String doPost(String url) {
+        return doPost(url, null);
+    }
+
+    public static String doPostJson(String url, String json) {
+        // 创建Httpclient对象
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        CloseableHttpResponse response = null;
+        String resultString = "";
+        try {
+            // 创建Http Post请求
+            HttpPost httpPost = new HttpPost(url);
+            // 创建请求内容
+            StringEntity entity = new StringEntity(json, ContentType.APPLICATION_JSON);
+            httpPost.setEntity(entity);
+            // 执行http请求
+            response = httpClient.execute(httpPost);
+            resultString = EntityUtils.toString(response.getEntity(), "utf-8");
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                response.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+
+        return resultString;
+    }
+}

+ 21 - 0
service-issue/service-issue-biz/src/main/java/com/usky/issue/service/vo/MqttBaseVO.java

@@ -0,0 +1,21 @@
+package com.usky.issue.service.vo;
+
+import lombok.Data;
+
+/**
+ * @author han
+ * @date 2025/03/20 14:41
+ */
+@Data
+public class MqttBaseVO {
+    /**
+     * 接口描述
+     */
+    private String describe;
+
+    private String topic;
+    /**
+     * 数据内容
+     */
+    private Object data;
+}

+ 24 - 0
service-issue/service-issue-biz/src/main/java/com/usky/issue/service/vo/RtuAttributeVO.java

@@ -0,0 +1,24 @@
+package com.usky.issue.service.vo;
+
+import lombok.Data;
+
+@Data
+public class RtuAttributeVO {
+    /**
+     * 电源状态
+     */
+    private Integer powerAlarm;
+    /**
+     * 运行状态
+     */
+    private Integer devWorking;
+    /**
+     * 手自动状态
+     */
+    private Integer manualAct;
+    /**
+     * 故障状态
+     */
+    private Integer devAlarm;
+
+}

+ 6 - 0
service-job/pom.xml

@@ -70,6 +70,12 @@
             <scope>compile</scope>
         </dependency>
 
+        <dependency>
+            <groupId>com.usky</groupId>
+            <artifactId>service-pm-api</artifactId>
+            <version>0.0.1</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 
     <build>

+ 6 - 6
service-job/src/main/java/com/ruoyi/job/task/RyTask.java

@@ -3,8 +3,8 @@ package com.ruoyi.job.task;
 import com.usky.common.core.utils.StringUtils;
 import com.usky.demo.RemoteMeetingService;
 import com.usky.fire.RemoteFireService;
-import com.usky.iot.RemoteIotTaskService;
-import com.usky.iot.RemotePmService;
+import com.usky.pm.RemotePmTaskService;
+import com.usky.pm.RemotePmService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -19,10 +19,10 @@ public class RyTask {
     private RemoteFireService remoteFireService;
 
     @Autowired
-    private RemotePmService remotePmService;
+    private RemotePmService remoteIotService;
 
     @Autowired
-    private RemoteIotTaskService remoteIotTaskService;
+    private RemotePmTaskService remoteIotTaskService;
 
     @Autowired
     private RemoteMeetingService remoteMeetingService;
@@ -47,7 +47,7 @@ public class RyTask {
     // 工作报告定时发送
     public void executeTimedSending() {
         System.out.println("executeTimedSending start........");
-        remotePmService.executeTimedSending();
+        remoteIotService.executeTimedSending();
     }
 
     public void dataOverviewJobData(){
@@ -78,7 +78,7 @@ public class RyTask {
     // 报告提交提醒
     public void reportSubmissionReminder(){
         System.out.println("reportSubmissionReminder start......");
-        remotePmService.reportSubmissionReminder();
+        remoteIotService.reportSubmissionReminder();
     }
 
 }

+ 5 - 11
service-oa/service-oa-biz/src/main/java/com/usky/oa/service/OaFbdDocumentService.java

@@ -1,8 +1,8 @@
 package com.usky.oa.service;
 
+import com.alibaba.fastjson.JSONObject;
 import com.usky.oa.domain.OaFbdDocument;
 import com.usky.common.mybatis.core.CrudService;
-import org.springframework.stereotype.Component;
 
 /**
  * <p>
@@ -12,19 +12,13 @@ import org.springframework.stereotype.Component;
  * @author fu
  * @since 2025-02-20
  */
-public interface OaFbdDocumentService extends CrudService<OaFbdDocument>{
+public interface OaFbdDocumentService extends CrudService<OaFbdDocument> {
 
     /**
-     * 新增发布申请
-     * @param oaFbdDocument
-     */
-    void add(OaFbdDocument oaFbdDocument);
+     * 新增发布申请 或 更新发布申请
+     **/
+    void addOrUpDate(OaFbdDocument oaFbdDocument, JSONObject node);
 
-    /**
-     * 更新发布申请
-     * @param oaFbdDocument
-     */
-    void update(OaFbdDocument oaFbdDocument);
 
     // 获取审批表数据
     void getOaApproval(OaFbdDocument oaFbdDocument);

+ 3 - 3
service-oa/service-oa-biz/src/main/java/com/usky/oa/service/impl/OaApprovalServiceImpl.java

@@ -239,7 +239,7 @@ public class OaApprovalServiceImpl extends AbstractCrudService<OaApprovalMapper,
                             // 发送消息通知下一步审批人
                             oaSendMessageCenter.sendAsyncMessage(
                                     oaApproval.getCreateBy(),
-                                    Long.valueOf(oaApproval.getProposer()),
+                                    oaApproval.getApprovalUid(),
                                     approval.getId(),
                                     userIds,
                                     3,
@@ -254,7 +254,7 @@ public class OaApprovalServiceImpl extends AbstractCrudService<OaApprovalMapper,
                 Long proposerId = Long.valueOf(oaApproval.getProposer());
                 oaSendMessageCenter.sendAsyncMessage(
                         oaApproval.getCreateBy(),
-                        proposerId,
+                        oaApproval.getApprovalUid(),
                         oaApproval.getId(),
                         Collections.singletonList(proposerId),
                         1,
@@ -266,7 +266,7 @@ public class OaApprovalServiceImpl extends AbstractCrudService<OaApprovalMapper,
             // 发送消息通知申请人审核不通过
             oaSendMessageCenter.sendAsyncMessage(
                     oaApproval.getCreateBy(),
-                    proposerId,
+                    oaApproval.getApprovalUid(),
                     oaApproval.getId(),
                     Collections.singletonList(proposerId),
                     0,

+ 6 - 2
service-oa/service-oa-biz/src/main/java/com/usky/oa/service/impl/OaDocumentServiceImpl.java

@@ -204,6 +204,8 @@ public class OaDocumentServiceImpl extends AbstractCrudService<OaDocumentMapper,
         queryWrapper.select(OaFormDefinition::getFieldInfo).eq(OaFormDefinition::getId, oaDocument.get("formId"));
         OaFormDefinition oaFormDefinition = oaFormDefinitionMapper.selectOne(queryWrapper);
 
+        JSONObject node = oaDocument.getJSONObject("node");
+
         if (oaFormDefinition == null) {
             throw new BusinessException("新增表单模板不存在!请联系管理员");
         }
@@ -220,7 +222,7 @@ public class OaDocumentServiceImpl extends AbstractCrudService<OaDocumentMapper,
                 oaCgdDocumentService.add(JSON.parseObject(oaDocument.toJSONString(), OaCgdDocument.class));
                 break;
             case "FBD":
-                oaFbdDocumentService.add(JSON.parseObject(oaDocument.toJSONString(), OaFbdDocument.class));
+                oaFbdDocumentService.addOrUpDate(JSON.parseObject(oaDocument.toJSONString(), OaFbdDocument.class), node);
                 break;
             default:
                 throw new BusinessException("新增表单模板不存在!请联系管理员");
@@ -236,6 +238,8 @@ public class OaDocumentServiceImpl extends AbstractCrudService<OaDocumentMapper,
         OaFormDefinition oaFormDefinition = oaFormDefinitionMapper.selectOne(queryWrapper);
         String sign = oaFormDefinition.getFieldInfo();
 
+        JSONObject node = jsonDocument.getJSONObject("node");
+
         switch (sign) {
             case "QJD":
                 oaQjdDocumentService.updateQjDocument(JSON.parseObject(jsonDocument.toJSONString(), OaQjdDocument.class));
@@ -247,7 +251,7 @@ public class OaDocumentServiceImpl extends AbstractCrudService<OaDocumentMapper,
                 oaCgdDocumentService.update(JSON.parseObject(jsonDocument.toJSONString(), OaCgdDocument.class));
                 break;
             case "FBD":
-                oaFbdDocumentService.update(JSON.parseObject(jsonDocument.toJSONString(), OaFbdDocument.class));
+                oaFbdDocumentService.addOrUpDate(JSON.parseObject(jsonDocument.toJSONString(), OaFbdDocument.class), node);
                 break;
             default:
                 throw new BusinessException("单据模板不存在!请联系管理员");

+ 71 - 84
service-oa/service-oa-biz/src/main/java/com/usky/oa/service/impl/OaFbdDocumentServiceImpl.java

@@ -1,5 +1,6 @@
 package com.usky.oa.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.usky.common.core.exception.BusinessException;
@@ -15,7 +16,6 @@ import com.usky.system.domain.SysUser;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
@@ -63,86 +63,74 @@ public class OaFbdDocumentServiceImpl extends AbstractCrudService<OaFbdDocumentM
     private OaApprovalService oaApprovalService;
 
     @Override
-    public void add(OaFbdDocument oaFbdDocument) {
+    public void addOrUpDate(OaFbdDocument oaFbdDocument, JSONObject node) {
         // 校验表单数据
         validateDocument(oaFbdDocument);
 
-        Long userId = SecurityUtils.getUserId();
-        String username = SecurityUtils.getUsername();
-        Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
-        Integer tenantId = SecurityUtils.getTenantId();
-
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyMMddHHmmss");
-        LocalDateTime now = LocalDateTime.now();
-        String formattedDate = now.format(formatter);
-
-        LambdaQueryWrapper<OaFormDefinition> queryWrapper = Wrappers.lambdaQuery();
-        queryWrapper.select(OaFormDefinition::getFormSign).eq(OaFormDefinition::getId, oaFbdDocument.getFormId());
-        OaFormDefinition oaFormDefinition = oaFormDefinitionMapper.selectOne(queryWrapper);
-        String sign = oaFormDefinition.getFormSign();
-        String docNo = sign + "-" + formattedDate;
-
-        // 插入发布表数据
-        oaFbdDocument.setDocNo(docNo);
-        oaFbdDocument.setProposer(userId);
-        oaFbdDocument.setCreateBy(username);
-        oaFbdDocument.setCreateTime(now);
-        oaFbdDocument.setDeptId(deptId);
-        oaFbdDocument.setTenantId(tenantId);
-        oaFbdDocumentMapper.insert(oaFbdDocument);
-
-        // 插入单据表数据
-        OaDocument oaDocument = new OaDocument();
-        oaDocument.setFormId(oaFbdDocument.getFormId());
-        oaDocument.setType(sign);
-        oaDocument.setDocNo(docNo);
-        oaDocument.setProposer(userId);
-        oaDocument.setDocStatus(oaFbdDocument.getDocStatus());
-        oaDocument.setCreateBy(username);
-        oaDocument.setCreateTime(oaFbdDocument.getCreateTime());
-        oaDocument.setDeptId(deptId);
-        oaDocument.setTenantId(tenantId);
-        oaDocumentMapper.insert(oaDocument);
-
-        // 插入审批表数据,第一条审批记录
-        if (oaFbdDocument.getDocStatus().equals(1)) {
-            getOaApproval(oaFbdDocument);
-        }
-    }
-
-    // 更新发布表数据
-    //@Transactional(rollbackFor = Exception.class)
-    @Transactional
-    @Override
-    public void update(OaFbdDocument oaFbdDocument) {
-        // 验证文档
-        validateDocument(oaFbdDocument);
-
-        // 获取当前用户和时间
         String username = SecurityUtils.getUsername();
         LocalDateTime now = LocalDateTime.now();
         Integer tenantId = SecurityUtils.getTenantId();
-
-        // 设置更新信息
-        oaFbdDocument.setUpdateBy(username);
-        oaFbdDocument.setUpdateTime(now);
-
-        // 更新发布表数据
-        oaFbdDocumentMapper.updateById(oaFbdDocument);
-
-        // 更新总单据状态
-        oaDocumentMapper.update(null, Wrappers.lambdaUpdate(OaDocument.class)
-                .eq(OaDocument::getDocNo, oaFbdDocument.getDocNo())
-                .set(OaDocument::getDocStatus, oaFbdDocument.getDocStatus())
-                .set(OaDocument::getUpdateBy, username)
-                .set(OaDocument::getUpdateTime, now)
-        );
-
-        // 如果文档状态为1,创建并插入审批记录
-        if (oaFbdDocument.getDocStatus() == 1) {
-            OaFbdDocument updatedDocument = oaFbdDocumentMapper.selectById(oaFbdDocument.getId());
-            getOaApproval(updatedDocument);
+        String sign = null;
+
+        if (oaFbdDocument.getId() == null) {
+            // 插入操作
+            Long userId = SecurityUtils.getUserId();
+            Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
+
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyMMddHHmmss");
+            String formattedDate = now.format(formatter);
+
+            LambdaQueryWrapper<OaFormDefinition> queryWrapper = Wrappers.lambdaQuery();
+            queryWrapper.select(OaFormDefinition::getFormSign).eq(OaFormDefinition::getId, oaFbdDocument.getFormId());
+            OaFormDefinition oaFormDefinition = oaFormDefinitionMapper.selectOne(queryWrapper);
+            sign = oaFormDefinition.getFormSign();
+            String docNo = sign + "-" + formattedDate;
+
+            oaFbdDocument.setDocNo(docNo);
+            oaFbdDocument.setProposer(userId);
+            oaFbdDocument.setCreateBy(username);
+            oaFbdDocument.setCreateTime(now);
+            oaFbdDocument.setDeptId(deptId);
+            oaFbdDocument.setTenantId(tenantId);
+            oaFbdDocumentMapper.insert(oaFbdDocument);
+
+            // 插入单据表数据
+            OaDocument oaDocument = new OaDocument();
+            oaDocument.setFormId(oaFbdDocument.getFormId());
+            oaDocument.setType(sign);
+            oaDocument.setDocNo(docNo);
+            oaDocument.setProposer(userId);
+            oaDocument.setDocStatus(oaFbdDocument.getDocStatus());
+            oaDocument.setCreateBy(username);
+            oaDocument.setCreateTime(now);
+            oaDocument.setDeptId(deptId);
+            oaDocument.setTenantId(tenantId);
+            oaDocumentMapper.insert(oaDocument);
+
+            if (oaFbdDocument.getDocStatus().equals(1)) {
+                getOaApproval(oaFbdDocument);
+            }
+        } else {
+            // 更新操作
+            oaFbdDocument.setUpdateBy(username);
+            oaFbdDocument.setUpdateTime(now);
+            oaFbdDocumentMapper.updateById(oaFbdDocument);
+
+            oaDocumentMapper.update(null, Wrappers.lambdaUpdate(OaDocument.class)
+                    .eq(OaDocument::getDocNo, oaFbdDocument.getDocNo())
+                    .set(OaDocument::getDocStatus, oaFbdDocument.getDocStatus())
+                    .set(OaDocument::getUpdateBy, username)
+                    .set(OaDocument::getUpdateTime, now)
+            );
+
+            if (oaFbdDocument.getDocStatus() == 1) {
+                OaFbdDocument updatedDocument = oaFbdDocumentMapper.selectById(oaFbdDocument.getId());
+                getOaApproval(updatedDocument);
+            }
+
+            sign = oaFbdDocumentMapper.selectById(oaFbdDocument.getId()).getDocNo().split("-")[0];
         }
+        oaApprovalGeneration.nodeSave(node, sign);
     }
 
     // 获取审批表数据
@@ -157,8 +145,6 @@ public class OaFbdDocumentServiceImpl extends AbstractCrudService<OaFbdDocumentM
 
         switch (oaNode.getNodeScope()) {
             case 0:
-            case 1:
-            case 2:
                 userIds = Arrays.stream(oaNode.getProposer().split(",")).map(Long::parseLong).collect(Collectors.toList());
                 break;
             case 3:
@@ -191,16 +177,17 @@ public class OaFbdDocumentServiceImpl extends AbstractCrudService<OaFbdDocumentM
             approval.setTenantId(oaFbdDocument.getTenantId());
             approval.setNodeId(oaNode.getId());
             oaApprovalMapper.insert(approval);
+
+            oaSendMessageCenter.sendAsyncMessage(
+                    oaFbdDocument.getCreateBy(),
+                    approval.getApprovalUid(),
+                    oaFbdDocument.getId(),
+                    userIds,
+                    3,
+                    oaApprovalService.getFieldInfo(oaFbdDocument.getDocNo())
+            );
         }
 
-        oaSendMessageCenter.sendAsyncMessage(
-                oaFbdDocument.getCreateBy(),
-                oaFbdDocument.getProposer(),
-                oaFbdDocument.getId(),
-                userIds,
-                3,
-                oaApprovalService.getFieldInfo(oaFbdDocument.getDocNo())
-        );
     }
 
     /**

+ 3 - 0
service-oa/service-oa-biz/src/main/java/com/usky/oa/service/impl/OaFormDefinitionServiceImpl.java

@@ -18,7 +18,9 @@ import com.usky.oa.service.vo.OaFormNameResponseVO;
 import com.usky.system.domain.SysUser;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.time.LocalDateTime;
 import java.util.*;
@@ -58,6 +60,7 @@ public class OaFormDefinitionServiceImpl extends AbstractCrudService<OaFormDefin
      * @param oaFormDefinition 表单定义对象,包含表单的详细信息
      * @throws BusinessException 当表单名称或标识不符合规范或已存在时抛出
      */
+    @Transactional
     @Override
     public void addForm(OaFormDefinition oaFormDefinition) {
 

+ 24 - 36
service-oa/service-oa-biz/src/main/java/com/usky/oa/service/utils/OaApprovalGeneration.java

@@ -14,16 +14,11 @@ import com.usky.system.domain.SysUser;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Configuration;
 import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
+import java.time.LocalDateTime;
 import java.util.List;
-import java.util.stream.Collectors;
 
 /**
  *
@@ -47,9 +42,6 @@ public class OaApprovalGeneration {
     @Autowired
     private SysUserMapper sysUserMapper;
 
-    @Autowired
-    private OaSendMessageCenter oaSendMessageCenter;
-
     /**
      * @description: 新增流程与节点信息
      * @author: fyc
@@ -58,7 +50,6 @@ public class OaApprovalGeneration {
      * @param: [oaFormDefinition]
      * @return: void
      **/
-    @Async
     public void addGenerate(OaFormDefinition oaFormDefinition) {
         // 新增流程数据
         OaFlow oaFlow = new OaFlow();
@@ -96,14 +87,10 @@ public class OaApprovalGeneration {
 
                 switch (nodeScope) {
                     case 0:
-                    case 2:
                         proposer = node.getString("appointApprover");
                         break;
                     case 1:
-                        Long deptLeader = getDeptLeader();
-                        if (deptLeader != null) {
-                            proposer = deptLeader.toString();
-                        }
+                    case 2:
                         break;
                     case 3:
                         deptId2 = node.getInteger("deptId");
@@ -134,7 +121,6 @@ public class OaApprovalGeneration {
         }
     }
 
-    @Async
     public void updateGenerate(OaFormDefinition oaFormDefinition) {
         Integer formId = oaFormDefinition.getId();
         OaFlow flow = oaFlowMapper.selectOne(Wrappers.lambdaQuery(OaFlow.class).eq(OaFlow::getFormId, formId));
@@ -164,14 +150,10 @@ public class OaApprovalGeneration {
 
                 switch (nodeScope) {
                     case 0:
-                    case 2:
                         proposer = node.getString("appointApprover");
                         break;
                     case 1:
-                        Long deptLeader = getDeptLeader();
-                        if (deptLeader != null) {
-                            proposer = deptLeader.toString();
-                        }
+                    case 2:
                         break;
                     case 3:
                         deptId2 = node.getInteger("deptId");
@@ -197,7 +179,26 @@ public class OaApprovalGeneration {
         }
     }
 
-    private Long getDeptLeader() {
+    public void nodeSave(JSONObject jsonObject, String sign) {
+        Integer flowId = selectBySign(sign).getId();
+        List<JSONObject> nodeList = jsonObject.getJSONArray("node").toJavaList(JSONObject.class);
+        String proposer = null;
+        for (JSONObject node : nodeList) {
+            String nodeNo = node.getString("nodebh");
+            Integer nodeScope = node.getInteger("nodeScope");
+            proposer = node.getString("appointApprover");
+
+            OaNode oaNode = new OaNode();
+            if (nodeScope == 1) {
+                oaNode.setProposer(getDeptLeader().toString());
+            } else if (nodeScope == 2) {
+                oaNode.setProposer(proposer);
+            }
+            oaNodeMapper.update(oaNode, new LambdaQueryWrapper<OaNode>().eq(OaNode::getFlowId, flowId).eq(OaNode::getNodeNo, nodeNo));
+        }
+    }
+
+    public Long getDeptLeader() {
         Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
         Integer tenantId = SecurityUtils.getTenantId();
 
@@ -206,20 +207,7 @@ public class OaApprovalGeneration {
                 .eq(SysDept::getDeptId, deptId)
                 .select(SysDept::getLeader);
         SysDept deptLeader = sysDeptMapper.selectOne(deptLeaderQuery);
-        String leader = deptLeader.getLeader();
-
-        LambdaQueryWrapper<SysUser> userQuery = new LambdaQueryWrapper<>();
-        userQuery.select(SysUser::getUserId)
-                .eq(SysUser::getTenantId, tenantId)
-                .eq(SysUser::getUserName, leader);
-        SysUser sysUser = sysUserMapper.selectOne(userQuery);
-        return sysUser.getUserId();
-    }
-
-    @Async
-    public void generateApproval(OaApproval approval) {
-        LambdaQueryWrapper<OaApproval> approvalQuery = new LambdaQueryWrapper<>();
-
+        return Long.valueOf(deptLeader.getLeader());
     }
 
     // 根据单据类型获取流程信息

+ 32 - 16
service-oa/service-oa-biz/src/main/java/com/usky/oa/service/utils/OaSendMessageCenter.java

@@ -10,6 +10,7 @@ import com.usky.oa.mapper.OaFormDefinitionMapper;
 import com.usky.oa.mapper.SysUserMapper;
 import com.usky.oa.service.enums.OaBuiltInDocument;
 import com.usky.system.RemoteMceService;
+import com.usky.system.domain.MceRequestVO;
 import com.usky.system.domain.SysUser;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -49,44 +50,59 @@ public class OaSendMessageCenter {
      * 异步发送消息
      *
      * @param username 提交人账号名
-     * @param submitterId 提交人id
+     * @param approvalUid 审批人userId
      * @param id 数据id
      * @param receivers 接收人userId集合
      * @param isPass 是否通过(0:不通过,1:通过)
+     * @param sign 申请单类型
      */
-    @Async
-    public void sendAsyncMessage(String username, Long submitterId, Integer id, List<Long> receivers, Integer isPass, String sign) {
+    @Async("asyncServiceExecutor")
+    public void sendAsyncMessage(String username, Long approvalUid, Integer id, List<Long> receivers, Integer isPass, String sign) {
 
         log.info(username + "的申请开始发送消息中心-----------------------------------");
 
         LambdaQueryWrapper<SysUser> nickNameQuery = Wrappers.lambdaQuery();
         nickNameQuery.select(SysUser::getNickName)
-                .eq(SysUser::getUserId, submitterId);
-        SysUser nickName = sysUserMapper.selectOne(nickNameQuery);
-        JSONObject jsonObject = new JSONObject();
-        jsonObject.put("infoTitle", INFO_TITLE);
+                .eq(SysUser::getUserId, approvalUid);
+        SysUser user = sysUserMapper.selectOne(nickNameQuery);
+
+        // JSONObject jsonObject = new JSONObject();
+        // jsonObject.put("infoTitle", INFO_TITLE);
+
+        MceRequestVO mceRequestVO = new MceRequestVO();
+        mceRequestVO.setInfoTitle(INFO_TITLE);
 
         switch (isPass) {
             case 0:
-                jsonObject.put("infoContent", nickName.getNickName() + INFO_APPROVE_FAIL);
+                // jsonObject.put("infoContent", nickName.getNickName() + INFO_APPROVE_FAIL);
+                mceRequestVO.setInfoContent(user.getNickName() + INFO_APPROVE_FAIL);
                 break;
             case 1:
-                jsonObject.put("infoContent", nickName.getNickName() + INFO_APPROVE_SUCCESS);
+                // jsonObject.put("infoContent", nickName.getNickName() + INFO_APPROVE_SUCCESS);
+                mceRequestVO.setInfoContent(user.getNickName() + INFO_APPROVE_SUCCESS);
                 break;
             default:
                 OaBuiltInDocument oaBuiltInDocument = OaBuiltInDocument.valueOf(sign);
                 String name = oaBuiltInDocument.getName();
-                jsonObject.put("infoContent", nickName.getNickName() + "的" + name + INFO_CONTENT);
+                // jsonObject.put("infoContent", username + "的" + name + INFO_CONTENT);
+                mceRequestVO.setInfoContent(username + "的" + name + INFO_CONTENT);
         }
 
-        jsonObject.put("infoType", INFO_TYPE);
-        jsonObject.put("id", id);
-        jsonObject.put("infoTypeName", INFO_TITLE);
-        jsonObject.put("userName", username);
-        jsonObject.put("userIds", receivers);
+        // jsonObject.put("infoType", INFO_TYPE);
+        // jsonObject.put("id", id);
+        // jsonObject.put("infoTypeName", INFO_TITLE);
+        // jsonObject.put("userName", username);
+        // jsonObject.put("userIds", receivers);
+
+        mceRequestVO.setInfoType(String.valueOf(INFO_TYPE));
+        mceRequestVO.setId(id);
+        mceRequestVO.setInfoTypeName(INFO_TITLE);
+        mceRequestVO.setUserName(username);
+        mceRequestVO.setUserIds(receivers);
         try {
             // 推送消息中心
-            ApiResult<Void> voidApiResult = remoteMceService.addMce(jsonObject.toString());
+            //ApiResult<Void> voidApiResult = remoteMceService.addMce(jsonObject.toString());
+            ApiResult<Void> voidApiResult = remoteMceService.addMceReceive(mceRequestVO);
 
             if (voidApiResult.isSuccess()) {
                 log.info("申请消息发送成功!");

+ 20 - 0
service-pm/pom.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>usky-modules</artifactId>
+        <groupId>com.usky</groupId>
+        <version>0.0.1</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>service-pm</artifactId>
+
+    <packaging>pom</packaging>
+    <version>0.0.1</version>
+
+    <modules>
+        <module>service-pm-biz</module>
+        <module>service-pm-api</module>
+    </modules>
+</project>

+ 27 - 0
service-pm/service-pm-api/pom.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>service-pm</artifactId>
+        <groupId>com.usky</groupId>
+        <version>0.0.1</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>service-pm-api</artifactId>
+    <!-- SpringCloud Openfeign -->
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.usky</groupId>
+            <artifactId>usky-common-core</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>${project.artifactId}</finalName>
+    </build>
+
+</project>

+ 15 - 0
service-pm/service-pm-api/src/main/java/com/usky/pm/RemotePmService.java

@@ -0,0 +1,15 @@
+package com.usky.pm;
+
+import com.usky.pm.factory.RemotePmFactory;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+
+@FeignClient(contextId = "remotePmService", value = "service-pm" , fallbackFactory = RemotePmFactory.class)
+public interface RemotePmService {
+
+    @GetMapping("/executeTimedSending")
+    void executeTimedSending();
+
+    @GetMapping("/reportSubmissionReminder")
+    void reportSubmissionReminder();
+}

+ 29 - 0
service-pm/service-pm-api/src/main/java/com/usky/pm/RemotePmTaskService.java

@@ -0,0 +1,29 @@
+package com.usky.pm;
+
+
+import com.usky.pm.factory.RemotePmTaskFactory;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+@FeignClient(contextId = "RemotePmTaskService", value = "service-pm" , fallbackFactory = RemotePmTaskFactory.class)
+public interface RemotePmTaskService {
+
+    @GetMapping("/dataOverviewJobData")
+    void dataOverviewJobData();
+
+    @GetMapping("/deviceStatus")
+    void deviceStatus();
+
+    @GetMapping("/deviceOffLineAlarm")
+    void deviceOffLineAlarm();
+
+    @GetMapping("/customInfoStatus")
+    void customInfoStatus();
+
+    @GetMapping("/addDeviceInfo")
+    void addDeviceInfo(@RequestParam("productCode") String productCode, @RequestParam(value = "deviceUuid") String deviceUuid, @RequestParam(value = "deviceId") String deviceId, @RequestParam(value = "deviceName") String deviceName, @RequestParam(value = "installAddress") String installAddress, @RequestParam(value = "serviceStatus") Integer serviceStatus);
+
+    @GetMapping("/deleteDeviceInfo")
+    void deleteDeviceInfo(@RequestParam(value = "deviceUuid") String deviceUuid);
+}

+ 105 - 0
service-pm/service-pm-api/src/main/java/com/usky/pm/domain/SysUserVO.java

@@ -0,0 +1,105 @@
+package com.usky.pm.domain;
+
+
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Data
+public class SysUserVO {
+
+    /**
+     * 用户ID
+     */
+    private Long userId;
+
+    /**
+     * 部门ID
+     */
+    private Long deptId;
+
+    /**
+     * 用户账号
+     */
+    private String userName;
+
+    /**
+     * 用户昵称
+     */
+    private String nickName;
+
+    /**
+     * 用户类型(00系统用户)
+     */
+    private String userType;
+
+    /**
+     * 用户邮箱
+     */
+    private String email;
+
+    /**
+     * 手机号码
+     */
+    private String phonenumber;
+
+    /**
+     * 用户性别(0男 1女 2未知)
+     */
+    private String sex;
+
+    /**
+     * 头像地址
+     */
+    private String avatar;
+
+    /**
+     * 密码
+     */
+    private String password;
+
+    /**
+     * 帐号状态(0正常 1停用)
+     */
+    private String status;
+
+    /**
+     * 删除标志(0代表存在 2代表删除)
+     */
+    private String delFlag;
+
+    /**
+     * 最后登录IP
+     */
+    private String loginIp;
+
+    /**
+     * 最后登录时间
+     */
+    private LocalDateTime loginDate;
+
+    /**
+     * 创建者
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更新者
+     */
+    private String updateBy;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}

+ 2 - 2
service-iot/service-iot-api/src/main/java/com/usky/iot/factory/RemotePmFactory.java → service-pm/service-pm-api/src/main/java/com/usky/pm/factory/RemotePmFactory.java

@@ -1,7 +1,7 @@
-package com.usky.iot.factory;
+package com.usky.pm.factory;
 
 import com.usky.common.core.exception.FeignBadRequestException;
-import com.usky.iot.RemotePmService;
+import com.usky.pm.RemotePmService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.cloud.openfeign.FallbackFactory;

+ 59 - 0
service-pm/service-pm-api/src/main/java/com/usky/pm/factory/RemotePmTaskFactory.java

@@ -0,0 +1,59 @@
+package com.usky.pm.factory;
+
+import com.usky.common.core.exception.FeignBadRequestException;
+import com.usky.pm.RemotePmTaskService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * 用户服务降级处理
+ *
+ * @author ruoyi
+ */
+@Component
+public class RemotePmTaskFactory implements FallbackFactory<RemotePmTaskService>
+{
+    private static final Logger log = LoggerFactory.getLogger(RemotePmTaskFactory.class);
+
+    @Override
+    public RemotePmTaskService create(Throwable throwable)
+    {
+        log.error("用户服务调用失败:{}", throwable.getMessage());
+        return new RemotePmTaskService()
+        {
+            @Override
+            public void dataOverviewJobData() {
+                throw new FeignBadRequestException(500,"数据概览数据定时生成异常"+throwable.getMessage());
+            }
+
+            @Override
+            public void deviceStatus() {
+                throw new FeignBadRequestException(500,"定时同步设备状态异常"+throwable.getMessage());
+            }
+
+            @Override
+            public void deviceOffLineAlarm() {
+                throw new FeignBadRequestException(500,"定时同步设备离线告警数据异常"+throwable.getMessage());
+            }
+
+            @Override
+            public void customInfoStatus() {
+                throw new FeignBadRequestException(500,"定时同步客户信息状态异常"+throwable.getMessage());
+            }
+
+            @Override
+            public void addDeviceInfo(String productCode, String deviceUuid, String deviceId, String deviceName, String installAddress, Integer serviceStatus) {
+                throw new FeignBadRequestException(500,"新增设备信息异常"+throwable.getMessage());
+            }
+
+            @Override
+            public void deleteDeviceInfo(String deviceUuid) {
+                throw new FeignBadRequestException(500,"删除设备信息异常"+throwable.getMessage());
+            }
+
+        };
+    }
+}

部分文件因为文件数量过多而无法显示