多店铺需求
This commit is contained in:
parent
cf7edfe5da
commit
fb5f44a20d
|
|
@ -100,9 +100,18 @@ public class ShopInfoController {
|
|||
@GetMapping("branchList")
|
||||
public CzgResult<List<ShopBranchSelectDTO>> findShopBranch() {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
String tokenValue = StpKit.USER.getTokenInfo().getTokenValue();
|
||||
Long headId = StpKit.USER.getHeadId();
|
||||
List<TokenSign> tokenSignList = StpKit.USER.getSession().getTokenSignList();
|
||||
List<ShopBranchSelectDTO> data = shopInfoService.findShopBranch((headId != null && CollUtil.isEmpty(tokenSignList)) ? headId : shopId);
|
||||
if (headId != null && CollUtil.isEmpty(tokenSignList)) {
|
||||
shopId = headId;
|
||||
} else {
|
||||
long count = tokenSignList.stream().filter(obj -> tokenValue.equals(obj.getValue())).count();
|
||||
if (headId != null && count == 0) {
|
||||
shopId = headId;
|
||||
}
|
||||
}
|
||||
List<ShopBranchSelectDTO> data = shopInfoService.findShopBranch(shopId);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue