Commit e0c8aec6 authored by 杨钧's avatar 杨钧

code_review修改

parent 9f68ff79
...@@ -85,9 +85,9 @@ public class OperateLogAspect { ...@@ -85,9 +85,9 @@ public class OperateLogAspect {
if (jsonObject.containsKey("opState")) { if (jsonObject.containsKey("opState")) {
Integer opStateFlag = jsonObject.getInteger("opState"); Integer opStateFlag = jsonObject.getInteger("opState");
if(opStateFlag == 1){ if(opStateFlag == 1){
opState = "设置有效"; opState = "添加白名单";
}else{ }else{
opState = "设置无效"; opState = "移除白名单";
} }
} }
...@@ -109,7 +109,11 @@ public class OperateLogAspect { ...@@ -109,7 +109,11 @@ public class OperateLogAspect {
moduleName = module; moduleName = module;
} }
moduleName = moduleName.concat(opState); // 针对特殊情形,需要取不同操作
if(StringUtils.isNotBlank(opState)){
moduleName = opState;
}
log.info("{} 处理结果:{}", logPre, String.valueOf(result)); log.info("{} 处理结果:{}", logPre, String.valueOf(result));
OpUser opUser = UserThreadLocal.get(); OpUser opUser = UserThreadLocal.get();
......
...@@ -4,9 +4,7 @@ import cn.quantgroup.customer.config.http.mvc.converter.DateConverter; ...@@ -4,9 +4,7 @@ import cn.quantgroup.customer.config.http.mvc.converter.DateConverter;
import cn.quantgroup.customer.config.http.mvc.converter.IEnumConverterFactory; import cn.quantgroup.customer.config.http.mvc.converter.IEnumConverterFactory;
import cn.quantgroup.customer.config.http.mvc.converter.LocalDateConverter; import cn.quantgroup.customer.config.http.mvc.converter.LocalDateConverter;
import cn.quantgroup.customer.config.http.mvc.converter.LocalDateTimeConverter; import cn.quantgroup.customer.config.http.mvc.converter.LocalDateTimeConverter;
import cn.quantgroup.customer.config.http.mvc.filter.UserTokenInterceptor;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry; import org.springframework.format.FormatterRegistry;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
......
...@@ -10,4 +10,7 @@ public interface OperateLogRepo extends JpaRepository<OperateLogModel, Long> { ...@@ -10,4 +10,7 @@ public interface OperateLogRepo extends JpaRepository<OperateLogModel, Long> {
@Query(value = "select * from operate_log where loan_id =?1 ORDER BY id DESC", nativeQuery = true) @Query(value = "select * from operate_log where loan_id =?1 ORDER BY id DESC", nativeQuery = true)
List<OperateLogModel> findLogsByLoanId(Long loanId); List<OperateLogModel> findLogsByLoanId(Long loanId);
@Query(value = "select count(1) from operate_log where loan_id =?1", nativeQuery = true)
Long findLogsCountsByLoanId(Long loanId);
} }
...@@ -25,15 +25,15 @@ public class OperateRest { ...@@ -25,15 +25,15 @@ public class OperateRest {
private IOrderService orderService; private IOrderService orderService;
/** /**
* 提前一次性结清订单白名单配置 * 添加或移除白名单
* *
* @param operateEntryParam * @param operateEntryParam
* @return * @return
*/ */
@PostMapping("/setOrCancelEarlySettleUpWhiteLists") @PostMapping("/set_or_cancel_settleUp_white_list")
@OperateLog(moduleName = "提前一次性结清白名单操作") @OperateLog(moduleName = "添加或移除白名单")
public JsonResult setOrCancelEarlySettleUpEntry(OperateEntryParam operateEntryParam) { public JsonResult setOrCancelSettleUpWhiteList(OperateEntryParam operateEntryParam) {
log.info("[结清白名单设置操作],请求参数:operateEntryParam={}", operateEntryParam); log.info("[结清白名单设置操作],请求参数:operateEntryParam={}", operateEntryParam);
return orderService.operateEntry(operateEntryParam); return orderService.setOrCancelSettleUpWhiteList(operateEntryParam);
} }
} }
...@@ -56,7 +56,7 @@ public class OrderRest { ...@@ -56,7 +56,7 @@ public class OrderRest {
* @param orderQuery * @param orderQuery
* @return * @return
*/ */
@GetMapping("/queryEarlySettleUpOrders") @GetMapping("/query_early_settleUp_order")
public JsonResult queryEarlySettleUpOrders(EarlySettleUpOrderQueryParam orderQuery) { public JsonResult queryEarlySettleUpOrders(EarlySettleUpOrderQueryParam orderQuery) {
log.info("[订单提前一次性结清查询],请求参数:orderQuery={}", orderQuery); log.info("[订单提前一次性结清查询],请求参数:orderQuery={}", orderQuery);
return orderService.queryEarlySettleUpOrders(orderQuery); return orderService.queryEarlySettleUpOrders(orderQuery);
...@@ -69,7 +69,7 @@ public class OrderRest { ...@@ -69,7 +69,7 @@ public class OrderRest {
* @param loanId * @param loanId
* @return * @return
*/ */
@GetMapping("/earlySettleUpTrial/{loanId}") @GetMapping("/early_settleUp_trial/{loanId}")
public JsonResult earlySettleUpTrial(@PathVariable Long loanId) { public JsonResult earlySettleUpTrial(@PathVariable Long loanId) {
log.info("[提前一次性结清金额试算],请求参数:loanId={}", loanId); log.info("[提前一次性结清金额试算],请求参数:loanId={}", loanId);
return orderService.earlySettleUpTrial(loanId); return orderService.earlySettleUpTrial(loanId);
...@@ -81,7 +81,7 @@ public class OrderRest { ...@@ -81,7 +81,7 @@ public class OrderRest {
* @param loanId * @param loanId
* @return * @return
*/ */
@GetMapping("/queryOperateLog/{loanId}") @GetMapping("/query_operateLog/{loanId}")
public JsonResult queryOperateLog(@PathVariable Long loanId) { public JsonResult queryOperateLog(@PathVariable Long loanId) {
log.info("[操作日志查询],请求参数:loanId={}", loanId); log.info("[操作日志查询],请求参数:loanId={}", loanId);
return orderService.queryOperateLog(loanId); return orderService.queryOperateLog(loanId);
......
...@@ -10,4 +10,6 @@ public interface IOperateLogService { ...@@ -10,4 +10,6 @@ public interface IOperateLogService {
void saveOperateLog(OperateLogModel logModel); void saveOperateLog(OperateLogModel logModel);
List<OpLog> findLogsByLoanId(Long loanId); List<OpLog> findLogsByLoanId(Long loanId);
Long findLogsCountsByLoanId(Long loanId);
} }
...@@ -42,12 +42,12 @@ public interface IOrderService{ ...@@ -42,12 +42,12 @@ public interface IOrderService{
JsonResult<List<EarlySettleUpOrder>> queryEarlySettleUpOrders(EarlySettleUpOrderQueryParam orderQuery); JsonResult<List<EarlySettleUpOrder>> queryEarlySettleUpOrders(EarlySettleUpOrderQueryParam orderQuery);
/** /**
* 显示or隐藏操作 * 设置/取消提前结清白名单入口
* *
* @param operateEntryParam * @param operateEntryParam
* @return * @return
*/ */
JsonResult<Boolean> operateEntry(OperateEntryParam operateEntryParam); JsonResult<Boolean> setOrCancelSettleUpWhiteList(OperateEntryParam operateEntryParam);
/** /**
* 提前一次性结清金额试算 * 提前一次性结清金额试算
......
...@@ -80,7 +80,7 @@ public interface IXyqbService { ...@@ -80,7 +80,7 @@ public interface IXyqbService {
* @param operateEntryParam * @param operateEntryParam
* @return * @return
*/ */
JsonResult<Boolean> operateEntry(OperateEntryParam operateEntryParam); JsonResult<Boolean> setOrCancelSettleUpWhiteList(OperateEntryParam operateEntryParam);
/** /**
* 提前一次性结清金额试算 * 提前一次性结清金额试算
......
...@@ -37,4 +37,9 @@ public class OperateLogServiceImpl implements IOperateLogService { ...@@ -37,4 +37,9 @@ public class OperateLogServiceImpl implements IOperateLogService {
opLogs.add(JSONObject.parseObject(JSONObject.toJSONString(it), OpLog.class))); opLogs.add(JSONObject.parseObject(JSONObject.toJSONString(it), OpLog.class)));
return opLogs; return opLogs;
} }
@Override
public Long findLogsCountsByLoanId(Long loanId) {
return operateLogRepo.findLogsCountsByLoanId(loanId);
}
} }
...@@ -4,7 +4,6 @@ import cn.quantgroup.customer.constant.Constant; ...@@ -4,7 +4,6 @@ import cn.quantgroup.customer.constant.Constant;
import cn.quantgroup.customer.entity.OpLog; import cn.quantgroup.customer.entity.OpLog;
import cn.quantgroup.customer.enums.ErrorCodeEnum; import cn.quantgroup.customer.enums.ErrorCodeEnum;
import cn.quantgroup.customer.model.kaordermapping.ApplyRequestHistory; import cn.quantgroup.customer.model.kaordermapping.ApplyRequestHistory;
import cn.quantgroup.customer.model.kaordermapping.ChannelConfigurationResult;
import cn.quantgroup.customer.model.kaordermapping.LoanOrderMapping; import cn.quantgroup.customer.model.kaordermapping.LoanOrderMapping;
import cn.quantgroup.customer.model.order.*; import cn.quantgroup.customer.model.order.*;
import cn.quantgroup.customer.model.xyqbuser.UserBasicInfo; import cn.quantgroup.customer.model.xyqbuser.UserBasicInfo;
...@@ -22,7 +21,6 @@ import org.springframework.stereotype.Service; ...@@ -22,7 +21,6 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* @author Wang Xiangwei * @author Wang Xiangwei
...@@ -43,17 +41,6 @@ public class OrderServiceImpl implements IOrderService { ...@@ -43,17 +41,6 @@ public class OrderServiceImpl implements IOrderService {
@Autowired @Autowired
private IUserService userService; private IUserService userService;
private static Map<String, String> earlySettleUpFieldMap = new HashMap<>();
static {
earlySettleUpFieldMap.put("principal","应还本金");
earlySettleUpFieldMap.put("interest","应还利息");
earlySettleUpFieldMap.put("serviceFee","应还担保费");
earlySettleUpFieldMap.put("premium","应还保费");
earlySettleUpFieldMap.put("overDueInterest","应还罚息");
earlySettleUpFieldMap.put("liquidatedDamages","结清违约金");
earlySettleUpFieldMap.put("otherFee","应还其他费用");
earlySettleUpFieldMap.put("totalAmount","应还总额");
}
@Override @Override
public JsonResult<List<FlowNode>> findFlowChart(String applyOrderNo) { public JsonResult<List<FlowNode>> findFlowChart(String applyOrderNo) {
...@@ -160,8 +147,6 @@ public class OrderServiceImpl implements IOrderService { ...@@ -160,8 +147,6 @@ public class OrderServiceImpl implements IOrderService {
@Override @Override
public JsonResult<List<EarlySettleUpOrder>> queryEarlySettleUpOrders(EarlySettleUpOrderQueryParam orderQuery) { public JsonResult<List<EarlySettleUpOrder>> queryEarlySettleUpOrders(EarlySettleUpOrderQueryParam orderQuery) {
String logPre = "OrderServiceImpl.queryEarlySettleUpOrders";
if (!existAtLestOneParam(orderQuery)) { if (!existAtLestOneParam(orderQuery)) {
return JsonResult.buildErrorStateResult("至少输入一个请求参数", null); return JsonResult.buildErrorStateResult("至少输入一个请求参数", null);
} }
...@@ -173,53 +158,32 @@ public class OrderServiceImpl implements IOrderService { ...@@ -173,53 +158,32 @@ public class OrderServiceImpl implements IOrderService {
// 获取用户userId // 获取用户userId
JsonResult<UserBasicInfo> userInfo = this.queryAndCheckUserInfo(orderQuery); JsonResult<UserBasicInfo> userInfo = this.queryAndCheckUserInfo(orderQuery);
if (Objects.isNull(userInfo) || !userInfo.isSuccess()) { if (!userInfo.isSuccess()) {
return JsonResult.buildErrorStateResult("查询不到用户信息", null); return JsonResult.buildErrorStateResult("查询不到用户信息", null);
} }
// 获取订单loanId
JsonResult<LoanOrderMapping> loanOrder = this.queryAndCheckOrderInfo(orderQuery);
if (Objects.isNull(loanOrder) || !loanOrder.isSuccess()) {
return JsonResult.buildErrorStateResult("查询不到订单信息", null);
}
// 请求xyqb // 请求xyqb
UserBasicInfo userBasicInfo = userInfo.getData(); UserBasicInfo userBasicInfo = userInfo.getData();
LoanOrderMapping loanOrderMapping = loanOrder.getData();
orderQuery.setUserId(userBasicInfo.getUserId()); orderQuery.setUserId(userBasicInfo.getUserId());
orderQuery.setLoanId(loanOrderMapping.getLoanId());
JsonResult<List<EarlySettleUpOrder>> xyqbOrderResult = this.xyqbService.findLoanOrder4EarlySettleUp(orderQuery); JsonResult<List<EarlySettleUpOrder>> xyqbOrderResult = this.xyqbService.findLoanOrder4EarlySettleUp(orderQuery);
if (Objects.isNull(xyqbOrderResult) || !xyqbOrderResult.isSuccess()) { if (Objects.isNull(xyqbOrderResult) || !xyqbOrderResult.isSuccess()) {
return JsonResult.buildErrorStateResult("查询订单信息出错", null); return JsonResult.buildErrorStateResult("查询订单信息出错", null);
} }
/**
* 查询渠道配置信息
*/
JsonResult<List<ChannelConfigurationResult>> channelConfigs = this.kaService.getAllChannelConfiguration();
if (Objects.isNull(channelConfigs) || !channelConfigs.isSuccess()) {
return JsonResult.buildErrorStateResult("查询渠道配置出错", null);
}
List<ChannelConfigurationResult> channelConfigLists = channelConfigs.getData();
Map<Long, List<ChannelConfigurationResult>> configurationResultMap = channelConfigLists.stream().collect(Collectors.groupingBy(ChannelConfigurationResult::getRegisteredFrom));
/** /**
* 处理数据转换 * 处理数据转换
*/ */
List<EarlySettleUpOrder> settleUpOrders = xyqbOrderResult.getData(); List<EarlySettleUpOrder> settleUpOrders = xyqbOrderResult.getData();
settleUpOrders.forEach(e -> { settleUpOrders.forEach(e -> {
ChannelConfigurationResult configurationResult = null;
if (configurationResultMap.get(e.getChannelId()).size() != 1 ||
(configurationResultMap.get(e.getChannelId()).size() == 1 && Objects.isNull(configurationResult = configurationResultMap.get(e.getChannelId()).get(0)))) {
return;
}
OrderQueryParam orderQueryParam = new OrderQueryParam();
orderQueryParam.setLoanId(e.getLoanId());
JsonResult<LoanOrderMapping> orderMappingJsonResult = this.kaService.findOrderMapping(orderQueryParam);
if (Objects.isNull(orderMappingJsonResult) || !orderMappingJsonResult.isSuccess()) {
log.error("{} 查询渠道订单表数据为空 loanId={}", logPre, e.getLoanId());
return;
}
LoanOrderMapping loanOrderMapping = orderMappingJsonResult.getData();
e.setChannelName(configurationResult.getChannelName());
e.setChannelOrderNo(loanOrderMapping.getChannelOrderNo()); e.setChannelOrderNo(loanOrderMapping.getChannelOrderNo());
e.setChannelId(configurationResult.getRegisteredFrom());
e.setPhoneNo(userBasicInfo.getPhoneNo()); e.setPhoneNo(userBasicInfo.getPhoneNo());
e.setShowOplog(dealWithShowOplog(e.getLoanId())); e.setShowOplog(dealWithShowOplog(e.getLoanId()));
}); });
...@@ -234,64 +198,82 @@ public class OrderServiceImpl implements IOrderService { ...@@ -234,64 +198,82 @@ public class OrderServiceImpl implements IOrderService {
* @return * @return
*/ */
private Boolean dealWithShowOplog(Long loanId) { private Boolean dealWithShowOplog(Long loanId) {
List<OpLog> list = operateLogService.findLogsByLoanId(loanId); return operateLogService.findLogsCountsByLoanId(loanId) > 0;
return (Objects.nonNull(list) && list.size() > 0);
} }
/** /**
* 查询用户信息 * 查询订单loanId
*
* @param orderQuery
* @return
*/ */
private JsonResult<LoanOrderMapping> queryAndCheckOrderInfo(EarlySettleUpOrderQueryParam orderQuery) {
String logPre = "OrderServiceImpl.queryAndCheckOrderInfo";
boolean isExistOrderParam = existOrderParam(orderQuery);
if (!isExistOrderParam) {
log.error("{} 查询订单信息,订单相关参数为空 orderQuery={}", logPre, orderQuery);
return JsonResult.buildErrorStateResult("查询订单信息,订单参数为空", null);
}
OrderQueryParam orderQueryParam = new OrderQueryParam();
orderQueryParam.setLoanId(orderQuery.getLoanId());
orderQueryParam.setChannelId(orderQuery.getChannelId());
orderQueryParam.setChannelOrderNo(orderQuery.getChannelOrderNo());
JsonResult<LoanOrderMapping> orderMappingJsonResult = this.kaService.findOrderMapping(orderQueryParam);
if (Objects.isNull(orderMappingJsonResult) || !orderMappingJsonResult.isSuccess()) {
log.error("{} 查询订单失败 result={}", logPre, orderMappingJsonResult);
return JsonResult.buildErrorStateResult("请求参数有误,查询不到订单信息", null);
}
return orderMappingJsonResult;
}
/**
* 查询用户userId
*
* @param orderQuery
* @return
*/
private JsonResult<UserBasicInfo> queryAndCheckUserInfo(EarlySettleUpOrderQueryParam orderQuery) { private JsonResult<UserBasicInfo> queryAndCheckUserInfo(EarlySettleUpOrderQueryParam orderQuery) {
String logPre = "OrderServiceImpl.queryAndCheckUserInfo"; String logPre = "OrderServiceImpl.queryAndCheckUserInfo";
// 说明业务参数和用户参数都为空 // 说明业务参数和用户参数都为空
boolean isExistOrderParam = existOrderParam(orderQuery);
boolean isExistUserParam = existUserParam(orderQuery); boolean isExistUserParam = existUserParam(orderQuery);
if (!(isExistOrderParam || isExistUserParam)) { if (!isExistUserParam) {
log.error("{} 根据请求参数查询不到用户信息 orderQuery={}", logPre, orderQuery); log.error("{} 查询用户信息请求参数为空 orderQuery={}", logPre, orderQuery);
return JsonResult.buildErrorStateResult("查询不到用户信息", null); return JsonResult.buildErrorStateResult("查询用户信息,用户参数为空", null);
} }
JsonResult<UserBasicInfo> userInfoByOrder = null;
// 有订单信息存在,根据订单查询用户userId //用户参数查询
if (isExistOrderParam) { UserQueryParam userQueryParam = new UserQueryParam();
OrderQueryParam orderQueryParam = new OrderQueryParam(); userQueryParam.setPhoneNo(orderQuery.getPhoneNo());
orderQueryParam.setLoanId(orderQuery.getLoanId()); userQueryParam.setUserId(orderQuery.getUserId());
orderQueryParam.setChannelId(orderQuery.getChannelId()); JsonResult<UserBasicInfo> userInfoByUserParam = this.userService.findUserInfo(userQueryParam);
orderQueryParam.setChannelOrderNo(orderQuery.getChannelOrderNo()); if (Objects.isNull(userInfoByUserParam) || !userInfoByUserParam.isSuccess()) {
userInfoByOrder = this.userService.findUserInfoByOrderParam(orderQueryParam); log.error("{} 查询用户失败 result={}", logPre, userInfoByUserParam);
if (Objects.isNull(userInfoByOrder) || !userInfoByOrder.isSuccess()) { return JsonResult.buildErrorStateResult("请求参数有误,查询不到用户信息", null);
log.error("{} 查询用户失败 result={}", logPre, userInfoByOrder);
return userInfoByOrder;
}
} }
JsonResult<UserBasicInfo> userInfoByPhone = null; UserBasicInfo userBasicInfo = userInfoByUserParam.getData();
if (isExistUserParam) { if (StringUtils.isNotBlank(orderQuery.getPhoneNo())) {
//用户参数查询 if (!orderQuery.getPhoneNo().equals(userBasicInfo.getPhoneNo())) {
UserQueryParam userQueryParam = new UserQueryParam(); log.error("{} 用户输入手机号和查询结果不一致 orderQuery.getPhoneNo()={}, userBasicInfo={}", logPre, orderQuery.getPhoneNo(), userBasicInfo);
userQueryParam.setPhoneNo(orderQuery.getPhoneNo()); return JsonResult.buildErrorStateResult("请求参数有误,查询不到用户信息", null);
userQueryParam.setUserId(orderQuery.getUserId());
userInfoByPhone = this.userService.findUserInfo(userQueryParam);
if (Objects.isNull(userInfoByPhone) || !userInfoByPhone.isSuccess()) {
log.error("{} 查询用户失败 result={}", logPre, userInfoByPhone);
return userInfoByPhone;
} }
} }
if (isExistOrderParam && isExistUserParam) { if (Objects.nonNull(orderQuery.getUserId())) {
UserBasicInfo userBasicInfoByOrder = userInfoByOrder.getData(); if (!orderQuery.getUserId().equals(userBasicInfo.getUserId())) {
UserBasicInfo userBasicInfoByUser = userInfoByOrder.getData(); log.error("{} 用户输入userId和查询结果不一致 orderQuery.getUserId()={}, userBasicInfo={}", logPre, orderQuery.getUserId(), userBasicInfo);
if (userBasicInfoByOrder.getUserId().equals(userBasicInfoByUser.getUserId())) { return JsonResult.buildErrorStateResult("请求参数有误,查询不到用户信息", null);
return userInfoByOrder;
} else {
return JsonResult.buildErrorStateResult("根据订单信息和用户信息查询的用户不一致", null);
} }
} else if (isExistOrderParam) {
return userInfoByOrder;
} else {
return userInfoByPhone;
} }
return userInfoByUserParam;
} }
/** /**
...@@ -331,13 +313,13 @@ public class OrderServiceImpl implements IOrderService { ...@@ -331,13 +313,13 @@ public class OrderServiceImpl implements IOrderService {
} }
@Override @Override
public JsonResult<Boolean> operateEntry(OperateEntryParam operateEntryParam) { public JsonResult<Boolean> setOrCancelSettleUpWhiteList(OperateEntryParam operateEntryParam) {
return this.xyqbService.operateEntry(operateEntryParam); return this.xyqbService.setOrCancelSettleUpWhiteList(operateEntryParam);
} }
@Override @Override
public JsonResult<List<Map<String, Object>>> earlySettleUpTrial(Long loanId) { public JsonResult<List<Map<String, Object>>> earlySettleUpTrial(Long loanId) {
String logPre = "OrderServiceImpl.queryAndCheckUserInfo"; String logPre = "OrderServiceImpl.earlySettleUpTrial";
JsonResult<EarlySettleUpTrial> jsonResult = this.xyqbService.earlySettleUpTrial(loanId); JsonResult<EarlySettleUpTrial> jsonResult = this.xyqbService.earlySettleUpTrial(loanId);
if (Objects.isNull(jsonResult) || !jsonResult.isSuccess()) { if (Objects.isNull(jsonResult) || !jsonResult.isSuccess()) {
...@@ -360,13 +342,30 @@ public class OrderServiceImpl implements IOrderService { ...@@ -360,13 +342,30 @@ public class OrderServiceImpl implements IOrderService {
JSONObject dataJson = JSONObject.parseObject(JSONObject.toJSONString(data)); JSONObject dataJson = JSONObject.parseObject(JSONObject.toJSONString(data));
Iterator<Map.Entry<String, Object>> iterator = dataJson.entrySet().iterator(); Iterator<Map.Entry<String, Object>> iterator = dataJson.entrySet().iterator();
List<Map<String, Object>> dataList = new ArrayList<>(); List<Map<String, Object>> dataList = new ArrayList<>();
while (iterator.hasNext()) { while (iterator.hasNext()) {
Map.Entry<String, Object> me = iterator.next(); Map.Entry<String, Object> me = iterator.next();
String key = me.getKey(); String key = me.getKey();
Object value = me.getValue(); Object value = me.getValue();
if(Objects.nonNull(value) && new BigDecimal(String.valueOf(value)).compareTo(new BigDecimal(0))>0){ if (Objects.nonNull(value) && new BigDecimal(String.valueOf(value)).compareTo(new BigDecimal(0)) > 0) {
Map<String, Object> fieldDataMap = new HashMap<>(4); Map<String, Object> fieldDataMap = new HashMap<>(4);
fieldDataMap.put("title", earlySettleUpFieldMap.get(key)); if ("principal".equals(key)) {
fieldDataMap.put("title", "应还本金");
} else if ("interest".equals(key)) {
fieldDataMap.put("title", "应还利息");
} else if ("serviceFee".equals(key)) {
fieldDataMap.put("title", "应还担保费");
} else if ("premium".equals(key)) {
fieldDataMap.put("title", "应还保费");
} else if ("overDueInterest".equals(key)) {
fieldDataMap.put("title", "应还罚息");
} else if ("liquidatedDamages".equals(key)) {
fieldDataMap.put("title", "结清违约金");
} else if ("otherFee".equals(key)) {
fieldDataMap.put("title", "应还其他费用");
} else if ("totalAmount".equals(key)) {
fieldDataMap.put("title", "应还总额");
}
fieldDataMap.put("value", Constant.DECIMAL_FORMAT2.format(value)); fieldDataMap.put("value", Constant.DECIMAL_FORMAT2.format(value));
dataList.add(fieldDataMap); dataList.add(fieldDataMap);
} }
......
...@@ -395,8 +395,8 @@ public class XyqbServiceImpl implements IXyqbService { ...@@ -395,8 +395,8 @@ public class XyqbServiceImpl implements IXyqbService {
} }
@Override @Override
public JsonResult<Boolean> operateEntry(OperateEntryParam operateEntryParam) { public JsonResult<Boolean> setOrCancelSettleUpWhiteList(OperateEntryParam operateEntryParam) {
String logPre = "[XyqbServiceImpl.operateEntry] 处理新增或删除白名单操作"; String logPre = "[XyqbServiceImpl.setOrCancelSettleUpWhiteList] 处理新增或删除白名单操作";
String url = xyqbSysUrl + "/ex/operate/config/earlysettle/opt_white_list"; String url = xyqbSysUrl + "/ex/operate/config/earlysettle/opt_white_list";
Map<String, Object> queryParam = new HashMap<>(8); Map<String, Object> queryParam = new HashMap<>(8);
if (Objects.isNull(operateEntryParam.getLoanId()) && if (Objects.isNull(operateEntryParam.getLoanId()) &&
...@@ -415,11 +415,11 @@ public class XyqbServiceImpl implements IXyqbService { ...@@ -415,11 +415,11 @@ public class XyqbServiceImpl implements IXyqbService {
Map<String, String> header = new HashMap<>(2); Map<String, String> header = new HashMap<>(2);
header.put("Accept", "application/json"); header.put("Accept", "application/json");
header.put("Content-Type", "application/x-www-form-urlencoded"); header.put("Content-Type", "application/x-www-form-urlencoded");
String result = null; String result;
try{ try {
result = httpService.post(url, header, queryParam); result = httpService.post(url, header, queryParam);
}catch (Exception e){ } catch (Exception e) {
log.error("{} 系统异常 e:{}",logPre, ExceptionUtils.getStackTrace(e)); log.error("{} 系统异常 e:{}", logPre, ExceptionUtils.getStackTrace(e));
return JsonResult.buildErrorStateResult("[处理失败]", Boolean.FALSE); return JsonResult.buildErrorStateResult("[处理失败]", Boolean.FALSE);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment