|
|
@ -69,6 +69,23 @@ public class PostponeClientTask {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 30 6 * * ?")
|
|
|
|
|
|
|
|
private void postponeMerchantRate() {
|
|
|
|
|
|
|
|
synchronizedScheduler.executeProcess("manage_task:postponeMerchantRate", 120_000, () -> {
|
|
|
|
|
|
|
|
String nextYearExipryDate = DateFormatUtils.format(DateUtils.addYears(new Date(), 1), "yyyy-MM-dd");
|
|
|
|
|
|
|
|
List<JSONObject> expiryRateMerchants = clientRateMapper.getAllClientRateExpiryMerchants();
|
|
|
|
|
|
|
|
StringBuilder merchantStrBuilder = new StringBuilder();
|
|
|
|
|
|
|
|
expiryRateMerchants.forEach(merchant -> {
|
|
|
|
|
|
|
|
if (clientManager.postponeClientRate(merchant.getIntValue("client_id"), merchant.getString("client_moniker"),nextYearExipryDate)) {
|
|
|
|
|
|
|
|
merchantStrBuilder.append(merchant.getString("client_moniker")).append("、");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
merchantStrBuilder.deleteCharAt(merchantStrBuilder.length() - 1);
|
|
|
|
|
|
|
|
sendComplianceNotify(merchantStrBuilder, nextYearExipryDate);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void sendComplianceNotify(StringBuilder sb, String newExpireDate) {
|
|
|
|
private void sendComplianceNotify(StringBuilder sb, String newExpireDate) {
|
|
|
|
List<String> compliance = managerMapper.listOpenIdsOfCompliances();
|
|
|
|
List<String> compliance = managerMapper.listOpenIdsOfCompliances();
|
|
|
|
compliance.forEach(p -> {
|
|
|
|
compliance.forEach(p -> {
|
|
|
@ -76,8 +93,8 @@ public class PostponeClientTask {
|
|
|
|
TemplateMessage notice = initComplianceMessage(sb.toString(), newExpireDate, p, api.getTemplateId("client-postpone"));
|
|
|
|
TemplateMessage notice = initComplianceMessage(sb.toString(), newExpireDate, p, api.getTemplateId("client-postpone"));
|
|
|
|
api.sendTemplateMessage(notice);
|
|
|
|
api.sendTemplateMessage(notice);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private TemplateMessage initComplianceMessage(String clients, String newExpiryDate, String wechatOpenid, String templateId) {
|
|
|
|
private TemplateMessage initComplianceMessage(String clients, String newExpiryDate, String wechatOpenid, String templateId) {
|
|
|
|
TemplateMessage notice = new TemplateMessage(wechatOpenid, templateId, null);
|
|
|
|
TemplateMessage notice = new TemplateMessage(wechatOpenid, templateId, null);
|
|
|
|
notice.put("first", "以下商户据合同费率已经自动延期1年", "#ff0000");
|
|
|
|
notice.put("first", "以下商户据合同费率已经自动延期1年", "#ff0000");
|
|
|
|