|
|
@ -1854,7 +1854,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
rate.put("clean_days", clientConfig.getIntValue("clean_days"));
|
|
|
|
rate.put("clean_days", clientConfig.getIntValue("clean_days"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (StringUtils.equalsIgnoreCase("rpaypmt_card", rate.getString("rate_name"))) {
|
|
|
|
if (StringUtils.equalsIgnoreCase("rpaypmt_card", rate.getString("rate_name"))) {
|
|
|
|
rate.put("ext_rates", JSONObject.parseObject(rate.getString("ext_rates")));
|
|
|
|
JSONObject extRates = JSONObject.parseObject(rate.getString("ext_rates"));
|
|
|
|
|
|
|
|
convertExtRateValueDataVersion(rate, extRates, "domestic_rate_value");
|
|
|
|
|
|
|
|
convertExtRateValueDataVersion(rate, extRates, "overseas_rate_value");
|
|
|
|
|
|
|
|
rate.put("ext_rates", extRates);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception ignore) {
|
|
|
|
} catch (Exception ignore) {
|
|
|
@ -1863,6 +1866,16 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
return rates;
|
|
|
|
return rates;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void convertExtRateValueDataVersion(JSONObject rate, JSONObject extRates, String subRateKey) {
|
|
|
|
|
|
|
|
if (!(extRates.get(subRateKey) instanceof JSON)) {
|
|
|
|
|
|
|
|
BigDecimal domesticRate = extRates.getBigDecimal(subRateKey);
|
|
|
|
|
|
|
|
JSONObject subRateConfig = new JSONObject();
|
|
|
|
|
|
|
|
subRateConfig.put("rate", domesticRate);
|
|
|
|
|
|
|
|
subRateConfig.put("clean_days", rate.getIntValue("clean_days"));
|
|
|
|
|
|
|
|
extRates.put(subRateKey, subRateConfig);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void configSettleHour(JSONObject manager, String clientMoniker, Integer hour) {
|
|
|
|
public void configSettleHour(JSONObject manager, String clientMoniker, Integer hour) {
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
@ -1948,18 +1961,26 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (StringUtils.equalsIgnoreCase("rpaypmt_card", config.getString("type"))) {
|
|
|
|
if (StringUtils.equalsIgnoreCase("rpaypmt_card", config.getString("type"))) {
|
|
|
|
JSONObject extRateParams = new JSONObject() {{
|
|
|
|
JSONObject extRateParams = new JSONObject() {{
|
|
|
|
put("domestic_rate_value", config.getBigDecimal("rate_value"));
|
|
|
|
put("domestic_rate_value", subRateObject(config.getBigDecimal("rate_value"), config.getIntValue("clean_days")));
|
|
|
|
put("overseas_rate_value", config.getJSONObject("ext_rates").getBigDecimal("international_rate_value"));
|
|
|
|
JSONObject extRates = config.getJSONObject("ext_rates");
|
|
|
|
|
|
|
|
put("overseas_rate_value", subRateObject(extRates.getBigDecimal("international_rate_value"), config.getIntValue("clean_days") + 1));
|
|
|
|
}};
|
|
|
|
}};
|
|
|
|
newConfig.put("ext_rates", extRateParams.toJSONString());
|
|
|
|
newConfig.put("ext_rates", extRateParams.toJSONString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(newConfig.getBigDecimal("cb_bankpay_rate_value") != null){
|
|
|
|
if (newConfig.getBigDecimal("cb_bankpay_rate_value") != null) {
|
|
|
|
clientRateMapper.saveRate(newConfig);
|
|
|
|
clientRateMapper.saveRate(newConfig);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
logger.info(clientId + "的" + channel + "费率设置成功");
|
|
|
|
logger.info(clientId + "的" + channel + "费率设置成功");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JSONObject subRateObject(BigDecimal rate, int cleanDays) {
|
|
|
|
|
|
|
|
JSONObject subRate = new JSONObject();
|
|
|
|
|
|
|
|
subRate.put("rate", rate);
|
|
|
|
|
|
|
|
subRate.put("clean_days", cleanDays);
|
|
|
|
|
|
|
|
return subRate;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@Transactional
|
|
|
|
@Transactional
|
|
|
|
public void modifyRateConfig(JSONObject manager, String clientMoniker, int rateId, ClientRateConfig config) {
|
|
|
|
public void modifyRateConfig(JSONObject manager, String clientMoniker, int rateId, ClientRateConfig config) {
|
|
|
@ -1979,7 +2000,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
configJson.put("update_time", new Date());
|
|
|
|
configJson.put("update_time", new Date());
|
|
|
|
if (StringUtils.equalsIgnoreCase("rpaypmt_card", config.getRateName())) {
|
|
|
|
if (StringUtils.equalsIgnoreCase("rpaypmt_card", config.getRateName())) {
|
|
|
|
JSONObject extParams = configJson.getJSONObject("ext_rates");
|
|
|
|
JSONObject extParams = configJson.getJSONObject("ext_rates");
|
|
|
|
extParams.put("domestic_rate_value", config.getRateValue());
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject domesticRate = subRateObject(new BigDecimal(config.getRateValue()), config.getCleanDays());
|
|
|
|
|
|
|
|
extParams.put("domestic_rate_value", domesticRate);
|
|
|
|
configJson.put("ext_rates", extParams.toJSONString());
|
|
|
|
configJson.put("ext_rates", extParams.toJSONString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
clientRateMapper.updateConfig(configJson);
|
|
|
|
clientRateMapper.updateConfig(configJson);
|
|
|
|