多店铺需求

This commit is contained in:
Tankaikai 2025-04-09 10:09:36 +08:00
parent cf7edfe5da
commit fb5f44a20d
1 changed files with 10 additions and 1 deletions

View File

@ -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);
}