master
kira 6 years ago
parent d6c53c115b
commit 3a7241360f

@ -341,5 +341,5 @@ public interface ClientManager {
void updateAllPartnerPassword(String clientMoniker, List<String> emails); void updateAllPartnerPassword(String clientMoniker, List<String> emails);
void postponeClientRate(Date now, Date yearTomorrow, String expireDate, JSONObject p, StringBuilder sb); void postponeClientRate(Date now, Date yearTomorrow, String expireDate, JSONObject client);
} }

@ -3998,11 +3998,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override @Override
@Transactional @Transactional
public void postponeClientRate(Date now, Date yearTomorrow, String expireDate, JSONObject p, StringBuilder sb) { public void postponeClientRate(Date now, Date yearTomorrow, String expireDate, JSONObject client) {
int client_id = p.getIntValue("client_id"); int client_id = client.getIntValue("client_id");
List<JSONObject> adminAccounts = clientAccountMapper.listAdminAccounts(client_id); List<JSONObject> adminAccounts = clientAccountMapper.listAdminAccounts(client_id);
List<JSONObject> clientRates = clientRateMapper.maxChannelExpiryTime(client_id, null); List<JSONObject> 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; int cleanDays = 1;
if (wechatRate.getInteger("clean_days") != null) { if (wechatRate.getInteger("clean_days") != null) {
cleanDays = wechatRate.getIntValue("clean_days"); 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 -> { adminAccounts.forEach(o -> {
sendClientPostponeNotify(o, expireDate); sendClientPostponeNotify(o, expireDate);
}); });
sb.append(p.getString("client_moniker"));
sb.append("、");
} }

@ -55,11 +55,13 @@ public class PostponeClientTask {
if (CollectionUtils.isEmpty(expiryClient)) { if (CollectionUtils.isEmpty(expiryClient)) {
return; return;
} }
for (JSONObject p : expiryClient) { for (JSONObject client : expiryClient) {
try { 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) { } catch (Exception ignore) {
logger.info("a",ignore); continue;
} }
} }
sb.deleteCharAt(sb.length() - 1); sb.deleteCharAt(sb.length() - 1);

@ -11,7 +11,7 @@ import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource; import javax.annotation.Resource;
@SpringBootTest @SpringBootTest
@ActiveProfiles({ "local", "alipay", "wechat", "jd", "bestpay" }) @ActiveProfiles({ "local","rpay", "alipay", "wechat", "jd", "bestpay" })
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
public class PostponeClientTaskTest { public class PostponeClientTaskTest {
@Resource @Resource

Loading…
Cancel
Save