|
|
|
@ -1967,11 +1967,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
if (!clientRateMapper.listClientRatesForSaving(clientId, config.getDate("active_time"), config.getDate("expiry_time"), config.getBigDecimal("rate_value"), config.getInteger("clean_days"), channel).isEmpty()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
List<JSONObject> existRate = clientRateMapper.listCurrentClientRates(clientId, config.getDate("active_time"), channel);
|
|
|
|
|
for (JSONObject rateLog : existRate) {
|
|
|
|
|
rateLog.put("expiry_time", DateUtils.addDays(config.getDate("active_time"), -1));
|
|
|
|
|
clientRateMapper.updateConfig(rateLog);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.equalsIgnoreCase("rpaypmt_card", config.getString("type"))) {
|
|
|
|
|
JSONObject extRateParams = JsonHelper.newJson(json -> {
|
|
|
|
|
json.put("domestic_rate_value", subRateObject(config.getBigDecimal("rate_value"), config.getIntValue("clean_days")));
|
|
|
|
@ -1979,6 +1974,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
json.put("overseas_rate_value", subRateObject(extRates.getBigDecimal("international_rate_value"), config.getIntValue("clean_days") + 1));
|
|
|
|
|
});
|
|
|
|
|
newConfig.put("ext_rates", extRateParams.toJSONString());
|
|
|
|
|
}else{
|
|
|
|
|
List<JSONObject> existRate = clientRateMapper.listCurrentClientRates(clientId, config.getDate("active_time"), channel);
|
|
|
|
|
for (JSONObject rateLog : existRate) {
|
|
|
|
|
rateLog.put("expiry_time", DateUtils.addDays(config.getDate("active_time"), -1));
|
|
|
|
|
clientRateMapper.updateConfig(rateLog);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ("cb_bankpay".equalsIgnoreCase(channel)) {
|
|
|
|
|
if (newConfig.getBigDecimal("cb_bankpay_rate_value") != null) {
|
|
|
|
|