Procházet zdrojové kódy

Merge branch 'master' of http://47.111.81.118:3000/uskycloud/usky-modules into fu-dev

fuyuchuan před 1 měsícem
rodič
revize
ee2f086455
41 změnil soubory, kde provedl 1150 přidání a 303 odebrání
  1. 11 0
      service-eg/service-eg-biz/src/main/java/com/usky/eg/controller/web/EgDeviceController.java
  2. 15 0
      service-eg/service-eg-biz/src/main/java/com/usky/eg/domain/EgDevice.java
  3. 2 0
      service-eg/service-eg-biz/src/main/java/com/usky/eg/service/EgDeviceService.java
  4. 26 4
      service-eg/service-eg-biz/src/main/java/com/usky/eg/service/impl/EgDeviceServiceImpl.java
  5. 3 0
      service-eg/service-eg-biz/src/main/resources/mapper/eg/EgDeviceMapper.xml
  6. 5 2
      service-iot/service-iot-api/src/main/java/com/usky/iot/RemoteIotTaskService.java
  7. 3 0
      service-iot/service-iot-api/src/main/java/com/usky/iot/RemotePmService.java
  8. 7 2
      service-iot/service-iot-api/src/main/java/com/usky/iot/factory/RemoteIotTaskFactory.java
  9. 7 1
      service-iot/service-iot-api/src/main/java/com/usky/iot/factory/RemotePmFactory.java
  10. 5 0
      service-iot/service-iot-biz/pom.xml
  11. 20 20
      service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/api/DeviceStatusApi.java
  12. 5 0
      service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/api/PmTimedSendingApi.java
  13. 7 2
      service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/api/ServiceIotTaskApi.java
  14. 2 1
      service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/web/DeviceHttpController.java
  15. 54 32
      service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/web/DmpDeviceInfoController.java
  16. 2 1
      service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/web/DmpDeviceTypeController.java
  17. 31 2
      service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/web/PmTimeConfController.java
  18. 1 1
      service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/web/PmWorkContentController.java
  19. 5 0
      service-iot/service-iot-biz/src/main/java/com/usky/iot/domain/DmpDeviceStatus.java
  20. 3 2
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/BaseAlarmService.java
  21. 26 2
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/DmpDeviceInfoService.java
  22. 1 1
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/DmpDeviceTypeService.java
  23. 16 2
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/PmTimeConfService.java
  24. 4 0
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/PmWorkReportService.java
  25. 34 0
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/enums/TopicInfo.java
  26. 25 21
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/BaseAlarmServiceImpl.java
  27. 2 0
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/BaseBuildFacilityServiceImpl.java
  28. 509 181
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/DmpDeviceInfoServiceImpl.java
  29. 3 2
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/DmpDeviceTypeServiceImpl.java
  30. 18 0
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/DmpProductInfoServiceImpl.java
  31. 27 8
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/PmTimeConfServiceImpl.java
  32. 0 2
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/PmWorkContentServiceImpl.java
  33. 69 9
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/PmWorkReportServiceImpl.java
  34. 23 0
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/vo/DmpHttpAlarmResponseVO.java
  35. 79 0
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/vo/DmpTopicRequestVO.java
  36. 57 0
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/vo/DmpTopicResponseVO.java
  37. 10 0
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/vo/FacilityDeviceResultVO.java
  38. 15 0
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/vo/PmSubmitCountResponseVO.java
  39. 1 1
      service-iot/service-iot-biz/src/main/resources/mapper/iot/BaseAlarmMapper.xml
  40. 15 3
      service-job/src/main/java/com/ruoyi/job/task/RyTask.java
  41. 2 1
      service-meeting/service-meeting-biz/src/main/java/com/usky/meeting/service/impl/MeetingInfoServiceImpl.java

+ 11 - 0
service-eg/service-eg-biz/src/main/java/com/usky/eg/controller/web/EgDeviceController.java

@@ -59,6 +59,17 @@ public class EgDeviceController {
         return ApiResult.success();
     }
 
+    /**
+     * 附加功能更新
+     * @param egDevice
+     * @return
+     */
+    @PutMapping("attachUpdate")
+    public ApiResult<Void> attachUpdate(@RequestBody EgDevice egDevice){
+        egDeviceService.attachUpdate(egDevice);
+        return ApiResult.success();
+    }
+
     /**
      * 删除
      * @param id

+ 15 - 0
service-eg/service-eg-biz/src/main/java/com/usky/eg/domain/EgDevice.java

@@ -108,6 +108,21 @@ public class EgDevice implements Serializable {
      */
     private Integer tenantId;
 
+    /**
+     * 屏保
+     */
+    private String imgPath;
+
+    /**
+     * 标识语
+     */
+    private String remark;
+
+    /**
+     * 开门方式
+     */
+    private String openMode;
+
     /**
      * 用户人脸信息记录
      */

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

