Commit 20e8a407 authored by 杨钧's avatar 杨钧

增加操作记录状态

parent 8e39fa7f
package cn.quantgroup.customer.aop; package cn.quantgroup.customer.aop;
import cn.quantgroup.customer.config.container.UserThreadLocal; import cn.quantgroup.customer.config.container.UserThreadLocal;
import cn.quantgroup.customer.constant.Constant;
import cn.quantgroup.customer.entity.OpUser; import cn.quantgroup.customer.entity.OpUser;
import cn.quantgroup.customer.entity.OperateLogModel; import cn.quantgroup.customer.entity.OperateLogModel;
import cn.quantgroup.customer.service.IOperateLogService; import cn.quantgroup.customer.service.IOperateLogService;
...@@ -115,6 +116,11 @@ public class OperateLogAspect { ...@@ -115,6 +116,11 @@ public class OperateLogAspect {
} }
log.info("{} 处理结果:{}", logPre, String.valueOf(result)); log.info("{} 处理结果:{}", logPre, String.valueOf(result));
JSONObject resultJson = JSONObject.parseObject(result.toString());
int status = 0;
if(resultJson.containsKey("code") && Constant.SUCCESS_CODE.equals(resultJson.getString("code"))){
status = 1;
}
OpUser opUser = UserThreadLocal.get(); OpUser opUser = UserThreadLocal.get();
OperateLogModel model = OperateLogModel.builder() OperateLogModel model = OperateLogModel.builder()
...@@ -128,6 +134,7 @@ public class OperateLogAspect { ...@@ -128,6 +134,7 @@ public class OperateLogAspect {
.loanId(loanId) .loanId(loanId)
.applyNo(applyNo) .applyNo(applyNo)
.remark(remark) .remark(remark)
.status(status)
.build(); .build();
operateLogService.saveOperateLog(model); operateLogService.saveOperateLog(model);
......
...@@ -55,6 +55,9 @@ public class OperateLogModel { ...@@ -55,6 +55,9 @@ public class OperateLogModel {
@Column(name = "remark") @Column(name = "remark")
private String remark; private String remark;
@Column(name = "status")
private Integer status;
public OperateLogModel() { public OperateLogModel() {
} }
......
...@@ -8,7 +8,7 @@ import java.util.List; ...@@ -8,7 +8,7 @@ import java.util.List;
public interface OperateLogRepo extends JpaRepository<OperateLogModel, Long> { 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 and status = 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) @Query(value = "select count(1) from operate_log where loan_id =?1", nativeQuery = true)
......
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