瀏覽代碼

设备管理费过期消息

李进 1 年之前
父節點
當前提交
dd56473d84
共有 1 個文件被更改,包括 7 次插入7 次删除
  1. 7 7
      device-api-service/src/main/java/com/xy/job/DeviceChargingJob.java

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

@@ -42,20 +42,20 @@ public class DeviceChargingJob {
         String now = DataTime.getSring();
         //即将过期
         FunctionUtils.NoParamsNoResult timeout1 = () -> {
-            int day = (~(SysDictUtils.getValue(EnumDeviceCharging.Code.CODE.getCode(), EnumDeviceCharging.N_200.getCode(), Integer.class) - 1));
-            String begin = DataTime.getStringAround(0, 0, day, 0, 0, 0);
-            deviceChargingTimeout(begin, now, 1, 1000);
+            int day = SysDictUtils.getValue(EnumDeviceCharging.Code.CODE.getCode(), EnumDeviceCharging.N_200.getCode(), Integer.class);
+            String end = DataTime.getStringAround(0, 0, day, 0, 0, 0);
+            deviceChargingTimeout(now, end, now, 1, 1000);
         };
         //欠费
         FunctionUtils.NoParamsNoResult timeout2 = () -> {
-            deviceChargingTimeout(null, now, 1, 1000);
+            deviceChargingTimeout(null, now, now, 1, 1000);
         };
         timeout1.run();
         timeout2.run();
         return ReturnT.SUCCESS;
     }
 
-    private void deviceChargingTimeout(String begin, String end, long current, long size) {
+    private void deviceChargingTimeout(String begin, String end, String thisTime, long current, long size) {
         //查询数据
         IPage<DeviceCharging> iPage = Page.of(current, size);
         IPage<Long> longIPage = deviceChargingMapper.deviceChargingTimeout(iPage, begin, end);
@@ -76,7 +76,7 @@ public class DeviceChargingJob {
                         .setChannelType(ChannelType.SMS.getCode())
                         .setMpOpenIds(Arrays.asList(contactPhone))
                         .setParams(new JHashMap<String, Object>()
-                                .set("dateTime", end)
+                                .set("dateTime", thisTime)
                                 .set("code", 1234)
                         );
                 msgInfos.add(msgInfo);
@@ -85,7 +85,7 @@ public class DeviceChargingJob {
         });
         //下一页
         current++;
-        deviceChargingTimeout(begin, end, current, size);
+        deviceChargingTimeout(begin, end, thisTime, current, size);
     }
 
 }