Commit e0c8aec6 authored by 杨钧's avatar 杨钧

code_review修改

parent 9f68ff79
......@@ -85,9 +85,9 @@ public class OperateLogAspect {
if (jsonObject.containsKey("opState")) {
Integer opStateFlag = jsonObject.getInteger("opState");
if(opStateFlag == 1){
opState = "设置有效";
opState = "添加白名单";
}else{
opState = "设置无效";
opState = "移除白名单";
}
}
......@@ -109,7 +109,11 @@ public class OperateLogAspect {
moduleName = module;
}
moduleName = moduleName.concat(opState);
// 针对特殊情形,需要取不同操作
if(StringUtils.isNotBlank(opState)){
moduleName = opState;
}
log.info("{} 处理结果:{}", logPre, String.valueOf(result));
OpUser opUser = UserThreadLocal.get();
......
......@@ -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.LocalDateConverter;
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.http.MediaType;
......
......@@ -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)
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 {
private IOrderService orderService;
/**
* 提前一次性结清订单白名单配置
* 添加或移除白名单
*
* @param operateEntryParam
* @return
*/
@PostMapping("/setOrCancelEarlySettleUpWhiteLists")
@OperateLog(moduleName = "提前一次性结清白名单操作")
public JsonResult setOrCancelEarlySettleUpEntry(OperateEntryParam operateEntryParam) {
@PostMapping("/set_or_cancel_settleUp_white_list")
@OperateLog(moduleName = "添加或移除白名单")
public JsonResult setOrCancelSettleUpWhiteList(OperateEntryParam operateEntryParam) {
log.info("[结清白名单设置操作],请求参数:operateEntryParam={}", operateEntryParam);
return orderService.operateEntry(operateEntryParam);
return orderService.setOrCancelSettleUpWhiteList(operateEntryParam);
}
}
......@@ -56,7 +56,7 @@ public class OrderRest {
* @param orderQuery
* @return
*/
@GetMapping("/queryEarlySettleUpOrders")
@GetMapping("/query_early_settleUp_order")
public JsonResult queryEarlySettleUpOrders(EarlySettleUpOrderQueryParam orderQuery) {
log.info("[订单提前一次性结清查询],请求参数:orderQuery={}", orderQuery);
return orderService.queryEarlySettleUpOrders(orderQuery);
......@@ -69,7 +69,7 @@ public class OrderRest {
* @param loanId
* @return
*/
@GetMapping("/earlySettleUpTrial/{loanId}")
@GetMapping("/early_settleUp_trial/{loanId}")
public JsonResult earlySettleUpTrial(@PathVariable Long loanId) {
log.info("[提前一次性结清金额试算],请求参数:loanId={}", loanId);
return orderService.earlySettleUpTrial(loanId);
......@@ -81,7 +81,7 @@ public class OrderRest {
* @param loanId
* @return
*/
@GetMapping("/queryOperateLog/{loanId}")
@GetMapping("/query_operateLog/{loanId}")
public JsonResult queryOperateLog(@PathVariable Long loanId) {
log.info("[操作日志查询],请求参数:loanId={}", loanId);
return orderService.queryOperateLog(loanId);
......
......@@ -10,4 +10,6 @@ public interface IOperateLogService {
void saveOperateLog(OperateLogModel logModel);
List<OpLog> findLogsByLoanId(Long loanId);
Long findLogsCountsByLoanId(Long loanId);
}
......@@ -42,12 +42,12 @@ public interface IOrderService{
JsonResult<List<EarlySettleUpOrder>> queryEarlySettleUpOrders(EarlySettleUpOrderQueryParam orderQuery);
/**
* 显示or隐藏操作
* 设置/取消提前结清白名单入口
*
* @param operateEntryParam
* @return
*/
JsonResult<Boolean> operateEntry(OperateEntryParam operateEntryParam);
JsonResult<Boolean> setOrCancelSettleUpWhiteList(OperateEntryParam operateEntryParam);
/**
* 提前一次性结清金额试算
......
......@@ -80,7 +80,7 @@ public interface IXyqbService {
* @param operateEntryParam
* @return
*/
JsonResult<Boolean> operateEntry(OperateEntryParam operateEntryParam);
JsonResult<Boolean> setOrCancelSettleUpWhiteList(OperateEntryParam operateEntryParam);
/**
* 提前一次性结清金额试算
......
......@@ -37,4 +37,9 @@ public class OperateLogServiceImpl implements IOperateLogService {
opLogs.add(JSONObject.parseObject(JSONObject.toJSONString(it), OpLog.class)));
return opLogs;
}
@Override
public Long findLogsCountsByLoanId(Long loanId) {
return operateLogRepo.findLogsCountsByLoanId(loanId);
}
}
......@@ -395,8 +395,8 @@ public class XyqbServiceImpl implements IXyqbService {
}
@Override
public JsonResult<Boolean> operateEntry(OperateEntryParam operateEntryParam) {
String logPre = "[XyqbServiceImpl.operateEntry] 处理新增或删除白名单操作";
public JsonResult<Boolean> setOrCancelSettleUpWhiteList(OperateEntryParam operateEntryParam) {
String logPre = "[XyqbServiceImpl.setOrCancelSettleUpWhiteList] 处理新增或删除白名单操作";
String url = xyqbSysUrl + "/ex/operate/config/earlysettle/opt_white_list";
Map<String, Object> queryParam = new HashMap<>(8);
if (Objects.isNull(operateEntryParam.getLoanId()) &&
......@@ -415,11 +415,11 @@ public class XyqbServiceImpl implements IXyqbService {
Map<String, String> header = new HashMap<>(2);
header.put("Accept", "application/json");
header.put("Content-Type", "application/x-www-form-urlencoded");
String result = null;
try{
String result;
try {
result = httpService.post(url, header, queryParam);
}catch (Exception e){
log.error("{} 系统异常 e:{}",logPre, ExceptionUtils.getStackTrace(e));
} catch (Exception e) {
log.error("{} 系统异常 e:{}", logPre, ExceptionUtils.getStackTrace(e));
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