Showing
1 changed file
with
34 additions
and
0 deletions
xingyun-sc/src/main/java/com/lframework/xingyun/sc/controller/customer/CustomerCreditController.java
| @@ -2,8 +2,10 @@ package com.lframework.xingyun.sc.controller.customer; | @@ -2,8 +2,10 @@ package com.lframework.xingyun.sc.controller.customer; | ||
| 2 | 2 | ||
| 3 | import com.lframework.starter.common.utils.StringUtil; | 3 | import com.lframework.starter.common.utils.StringUtil; |
| 4 | import com.lframework.starter.web.core.annotations.security.HasPermission; | 4 | import com.lframework.starter.web.core.annotations.security.HasPermission; |
| 5 | +import com.lframework.starter.web.core.components.redis.RedisHandler; | ||
| 5 | import com.lframework.starter.web.core.controller.DefaultBaseController; | 6 | import com.lframework.starter.web.core.controller.DefaultBaseController; |
| 6 | import com.lframework.starter.web.core.utils.ExcelUtil; | 7 | import com.lframework.starter.web.core.utils.ExcelUtil; |
| 8 | +import com.lframework.starter.web.core.utils.JsonUtil; | ||
| 7 | import com.lframework.starter.web.inner.bo.system.user.QuerySysUserBo; | 9 | import com.lframework.starter.web.inner.bo.system.user.QuerySysUserBo; |
| 8 | import com.lframework.starter.web.inner.entity.SysUser; | 10 | import com.lframework.starter.web.inner.entity.SysUser; |
| 9 | import com.lframework.starter.web.inner.service.system.SysUserService; | 11 | import com.lframework.starter.web.inner.service.system.SysUserService; |
| @@ -65,6 +67,8 @@ public class CustomerCreditController extends DefaultBaseController { | @@ -65,6 +67,8 @@ public class CustomerCreditController extends DefaultBaseController { | ||
| 65 | private CorePersonnelService corePersonnelService; | 67 | private CorePersonnelService corePersonnelService; |
| 66 | @Resource | 68 | @Resource |
| 67 | private SysUserService sysUserService; | 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,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 | @ApiOperation("新增") | 145 | @ApiOperation("新增") |