From d4b1d7260819e6ecb74874b140566487fe811373 Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Wed, 29 Nov 2023 16:56:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/LJUserServiceImpl.java | 21 +++++++++++++++++-- .../business/userManager/vo/LJUserVo.java | 5 +++++ .../service/impl/MemberServiceImpl.java | 10 ++++++++- 3 files changed, 33 insertions(+), 3 deletions(-) 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 00c7a5584..b93f8b58d 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 @@ -5,8 +5,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.fuint.business.storeInformation.entity.LJStore; +import com.fuint.business.storeInformation.service.ILJStoreService; import com.fuint.business.userManager.entity.CertifiedMember; import com.fuint.business.userManager.entity.LJUser; +import com.fuint.business.userManager.entity.MtInvitation; import com.fuint.business.userManager.entity.UserBalance; import com.fuint.business.userManager.mapper.CertifiedMemberMapper; import com.fuint.business.userManager.mapper.LJUserMapper; @@ -145,6 +148,9 @@ public class LJUserServiceImpl extends ServiceImpl impleme balanceService.deleteUserBalanceByUserId(id); } + @Autowired + private ILJStoreService storeService; + /** * 添加会员信息 * @param user @@ -155,7 +161,6 @@ public class LJUserServiceImpl extends ServiceImpl impleme AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); Integer storeId = nowAccountInfo.getStoreId(); LJUser user1 = new LJUser(); - user1.setStoreId(storeId); if (user.getMobile()==null || user.getMobile().equals("")){ return 0; } @@ -196,6 +201,7 @@ public class LJUserServiceImpl extends ServiceImpl impleme user1.setDescription(user.getDescription()); user1.setOfficial(user.getOfficial()); int row = baseMapper.insert(user1); + // 查询添加后的用户id LJUser ljUser = this.selectUserByMobile(user.getMobile()); // 添加用户储值卡信息 @@ -209,6 +215,18 @@ public class LJUserServiceImpl extends ServiceImpl impleme balance.setSecondCard(user.getSecondCard()); balance.setFixingLevel(user.getFixingLevel()); balanceService.insertUserBalance(balance); + Integer chainStoreId = null; +// 根据店铺id查询店铺所对应的连锁店id + LJStore store = storeService.selectStoreByStoreId(storeId); + if (!ObjectUtil.isEmpty(store)){ + chainStoreId = store.getChainStoreId(); + } +// 添加邀请注册信息 + MtInvitation invitation = new MtInvitation(); + invitation.setUserid(ljUser.getId()); + invitation.setStoreId(storeId); + invitation.setStaffid(nowAccountInfo.getStaffId()); + invitation.setChainStoreId(chainStoreId); return row; } @@ -221,7 +239,6 @@ public class LJUserServiceImpl extends ServiceImpl impleme public int updateUser(LJUserVo userVo) { LJUser user = new LJUser(); user.setUserNo(userVo.getUserNo()); - user.setStoreId(userVo.getStoreId()); user.setAvatar(userVo.getAvatar()); user.setName(userVo.getName()); user.setOpenId(userVo.getOpenId()); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/vo/LJUserVo.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/vo/LJUserVo.java index e03c5a948..87979f23d 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/vo/LJUserVo.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/vo/LJUserVo.java @@ -15,6 +15,7 @@ public class LJUserVo extends BaseEntity { * 用户id */ private Integer id; + private Integer balanceId; // 会员号 @ExcelProperty(value = "会员号") @@ -105,4 +106,8 @@ public class LJUserVo extends BaseEntity { * 邀请人id */ private Integer inviterid; + /** + * 连锁店id + */ + private Integer chainStoreId; } 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 8811eeba4..cd8a9249f 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 @@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fuint.business.store.entity.MtStore; import com.fuint.business.store.service.StoreService; +import com.fuint.business.storeInformation.entity.LJStore; +import com.fuint.business.storeInformation.service.ILJStoreService; import com.fuint.business.userManager.entity.MtInvitation; import com.fuint.business.userManager.entity.UserBalance; import com.fuint.business.userManager.mapper.MtInvitationMapper; @@ -36,6 +38,7 @@ import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import org.apache.commons.lang.StringUtils; import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageRequest; @@ -722,6 +725,8 @@ public class MemberServiceImpl extends ServiceImpl impleme @Resource private UserBalanceService userBalanceService; + @Autowired + private ILJStoreService iljStoreService; @Override @@ -822,7 +827,7 @@ public class MemberServiceImpl extends ServiceImpl impleme // 新增会员余额信息 userBalanceService.insertUserBalance(userBalanceAdd); } - + LJStore store = iljStoreService.selectStoreByStoreId(Integer.parseInt(storeId)); // 查询关联表里面是否有信息 MtInvitation mtInvitation1 = mtInvitationMapper.queryByStoreId(Integer.parseInt(storeId), user.getId()); if (ObjectUtil.isEmpty(mtInvitation1)) { @@ -831,6 +836,9 @@ public class MemberServiceImpl extends ServiceImpl impleme mtInvitation.setStoreId(Integer.parseInt(storeId)); mtInvitation.setStaffid(Integer.parseInt(staffId)); mtInvitation.setInviterid(Integer.parseInt(inviterId)); + if (!ObjectUtil.isEmpty(store)){ + mtInvitation.setChainStoreId(store.getChainStoreId()); + } mtInvitationMapper.insert(mtInvitation); } }