ソースを参照

去除算法停机(提现模式)

lijin 6 ヶ月 前
コミット
423b1efd10

+ 13 - 0
device-api-service/src/main/java/com/xy/job/DeviceAlgorithmChargingJob.java

@@ -10,12 +10,14 @@ import com.xy.collections.list.JList;
 import com.xy.collections.map.JMap;
 import com.xy.dto.MercAccountDto;
 import com.xy.dto.MercArrearageConfigDto;
+import com.xy.dto.be.MercDto;
 import com.xy.entity.DeviceAlgorithmCharging;
 import com.xy.entity.DeviceInfo;
 import com.xy.service.DeviceAlgorithmChargingServiceImpl;
 import com.xy.service.DeviceInfoServiceImpl;
 import com.xy.service.MercAccountService;
 import com.xy.service.MercArrearageConfigService;
+import com.xy.service.be.MercService;
 import com.xy.sys.EnumMercCostMsgConfig;
 import com.xy.utils.Emptys;
 import com.xy.utils.SysDictUtils;
@@ -27,6 +29,7 @@ import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 设备算法费job
@@ -44,6 +47,8 @@ public class DeviceAlgorithmChargingJob {
 
     private MercArrearageConfigService mercArrearageConfigService;
 
+    private MercService mercService;
+
     /**
      * 算法费设备停机
      *
@@ -67,6 +72,9 @@ public class DeviceAlgorithmChargingJob {
         selectList.setType(2);
         List<MercArrearageConfigDto.Vo> data = mercArrearageConfigService.list(selectList).getData();
         JMap<Long, MercArrearageConfigDto.Vo> mercArrearageConfigJMaps = new JArrayList<>(data).toMap(MercArrearageConfigDto.Vo::getMercId).cover();
+        //查询是否提现模式
+        Map<Long, Boolean> isDrawMaps = mercService.isDrawList(new MercDto.IsDrawList().setMercIds(new JArrayList<>(list).getProperty(MercAccountDto.Vo::getMercId))).getData();
+        //循环处理
         mercAccounts.forEach(vo -> {
             //验证白名单
             MercArrearageConfigDto.Vo mercArrearageConfig = mercArrearageConfigJMaps.get(vo.getMercId());
@@ -75,6 +83,11 @@ public class DeviceAlgorithmChargingJob {
                     return;
                 }
             }
+            //验证是否提现模式
+            Boolean isDraw = isDrawMaps.get(vo.getMercId());
+            if (isDraw) {
+                return;
+            }
             //查询商户未冻结设备
             List<DeviceInfo> deviceInfos = deviceInfoService.list(new LambdaQueryWrapper<DeviceInfo>()
                     .in(DeviceInfo::getDeviceType, Arrays.asList(1, 2))

+ 3 - 3
device-api-service/src/main/java/com/xy/service/factory/device/impl/open/OpenDeviceFactoryImpl.java

@@ -154,9 +154,9 @@ public class OpenDeviceFactoryImpl implements DeviceFactory {
         if (count > 0) {
             return R.fail("机器已激活");
         }
-        //提现模式商户无需算法费
-        MercDto.Vo merc = mercService.obj(new MercDto.Vo().setId(deviceIds.get(0))).getData();
-        if (Emptys.check(merc.getIsDraw()) && merc.getIsDraw()) {
+        //提现模式商户无需算法费
+        Boolean isDraw = mercService.isDraw(new MercDto.IsDraw().setMercId(deviceIds.get(0))).getData();
+        if (isDraw) {
             active.setIsDeviceAlgorithmCharging(false);
         }
         //检查费用