|
|
|
@ -76,15 +76,28 @@ public class ClientContractServiceImpl implements ClientContractService {
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new NotFoundException("merchant not found");
|
|
|
|
|
}
|
|
|
|
|
Date now = new Date();
|
|
|
|
|
JSONObject account = clientAccountMapper.findById(account_id);
|
|
|
|
|
JSONObject contract = clientsContractMapper.findByClientId(client_id);
|
|
|
|
|
if (contract != null && contract.getBoolean("has_sign")) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(contract ==null){
|
|
|
|
|
JSONObject record = new JSONObject();
|
|
|
|
|
record.put("has_sign",1);
|
|
|
|
|
record.put("client_id",client_id);
|
|
|
|
|
record.put("create_time",now);
|
|
|
|
|
record.put("sign_account_id", account_id);
|
|
|
|
|
record.put("sign_channel", channel);
|
|
|
|
|
record.put("confirm_time", now);
|
|
|
|
|
record.put("expiry_date", DateUtils.addYears(now, 1));
|
|
|
|
|
record.put("sign_channel", channel);
|
|
|
|
|
record.put("signatory", account.getString("display_name"));
|
|
|
|
|
clientsContractMapper.save(record);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getOrGenerateSourceAgreement(client_id, channel);
|
|
|
|
|
Date now = new Date();
|
|
|
|
|
logger.info("confirmSourceAgreement+account_id"+account_id);
|
|
|
|
|
JSONObject account = clientAccountMapper.findById(account_id);
|
|
|
|
|
contract.put("has_sign", 1);
|
|
|
|
|
contract.put("sign_account_id", account_id);
|
|
|
|
|
contract.put("sign_channel", channel);
|
|
|
|
@ -155,4 +168,6 @@ public class ClientContractServiceImpl implements ClientContractService {
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|