|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package au.com.royalpay.payment.manage.system.core.impl;
|
|
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientFilesMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientsContractMapper;
|
|
|
|
@ -38,6 +39,8 @@ public class ClientContractServiceImpl implements ClientContractService {
|
|
|
|
|
private ClientRateMapper clientRateMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private SysConfigManager sysConfigManager;
|
|
|
|
|
@Resource
|
|
|
|
|
private ClientAccountMapper clientAccountMapper;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
@ -84,7 +87,7 @@ public class ClientContractServiceImpl implements ClientContractService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public void confirmSourceAgreement(int client_id) {
|
|
|
|
|
public void confirmSourceAgreement(int client_id,String account_id) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfo(client_id);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new NotFoundException("merchant not found");
|
|
|
|
@ -99,7 +102,11 @@ public class ClientContractServiceImpl implements ClientContractService {
|
|
|
|
|
if(contract.getBoolean("has_sign")){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
JSONObject account = clientAccountMapper.findById(account_id);
|
|
|
|
|
|
|
|
|
|
contract.put("has_sign", 1);
|
|
|
|
|
contract.put("sign_account_id",account_id);
|
|
|
|
|
contract.put("signatory",account.getString("display_name"));
|
|
|
|
|
clientsContractMapper.update(contract);
|
|
|
|
|
Date now = new Date();
|
|
|
|
|
List<JSONObject> rateInfo = clientRateMapper.minExpiryTime(client_id, null);
|
|
|
|
@ -118,8 +125,8 @@ public class ClientContractServiceImpl implements ClientContractService {
|
|
|
|
|
p.remove("client_rate_id");
|
|
|
|
|
p.put("create_time",now);
|
|
|
|
|
p.put("update_time",now);
|
|
|
|
|
p.put("active_time",DateUtils.addDays(p.getDate("active_time"),1));
|
|
|
|
|
p.put("expiry_time",DateUtils.addYears(p.getDate("expiry_time"),1));
|
|
|
|
|
p.put("active_time",DateUtils.addDays(p.getDate("expiry_time"),1));
|
|
|
|
|
p.put("expiry_time",DateUtils.addYears(p.getDate("active_time"),1));
|
|
|
|
|
clientRateMapper.saveRate(p);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|