@@ -25,6 +25,8 @@ public interface EgDeviceService extends CrudService<EgDevice> {
 
     void update(EgDevice egDevice);
 
+    void attachUpdate(EgDevice egDevice);
+
     void remove(Integer id);
 
     boolean checkNameUnique(EgDevice egDevice);

+ 26 - 4
service-eg/service-eg-biz/src/main/java/com/usky/eg/service/impl/EgDeviceServiceImpl.java

@@ -72,15 +72,25 @@ public class EgDeviceServiceImpl extends AbstractCrudService<EgDeviceMapper, EgD
                 .orderByDesc(EgDevice::getId);
         page = this.page(page,queryWrapper);
         if(page.getRecords().size() > 0){
+
+            LambdaQueryWrapper<MeetingFace> meetingFaceQuery = Wrappers.lambdaQuery();
+            meetingFaceQuery.eq(MeetingFace::getTenantId,tenantId);
+            List<MeetingFace> meetingAllFaceList = meetingFaceMapper.selectList(meetingFaceQuery);
+
             for (int i = 0; i < page.getRecords().size(); i++) {
                 if(Objects.nonNull(page.getRecords().get(i).getBindFace()) ||StringUtils.isNotBlank(page.getRecords().get(i).getBindFace())){
                     String[] fidListStr = page.getRecords().get(i).getBindFace().split(",");
                     Integer[] fidList = Arrays.stream(fidListStr).map(Integer::parseInt).toArray(Integer[]::new);
 
-                    LambdaQueryWrapper<MeetingFace> meetingFaceQuery = Wrappers.lambdaQuery();
-                    meetingFaceQuery.in(MeetingFace::getFid,Arrays.asList(fidList));
-                    List<MeetingFace> meetingFaceList = meetingFaceMapper.selectList(meetingFaceQuery);
-
+                    List<MeetingFace> meetingFaceList = new ArrayList<>();
+                    for (int j = 0; j < fidList.length; j++) {
+                        for (int k = 0; k < meetingAllFaceList.size(); k++) {
+                            if(fidList[j] == meetingAllFaceList.get(k).getFid()){
+                                meetingFaceList.add(meetingAllFaceList.get(k));
+                                break;
+                            }
+                        }
+                    }
                     page.getRecords().get(i).setMeetingFaceList(meetingFaceList);
                 }
 
@@ -166,6 +176,18 @@ public class EgDeviceServiceImpl extends AbstractCrudService<EgDeviceMapper, EgD
         }
     }
 
+    @Override
+    public void attachUpdate(EgDevice egDevice){
+        if(checkNameUnique(egDevice)){
+            throw new BusinessException("更新门禁设备附加功能'"+egDevice.getDeviceId()+"'失败,设备已存在");
+        }
+
+        egDevice.setUpdateBy(SecurityUtils.getUsername());
+        egDevice.setUpdateTime(LocalDateTime.now());
+
+        this.updateById(egDevice);
+    }
+
     @Override
     public void remove(Integer id){
         EgDevice egDevice = this.getById(id);

+ 3 - 0
service-eg/service-eg-biz/src/main/resources/mapper/eg/EgDeviceMapper.xml

@@ -20,6 +20,9 @@
         <result column="update_time" property="updateTime" />
         <result column="dept_id" property="deptId" />
         <result column="tenant_id" property="tenantId" />
+        <result column="img_path" property="imgPath" />
+        <result column="remark" property="remark" />
+        <result column="open_mode" property="openMode" />
     </resultMap>
     <insert id="insertMeetingFaceDevice" parameterType="integer">
         insert into meeting_face_device (face_id,device_id) value (#{fid}, #{egDeviceId});

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

@@ -14,8 +14,11 @@ public interface RemoteIotTaskService {
     @GetMapping("/dataOverviewJobData")
     void dataOverviewJobData();
 
-    @GetMapping("/baseAlarmStatus")
-    void baseAlarmStatus();
+    @GetMapping("/deviceStatus")
+    void deviceStatus();
+
+    @GetMapping("/deviceOffLineAlarm")
+    void deviceOffLineAlarm();
 
     @GetMapping("/customInfoStatus")
     void customInfoStatus();

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

@@ -10,4 +10,7 @@ public interface RemotePmService {
 
     @GetMapping("/executeTimedSending")
     void executeTimedSending();
+
+    @GetMapping("/reportSubmissionReminder")
+    void reportSubmissionReminder();
 }

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

@@ -32,8 +32,13 @@ public class RemoteIotTaskFactory implements FallbackFactory<RemoteIotTaskServic
             }
 
             @Override
-            public void baseAlarmStatus() {
-                throw new FeignBadRequestException(500,"定时同步设备状态和设备告警数据异常"+throwable.getMessage());
+            public void deviceStatus() {
+                throw new FeignBadRequestException(500,"定时同步设备状态异常"+throwable.getMessage());
+            }
+
+            @Override
+            public void deviceOffLineAlarm() {
+                throw new FeignBadRequestException(500,"定时同步设备离线告警数据异常"+throwable.getMessage());
             }
 
             @Override

+ 7 - 1
service-iot/service-iot-api/src/main/java/com/usky/iot/factory/RemotePmFactory.java

@@ -21,14 +21,20 @@ public class RemotePmFactory implements FallbackFactory<RemotePmService>
     @Override
     public RemotePmService create(Throwable throwable)
     {
-        log.error("用户服务调用失败:{}", throwable.getMessage());
         return new RemotePmService()
         {
             @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());
+            }
+
         };
     }
 }

+ 5 - 0
service-iot/service-iot-biz/pom.xml

@@ -19,6 +19,11 @@
             <artifactId>service-backend-api</artifactId>
             <version>0.0.1</version>
         </dependency>
+        <dependency>
+            <groupId>com.usky</groupId>
+            <artifactId>data-tsdb-proxy-api</artifactId>
+            <version>0.0.1</version>
+        </dependency>
         <dependency>
             <groupId>com.usky</groupId>
             <artifactId>data-transfer-api</artifactId>

+ 20 - 20
service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/api/DeviceStatusApi.java

@@ -1,20 +1,20 @@
-package com.usky.iot.controller.api;
-
-import com.usky.iot.client.DeviceStatusClient;
-import com.usky.iot.service.BaseAlarmService;
-import io.swagger.annotations.Api;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-@Api(tags = "数据统一查询RPC")
-public class DeviceStatusApi implements DeviceStatusClient {
-
-    @Autowired
-    private BaseAlarmService baseAlarmService;
-
-    public void status(){
-        baseAlarmService.status();
-    }
-
-}
+//package com.usky.iot.controller.api;
+//
+//import com.usky.iot.client.DeviceStatusClient;
+//import com.usky.iot.service.DmpDeviceInfoService;
+//import io.swagger.annotations.Api;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.web.bind.annotation.RestController;
+//
+//@RestController
+//@Api(tags = "数据统一查询RPC")
+//public class DeviceStatusApi implements DeviceStatusClient {
+//
+//    @Autowired
+//    private DmpDeviceInfoService dmpDeviceInfoService;
+//
+//    public void status(){
+//        dmpDeviceInfoService.deviceStatus();
+//    }
+//
+//}

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

@@ -26,4 +26,9 @@ public class PmTimedSendingApi implements RemotePmService {
         pmWorkReportService.timedSending(now);
     }
 
+    @Override
+    public void reportSubmissionReminder() {
+        pmWorkReportService.reportSubmissionReminder();
+    }
+
 }

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

@@ -34,8 +34,13 @@ public class ServiceIotTaskApi implements RemoteIotTaskService {
     }
 
     @Override
