Prechádzať zdrojové kódy

算法卡包修改业务逻辑

李进 1 rok pred
rodič
commit
beb572c649

+ 1 - 3
device-api-service/src/main/java/com/xy/job/DeviceAlgorithmChargingJob.java

@@ -5,7 +5,6 @@ import com.xxl.job.core.biz.model.ReturnT;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import com.xy.annotate.RestMappingController;
 import com.xy.collections.list.JArrayList;
-import com.xy.collections.list.JList;
 import com.xy.collections.map.JMap;
 import com.xy.dto.MercAccountDto;
 import com.xy.entity.DeviceAlgorithmCharging;
@@ -85,11 +84,10 @@ public class DeviceAlgorithmChargingJob {
                 if (deviceAlgorithmChargingsJMaps.containsKey(deviceId)) {
                     return;
                 }
-                //冻结and停运设备
+                //冻结设备
                 DeviceInfo updateDeviceInfo = new DeviceInfo()
                         .setDeviceId(deviceId)
                         .setFreezeStatus(2)
-                        .setBusyState(2)
                         .setUpdateTime(now);
                 updateDeviceInfos.add(updateDeviceInfo);
             });

+ 1 - 2
device-api-service/src/main/java/com/xy/job/DeviceChargingJob.java

@@ -67,11 +67,10 @@ public class DeviceChargingJob {
                     .eq(DeviceInfo::getActiveState, 1)
                     .eq(DeviceInfo::getFreezeStatus, 1);
             List<DeviceInfo> deviceInfos = deviceInfoService.list(deviceInfoLambdaQueryWrapper);
-            //冻结and停运设备
+            //冻结设备
             if (Emptys.check(deviceInfos)) {
                 deviceInfos.forEach(deviceInfo -> deviceInfo
                         .setFreezeStatus(2)
-                        .setBusyState(2)
                         .setUpdateTime(now)
                 );
                 deviceInfoService.updateBatchById(deviceInfos);

+ 0 - 1
device-api-service/src/main/java/com/xy/service/DeviceChargingServiceImpl.java

@@ -325,7 +325,6 @@ public class DeviceChargingServiceImpl extends ServiceImpl<DeviceChargingMapper,
                 DeviceInfoDto.Update updateDeviceInfo = new DeviceInfoDto.Update()
                         .setDeviceId(deviceChargingHistory.getDeviceId());
                 updateDeviceInfo.setFreezeStatus(1);
-                updateDeviceInfo.setBusyState(1);
                 //激活设备
                 if (deviceChargingHistory.getChargingType() != 100) {
                     if (deviceInfo.getActiveState() == 2) {

+ 2 - 1
device-api-service/src/main/java/com/xy/service/DeviceInfoServiceImpl.java

@@ -500,8 +500,8 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
         return R.ok();
     }
 
+    @Override
     @ApiOperation("批量修改")
-    @PostMapping("updateBatch")
     public R updateBatch(@RequestBody List<DeviceInfoDto.Update> updates) {
         LocalDateTime now = LocalDateTime.now();
         List<DeviceInfo> deviceInfos = new ArrayList<>(updates.size());
@@ -778,6 +778,7 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
     @Override
     public R<List<DeviceInfoDto.Vo>> list(DeviceInfoDto.ListDto dto) {
         List<DeviceInfo> list = list(new LambdaQueryWrapper<DeviceInfo>()
+                .eq(DeviceInfo::getFreezeStatus, dto.getFreezeStatus())
                 .in(CollUtil.isNotEmpty(dto.getDeviceIds()), DeviceInfo::getDeviceId, dto.getDeviceIds())
                 .eq(Emptys.check(dto.getMercId()), DeviceInfo::getMercId, dto.getMercId())
         );

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

@@ -245,6 +245,9 @@ public final static String DEL = "del";
 
         @ApiModelProperty(value = "商户id")
         private Long mercId;
+
+        @ApiModelProperty("冻结状态")
+        private Integer freezeStatus;
     }
 
     @Data

+ 3 - 0
device-api/src/main/java/com/xy/service/DeviceInfoService.java

@@ -203,4 +203,7 @@ public interface DeviceInfoService {
 
     @PostMapping("pageByAdminName")
     R<PageBean<DeviceInfoDto.ListByAdminName>> pageByAdminName(@RequestBody @Validated DeviceInfoDto.PageByAdminNameDto dto);
+
+    @PostMapping("updateBatch")
+    R updateBatch(@RequestBody List<DeviceInfoDto.Update> updates);
 }