| | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @TableField(exist = false) |
| | | private Integer isSign; |
| | | |
| | | @ApiModelProperty("绑定门店id列表") |
| | | @TableField(exist = false) |
| | | private Set<Integer> shopIds; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | @TableField("user_address") |
| | | private String userAddress; |
| | | |
| | | @ApiModelProperty(value = "状态(0=待服务,1=已服务,2=已取消)") |
| | | @ApiModelProperty(value = "状态(0=待服务,1=已服务,2=已取消, 3=已到期)") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | @Slf4j |
| | | public class ShopClientFallbackFactory implements FallbackFactory<ShopClient> { |
| | |
| | | public R<List<Shop>> getShopByUserIds(List<Long> userIds) { |
| | | return R.fail("根据用户id集合获取门店数据失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Set<Integer>> getShopIdByName(String shopName) { |
| | | return R.fail("根据门店名称获取门店id失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.factory.ShopClientFallbackFactory; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | |
| | | @PostMapping("/getShopByUserIds") |
| | | public R<List<Shop>> getShopByUserIds(@RequestBody List<Long> userIds); |
| | | |
| | | @GetMapping("/getShopIdByName") |
| | | R<Set<Integer>> getShopIdByName(String shopName); |
| | | } |
| | |
| | | import lombok.extern.log4j.Log4j2; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Set; |
| | |
| | | public void updateStatus() { |
| | | long now = System.currentTimeMillis() / 1000; // 获取当前时间戳(秒) |
| | | Set<String> subscribeIds = redisTemplate.opsForZSet().rangeByScore("delay_queue:subscribe", 0, now); |
| | | if (subscribeIds != null) { |
| | | if (!CollectionUtils.isEmpty(subscribeIds)) { |
| | | subscribeIds.forEach(subscribeId -> { |
| | | technicianClient.updateStatus(2, Long.valueOf(subscribeId)); |
| | | technicianClient.updateStatus(3, Long.valueOf(subscribeId)); |
| | | }); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.UserCancellationLog; |
| | | import com.ruoyi.account.api.model.UserCoupon; |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户列表 |
| | | */ |
| | | @GetMapping("/getAppuserPage") |
| | | @ApiOperation(value = "用户列表", tags = {"后台管理"}) |
| | | public R<IPage<AppUser>> getAppuserPage(@ApiParam("页码") @RequestParam Integer PageNum, |
| | | @ApiParam("每一页数据大小") Integer pageSize, |
| | | AppUser appUser) |
| | | { |
| | | IPage<AppUser> appuserPage = appUserService.getAppuserPage(PageNum, pageSize, appUser); |
| | | return R.ok(appuserPage); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.account.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.vo.NearbyReferrer; |
| | | import com.ruoyi.account.vo.NearbyReferrerVo; |
| | |
| | | * @return |
| | | */ |
| | | List<NearbyReferrerVo> getNearbyReferrer(@Param("cityCode") String cityCode, @Param("nearbyReferrer") NearbyReferrer nearbyReferrer); |
| | | |
| | | IPage<AppUser> getAppuserPage(@Param("page") IPage<AppUser> page, @Param("appUser") AppUser appUser); |
| | | |
| | | |
| | | |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.vo.*; |
| | |
| | | * 在线记录操作,用于赠送积分 |
| | | */ |
| | | void onlineRecord(); |
| | | |
| | | IPage<AppUser> getAppuserPage(Integer pageNum, Integer pageSize, AppUser appUser); |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.model.AppUserShop; |
| | | import com.ruoyi.account.api.model.UserChangeLog; |
| | |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import org.apache.logging.log4j.core.util.UuidUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | |
| | | |
| | | @Resource |
| | | private UserPointService userPointService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private AppUserMapper appUserMapper; |
| | | |
| | | |
| | | /** |
| | | * 小程序一键登录 |
| | | * @param appletLogin |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public IPage<AppUser> getAppuserPage(Integer pageNum, Integer pageSize, AppUser appUser) { |
| | | if (StringUtils.isNotEmpty(appUser.getShopName())){ |
| | | R<Set<Integer>> shopR = shopClient.getShopIdByName(appUser.getShopName()); |
| | | if (R.isSuccess(shopR)){ |
| | | Set<Integer> shopIds = shopR.getData(); |
| | | if (!CollectionUtils.isEmpty(shopIds)){ |
| | | appUser.setShopIds(shopIds); |
| | | } |
| | | } |
| | | } |
| | | return appUserMapper.getAppuserPage(new Page<>(pageNum, pageSize), appUser); |
| | | } |
| | | } |
| | |
| | | </if> |
| | | ) as aa order by aa.distance |
| | | </select> |
| | | |
| | | <select id="getAppuserPage" resultType="com.ruoyi.account.api.model.AppUser"> |
| | | SELECT ta.id, ta.`name`, ta.vip_id, ta.shop_id |
| | | FROM t_app_user ta |
| | | <where> |
| | | ta.del_flag = 0 |
| | | <if test="null != appUser.name and '' != appUser.name"> |
| | | and ta.`name` like CONCAT('%',#{appUser.name},'%') |
| | | </if> |
| | | <if test="null != appUser.phone and '' != appUser.phone"> |
| | | and ta.phone like CONCAT('%',#{appUser.phone},'%') |
| | | </if> |
| | | <if test="null != appUser.vipId"> |
| | | and ta.vip_id = #{appUser.vipId} |
| | | </if> |
| | | <if test="null != appUser.shopIds and appUser.shopIds.size() > 0"> |
| | | and ta.shop_id in |
| | | <foreach collection="appUser.shopIds" item="shopId" open="(" separator="," close=")"> |
| | | #{shopId} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | AppUserShop appUserShop = new AppUserShop(); |
| | | appUserShop.setAppUserId(loginUserApplet.getUserid()); |
| | | appUserShop.setShopId(shop.getId()); |
| | | appUserClient.addAppUserShop(appUserShop); |
| | | R<Void> r = appUserClient.addAppUserShop(appUserShop); |
| | | if (R.isError(r)){ |
| | | throw new RuntimeException("添加失败"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/getShopIdByName") |
| | | R<Set<Integer>> getShopIdByName(@RequestParam String shopName){ |
| | | List<Shop> list = shopService.list(new LambdaQueryWrapper<Shop>() |
| | | .like(Shop::getName, shopName)); |
| | | return R.ok(list.stream().map(Shop::getId).collect(Collectors.toSet())); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | public enum TechnicianStatus { |
| | | UNSUBSCRIBE(0, "待服务"), |
| | | SERVE(1, "已服务"), |
| | | CANCEL(2, "已取消"); |
| | | CANCEL(2, "已取消"), |
| | | EXPIRED(3, "已到期"); |
| | | private final Integer code; |
| | | private final String message; |
| | | |
| | |
| | | t_shop ts |
| | | LEFT JOIN t_goods_shop tgs ON ts.id = tgs.shop_id |
| | | LEFT JOIN t_goods tg ON tg.id = tgs.goods_id |
| | | where ts.id = #{shopId} |
| | | where ts.id = #{shopId} and ts.del_flag = 0 |
| | | <if test="vip != null"> |
| | | and FIND_IN_SET(#{vip}, commodity_authority) > 0 |
| | | </if> |
| | |
| | | t_goods tg |
| | | LEFT JOIN t_goods_category tgc ON tg.goods_category_id = tgc.id |
| | | <where> |
| | | <if test=""> |
| | | tg.del_flag = 0 |
| | | <if test="goods.id != null"> |
| | | <if test="goods.id != null"> |
| | | and tg.id = #{goods.id} |
| | | </if> |
| | |
| | | t_seckill_activity_info tsai |
| | | LEFT JOIN t_goods tg ON tsai.good_id = tg.id |
| | | LEFT JOIN t_goods_seckill tgs ON tgs.seckill_activity_info_id = tsai.id |
| | | WHERE tsai.end_time >= NOW() |
| | | WHERE tsai.end_time >= NOW() AND tsai.del_flag = 0 |
| | | <if test="name != null and name != ''"> |
| | | AND tg.`name` LIKE concat('%',#{goodsName},'%') |
| | | </if> |
| | |
| | | t_seckill_activity_info tsai |
| | | LEFT JOIN t_goods tg ON tsai.good_id = tg.id |
| | | LEFT JOIN t_goods_seckill tgs ON tgs.seckill_activity_info_id = tsai.id |
| | | WHERE tsai.id = #{seckillActivityId} |
| | | WHERE tsai.id = #{seckillActivityId} AND tsai.del_flag = 0 |
| | | </select> |
| | | </mapper> |
| | |
| | | `qijisheng_other`.t_shop ts |
| | | LEFT JOIN `qijisheng_account`.t_app_user tau ON ts.app_user_id = tau.id |
| | | <where> |
| | | ts.del_flag = 0 |
| | | <if test="shop.name != null and shop.name != ''"> |
| | | and ts.name like concat('%',#{shop.name},'%') |
| | | </if> |