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);
}
} }
...@@ -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