|
|
@ -20,6 +20,8 @@ package com.epmet.controller; |
|
|
|
import com.epmet.commons.tools.annotation.LoginUser; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.redis.RedisKeys; |
|
|
|
import com.epmet.commons.tools.redis.RedisUtils; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.ExcelUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
@ -53,6 +55,8 @@ import java.util.Set; |
|
|
|
@RestController |
|
|
|
@RequestMapping("customeragency") |
|
|
|
public class CustomerAgencyController { |
|
|
|
@Autowired |
|
|
|
private RedisUtils redisUtils; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private CustomerAgencyService customerAgencyService; |
|
|
@ -365,8 +369,18 @@ public class CustomerAgencyController { |
|
|
|
* @Date 2021/9/8 15:20 |
|
|
|
*/ |
|
|
|
@PostMapping("agencygridtree") |
|
|
|
public Result<AgencyTreeResultDTO> getOrgTreeData(@LoginUser TokenDto tokenDTO) { |
|
|
|
return new Result<AgencyTreeResultDTO>().ok(customerAgencyService.getOrgTreeData(tokenDTO.getUserId())); |
|
|
|
public Result<AgencyTreeResultDTO> getOrgTreeData(/*@LoginUser */TokenDto tokenDTO) { |
|
|
|
tokenDTO.setUserId("dffe71e021a61b900f9025f4f07f6955"); |
|
|
|
String orgTreeCacheKey = RedisKeys.getOrgTreeCacheKey(tokenDTO.getUserId()); |
|
|
|
Object o = redisUtils.get(orgTreeCacheKey); |
|
|
|
AgencyTreeResultDTO result = null; |
|
|
|
if (o == null){ |
|
|
|
result = customerAgencyService.getOrgTreeData(tokenDTO.getUserId()); |
|
|
|
redisUtils.set(orgTreeCacheKey,result,RedisUtils.MINUTE_THIRTY_EXPIRE); |
|
|
|
}else { |
|
|
|
result = (AgencyTreeResultDTO) o; |
|
|
|
} |
|
|
|
return new Result<AgencyTreeResultDTO>().ok(result); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|