Commit f1f446c03df8d534720a9979314683bb7d52df23

Authored by 房远帅
1 parent e6c96af2

楚江ERP:客户资质-审核、详情查看接口

... ... @@ -2,8 +2,10 @@ package com.lframework.xingyun.sc.controller.customer;
2 2
3 3 import com.lframework.starter.common.utils.StringUtil;
4 4 import com.lframework.starter.web.core.annotations.security.HasPermission;
  5 +import com.lframework.starter.web.core.components.redis.RedisHandler;
5 6 import com.lframework.starter.web.core.controller.DefaultBaseController;
6 7 import com.lframework.starter.web.core.utils.ExcelUtil;
  8 +import com.lframework.starter.web.core.utils.JsonUtil;
7 9 import com.lframework.starter.web.inner.bo.system.user.QuerySysUserBo;
8 10 import com.lframework.starter.web.inner.entity.SysUser;
9 11 import com.lframework.starter.web.inner.service.system.SysUserService;
... ... @@ -65,6 +67,8 @@ public class CustomerCreditController extends DefaultBaseController {
65 67 private CorePersonnelService corePersonnelService;
66 68 @Resource
67 69 private SysUserService sysUserService;
  70 + @Autowired
  71 + private RedisHandler redisHandler;
68 72
69 73 /**
70 74 * 查询列表
... ... @@ -106,6 +110,36 @@ public class CustomerCreditController extends DefaultBaseController {
106 110 }
107 111
108 112 /**
  113 + * 根据ID查询变更审核的数据
  114 + */
  115 + @ApiOperation("根据ID查询")
  116 + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true)
  117 + @HasPermission({"customer-credit-manage:customer-credit-plan:examine"})
  118 + @GetMapping("/getExamineById")
  119 + public InvokeResult<GetCustomerCreditBo> getExamineById(@NotBlank(message = "id不能为空!") String id) {
  120 +
  121 + Object o = redisHandler.get(id);
  122 + CustomerCredit customerCredit = null;
  123 + if (o != null) {
  124 + String jsonString = o.toString();
  125 + // 2. 反序列化为 CustomerCredit 对象
  126 + customerCredit = JsonUtil.parseObject(jsonString, CustomerCredit.class);
  127 + GetCustomerCreditBo result = packCustomerCreditData(customerCredit);
  128 + return InvokeResultBuilder.success(result);
  129 + } else {
  130 + CustomerCredit data = customerCreditService.findById(id);
  131 + if (data == null) {
  132 + throw new DefaultClientException("客户资信表不存在!");
  133 + }
  134 +
  135 + GetCustomerCreditBo result = packCustomerCreditData(data);
  136 +
  137 + return InvokeResultBuilder.success(result);
  138 + }
  139 +
  140 + }
  141 +
  142 + /**
109 143 * 新增
110 144 */
111 145 @ApiOperation("新增")
... ...