|
@@ -37,14 +37,28 @@ public class DeviceChargingJob {
|
|
|
String now = DataTime.getSring();
|
|
|
Map<String, SysDictRedis> stringSysDictRedisMap = SysDictUtils.get(EnumMercCostMsgConfig.Code.CODE.getCode());
|
|
|
String tel = stringSysDictRedisMap.get(EnumMercCostMsgConfig.CUSTOM_TEL.getCode()).toString();
|
|
|
+ String mmiTime = DataTime.getStringAround(0, -1, 0, 0, 0, 0, now);
|
|
|
//即将过期
|
|
|
FunctionUtils.NoParamsNoResult timeout1 = () -> {
|
|
|
int day = Integer.valueOf(stringSysDictRedisMap.get(EnumMercCostMsgConfig.DEVICE_COST_DAY.getCode()).toString());
|
|
|
- String end = DataTime.getStringAround(0, 0, day, 0, 0, 0);
|
|
|
- deviceChargingTimeout1(now, end, 1, 1000, tel);
|
|
|
+ String end = DataTime.getStringAround(0, 0, day, 0, 0, 0, now);
|
|
|
+ JMap<String, Object> map = new JHashMap<String, Object>()
|
|
|
+ .set("mmiTime", mmiTime)
|
|
|
+ .set("workType", 1)
|
|
|
+ .set("begin", now)
|
|
|
+ .set("end", end);
|
|
|
+ deviceChargingTimeout1(map, 1, 100, tel);
|
|
|
};
|
|
|
//欠费
|
|
|
- FunctionUtils.NoParamsNoResult timeout2 = () -> deviceChargingTimeout2(now, now, 1, 1000, tel);
|
|
|
+ FunctionUtils.NoParamsNoResult timeout2 = () -> {
|
|
|
+ int day = Integer.valueOf(stringSysDictRedisMap.get(EnumMercCostMsgConfig.ARREARAGE_DAY.getCode()).toString());
|
|
|
+ String time1 = DataTime.getStringAround(0, 0, day, 0, 0, 0, now);
|
|
|
+ JMap<String, Object> map = new JHashMap<String, Object>()
|
|
|
+ .set("mmiTime", mmiTime)
|
|
|
+ .set("workType", 2)
|
|
|
+ .set("end", now);
|
|
|
+ deviceChargingTimeout2(map, now, time1, 1, 100, tel);
|
|
|
+ };
|
|
|
timeout1.run();
|
|
|
timeout2.run();
|
|
|
return ReturnT.SUCCESS;
|
|
@@ -53,15 +67,14 @@ public class DeviceChargingJob {
|
|
|
/**
|
|
|
* 即将过期
|
|
|
*
|
|
|
- * @param begin
|
|
|
- * @param end
|
|
|
- * @param current
|
|
|
- * @param size
|
|
|
- * @param tel
|
|
|
+ * @param map sql参数
|
|
|
+ * @param current 当前页码
|
|
|
+ * @param size 显示行数
|
|
|
+ * @param tel 客服手机
|
|
|
*/
|
|
|
- private void deviceChargingTimeout1(String begin, String end, long current, long size, String tel) {
|
|
|
+ private void deviceChargingTimeout1(JMap<String, Object> map, long current, long size, String tel) {
|
|
|
//查询数据
|
|
|
- IPage<Long> longIPage = deviceChargingMapper.deviceChargingTimeout(Page.of(current, size), begin, end);
|
|
|
+ IPage<Long> longIPage = deviceChargingMapper.deviceChargingTimeout(Page.of(current, size), map);
|
|
|
List<Long> mercIds = longIPage.getRecords();
|
|
|
if (!Emptys.check(mercIds)) {
|
|
|
return;
|
|
@@ -76,21 +89,22 @@ public class DeviceChargingJob {
|
|
|
.builder();
|
|
|
//下一页
|
|
|
current++;
|
|
|
- deviceChargingTimeout1(begin, end, current, size, tel);
|
|
|
+ deviceChargingTimeout1(map, current, size, tel);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 已欠费
|
|
|
*
|
|
|
- * @param end
|
|
|
- * @param thisTime
|
|
|
- * @param current
|
|
|
- * @param size
|
|
|
- * @param tel
|
|
|
+ * @param map sql参数
|
|
|
+ * @param thisTime 当前时间
|
|
|
+ * @param time1 过期后可用时间
|
|
|
+ * @param current 当前页码
|
|
|
+ * @param size 显示行数
|
|
|
+ * @param tel 客服手机
|
|
|
*/
|
|
|
- private void deviceChargingTimeout2(String end, String thisTime, long current, long size, String tel) {
|
|
|
+ private void deviceChargingTimeout2(JMap<String, Object> map, String thisTime, String time1, long current, long size, String tel) {
|
|
|
//查询数据
|
|
|
- IPage<Long> longIPage = deviceChargingMapper.deviceChargingTimeout(Page.of(current, size), null, end);
|
|
|
+ IPage<Long> longIPage = deviceChargingMapper.deviceChargingTimeout(Page.of(current, size), map);
|
|
|
List<Long> mercIds = longIPage.getRecords();
|
|
|
if (!Emptys.check(mercIds)) {
|
|
|
return;
|
|
@@ -99,7 +113,7 @@ public class DeviceChargingJob {
|
|
|
JMap<String, Object> params = new JHashMap<String, Object>()
|
|
|
.set("time0", thisTime)
|
|
|
.set("type", "设备管理费")
|
|
|
- .set("time1", "")
|
|
|
+ .set("time1", time1)
|
|
|
.set("phone", tel);
|
|
|
MsgUtils.sendMsg(15L, mercIds)
|
|
|
.official(userInfo -> new MsgUtils.MsgInfo(userInfo.getMpOpenid(), params))
|
|
@@ -107,7 +121,7 @@ public class DeviceChargingJob {
|
|
|
.builder();
|
|
|
//下一页
|
|
|
current++;
|
|
|
- deviceChargingTimeout2(end, thisTime, current, size, tel);
|
|
|
+ deviceChargingTimeout2(map, thisTime, time1, current, size, tel);
|
|
|
}
|
|
|
|
|
|
}
|