This commit is contained in:
齐天大圣 2024-04-28 09:10:38 +08:00
parent f0d00a61e1
commit bc13cc8d40
10 changed files with 30 additions and 20 deletions

View File

@ -220,7 +220,7 @@ public class LJUserController extends BaseController {
*/ */
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
public ResponseObject remove(@PathVariable Integer id){ public ResponseObject remove(@PathVariable Integer id){
userService.deleteUserById(id); userService.deleteUserBy(id);
return getSuccessResult("操作成功"); return getSuccessResult("操作成功");
} }

View File

@ -114,7 +114,8 @@ public interface LJUserService extends IService<LJUser> {
* 根据id删除会员信息 * 根据id删除会员信息
* @param id * @param id
*/ */
public void deleteUserById(Integer id); public void deleteUserById(Integer id,Integer storeId);
public void deleteUserBy(Integer id);
/** /**
* 增加会员信息 * 增加会员信息

View File

@ -59,5 +59,5 @@ public interface MtInvitationService {
* 根据会员id和店铺id删除用户邀请注册信息 * 根据会员id和店铺id删除用户邀请注册信息
* @param userId * @param userId
*/ */
void deleteByUserIdAndeStoreId(Integer userId); void deleteByUserIdAndeStoreId(Integer userId,Integer storeId);
} }

View File

@ -22,7 +22,7 @@ public interface UserBalanceService extends IService<UserBalance> {
* 根据用户id和店铺id删除会员储值信息 * 根据用户id和店铺id删除会员储值信息
* @param userId * @param userId
*/ */
public void deleteUserBalanceByUserId(Integer userId); public void deleteUserBalanceByUserId(Integer userId,Integer storeId);
/** /**
* 根据用户id修改储值卡金额 * 根据用户id修改储值卡金额

View File

@ -291,15 +291,28 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
* @param id * @param id
*/ */
@Override @Override
public void deleteUserById(Integer id) { public void deleteUserById(Integer id,Integer storeId) {
balanceService.deleteUserBalanceByUserId(id); balanceService.deleteUserBalanceByUserId(id,storeId);
List<UserBalance> userBalances = balanceService.selectUserBalance(id); List<UserBalance> userBalances = balanceService.selectUserBalance(id);
if (userBalances.size()==0){ if (userBalances.size()==0){
baseMapper.deleteById(id); 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<UserBalance> userBalances = balanceService.selectUserBalance(id);
if (userBalances.size()==0){
baseMapper.deleteById(id);
}
invitationService.deleteByUserIdAndeStoreId(id,nowAccountInfo.getStoreId());
} }
@Autowired @Autowired

View File

@ -89,11 +89,10 @@ public class MtInvitationServiceImpl implements MtInvitationService {
} }
@Override @Override
public void deleteByUserIdAndeStoreId(Integer userId) { public void deleteByUserIdAndeStoreId(Integer userId,Integer storeId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("userId",userId); queryWrapper.eq("userId",userId);
queryWrapper.eq("storeId",nowAccountInfo.getStoreId()); queryWrapper.eq("storeId",storeId);
mtInvitationMapper.delete(queryWrapper); mtInvitationMapper.delete(queryWrapper);
} }
} }

View File

@ -46,9 +46,9 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
} }
@Override @Override
public void deleteUserBalanceByUserId(Integer userId) { public void deleteUserBalanceByUserId(Integer userId,Integer storeId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); /*AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();*/
LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId()); LJStore store = storeService.selectStoreByStoreId(storeId);
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("mt_user_id",userId); queryWrapper.eq("mt_user_id",userId);
queryWrapper.eq("chain_store_id",store.getChainStoreId()); queryWrapper.eq("chain_store_id",store.getChainStoreId());

View File

@ -835,7 +835,7 @@ public class MemberServiceImpl extends ServiceImpl<MtUserMapper, MtUser> impleme
if (ObjectUtil.isNotEmpty(user)){ if (ObjectUtil.isNotEmpty(user)){
if (mtUserMobile.getId()!=user.getId()){ if (mtUserMobile.getId()!=user.getId()){
ljUserService.deleteUserById(user.getId()); ljUserService.deleteUserById(user.getId(),Integer.parseInt(storeId));
} }
} }
int i = baseMapper.updateById(mtUserMobile); int i = baseMapper.updateById(mtUserMobile);

View File

@ -49,6 +49,7 @@ public class ShiroConfig {
filterMap.put("/excel/export","anon"); filterMap.put("/excel/export","anon");
//根据地理位置获取最近的店铺信息 //根据地理位置获取最近的店铺信息
filterMap.put("/business/storeInformation/store/recentlyStore","anon"); filterMap.put("/business/storeInformation/store/recentlyStore","anon");
filterMap.put("/business/storeInformation/store/isRecharge","anon");
//会员扫码进入小程序后根据id获取店铺信息 //会员扫码进入小程序后根据id获取店铺信息
filterMap.put("/business/storeInformation/store/queryStoreById","anon"); filterMap.put("/business/storeInformation/store/queryStoreById","anon");
filterMap.put("/backendApi/store/loginVerification","anon"); filterMap.put("/backendApi/store/loginVerification","anon");

View File

@ -251,20 +251,16 @@
this.storeId = uni.getStorageSync("storeId") this.storeId = uni.getStorageSync("storeId")
this.chainStoreId = uni.getStorageSync("chainStoreId") this.chainStoreId = uni.getStorageSync("chainStoreId")
this.staffId = uni.getStorageSync("inviteStaffId") this.staffId = uni.getStorageSync("inviteStaffId")
await this.getUserAuthority(); // await this.getUserAuthority();
// await this.getOilType(); // await this.getOilType();
} else { } else {
if (uni.getStorageSync("storeId")) { if (uni.getStorageSync("storeId")) {
this.storeId = uni.getStorageSync("storeId") this.storeId = uni.getStorageSync("storeId")
} else {
let storeId = "34";
uni.setStorageSync("storeId", storeId)
} }
await this.getUserAuthority();
// await this.getOilType(); // await this.getOilType();
} }
await this.getUserAuthority();
await this.getTheJudgmentIsTheSame(); await this.getTheJudgmentIsTheSame();
} else { } else {
await this.getUserAuthority(); await this.getUserAuthority();