suntianwu 3 年之前
父節點
當前提交
678f539661

+ 3 - 4
src/main/java/com/iden/bms/service/CameraService.java

@@ -88,7 +88,7 @@ public class CameraService {
                 pageRes.getRecords().forEach(item -> {
                     CameraVO resVO = new CameraVO();
                     BeanUtils.copyProperties(item,resVO);
-                    resVO.setStatusName(ConnectStatusEnum.getValueToName(resVO.getCode()));
+                    resVO.setStatusName(ConnectStatusEnum.getValueToName(resVO.getStatus()));
                     resVO.setTypeName(CameraTypeEnum.getValueToName(resVO.getType()));
                     Long communityId1 = resVO.getCommunityId();
                     if(communityId1 != null){
@@ -184,7 +184,7 @@ public class CameraService {
             list.forEach(item->{
                 CameraVO vo = new CameraVO();
                 BeanUtil.copyProperties(item, vo);
-                vo.setStatusName(ConnectStatusEnum.getValueToName(vo.getCode()));
+                vo.setStatusName(ConnectStatusEnum.getValueToName(vo.getStatus()));
                 vo.setTypeName(CameraTypeEnum.getValueToName(vo.getType()));
                 Long communityId1 = vo.getCommunityId();
                 if(communityId1 != null){
@@ -265,14 +265,13 @@ public class CameraService {
                 }
                 final IdenCamera obj =  new IdenCamera();
                 BeanUtils.copyProperties(tmpObj,obj);
+                obj.setStatus(ConnectStatusEnum.getNameToValue(tmpObj.getName()));
                 String communityName = tmpObj.getCommunityName();
                 QueryWrapper<IdenCommunity> queryWrapper = new QueryWrapper<>();
                 queryWrapper.lambda().eq(IdenCommunity::getName,communityName);
                 IdenCommunity idenCommunity = this.idenCommunityService.getOne(queryWrapper);
                 if(idenCommunity != null){
                     obj.setCommunityId(idenCommunity.getId());
-                } else {
-                    continue;
                 }
                 obj.setType(type);
                 listDb.add(obj);

+ 16 - 0
src/main/java/com/iden/common/enums/ConnectStatusEnum.java

@@ -22,6 +22,9 @@ public enum ConnectStatusEnum {
     public String getValue() {
         return value;
     }
+    public String getName() {
+        return name;
+    }
 
     public static String getValueToName(String value){
         if (StrUtil.isEmpty(value)){
@@ -35,4 +38,17 @@ public enum ConnectStatusEnum {
 
         return null;
     }
+
+    public static String getNameToValue(String name){
+        if (StrUtil.isEmpty(name)){
+            return null;
+        }
+        if (DISCONNECT.getName().equals(name)){
+            return  DISCONNECT.value;
+        }else if (CONNECTED.getName().equals(name)){
+            return  CONNECTED.value;
+        }
+
+        return null;
+    }
 }

+ 7 - 4
src/main/java/com/iden/common/vo/CameraVO.java

@@ -75,14 +75,16 @@ public class CameraVO implements Serializable {
     @ApiModelProperty("状态,0未连接,1已连接")
     private String status;
 
-    @ApiModelProperty("状态名,0未连接,1已连接")
+    @ApiModelProperty("状态")
+    @HeaderToColumn(header = "状态")
     private String statusName;
 
 
     @ApiModelProperty("类型:1摄像机,2抓拍设备")
     private String type;
 
-    @ApiModelProperty("类型名:1摄像机,2抓拍设备")
+    @ApiModelProperty("类型")
+    @HeaderToColumn(header = "类型")
     private String typeName;
 
     @ApiModelProperty("备注")
@@ -90,11 +92,12 @@ public class CameraVO implements Serializable {
     private String remark;
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
-    @ApiModelProperty("createTime")
+    @ApiModelProperty("创建时间")
+    @HeaderToColumn(header = "创建时间")
     private Date createTime;
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
-    @ApiModelProperty("modifyTime")
+    @ApiModelProperty("修改时间")
     private Date modifyTime;
 
 

+ 4 - 2
src/main/java/com/iden/common/vo/CommunityVO.java

@@ -83,12 +83,14 @@ public class CommunityVO implements Serializable {
     @HeaderToColumn(header = "备注")
     private String remark;
 
+
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
-    @ApiModelProperty("createTime")
+    @ApiModelProperty("创建时间")
+    @HeaderToColumn(header = "创建时间")
     private Date createTime;
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
-    @ApiModelProperty("modifyTime")
+    @ApiModelProperty("修改时间")
     private Date modifyTime;
 
 

+ 1 - 1
src/main/java/com/iden/common/vo/CrowdVO.java

@@ -53,7 +53,7 @@ public class CrowdVO implements Serializable {
     private Date dataDateEnd;
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
-    @ApiModelProperty("createTime")
+    @ApiModelProperty("创建时间")
     private Date createTime;
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")

二進制
src/main/resources/static/template/export/IdenCameraExportTemplate.xlsx