| | |
| | | shopFileService.deleteByShopId(shop.getShopId()); |
| | | shopRelTagService.deleteByShopId(shop.getShopId()); |
| | | shopRelUserService.deleteByShopId(shop.getShopId()); |
| | | //默认登录账号开关 开启后原默认账号开关关闭 |
| | | List<Long> openIdList = Arrays.stream(mgtEditShopDto.getRelUserOpenIds().split(",")) |
| | | .map(String::trim) |
| | | .filter(StringUtils::isNotBlank) |
| | | .map(Long::valueOf) |
| | | .collect(Collectors.toList()); |
| | | if ( !openIdList.isEmpty()) { |
| | | shopRelUserService.setDefaultCloseByUserIdList(openIdList); |
| | | } |
| | | |
| | | //清空归属 |
| | | shopStaffService.clearShopStaffRelation(shop.getShopId()); |
| | | if(!shop.getShopName().equals(mgtEditShopDto.getShopName())){ |
| | |
| | | handleShopStaff(shop.getShopId(),belongSysUser); |
| | | }*/ |
| | | //商户关联人员 |
| | | String[] openIds = mgtEditShopDto.getRelUserOpenIds().split(",");//开启默认登录账号 |
| | | if(StringUtils.isNotBlank(relUserIds)){ |
| | | shopStaffService.clearShopStaffRelation(shop.getShopId()); |
| | | String[] relUserIdArray = relUserIds.split(","); |
| | |
| | | shopRelUser.setUserName(sysUser.getNickName()); |
| | | shopRelUser.setUserMobile(sysUser.getPhonenumber()); |
| | | shopRelUser.setUserDeptId(sysUser.getDeptId()); |
| | | shopRelUser.setIsDefault((openIds.length > 0 && Arrays.asList(openIds).contains(str)) ? 1 : 0); |
| | | shopRelUserService.save(shopRelUser); |
| | | handleShopStaff(shop.getShopId(),sysUser); |
| | | } |
| | |
| | | if(shopRelUserList!=null&&!shopRelUserList.isEmpty()){ |
| | | StringJoiner shopUserJs = new StringJoiner(","); |
| | | StringJoiner shopUserNameJs = new StringJoiner(","); |
| | | StringJoiner relUserOpenIds = new StringJoiner(","); |
| | | for(ShopRelUser shopRelUser : shopRelUserList){ |
| | | shopUserJs.add(shopRelUser.getUserId().toString()); |
| | | shopUserNameJs.add(shopRelUser.getUserName()); |
| | | if (shopRelUser.getIsDefault()==1){ |
| | | relUserOpenIds.add(shopRelUser.getUserId().toString()); |
| | | } |
| | | } |
| | | mgtShopInfoVo.setRelUserIds(shopUserJs.toString()); |
| | | mgtShopInfoVo.setRelUsers(shopUserNameJs.toString()); |
| | | mgtShopInfoVo.setRelUserOpenIds(relUserOpenIds.toString()); |
| | | } |
| | | //商户图片 |
| | | List<ShopFile> shopFileList = shopFileService.listShopFileByShopId(shopId); |