|
|
|
@ -54,7 +54,8 @@ public class ClientContractServiceImpl implements ClientContractService {
|
|
|
|
|
JSONObject expireInfo = getClientContractExpire(client_id);
|
|
|
|
|
JSONObject contract = clientsContractMapper.findByClientId(client_id);
|
|
|
|
|
Date now = new Date();
|
|
|
|
|
if ((expireInfo.getBoolean("rate_waring")||expireInfo.getBoolean("old_contract")) && (contract == null || now.compareTo(contract.getDate("expiry_date")) > 0)) {
|
|
|
|
|
if ((expireInfo.getBoolean("rate_waring") || expireInfo.getBoolean("old_contract"))
|
|
|
|
|
&& (contract == null || now.compareTo(contract.getDate("expiry_date")) > 0)) {
|
|
|
|
|
try {
|
|
|
|
|
clientManager.getNewAggregateAgreeFile(client.getString("client_moniker"), null, true);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
@ -118,7 +119,6 @@ public class ClientContractServiceImpl implements ClientContractService {
|
|
|
|
|
contract.put("signatory", account.getString("display_name"));
|
|
|
|
|
clientsContractMapper.update(contract);
|
|
|
|
|
List<JSONObject> rateInfo = clientRateMapper.minExpiryTime(client_id, null);
|
|
|
|
|
if (expire || old_contract) {
|
|
|
|
|
rateInfo.forEach((p) -> {
|
|
|
|
|
p.remove("client_rate_id");
|
|
|
|
|
p.put("create_time", now);
|
|
|
|
@ -129,19 +129,6 @@ public class ClientContractServiceImpl implements ClientContractService {
|
|
|
|
|
p.put("manager_name", "merchant_" + account_id + "_" + account.getString("display_name"));
|
|
|
|
|
clientRateMapper.saveRate(p);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (!expire && waring && !old_contract) {
|
|
|
|
|
rateInfo.forEach((p) -> {
|
|
|
|
|
p.remove("client_rate_id");
|
|
|
|
|
p.put("create_time", now);
|
|
|
|
|
p.put("manager_id", "0");
|
|
|
|
|
p.put("update_time", now);
|
|
|
|
|
p.put("manager_name", "merchant_" + account_id + "_" + account.getString("display_name"));
|
|
|
|
|
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);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
clientManager.setClientTaxInSurcharge(client.getString("client_moniker"), false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -213,14 +200,15 @@ public class ClientContractServiceImpl implements ClientContractService {
|
|
|
|
|
result.put("rate_waring", true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(!result.getBoolean("rate_waring") && !result.getBoolean("rate_expire")){
|
|
|
|
|
if (!result.getBoolean("rate_waring") && !result.getBoolean("rate_expire")) {
|
|
|
|
|
List<JSONObject> files = clientFilesMapper.findFileByClientAndType(client_id, "source_agree_file");
|
|
|
|
|
if (CollectionUtils.isEmpty(files)) {
|
|
|
|
|
result.put("old_contract", true);
|
|
|
|
|
result.put("rate_waring", true);
|
|
|
|
|
} else {
|
|
|
|
|
JSONObject file = files.get(0);
|
|
|
|
|
if (sysconfig.getDate("sys_new_contract_time").compareTo(file.getDate("last_update_date")) > 0 || (contract!=null && !contract.getBoolean("has_sign"))) {
|
|
|
|
|
if (sysconfig.getDate("sys_new_contract_time").compareTo(file.getDate("last_update_date")) > 0
|
|
|
|
|
|| (contract != null && !contract.getBoolean("has_sign"))) {
|
|
|
|
|
result.put("old_contract", true);
|
|
|
|
|
result.put("rate_waring", true);
|
|
|
|
|
}
|
|
|
|
|