|
|
@ -47,14 +47,9 @@ public class ClientContractServiceImpl implements ClientContractService {
|
|
|
|
throw new NotFoundException("merchant not found");
|
|
|
|
throw new NotFoundException("merchant not found");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
JSONObject expireInfo = getClientContractExpire(client_id);
|
|
|
|
JSONObject expireInfo = getClientContractExpire(client_id);
|
|
|
|
if(expireInfo.getBoolean("rate_waring")){
|
|
|
|
|
|
|
|
List<JSONObject> files = clientFilesMapper.findFileByClientAndType(client_id, "source_agree_file");
|
|
|
|
|
|
|
|
return files.get(0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject contract = clientsContractMapper.findByClientId(client_id);
|
|
|
|
JSONObject contract = clientsContractMapper.findByClientId(client_id);
|
|
|
|
Date now = new Date();
|
|
|
|
Date now = new Date();
|
|
|
|
if (contract == null || now.compareTo(contract.getDate("expiry_date")) > 0 ) {
|
|
|
|
if (contract == null || now.compareTo(contract.getDate("expiry_date")) > 0) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
clientManager.getAggregateAgreeFile(client.getString("client_moniker"), null);
|
|
|
|
clientManager.getAggregateAgreeFile(client.getString("client_moniker"), null);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
@ -90,6 +85,10 @@ public class ClientContractServiceImpl implements ClientContractService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@Transactional
|
|
|
|
@Transactional
|
|
|
|
public void confirmSourceAgreement(int client_id) {
|
|
|
|
public void confirmSourceAgreement(int client_id) {
|
|
|
|
|
|
|
|
JSONObject client = clientManager.getClientInfo(client_id);
|
|
|
|
|
|
|
|
if (client == null) {
|
|
|
|
|
|
|
|
throw new NotFoundException("merchant not found");
|
|
|
|
|
|
|
|
}
|
|
|
|
JSONObject rateExpire = getClientContractExpire(client_id);
|
|
|
|
JSONObject rateExpire = getClientContractExpire(client_id);
|
|
|
|
boolean expire = rateExpire.getBoolean("rate_expire");
|
|
|
|
boolean expire = rateExpire.getBoolean("rate_expire");
|
|
|
|
boolean waring = rateExpire.getBoolean("rate_waring");
|
|
|
|
boolean waring = rateExpire.getBoolean("rate_waring");
|
|
|
@ -109,6 +108,7 @@ public class ClientContractServiceImpl implements ClientContractService {
|
|
|
|
p.remove("client_rate_id");
|
|
|
|
p.remove("client_rate_id");
|
|
|
|
p.put("create_time",now);
|
|
|
|
p.put("create_time",now);
|
|
|
|
p.put("active_time",now);
|
|
|
|
p.put("active_time",now);
|
|
|
|
|
|
|
|
p.put("update_time",now);
|
|
|
|
p.put("expiry_time",DateUtils.addYears(now,1));
|
|
|
|
p.put("expiry_time",DateUtils.addYears(now,1));
|
|
|
|
clientRateMapper.saveRate(p);
|
|
|
|
clientRateMapper.saveRate(p);
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -117,12 +117,13 @@ public class ClientContractServiceImpl implements ClientContractService {
|
|
|
|
rateInfo.forEach((p)->{
|
|
|
|
rateInfo.forEach((p)->{
|
|
|
|
p.remove("client_rate_id");
|
|
|
|
p.remove("client_rate_id");
|
|
|
|
p.put("create_time",now);
|
|
|
|
p.put("create_time",now);
|
|
|
|
|
|
|
|
p.put("update_time",now);
|
|
|
|
p.put("active_time",DateUtils.addDays(p.getDate("active_time"),1));
|
|
|
|
p.put("active_time",DateUtils.addDays(p.getDate("active_time"),1));
|
|
|
|
p.put("expiry_time",DateUtils.addYears(p.getDate("active_time"),1));
|
|
|
|
p.put("expiry_time",DateUtils.addYears(p.getDate("expiry_time"),1));
|
|
|
|
clientRateMapper.saveRate(p);
|
|
|
|
clientRateMapper.saveRate(p);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
clientManager.setClientTaxInSurcharge(client.getString("client_moniker"),true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|