切换店铺统计 √

下单选择会员 √
注册会员 √
完善手机号 √
会员流水信息同步 √
This commit is contained in:
Tankaikai 2025-04-10 18:21:08 +08:00
parent c3b47e05c8
commit b25c402e41
8 changed files with 36 additions and 20 deletions

View File

@ -104,11 +104,11 @@ public class ShopInfoController {
Long headId = StpKit.USER.getHeadId();
List<TokenSign> tokenSignList = StpKit.USER.getSession().getTokenSignList();
if (headId != null && CollUtil.isEmpty(tokenSignList)) {
shopId = headId;
shopId = StpKit.USER.getHeadShopId();
} else {
long count = tokenSignList.stream().filter(obj -> tokenValue.equals(obj.getValue())).count();
if (headId != null && count == 0) {
shopId = headId;
shopId = StpKit.USER.getHeadShopId();
}
}
List<ShopBranchSelectDTO> data = shopInfoService.findShopBranch(shopId);

View File

@ -43,7 +43,7 @@ public class ShopUserController {
@GetMapping("/summary")
@SaStaffCheckPermission("yun_xu_guan_li_hui_yuan_xin_xi")
public CzgResult<ShopUserSummaryDTO> summary(Integer isVip) {
return CzgResult.success(shopUserService.getSummary(StpKit.USER.getHeadShopId(), isVip));
return CzgResult.success(shopUserService.getSummary(StpKit.USER.getVipHeadShopId(), isVip));
}
/**
@ -67,7 +67,7 @@ public class ShopUserController {
@GetMapping("/flow")
@SaStaffCheckPermission("yun_xu_guan_li_hui_yuan_xin_xi")
public CzgResult<Page<ShopUserFlowVO>> flow(Integer userId, String bizCode, String startTime, String endTime) {
return CzgResult.success(shopUserFlowService.pageInfo(StpKit.USER.getHeadShopId(), userId, bizCode, startTime, endTime));
return CzgResult.success(shopUserFlowService.pageInfo(StpKit.USER.getVipHeadShopId(), userId, bizCode, startTime, endTime));
}
/**
@ -83,7 +83,7 @@ public class ShopUserController {
@GetMapping("/flow/download")
@SaStaffCheckPermission("yun_xu_guan_li_hui_yuan_xin_xi")
public void flowDownload(Integer userId, String bizCode, String startTime, String endTime, HttpServletResponse response) throws IOException {
shopUserFlowService.flowDownload(StpKit.USER.getHeadShopId(), userId, bizCode, startTime, endTime, response);
shopUserFlowService.flowDownload(StpKit.USER.getVipHeadShopId(), userId, bizCode, startTime, endTime, response);
}
/**
@ -125,7 +125,7 @@ public class ShopUserController {
@SaAdminCheckPermission(value = "shopUser:add", name = "店铺用户添加")
@PostMapping
public CzgResult<Boolean> add(@RequestBody @Validated ShopUserAddDTO shopUserAddDTO) {
return CzgResult.success(shopUserService.add(StpKit.USER.getHeadShopId(), shopUserAddDTO));
return CzgResult.success(shopUserService.add(StpKit.USER.getVipHeadShopId(), shopUserAddDTO));
}
/**
@ -137,7 +137,7 @@ public class ShopUserController {
@SaAdminCheckPermission(value = "shopUser:edit", name = "店铺用户修改")
@PutMapping
public CzgResult<Boolean> edit(@RequestBody @Validated ShopUserEditDTO shopUserEditDTO) {
return CzgResult.success(shopUserService.updateInfo(StpKit.USER.getHeadShopId(), shopUserEditDTO));
return CzgResult.success(shopUserService.updateInfo(StpKit.USER.getVipHeadShopId(), shopUserEditDTO));
}
/**
@ -150,7 +150,7 @@ public class ShopUserController {
@PutMapping("/money")
public CzgResult<Boolean> editMoney(@RequestBody @Validated ShopUserMoneyEditDTO shopUserMoneyEditDTO) {
shopUserMoneyEditDTO.setBizEnum(ShopUserFlowBizEnum.ADMIN_IN);
return CzgResult.success(shopUserService.updateMoney(StpKit.USER.getHeadShopId(), shopUserMoneyEditDTO) > 0L);
return CzgResult.success(shopUserService.updateMoney(StpKit.USER.getVipHeadShopId(), shopUserMoneyEditDTO) > 0L);
}
}

View File

@ -45,7 +45,7 @@ public class UShopUserController {
*/
@GetMapping
public CzgResult<ShopUserDetailDTO> get(Long shopId) {
return CzgResult.success(shopUserService.getInfo(shopId == null ? StpKit.USER.getHeadShopId() : shopId, StpKit.USER.getLoginIdAsLong()));
return CzgResult.success(shopUserService.getInfo(shopId == null ? StpKit.USER.getVipHeadShopId() : shopId, StpKit.USER.getLoginIdAsLong()));
}
/**
@ -65,7 +65,7 @@ public class UShopUserController {
*/
@GetMapping("/code")
public CzgResult<String> code(Long shopId) {
return shopUserService.getCode(StpKit.USER.getLoginIdAsLong(), shopId == null ? StpKit.USER.getHeadShopId() : shopId);
return shopUserService.getCode(StpKit.USER.getLoginIdAsLong(), shopId == null ? StpKit.USER.getVipHeadShopId() : shopId);
}
/**
@ -76,7 +76,7 @@ public class UShopUserController {
@PostMapping
@Debounce("#shopUserAddDTO.phone")
public CzgResult<Boolean> join(@RequestBody @Validated ShopUserAddDTO shopUserAddDTO) {
return CzgResult.success(shopUserService.join(StpKit.USER.getHeadShopId(), StpKit.USER.getLoginIdAsLong(), shopUserAddDTO));
return CzgResult.success(shopUserService.join(StpKit.USER.getVipHeadShopId(), StpKit.USER.getLoginIdAsLong(), shopUserAddDTO));
}

View File

@ -34,7 +34,7 @@ public class UserController {
*/
@PutMapping
public CzgResult<Boolean> update(@RequestBody UserInfoEditDTO userInfoEditDTO) {
return CzgResult.success(userInfoService.updateInfo(StpKit.USER.getHeadShopId(), StpKit.USER.getLoginIdAsLong(), userInfoEditDTO));
return CzgResult.success(userInfoService.updateInfo(StpKit.USER.getVipHeadShopId(), StpKit.USER.getLoginIdAsLong(), userInfoEditDTO));
}
/**

View File

@ -303,7 +303,7 @@ public class ProductController {
public CzgResult<Void> sync() {
long shopId = StpKit.USER.getShopId(0L);
long sysUserId = StpKit.USER.getLoginIdAsLong();
long headShopId = StpKit.USER.getHeadShopId();
long headShopId = StpKit.USER.getVipHeadShopId();
if(shopId == headShopId){
throw new CzgException("不存在主店分店关系,无需同步");
}

View File

@ -61,15 +61,17 @@ public class SaTokenConfigure implements WebMvcConfigurer {
SaRouter.match("/user/**").notMatch("/user/login", "/user/test", "/user/geo/**", "/user/home/**", "/user/home/**", "/user/dict/**", "/user/openId")
.notMatch("/pay/**")
.notMatch("/notify/**")
.notMatch("/order/notify/**")
.notMatch("/user/product/**")
.check(r -> MyStpLogic.CLIENT_LOGIC.checkLogin())
.setHit(true)
// .match("/**")
.notMatch("/user/**")
.notMatch("/pay/**")
.notMatch("/notify/**")
.notMatch("/admin/auth/**")
.notMatch("/admin/shopMsgPush/subscribe/**")
.notMatch("/order/notify/**")
.notMatch("/account/admin/auth/**")
.notMatch("/user/product/**")
.notMatch("/account/admin/shopMsgPush/subscribe/**")
.check(r -> MyStpLogic.ADMIN_LOGIC.checkLogin());
})).addPathPatterns("/**");

View File

@ -202,13 +202,27 @@ public class MyStpLogic {
return shopId == null ? defaultVal : shopId;
}
/**
* 获取店铺会员查询主店id
*
* @return 主店id
*/
public Long getVipHeadShopId() {
Long shopId = getShopId(0L);
Long mainId = DbChain.table("tb_shop_config").select("main_id").where("id = ? and is_enable_vip_sync = ?", shopId, 1).objAs(Long.class);
if (mainId != null) {
return mainId;
}
return shopId;
}
/**
* 获取主店id
* @return 主店id
*/
public Long getHeadShopId() {
Long shopId = getShopId(0L);
Long mainId = DbChain.table("tb_shop_config").select("main_id").where("id = ? and is_enable_vip_sync = ?", shopId, 1).objAs(Long.class);
Long mainId = DbChain.table("tb_shop_config").select("main_id").where("id = ?", shopId).objAs(Long.class);
if (mainId != null) {
return mainId;
}

View File

@ -84,7 +84,7 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
@Override
public Page<ShopUserDTO> getPage(String key, Integer isVip, BigDecimal amount) {
PageHelper.startPage(PageUtil.buildPageHelp());
return PageUtil.convert(new PageInfo<>(mapper.selectPageByKeyAndIsVip(StpKit.USER.getHeadShopId(), isVip, key, amount)));
return PageUtil.convert(new PageInfo<>(mapper.selectPageByKeyAndIsVip(StpKit.USER.getVipHeadShopId(), isVip, key, amount)));
}
@Override
@ -352,7 +352,7 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
@Override
public ShopUser getDetail(Integer id, Integer userId) {
ShopUser shopUser = getOne(new QueryWrapper().eq(ShopUser::getShopId, StpKit.USER.getHeadShopId()).eq(ShopUser::getId, id).eq(ShopUser::getUserId, userId));
ShopUser shopUser = getOne(new QueryWrapper().eq(ShopUser::getShopId, StpKit.USER.getVipHeadShopId()).eq(ShopUser::getId, id).eq(ShopUser::getUserId, userId));
long count = shopActivateCouponRecordService.count(new QueryWrapper().eq(ShopActivateCouponRecord::getShopUserId, shopUser.getId()).eq(ShopActivateCouponRecord::getStatus, 0));
ShopUserDTO shopUserDTO = BeanUtil.copyProperties(shopUser, ShopUserDTO.class);
shopUserDTO.setCouponNum(count);