|
|
@ -4,6 +4,8 @@ import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
|
|
|
|
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
|
|
|
|
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.entity.impls.SwitchPermissionModify;
|
|
|
|
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi;
|
|
|
|
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi;
|
|
|
|
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider;
|
|
|
|
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider;
|
|
|
|
import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage;
|
|
|
|
import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage;
|
|
|
@ -18,6 +20,7 @@ import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
@ -47,9 +50,11 @@ public class PostponeClientTask {
|
|
|
|
private ManagerMapper managerMapper;
|
|
|
|
private ManagerMapper managerMapper;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private SynchronizedScheduler synchronizedScheduler;
|
|
|
|
private SynchronizedScheduler synchronizedScheduler;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private ClientModifySupport clientModifySupport;
|
|
|
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 30 8 * * ?")
|
|
|
|
@Scheduled(cron = "0 30 8 * * ?")
|
|
|
|
|
|
|
|
@Transactional
|
|
|
|
public void postponeClient() {
|
|
|
|
public void postponeClient() {
|
|
|
|
synchronizedScheduler.executeProcess("manage_task:postPoneClient", 120_000, () -> {
|
|
|
|
synchronizedScheduler.executeProcess("manage_task:postPoneClient", 120_000, () -> {
|
|
|
|
Date now = new Date();
|
|
|
|
Date now = new Date();
|
|
|
@ -91,6 +96,9 @@ public class PostponeClientTask {
|
|
|
|
clientRateMapper.saveRate(record);
|
|
|
|
clientRateMapper.saveRate(record);
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
if(p.getBooleanValue("tax_in_surcharge")){
|
|
|
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(null,p.getString("client_moniker"),"tax_in_surcharge",false));
|
|
|
|
|
|
|
|
}
|
|
|
|
adminAccounts.forEach(o -> {
|
|
|
|
adminAccounts.forEach(o -> {
|
|
|
|
sendClientPostponeNotify(o, expireDate);
|
|
|
|
sendClientPostponeNotify(o, expireDate);
|
|
|
|
});
|
|
|
|
});
|
|
|
|