puzhibing
2025-01-09 5c6b1469792343d30781074c18880259498109b4
修改bug
31个文件已修改
393 ■■■■■ 已修改文件
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserShopClientFallbackFactory.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserShopClient.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/vo/OrderGoodsVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysUserMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserShareController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserShopController.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserPointController.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/mapper/AppUserMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/AppUserService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/UserPointService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/UserPointServiceImpl.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/OrderPageListVo.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/OrderMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShopMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/NearbyShopVO.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/ShopDetailVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserShopClientFallbackFactory.java
@@ -25,6 +25,11 @@
            public R delAppUserShop(AppUserShop appUserShop) {
                return R.fail("删除用户门店关系数据失败:" + cause.getMessage());
            }
            @Override
            public void saveAppUserShop(AppUserShop appUserShop) {
                R.fail("保存用户门店关系数据失败:" + cause.getMessage());
            }
        };
    }
}
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserShopClient.java
@@ -33,4 +33,12 @@
     */
    @PostMapping("/appUserShop/delAppUserShop")
    R delAppUserShop(@RequestBody AppUserShop appUserShop);
    /**
     * 保存关系数据
     * @param appUserShop
     */
    @PostMapping("/saveAppUserShop/delAppUserShop")
    void saveAppUserShop(@RequestBody AppUserShop appUserShop);
}
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/vo/OrderGoodsVO.java
@@ -27,6 +27,9 @@
    @ApiModelProperty(value = "基础售价")
    private BigDecimal sellingPrice;
    @ApiModelProperty(value = "积分")
    private Integer integral;
    @ApiModelProperty(value = "划线价")
    private BigDecimal originalPrice;
}
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java
@@ -216,4 +216,7 @@
    @TableField(exist = false)
    private Double distance;
    @TableField(exist = false)
    private Double score;
}
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java
@@ -3,6 +3,10 @@
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;
@@ -78,6 +82,12 @@
    
    @Autowired
    private ISysMenuService menuService;
    @Resource
    private AppUserClient appUserClient;
    @Resource
    private AppUserShopClient appUserShopClient;
    
    
    
@@ -127,16 +137,32 @@
            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();
@@ -256,7 +282,7 @@
        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()));
@@ -635,6 +661,11 @@
                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();
ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysUserMapper.xml
@@ -244,6 +244,8 @@
             <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}
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
@@ -19,6 +19,7 @@
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;
@@ -183,10 +184,8 @@
    @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));
    }
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserShareController.java
@@ -12,6 +12,7 @@
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;
@@ -46,7 +47,7 @@
    
    
    
    @PostMapping("/saveAppUserShare")
    @GetMapping("/saveAppUserShare")
    @ApiOperation(value = "操作分享调用接口", tags = {"小程序-推广中心"})
    public R saveAppUserShare(){
        Long userid = tokenService.getLoginUserApplet().getUserid();
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserShopController.java
@@ -2,7 +2,9 @@
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.*;
@@ -20,6 +22,10 @@
public class AppUserShopController {
    @Resource
    private AppUserShopService appUserShopService;
    @Resource
    private AppUserService appUserService;
    @PostMapping("/addAppUserShop")
    public R<Void> add(@RequestBody AppUserShop appUserShop) {
@@ -54,7 +60,18 @@
            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);
    }
}
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserPointController.java
@@ -14,6 +14,7 @@
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;
@@ -66,10 +67,10 @@
     */
    @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) {
@@ -84,9 +85,8 @@
            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);
    }
    /**
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/mapper/AppUserMapper.java
@@ -7,6 +7,7 @@
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;
@@ -28,7 +29,7 @@
     * @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);
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/AppUserService.java
@@ -6,6 +6,7 @@
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;
@@ -58,7 +59,7 @@
     * @param nearbyReferrer
     * @return
     */
    List<NearbyReferrerVo> getNearbyReferrer(NearbyReferrer nearbyReferrer);
    PageInfo<NearbyReferrerVo> getNearbyReferrer(NearbyReferrer nearbyReferrer);
    /**
     * 获取用户的祖籍列表
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/UserPointService.java
@@ -10,6 +10,7 @@
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;
@@ -29,7 +30,7 @@
    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);
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java
@@ -20,6 +20,7 @@
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.*;
@@ -466,7 +467,8 @@
            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);
@@ -679,7 +681,7 @@
     * @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)){
@@ -687,8 +689,9 @@
        }
        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;
    }
@@ -750,7 +753,7 @@
        //注册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));
@@ -761,7 +764,7 @@
            }
        }
        //可更换推广人
        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));
@@ -783,7 +786,7 @@
        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){
@@ -958,7 +961,7 @@
    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) {
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/UserPointServiceImpl.java
@@ -2,7 +2,10 @@
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;
@@ -18,6 +21,7 @@
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;
@@ -79,13 +83,14 @@
    }
    @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());
@@ -93,8 +98,14 @@
                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;
    }
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
@@ -136,6 +136,7 @@
            orderGoodsVO.setType(goods.getType());
            orderGoodsVO.setGoodsPic(goods.getHomePagePicture());
            orderGoodsVO.setSellingPrice(goods.getSellingPrice());
            orderGoodsVO.setIntegral(goods.getIntegral());
            orderGoodsVO.setOriginalPrice(goods.getOriginalPrice());
            goodsList.add(orderGoodsVO);
        }
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java
@@ -502,7 +502,7 @@
        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){
@@ -1148,8 +1148,9 @@
            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();
@@ -1408,7 +1409,7 @@
    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) {
@@ -1428,7 +1429,7 @@
        }
        
        //快递支付
        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));
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/OrderPageListVo.java
@@ -19,6 +19,8 @@
    private String code;
    @ApiModelProperty("下单时间")
    private String createTime;
    @ApiModelProperty("售后截止时间")
    private String afterSaleTime;
    @ApiModelProperty("下单用户")
    private String userName;
    @ApiModelProperty("联系电话")
@@ -29,6 +31,8 @@
    private Integer paymentType;
    @ApiModelProperty("订单金额")
    private BigDecimal orderMoney;
    @ApiModelProperty("订单积分")
    private BigDecimal point;
    @ApiModelProperty("订单状态(1待发货2待收货3待使用4已完成5已取消6已退款7售后中8已评价)")
    private Integer status;
    /**
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/OrderMapper.xml
@@ -54,10 +54,12 @@
            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">
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java
@@ -157,13 +157,13 @@
    @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);
@@ -229,8 +229,12 @@
    }
    @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);
    }
    
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
@@ -2,6 +2,7 @@
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;
@@ -13,15 +14,9 @@
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;
@@ -80,6 +75,11 @@
    private GoodsShopService goodsShopService;
    @Resource
    private OrderClient orderClient;
    @Resource
    private TechnicianSubscribeService technicianSubscribeService;
    @Resource
    private TechnicianService technicianService;
@@ -185,25 +185,38 @@
        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();
    }
@@ -383,8 +396,10 @@
     */
    @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)){
@@ -392,6 +407,26 @@
            }
            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<>());
