Browse Source

Merge remote-tracking branch 'origin/master'

李进 1 year ago
parent
commit
9b912f5ae2

+ 9 - 0
device-api-service/src/main/java/com/xy/service/DeviceInfoServiceImpl.java

@@ -77,6 +77,7 @@ import static com.xy.utils.PlusBeans.*;
 public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceInfo> implements DeviceInfoService {
 
     private final CloudWalkApiService cloudWalkApiService;
+    private final AlgorithmService algorithmService;
     /**
      * 质检商户code
      */
@@ -761,6 +762,8 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
             List<GoodsDeviceDto.Vo> goodsDeviceList = R.feignCheckData(goodsService.queryGoodsDeviceInfo(new GoodsDto.QueryGoodsDeviceInfo().setMercId(mercId).setDeviceIds(deviceIds)));
             Map<Long, List<GoodsDeviceDto.Vo>> deviceIdGoodsMap = goodsDeviceList.stream()
                     .collect(Collectors.groupingBy(GoodsDeviceDto.Vo::getDeviceId));
+            List<AlgorithmDto.ListNameId> algorithmList = R.feignCheckData(algorithmService.ListNameId());
+            Map<Long, String> algorithmListMap = algorithmList.stream().collect(Collectors.toMap(AlgorithmDto.ListNameId::getId, AlgorithmDto.ListNameId::getAlias));
 
             for (DeviceInfoDto.MercHomeDeviceVo device : deviceInfos) {
                 Long dId = device.getDeviceId();
@@ -783,6 +786,12 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
                         device.setFillNum(goodsDevice.stream().mapToInt(GoodsDeviceDto.Vo::getFillCount).sum());
                     }
                 }
+                //算法類型
+                Long algorithmId = device.getAlgorithmId();
+                if (algorithmId != null) {
+                    String name = algorithmListMap.get(algorithmId);
+                    device.setAlgorithmAlias(name);
+                }
 
                 //联网状态
                 Integer netState = deviceStatus == null ? DeviceNetSateType.DISCONNECT.getCode() : deviceStatus.getNetState();

+ 7 - 0
device-api/src/main/java/com/xy/dto/DeviceInfoDto.java

@@ -721,6 +721,13 @@ public class DeviceInfoDto {
         @ApiModelProperty("设备类型")
         private Integer deviceType;
 
+        @ApiModelProperty(value = "算法平台ID")
+        private Long algorithmId;
+
+        @ApiModelProperty(value = "算法类型别名")
+        private String algorithmAlias;
+
+
         @ApiModelProperty("设备类型名称")
         private String deviceTypeName;
 

+ 22 - 0
device-api/src/main/java/com/xy/dto/MercMiniSalseCountDto.java

@@ -73,6 +73,12 @@ public class MercMiniSalseCountDto {
 
         @ApiModelProperty(value = "商户ID")
         private Long mercId;
+
+        @ApiModelProperty(value = "拥有的设备ID", hidden = true)
+        private List<Long> myDeviceIds;
+
+        @ApiModelProperty(value = "是否商户管理员", hidden = true)
+        private Boolean mercAdmin;
     }
 
     @Data
@@ -91,6 +97,22 @@ public class MercMiniSalseCountDto {
 
     }
 
+    @Data
+    @Accessors(chain = true)
+    public static class MonthDTO {
+
+        @ApiModelProperty(value = "日期", required = false)
+        @JsonFormat(pattern = "yyyy-MM-dd")
+        private DateTime date;
+
+        @ApiModelProperty(value = "商户ID", required = false)
+        private Long mercId;
+
+        @ApiModelProperty(value = "拥有的设备ID", hidden = true)
+        private List<Long> myDeviceIds;
+
+    }
+
     @Data
     @Accessors(chain = true)
     public static class DayDetailDTO {