| | |
| | | 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); |
| | | if(StringUtils.isNotEmpty(mgtEditShopDto.getRelUserOpenIds())){ |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | //清空归属 |
| | |
| | | handleShopStaff(shop.getShopId(),belongSysUser); |
| | | }*/ |
| | | //商户关联人员 |
| | | String[] openIds = mgtEditShopDto.getRelUserOpenIds().split(",");//开启默认登录账号 |
| | | String[] openIds = null; |
| | | if(StringUtils.isNotEmpty(mgtEditShopDto.getRelUserOpenIds())){ |
| | | 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); |
| | | shopRelUser.setIsDefault((null != openIds && openIds.length > 0 && Arrays.asList(openIds).contains(str)) ? 1 : 0); |
| | | shopRelUserService.save(shopRelUser); |
| | | handleShopStaff(shop.getShopId(),sysUser); |
| | | } |
| | |
| | | shopProportion.setDelFlag(0); |
| | | shopProportion.setShopId(shop.getShopId()); |
| | | shopProportion.setShopType(shop.getShopType()); |
| | | BigDecimal proportionPercent = new BigDecimal("30"); |
| | | String proportionPercentStr = redisService.getCacheObject(SecurityConstant.SHOP_COMMON_PROPORTION); |
| | | BigDecimal proportionPercent = new BigDecimal(proportionPercentStr); |
| | | if(proportionPercent==null){ |
| | | proportionPercent = new BigDecimal("30"); |
| | | if(StringUtils.isNotEmpty(proportionPercentStr)){ |
| | | proportionPercent = new BigDecimal(proportionPercentStr); |
| | | } |
| | | shopProportion.setProportionPercent(proportionPercent); |
| | | shopProportion.setUpdateTime(new Date()); |
| | |
| | | MerHomeShopTotalVo orderVo = remoteOrderService.getMerHomeTotal(merHomeShopTotalVo).getData(); |
| | | merHomeShopTotalVo.setShopId(shopId); |
| | | merHomeShopTotalVo.setShopType(shop.getShopType()); |
| | | merHomeShopTotalVo.setTodayShop(orderVo.getTodayShop()); |
| | | merHomeShopTotalVo.setUnHandleOrder(orderVo.getUnHandleOrder()); |
| | | merHomeShopTotalVo.setTodayShop(null == orderVo ? 0: orderVo.getTodayShop()); |
| | | merHomeShopTotalVo.setUnHandleOrder(null == orderVo ? 0: orderVo.getUnHandleOrder()); |
| | | List<Integer> taskCount = memberTaskService.getMemberIngTotal(shopId); |
| | | merHomeShopTotalVo.setTask(taskCount.size()); |
| | | merHomeShopTotalVo.setShopTurnover(orderVo.getShopTurnover()); |
| | | merHomeShopTotalVo.setCycleSurp(orderVo.getCycleSurp()); |
| | | merHomeShopTotalVo.setExplorationSurp(orderVo.getExplorationSurp()); |
| | | merHomeShopTotalVo.setShopTurnover(null == orderVo ? BigDecimal.ZERO : orderVo.getShopTurnover()); |
| | | merHomeShopTotalVo.setCycleSurp(null == orderVo ? 0: orderVo.getCycleSurp()); |
| | | merHomeShopTotalVo.setExplorationSurp(null == orderVo ? 0: orderVo.getExplorationSurp()); |
| | | merHomeShopTotalVo.setPlatformBirthdayFlag(shop.getPlatformBirthdayFlag()); |
| | | merHomeShopTotalVo.setPlatformCouponFlag(shop.getPlatformCouponFlag()); |
| | | int unHandleReserve = shopAppointableTimeService.count(new LambdaQueryWrapper<TShopAppointableTime>().eq(TShopAppointableTime::getShopId, shopId).eq(TShopAppointableTime::getStatus, 1)); |
| | |
| | | if (shop.getShopType()==2){ |
| | | //经销商转加盟商: 先解绑该经销商下所有加盟商 |
| | | shopMapper.setBelongShopIdNull(shopId); |
| | | } else { |
| | | //该加盟商所属区域下的加盟商 改为该新转换的经销商 |
| | | List<String> areaCodes = Optional.ofNullable(shop.getSignAreaCode()) |
| | | .map(codes -> codes.split(";")) |
| | | .map(Arrays::asList) |
| | | .orElse(Collections.emptyList());//签约区域 |
| | | if (!areaCodes.isEmpty()){ |
| | | // 1. 查询符合条件的加盟商列表 |
| | | List<Long> shopIds = shopMapper.getShopListBySignAreaCodes(areaCodes); |
| | | |
| | | // 2. 批量更新(优化性能,避免循环中单条更新) |
| | | if(null != shopIds && !shopIds.isEmpty()){ |
| | | shopMapper.updateBelongShopIdBatch(shopIds,shop.getShopId()); |
| | | } |
| | | } |
| | | } |
| | | shop.setUpdateUserId(SecurityUtils.getUserId()); |
| | | shopMapper.updateById(shop); |
| | |
| | | .setDelFlag(0)); |
| | | } |
| | | } |
| | | shopFileService.saveBatch(coverUrlList); |
| | | shopFileService.saveBatch(bannerList); |
| | | |
| | | //批量修改门店信息 |
| | | oneClinkSyncing.setShopIdList(shopIdList); |
| | | shopMapper.updateShopByOneClinkSyncing(oneClinkSyncing); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> getRelUserShop(Long userId) { |
| | | List<ShopRelUser> shopRelUserList = shopRelUserService.getByUserId(userId); |
| | | List<Long> shopIds = shopRelUserList.stream().map(ShopRelUser::getShopId).collect(Collectors.toList()); |
| | | if(!shopIds.isEmpty()){ |
| | | List<Shop> shops = shopMapper.selectList(new LambdaQueryWrapper<Shop>() |
| | | .ne(Shop::getShopStatus,-1) |
| | | .in(Shop::getShopId,shopIds)); |
| | | return shops.stream().map(Shop::getShopName).collect(Collectors.toList()); |
| | | } |
| | | return null; |
| | | } |
| | | } |