Эх сурвалжийг харах

Merge branch 'master' into test

李进 1 жил өмнө
parent
commit
6154527a8c

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

@@ -3,9 +3,7 @@ package com.xy.job;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 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;
@@ -17,7 +15,6 @@ import com.xy.utils.Emptys;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.GetMapping;
 
 import java.time.LocalDateTime;
 import java.util.ArrayList;
@@ -29,7 +26,6 @@ import java.util.List;
 @Slf4j
 @Component
 @AllArgsConstructor
-@RestMappingController("test")
 public class DeviceAlgorithmChargingJob {
 
     private MercAccountService mercAccountService;
@@ -43,7 +39,6 @@ public class DeviceAlgorithmChargingJob {
      *
      * @return
      */
-    @GetMapping("test")
     @XxlJob("deviceAlgorithmChargingHalt")
     public ReturnT<String> deviceAlgorithmChargingHalt() {
         //查询余额<=0商户
@@ -85,11 +80,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);
 }