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

Merge remote-tracking branch 'origin/main'

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

+ 5 - 6
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,7 +17,6 @@ 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
@@ -32,20 +31,20 @@ public class AdminDataController {
 
     @PostMapping("/uploadDev")
     @ApiOperation(value = "excel上传设备信息")
-    public ApiResult<UploadRes> uploadDev(@Valid @RequestParam MultipartFile file) throws IOException {
+    public ApiResult<UploadRes> uploadDev(@RequestParam MultipartFile file) throws IOException {
         return ApiResult.success(adminGateway.uploadDev(file));
     }
 
     @PostMapping("/queryDevList")
     @ApiOperation(value = "查询上传设备信息")
-    public ApiResult<PageRecord<DeviceDTO>> queryDevList(@Valid @RequestBody DeviceListQueryReq queryReq) {
+    public ApiResult<PageRecord<DeviceDTO>> queryDevList(@RequestBody DeviceListQueryReq queryReq) {
         return ApiResult.success(adminGateway.queryDevList(queryReq));
     }
 
     @PostMapping("/addOneDevice")
     @ApiOperation(value = "添加上传设备信息")
-    public ApiResult<Void> addOneDevice(@Valid @RequestBody DeviceDTO deviceDTO) {
-        adminGateway.addOneDevice(deviceDTO);
+    public ApiResult<Void> addOneDevice(@RequestBody DeviceAddParam deviceAddParam) {
+        adminGateway.addOneDevice(deviceAddParam);
         return ApiResult.success();
     }
 

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

@@ -0,0 +1,209 @@
+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(@Valid DeviceListQueryReq queryReq);
+    PageRecord<DeviceDTO> queryDevList(DeviceListQueryReq queryReq);
 
-    void addOneDevice(@Valid DeviceDTO deviceDTO);
+    void addOneDevice(DeviceAddParam deviceAddParam);
 }

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

@@ -5,6 +5,7 @@ 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;
@@ -120,17 +121,17 @@ public class AdminGatewayImpl implements AdminGateway {
     }
 
     @Override
-    public void addOneDevice(DeviceDTO deviceDTO) {
+    public void addOneDevice(DeviceAddParam deviceAddParam) {
 
-        DevInfo devInfo = devInfoService.queryOneByClientId(deviceDTO.getClientId());
+        DevInfo devInfo = devInfoService.queryOneByClientId(deviceAddParam.getClientId());
         if (devInfo != null) {
             throw new BizException(ErrorEnum.DEVICE_IS_EXIST.getErrorCode(), ErrorEnum.DEVICE_IS_EXIST.getErrorMessage());
         }
 
         DevInfo saveInfo = new DevInfo();
-        saveInfo.setClientId(deviceDTO.getClientId());
-        saveInfo.setDevType(deviceDTO.getDevType());
-        saveInfo.setSoftware(deviceDTO.getSoftware());
+        saveInfo.setClientId(deviceAddParam.getClientId());
+        saveInfo.setDevType(deviceAddParam.getDevType());
+        saveInfo.setSoftware(deviceAddParam.getSoftware());
         saveInfo.setStatusLight(1);
         saveInfo.setOnline(0);
         saveInfo.setIsDeleted(BasePO.DeleteFlag.NOT_DELETED);