From bc13cc8d40398a9200e334607e36c0cd556a3f59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BD=90=E5=A4=A9=E5=A4=A7=E5=9C=A3?= <17615834396@163.com> Date: Sun, 28 Apr 2024 09:10:38 +0800 Subject: [PATCH] bug --- .../controller/LJUserController.java | 2 +- .../userManager/service/LJUserService.java | 3 ++- .../service/MtInvitationService.java | 2 +- .../service/UserBalanceService.java | 2 +- .../service/impl/LJUserServiceImpl.java | 19 ++++++++++++++++--- .../service/impl/MtInvitationServiceImpl.java | 5 ++--- .../service/impl/UserBalanceServiceImpl.java | 6 +++--- .../service/impl/MemberServiceImpl.java | 2 +- .../fuint/common/shiroConfig/ShiroConfig.java | 1 + gasStation-uni/pages/index/index.vue | 8 ++------ 10 files changed, 30 insertions(+), 20 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java index 007112f7f..d048583fe 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/LJUserController.java @@ -220,7 +220,7 @@ public class LJUserController extends BaseController { */ @DeleteMapping("/{id}") public ResponseObject remove(@PathVariable Integer id){ - userService.deleteUserById(id); + userService.deleteUserBy(id); return getSuccessResult("操作成功"); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java index 9fbd055fe..87a7dc385 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/LJUserService.java @@ -114,7 +114,8 @@ public interface LJUserService extends IService { * 根据id删除会员信息 * @param id */ - public void deleteUserById(Integer id); + public void deleteUserById(Integer id,Integer storeId); + public void deleteUserBy(Integer id); /** * 增加会员信息 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/MtInvitationService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/MtInvitationService.java index 4687edfd6..218c9ba3f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/MtInvitationService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/MtInvitationService.java @@ -59,5 +59,5 @@ public interface MtInvitationService { * 根据会员id和店铺id删除用户邀请注册信息 * @param userId */ - void deleteByUserIdAndeStoreId(Integer userId); + void deleteByUserIdAndeStoreId(Integer userId,Integer storeId); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/UserBalanceService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/UserBalanceService.java index 8a6f7c998..8052041e8 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/UserBalanceService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/UserBalanceService.java @@ -22,7 +22,7 @@ public interface UserBalanceService extends IService { * 根据用户id和店铺id删除会员储值信息 * @param userId */ - public void deleteUserBalanceByUserId(Integer userId); + public void deleteUserBalanceByUserId(Integer userId,Integer storeId); /** * 根据用户id修改储值卡金额 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java index aa80d6120..8fa662989 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/LJUserServiceImpl.java @@ -291,15 +291,28 @@ public class LJUserServiceImpl extends ServiceImpl impleme * @param id */ @Override - public void deleteUserById(Integer id) { - balanceService.deleteUserBalanceByUserId(id); + public void deleteUserById(Integer id,Integer storeId) { + balanceService.deleteUserBalanceByUserId(id,storeId); List userBalances = balanceService.selectUserBalance(id); if (userBalances.size()==0){ baseMapper.deleteById(id); } - invitationService.deleteByUserIdAndeStoreId(id); + invitationService.deleteByUserIdAndeStoreId(id,storeId); + } + + @Override + public void deleteUserBy(Integer id) { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + balanceService.deleteUserBalanceByUserId(id,nowAccountInfo.getStoreId()); + + List userBalances = balanceService.selectUserBalance(id); + if (userBalances.size()==0){ + baseMapper.deleteById(id); + } + + invitationService.deleteByUserIdAndeStoreId(id,nowAccountInfo.getStoreId()); } @Autowired diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/MtInvitationServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/MtInvitationServiceImpl.java index 7b21b430a..2f3c99a49 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/MtInvitationServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/MtInvitationServiceImpl.java @@ -89,11 +89,10 @@ public class MtInvitationServiceImpl implements MtInvitationService { } @Override - public void deleteByUserIdAndeStoreId(Integer userId) { - AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + public void deleteByUserIdAndeStoreId(Integer userId,Integer storeId) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("userId",userId); - queryWrapper.eq("storeId",nowAccountInfo.getStoreId()); + queryWrapper.eq("storeId",storeId); mtInvitationMapper.delete(queryWrapper); } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/UserBalanceServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/UserBalanceServiceImpl.java index 090dc3c89..76b2b10e4 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/UserBalanceServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/UserBalanceServiceImpl.java @@ -46,9 +46,9 @@ public class UserBalanceServiceImpl extends ServiceImpl(); queryWrapper.eq("mt_user_id",userId); queryWrapper.eq("chain_store_id",store.getChainStoreId()); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/MemberServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/MemberServiceImpl.java index fb294b474..4247a30e5 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/MemberServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/MemberServiceImpl.java @@ -835,7 +835,7 @@ public class MemberServiceImpl extends ServiceImpl impleme if (ObjectUtil.isNotEmpty(user)){ if (mtUserMobile.getId()!=user.getId()){ - ljUserService.deleteUserById(user.getId()); + ljUserService.deleteUserById(user.getId(),Integer.parseInt(storeId)); } } int i = baseMapper.updateById(mtUserMobile); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/shiroConfig/ShiroConfig.java b/fuintBackend/fuint-application/src/main/java/com/fuint/common/shiroConfig/ShiroConfig.java index aa5d80c9c..37a2701a2 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/common/shiroConfig/ShiroConfig.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/common/shiroConfig/ShiroConfig.java @@ -49,6 +49,7 @@ public class ShiroConfig { filterMap.put("/excel/export","anon"); //根据地理位置获取最近的店铺信息 filterMap.put("/business/storeInformation/store/recentlyStore","anon"); + filterMap.put("/business/storeInformation/store/isRecharge","anon"); //会员扫码进入小程序后根据id获取店铺信息 filterMap.put("/business/storeInformation/store/queryStoreById","anon"); filterMap.put("/backendApi/store/loginVerification","anon"); diff --git a/gasStation-uni/pages/index/index.vue b/gasStation-uni/pages/index/index.vue index 1b2786a52..16ae4ef3a 100644 --- a/gasStation-uni/pages/index/index.vue +++ b/gasStation-uni/pages/index/index.vue @@ -251,20 +251,16 @@ this.storeId = uni.getStorageSync("storeId") this.chainStoreId = uni.getStorageSync("chainStoreId") this.staffId = uni.getStorageSync("inviteStaffId") - await this.getUserAuthority(); + // await this.getUserAuthority(); // await this.getOilType(); } else { if (uni.getStorageSync("storeId")) { this.storeId = uni.getStorageSync("storeId") - } else { - let storeId = "34"; - - uni.setStorageSync("storeId", storeId) } - await this.getUserAuthority(); // await this.getOilType(); } + await this.getUserAuthority(); await this.getTheJudgmentIsTheSame(); } else { await this.getUserAuthority();