master
wangning 7 years ago
parent 15fd0edfc5
commit 65975c4f6e

@ -345,6 +345,6 @@ public class RetailAppController {
@RequestMapping(value = "/file/agree/confirm", method = RequestMethod.POST)
public void confirmSourceAgreeFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) {
clientContractService.confirmSourceAgreement(device.getIntValue("client_id"));
clientContractService.confirmSourceAgreement(device.getIntValue("client_id"),device.getString("account_id"));
}
}

@ -532,6 +532,6 @@ public class PartnerManageController {
@PartnerMapping(value = "/agree/confirm", method = RequestMethod.POST)
public void confirmSourceAgreeFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
clientContractService.confirmSourceAgreement(account.getIntValue("client_id"));
clientContractService.confirmSourceAgreement(account.getIntValue("client_id"),account.getString("account_id"));
}
}

@ -6,7 +6,7 @@ public interface ClientContractService {
JSONObject getOrGenerateSourceAgreement(int client_id);
void confirmSourceAgreement(int client_id);
void confirmSourceAgreement(int client_id,String account_id);
JSONObject getSourceAgreement(int client_id);

@ -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);
});
}

Loading…
Cancel
Save