| | |
| | | public R delAppUserShop(AppUserShop appUserShop) { |
| | | return R.fail("删除用户门店关系数据失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public void saveAppUserShop(AppUserShop appUserShop) { |
| | | R.fail("保存用户门店关系数据失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/appUserShop/delAppUserShop") |
| | | R delAppUserShop(@RequestBody AppUserShop appUserShop); |
| | | |
| | | |
| | | /** |
| | | * 保存关系数据 |
| | | * @param appUserShop |
| | | */ |
| | | @PostMapping("/saveAppUserShop/delAppUserShop") |
| | | void saveAppUserShop(@RequestBody AppUserShop appUserShop); |
| | | } |
| | |
| | | @ApiModelProperty(value = "基础售价") |
| | | private BigDecimal sellingPrice; |
| | | |
| | | @ApiModelProperty(value = "积分") |
| | | private Integer integral; |
| | | |
| | | @ApiModelProperty(value = "划线价") |
| | | private BigDecimal originalPrice; |
| | | } |
| | |
| | | |
| | | @TableField(exist = false) |
| | | private Double distance; |
| | | |
| | | @TableField(exist = false) |
| | | private Double score; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.feignClient.AppUserShopClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.AppUserShop; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | |
| | | |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | @Resource |
| | | private AppUserShopClient appUserShopClient; |
| | | |
| | | |
| | | |
| | |
| | | SysUser one = userService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUserName, user.getPhonenumber()) |
| | | .eq(SysUser::getDelFlag, "0").eq(SysUser::getStatus, "0").eq(SysUser::getRoleType, 2)); |
| | | if(null == one){ |
| | | AppUser appUser = appUserClient.getAppUserByPhone1(user.getPhonenumber()).getData(); |
| | | if(null == appUser){ |
| | | return error("请先注册小程序账号"); |
| | | } |
| | | user.setCreateBy(SecurityUtils.getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword("a123456")); |
| | | user.setRoleType(sysUser1.getRoleType()); |
| | | user.setObjectId(sysUser1.getObjectId()); |
| | | if(null != appUser){ |
| | | user.setAppUserId(appUser.getId()); |
| | | } |
| | | userService.insertUser(user); |
| | | one = user; |
| | | SysUserRole sysUserRole = new SysUserRole(); |
| | | sysUserRole.setRoleId(user.getRoleId()); |
| | | sysUserRole.setUserId(user.getUserId()); |
| | | userRoleService.insertSysUserRole(sysUserRole); |
| | | //添加小程序店员关系数据 |
| | | if(null != appUser){ |
| | | AppUserShop appUserShop = new AppUserShop(); |
| | | appUserShop.setAppUserId(appUser.getId()); |
| | | appUserShop.setShopId(sysUser1.getObjectId()); |
| | | appUserShopClient.saveAppUserShop(appUserShop); |
| | | appUser.setUserType(2); |
| | | appUserClient.editAppUserById(appUser); |
| | | } |
| | | } |
| | | //添加门店员工关系数据 |
| | | UserShop userShop = new UserShop(); |
| | |
| | | user.setUpdateBy(SecurityUtils.getUsername()); |
| | | user.setUpdateTime(new Date()); |
| | | userService.updateUser(user); |
| | | |
| | | user = userService.getById(user.getUserId()); |
| | | //添加门店员工关系数据 |
| | | if(2 == user.getRoleType()){ |
| | | UserShop one = userShopService.getOne(new LambdaQueryWrapper<UserShop>().eq(UserShop::getUserId, user.getUserId()).eq(UserShop::getShopId, user.getObjectId())); |
| | |
| | | sysUser.setDelFlag("2"); |
| | | userService.updateById(sysUser); |
| | | } |
| | | if(sysUser.getObjectId().equals(objectId) && collect.size() > 1){ |
| | | Integer integer = collect.stream().filter(s -> !s.equals(sysUser.getObjectId())).findFirst().get(); |
| | | sysUser.setObjectId(integer); |
| | | userService.updateById(sysUser); |
| | | } |
| | | userShopService.remove(new LambdaUpdateWrapper<UserShop>().eq(UserShop::getUserId, sysUser.getUserId()).eq(UserShop::getShopId, objectId)); |
| | | } |
| | | return R.ok(); |
| | |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | <if test="forbiddenRemark != null">forbidden_remark = #{forbiddenRemark},</if> |
| | | <if test="roleType != null">role_type = #{roleType},</if> |
| | | <if test="objectId != null">objectId = #{objectId},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where user_id = #{userId} |
| | |
| | | import com.ruoyi.account.util.ObsUploadUtil; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.feignClient.OrderClient; |
| | | import com.ruoyi.order.feignClient.RemoteOrderGoodsClient; |
| | |
| | | @ResponseBody |
| | | @GetMapping("/getNearbyReferrer") |
| | | @ApiOperation(value = "获取附近推荐人列表") |
| | | public TableDataInfo<NearbyReferrerVo> getNearbyReferrer(NearbyReferrer nearbyReferrer) { |
| | | startPage(); |
| | | List<NearbyReferrerVo> list = appUserService.getNearbyReferrer(nearbyReferrer); |
| | | return getDataTable(list); |
| | | public R<PageInfo<NearbyReferrerVo>> getNearbyReferrer(NearbyReferrer nearbyReferrer) { |
| | | return R.ok(appUserService.getNearbyReferrer(nearbyReferrer)); |
| | | } |
| | | |
| | | |
| | |
| | | import com.ruoyi.other.api.domain.PointSetting; |
| | | import com.ruoyi.other.api.feignClient.PointSettingClient; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | |
| | | |
| | | |
| | | @PostMapping("/saveAppUserShare") |
| | | @GetMapping("/saveAppUserShare") |
| | | @ApiOperation(value = "操作分享调用接口", tags = {"小程序-推广中心"}) |
| | | public R saveAppUserShare(){ |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.AppUserShop; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.AppUserShopService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | public class AppUserShopController { |
| | | @Resource |
| | | private AppUserShopService appUserShopService; |
| | | @Resource |
| | | private AppUserService appUserService; |
| | | |
| | | |
| | | |
| | | @PostMapping("/addAppUserShop") |
| | | public R<Void> add(@RequestBody AppUserShop appUserShop) { |
| | |
| | | wrapper.eq(AppUserShop::getShopId, appUserShop.getShopId()); |
| | | } |
| | | appUserShopService.remove(wrapper); |
| | | //删除用户绑定门店数据 |
| | | appUserService.update(new LambdaUpdateWrapper<AppUser>().eq(AppUser::getShopId, appUserShop.getShopId()).set(AppUser::getShopId, null)); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存关系数据 |
| | | * @param appUserShop |
| | | */ |
| | | @PostMapping("/saveAppUserShop") |
| | | public void saveAppUserShop(@RequestBody AppUserShop appUserShop){ |
| | | appUserShopService.save(appUserShop); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | |
| | | */ |
| | | @GetMapping("/getUserPointDetail") |
| | | @ApiOperation("获取变更明细") |
| | | public TableDataInfo<UserPointDetailVO> getUserPointDetail(@ApiParam("指定日期") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate date, |
| | | @ApiParam("变动类型(1=消费积分,2=返佣积分,3=拉新人积分,4=兑换商品 " + |
| | | public R<PageInfo<UserPointDetailVO>> getUserPointDetail(@ApiParam("指定日期") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate date, |
| | | @ApiParam("变动类型(1=消费积分,2=返佣积分,3=拉新人积分,4=兑换商品 " + |
| | | "5 = 门店业绩积分 6 =门店返佣积分7=技师业绩积分8 =转赠积分 9 =做工积分 " + |
| | | "10 =注册积分)") Integer type) { |
| | | "10 =注册积分)") Integer type, Integer pageCurr, Integer pageSize) { |
| | | LocalDateTime startTime = null; |
| | | LocalDateTime endTime = null; |
| | | if (date != null) { |
| | |
| | | endTime = lastDayOfMonth.atTime(LocalTime.MAX); |
| | | } |
| | | |
| | | startPage(); |
| | | List<UserPointDetailVO> list = userPointService.getUserPointDetail(SecurityUtils.getUserId(), startTime, endTime, type); |
| | | return getDataTable(list); |
| | | PageInfo<UserPointDetailVO> userPointDetail = userPointService.getUserPointDetail(SecurityUtils.getUserId(), startTime, endTime, type, pageCurr, pageSize); |
| | | return R.ok(userPointDetail); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.account.vo.NearbyReferrerVo; |
| | | import com.ruoyi.account.vo.UserStatistics; |
| | | import com.ruoyi.account.vo.UserStatisticsDetail; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | * @param cityCode |
| | | * @return |
| | | */ |
| | | List<NearbyReferrerVo> getNearbyReferrer(@Param("cityCode") String cityCode, @Param("nearbyReferrer") NearbyReferrer nearbyReferrer); |
| | | List<NearbyReferrerVo> getNearbyReferrer(PageInfo<NearbyReferrerVo> pageInfo, @Param("cityCode") String cityCode, @Param("nearbyReferrer") NearbyReferrer nearbyReferrer); |
| | | |
| | | IPage<AppUser> getAppuserPage(@Param("page") IPage<AppUser> page, @Param("appUser") AppUser appUser, @Param("shopId") Integer shopId, @Param("userId") Set<Long> userIds); |
| | | IPage<AppUser> getAppuserPage1(@Param("page") IPage<AppUser> page, @Param("appUser") AppUser appUser,@Param("objectId")Integer objectId,@Param("userIds")List<Long> userIds); |
| | |
| | | import com.ruoyi.account.vo.*; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | |
| | | * @param nearbyReferrer |
| | | * @return |
| | | */ |
| | | List<NearbyReferrerVo> getNearbyReferrer(NearbyReferrer nearbyReferrer); |
| | | PageInfo<NearbyReferrerVo> getNearbyReferrer(NearbyReferrer nearbyReferrer); |
| | | |
| | | /** |
| | | * 获取用户的祖籍列表 |
| | |
| | | import com.ruoyi.account.vo.UserPointStatistics; |
| | | import com.ruoyi.account.vo.UserPointVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | UserPointVO getUserPoint(Long userId); |
| | | |
| | | |
| | | List<UserPointDetailVO> getUserPointDetail(Long userId, LocalDateTime startTime, LocalDateTime endTime, Integer type); |
| | | PageInfo<UserPointDetailVO> getUserPointDetail(Long userId, LocalDateTime startTime, LocalDateTime endTime, Integer type, Integer pageCurr, Integer pageSize); |
| | | |
| | | R transferPoint(Integer point, String phone); |
| | | |
| | |
| | | import com.ruoyi.account.vo.*; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.*; |
| | |
| | | weChatUtil.getwxacodeunlimit("pages/login/login", "id=" + appUser.getId(), EnvVersion.TRIAL, filePath + fileName); |
| | | appUser.setQrCode(accessPath + fileName); |
| | | this.updateById(appUser); |
| | | } |
| | | |
| | | } |
| | | LoginVo loginVo = new LoginVo(); |
| | | loginVo.setSkipPage(1); |
| | | loginVo.setFirstTime(null == appUser1); |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<NearbyReferrerVo> getNearbyReferrer(NearbyReferrer nearbyReferrer) { |
| | | public PageInfo<NearbyReferrerVo> getNearbyReferrer(NearbyReferrer nearbyReferrer) { |
| | | //使用地图获取省市区数据 |
| | | String citycode = TencentMapUtil.inverseGeographicalAnalysis(nearbyReferrer.getLongitude(), nearbyReferrer.getLatitude(), false); |
| | | if(StringUtils.isEmpty(citycode)){ |
| | |
| | | } |
| | | if(null != citycode){ |
| | | String cityCode = citycode.substring(0, 4) + "00"; |
| | | List<NearbyReferrerVo> list = this.baseMapper.getNearbyReferrer(cityCode, nearbyReferrer); |
| | | return list; |
| | | PageInfo<NearbyReferrerVo> pageInfo = new PageInfo(nearbyReferrer.getPageCurr(), nearbyReferrer.getPageSize()); |
| | | List<NearbyReferrerVo> list = this.baseMapper.getNearbyReferrer(pageInfo, cityCode, nearbyReferrer); |
| | | return pageInfo.setRecords(list); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | //注册X天后没有升级成黄金会员则自动解绑推广人 |
| | | |
| | | //解绑推广人 |
| | | Set<Long> unbind_promoter = redisTemplate.opsForZSet().range("unbind_promoter", 0, LocalDateTime.now().toEpochSecond(ZoneOffset.UTC)); |
| | | Set<Long> unbind_promoter = redisTemplate.opsForZSet().rangeByScore("unbind_promoter", 0, LocalDateTime.now().toEpochSecond(ZoneOffset.UTC)); |
| | | if(unbind_promoter.size() > 0){ |
| | | List<AppUser> list = this.list(new LambdaQueryWrapper<AppUser>().eq(AppUser::getVipId, 1).eq(AppUser::getDelFlag, 0).isNotNull(AppUser::getInviteUserId) |
| | | .eq(AppUser::getStatus, 1).in(AppUser::getId, unbind_promoter)); |
| | |
| | | } |
| | | } |
| | | //可更换推广人 |
| | | Set<Long> replaceable = redisTemplate.opsForZSet().range("replaceable", 0, LocalDateTime.now().toEpochSecond(ZoneOffset.UTC)); |
| | | Set<Long> replaceable = redisTemplate.opsForZSet().rangeByScore("replaceable", 0, LocalDateTime.now().toEpochSecond(ZoneOffset.UTC)); |
| | | if(replaceable.size() > 0){ |
| | | List<AppUser> list = this.list(new LambdaQueryWrapper<AppUser>().eq(AppUser::getDelFlag, 0).eq(AppUser::getChangePromoter, 0) |
| | | .eq(AppUser::getStatus, 1).in(AppUser::getId, unbind_promoter)); |
| | |
| | | if(null == cacheObject){ |
| | | redisService.setCacheObject("ONLINE_" + userid, 0, 15L, TimeUnit.MINUTES); |
| | | }else{ |
| | | Long duration = (Long) cacheObject; |
| | | Integer duration = (Integer) cacheObject; |
| | | duration += 10; |
| | | //满足一个小时,开始发放积分,计时归0 |
| | | if(60 >= duration){ |
| | |
| | | public void closeOrder() { |
| | | //订单支付数据 |
| | | long second = LocalDateTime.now().toEpochSecond(ZoneOffset.UTC); |
| | | Set<String> orderPayment = redisTemplate.opsForZSet().range("BalanceRecharge", 0, second); |
| | | Set<String> orderPayment = redisTemplate.opsForZSet().rangeByScore("BalanceRecharge", 0, second); |
| | | if(orderPayment.size() > 0){ |
| | | List<BalancePayment> list = balancePaymentService.list(new LambdaQueryWrapper<BalancePayment>().in(BalancePayment::getId, orderPayment)); |
| | | for (BalancePayment order : list) { |
| | |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.QueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.PhoneNumberValidator; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.PointSetting; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<UserPointDetailVO> getUserPointDetail(Long userId, LocalDateTime startTime, LocalDateTime endTime, Integer type) { |
| | | List<UserPoint> userPointList = list(new LambdaQueryWrapper<UserPoint>() |
| | | .between(startTime != null, UserPoint::getCreateTime, startTime, endTime) |
| | | .eq(type != null, UserPoint::getType, type) |
| | | .eq(UserPoint::getAppUserId, userId).orderByDesc(UserPoint::getCreateTime)); |
| | | if (CollectionUtil.isNotEmpty(userPointList)) { |
| | | return userPointList.stream().map(p -> { |
| | | public PageInfo<UserPointDetailVO> getUserPointDetail(Long userId, LocalDateTime startTime, LocalDateTime endTime, Integer type, Integer pageCurr, Integer pageSize) { |
| | | PageInfo<UserPoint> pageInfo = new PageInfo<>(pageCurr, pageSize); |
| | | PageInfo<UserPoint> page = this.page(pageInfo, new QueryWrapper<UserPoint>() |
| | | .between(startTime != null, "create_time", startTime, endTime) |
| | | .eq(type != null, "type", type) |
| | | .eq("app_user_id", userId).orderByDesc("create_time")); |
| | | if (CollectionUtil.isNotEmpty(page.getRecords())) { |
| | | List<UserPointDetailVO> collect = page.getRecords().stream().map(p -> { |
| | | UserPointDetailVO userPointDetailVO = new UserPointDetailVO(); |
| | | userPointDetailVO.setType(p.getType()); |
| | | userPointDetailVO.setVariablePoint(p.getVariablePoint()); |
| | |
| | | userPointDetailVO.setCreateTime(format); |
| | | return userPointDetailVO; |
| | | }).collect(Collectors.toList()); |
| | | PageInfo<UserPointDetailVO> pageInfo1 = new PageInfo<>(pageCurr, pageSize); |
| | | pageInfo1.setRecords(collect); |
| | | pageInfo1.setTotal(page.getTotal()); |
| | | pageInfo1.setCurrent(page.getCurrent()); |
| | | pageInfo1.setSize(page.getSize()); |
| | | return pageInfo1; |
| | | } |
| | | return Collections.emptyList(); |
| | | return null; |
| | | } |
| | | |
| | | |
| | |
| | | orderGoodsVO.setType(goods.getType()); |
| | | orderGoodsVO.setGoodsPic(goods.getHomePagePicture()); |
| | | orderGoodsVO.setSellingPrice(goods.getSellingPrice()); |
| | | orderGoodsVO.setIntegral(goods.getIntegral()); |
| | | orderGoodsVO.setOriginalPrice(goods.getOriginalPrice()); |
| | | goodsList.add(orderGoodsVO); |
| | | } |
| | |
| | | confirmOrderVo.setEarnPoint(earnPoint); |
| | | //支付金额,订单金额-订单优惠 |
| | | confirmOrderVo.setPayMoney(paymentMoney); |
| | | confirmOrderVo.setResidualPoint(appUser.getLavePoint().intValue()); |
| | | confirmOrderVo.setResidualPoint(appUser.getAvailablePoint().intValue()); |
| | | //获取默认收货地址 |
| | | UserAddress userAddress = userAddressClient.getDefaultUserAddress(userid).getData(); |
| | | if(null != userAddress){ |
| | |
| | | if(transferablePoint > 0){ |
| | | tra = transferablePoint - orderPoint; |
| | | appUser.setTransferablePoint(tra >= 0 ? tra : 0); |
| | | }else{ |
| | | appUser.setTransferablePoint(appUser.getTransferablePoint() - orderPoint); |
| | | } |
| | | appUser.setTransferablePoint(appUser.getTransferablePoint() - orderPoint); |
| | | |
| | | //构建积分流水记录 |
| | | UserPoint userPoint = new UserPoint(); |
| | |
| | | public void closeOrder() { |
| | | //订单支付数据 |
| | | long second = LocalDateTime.now().toEpochSecond(ZoneOffset.UTC); |
| | | Set<String> orderPayment = redisTemplate.opsForZSet().range("OrderPayment", 0, second); |
| | | Set<String> orderPayment = redisTemplate.opsForZSet().rangeByScore("OrderPayment", 0, second); |
| | | if(orderPayment.size() > 0){ |
| | | List<Order> list = orderService.list(new LambdaQueryWrapper<Order>().in(Order::getOrderNumber, orderPayment)); |
| | | for (Order order : list) { |
| | |
| | | } |
| | | |
| | | //快递支付 |
| | | Set<String> materialFlowPayment = redisTemplate.opsForZSet().range("MaterialFlowPayment", 0, second); |
| | | Set<String> materialFlowPayment = redisTemplate.opsForZSet().rangeByScore("MaterialFlowPayment", 0, second); |
| | | if(materialFlowPayment.size() > 0){ |
| | | materialFlowPayment.forEach(s->s.substring(1)); |
| | | List<Order> list = orderService.list(new LambdaQueryWrapper<Order>().in(Order::getOrderNumber, materialFlowPayment)); |
| | |
| | | private String code; |
| | | @ApiModelProperty("下单时间") |
| | | private String createTime; |
| | | @ApiModelProperty("售后截止时间") |
| | | private String afterSaleTime; |
| | | @ApiModelProperty("下单用户") |
| | | private String userName; |
| | | @ApiModelProperty("联系电话") |
| | |
| | | private Integer paymentType; |
| | | @ApiModelProperty("订单金额") |
| | | private BigDecimal orderMoney; |
| | | @ApiModelProperty("订单积分") |
| | | private BigDecimal point; |
| | | @ApiModelProperty("订单状态(1待发货2待收货3待使用4已完成5已取消6已退款7售后中8已评价)") |
| | | private Integer status; |
| | | /** |
| | |
| | | id, |
| | | order_number as code, |
| | | DATE_FORMAT(create_time, '%Y-%m-%d %H:%i:%s') as createTime, |
| | | DATE_FORMAT(after_sale_time, '%Y-%m-%d %H:%i:%s') as afterSaleTime, |
| | | app_user_id as appUserId, |
| | | order_type as goodsType, |
| | | pay_method as paymentType, |
| | | total_amount as orderMoney, |
| | | point, |
| | | order_status as status |
| | | from t_order where del_flag = 0 and pay_status = 2 |
| | | <if test="null != item.code and '' != item.code"> |
| | |
| | | @GetMapping("/manage/list") |
| | | public R<Page<Share>> managelist(String name, Integer addType, @RequestParam Integer pageNum, Integer pageSize) { |
| | | //判断当前登陆人是平台还是门店 |
| | | if (tokenService.getLoginUser().getSysUser().getRoleType()==1) { |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = sysUserClient.getSysUser(userid).getData(); |
| | | if (sysUser.getRoleType()==1) { |
| | | Page<Share> page = shareService.lambdaQuery().eq(Share::getAuditStatus, 1).like(name != null, Share::getName, name) |
| | | .eq(Share::getAddType, 1).page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | }else { |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = sysUserClient.getSysUser(userid).getData(); |
| | | Page<Share> page = shareService.lambdaQuery().eq(Share::getAddType,3).eq(Share::getObjectId, sysUser.getObjectId()) |
| | | .like(name != null, Share::getName, name).page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "获取小程序分享数据", tags = {"小程序-分享"}) |
| | | @GetMapping("/auth/getAppletShare") |
| | | public R<Share> getAppletShare(){ |
| | | Share one = shareService.getOne(new LambdaQueryWrapper<Share>().eq(Share::getDelFlag, 0).eq(Share::getAppletShare, 1).eq(Share::getAuditStatus, 1).last(" limit 0, 1")); |
| | | return R.ok(one); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.feignClient.AppUserShopClient; |
| | |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.order.feignClient.OrderClient; |
| | | import com.ruoyi.order.vo.VerifiableShopVo; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.api.domain.GoodsShop; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.domain.ShopScore; |
| | | import com.ruoyi.other.api.domain.*; |
| | | import com.ruoyi.other.mapper.ShopMapper; |
| | | import com.ruoyi.other.service.GoodsService; |
| | | import com.ruoyi.other.service.GoodsShopService; |
| | | import com.ruoyi.other.service.ShopScoreService; |
| | | import com.ruoyi.other.service.ShopService; |
| | | import com.ruoyi.other.service.*; |
| | | import com.ruoyi.other.util.GeodesyUtil; |
| | | import com.ruoyi.other.util.tencentMap.TencentMapUtil; |
| | | import com.ruoyi.other.vo.NearbyShopVO; |
| | |
| | | private GoodsShopService goodsShopService; |
| | | @Resource |
| | | private OrderClient orderClient; |
| | | @Resource |
| | | private TechnicianSubscribeService technicianSubscribeService; |
| | | @Resource |
| | | private TechnicianService technicianService; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | UserShop userShop = new UserShop(); |
| | | userShop.setShopId(shop.getId()); |
| | | List<UserShop> data = userShopClient.getUserShop(userShop).getData(); |
| | | List<Integer> collect = data.stream().map(UserShop::getUserId).collect(Collectors.toList()).stream().map(Long::intValue).collect(Collectors.toList()); |
| | | List<SysUser> sysUserList = sysUserClient.getUserList(collect).getData(); |
| | | //删除门店下的所有员工 |
| | | sysUserClient.delShopUser(shop.getId(), 2); |
| | | //修改小程序用户类型和门店数据 |
| | | for (SysUser sysUser : sysUserList) { |
| | | //通过电话号码查询小程序用户和门店关系数据 |
| | | AppUser appUser = appUserClient.getAppUserByPhone1(sysUser.getUserName()).getData(); |
| | | //需要先判断用户是否没有关联任何门店 |
| | | List<AppUserShop> userShops = appUserShopClient.getAppUserShop(appUser.getId()).getData(); |
| | | if(userShops.size() == 1 && userShops.get(0).getShopId().equals(shop.getId())){ |
| | | appUser.setUserType(1); |
| | | appUserClient.editAppUserById(appUser); |
| | | if(data.size() > 0){ |
| | | List<Integer> collect = data.stream().map(UserShop::getUserId).collect(Collectors.toList()).stream().map(Long::intValue).collect(Collectors.toList()); |
| | | List<SysUser> sysUserList = sysUserClient.getUserList(collect).getData(); |
| | | //删除门店下的所有员工 |
| | | sysUserClient.delShopUser(shop.getId(), 2); |
| | | //修改小程序用户类型和门店数据 |
| | | for (SysUser sysUser : sysUserList) { |
| | | //通过电话号码查询小程序用户和门店关系数据 |
| | | AppUser appUser = appUserClient.getAppUserByPhone1(sysUser.getUserName()).getData(); |
| | | //需要先判断用户是否没有关联任何门店 |
| | | List<AppUserShop> userShops = appUserShopClient.getAppUserShop(appUser.getId()).getData(); |
| | | if(userShops.size() == 1 && userShops.get(0).getShopId().equals(shop.getId())){ |
| | | appUser.setUserType(1); |
| | | appUserClient.editAppUserById(appUser); |
| | | } |
| | | //删除用户门店关系表数据 |
| | | AppUserShop appUserShop = new AppUserShop(); |
| | | appUserShop.setAppUserId(appUser.getId()); |
| | | appUserShop.setShopId(shop.getId()); |
| | | appUserShopClient.delAppUserShop(appUserShop); |
| | | } |
| | | //删除用户门店关系表数据 |
| | | AppUserShop appUserShop = new AppUserShop(); |
| | | appUserShop.setAppUserId(appUser.getId()); |
| | | appUserShop.setShopId(shop.getId()); |
| | | appUserShopClient.delAppUserShop(appUserShop); |
| | | } |
| | | //取消预约的订单 |
| | | List<Technician> list = technicianService.list(new LambdaQueryWrapper<Technician>().eq(Technician::getShopId, shop.getId()).eq(Technician::getDelFlag, 0)); |
| | | if(list.size() > 0){ |
| | | for (Technician technician : list) { |
| | | technician.setDelFlag(1); |
| | | } |
| | | technicianService.updateBatchById(list); |
| | | Set<Integer> collect = list.stream().map(Technician::getId).collect(Collectors.toSet()); |
| | | technicianSubscribeService.update(new LambdaUpdateWrapper<TechnicianSubscribe>().in(TechnicianSubscribe::getTechnicianId, collect).eq(TechnicianSubscribe::getDelFlag, 0) |
| | | .eq(TechnicianSubscribe::getStatus, 0).set(TechnicianSubscribe::getStatus, 2)); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | */ |
| | | @GetMapping("/shopByUser") |
| | | @ApiOperation(value = "查询当前店长所属门店", tags = {"小程序-个人中心"}, notes = "可绑定的门店列表") |
| | | public R<List<Shop>> shopByUser() { |
| | | R<List<AppUserShop>> r = appUserClient.getAppUserShop(SecurityUtils.getUserId()); |
| | | public R<List<Shop>> shopByUser(@RequestParam("longitude") String longitude, @RequestParam("latitude") String latitude) { |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | | AppUser appUser = appUserClient.getAppUserById(userid); |
| | | R<List<AppUserShop>> r = appUserClient.getAppUserShop(userid); |
| | | if (R.isSuccess(r)){ |
| | | List<AppUserShop> appUserShopList = r.getData(); |
| | | if (CollectionUtils.isEmpty(appUserShopList)){ |
| | |
| | | } |
| | | List<Integer> shopIds = appUserShopList.stream().map(AppUserShop::getShopId).collect(Collectors.toList()); |
| | | List<Shop> shopList = shopService.listByIds(shopIds); |
| | | if(null != appUser.getShopId()){ |
| | | Optional<Shop> first = shopList.stream().filter(s -> s.getId().equals(appUser.getShopId())).findFirst(); |
| | | if(first.isPresent()){ |
| | | Shop shop = first.get(); |
| | | for (Shop shop1 : shopList) { |
| | | if(shop1.getId().equals(shop.getId())){ |
| | | shopList.remove(shop1); |
| | | break; |
| | | } |
| | | } |
| | | shopList.add(0, shop); |
| | | } |
| | | } |
| | | for (Shop shop : shopList) { |
| | | Double wgs84 = GeodesyUtil.getDistance(longitude + "," + latitude, shop.getLongitude() + "," + shop.getLatitude()).get("WGS84"); |
| | | shop.setDistance(wgs84); |
| | | List<ShopScore> list = shopScoreService.list(new LambdaQueryWrapper<ShopScore>().eq(ShopScore::getShopId, shop.getId())); |
| | | double v = list.stream().map(ShopScore::getScore).reduce(BigDecimal.ZERO, BigDecimal::add).doubleValue(); |
| | | shop.setScore(v); |
| | | } |
| | | return R.ok(shopList); |
| | | } |
| | | return R.ok(new ArrayList<>()); |
| | |
| | | @ApiOperation(value = "绑定门店", tags = {"小程序-个人中心"}) |
| | | public R<Void> bindShop(@ApiParam("门店id") @RequestParam Integer shopId) { |
| | | AppUser appUser = appUserClient.getAppUserById(SecurityUtils.getUserId()); |
| | | if(null != appUser.getShopId()){ |
| | | return R.fail("不能重复绑定门店"); |
| | | } |
| | | appUser.setShopId(shopId); |
| | | return appUserClient.editAppUserById(appUser); |
| | | } |
| | |
| | | import com.ruoyi.other.service.TechnicianService; |
| | | import com.ruoyi.other.vo.TechnicianDetailVO; |
| | | import com.ruoyi.other.vo.TechnicianVO; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | |
| | | private TechnicianScoreService technicianScoreService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private SysUserClient sysUserClient; |
| | | |
| | | |
| | | |
| | | // @PostMapping("/shop/list") |
| | | // @ApiOperation(value = "获取门店的技师列表", tags = {"小程序-门店详情-技师预约"}) |
| | |
| | | @PostMapping("/manage/addorupdate") |
| | | @ApiOperation(value = "添加编辑", tags = {"门店-技师列表"}) |
| | | public R<Page<Technician>> add(@RequestBody Technician technician) { |
| | | Integer objectId = tokenService.getLoginUser().getSysUser().getObjectId(); |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = sysUserClient.getSysUser(userid).getData(); |
| | | if (technician.getId()==null) { |
| | | technician.setSubscribeStatus(2); |
| | | List<Technician> list = technicianService.lambdaQuery().eq(Technician::getPhone, technician.getPhone()).list(); |
| | | List<Technician> list = technicianService.lambdaQuery().eq(Technician::getPhone, technician.getPhone()).eq(Technician::getShopId, sysUser.getObjectId()).list(); |
| | | if (!list.isEmpty()) { |
| | | return R.fail("当前号码已经添加"); |
| | | } |
| | |
| | | }else { |
| | | Technician byId = technicianService.getById(technician.getId()); |
| | | if (byId.getPhone()!=technician.getPhone()){ |
| | | List<Technician> list = technicianService.lambdaQuery().eq(Technician::getPhone, technician.getPhone()).list(); |
| | | List<Technician> list = technicianService.lambdaQuery().eq(Technician::getPhone, technician.getPhone()).eq(Technician::getShopId, sysUser.getObjectId()).list(); |
| | | if (!list.isEmpty()) { |
| | | return R.fail("当前号码已经添加"); |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | technician.setShopId(objectId); |
| | | technician.setShopId(sysUser.getObjectId()); |
| | | R<AppUser> appUserByPhone1 = appUserClient.getAppUserByPhone1(technician.getPhone()); |
| | | if (appUserByPhone1.getData()!=null){ |
| | | technician.setAppUserId(appUserByPhone1.getData().getId()); |
| | |
| | | |
| | | IPage<Shop> selectShopList(@Param("page") Page<Shop> page,@Param("shop") Shop shop); |
| | | |
| | | List<NearbyShopVO> selectNearbyShopList(@Param("longitude") BigDecimal longitude,@Param("latitude") BigDecimal latitude); |
| | | List<NearbyShopVO> selectNearbyShopList(); |
| | | |
| | | ShopDetailVO selectShopDetail(@Param("shopId") Integer shopId); |
| | | |
| | |
| | | .in(Shop::getDelFlag, 0)); |
| | | goodsVO.setShopList(shopList); |
| | | } |
| | | List<Shop> shopList = goodsVO.getShopList(); |
| | | for (Shop shop : shopList) { |
| | | Double wgs84 = GeodesyUtil.getDistance(longitude + "," + latitude, shop.getLongitude() + "," + shop.getLatitude()).get("WGS84"); |
| | | shop.setDistance(wgs84); |
| | | } |
| | | shopList.sort(new Comparator<Shop>() { |
| | | @Override |
| | | public int compare(Shop o1, Shop o2) { |
| | | return o1.getDistance().compareTo(o2.getDistance()); |
| | | if(StringUtils.isNotEmpty(longitude) && StringUtils.isNotEmpty(latitude)){ |
| | | List<Shop> shopList = goodsVO.getShopList(); |
| | | for (Shop shop : shopList) { |
| | | Double wgs84 = GeodesyUtil.getDistance(longitude + "," + latitude, shop.getLongitude() + "," + shop.getLatitude()).get("WGS84"); |
| | | shop.setDistance(wgs84); |
| | | } |
| | | }); |
| | | goodsVO.setShopList(shopList); |
| | | shopList.sort(new Comparator<Shop>() { |
| | | @Override |
| | | public int compare(Shop o1, Shop o2) { |
| | | return o1.getDistance().compareTo(o2.getDistance()); |
| | | } |
| | | }); |
| | | goodsVO.setShopList(shopList); |
| | | } |
| | | Integer integer = orderClient.getGoodsSaleNum(goods.getId(), 1).getData(); |
| | | goodsVO.setSaleNum(integer); |
| | | return goodsVO; |
| | |
| | | shops = shopMapper.selectList(new LambdaUpdateWrapper<Shop>().eq(Shop::getDelFlag, 0)); |
| | | } |
| | | |
| | | for (Shop shop : shops) { |
| | | Double wgs84 = GeodesyUtil.getDistance(longitude + "," + latitude, shop.getLongitude() + "," + shop.getLatitude()).get("WGS84"); |
| | | shop.setDistance(wgs84); |
| | | } |
| | | shops.sort(new Comparator<Shop>() { |
| | | @Override |
| | | public int compare(Shop o1, Shop o2) { |
| | | return o1.getDistance().compareTo(o2.getDistance()); |
| | | if(StringUtils.isNotEmpty(longitude) && StringUtils.isNotEmpty(latitude)){ |
| | | for (Shop shop : shops) { |
| | | Double wgs84 = GeodesyUtil.getDistance(longitude + "," + latitude, shop.getLongitude() + "," + shop.getLatitude()).get("WGS84"); |
| | | shop.setDistance(wgs84); |
| | | } |
| | | }); |
| | | shops.sort(new Comparator<Shop>() { |
| | | @Override |
| | | public int compare(Shop o1, Shop o2) { |
| | | return o1.getDistance().compareTo(o2.getDistance()); |
| | | } |
| | | }); |
| | | } |
| | | seckillActivityDetailVO.setShopList(shops); |
| | | Integer integer = orderClient.getGoodsSaleNum(goods.getId(), 2).getData(); |
| | | seckillActivityDetailVO.setSaleNum(integer); |
| | |
| | | appUser = appUserClient.getAppUserById(userid); |
| | | } |
| | | |
| | | List<NearbyShopVO> nearbyShopVOS = shopMapper.selectNearbyShopList(longitude, longitude); |
| | | List<NearbyShopVO> nearbyShopVOS = shopMapper.selectNearbyShopList(); |
| | | for (NearbyShopVO nearbyShopVO : nearbyShopVOS) { |
| | | Double wgs84 = GeodesyUtil.getDistance(nearbyShopVO.getLongitude() + "," + nearbyShopVO.getLatitude(), longitude + "," + latitude).get("WGS84"); |
| | | nearbyShopVO.setDistance(wgs84); |
| | | } |
| | | nearbyShopVOS.sort(new Comparator<NearbyShopVO>() { |
| | | @Override |
| | | public int compare(NearbyShopVO o1, NearbyShopVO o2) { |
| | | return o1.getDistance().compareTo(o2.getDistance()); |
| | | } |
| | | }); |
| | | |
| | | if(null != appUser && null != appUser.getShopId()){ |
| | | AppUser finalAppUser = appUser; |
| | | Optional<NearbyShopVO> first = nearbyShopVOS.stream().filter(s -> s.getId().equals(finalAppUser.getShopId().longValue())).findFirst(); |
| | |
| | | vo.setAddress(shop.getAddress()); |
| | | vo.setHomePicture(shop.getHomePicture()); |
| | | Double wgs84 = GeodesyUtil.getDistance(longitude.toString() + "," + latitude.toString(), shop.getLongitude() + "," + shop.getLatitude()).get("WGS84"); |
| | | vo.setDistance(wgs84.toString()); |
| | | vo.setDistance(wgs84); |
| | | nearbyShopVOS.add(0, vo); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.other.mapper.TechnicianSubscribeMapper; |
| | | import com.ruoyi.other.service.TechnicianSubscribeService; |
| | | import com.ruoyi.other.vo.TechnicianSubscribeVO; |
| | | import org.springframework.data.redis.connection.RedisZSetCommands; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public void taskEditStstus() { |
| | | Set<String> technician_subscribe = redisTemplate.opsForZSet().range("technician_subscribe", 0, LocalDateTime.now().toEpochSecond(ZoneOffset.UTC)); |
| | | long second = LocalDateTime.now().toEpochSecond(ZoneOffset.UTC); |
| | | Set<String> technician_subscribe = redisTemplate.opsForZSet().rangeByScore("technician_subscribe", 0, second); |
| | | if(technician_subscribe.size() > 0){ |
| | | List<TechnicianSubscribe> list = this.listByIds(technician_subscribe); |
| | | list.forEach(s->s.setStatus(3)); |
| | |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "距离") |
| | | private String distance; |
| | | private Double distance; |
| | | |
| | | @ApiModelProperty(value = "评分") |
| | | private String score; |
| | | |
| | | private String latitude; |
| | | |
| | | private String longitude; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "纬度") |
| | | private BigDecimal latitude; |
| | | |
| | | @ApiModelProperty(value = "状态(1=正常,2=冻结)") |
| | | private Integer status; |
| | | } |
| | |
| | | home_picture, |
| | | name, |
| | | address, |
| | | ( |
| | | 6371 * acos( |
| | | cos( |
| | | radians(#{latitude})) * cos( |
| | | radians(latitude)) * cos( |
| | | radians(longitude) - radians(#{longitude})) + sin( |
| | | radians(#{latitude})) * sin( |
| | | radians(latitude)) |
| | | )) AS distance |
| | | longitude, |
| | | latitude |
| | | FROM t_shop |
| | | where del_flag = 0 |
| | | and status = 1 |
| | | ORDER BY distance |
| | | where del_flag = 0 and status = 1 |
| | | </select> |
| | | <select id="selectShopDetail" resultType="com.ruoyi.other.vo.ShopDetailVO"> |
| | | SELECT |
| | |
| | | ts.start_time, |
| | | ts.end_time, |
| | | ts.longitude, |
| | | ts.latitude |
| | | ts.latitude, |
| | | ts.status |
| | | FROM |
| | | t_shop ts |
| | | WHERE ts.del_flag = 0 AND ts.`status` = 1 AND ts.id = #{shopId} |
| | |
| | | tts.status |
| | | FROM |
| | | t_technician_subscribe tts |
| | | LEFT JOIN t_technician tt ON tts.technician_id = tt.id AND tt.del_flag = 0 |
| | | LEFT JOIN t_shop ts ON tt.shop_id = ts.id AND ts.del_flag = 0 |
| | | LEFT JOIN t_technician tt ON tts.technician_id = tt.id |
| | | LEFT JOIN t_shop ts ON tt.shop_id = ts.id |
| | | WHERE |
| | | ts.id = #{shopId} |
| | | AND tts.del_flag = 0 |
| | |
| | | tts.app_user_id as appUserId |
| | | FROM |
| | | t_technician_subscribe tts |
| | | LEFT JOIN t_technician tt ON tts.technician_id = tt.id AND tt.del_flag = 0 |
| | | LEFT JOIN t_shop ts ON tt.shop_id = ts.id AND ts.del_flag = 0 |
| | | LEFT JOIN t_technician tt ON tts.technician_id = tt.id |
| | | LEFT JOIN t_shop ts ON tt.shop_id = ts.id |
| | | WHERE |
| | | ts.id = #{shopId} |
| | | AND tts.del_flag = 0 |
| | |
| | | END AS status |
| | | FROM |
| | | t_technician_subscribe tts |
| | | LEFT JOIN t_technician tt ON tts.technician_id = tt.id AND tt.del_flag = 0 |
| | | LEFT JOIN t_shop ts ON tt.shop_id = ts.id AND ts.del_flag = 0 |
| | | LEFT JOIN t_technician tt ON tts.technician_id = tt.id |
| | | LEFT JOIN t_shop ts ON tt.shop_id = ts.id |
| | | WHERE |
| | | tts.app_user_id = #{userId} |
| | | AND tts.del_flag = 0 |