@@ -404,9 +439,6 @@
    @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);
    }
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java
@@ -15,6 +15,8 @@
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;
@@ -41,6 +43,10 @@
    private TechnicianScoreService technicianScoreService;
    @Resource
    private TokenService tokenService;
    @Resource
    private SysUserClient sysUserClient;
//        @PostMapping("/shop/list")
//    @ApiOperation(value = "获取门店的技师列表", tags = {"小程序-门店详情-技师预约"})
@@ -127,10 +133,11 @@
    @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("当前号码已经添加");
            }
@@ -141,7 +148,7 @@
        }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("当前号码已经添加");
                }
@@ -151,7 +158,7 @@
                }
            }
        }
        technician.setShopId(objectId);
        technician.setShopId(sysUser.getObjectId());
        R<AppUser> appUserByPhone1 = appUserClient.getAppUserByPhone1(technician.getPhone());
        if (appUserByPhone1.getData()!=null){
            technician.setAppUserId(appUserByPhone1.getData().getId());
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/ShopMapper.java
@@ -24,7 +24,7 @@
    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);
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java
@@ -173,18 +173,20 @@
                    .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;
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java
@@ -106,16 +106,18 @@
            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);
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java
@@ -70,7 +70,18 @@
            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();
@@ -89,7 +100,7 @@
                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);
            }
        }
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java
@@ -15,6 +15,7 @@
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;
@@ -101,7 +102,8 @@
     */
    @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));
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/NearbyShopVO.java
@@ -20,8 +20,12 @@
    private String address;
    @ApiModelProperty(value = "距离")
    private String distance;
    private Double distance;
    @ApiModelProperty(value = "评分")
    private String score;
    private String latitude;
    private String longitude;
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/ShopDetailVO.java
@@ -68,4 +68,7 @@
    @ApiModelProperty(value = "纬度")
    private BigDecimal latitude;
    @ApiModelProperty(value = "状态(1=正常,2=冻结)")
    private Integer status;
}
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml
@@ -7,19 +7,10 @@
               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
@@ -32,7 +23,8 @@
            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}
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianSubscribeMapper.xml
@@ -16,8 +16,8 @@
            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
@@ -41,8 +41,8 @@
            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
@@ -80,8 +80,8 @@
        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