Browse Source

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

fuyuchuan 2 weeks ago
parent
commit
eaeb5ab3f5
34 changed files with 1272 additions and 36 deletions
  1. 2 2
      service-fire/service-fire-biz/src/main/java/com/usky/fire/RuoYiSystemApplication.java
  2. 15 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionSiteController.java
  3. 3 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionSiteService.java
  4. 1 2
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionContentServiceImpl.java
  5. 12 12
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPlanServiceImpl.java
  6. 67 14
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionSiteServiceImpl.java
  7. 51 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/PatrolInspectionSiteImportVo.java
  8. 21 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/controller/web/AccessAlarmController.java
  9. 21 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/controller/web/AccessEntryExitRecordController.java
  10. 141 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/domain/AccessAlarm.java
  11. 86 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/domain/AccessEntryExitRecord.java
  12. 16 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/mapper/AccessAlarmMapper.java
  13. 16 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/mapper/AccessEntryExitRecordMapper.java
  14. 16 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/service/AccessAlarmService.java
  15. 16 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/service/AccessEntryExitRecordService.java
  16. 20 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/service/impl/AccessAlarmServiceImpl.java
  17. 20 0
      service-ids/service-ids-biz/src/main/java/com/usky/ids/service/impl/AccessEntryExitRecordServiceImpl.java
  18. 32 0
      service-ids/service-ids-biz/src/main/resources/mapper/ids/AccessAlarmMapper.xml
  19. 21 0
      service-ids/service-ids-biz/src/main/resources/mapper/ids/AccessEntryExitRecordMapper.xml
  20. 0 6
      service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/BaseAlarmServiceImpl.java
  21. 4 0
      service-issue/service-issue-api/src/main/java/com/usky/issue/RemoteIssueTaskService.java
  22. 4 0
      service-issue/service-issue-api/src/main/java/com/usky/issue/factory/RemoteIssueTaskFactory.java
  23. 50 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/config/mqtt/MqttBaseConfig.java
  24. 48 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/config/mqtt/MqttInConfig.java
  25. 86 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/config/mqtt/MqttOutConfig.java
  26. 175 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/job/JgDataForward.java
  27. 55 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/listener/MqttListener.java
  28. 13 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/mqtt/MqttStrategy.java
  29. 25 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/mqtt/SimpleContext.java
  30. 27 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/mqtt/event/event.java
  31. 31 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/mqtt/info/Info.java
  32. 132 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/util/HttpClientUtils.java
  33. 21 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/vo/MqttBaseVO.java
  34. 24 0
      service-issue/service-issue-biz/src/main/java/com/usky/issue/service/vo/RtuAttributeVO.java

+ 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;
+
+}

+ 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 {
+
+}
+

+ 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;
+
+
+}

+ 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/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> {
+
+}

+ 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 {
+
+}

+ 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>

+ 0 - 6
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;
@@ -73,9 +70,6 @@ public class BaseAlarmServiceImpl extends AbstractCrudService<BaseAlarmMapper, B
     @Autowired
     private DataQueryClient dataQueryClient;
 
-    @Autowired
-    private RemoteTsdbProxyService remoteTsdbProxyService;
-
     @Autowired
     private DmpDeviceStatusService dmpDeviceStatusService;
 

+ 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;
+
+}