| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<Void> add(@RequestBody Shop shop){ |
| | | String phone = shop.getPhone(); |
| | | if (!shopService.cheUserByPhone(phone)) { |
| | | AppUser appUser = appUserClient.getAppUserByPhone1(phone).getData(); |
| | | if (appUser == null){ |
| | | return R.fail("该手机号未注册"); |
| | | } |
| | | AppUser appUser = appUserClient.getAppUserByPhone1(phone).getData(); |
| | | shop.setShopAllPoint(0); |
| | | shop.setLowerLevelSharePoint(0); |
| | | shop.setSharePoint(0); |
| | |
| | | userShop.setRoleId(2L); |
| | | userShopClient.saveUserShop(userShop); |
| | | } |
| | | |
| | | // 更换下级会员绑定门店 |
| | | R<List<AppUser>> lowerShopR = appUserClient.setLowerUserShop(appUser.getId(), shop.getId()); |
| | | if (R.isError(lowerShopR)){ |
| | | throw new RuntimeException("更换下级会员绑定门店失败"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |