diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java index a1da2958b..8bcca2a11 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java @@ -341,5 +341,5 @@ public interface ClientManager { void updateAllPartnerPassword(String clientMoniker, List emails); - void postponeClientRate(Date now, Date yearTomorrow, String expireDate, JSONObject p, StringBuilder sb); + void postponeClientRate(Date now, Date yearTomorrow, String expireDate, JSONObject client); } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index ddb9a9738..85af71677 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -3998,11 +3998,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Override @Transactional - public void postponeClientRate(Date now, Date yearTomorrow, String expireDate, JSONObject p, StringBuilder sb) { - int client_id = p.getIntValue("client_id"); + public void postponeClientRate(Date now, Date yearTomorrow, String expireDate, JSONObject client) { + int client_id = client.getIntValue("client_id"); List adminAccounts = clientAccountMapper.listAdminAccounts(client_id); List clientRates = clientRateMapper.maxChannelExpiryTime(client_id, null); - JSONObject wechatRate = clientRateMapper.latestChannelCleanDays("Wechat", p.getIntValue("client_id")); + JSONObject wechatRate = clientRateMapper.latestChannelCleanDays("Wechat", client.getIntValue("client_id")); int cleanDays = 1; if (wechatRate.getInteger("clean_days") != null) { cleanDays = wechatRate.getIntValue("clean_days"); @@ -4027,12 +4027,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } } - clientModifySupport.processClientConfigModify(new SwitchPermissionModify(null, p.getString("client_moniker"), "tax_in_surcharge", false)); + clientModifySupport.processClientConfigModify(new SwitchPermissionModify(null, client.getString("client_moniker"), "tax_in_surcharge", false)); adminAccounts.forEach(o -> { sendClientPostponeNotify(o, expireDate); }); - sb.append(p.getString("client_moniker")); - sb.append("、"); } diff --git a/src/main/java/au/com/royalpay/payment/manage/task/PostponeClientTask.java b/src/main/java/au/com/royalpay/payment/manage/task/PostponeClientTask.java index f0cc4f098..c03a84d31 100644 --- a/src/main/java/au/com/royalpay/payment/manage/task/PostponeClientTask.java +++ b/src/main/java/au/com/royalpay/payment/manage/task/PostponeClientTask.java @@ -55,11 +55,13 @@ public class PostponeClientTask { if (CollectionUtils.isEmpty(expiryClient)) { return; } - for (JSONObject p : expiryClient) { + for (JSONObject client : expiryClient) { try { - clientManager.postponeClientRate(now, yearTomorrow, expireDate, p, sb); + clientManager.postponeClientRate(now, yearTomorrow, expireDate, client); + sb.append(client.getString("client_moniker")); + sb.append("、"); } catch (Exception ignore) { - logger.info("a",ignore); + continue; } } sb.deleteCharAt(sb.length() - 1); diff --git a/src/test/java/au/com/royalpay/payment/manage/task/PostponeClientTaskTest.java b/src/test/java/au/com/royalpay/payment/manage/task/PostponeClientTaskTest.java index 42b2f38e6..254f1ca27 100644 --- a/src/test/java/au/com/royalpay/payment/manage/task/PostponeClientTaskTest.java +++ b/src/test/java/au/com/royalpay/payment/manage/task/PostponeClientTaskTest.java @@ -10,9 +10,9 @@ import org.springframework.test.context.junit4.SpringRunner; import javax.annotation.Resource; -@SpringBootTest -@ActiveProfiles({ "local", "alipay", "wechat", "jd", "bestpay" }) -@RunWith(SpringRunner.class) + @SpringBootTest + @ActiveProfiles({ "local","rpay", "alipay", "wechat", "jd", "bestpay" }) + @RunWith(SpringRunner.class) public class PostponeClientTaskTest { @Resource private ClientRateMapper clientRateMapper;