-    public void baseAlarmStatus() {
-        baseAlarmService.status();
+    public void deviceStatus() {
+        dmpDeviceInfoService.deviceStatus();
+    }
+
+    @Override
+    public void deviceOffLineAlarm() {
+        baseAlarmService.deviceOffLineAlarm();
     }
 
     @Override

+ 2 - 1
service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/web/DeviceHttpController.java

@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
 
 import java.io.IOException;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -42,7 +43,7 @@ public class DeviceHttpController {
 
     @GetMapping(value = "/status")
     public ApiResult<Void> status(){
-        baseAlarmService.status();
+        dmpDeviceInfoService.deviceStatus();
         return ApiResult.success();
     }
 

+ 54 - 32
service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/web/DmpDeviceInfoController.java

@@ -1,27 +1,20 @@
 package com.usky.iot.controller.web;
 
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.usky.backend.domain.*;
 import com.usky.common.core.bean.ApiResult;
 import com.usky.common.core.bean.CommonPage;
 import com.usky.common.core.utils.poi.ExcelUtil;
-import com.usky.iot.domain.BaseFacilityDevice;
+import com.usky.demo.domain.LastInnerQueryVO;
 import com.usky.iot.domain.DmpDeviceInfo;
 import com.usky.iot.service.DmpDeviceInfoService;
-import com.usky.iot.service.vo.BaseFacilityDeviceVO;
-import com.usky.iot.service.vo.DmpDeviceInfoRequest;
+import com.usky.iot.service.vo.*;
 import io.swagger.annotations.ApiOperation;
 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 javax.validation.constraints.NotNull;
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -44,7 +37,7 @@ public class DmpDeviceInfoController {
      * @return
      */
     @PostMapping
-    public ApiResult<Void> add(@RequestBody DmpDeviceInfo dmpDeviceInfo){
+    public ApiResult<Void> add(@RequestBody DmpDeviceInfo dmpDeviceInfo) {
         dmpDeviceInfoService.add(dmpDeviceInfo);
         return ApiResult.success();
     }
@@ -55,11 +48,21 @@ public class DmpDeviceInfoController {
      * @return
      */
     @PutMapping
-    public ApiResult<Void> edit(@RequestBody DmpDeviceInfo dmpDeviceInfo){
+    public ApiResult<Void> edit(@RequestBody DmpDeviceInfo dmpDeviceInfo) {
         dmpDeviceInfoService.update(dmpDeviceInfo);
         return ApiResult.success();
     }
 
+    /**
+     * 更新设备列表状态
+     * @param queryVO
+     * @return
+     */
+    @PostMapping("updateDeviceStatus")
+    public ApiResult<Void> updateDeviceStatus(@RequestBody LastInnerQueryVO queryVO){
+        dmpDeviceInfoService.updateDeviceStatus(queryVO);
+        return ApiResult.success();
+    }
 
     /**
      * 分页
@@ -67,8 +70,7 @@ public class DmpDeviceInfoController {
      * @return
      */
     @PostMapping("/page")
-    public ApiResult<CommonPage<DmpDeviceInfo>> page(@RequestBody DmpDeviceInfoRequest dmpDeviceInfoRequest)
-    {
+    public ApiResult<CommonPage<DmpDeviceInfo>> page(@RequestBody DmpDeviceInfoRequest dmpDeviceInfoRequest) {
         return ApiResult.success(dmpDeviceInfoService.page(dmpDeviceInfoRequest));
     }
 
@@ -79,8 +81,7 @@ public class DmpDeviceInfoController {
      * @return
      */
     @PostMapping("/pageWhite")
-    public ApiResult<CommonPage<DmpDeviceInfo>> pageWhite(@RequestBody DmpDeviceInfoRequest dmpDeviceInfoRequest)
-    {
+    public ApiResult<CommonPage<DmpDeviceInfo>> pageWhite(@RequestBody DmpDeviceInfoRequest dmpDeviceInfoRequest) {
         return ApiResult.success(dmpDeviceInfoService.pageWhite(dmpDeviceInfoRequest));
     }
 
@@ -88,8 +89,7 @@ public class DmpDeviceInfoController {
      * 删除记录
      */
     @DeleteMapping("/{id}")
-    public ApiResult<Void> remove(@PathVariable("id") Integer id)
-    {
+    public ApiResult<Void> remove(@PathVariable("id") Integer id) {
         dmpDeviceInfoService.remove(id);
         return ApiResult.success();
     }
@@ -100,7 +100,7 @@ public class DmpDeviceInfoController {
      * @return
      */
     @PostMapping("/addByFile")
-    public ApiResult<Void> addByFile(@RequestParam(value = "file") MultipartFile multipartFiles){
+    public ApiResult<Void> addByFile(@RequestParam(value = "file") MultipartFile multipartFiles) {
         dmpDeviceInfoService.addByFile(multipartFiles);
         return ApiResult.success();
     }
@@ -112,7 +112,7 @@ public class DmpDeviceInfoController {
      * @return
      */
     @PostMapping("/importDeviceInfo")
-    public ApiResult<Void> importDeviceInfo(@RequestBody List<DmpDeviceInfo> list){
+    public ApiResult<Void> importDeviceInfo(@RequestBody List<DmpDeviceInfo> list) {
         dmpDeviceInfoService.importDeviceInfo(list);
         return ApiResult.success();
     }
@@ -124,8 +124,8 @@ public class DmpDeviceInfoController {
      * @return
      */
     @PostMapping("/export")
-    public void export(@RequestBody DmpDeviceInfoRequest dmpDeviceInfoRequest, HttpServletResponse response){
-        dmpDeviceInfoService.export(dmpDeviceInfoRequest,response);
+    public void export(@RequestBody DmpDeviceInfoRequest dmpDeviceInfoRequest, HttpServletResponse response) {
+        dmpDeviceInfoService.export(dmpDeviceInfoRequest, response);
     }
 
     /**
@@ -139,12 +139,12 @@ public class DmpDeviceInfoController {
      * @return
      */
     @GetMapping("deviceCurrentDataList")
-    public ApiResult<CommonPage<Object>> deviceCurrentDataList(@RequestParam(value = "deviceName",required = false) String deviceName,
-                                                               @RequestParam(value = "installAddress",required = false) String installAddress,
-                                                               @RequestParam(value = "productCode",required = false) String productCode,
+    public ApiResult<CommonPage<Object>> deviceCurrentDataList(@RequestParam(value = "deviceName", required = false) String deviceName,
+                                                               @RequestParam(value = "installAddress", required = false) String installAddress,
+                                                               @RequestParam(value = "productCode", required = false) String productCode,
                                                                @RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
-                                                               @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize){
-        return ApiResult.success(dmpDeviceInfoService.deviceCurrentDataList(deviceName,installAddress,productCode,pageNum,pageSize));
+                                                               @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
+        return ApiResult.success(dmpDeviceInfoService.deviceCurrentDataList(deviceName, installAddress, productCode, pageNum, pageSize));
     }
 
     /**
@@ -154,7 +154,7 @@ public class DmpDeviceInfoController {
      * @return
      */
     @PostMapping("dataTVList")
-    public ApiResult<CommonPage<DataTVResponseVO>> dataTVList(@RequestBody DataTVRequestVO requestVO){
+    public ApiResult<CommonPage<DataTVResponseVO>> dataTVList(@RequestBody DataTVRequestVO requestVO) {
         return ApiResult.success(dmpDeviceInfoService.dataTVList(requestVO));
     }
 
@@ -165,7 +165,7 @@ public class DmpDeviceInfoController {
      * @return
      */
     @PostMapping("dataTVStatistic")
-    public ApiResult<List<DataTVStatisticResponseVO>> dataTVStatistic(@RequestBody DataTVRequestVO requestVO){
+    public ApiResult<List<DataTVStatisticResponseVO>> dataTVStatistic(@RequestBody DataTVRequestVO requestVO) {
         return ApiResult.success(dmpDeviceInfoService.dataTVStatistic(requestVO));
     }
 
@@ -176,7 +176,7 @@ public class DmpDeviceInfoController {
      */
     @PostMapping("deviceDataTotal")
     @ApiOperation("获取设备某个时间端内的汇总值")
-    public ApiResult<List<Map<String,Object>>> deviceDataTotal(@RequestBody DataTotalRequestVO requestVO){
+    public ApiResult<List<Map<String, Object>>> deviceDataTotal(@RequestBody DataTotalRequestVO requestVO) {
         return ApiResult.success(dmpDeviceInfoService.deviceDataTotal(requestVO));
     }
 
@@ -187,7 +187,7 @@ public class DmpDeviceInfoController {
      */
     @PostMapping("deviceDataAverage")
     @ApiOperation("获取设备日平均、月平均、年平均值")
-    public ApiResult<List<DataAverageResponseVO>> deviceDataAverage(@RequestBody DataAverageRequestVO requestVO){
+    public ApiResult<List<DataAverageResponseVO>> deviceDataAverage(@RequestBody DataAverageRequestVO requestVO) {
         return ApiResult.success(dmpDeviceInfoService.deviceDataAverage(requestVO));
     }
 
@@ -198,10 +198,32 @@ public class DmpDeviceInfoController {
      * @throws IOException
      */
     @PostMapping("deviceDataAverageExport")
-    public void export(@RequestBody DataAverageRequestVO requestVO, HttpServletResponse response) throws IOException{
+    public void export(@RequestBody DataAverageRequestVO requestVO, HttpServletResponse response) throws IOException {
         List<DataAverageExportVO> list = dmpDeviceInfoService.DataAverageExport(requestVO);
         ExcelUtil<DataAverageExportVO> util = new ExcelUtil<DataAverageExportVO>(DataAverageExportVO.class);
-        util.exportExcel(response,list,requestVO.getSheetName(),requestVO.getTitleName());
+        util.exportExcel(response, list, requestVO.getSheetName(), requestVO.getTitleName());
+    }
+
+    /**
+     * 获取设备topic列表
+     * @param requestVO
+     * @return
+     */
+    @PostMapping("topic")
+    public ApiResult<CommonPage<DmpTopicResponseVO>> topic(@RequestBody DmpTopicRequestVO requestVO) {
+        return ApiResult.success(dmpDeviceInfoService.topic(requestVO));
+    }
+
+    /**
+     * 获取设备告警请求信息
+     * @param deviceId 设备id
+     * @param productCode 产品编码
+     * @return
+     */
+    @GetMapping("alarmResponse")
+    public ApiResult<DmpHttpAlarmResponseVO> alarmResponse(@RequestParam(value = "deviceId") String deviceId,
+                                                           @RequestParam(value = "productCode") String productCode){
+        return ApiResult.success(dmpDeviceInfoService.alarmResponse(deviceId, productCode));
     }
 }
 

+ 2 - 1
service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/web/DmpDeviceTypeController.java

@@ -71,9 +71,10 @@ public class DmpDeviceTypeController {
     @GetMapping("getDeviceTypeList")
     public ApiResult<CommonPage<DmpDeviceType>> getDeviceTypeList(@RequestParam(value = "typeCode",required = false) String typeCode,
                                                                   @RequestParam(value = "typeName",required = false) String typeName,
+                                                                  @RequestParam(value = "typeDomain",required = false) Integer typeDomain,
                                                                   @RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
                                                                   @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize){
-        return ApiResult.success(dmpDeviceTypeService.getDeviceTypeList(typeCode,typeName,pageNum,pageSize));
+        return ApiResult.success(dmpDeviceTypeService.getDeviceTypeList(typeCode,typeName,typeDomain,pageNum,pageSize));
     }
 
     /**

+ 31 - 2
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.security.utils.SecurityUtils;
+import com.usky.iot.domain.PmTimeConf;
 import com.usky.iot.domain.PmWorkReport;
 import com.usky.iot.service.PmTimeConfService;
 import com.usky.iot.service.vo.PmSubmitCountResponseVO;
@@ -15,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
 
 /**
  * <p>
@@ -38,12 +42,27 @@ public class PmTimeConfController {
      */
     @GetMapping("/submitCount")
     public PmSubmitCountResponseVO submitCount(@RequestParam(value = "submitDate", required = false) String submitDate) {
-        if (submitDate == null || submitDate.isEmpty()) {
-            submitDate = LocalDate.now().toString();
+        if (submitDate == null) {
+            LocalDateTime now = LocalDateTime.now();
+            LocalDateTime today1800 = LocalDateTime.of(now.toLocalDate(), LocalTime.of(18, 0));
+            if (now.isBefore(today1800)) {
+                submitDate = now.toLocalDate().minusDays(1).toString();
+            } else {
+                submitDate = now.toLocalDate().toString();
+            }
         }
         return pmTimeConfService.submitCount(submitDate);
     }
 
+    /**
+     * 提交记录分页
+     * @param queryType 查询类型(0:按时提交,1:迟交,2:未提交)
+     * @param submitDate 提交日期
+     * @param reportId 报告id
+     * @param pageNum 页码
+     * @param pageSize 页大小
+     * @return 分页结果
+     */
     @GetMapping("/submitPage")
     public CommonPage<Object> submitPage(@RequestParam(value = "queryType", required = false, defaultValue = "0") Integer queryType,
                                          @RequestParam(value = "submitDate", required = false) String submitDate,
@@ -56,5 +75,15 @@ public class PmTimeConfController {
         return pmTimeConfService.submitPage(submitDate, queryType, reportId, pageNum, pageSize);
     }
 
+    /**
+     * 获取配置时间
+     * @return 配置时间
+     */
+    @GetMapping("/timeQuery")
+    public PmTimeConf timeQuery() {
+        Integer tenantId = SecurityUtils.getTenantId();
+        return pmTimeConfService.getTimeConf(tenantId);
+    }
+
 }
 

+ 1 - 1
service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/web/PmWorkContentController.java

@@ -112,7 +112,7 @@ public class PmWorkContentController {
     @GetMapping("/slide")
     public ApiResult<PmWorkReportSlideVO> slide(@RequestParam(value = "upOrDown", required = false) Integer upOrDown,
                                                 @RequestParam(value = "slideSum", required = false) Integer slideSum,
-                                                @RequestParam(value = "submitDate", required = true) LocalDateTime submitDate){
+                                                @RequestParam(value = "submitDate") LocalDateTime submitDate){
         return ApiResult.success(pmWorkContentService.slide(upOrDown, slideSum, submitDate));
     }
 

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

@@ -56,4 +56,9 @@ public class DmpDeviceStatus implements Serializable {
      * 产品编码
      */
     private String productCode;
+
+    /**
+     * 设备uuid
+     */
+    private String deviceUuid;
 }

+ 3 - 2
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/BaseAlarmService.java

@@ -8,6 +8,7 @@ import com.usky.iot.service.vo.BaseAlarmListVO;
 import com.usky.iot.service.vo.BaseAlarmRequestVO;
 import com.usky.iot.service.vo.BaseAlarmResponeVO;
 import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.List;
 import java.util.Map;
@@ -26,6 +27,8 @@ public interface BaseAlarmService extends CrudService<BaseAlarm> {
 
     CommonPage<BaseAlarm> page(BaseAlarmListVO baseAlarmListVO);
 
+    void deviceOffLineAlarm();
+
     CommonPage<BaseAlarmResponeVO> statistic_notoken(BaseAlarmRequestVO baseAlarmRequestVO);
 
     CommonPage<BaseAlarm> page_notoken(BaseAlarmListVO baseAlarmListVO);
@@ -36,8 +39,6 @@ public interface BaseAlarmService extends CrudService<BaseAlarm> {
 
     boolean add(BaseAlarm baseAlarm);
 
-    void status();
-
     /**
      * 综合云图-告警统计
      * @return

+ 26 - 2
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/DmpDeviceInfoService.java

@@ -3,9 +3,9 @@ package com.usky.iot.service;
 import com.usky.backend.domain.*;
 import com.usky.common.core.bean.CommonPage;
 import com.usky.common.mybatis.core.CrudService;
+import com.usky.demo.domain.LastInnerQueryVO;
 import com.usky.iot.domain.DmpDeviceInfo;
-import com.usky.iot.service.vo.BaseFacilityDeviceVO;
-import com.usky.iot.service.vo.DmpDeviceInfoRequest;
+import com.usky.iot.service.vo.*;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.multipart.MultipartFile;
@@ -33,6 +33,10 @@ public interface DmpDeviceInfoService extends CrudService<DmpDeviceInfo> {
 
     boolean checkNameUnique1(DmpDeviceInfo dmpDeviceInfo,Integer tenantId);
 
+    void deviceStatus();
+
+    void updateDeviceStatus(LastInnerQueryVO queryVO);
+
     CommonPage<DmpDeviceInfo> page(DmpDeviceInfoRequest dmpDeviceInfoRequest);
 
     CommonPage<DmpDeviceInfo> pageWhite(DmpDeviceInfoRequest dmpDeviceInfoRequest);
@@ -73,4 +77,24 @@ public interface DmpDeviceInfoService extends CrudService<DmpDeviceInfo> {
     List<DataAverageExportVO> DataAverageExport(DataAverageRequestVO requestVO);
 
     Map<String,Object> control(String productCode, String deviceUuid, String commandCode, String commandValue, String domain, Long userId, String userName);
+
+    /**
+     * @description: 获取设备topic列表
+     * @author: fyc
+     * @email yuchuan.fu@chinausky.com
+     * @date: 2025/2/7 17:49
+     * @param: [pageNum, pageSize]
+     * @return: java.util.List<com.usky.iot.service.vo.DmpTopicResponseVO>
+     **/
+    CommonPage<DmpTopicResponseVO> topic(DmpTopicRequestVO requestVO);
+
+    /**
+     * @description: 获取设备告警请求信息
+     * @author: fyc
+     * @email yuchuan.fu@chinausky.com
+     * @date: 2025/2/7 17:49
+     * @param: [deviceId, productCode]
+     * @return: com.usky.iot.service.vo.DmpHttpAlarmResponseVO
+     **/
+    DmpHttpAlarmResponseVO alarmResponse(String deviceId, String productCode);
 }

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

@@ -24,7 +24,7 @@ public interface DmpDeviceTypeService extends CrudService<DmpDeviceType> {
 
     void remove(Integer id);
 
-    CommonPage<DmpDeviceType> getDeviceTypeList(String typeCode, String typeName, Integer pageNum, Integer pageSize);
+    CommonPage<DmpDeviceType> getDeviceTypeList(String typeCode, String typeName, Integer typeDomain, Integer pageNum, Integer pageSize);
 
     List<DmpDeviceType> tenantIdDeviceTypeList();
 

+ 16 - 2
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/PmTimeConfService.java

@@ -6,6 +6,9 @@ import com.usky.common.mybatis.core.CrudService;
 import com.usky.iot.domain.PmWorkReport;
 import com.usky.iot.service.vo.PmSubmitCountResponseVO;
 
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
 /**
  * <p>
  * 工作报告提交时间配置表 服务类
@@ -24,8 +27,19 @@ public interface PmTimeConfService extends CrudService<PmTimeConf> {
     PmSubmitCountResponseVO submitCount(String submitDate);
 
     /**
-     * 获取提交列表
-     * @return
+     * 提交记录分页
+     * @param queryType 查询类型(0:按时提交,1:迟交,2:未提交)
+     * @param submitDate 提交日期
+     * @param reportId 报告id
+     * @param pageNum 页码
+     * @param pageSize 页大小
+     * @return 分页结果
      */
     CommonPage<Object> submitPage(String submitDate, Integer queryType, Integer reportId, Integer pageNum, Integer pageSize);
+
+    /**
+     * 获取提交时间
+     * @return
+     */
+    public PmTimeConf getTimeConf(Integer tenantId);
 }

+ 4 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/PmWorkReportService.java

@@ -59,4 +59,8 @@ public interface PmWorkReportService extends CrudService<PmWorkReport> {
      */
     List<PmWorkReport> timedReportQuery();
 
+    /**
+     * 报告提交定时提醒
+     */
+    void reportSubmissionReminder();
 }

+ 34 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/enums/TopicInfo.java

@@ -0,0 +1,34 @@
+package com.usky.iot.service.enums;
+
+/**
+ *
+ * @author fyc
+ * @email yuchuan.fu@chinausky.com
+ * @date 2025/2/7
+ */
+public enum TopicInfo {
+
+    GATEWAY_DEVICE("网关设备","gatewayDevice"),
+    IOT_PLATFORM("物联网平台","IoTPlatform"),
+    ADD_REMARKS("网关设备添加子设备","add"),
+    INFO_REMARKS("网关设备指标数据上报","info"),
+    CONTROL_REMARKS("网关设备命令下发","control"),
+    CONTROL_RESPONSE_REMARKS("网关设备命令响应","controlResponse");
+
+    private String value;
+    private String letter;
+
+    TopicInfo(String value, String letter){
+        this.value = value;
+        this.letter = letter;
+    }
+
+
+    public String getValue() {
+        return value;
+    }
+
+    public String getLetter(){
+        return letter;
+    }
+}

+ 25 - 21
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/BaseAlarmServiceImpl.java

@@ -14,6 +14,9 @@ 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;
@@ -69,6 +72,9 @@ public class BaseAlarmServiceImpl extends AbstractCrudService<BaseAlarmMapper, B
     @Autowired
     private DataQueryClient dataQueryClient;
 
+    @Autowired
+    private RemoteTsdbProxyService remoteTsdbProxyService;
+
     @Autowired
     private DmpDeviceStatusService dmpDeviceStatusService;
 
@@ -619,16 +625,25 @@ public class BaseAlarmServiceImpl extends AbstractCrudService<BaseAlarmMapper, B
     }
 
     @Override
-    public void status(){
-        log.info("定时同步设备状态和设备告警数据 start");
-        ApiResult<List<StatusVO>> resultList = dataQueryClient.status();
-        List<StatusVO> list = resultList.getData();
-        if(CollectionUtils.isNotEmpty(list)){
-            List<String> devList = new ArrayList<>();
-            for(int i=0;i<list.size();i++){
-                devList.add(list.get(i).getDeviceId());
+    public void deviceOffLineAlarm(){
+        log.info("定时同步设备告警数据 start");
+        List<StatusVO> list = new ArrayList<>();
+        List<String> devList = new ArrayList<>();
+        LambdaQueryWrapper<DmpDeviceStatus> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.select(DmpDeviceStatus::getProductCode,DmpDeviceStatus::getDeviceId,DmpDeviceStatus::getLastOnlineTime);
+        List<DmpDeviceStatus> dmpDeviceStatusList = dmpDeviceStatusService.list(queryWrapper);
+        if(CollectionUtils.isNotEmpty(dmpDeviceStatusList)){
+            for (int i = 0; i < dmpDeviceStatusList.size(); i++) {
+                StatusVO statusVO = new StatusVO();
+                statusVO.setProductCode(dmpDeviceStatusList.get(i).getProductCode());
+                statusVO.setDeviceId(dmpDeviceStatusList.get(i).getDeviceId());
+                statusVO.setTime(dmpDeviceStatusList.get(i).getLastOnlineTime());
+                list.add(statusVO);
+                devList.add(dmpDeviceStatusList.get(i).getDeviceId());
             }
+        }
 
+        if(CollectionUtils.isNotEmpty(list)){
             List<DmpDeviceInfo> devInfoList = new ArrayList<>();
             List<BaseAlarm> baseUnAlarmList = new ArrayList<>();
 //            List<BaseAlarm> baseAlarmList = new ArrayList<>();
@@ -640,14 +655,8 @@ public class BaseAlarmServiceImpl extends AbstractCrudService<BaseAlarmMapper, B
 
             if(CollectionUtils.isNotEmpty(devInfoList)){
                 for(int i=0;i<list.size();i++){
-                    String date =  list.get(i).getTime().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,list.get(i).getTime())
-                                .eq(DmpDeviceStatus::getDeviceId,list.get(i).getDeviceId())
-                                .eq(DmpDeviceStatus::getProductCode,list.get(i).getProductCode());
+                    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++){
@@ -666,10 +675,6 @@ public class BaseAlarmServiceImpl extends AbstractCrudService<BaseAlarmMapper, B
                         }
 
                     }else{
-                        updateWrapper.set(DmpDeviceStatus::getDeviceStatus,2)  //设备离线
-                                .set(DmpDeviceStatus::getLastOfflineTime,list.get(i).getTime())
-                                .eq(DmpDeviceStatus::getDeviceId,list.get(i).getDeviceId())
-                                .eq(DmpDeviceStatus::getProductCode,list.get(i).getProductCode());
 
                         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())){
@@ -699,12 +704,11 @@ public class BaseAlarmServiceImpl extends AbstractCrudService<BaseAlarmMapper, B
                         }
 
                     }
-                    dmpDeviceStatusService.update(updateWrapper);
                 }
             }
 
         }
-        log.info("定时同步设备状态和设备告警数据 end");
+        log.info("定时同步设备告警数据 end");
     }
 
     @Override

+ 2 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/BaseBuildFacilityServiceImpl.java

@@ -328,6 +328,8 @@ public class BaseBuildFacilityServiceImpl extends AbstractCrudService<BaseBuildF
                             if(list2.get(i).getDeviceId().equals(deviceInfoList.get(j).getDeviceId())){
                                 resultVO.setDeviceName(deviceInfoList.get(j).getDeviceName());
                                 resultVO.setDeviceAddress(deviceInfoList.get(j).getInstallAddress());
+                                resultVO.setDeviceId(deviceInfoList.get(j).getDeviceId());
+                                resultVO.setProductCode(deviceInfoList.get(j).getProductCode());
                             }
                         }
                     }

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 509 - 181
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/DmpDeviceInfoServiceImpl.java


+ 3 - 2
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/DmpDeviceTypeServiceImpl.java

@@ -84,11 +84,12 @@ public class DmpDeviceTypeServiceImpl extends AbstractCrudService<DmpDeviceTypeM
     }
 
     @Override
-    public CommonPage<DmpDeviceType> getDeviceTypeList(String typeCode, String typeName, Integer pageNum, Integer pageSize) {
+    public CommonPage<DmpDeviceType> getDeviceTypeList(String typeCode, String typeName, Integer typeDomain, Integer pageNum, Integer pageSize) {
         IPage<DmpDeviceType> page = new Page<>(pageNum, pageSize);
         LambdaQueryWrapper<DmpDeviceType> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.like(StringUtils.isNotBlank(typeCode), DmpDeviceType::getTypeCode, typeCode)
-                .like(StringUtils.isNotBlank(typeName), DmpDeviceType::getTypeName, typeName);
+                .like(StringUtils.isNotBlank(typeName), DmpDeviceType::getTypeName, typeName)
+                .eq(typeDomain != null,DmpDeviceType::getTypeDomain,typeDomain);
         page = this.page(page, queryWrapper);
         return new CommonPage<>(page.getRecords(), page.getTotal(), pageSize, pageNum);
     }

+ 18 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/DmpProductInfoServiceImpl.java

@@ -21,6 +21,7 @@ import com.usky.iot.mapper.DmpProductInfoMapper;
 import com.usky.iot.service.*;
 import com.usky.iot.service.config.IntegerUtils;
 import com.usky.iot.service.vo.DmpProductInfoRequest;
+import com.usky.transfer.RemoteTransferService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -54,6 +55,9 @@ public class DmpProductInfoServiceImpl extends AbstractCrudService<DmpProductInf
     @Autowired
     private DmpProductAttributeService dmpProductAttributeService;
 
+    @Autowired
+    private RemoteTransferService remoteTransferService;
+
     @Override
     public void add(DmpProductInfo dmpProductInfo) {
         if (checkNameUnique(dmpProductInfo)){
@@ -68,11 +72,22 @@ public class DmpProductInfoServiceImpl extends AbstractCrudService<DmpProductInf
         if (StringUtils.isBlank(dd) || dd.length() == 0){
             throw new BusinessException("新增产品信息'" + dmpProductInfo.getProductCode() + "'失败,设备类型缺少属性");
         }
+
+        QueryWrapper<DmpProductInfo> query = Wrappers.query();
+        query.select("max(id) as id");
+        DmpProductInfo info1 = this.getOne(query);
+        int id = info1.getId()+1;
+        String productCode = String.format("%03d",deviceType)+"_"+String.format("%04d",id);
+        dmpProductInfo.setProductCode(productCode);
+
         dmpProductInfo.setCreatedBy(SecurityUtils.getUsername());
         dmpProductInfo.setCreatedTime(new Date());
         dmpProductInfo.setDeleteFlag(0);
         dmpProductInfo.setTenantId(SecurityUtils.getTenantId());
         this.save(dmpProductInfo);
+
+        remoteTransferService.deleteProductCache();
+
         int productId = dmpProductInfo.getId();
         if(null != one){
             String dataField = one.getDataField();
@@ -245,6 +260,9 @@ public class DmpProductInfoServiceImpl extends AbstractCrudService<DmpProductInf
         }
 
         dmpProductInfo.setDeleteFlag(1);
+
+        remoteTransferService.deleteProductCache();
+
         return this.updateById(dmpProductInfo);
     }
 

+ 27 - 8
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/PmTimeConfServiceImpl.java

@@ -55,14 +55,23 @@ public class PmTimeConfServiceImpl extends AbstractCrudService<PmTimeConfMapper,
     public PmSubmitCountResponseVO submitCount(String submitDate) {
         Integer tenantId = SecurityUtils.getTenantId();
         PmSubmitCountResponseVO responseVO = new PmSubmitCountResponseVO();
-        LocalDate countDate = LocalDate.parse(submitDate);
+        LocalDate countDate = null;
+        try {
+            countDate = LocalDate.parse(submitDate);
+        } catch (Exception e) {
+            throw new BusinessException("提交日期有误" + e.getMessage());
+        }
 
         // 查询时间配置
         PmTimeConf timeConf = getTimeConf(tenantId);
         if (timeConf == null) {
             throw new RuntimeException("未找到工作报提交统计告时间配置,请联系管理员");
-        } else if (countDate.equals(LocalDate.now()) && timeConf.getStartTime().isAfter(LocalTime.now())) {
-            throw new RuntimeException("不可查看未来数据");
+        } else if (countDate.equals(LocalDate.now()) && timeConf.getStartTime().isAfter(LocalTime.now()) || countDate.isAfter(LocalDate.now())) {
+            responseVO.setSubmitOnTime(0);
+            responseVO.setSubmitLate(0);
+            responseVO.setNotSubmitted(0);
+            responseVO.setStatisticalDate(countDate);
+            return responseVO;
         }
 
         LocalTime startTime = timeConf.getStartTime();
@@ -87,6 +96,7 @@ public class PmTimeConfServiceImpl extends AbstractCrudService<PmTimeConfMapper,
         responseVO.setSubmitOnTime(submitOnTime);
         responseVO.setSubmitLate(submitLate);
         responseVO.setNotSubmitted(notSubmitted);
+        responseVO.setStatisticalDate(countDate);
         return responseVO;
     }
 
@@ -94,7 +104,12 @@ public class PmTimeConfServiceImpl extends AbstractCrudService<PmTimeConfMapper,
     public CommonPage<Object> submitPage(String submitDate, Integer queryType, Integer reportId, Integer pageNum, Integer pageSize) {
         Integer tenantId = SecurityUtils.getTenantId();
         Long userId2 = SecurityUtils.getUserId();
-        LocalDate countDate = LocalDate.parse(submitDate);
+        LocalDate countDate = null;
+        try {
+            countDate = LocalDate.parse(submitDate);
+        } catch (Exception e) {
+            throw new BusinessException("提交日期有误" + e.getMessage());
+        }
 
         List<SysUser> userList = users(tenantId);
 
@@ -102,6 +117,10 @@ public class PmTimeConfServiceImpl extends AbstractCrudService<PmTimeConfMapper,
         if (timeConf == null) {
             throw new BusinessException("未找到工作报提交统计告时间配置,请联系管理员");
         }
+        if ((LocalDate.now().equals(countDate) && timeConf.getStartTime().isAfter(LocalTime.now())) ||
+                countDate.isAfter(LocalDate.now())) {
+            return new CommonPage<>();
+        }
 
         LocalTime startTime = timeConf.getStartTime();
         LocalTime onTime = timeConf.getOnTime();
@@ -157,7 +176,7 @@ public class PmTimeConfServiceImpl extends AbstractCrudService<PmTimeConfMapper,
                     throw new BusinessException("报告统计分页参数错误!");
             }
             if (countDate.equals(LocalDate.now()) && timeConf.getStartTime().isAfter(LocalTime.now())) {
-                throw new BusinessException("不可查看未来数据");
+                return new CommonPage<>();
             }
             reportQuery.eq(PmWorkReport::getReportDate, countDate);
         }
@@ -285,10 +304,10 @@ public class PmTimeConfServiceImpl extends AbstractCrudService<PmTimeConfMapper,
     }
 
     // 获取报告时间配置
-    private PmTimeConf getTimeConf(Integer tenantId) {
+    @Override
+    public PmTimeConf getTimeConf(Integer tenantId) {
         LambdaQueryWrapper<PmTimeConf> timeConfQuery = new LambdaQueryWrapper<>();
-        timeConfQuery.select(PmTimeConf::getStartTime, PmTimeConf::getOnTime, PmTimeConf::getEndTime)
-                .eq(PmTimeConf::getTenantId, tenantId)
+        timeConfQuery.eq(PmTimeConf::getTenantId, tenantId)
                 .eq(PmTimeConf::getConfType, "PM");
         return pmTimeConfMapper.selectOne(timeConfQuery);
     }

+ 0 - 2
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/PmWorkContentServiceImpl.java

@@ -820,8 +820,6 @@ public class PmWorkContentServiceImpl extends AbstractCrudService<PmWorkContentM
         if (!userId.isEmpty()) {
             userNameQuery.eq(SysUser::getDelFlag, 0).eq(SysUser::getStatus, 0).in(SysUser::getUserId, userId);
             return sysUserMapper.selectList(userNameQuery);
-        } else if (workerOrProject == 2) {
-            userNameQuery.apply(Objects.nonNull(DataScopeContextHolder.getDataScopeSql()), DataScopeContextHolder.getDataScopeSql());
         } else {
             userNameQuery.eq(SysUser::getUserId, SecurityUtils.getUserId());
         }

+ 69 - 9
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/PmWorkReportServiceImpl.java

@@ -1,8 +1,10 @@
 package com.usky.iot.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.aliyuncs.exceptions.ClientException;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.usky.common.core.bean.ApiResult;
 import com.usky.common.core.exception.BusinessException;
 import com.usky.common.mybatis.core.AbstractCrudService;
 import com.usky.common.security.utils.SecurityUtils;
@@ -13,12 +15,14 @@ import com.usky.iot.domain.PmWorkReport;
 import com.usky.iot.mapper.PmReceiveMapper;
 import com.usky.iot.mapper.PmWorkContentMapper;
 import com.usky.iot.mapper.PmWorkReportMapper;
+import com.usky.iot.mapper.SysUserMapper;
 import com.usky.iot.service.PmProjectService;
 import com.usky.iot.service.PmWorkContentService;
 import com.usky.iot.service.PmWorkReportService;
 import com.usky.iot.service.config.DingTalkAndMessage;
 import com.usky.iot.service.vo.PmProjectTotalWorkTimeVo;
 import com.usky.iot.service.vo.PmProjectWorkTimeVo;
+import com.usky.system.RemoteMceService;
 import com.usky.system.domain.SysUser;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -71,6 +75,16 @@ public class PmWorkReportServiceImpl extends AbstractCrudService<PmWorkReportMap
     @Autowired
     private PmReceiveMapper pmReceiveMapper;
 
+    @Autowired
+    private SysUserMapper sysUserMapper;
+
+    @Autowired
+    private RemoteMceService remoteMceService;
+
+    private static final String INFO_TITLE = "日报未提交提醒";
+    private static final String INFO_CONTENT = "您今天的日报还未提交,别忘记哦~";
+    private static final int INFO_TYPE = 5;
+
     /**
      * 获取时间内工作报告
      *
@@ -219,13 +233,13 @@ public class PmWorkReportServiceImpl extends AbstractCrudService<PmWorkReportMap
 
         List<PmWorkContent> workContents = pmWorkReport.getWorkContents();
         if (workContents == null) {
-            throw new BusinessException("报告内容不能为空,请检查!");
+            throw new BusinessException("报告内容不能为空,请检查后提交!");
         } else {
             for (PmWorkContent workContent : workContents) {
                 BigDecimal workTime = workContent.getWorkTime();
                 // 单个工时大于零
                 if (workTime == null) {
-                    throw new BusinessException("工时不能为空,请检查!");
+                    throw new BusinessException("工时不能为空,请检查后提交!");
                 } else if (workTime.compareTo(BigDecimal.ZERO) <= 0) {
                     throw new BusinessException("工时必须大于零!");
                 } else if (workTime.scale() > 1) {
@@ -237,14 +251,14 @@ public class PmWorkReportServiceImpl extends AbstractCrudService<PmWorkReportMap
                 String workContent1 = workContent.getWorkContent();
                 // 工作内容不允许为空或空字符串
                 if (StringUtils.isBlank(workContent1)) {
-                    throw new BusinessException("工作内容不能为空,请检查!");
+                    throw new BusinessException("工作内容不能为空,请检查后提交!");
                 }
             }
         }
         Set<Integer> projectIds2 = new HashSet<>();
         for (PmWorkContent workContent : pmWorkReport.getWorkContents()) {
             if (!projectIds2.add(workContent.getProjectId())) {
-                throw new BusinessException("存在重复项目,请检查!");
+                throw new BusinessException("存在重复项目,请检查后提交!");
             }
         }
         for (PmWorkContent a : pmWorkReport.getWorkContents()) {
@@ -253,11 +267,20 @@ public class PmWorkReportServiceImpl extends AbstractCrudService<PmWorkReportMap
         // 判断总工时是否超过24h
         BigDecimal maxWorkTimePerDay = BigDecimal.valueOf(24);
         if (totalWorkTime.compareTo(maxWorkTimePerDay) >= 0) {
-            throw new BusinessException("一天24小时都不够你用,请检查当日总工时!");
+            throw new BusinessException("总工时超过24小时,请检查后提交!");
         }
 
         // 判断是否携带reportId,不写带则为新增报告,携带则为编辑(更新)报告
         if (rid == null) {
+            // 判断是否今天已提交过
+            LambdaQueryWrapper<PmWorkReport> wrapper = Wrappers.lambdaQuery();
+            wrapper.eq(PmWorkReport::getReportDate, pmWorkReport.getReportDate())
+                    .eq(PmWorkReport::getSubmitterId, userId)
+                    .eq(PmWorkReport::getTenantId, tenantId);
+            if (!pmWorkReportMapper.selectList(wrapper).isEmpty()) {
+                throw new BusinessException("今天已提交工作报告,请勿重复提交!");
+            }
+
             PmWorkReport newReport = new PmWorkReport();
             newReport.setReportDate(pmWorkReport.getReportDate());
             newReport.setSubmitterId(userId);
@@ -280,15 +303,14 @@ public class PmWorkReportServiceImpl extends AbstractCrudService<PmWorkReportMap
                     newReport.setTimingTime(timingTime);
                     newReport.setReportStatus(0);
                 } else {
-                    throw new BusinessException("定时发送支持选中5分钟后的时间,请重新选择时间");
+                    throw new BusinessException("定时发送支持选中5分钟后的时间,请重新选择时间");
                 }
             }
             try {
                 pmWorkReportMapper.insert(newReport);
 
             } catch (Exception e) {
-                e.printStackTrace();
-                throw new BusinessException("已存在重复数据,一人一天一篇报告!");
+                throw new BusinessException("新增报告异常!请联系管理员" + e);
             }
 
             // 获取报告中所有项目id
@@ -541,7 +563,7 @@ public class PmWorkReportServiceImpl extends AbstractCrudService<PmWorkReportMap
             LocalDate firstMondayOfYear = firstDayOfYear.with(TemporalAdjusters.nextOrSame(DayOfWeek.MONDAY));
 
             DayOfWeek dayOfWeek = firstDayOfYear.getDayOfWeek();
-            if (dayOfWeek != DayOfWeek.MONDAY){
+            if (dayOfWeek != DayOfWeek.MONDAY) {
                 dateNum -= 1;
             }
 
@@ -578,6 +600,7 @@ public class PmWorkReportServiceImpl extends AbstractCrudService<PmWorkReportMap
      * @param: [time] 开始时间
      * @return: void
      **/
+    @Async
     @Override
     public void timedSending(LocalDateTime time) {
         log.info("定时报告任务开始---------------------------");
@@ -716,5 +739,42 @@ public class PmWorkReportServiceImpl extends AbstractCrudService<PmWorkReportMap
         return timedReports;
     }
 
+    @Async
+    @Override
+    public void reportSubmissionReminder() {
+        Integer tenantId = SecurityUtils.getTenantId();
+        List<Long> userIds = new ArrayList<>();
+        LambdaQueryWrapper<PmWorkReport> todayReports = Wrappers.lambdaQuery();
+        todayReports.eq(PmWorkReport::getReportStatus, 1)
+                .eq(PmWorkReport::getReportDate, LocalDate.now())
+                .eq(PmWorkReport::getTenantId, tenantId);
+        List<PmWorkReport> todayReportsList = pmWorkReportMapper.selectList(todayReports);
+        if (!todayReportsList.isEmpty()) {
+            userIds = todayReportsList.stream().map(PmWorkReport::getSubmitterId).collect(Collectors.toList());
+        }
 
+        LambdaQueryWrapper<SysUser> userQueryWrapper = Wrappers.lambdaQuery();
+        userQueryWrapper.select(SysUser::getUserId, SysUser::getNickName)
+                .eq(SysUser::getTenantId, tenantId)
+                .eq(SysUser::getStatus, 0)
+                .eq(SysUser::getDelFlag, 0)
+                .notIn(!userIds.isEmpty(), SysUser::getUserId, userIds);
+        userIds =  sysUserMapper.selectList(userQueryWrapper).stream().map(SysUser::getUserId).collect(Collectors.toList());
+
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("infoTitle", INFO_TITLE);
+        jsonObject.put("infoContent", INFO_CONTENT);
+        jsonObject.put("infoType", INFO_TYPE);
+        jsonObject.put("id", 0);
+        jsonObject.put("infoTypeName", INFO_TITLE);
+        jsonObject.put("userName", "报告提醒通知");
+        jsonObject.put("userIds", userIds);
+
+        // 推送消息中心
+        try {
+            remoteMceService.addMce(jsonObject.toString());
+        } catch (Exception e) {
+            throw new BusinessException("报告提醒通知失败" + e);
+        }
+    }
 }

+ 23 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/vo/DmpHttpAlarmResponseVO.java

@@ -0,0 +1,23 @@
+package com.usky.iot.service.vo;
+
+import lombok.Data;
+
+/**
+ *
+ * @author fyc
+ * @email yuchuan.fu@chinausky.com
+ * @date 2025/2/10
+ */
+@Data
+public class DmpHttpAlarmResponseVO {
+
+    /**
+     * 报警事件数据上报http地址
+     **/
+    private String alarmHttpUrl;
+
+    /**
+     * 报警事件数据上报参数body
+     **/
+    private String alarmPayload;
+}

+ 79 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/vo/DmpTopicRequestVO.java

@@ -0,0 +1,79 @@
+package com.usky.iot.service.vo;
+
+import lombok.Data;
+
+/**
+ *
+ * @author fyc
+ * @email yuchuan.fu@chinausky.com
+ * @date 2025/2/10
+ */
+@Data
+public class DmpTopicRequestVO {
+
+    /**
+     * topic类型
+     **/
+    private String topicType;
+
+    /**
+     * 产品编码
+     **/
+    private String productCode;
+
+    /**
+     * 产品id
+     **/
+    private Integer productId;
+
+    /**
+     * 设备id
+     **/
+    private String deviceId;
+
+    /**
+     * 设备唯一标识
+     **/
+    private String deviceUuid;
+
+    /**
+     * 设备名称
+     **/
+    private String deviceName;
+
+    /**
+     * sim卡号
+     **/
+    private String simCode;
+
+    /**
+     * 安装位置
+     **/
+    private String installAddress;
+
+    /**
+     * 时间戳
+     **/
+    private Long timestamp;
+
+    /**
+     * 属性值集合
+     **/
+    private String metrics;
+
+    /**
+     * 标签值集合
+     **/
+    private String tags;
+
+    /**
+     * 页码
+     **/
+    private Integer pageNum;
+
+    /**
+     * 每页条数
+     **/
+    private Integer pageSize;
+
+}

+ 57 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/vo/DmpTopicResponseVO.java

@@ -0,0 +1,57 @@
+package com.usky.iot.service.vo;
+
+import com.usky.iot.domain.DmpProductAttribute;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ *
+ * @author fyc
+ * @email yuchuan.fu@chinausky.com
+ * @date 2025/2/7
+ */
+@Data
+public class DmpTopicResponseVO {
+
+    /**
+     * topic
+     **/
+    private String topic;
+
+    /**
+     * 发布者
+     **/
+    private String publisher;
+
+    /**
+     * 订阅者
+     **/
+    private String subscriber;
+
+    /**
+     * 备注
+     **/
+    private String remarks;
+
+    /**
+     * mqtt数据上报数据
+     **/
+    private String topicPayload;
+
+    /**
+     * http报警数据上报地址
+     **/
+    private String alarm;
+
+    /**
+     * http报警数据上报数据
+     **/
+    private String alarmPayload;
+
+    /**
+     * 产品属性
+     **/
+    private List<DmpProductAttribute> productAttributeList;
+
+}

+ 10 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/vo/FacilityDeviceResultVO.java

@@ -41,6 +41,16 @@ public class FacilityDeviceResultVO {
      */
     private String deviceAddress;
 
+    /**
+     * 产品编码
+     */
+    private String productCode;
+
+    /**
+     * 设备id
+     */
+    private String deviceId;
+
     /**
      * 设备属性
      */

+ 15 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/vo/PmSubmitCountResponseVO.java

@@ -1,5 +1,7 @@
 package com.usky.iot.service.vo;
 
+import java.time.LocalDate;
+
 /**
  *
  * @author fyc
@@ -23,6 +25,11 @@ public class PmSubmitCountResponseVO {
      **/
     private Integer notSubmitted;
 
+    /**
+     * 统计日期
+     **/
+    private LocalDate statisticalDate;
+
     public Integer getSubmitOnTime() {
         return submitOnTime;
     }
@@ -47,4 +54,12 @@ public class PmSubmitCountResponseVO {
         this.notSubmitted = notSubmitted;
     }
 
+    public LocalDate getStatisticalDate() {
+        return statisticalDate;
+    }
+
+    public void setStatisticalDate(LocalDate statisticalDate) {
+        this.statisticalDate = statisticalDate;
+    }
+
 }

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

@@ -52,7 +52,7 @@
         from dmp_device ddi
         <where>
             <if test="1 == 1">
-                and delete_flag = 0
+                and delete_flag = 0 and service_status = 2
             </if>
             <if test="1 == 1">
                 and device_id in

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

@@ -44,6 +44,7 @@ public class RyTask {
         System.out.println("addPatrolInspectionAbnormalData");
     }
 
+    // 工作报告定时发送
     public void executeTimedSending() {
         System.out.println("executeTimedSending start........");
         remotePmService.executeTimedSending();
@@ -54,9 +55,14 @@ public class RyTask {
         remoteIotTaskService.dataOverviewJobData();
     }
 
-    public void baseAlarmStatus(){
-        System.out.println("baseAlarmStatus start......");
-        remoteIotTaskService.baseAlarmStatus();
+    public void deviceStatus(){
+        System.out.println("deviceStatus start......");
+        remoteIotTaskService.deviceStatus();
+    }
+
+    public void deviceOffLineAlarm(){
+        System.out.println("deviceOffLineAlarm start......");
+        remoteIotTaskService.deviceOffLineAlarm();
     }
 
     public void customInfoStatus(){
@@ -69,4 +75,10 @@ public class RyTask {
         remoteMeetingService.meetingInfoStatus();
     }
 
+    // 报告提交提醒
+    public void reportSubmissionReminder(){
+        System.out.println("reportSubmissionReminder start......");
+        remotePmService.reportSubmissionReminder();
+    }
+
 }

+ 2 - 1
service-meeting/service-meeting-biz/src/main/java/com/usky/meeting/service/impl/MeetingInfoServiceImpl.java

@@ -604,7 +604,8 @@ public class MeetingInfoServiceImpl extends AbstractCrudService<MeetingInfoMappe
                             if(code.getCode() != null && code.getCode().equals("OK")) {
                                 //请求成功
                             }else {
-                                throw new BusinessException("发送短信失败");
+//                                throw new BusinessException("发送短信失败");
+                                log.info(dmUser.getPhonenumber()+"发送短信失败");
                             }
                         }
 

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů