|
|
|
@ -61,8 +61,9 @@ public class PostponeClientTask {
|
|
|
|
|
expiryClients.put(p.getInteger("client_id"), p);
|
|
|
|
|
});
|
|
|
|
|
expiryClients.values().forEach(p -> {
|
|
|
|
|
List<JSONObject> adminAccounts = clientAccountMapper.listAdminAccounts(p.getIntValue("client_id"));
|
|
|
|
|
List<JSONObject> clientRates = clientRateMapper.maxChannelExpiryTime(p.getIntValue("client_id"), null);
|
|
|
|
|
int client_id = p.getIntValue("client_id");
|
|
|
|
|
List<JSONObject> adminAccounts = clientAccountMapper.listAdminAccounts(client_id);
|
|
|
|
|
List<JSONObject> clientRates = clientRateMapper.maxChannelExpiryTime(client_id, null);
|
|
|
|
|
JSONObject wechatRate = clientRateMapper.latestChannelCleanDays("Wechat", p.getIntValue("client_id"));
|
|
|
|
|
int cleanDays = 1;
|
|
|
|
|
if (wechatRate.getInteger("clean_days") != null) {
|
|
|
|
@ -72,16 +73,17 @@ public class PostponeClientTask {
|
|
|
|
|
}
|
|
|
|
|
int finalCleanDays = cleanDays;
|
|
|
|
|
clientRates.forEach(o -> {
|
|
|
|
|
o.remove("client_rate_id");
|
|
|
|
|
o.put("active_time", tomorrow);
|
|
|
|
|
o.put("manager_id", 0);
|
|
|
|
|
o.put("expiry_time", yearTomorrow);
|
|
|
|
|
o.put("create_time", now);
|
|
|
|
|
o.put("update_time", now);
|
|
|
|
|
o.put("clean_days", finalCleanDays);
|
|
|
|
|
o.put("manager_name", "System");
|
|
|
|
|
o.put("remark", "费率到期系统自动延期1年");
|
|
|
|
|
clientRateMapper.saveRate(o);
|
|
|
|
|
JSONObject record = clientRateMapper.latestExpiryConfig(client_id,o.getString("rate_name"));
|
|
|
|
|
record.remove("client_rate_id");
|
|
|
|
|
record.put("active_time", now);
|
|
|
|
|
record.put("manager_id", 0);
|
|
|
|
|
record.put("expiry_time", yearTomorrow);
|
|
|
|
|
record.put("create_time", now);
|
|
|
|
|
record.put("update_time", now);
|
|
|
|
|
record.put("clean_days", finalCleanDays);
|
|
|
|
|
record.put("manager_name", "System");
|
|
|
|
|
record.put("remark", "费率到期系统自动延期1年");
|
|
|
|
|
clientRateMapper.saveRate(record);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
adminAccounts.forEach(o -> {
|
|
|
|
|