Преглед на файлове

feat: 回滚springboot版本

yangliu преди 3 месеца
родител
ревизия
5d66424f54

+ 6 - 5
portal-service-application/src/main/java/com/hfln/portal/application/controller/admin/AdminDataController.java

@@ -5,8 +5,8 @@ package com.hfln.portal.application.controller.admin;
 import cn.hfln.framework.catchlog.CatchAndLog;
 import cn.hfln.framework.dto.ApiResult;
 import com.hfln.portal.common.dto.data.device.DeviceDTO;
-import com.hfln.portal.common.request.admin.DeviceAddParam;
 import com.hfln.portal.common.request.device.DeviceListQueryReq;
+import com.hfln.portal.common.request.share.ShareParam;
 import com.hfln.portal.common.vo.PageRecord;
 import com.hfln.portal.common.vo.UploadRes;
 import com.hfln.portal.domain.gateway.AdminGateway;
@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.validation.Valid;
 import java.io.IOException;
 
 @RestController
@@ -31,20 +32,20 @@ public class AdminDataController {
 
     @PostMapping("/uploadDev")
     @ApiOperation(value = "excel上传设备信息")
-    public ApiResult<UploadRes> uploadDev(@RequestParam MultipartFile file) throws IOException {
+    public ApiResult<UploadRes> uploadDev(@Valid @RequestParam MultipartFile file) throws IOException {
         return ApiResult.success(adminGateway.uploadDev(file));
     }
 
     @PostMapping("/queryDevList")
     @ApiOperation(value = "查询上传设备信息")
-    public ApiResult<PageRecord<DeviceDTO>> queryDevList(@RequestBody DeviceListQueryReq queryReq) {
+    public ApiResult<PageRecord<DeviceDTO>> queryDevList(@Valid @RequestBody DeviceListQueryReq queryReq) {
         return ApiResult.success(adminGateway.queryDevList(queryReq));
     }
 
     @PostMapping("/addOneDevice")
     @ApiOperation(value = "添加上传设备信息")
-    public ApiResult<Void> addOneDevice(@RequestBody DeviceAddParam deviceAddParam) {
-        adminGateway.addOneDevice(deviceAddParam);
+    public ApiResult<Void> addOneDevice(@Valid @RequestBody DeviceDTO deviceDTO) {
+        adminGateway.addOneDevice(deviceDTO);
         return ApiResult.success();
     }
 

+ 0 - 209
portal-service-common/src/main/java/com/hfln/portal/common/request/admin/DeviceAddParam.java

@@ -1,209 +0,0 @@
-package com.hfln.portal.common.request.admin;
-
-import com.hfln.portal.common.vo.BaseVO;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-import java.math.BigDecimal;
-import java.time.LocalDateTime;
-
-@EqualsAndHashCode(callSuper = true)
-@Data
-public class DeviceAddParam extends BaseVO {
-    /**
-     * 主键ID
-     */
-    @ApiModelProperty("主键ID")
-    private Long devId;
-
-    /**
-     * 设备ID
-     */
-    @ApiModelProperty("设备ID")
-    private String clientId;
-
-    /**
-     * 用户openid
-     */
-    @ApiModelProperty("用户Id")
-    private Long userId;
-
-    /**
-     * 设备名称
-     */
-    @ApiModelProperty("设备名称")
-    private String devName;
-
-    /**
-     * 设备类型
-     */
-    @ApiModelProperty("设备类型")
-    private String devType;
-
-    /**
-     * 在线状态:0-离线,1-在线
-     */
-    @ApiModelProperty("在线状态:0-离线,1-在线")
-    private Integer online;
-
-    /**
-     * 设备报警:0-正常,1-报警
-     */
-    @ApiModelProperty("设备报警:0-正常,1-报警")
-    private Integer devWarn;
-
-    /**
-     * 软件版本号
-     */
-    @ApiModelProperty("软件版本号")
-    private String software;
-
-    /**
-     * 硬件版本号
-     */
-    @ApiModelProperty("硬件版本号")
-    private String hardware;
-
-    /**
-     * wifi名称
-     */
-    @ApiModelProperty("wifi名称")
-    private String wifiName;
-
-    /**
-     * wifi密码
-     */
-    @ApiModelProperty(" wifi密码")
-    private String wifiPassword;
-
-    /**
-     * ip地址
-     */
-    @ApiModelProperty("ip地址")
-    private String ip;
-
-    /**
-     * 安装方式:Wall-墙装,Ceiling-顶装
-     */
-    @ApiModelProperty("安装方式:Wall-墙装,Ceiling-顶装")
-    private String mountPlain;
-
-    /**
-     * 跟踪区域起始X坐标
-     */
-    @ApiModelProperty("跟踪区域起始X坐标")
-    private BigDecimal startX;
-
-    /**
-     * 跟踪区域起始Y坐标
-     */
-    @ApiModelProperty("跟踪区域起始Y坐标")
-    private BigDecimal startY;
-
-    /**
-     * 跟踪区域起始Z坐标
-     */
-    @ApiModelProperty("跟踪区域起始Z坐标")
-    private BigDecimal startZ;
-
-    /**
-     * 跟踪区域结束X坐标
-     */
-    @ApiModelProperty("跟踪区域结束X坐标")
-    private BigDecimal stopX;
-
-    /**
-     * 跟踪区域结束Y坐标
-     */
-    @ApiModelProperty("跟踪区域结束Y坐标")
-    private BigDecimal stopY;
-
-    /**
-     * 跟踪区域结束Z坐标
-     */
-    @ApiModelProperty("跟踪区域结束Z坐标")
-    private BigDecimal stopZ;
-
-    /**
-     * 安装高度
-     */
-    @ApiModelProperty("安装高度")
-    private BigDecimal height;
-
-    /**
-     * 房间长度
-     */
-    @ApiModelProperty("房间长度")
-    private BigDecimal length;
-
-    /**
-     * 房间宽度
-     */
-    @ApiModelProperty("房间宽度")
-    private BigDecimal width;
-
-    /**
-     * target数组
-     */
-    @ApiModelProperty("target数组")
-    private Object targetPoints;
-
-    /**
-     * 接收target时间
-     */
-    @ApiModelProperty("接收target时间")
-    private LocalDateTime signalTime;
-
-    /**
-     * 北向夹角
-     */
-    @ApiModelProperty("北向夹角")
-    private BigDecimal northAngle;
-
-    /**
-     * 安装坐标x
-     */
-    @ApiModelProperty("安装坐标x")
-    private BigDecimal x;
-
-    /**
-     * 安装坐标y
-     */
-    @ApiModelProperty("安装坐标y")
-    private BigDecimal y;
-
-    /**
-     * 指示灯开关:0-关闭,1-开启
-     */
-    @ApiModelProperty("指示灯开关:0-关闭,1-开启")
-    private Integer statusLight;
-
-    /**
-     * 创建人
-     */
-    @ApiModelProperty("创建人")
-    private String createId;
-
-
-    /**
-     * 修改人
-     */
-
-    @ApiModelProperty("修改人")
-    private String updateId;
-
-    /**
-     * 创建时间
-     */
-    @ApiModelProperty("创建时间")
-    private LocalDateTime createTime;
-
-    /**
-     * 更新时间
-     */
-    @ApiModelProperty("更新时间")
-    private LocalDateTime updateTime;
-
-
-}

+ 3 - 3
portal-service-domain/src/main/java/com/hfln/portal/domain/gateway/AdminGateway.java

@@ -1,19 +1,19 @@
 package com.hfln.portal.domain.gateway;
 
 import com.hfln.portal.common.dto.data.device.DeviceDTO;
-import com.hfln.portal.common.request.admin.DeviceAddParam;
 import com.hfln.portal.common.request.device.DeviceListQueryReq;
 import com.hfln.portal.common.vo.PageRecord;
 import com.hfln.portal.common.vo.UploadRes;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.validation.Valid;
 import java.io.IOException;
 
 public interface AdminGateway {
 
     UploadRes uploadDev(MultipartFile file) throws IOException;
 
-    PageRecord<DeviceDTO> queryDevList(DeviceListQueryReq queryReq);
+    PageRecord<DeviceDTO> queryDevList(@Valid DeviceListQueryReq queryReq);
 
-    void addOneDevice(DeviceAddParam deviceAddParam);
+    void addOneDevice(@Valid DeviceDTO deviceDTO);
 }

+ 1 - 0
portal-service-infrastructure/src/main/java/com/hfln/portal/infrastructure/config/SaTokenConfigure.java

@@ -72,6 +72,7 @@ public class SaTokenConfigure implements WebMvcConfigurer {
 		.addPathPatterns("/**")
 		.excludePathPatterns("/error");
 		
+		
 	}
 	
 	/**

+ 5 - 6
portal-service-infrastructure/src/main/java/com/hfln/portal/infrastructure/gateway/impl/AdminGatewayImpl.java

@@ -5,7 +5,6 @@ import com.alibaba.excel.EasyExcel;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.hfln.portal.common.dto.DevInfoImportDto;
 import com.hfln.portal.common.dto.data.device.DeviceDTO;
-import com.hfln.portal.common.request.admin.DeviceAddParam;
 import com.hfln.portal.common.request.device.DeviceListQueryReq;
 import com.hfln.portal.common.vo.PageRecord;
 import com.hfln.portal.common.vo.UploadRes;
@@ -121,17 +120,17 @@ public class AdminGatewayImpl implements AdminGateway {
     }
 
     @Override
-    public void addOneDevice(DeviceAddParam deviceAddParam) {
+    public void addOneDevice(DeviceDTO deviceDTO) {
 
-        DevInfo devInfo = devInfoService.queryOneByClientId(deviceAddParam.getClientId());
+        DevInfo devInfo = devInfoService.queryOneByClientId(deviceDTO.getClientId());
         if (devInfo != null) {
             throw new BizException(ErrorEnum.DEVICE_IS_EXIST.getErrorCode(), ErrorEnum.DEVICE_IS_EXIST.getErrorMessage());
         }
 
         DevInfo saveInfo = new DevInfo();
-        saveInfo.setClientId(deviceAddParam.getClientId());
-        saveInfo.setDevType(deviceAddParam.getDevType());
-        saveInfo.setSoftware(deviceAddParam.getSoftware());
+        saveInfo.setClientId(deviceDTO.getClientId());
+        saveInfo.setDevType(deviceDTO.getDevType());
+        saveInfo.setSoftware(deviceDTO.getSoftware());
         saveInfo.setStatusLight(1);
         saveInfo.setOnline(0);
         saveInfo.setIsDeleted(BasePO.DeleteFlag.NOT_DELETED);

+ 8 - 9
portal-service-infrastructure/src/main/java/com/hfln/portal/infrastructure/mqtt/MqttSubHandle.java

@@ -230,11 +230,10 @@ public class MqttSubHandle {
 //							}
 //						}
 
-            if (userIds.size() > 0) {
+            if (!userIds.isEmpty()) {
                 // 拥有者和被分享者phone
                 List<UserInfo> userInfos = userService.listByIds(userIds);
-                for (int i = 0; i < userInfos.size(); i++) {
-                    UserInfo user = userInfos.get(i);
+                for (UserInfo user : userInfos) {
                     // 发送跌倒短信
                     log.info("mqttutil--开始发送跌倒消息");
                     log.info("mqttutil--sendmsg:phone{}, dev_name:{}", user.getPhone(), devName.toString());
@@ -252,7 +251,7 @@ public class MqttSubHandle {
                     // 发送微信公告号消息
                     wxOfficeAccountClient.sendMsg(devId, devName.toString(), user.getPhone(), fwhOpenId, "设备检测到跌倒,请前往小程序查看详细信息");
                     log.info("发送微信公众号消息发完了");
-                    }
+                }
                 }
 
             }
@@ -267,10 +266,10 @@ public class MqttSubHandle {
 
         List<DevInfo> devs = devInfoService.queryByClientId(clientId);
         List<Long> userIds = new ArrayList<>();
-        StringBuffer devName = new StringBuffer("");
+        StringBuilder devName = new StringBuilder();
         String devId = "";
         // 设备拥有者openid
-        if (devs != null && devs.size() > 0) {
+        if (devs != null && !devs.isEmpty()) {
             DevInfo dev = devs.get(0);
             userIds.add(dev.getUserId());
             devName.append(dev.getDevName());
@@ -285,7 +284,7 @@ public class MqttSubHandle {
 //							}
 //						}
 
-        if (userIds.size() > 0) {
+        if (!userIds.isEmpty()) {
             // 拥有者和被分享者phone
             List<UserInfo> userInfos = userService.listByIds(userIds);
             for (int i = 0; i < userInfos.size(); i++) {
@@ -336,7 +335,7 @@ public class MqttSubHandle {
 
         String targetPointsStr = JSON.toJSONString(targetPoints);
         List<DevInfo> devs = devInfoService.queryByClientId(clientId);
-        if (devs != null && devs.size() > 0) {
+        if (devs != null && !devs.isEmpty()) {
             DevInfo dev = devs.get(0);
             if (!targetPointsStr.equals(dev.getTargetPoints())) {
                 //  存储跌倒事件
@@ -449,7 +448,7 @@ public class MqttSubHandle {
         vo.setLength(length);
 
         List<DevInfo> devs = devInfoService.queryByClientId(clientId);
-        if (devs.size() > 0) {
+        if (!devs.isEmpty()) {
 
             devInfoService.update(vo, new LambdaUpdateWrapper<DevInfo>().eq(DevInfo::getClientId, clientId));
 

+ 0 - 4
portal-service-server/src/main/resources/bootstrap-dev.yml

@@ -99,10 +99,6 @@ mqtt:
   keepalive: 60
   clean-session: true
   automatic-reconnect: true
-  max-reconnect-delay: 10000
-  connection-timeout: 30
-  max-message-size: 1048576
-  ssl: false
 
 # oss 存储
 oss: