Merge remote-tracking branch 'origin/master'
# Conflicts:
# ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java
5 文件已重命名
59个文件已修改
1个文件已删除
4个文件已添加
| | |
| | | log.error("获取用户祖籍列表失败:{}", cause.getMessage()); |
| | | throw new RuntimeException("获取用户祖籍列表失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<AppUser> getSuperiorLeader(Long id) { |
| | | return R.fail("获取直帮上级用户失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Long> getVipCount(Long userId, Integer vipId) { |
| | | log.error("获取直推会员数失败:{}", cause.getMessage()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<UserAddress> getUserAddressById(Integer id) { |
| | | public R<UserAddress> getUserAddressById(Long id) { |
| | | return R.fail("根据id获取用户地址信息失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | |
| | | @GetMapping("/appletLogin/getUserAncestorList") |
| | | R<List<AppUser>> getUserAncestorList(@RequestParam("id") Long id); |
| | | |
| | | @GetMapping("/appletLogin/getSuperiorLeader") |
| | | R<AppUser> getSuperiorLeader(@RequestParam("id") Long id); |
| | | |
| | | |
| | | |
| | | @PostMapping("/app-user/getVipCount") |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/user-address/getUserAddressById") |
| | | R<UserAddress> getUserAddressById(@RequestParam("id") Integer id); |
| | | R<UserAddress> getUserAddressById(@RequestParam("id") Long id); |
| | | } |
| | |
| | | @TableId("id") |
| | | private Long id; |
| | | |
| | | @TableField(exist = false) |
| | | private String idStr; |
| | | |
| | | @TableField(exist = false) |
| | | private String uid; |
| | | |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("app_user_id") |
| | | private Long appUserId; |
| | |
| | | @TableField("point") |
| | | private Integer point; |
| | | |
| | | @ApiModelProperty(value = "1wx2积分") |
| | | @ApiModelProperty(value = "1微信,2账户余额,3积分") |
| | | @TableField("pay_method") |
| | | private Integer payMethod; |
| | | |
| | |
| | | @TableField("express_amount") |
| | | private BigDecimal expressAmount; |
| | | |
| | | @ApiModelProperty(value = "1微信,2账户余额") |
| | | @TableField("express_pay_method") |
| | | private Integer expressPayMethod; |
| | | |
| | | @ApiModelProperty(value = "第三方快递信息") |
| | | @TableField("express_json") |
| | | private String expressJson; |
| | |
| | | @TableField("superior_type") |
| | | private Integer superiorType; |
| | | |
| | | @ApiModelProperty(value = "获取分佣金额上级类型(1=直推上级,2=直帮上级)") |
| | | @TableField("superior_price_type") |
| | | private Integer superiorPriceType; |
| | | |
| | | @ApiModelProperty(value = "核销门店可获得服务费") |
| | | @TableField("servuce_shop_charges") |
| | | private BigDecimal servuceShopCharges; |
| | |
| | | |
| | | @TableId("id") |
| | | private Long id; |
| | | @TableField(exist = false) |
| | | private String idStr; |
| | | |
| | | @ApiModelProperty(value = "订单id") |
| | | @TableField("order_id") |
| | |
| | | @ApiModelProperty(value = "订单id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "订单状态") |
| | | private Integer orderStatus; |
| | | |
| | | @ApiModelProperty(value = "订单商品") |
| | | private List<OrderGoodsVO> goodsList; |
| | | |
| | |
| | | @ApiModelProperty(value = "实际支付价格") |
| | | private BigDecimal paymentAmount; |
| | | |
| | | @ApiModelProperty(value = "配送方式(1=自提,2=快递)") |
| | | private Integer distributionMode; |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String shopName; |
| | | |
| | | @ApiModelProperty(value = "门店地址") |
| | | private String shopAddress; |
| | | |
| | | @ApiModelProperty(value = "经度") |
| | | private String longitude; |
| | | |
| | | @ApiModelProperty(value = "纬度") |
| | | private String latitude; |
| | | |
| | | } |
| | |
| | | @TableField("superior_type") |
| | | private Integer superiorType; |
| | | |
| | | @ApiModelProperty(value = "获取分佣金额上级类型(1=直推上级,2=直帮上级)") |
| | | @TableField("superior_price_type") |
| | | private Integer superiorPriceType; |
| | | |
| | | @ApiModelProperty(value = "核销门店可获得服务费") |
| | | @TableField("servuce_shop_charges") |
| | | private BigDecimal servuceShopCharges; |
| | |
| | | @TableField("vip_info") |
| | | private String vipInfo; |
| | | |
| | | @ApiModelProperty(value = "1级会员用 注册 天后 未成为黄金会员自动解绑推广人") |
| | | @ApiModelProperty(value = "1级会员专用 自动解绑推广人天数: 达到设置天数未成为黄金会员自动解绑推广人") |
| | | @TableField("vip_cancel_day") |
| | | private Integer vipCancelDay; |
| | | |
| | | @ApiModelProperty(value = "1级会员用 注册 天后 未在商城下单,可更换推广人") |
| | | @ApiModelProperty(value = "1级会员专用 可更换绑定人天数:用户在达到设置的天数未下单商品,可以更换绑定人") |
| | | @TableField("vip_change_day") |
| | | private Integer vipChangeDay; |
| | | |
| | | @ApiModelProperty(value = "钱包提现权限1开0关") |
| | | @ApiModelProperty(value = "钱包提现权限:1开0关") |
| | | @TableField("vip_withdrawal_role") |
| | | private Integer vipWithdrawalRole; |
| | | |
| | |
| | | @TableField("vip_gift_role") |
| | | private Integer vipGiftRole; |
| | | |
| | | @ApiModelProperty(value = "消费达到积分 后升级") |
| | | @ApiModelProperty(value = "达成会员等级所需消费积分数量") |
| | | @TableField("vip_level_up_shop") |
| | | private BigDecimal vipLevelUpShop; |
| | | private Integer vipLevelUpShop; |
| | | |
| | | @ApiModelProperty(value = "普通会员:达到消费积分后升级开关 1开0关") |
| | | @ApiModelProperty(value = "通过消费积分达成会员等级的开关 1开0关") |
| | | @TableField("vip_level_up_shop_role") |
| | | private Integer vipLevelUpShopRole; |
| | | |
| | | @ApiModelProperty(value = "返佣达到积分 后升级") |
| | | @ApiModelProperty(value = "达成会员等级所需的返佣积分数量") |
| | | @TableField("vip_level_up_share") |
| | | private BigDecimal vipLevelUpShare; |
| | | private Integer vipLevelUpShare; |
| | | |
| | | @ApiModelProperty(value = "普通会员:返佣积分后升级开关 1开0关") |
| | | @ApiModelProperty(value = "通过返佣积分达成会员等级的开关 1开0关") |
| | | @TableField("vip_level_up_share_role") |
| | | private Integer vipLevelUpShareRole; |
| | | |
| | | @ApiModelProperty(value = "创业者:消费并且返佣升级 1开0关") |
| | | @TableField("vip_agent_level_up_role") |
| | | private Integer vipAgentLevelUpRole; |
| | | |
| | | @ApiModelProperty(value = "普通会员:直推用户数 达到后升级") |
| | | @ApiModelProperty(value = "达成会员等级所需的直推人数(包括钻石和代理)") |
| | | @TableField("vip_direct_num") |
| | | private Integer vipDirectNum; |
| | | |
| | | @ApiModelProperty(value = "普通会员:团队人数达到后升级") |
| | | @ApiModelProperty(value = "达成会员等级所需的团队数量") |
| | | @TableField("vip_team_num") |
| | | private Integer vipTeamNum; |
| | | |
| | | @ApiModelProperty(value = "普通会员:推广人数升级开关 1开0关") |
| | | @ApiModelProperty(value = "通过直推用户或团队数量的方式达成会员等级的开关 1开0关") |
| | | @TableField("vip_level_up_num_role") |
| | | private Integer vipLevelUpNumRole; |
| | | |
| | | @ApiModelProperty(value = "创业者:直推钻石会员") |
| | | |
| | | |
| | | @ApiModelProperty(value = "达成会员等级所需准代理数(达成总代和合伙人用到)") |
| | | @TableField("vip_direct_vip_num") |
| | | private Integer vipDirectVipNum; |
| | | |
| | | @ApiModelProperty(value = "创业者:直推钻石会员开关 1开0关") |
| | | @TableField("vip_direct_vip_role") |
| | | private Integer vipDirectVipRole; |
| | | @ApiModelProperty(value = "达成会员等级所需总代数量(达成合伙人用到)") |
| | | @TableField("vip_team_vip_num") |
| | | private Integer vipTeamVipNum; |
| | | |
| | | @ApiModelProperty(value = "保级:消费x天") |
| | | @ApiModelProperty(value = "达成会员等级所需开店数量") |
| | | @TableField("vip_open_shop_num") |
| | | private Integer vipOpenShopNum; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "消费积分保级周期(天)") |
| | | @TableField("keep_buy_day") |
| | | private Integer keepBuyDay; |
| | | |
| | | @ApiModelProperty(value = "保级:消费x分") |
| | | @ApiModelProperty(value = "消费积分保级的积分阈值(分))") |
| | | @TableField("keep_buy_point") |
| | | private BigDecimal keepBuyPoint; |
| | | private Integer keepBuyPoint; |
| | | |
| | | @ApiModelProperty(value = "保级:返佣x天") |
| | | @ApiModelProperty(value = "返佣积分保的周期(天)") |
| | | @TableField("keep_share_day") |
| | | private Integer keepShareDay; |
| | | |
| | | @ApiModelProperty(value = "保级:返佣x分") |
| | | @ApiModelProperty(value = "返佣积分保级的积分阈值(分)") |
| | | @TableField("keep_share_point") |
| | | private BigDecimal keepSharePoint; |
| | | private Integer keepSharePoint; |
| | | |
| | | @ApiModelProperty(value = "保级:门店x天") |
| | | @ApiModelProperty(value = "门店业绩积分保级的周期(天)") |
| | | @TableField("keep_shop_day") |
| | | private Integer keepShopDay; |
| | | |
| | | @ApiModelProperty(value = "保级:门店x分") |
| | | @ApiModelProperty(value = "门店业绩积分保级的积分阈值(分)") |
| | | @TableField("keep_shop_point") |
| | | private BigDecimal keepShopPoint; |
| | | private Integer keepShopPoint; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.other.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.VipGood; |
| | | import com.ruoyi.other.api.feignClient.VipGoodClient; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class VipGoodClientFallbackFactory implements FallbackFactory<VipGoodClient> { |
| | | @Override |
| | | public VipGoodClient create(Throwable cause) { |
| | | return new VipGoodClient() { |
| | | @GetMapping("/vip-good/getVipGoodsByVipId") |
| | | @Override |
| | | public R<List<VipGood>> getVipGoodsByVipId(Integer vipId) { |
| | | return R.fail("根据会员id获取会员购买商品失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | * @author zhibing.pu |
| | | * @Date 2024/11/28 10:53 |
| | | */ |
| | | @FeignClient(contextId = "GoodsBargainPriceClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = GoodsBargainPriceClientFallbackFactory.class) |
| | | @FeignClient(contextId = "GoodsBargainPriceClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = GoodsBargainPriceClientFallbackFactory.class) |
| | | public interface GoodsBargainPriceClient { |
| | | |
| | | |
| | |
| | | * @author zhibing.pu |
| | | * @Date 2024/11/29 10:55 |
| | | */ |
| | | @FeignClient(contextId = "OrderActivityInfoClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = OrderActivityInfoClientFallbackFactory.class) |
| | | @FeignClient(contextId = "OrderActivityInfoClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = OrderActivityInfoClientFallbackFactory.class) |
| | | public interface OrderActivityInfoClient { |
| | | |
| | | |
| | |
| | | * 后台订单服务 |
| | | * @author ruoyi |
| | | */ |
| | | @FeignClient(contextId = "OrderClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = OrderFallbackFactory.class) |
| | | @FeignClient(contextId = "OrderClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = OrderFallbackFactory.class) |
| | | public interface OrderClient { |
| | | @PostMapping(value = "/management/give/vip") |
| | | public R<List<Long>> getOrderIdsByTechId(@RequestParam("id") Integer id); |
| | |
| | | * @author zhibing.pu |
| | | * @Date 2024/11/28 10:38 |
| | | */ |
| | | @FeignClient(contextId = "SeckillActivityInfoClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = SeckillActivityInfoClientFallbackFactory.class) |
| | | @FeignClient(contextId = "SeckillActivityInfoClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = SeckillActivityInfoClientFallbackFactory.class) |
| | | public interface SeckillActivityInfoClient { |
| | | |
| | | |
| | |
| | | * @author zhibing.pu |
| | | * @Date 2024/11/29 10:28 |
| | | */ |
| | | @FeignClient(contextId = "ShopClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = ShopClientFallbackFactory.class) |
| | | @FeignClient(contextId = "ShopClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = ShopClientFallbackFactory.class) |
| | | public interface ShopClient { |
| | | |
| | | |
| | |
| | | * @author zhibing.pu |
| | | * @Date 2024/11/29 15:58 |
| | | */ |
| | | @FeignClient(contextId = "SystemConfigClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = SystemConfigClientFallbackFactory.class) |
| | | @FeignClient(contextId = "SystemConfigClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = SystemConfigClientFallbackFactory.class) |
| | | public interface SystemConfigClient { |
| | | |
| | | |
| | |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | @FeignClient(contextId = "TechnicianClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = TechnicianClientFallbackFactory.class) |
| | | @FeignClient(contextId = "TechnicianClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = TechnicianClientFallbackFactory.class) |
| | | public interface TechnicianClient { |
| | | |
| | | @PostMapping("/technician/shop/detail") |
New file |
| | |
| | | package com.ruoyi.other.api.feignClient; |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.VipGood; |
| | | import com.ruoyi.other.api.factory.VipGoodClientFallbackFactory; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | @FeignClient(contextId = "VipGoodClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = VipGoodClientFallbackFactory.class) |
| | | public interface VipGoodClient { |
| | | |
| | | @GetMapping("/vip-good/getVipGoodsByVipId") |
| | | public R<List<VipGood>> getVipGoodsByVipId(@RequestParam("subscribeId") Integer vipId); |
| | | } |
| | |
| | | com.ruoyi.other.api.factory.StoreFallbackFactory |
| | | com.ruoyi.other.api.factory.CouponClientFallbackFactory |
| | | com.ruoyi.other.api.factory.TechnicianClientFallbackFactory |
| | | com.ruoyi.other.api.factory.PointSettingClientFallbackFactory |
| | | com.ruoyi.other.api.factory.VipGoodClientFallbackFactory |
| | |
| | | </description> |
| | | |
| | | <dependencies> |
| | | |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-modules-order</artifactId> |
| | | <version>3.6.2</version> |
| | | </dependency> |
| | | |
| | | <!-- SpringCloud Alibaba Nacos --> |
| | | <dependency> |
| | |
| | | package com.ruoyi.job.task; |
| | | |
| | | import com.ruoyi.order.service.CommissionService; |
| | | import lombok.extern.log4j.Log4j2; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | public class AfterSalesTask { |
| | | @Resource |
| | | private RedisTemplate<String, String> redisTemplate; |
| | | @Resource |
| | | private CommissionService commissionService; |
| | | |
| | | /** |
| | | * 计算佣金(设置每分钟执行一次) |
| | |
| | | // 从延迟队列中获取需要处理的订单 |
| | | Set<String> orderIds = redisTemplate.opsForZSet().rangeByScore("delay_queue:commission", 0, now); |
| | | if (orderIds != null && !orderIds.isEmpty()) { |
| | | commissionService.calculationCommission(orderIds); |
| | | // 处理完后移除已处理的订单 |
| | | redisTemplate.opsForZSet().removeRangeByScore("delay_queue:commission", 0, now); |
| | | } |
| | |
| | | <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-seata</artifactId> |
| | | </dependency> |
| | | <!--<dependency>--> |
| | | <!--<groupId>com.alibaba.cloud</groupId>--> |
| | | <!--<artifactId>spring-cloud-starter-alibaba-seata</artifactId>--> |
| | | <!--</dependency>--> |
| | | |
| | | <!-- SpringBoot Actuator --> |
| | | <dependency> |
| | |
| | | @ResponseBody |
| | | @GetMapping("/change") |
| | | @ApiOperation(value = "推广中心", tags = {"小程序-推广中心"}) |
| | | public R<AppUser> change(@ApiParam("换绑用户id") Long userId){ |
| | | public R<AppUser> change(@ApiParam("换绑用户手机号") String phone){ |
| | | Long userId1 = tokenService.getLoginUserApplet().getUserid(); |
| | | AppUser byId = appUserService.getById(userId1); |
| | | //获取绑定门店 |
| | | AppUser user = appUserService.getById(userId1); |
| | | user.setInviteUserId(userId); |
| | | appUserService.updateById(user); |
| | | AppUser user = appUserService.lambdaQuery().eq(AppUser::getPhone,phone).one(); |
| | | if (user==null){ |
| | | return R.fail("当前手机号未注册"); |
| | | } |
| | | byId.setInviteUserId(user.getId()); |
| | | appUserService.updateById(byId); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户的直帮上级用户 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/getSuperiorLeader") |
| | | @ApiOperation(value = "获取用户的直帮上级用户") |
| | | public R<AppUser> getSuperiorLeader(@RequestParam("id") Long id) { |
| | | AppUser superiorLeader = appUserService.getSuperiorLeader(id); |
| | | return R.ok(superiorLeader); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @ApiOperation(value = "添加", tags = {"小程序-个人中心首页-我的地址"}) |
| | | public R add(@RequestBody UserAddress userAddress){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserid(); |
| | | |
| | | if (userAddress.getIsDefault()==1){ |
| | | List<UserAddress> list = userAddressService.lambdaQuery().eq(UserAddress::getAppUserId, userId).list(); |
| | | for (UserAddress userAddress1 : list) { |
| | | userAddress1.setIsDefault(0); |
| | | } |
| | | userAddressService.updateBatchById(list); |
| | | } |
| | | |
| | | userAddress.setAppUserId(userId); |
| | | userAddressService.save(userAddress); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "列表", tags = {"小程序-个人中心首页-我的地址"}) |
| | | public R list(){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserid(); |
| | | List<UserAddress> list = userAddressService.lambdaQuery().eq(UserAddress::getAppUserId, userId).orderByDesc(UserAddress::getIsDefault).list(); |
| | | for (UserAddress userAddress : list) { |
| | | userAddress.setIdStr(userAddress.getId().toString()); |
| | | userAddress.setUid(userAddress.getId().toString()); |
| | | } |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/edit") |
| | | @ApiOperation(value = "编辑", tags = {"小程序-个人中心首页-我的地址"}) |
| | | public R edit(@RequestBody UserAddress userAddress){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserid(); |
| | | if (userAddress.getIsDefault()==1){ |
| | | List<UserAddress> list = userAddressService.lambdaQuery().eq(UserAddress::getAppUserId, userId).list(); |
| | | for (UserAddress userAddress1 : list) { |
| | | userAddress1.setIsDefault(0); |
| | | } |
| | | userAddressService.updateBatchById(list); |
| | | } |
| | | userAddressService.updateById(userAddress); |
| | | return R.ok(); |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/delete") |
| | | @GetMapping("/delete") |
| | | @ApiOperation(value = "删除", tags = {"小程序-个人中心首页-我的地址"}) |
| | | public R edit(@RequestParam Integer id){ |
| | | public R edit(@RequestParam String id){ |
| | | userAddressService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/set") |
| | | @GetMapping("/set") |
| | | @ApiOperation(value = "设为默认", tags = {"小程序-个人中心首页-我的地址"}) |
| | | public R set(@RequestParam Integer id){ |
| | | public R set(@RequestParam String id){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserid(); |
| | | List<UserAddress> list = userAddressService.lambdaQuery().eq(UserAddress::getAppUserId, userId).list(); |
| | | for (UserAddress userAddress : list) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取登录用户地址列表 |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("/getUserAddressList") |
| | | @ApiOperation(value = "获取登录用户地址列表", tags = {"小程序-个人中心首页-我的地址"}) |
| | | public R<List<UserAddress>> getUserAddressList(){ |
| | | Long userId = tokenService.getLoginUserApplet().getUserid(); |
| | | List<UserAddress> list = userAddressService.lambdaQuery().eq(UserAddress::getAppUserId, userId).list(); |
| | | for (UserAddress userAddress : list) { |
| | | userAddress.setIdStr(userAddress.getId().toString()); |
| | | } |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * 根据id获取用户地址信息 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/getUserAddressById") |
| | | public R<UserAddress> getUserAddressById(@RequestParam("id") Integer id){ |
| | | public R<UserAddress> getUserAddressById(@RequestParam("id") Long id){ |
| | | UserAddress userAddress = userAddressService.getById(id); |
| | | return R.ok(userAddress); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | |
| | | @PostMapping("/mine/list") |
| | | @GetMapping("/mine/list") |
| | | @ApiOperation(value = "已领取列表", tags = {"小程序-个人中心-优惠劵"}) |
| | | public R<Page<UserCoupon>> minelist(@RequestParam Integer pageNum, @RequestParam Integer pageSize, @ApiParam("1未使用2已使用3已过期") Integer status) { |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | |
| | | .isNull(status!=null&&(status==1||status==3),UserCoupon::getUseTime) |
| | | .isNotNull(status!=null&&status==2,UserCoupon::getUseTime) |
| | | .lt(status!=null&&status==3,UserCoupon::getEndTime, LocalDateTime.now()) |
| | | .eq(UserCoupon::getAppUserId, userid).page(Page.of(pageNum, pageSize)); |
| | | .eq(UserCoupon::getAppUserId, userid).page(Page.of(pageNum-1, pageSize)); |
| | | for (UserCoupon record : page.getRecords()) { |
| | | CouponInfo data = couponClient.detail(record.getCouponId()).getData(); |
| | | CouponInfoVo vo = new CouponInfoVo(); |
| | |
| | | } |
| | | |
| | | |
| | | @PostMapping("/get") |
| | | @GetMapping("/get") |
| | | @ApiOperation(value = "领取或者兑换优惠券", tags = {"小程序-个人中心-优惠劵"}) |
| | | public R<Page<UserCoupon>> get(@RequestParam Integer couponId) { |
| | | |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.UserSignRecord; |
| | | import com.ruoyi.account.service.UserSignRecordService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/user-sign-record") |
| | | public class UserSignRecordController { |
| | | @Resource |
| | | private UserSignRecordService userSignRecordService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @ResponseBody |
| | | @GetMapping("/sign") |
| | | @ApiOperation(value = "签到", tags = {"小程序-签到"}) |
| | | public R<AppUser> change(){ |
| | | Long userId1 = tokenService.getLoginUserApplet().getUserid(); |
| | | UserSignRecord userSignRecord = new UserSignRecord(); |
| | | userSignRecord.setAppUserId(userId1); |
| | | userSignRecord.setCreateTime(LocalDateTime.now()); |
| | | userSignRecord.setRedAmount(new BigDecimal(0)); |
| | | userSignRecord.setSignDay(LocalDate.now()); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.VipSettingService; |
| | | import com.ruoyi.account.vo.vip.Level; |
| | | import com.ruoyi.account.vo.vip.VipLevel; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.*; |
| | | import com.ruoyi.other.api.feignClient.BaseSettingClient; |
| | | import com.ruoyi.other.api.feignClient.GoodsVipClient; |
| | | import com.ruoyi.other.api.feignClient.RemoteVipSettingClient; |
| | | import com.ruoyi.other.api.feignClient.VipGoodClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.log4j.Log4j2; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @RestController |
| | | @RequestMapping("/vipCenter") |
| | | @Api(tags = "小程序-会员中心") |
| | | @Log4j2 |
| | | public class VipCenterController { |
| | | @Resource |
| | | private RemoteVipSettingClient remoteVipSettingClient; |
| | | @Resource |
| | | private BaseSettingClient baseSettingClient; |
| | | @Resource |
| | | private GoodsVipClient goodsVipClient; |
| | | @Resource |
| | | private VipSettingService vipSettingService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private VipGoodClient vipGoodClient; |
| | | @Resource |
| | | private AppUserService appUserService; |
| | | |
| | | |
| | | @GetMapping("getVipLevelList") |
| | | @ApiOperation(value = "会员等级列表", tags = {"会员中心-小程序"}) |
| | | public R<VipLevel> vipLevelList() { |
| | | try { |
| | | R<List<VipSetting>> r = remoteVipSettingClient.list(); |
| | | if (!checkSuccess(r)) { |
| | | return R.fail("会员等级获取失败"); |
| | | } |
| | | List<VipSetting> vipSettingList = r.getData(); |
| | | if (vipSettingList == null || vipSettingList.isEmpty()) { |
| | | return R.fail("会员等级获取失败"); |
| | | } |
| | | |
| | | R<BaseSetting> baseSettingR = baseSettingClient.getBaseSetting(3); |
| | | if (!checkSuccess(baseSettingR)) { |
| | | log.error("【会员设置说明】获取失败:{}", baseSettingR.getMsg()); |
| | | return R.fail("会员等级获取失败"); |
| | | } |
| | | BaseSetting baseSetting = baseSettingR.getData(); |
| | | if (baseSetting == null) { |
| | | log.error("【会员设置说明】未设置"); |
| | | return R.fail("会员等级获取失败"); |
| | | } |
| | | |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | | VipSetting loginUserVipSetting = vipSettingService.getVipSettingByUserId(userid); |
| | | |
| | | VipLevel vipLevel = new VipLevel(); |
| | | List<Level> levelList = new ArrayList<>(); |
| | | |
| | | // 批量获取 goodsVip 和 vipGoods |
| | | List<Integer> vipIds = vipSettingList.stream().map(VipSetting::getId).collect(Collectors.toList()); |
| | | Map<Integer, R<GoodsVip>> goodsVipMap = getGoodsVips(vipIds); |
| | | Map<Integer, R<List<VipGood>>> vipGoodsMap = getVipGoods(vipIds); |
| | | |
| | | vipSettingList.forEach(vipSetting -> { |
| | | Level level = new Level(); |
| | | BeanUtils.copyBeanProp(level, vipSetting); |
| | | level.setVipDesc(baseSetting.getContent()); |
| | | |
| | | R<GoodsVip> goodsVipR = goodsVipMap.get(vipSetting.getId()); |
| | | if (R.isSuccess(goodsVipR)) { |
| | | R<List<VipGood>> vipGoodR = vipGoodsMap.get(vipSetting.getId()); |
| | | if (R.isSuccess(vipGoodR)) { |
| | | List<VipGood> vipGoodList = vipGoodR.getData(); |
| | | if (vipGoodList != null && !vipGoodList.isEmpty()) { |
| | | List<String> goodsNames = new ArrayList<>(); |
| | | vipGoodList.forEach(vipGood -> { |
| | | String goodJson = vipGood.getGoodJson(); |
| | | if (isValidJson(goodJson)) { |
| | | Goods goods = JSONObject.parseObject(goodJson, Goods.class); |
| | | goodsNames.add(goods.getName()); |
| | | } else { |
| | | log.warn("JSON无效: " + goodJson); |
| | | } |
| | | }); |
| | | level.setGoodsNames(goodsNames); |
| | | } |
| | | } |
| | | } |
| | | levelList.add(level); |
| | | }); |
| | | |
| | | vipLevel.setLevelList(levelList); |
| | | vipLevel.setCurrentLevel(loginUserVipSetting.getId()); |
| | | return R.ok(vipLevel); |
| | | } catch (Exception e) { |
| | | log.error("会员等级获取失败", e); |
| | | return R.fail("会员等级获取失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | | public R<Void> test() { |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | AppUser appUser = appUserService.getById(loginUserApplet.getUserid()); |
| | | if (appUser.getShopPoint() < 500){ |
| | | return R.fail("消费积分不足500"); |
| | | } |
| | | if (appUser.getSharePoint() < 500){ |
| | | return R.fail("返佣积分不足500"); |
| | | } |
| | | // 当前用户的直推用户 |
| | | // List<AppUser> bottomUsers = appUserService.list(new LambdaQueryWrapper<AppUser>() |
| | | // .eq(AppUser::getInviteUserId, loginUserApplet.getUserid()) |
| | | // .eq(AppUser::getVipId)); |
| | | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | private boolean checkSuccess(R<?> r) { |
| | | if (!R.isSuccess(r)) { |
| | | log.error("请求失败: " + r.getMsg()); |
| | | } |
| | | return R.isSuccess(r); |
| | | } |
| | | |
| | | private Map<Integer, R<GoodsVip>> getGoodsVips(List<Integer> vipIds) { |
| | | Map<Integer, R<GoodsVip>> result = new HashMap<>(); |
| | | for (Integer vipId : vipIds) { |
| | | R<GoodsVip> goodsVipR = goodsVipClient.getGoodsVip(vipId); |
| | | result.put(vipId, goodsVipR); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | private Map<Integer, R<List<VipGood>>> getVipGoods(List<Integer> vipIds) { |
| | | Map<Integer, R<List<VipGood>>> result = new HashMap<>(); |
| | | for (Integer vipId : vipIds) { |
| | | // R<List<VipGood>> vipGoodR = vipGoodClient.getVipGoodsByVipId(vipId); |
| | | // result.put(vipId, vipGoodR); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | private boolean isValidJson(String json) { |
| | | try { |
| | | JSONObject.parseObject(json); |
| | | return true; |
| | | } catch (Exception e) { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | |
| | | return R.ok(list); |
| | | } |
| | | |
| | | // /** |
| | | // * 充值 |
| | | // */ |
| | | // @GetMapping("recharge") |
| | | // @ApiOperation(value = "充值", notes = "钱包充值") |
| | | // public AjaxResult recharge(@ApiParam(value = "充值金额", required = true) @RequestParam BigDecimal amount) { |
| | | // Long userId = SecurityUtils.getUserId(); |
| | | // String openId; |
| | | // // 商户号 |
| | | // String partnerTradeNo; |
| | | // // TODO 充值 |
| | | // return AjaxResult.success(); |
| | | // } |
| | | /** |
| | | * 充值 |
| | | */ |
| | | @GetMapping("recharge") |
| | | @ApiOperation(value = "充值", notes = "钱包充值") |
| | | public R<Void> recharge(@ApiParam(value = "充值金额", required = true) @RequestParam BigDecimal amount) { |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | AppUser appUser = appUserService.getById(loginUserApplet.getUserid()); |
| | | String wxOpenid = appUser.getWxOpenid(); |
| | | // 商户号 |
| | | String partnerTradeNo; |
| | | // TODO 充值 |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | * 获取用户的祖籍列表 |
| | | */ |
| | | List<AppUser> getUserAncestorList(Long id,List<AppUser> list); |
| | | |
| | | /** |
| | | * 获取指定用户的直帮上级用户(消费用户绑定的上级,最近一个用户会员类型为【创业者】的用户) |
| | | */ |
| | | AppUser getSuperiorLeader(Long id); |
| | | } |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.model.AppUserShop; |
| | |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.AppUserShopService; |
| | | import com.ruoyi.account.util.weChat.WXCore; |
| | | import com.ruoyi.account.util.weChat.WeChatUtil; |
| | | import com.ruoyi.account.vo.*; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | |
| | | return R.fail(map.get("msg").toString()); |
| | | } |
| | | String openid = map.get("openid").toString(); |
| | | String sessionKey = map.get("sessionKey").toString(); |
| | | //查询用户是否注册,没有注册则跳转到注册页面 |
| | | AppUser appUser = this.getOne(new LambdaQueryWrapper<AppUser>().eq(AppUser::getWxOpenid, openid).ne(AppUser::getStatus, 3).eq(AppUser::getDelFlag, 0)); |
| | | if(null == appUser){ |
| | | String decrypt = WXCore.decrypt(appletLogin.getEncryptedData_phone(), sessionKey, appletLogin.getIv_phone()); |
| | | if (StringUtils.isEmpty(decrypt)) { |
| | | return R.fail("获取手机信息失败"); |
| | | } |
| | | JSONObject phone = JSON.parseObject(decrypt); |
| | | String purePhoneNumber = phone.getString("purePhoneNumber"); |
| | | LoginVo loginVo = new LoginVo(); |
| | | loginVo.setSkipPage(2); |
| | | loginVo.setPhone(purePhoneNumber); |
| | | return R.ok(loginVo); |
| | | } |
| | | //账户被冻结,给出提示 |
| | |
| | | if(null == appUser){ |
| | | LoginVo loginVo = new LoginVo(); |
| | | loginVo.setSkipPage(2); |
| | | loginVo.setPhone(mobileLogin.getPhone()); |
| | | return R.ok(loginVo); |
| | | } |
| | | //账户被冻结,给出提示 |
| | |
| | | // return R.fail("验证码错误"); |
| | | // } |
| | | //使用jscode获取微信openid |
| | | // Map<String, Object> map = weChatUtil.code2Session(registerAccount.getJscode()); |
| | | // Integer errcode = Integer.valueOf(map.get("errcode").toString()); |
| | | // if(0 != errcode){ |
| | | // return R.fail(map.get("msg").toString()); |
| | | // } |
| | | // String openid = map.get("openid").toString(); |
| | | // //查询用户是否注册 |
| | | // AppUser appUser = this.getOne(new LambdaQueryWrapper<AppUser>().eq(AppUser::getWxOpenid, openid).ne(AppUser::getStatus, 3).eq(AppUser::getDelFlag, 0)); |
| | | // if(null != appUser){ |
| | | // return R.fail("此微信号已注册,请直接登录!"); |
| | | // } |
| | | AppUser appUser = null; |
| | | Map<String, Object> map = weChatUtil.code2Session(registerAccount.getJscode()); |
| | | Integer errcode = Integer.valueOf(map.get("errcode").toString()); |
| | | if(0 != errcode){ |
| | | return R.fail(map.get("msg").toString()); |
| | | } |
| | | String openid = map.get("openid").toString(); |
| | | //查询用户是否注册 |
| | | AppUser appUser = this.getOne(new LambdaQueryWrapper<AppUser>().eq(AppUser::getWxOpenid, openid).ne(AppUser::getStatus, 3).eq(AppUser::getDelFlag, 0)); |
| | | if(null != appUser){ |
| | | return R.fail("此微信号已注册,请直接登录!"); |
| | | } |
| | | AppUser appUser1 = this.getOne(new LambdaQueryWrapper<AppUser>().eq(AppUser::getPhone, registerAccount.getPhone()).ne(AppUser::getStatus, 3).eq(AppUser::getDelFlag, 0)); |
| | | if(null != appUser1){ |
| | | if(null != appUser1 && StringUtils.isNotEmpty(appUser1.getWxOpenid())){ |
| | | return R.fail("手机号已注册,请直接登录!"); |
| | | } |
| | | if(null == appUser){ |
| | | if(null != appUser1 && appUser1.getStatus() == 2){ |
| | | return R.fail("手机号已注册,请直接登录!"); |
| | | } |
| | | //如果手机号已注册,但是没有微信号,则将微信号添加到已有账户上 |
| | | if(null != appUser1 && StringUtils.isEmpty(appUser1.getWxOpenid())){ |
| | | appUser1.setWxOpenid(openid); |
| | | this.updateById(appUser1); |
| | | appUser = appUser1; |
| | | }else if(null == appUser){ |
| | | appUser = new AppUser(); |
| | | appUser.setName(registerAccount.getName()); |
| | | appUser.setPhone(registerAccount.getPhone()); |
| | | // appUser.setWxOpenid(openid); |
| | | appUser.setWxOpenid(openid); |
| | | //注册默认为普通会员 |
| | | appUser.setVipId(1); |
| | | appUser.setStatus(1); |
| | |
| | | sysUserClient.saveShopUser(user); |
| | | } |
| | | } |
| | | |
| | | } |
| | | LoginVo loginVo = new LoginVo(); |
| | | loginVo.setSkipPage(1); |
| | | loginVo.setFirstTime(false); |
| | | loginVo.setFirstTime(null == appUser1 ? true : false); |
| | | loginVo.setPhone(appUser.getPhone()); |
| | | //构建token |
| | | LoginUser loginUser = new LoginUser(); |
| | |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public AppUser getSuperiorLeader(Long id) { |
| | | AppUser appUser = getById(id); |
| | | Long inviteUserId = appUser.getInviteUserId(); |
| | | AppUser inviteUser = getById(inviteUserId); |
| | | if (inviteUser == null){ |
| | | return null; |
| | | } |
| | | if (inviteUser.getVipId() > 3) { |
| | | return inviteUser; |
| | | }else { |
| | | getSuperiorLeader(inviteUserId); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | walletVO.setAuditAmount(waitAuditList.stream() |
| | | .map(WithdrawalRequests::getWithdrawalAmount) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | |
| | | walletVO.setBalance(appUser.getBalance()); |
| | | return walletVO; |
| | | } |
| | | |
File was renamed from ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/weChat/TaskUtil.java |
| | |
| | | package com.ruoyi.account.util.weChat; |
| | | package com.ruoyi.account.util; |
| | | |
| | | |
| | | import org.springframework.scheduling.annotation.Scheduled; |
File was renamed from ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/weChat/weChat/WeChatUtil.java |
| | |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * 微信工具类 |
| | |
| | | |
| | | // @Value("${wx.appSecret}") |
| | | private String webAppSecret; |
| | | |
| | | @Resource |
| | | private RedisService redisService; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | public String getWxAppletsAccessToken(){ |
| | | Object wxAppletsAccessToken = redisService.getCacheObject("wxAppletsAccessToken"); |
| | | if(null != wxAppletsAccessToken){ |
| | | return wxAppletsAccessToken.toString(); |
| | | } |
| | | String appletsAccessToken = getAppletsAccessToken(); |
| | | redisService.setCacheObject("wxAppletsAccessToken", appletsAccessToken, 7200L, TimeUnit.SECONDS); |
| | | return appletsAccessToken; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取微信小程序token |
| | | * @return |
| | | */ |
| | | public String getWxAppletsAccessToken() throws Exception{ |
| | | public String getAppletsAccessToken() { |
| | | String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + wxAppletsAppid + "&secret=" + wxAppletsAppSecret; |
| | | HttpRequest get = HttpUtil.createGet(url); |
| | | HttpResponse response = get.execute(); |
| | |
| | | package com.ruoyi.account.vo.vip; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | @ApiModelProperty(value = "会员等级id") |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 会员名称 |
| | | */ |
| | | @ApiModelProperty(value = "会员名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "会员专属权益") |
| | | private String vipInfo; |
| | | |
| | | @ApiModelProperty(value = "会员说明") |
| | | private String vipDesc; |
| | | @ApiModelProperty(value = "1级会员专用 自动解绑推广人天数: 达到设置天数未成为黄金会员自动解绑推广人") |
| | | private Integer vipCancelDay; |
| | | |
| | | @ApiModelProperty(value = "消费达到积分 后升级") |
| | | private BigDecimal vipLevelUpShop; |
| | | @ApiModelProperty(value = "1级会员专用 可更换绑定人天数:用户在达到设置的天数未下单商品,可以更换绑定人") |
| | | private Integer vipChangeDay; |
| | | |
| | | @ApiModelProperty(value = "返佣达到积分 后升级") |
| | | private BigDecimal vipLevelUpShare; |
| | | @ApiModelProperty(value = "钱包提现权限:1开0关") |
| | | private Integer vipWithdrawalRole; |
| | | |
| | | @ApiModelProperty(value = "升级会员的直推用户人数要求") |
| | | @ApiModelProperty(value = "最低提现门槛") |
| | | private BigDecimal vipWithdrawalMinAmount; |
| | | |
| | | @ApiModelProperty(value = "提现手续费") |
| | | private BigDecimal vipWithdrawalFee; |
| | | |
| | | @ApiModelProperty(value = "积分转赠权限 1开0关") |
| | | private Integer vipGiftRole; |
| | | |
| | | @ApiModelProperty(value = "达成会员等级所需消费积分数量") |
| | | private Integer vipLevelUpShop; |
| | | |
| | | @ApiModelProperty(value = "通过消费积分达成会员等级的开关 1开0关") |
| | | private Integer vipLevelUpShopRole; |
| | | |
| | | @ApiModelProperty(value = "达成会员等级所需的返佣积分数量") |
| | | private Integer vipLevelUpShare; |
| | | |
| | | @ApiModelProperty(value = "通过返佣积分达成会员等级的开关 1开0关") |
| | | private Integer vipLevelUpShareRole; |
| | | |
| | | @ApiModelProperty(value = "达成会员等级所需的直推人数(包括钻石和代理)") |
| | | private Integer vipDirectNum; |
| | | @ApiModelProperty(value = "升级会员的团队数要求") |
| | | |
| | | @ApiModelProperty(value = "达成会员等级所需的团队数量") |
| | | private Integer vipTeamNum; |
| | | |
| | | @ApiModelProperty(value = "保级:消费x天") |
| | | @ApiModelProperty(value = "通过直推用户或团队数量的方式达成会员等级的开关 1开0关") |
| | | private Integer vipLevelUpNumRole; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "达成会员等级所需准代理数(达成总代和合伙人用到)") |
| | | private Integer vipDirectVipNum; |
| | | |
| | | @ApiModelProperty(value = "达成会员等级所需总代数量(达成合伙人用到)") |
| | | private Integer vipTeamVipNum; |
| | | |
| | | @ApiModelProperty(value = "达成会员等级所需开店数量") |
| | | private Integer vipOpenShopNum; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "消费积分保级周期(天)") |
| | | private Integer keepBuyDay; |
| | | |
| | | @ApiModelProperty(value = "保级:消费x分") |
| | | private BigDecimal keepBuyPoint; |
| | | @ApiModelProperty(value = "消费积分保级的积分阈值(分))") |
| | | private Integer keepBuyPoint; |
| | | |
| | | @ApiModelProperty(value = "保级:返佣x天") |
| | | @ApiModelProperty(value = "返佣积分保的周期(天)") |
| | | private Integer keepShareDay; |
| | | |
| | | @ApiModelProperty(value = "保级:返佣x分") |
| | | private BigDecimal keepSharePoint; |
| | | @ApiModelProperty(value = "返佣积分保级的积分阈值(分)") |
| | | private Integer keepSharePoint; |
| | | |
| | | @ApiModelProperty(value = "保级:门店x天") |
| | | @ApiModelProperty(value = "门店业绩积分保级的周期(天)") |
| | | private Integer keepShopDay; |
| | | |
| | | @ApiModelProperty(value = "保级:门店x分") |
| | | private BigDecimal keepShopPoint; |
| | | @ApiModelProperty(value = "门店业绩积分保级的积分阈值(分)") |
| | | private Integer keepShopPoint; |
| | | |
| | | @ApiModelProperty(value = "会员描述") |
| | | private String vipDesc; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "会员商品名称") |
| | | private List<String> goodsNames; |
| | | } |
| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.ruoyi.account.api.feignClient.UserAddressClient; |
| | | import com.ruoyi.account.api.model.UserAddress; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.order.vo.OrderDetailVO; |
| | | import com.ruoyi.order.vo.OrderVO; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.*; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ruoyi.order.vo.OrderDetailVO; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import com.ruoyi.order.model.Order; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | @Resource |
| | | private OrderService orderService; |
| | | @Resource |
| | | TokenService tokenService; |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private UserAddressClient addressClient; |
| | | |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(value = "订单状态", name = "status", required = true, dataType = "int"), |
| | | }) |
| | | @GetMapping("/getMyOrderList") |
| | | public TableDataInfo getMyOrderList(@ApiParam("订单状态") Integer status){ |
| | | public TableDataInfo<OrderVO> getMyOrderList(@ApiParam("订单状态") Integer status){ |
| | | startPage(); |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | return getDataTable(orderService.selectOrderListByUserId(status, loginUserApplet.getUserid())); |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单号", name = "code", required = true, dataType = "String"), |
| | | }) |
| | | @GetMapping("/writeOff/{code}") |
| | | public R<Void> writeOff(@PathVariable("code") String code){ |
| | | @GetMapping("/writeOff/{code}/{shopId}") |
| | | public R<Void> writeOff(@PathVariable("code") String code, @PathVariable("shopId") Integer shopId){ |
| | | orderService.writeOff(code, shopId); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | }) |
| | | @GetMapping("/cancel/{orderId}") |
| | | public R<Void> cancel(@PathVariable("orderId") Long orderId){ |
| | | // TODO 待完善 |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 确认收货 |
| | | */ |
| | | @ApiOperation(value = "确认收货", tags = {"小程序-个人中心-我的订单-确认收货"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | }) |
| | | @GetMapping("/confirm/{orderId}") |
| | | public R<Void> confirm(@PathVariable("orderId") Long orderId){ |
| | | // TODO 待完善 |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 更换收货地址 |
| | | */ |
| | | @ApiOperation(value = "更换收货地址", tags = {"小程序-个人中心-我的订单-更换收货地址"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | }) |
| | | @GetMapping("/changeAddress") |
| | | public R<Void> changeAddress(@RequestParam("orderId") Long orderId, @RequestParam("addressId") Long addressId){ |
| | | R<UserAddress> userAddressR = addressClient.getUserAddressById(addressId); |
| | | if(R.isError(userAddressR)){ |
| | | return R.fail("收货地址不存在"); |
| | | } |
| | | UserAddress userAddress = userAddressR.getData(); |
| | | String addressJson = JSONObject.toJSONString(userAddress); |
| | | orderService.update(new LambdaUpdateWrapper<Order>() |
| | | .eq(Order::getId, orderId) |
| | | .set(Order::getAddressJson, addressJson)); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.order.model.RefundPass; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.order.service.RefundPassService; |
| | | import com.ruoyi.order.vo.ApplyRefundPass; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RequestMapping("/refund-pass") |
| | | public class RefundPassController { |
| | | |
| | | |
| | | @Resource |
| | | private RefundPassService refundPassService; |
| | | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | @Resource |
| | | private OrderService orderService; |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/applyRefundPass") |
| | | @ApiOperation(value = "售后申请", tags = {"我的订单-个人中心-小程序"}) |
| | | public R applyRefundPass(@RequestBody ApplyRefundPass applyRefundPass){ |
| | | return refundPassService.applyRefundPass(applyRefundPass); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getRefundPass/{orderId}") |
| | | @ApiOperation(value = "获取售后详情", tags = {"我的订单-个人中心-小程序"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "orderId", value = "订单id", required = true, dataType = "long"), |
| | | }) |
| | | public R<RefundPass> getRefundPass(@PathVariable("orderId") Long orderId){ |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | | Order order = orderService.getById(orderId); |
| | | if(!order.getAppUserId().equals(userid)){ |
| | | return R.fail("权限不足"); |
| | | } |
| | | RefundPass one = refundPassService.getOne(new LambdaQueryWrapper<RefundPass>().eq(RefundPass::getOrderId, orderId) |
| | | .eq(RefundPass::getDelFlag, 0).last(" order by createTime desc limit 0,1")); |
| | | one.setIdStr(one.getId().toString()); |
| | | return R.ok(one); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PutMapping("/cancelRefundPass/{id}") |
| | | @ApiOperation(value = "取消售后", tags = {"我的订单-个人中心-小程序"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "售后数据id", required = true, dataType = "long"), |
| | | }) |
| | | public R cancelRefundPass(@PathVariable("id") Long id){ |
| | | RefundPass refundPass = refundPassService.getById(id); |
| | | if(null == refundPass){ |
| | | return R.fail(); |
| | | } |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | | Order order = orderService.getById(refundPass.getOrderId()); |
| | | if(!order.getAppUserId().equals(userid)){ |
| | | return R.fail("权限不足"); |
| | | } |
| | | if(Arrays.asList(2, 3).contains(refundPass.getStatus())){ |
| | | return R.fail("售后取消失败"); |
| | | } |
| | | refundPass.setDelFlag(1); |
| | | refundPassService.updateById(refundPass); |
| | | order.setOrderStatus(4); |
| | | orderService.updateById(order); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PutMapping("/deliverGoodsRefundPass/{id}") |
| | | @ApiOperation(value = "售后已发货操作", tags = {"我的订单-个人中心-小程序"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "售后数据id", required = true, dataType = "long"), |
| | | }) |
| | | public R deliverGoodsRefundPass(@PathVariable("id") Long id){ |
| | | RefundPass refundPass = refundPassService.getById(id); |
| | | if(null == refundPass){ |
| | | return R.fail(); |
| | | } |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | | Order order = orderService.getById(refundPass.getOrderId()); |
| | | if(!order.getAppUserId().equals(userid)){ |
| | | return R.fail("权限不足"); |
| | | } |
| | | if(4 != refundPass.getStatus()){ |
| | | return R.fail("操作失败"); |
| | | } |
| | | refundPass.setStatus(5); |
| | | refundPassService.updateById(refundPass); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | public interface CommissionService { |
| | | |
| | | // 计算佣金 |
| | | void calculationCommission(List<Long> orderIds); |
| | | void calculationCommission(Set<String> orderIds); |
| | | |
| | | void addToCommissionDelayQueue(Long orderId, LocalDateTime afterSalesDeadline); |
| | | } |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.model.RefundPass; |
| | | import com.ruoyi.order.vo.ApplyRefundPass; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface RefundPassService extends IService<RefundPass> { |
| | | |
| | | /** |
| | | * 申请售后 |
| | | * @param applyRefundPass |
| | | * @return |
| | | */ |
| | | R applyRefundPass(ApplyRefundPass applyRefundPass); |
| | | |
| | | } |
| | |
| | | import java.time.ZoneId; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void calculationCommission(List<Long> orderIds) { |
| | | public void calculationCommission(Set<String> orderIds) { |
| | | List<OrderGood> orderGoods = orderGoodService.list(new LambdaQueryWrapper<OrderGood>() |
| | | .in(OrderGood::getOrderId, orderIds)); |
| | | |
| | |
| | | throw new RuntimeException("获取用户信息失败"); |
| | | } |
| | | Long inviteUserId = appUser.getInviteUserId(); |
| | | // 直推上级用户 |
| | | AppUser inviteUser = appUserClient.getAppUserById(inviteUserId); |
| | | |
| | | // 获取直帮上级用户 |
| | | R<AppUser> superiorLeaderR = appUserClient.getSuperiorLeader(appUserId); |
| | | if (!R.isSuccess(superiorLeaderR)) { |
| | | throw new RuntimeException("获取直帮上级信息失败"); |
| | | } |
| | | AppUser superiorLeader = superiorLeaderR.getData(); |
| | | |
| | | for (OrderGood og : v) {// 累计分销金额 |
| | | |
| | | // 上级分销金额 |
| | | if (inviteUser != null){ |
| | | // 直推上级分佣金额 |
| | | Integer superiorType = og.getSuperiorType(); |
| | | if (superiorType == 1 && inviteUser != null){ |
| | | // 分佣金额 |
| | | BigDecimal superiorSubcommission = og.getSuperiorSubcommission(); |
| | | BigDecimal totalDistributionAmount = inviteUser.getTotalDistributionAmount(); |
| | | totalDistributionAmount = totalDistributionAmount.add(superiorSubcommission); |
| | | // |
| | | Integer superiorType = og.getSuperiorType(); |
| | | inviteUser.setTotalDistributionAmount(totalDistributionAmount); |
| | | |
| | | // 分佣积分 |
| | | Integer sharePoint = inviteUser.getSharePoint(); |
| | | if (superiorType == 1) { |
| | | Integer superiorRebatePoints = og.getSuperiorRebatePoints(); |
| | | sharePoint = sharePoint + superiorRebatePoints; |
| | | } else if (superiorType == 2) { |
| | | |
| | | } else { |
| | | continue; |
| | | } |
| | | inviteUser.setTotalDistributionAmount(totalDistributionAmount); |
| | | inviteUser.setSharePoint(sharePoint); |
| | | } |
| | | |
| | | // 门店分销金额 |
| | | og.getBoundShopCharges(); |
| | | appUserClient.editAppUserById(inviteUser); |
| | | }else |
| | | // 直帮上级分佣金额 |
| | | if (superiorType == 2 && superiorLeader != null){ |
| | | // 分佣金额 |
| | | BigDecimal superiorSubcommission = og.getSuperiorSubcommission(); |
| | | BigDecimal totalDistributionAmount = superiorLeader.getTotalDistributionAmount(); |
| | | totalDistributionAmount = totalDistributionAmount.add(superiorSubcommission); |
| | | superiorLeader.setTotalDistributionAmount(totalDistributionAmount); |
| | | |
| | | // 分佣积分 |
| | | Integer sharePoint = superiorLeader.getSharePoint(); |
| | | Integer superiorRebatePoints = og.getSuperiorRebatePoints(); |
| | | sharePoint = sharePoint + superiorRebatePoints; |
| | | superiorLeader.setSharePoint(sharePoint); |
| | | |
| | | appUserClient.editAppUserById(superiorLeader); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.ruoyi.order.vo.OrderDetailVO; |
| | | import com.ruoyi.order.vo.OrderGoodsVO; |
| | | import com.ruoyi.order.vo.OrderVO; |
| | | import com.ruoyi.other.api.domain.CouponInfo; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.api.domain.OrderActivityInfo; |
| | | import com.ruoyi.other.api.domain.Technician; |
| | | import com.ruoyi.other.api.domain.*; |
| | | import com.ruoyi.other.api.feignClient.GoodsClient; |
| | | import com.ruoyi.other.api.feignClient.ShopClient; |
| | | import com.ruoyi.other.api.feignClient.TechnicianClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private TechnicianClient technicianClient; |
| | | @Resource |
| | | private ShopClient shopClient; |
| | | |
| | | |
| | | @Override |
| | |
| | | if (order == null){ |
| | | throw new ServiceException("订单不存在"); |
| | | } |
| | | R<Shop> shopR = shopClient.getShopById(order.getShopId()); |
| | | if (!R.isSuccess(shopR)){ |
| | | throw new ServiceException("获取门店信息失败"); |
| | | } |
| | | |
| | | // 商品 |
| | | List<OrderGood> orderGoods = orderGoodMapper.selectList(new LambdaQueryWrapper<OrderGood>() |
| | | .eq(OrderGood::getOrderId, orderId)); |
| | |
| | | for (OrderGood orderGood : orderGoods) { |
| | | String goodJson = orderGood.getGoodJson(); |
| | | Goods goods = JSONObject.parseObject(goodJson, Goods.class); |
| | | |
| | | OrderGoodsVO orderGoodsVO = new OrderGoodsVO(); |
| | | orderGoodsVO.setGoodsId(orderGood.getGoodsId()); |
| | | orderGoodsVO.setNum(orderGood.getNum()); |
| | | orderGoodsVO.setGoodsName(goods.getName()); |
| | | orderGoodsVO.setType(goods.getType()); |
| | | orderGoodsVO.setNum(orderGood.getNum()); |
| | | orderGoodsVO.setGoodsPic(goods.getHomePagePicture()); |
| | | orderGoodsVO.setSellingPrice(goods.getSellingPrice()); |
| | | orderGoodsVO.setOriginalPrice(goods.getOriginalPrice()); |
| | | goodsList.add(orderGoodsVO); |
| | | } |
| | | |
| | | |
| | | |
| | | // 收货地址 |
| | |
| | | } |
| | | |
| | | OrderDetailVO orderDetailVO = new OrderDetailVO(); |
| | | |
| | | if (CollectionUtil.isNotEmpty(orderGoods)){ |
| | | String goodJson = orderGoods.get(0).getGoodJson(); |
| | | Goods goods = JSONObject.parseObject(goodJson, Goods.class); |
| | | orderDetailVO.setDistributionMode(goods.getDistributionMode()); |
| | | } |
| | | |
| | | Shop shop = shopR.getData(); |
| | | |
| | | |
| | | orderDetailVO.setId(order.getId()); |
| | | orderDetailVO.setOrderStatus(order.getOrderStatus()); |
| | | orderDetailVO.setPoint(order.getPoint()); |
| | | orderDetailVO.setAddressId(userAddress.getId()); |
| | | orderDetailVO.setRecieveName(userAddress.getRecieveName()); |
| | |
| | | orderDetailVO.setPointAmount(order.getGetPoint()); |
| | | orderDetailVO.setPaymentAmount(order.getPaymentAmount()); |
| | | orderDetailVO.setGoodsList(goodsList); |
| | | orderDetailVO.setShopName(shop.getName()); |
| | | orderDetailVO.setShopAddress(shop.getAddress()); |
| | | orderDetailVO.setLongitude(shop.getLongitude()); |
| | | orderDetailVO.setLatitude(shop.getLatitude()); |
| | | return orderDetailVO; |
| | | } |
| | | |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.mapper.RefundPassMapper; |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.order.model.RefundPass; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.order.service.RefundPassService; |
| | | import com.ruoyi.order.vo.ApplyRefundPass; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneOffset; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class RefundPassServiceImpl extends ServiceImpl<RefundPassMapper, RefundPass> implements RefundPassService { |
| | | |
| | | @Resource |
| | | private OrderService orderService; |
| | | |
| | | |
| | | /** |
| | | * 申请售后 |
| | | * @param applyRefundPass |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R applyRefundPass(ApplyRefundPass applyRefundPass) { |
| | | RefundPass one = this.getOne(new LambdaQueryWrapper<RefundPass>().eq(RefundPass::getOrderId, applyRefundPass.getId()).eq(RefundPass::getDelFlag, 0) |
| | | .ne(RefundPass::getStatus, 3)); |
| | | if(null != one){ |
| | | return R.fail("不能重复提交售后"); |
| | | } |
| | | Order order = orderService.getById(applyRefundPass.getId()); |
| | | //判断是都已经超过售后时间 |
| | | LocalDateTime afterSaleTime = order.getAfterSaleTime(); |
| | | if(null != afterSaleTime && afterSaleTime.toEpochSecond(ZoneOffset.UTC) < LocalDateTime.now().toEpochSecond(ZoneOffset.UTC)){ |
| | | return R.fail("已超过售后期间"); |
| | | } |
| | | |
| | | //构建售后申请数据 |
| | | RefundPass refundPass = new RefundPass(); |
| | | refundPass.setOrderId(applyRefundPass.getId()); |
| | | refundPass.setStatus(1); |
| | | refundPass.setRefundMethod(applyRefundPass.getRefundMethod()); |
| | | refundPass.setRefundReason(applyRefundPass.getRefundReason()); |
| | | refundPass.setUserRemark(applyRefundPass.getUserRemark()); |
| | | refundPass.setPics(applyRefundPass.getPics()); |
| | | refundPass.setPassStatus(1); |
| | | refundPass.setDelFlag(0); |
| | | refundPass.setCreateTime(LocalDateTime.now()); |
| | | this.save(refundPass); |
| | | order.setOrderStatus(7); |
| | | orderService.updateById(order); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.order.model.OrderGood; |
| | | import com.ruoyi.order.model.ShoppingCart; |
| | | import com.ruoyi.order.service.CommissionService; |
| | | import com.ruoyi.order.service.OrderGoodService; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.order.service.ShoppingCartService; |
| | |
| | | |
| | | @Resource |
| | | private BalanceChangeRecordClient balanceChangeRecordClient; |
| | | |
| | | @Resource |
| | | private CommissionService commissionService; |
| | | |
| | | |
| | | |
| | |
| | | paymentUserCoupon.setType(confirmOrder.getType()); |
| | | if(confirmOrder.getPaymentType() == 1){ |
| | | List<PaymentUserCouponVo> data = userCouponClient.getPaymentUserCoupon(paymentUserCoupon).getData(); |
| | | if(null != data){ |
| | | for (PaymentUserCouponVo couponInfo : data) { |
| | | List<Integer> forGoodIds = couponInfo.getForGoodIds(); |
| | | //全部商品适用 |
| | |
| | | //代金券 |
| | | if(2 == couponInfo.getCouponType() || 3 == couponInfo.getCouponType()){ |
| | | couponInfo.setAvailable(true); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | for (ShoppingCart shoppingCart : list) { |
| | | Goods goods = goodsClient.getGoodsById(shoppingCart.getGoodsId()).getData(); |
| | | MyShoppingCartVo vo = new MyShoppingCartVo(); |
| | | vo.setId(shoppingCart.getId()); |
| | | vo.setId(shoppingCart.getId().toString()); |
| | | vo.setGoodsId(goods.getId()); |
| | | vo.setHomePicture(goods.getHomePagePicture()); |
| | | vo.setName(goods.getName()); |
| | |
| | | //获取支付价格 |
| | | Price price = getPrice(appUser, shoppingCart.getGoodsId(), shopId); |
| | | if(null == price){ |
| | | price = new Price(); |
| | | //使用商品的基础价格 |
| | | price.setCash(1 == goods.getCashPayment() ? goods.getSellingPrice() : null); |
| | | price.setPoint(1 == goods.getPointPayment() ? goods.getIntegral() : null); |
| | |
| | | goodsShop.setGoodsId(shoppingCart.getGoodsId()); |
| | | goodsShop.setShopId(shopId); |
| | | GoodsShop goodsShop1 = goodsShopClient.getGoodsShop(goodsShop).getData(); |
| | | vo.setVerifiable(null == goodsShop1 ? false : true); |
| | | vo.setVerifiable(goods.getAppointStore() == 1 && null == goodsShop1 ? false : true); |
| | | //判断当前数量是否已经超出限购数量(需要计算已经购买的数量) |
| | | if(null == goods.getPurchaseLimit() || -1 == goods.getPurchaseLimit()){ |
| | | vo.setPurchaseLimit(false); |
| | |
| | | if(data.size() != goodsList.size()){ |
| | | String goodsName = ""; |
| | | for (Integer goodsId : goodsIds) { |
| | | if(!collect.contains(goodsId)){ |
| | | goodsName = goodsClient.getGoodsById(goodsId).getData().getName(); |
| | | Goods goods = goodsClient.getGoodsById(goodsId).getData(); |
| | | if(1 == goods.getAppointStore() && !collect.contains(goodsId)){ |
| | | goodsName = goods.getName(); |
| | | break; |
| | | } |
| | | } |
| | | if(StringUtils.isNotEmpty(goodsName)){ |
| | | return R.fail(goodsName + "不能在该门店核销"); |
| | | } |
| | | } |
| | | //开始构建支付信息 |
| | | //现金支付的订单金额 |
| | |
| | | order.setShopId(shoppingCartPayment.getShopId()); |
| | | order.setDelFlag(0); |
| | | order.setCreateTime(LocalDateTime.now()); |
| | | order.setExpressPayMethod(shoppingCartPayment.getFreightPaymentType()); |
| | | |
| | | if(2 == shoppingCartPayment.getPaymentType()){ |
| | | BigDecimal balance = appUser.getBalance(); |
| | |
| | | } |
| | | } |
| | | //判断运费支付是否足够 |
| | | if(2 == shoppingCartPayment.getFreightPaymentType() && expressFee.compareTo(BigDecimal.ZERO) > 0){ |
| | | if(null != shoppingCartPayment.getFreightPaymentType() && 2 == shoppingCartPayment.getFreightPaymentType() && expressFee.compareTo(BigDecimal.ZERO) > 0){ |
| | | BigDecimal balance = appUser.getBalance(); |
| | | if(balance.compareTo(expressFee) < 0){ |
| | | return R.fail("账户余额不足"); |
| | |
| | | } |
| | | for (int i = 0; i < objects.size(); i++) { |
| | | Long id = objects.getJSONObject(i).getLong("id"); |
| | | if(myShoppingCartVo.getId().equals(id)){ |
| | | if(myShoppingCartVo.getId().equals(id.toString())){ |
| | | ShoppingCart shoppingCart = this.getById(id); |
| | | Integer num1 = objects.getJSONObject(i).getInteger("num"); |
| | | orderGood.setNum(num1); |
| | | Goods goods1 = goodsClient.getGoodsById(myShoppingCartVo.getGoodsId()).getData(); |
| | | Goods goods1 = goodsClient.getGoodsById(shoppingCart.getGoodsId()).getData(); |
| | | orderGood.setGoodJson(JSON.toJSONString(goods1)); |
| | | break; |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/12/6 18:30 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class ApplyRefundPass { |
| | | @ApiModelProperty(value = "订单id", required = true) |
| | | private Long id; |
| | | @ApiModelProperty(value = "售后类型(1=退货退款,2=仅退款)", required = true) |
| | | private Integer refundMethod; |
| | | @ApiModelProperty(value = "申请原因", required = true) |
| | | private String refundReason; |
| | | @ApiModelProperty(value = "备注", required = true) |
| | | private String userRemark; |
| | | @ApiModelProperty(value = "图片地址,多个逗号分隔", required = true) |
| | | private String pics; |
| | | |
| | | } |
| | |
| | | @ApiModel("购物车") |
| | | public class MyShoppingCartVo { |
| | | @ApiModelProperty("数据id") |
| | | private Long id; |
| | | private String id; |
| | | @ApiModelProperty("商品id") |
| | | private Integer goodsId; |
| | | @ApiModelProperty("封面图") |
| | |
| | | @Data |
| | | public class OrderVO { |
| | | @ApiModelProperty(value = "订单id") |
| | | private Integer id; |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String orderNumber; |
| | |
| | | @ApiModel |
| | | public class SetGoodsNumber { |
| | | @ApiModelProperty(value = "购物车数据id", required = true) |
| | | private Integer id; |
| | | private Long id; |
| | | @ApiModelProperty(value = "修改数量", required = true) |
| | | private Integer number; |
| | | } |
| | |
| | | @ApiModelProperty(value = "配送方式(1=自提,2=快递)", required = false) |
| | | private Integer distributionMode; |
| | | @ApiModelProperty(value = "配送地址id", required = false) |
| | | private Integer userAddressId; |
| | | private Long userAddressId; |
| | | @ApiModelProperty(value = "预计提货时间", required = false) |
| | | private String expectedDeliveryTime; |
| | | } |
| | |
| | | |
| | | <select id="selectOrderListByUserId" resultType="com.ruoyi.order.vo.OrderVO"> |
| | | SELECT |
| | | o.id, |
| | | CAST(o.id AS CHAR) id, |
| | | o.order_number, |
| | | o.order_status, |
| | | o.good_name, |
| | |
| | | o.good_pics, |
| | | o.num, |
| | | o.point, |
| | | o.payment_amount |
| | | o.payment_amount, |
| | | o.create_time |
| | | ORDER BY |
| | | o.create_time DESC |
| | | </select> |
| | |
| | | <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-seata</artifactId> |
| | | </dependency> |
| | | <!--<dependency>--> |
| | | <!--<groupId>com.alibaba.cloud</groupId>--> |
| | | <!--<artifactId>spring-cloud-starter-alibaba-seata</artifactId>--> |
| | | <!--</dependency>--> |
| | | |
| | | <!-- SpringBoot Actuator --> |
| | | <dependency> |
| | |
| | | } |
| | | |
| | | |
| | | @PostMapping("/gift/list") |
| | | @GetMapping("/gift/list") |
| | | @ApiOperation(value = "待领取列表", tags = {"小程序-个人中心-优惠劵"}) |
| | | public R<List<CouponInfo>> giftlist(){ |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | |
| | | */ |
| | | @GetMapping("/getGoodsListByShopId") |
| | | @ApiOperation(value = "商品列表", tags = {"小程序-首页-门店详情-商品购买列表"}) |
| | | public R<List<Goods>> getGoodsListByShopId(@ApiParam("门店id") @RequestParam Integer shopId) { |
| | | public R<TableDataInfo> getGoodsListByShopId(@ApiParam("门店id") @RequestParam Integer shopId) { |
| | | startPage(); |
| | | return R.ok(goodsService.getGoodsListByShopId(shopId)); |
| | | return R.ok(getDataTable(goodsService.getGoodsListByShopId(shopId))); |
| | | } |
| | | |
| | | |
| | |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.api.domain.GoodsEvaluate; |
| | | import com.ruoyi.other.service.GoodsEvaluateService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/goods-evaluate") |
| | | @Api("评论") |
| | | public class GoodsEvaluateController { |
| | | @Resource |
| | | private GoodsEvaluateService goodsEvaluateService; |
| | |
| | | private AppUserClient appUserClient; |
| | | |
| | | @GetMapping("/goodsList") |
| | | @ApiOperation(value = "商品评价", tags = {"小程序-商品评价"}) |
| | | @ApiOperation(value = "获取商品评价", tags = {"小程序-获取商品评价"}) |
| | | public R<List<GoodsEvaluate>> goodsList(@ApiParam("商品id") Integer goodsId){ |
| | | List<GoodsEvaluate> list = goodsEvaluateService.lambdaQuery().eq(GoodsEvaluate::getGoodsId, goodsId).list(); |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * 发布商品评价 |
| | | */ |
| | | @PostMapping("/addGoodsEvaluate") |
| | | @ApiOperation(value = "发布商品评价", tags = {"小程序-发布商品评价"}) |
| | | public R<Void> addGoodsEvaluate(GoodsEvaluate goodsEvaluate){ |
| | | goodsEvaluateService.save(goodsEvaluate); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 评论详情 |
| | | */ |
| | | @GetMapping("/detail/{id}") |
| | | @ApiOperation(value = "评论详情", tags = {"小程序-评论详情"}) |
| | | public R<GoodsEvaluate> detail(@PathVariable("id") Long id){ |
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(id); |
| | | return R.ok(goodsEvaluate); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | return R.ok(shopService.nearbyShopList(longitude, latitude)); |
| | | } |
| | | |
| | | /** |
| | | * 门店详情 |
| | | */ |
| | | @GetMapping("/technicianList") |
| | | @ApiOperation(value = "技师列表", tags = {"技师列表-小程序"}) |
| | | public AjaxResult technicianList(@ApiParam("门店id") @RequestParam String shopId){ |
| | | return success(technicianService.list(new LambdaQueryWrapper<Technician>() |
| | | .eq(Technician::getShopId,shopId) |
| | | .eq(Technician::getStatus,2) |
| | | .eq(Technician::getSubscribeStatus,1))); |
| | | } |
| | | |
| | | @GetMapping("/shopDetail") |
| | | @ApiOperation(value = "门店详情", tags = {"小程序-首页-门店详情"}) |
| | |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.feignClient.OrderClient; |
| | | import com.ruoyi.other.service.GoodsEvaluateService; |
| | | import com.ruoyi.other.service.TechnicianService; |
| | | import com.ruoyi.other.service.TechnicianSubscribeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/technician") |
| | | public class TechnicianController { |
| | | @Api(tags = "技师") |
| | | public class TechnicianController extends BaseController { |
| | | @Resource |
| | | private TechnicianService technicianService; |
| | | @Resource |
| | |
| | | */ |
| | | @GetMapping("/technicianListByShopId") |
| | | @ApiOperation(value = "技师列表", tags = {"技师列表-小程序"}) |
| | | public R<List<TechnicianVO>> technicianListByShopId(@ApiParam("门店id") @RequestParam Long shopId) { |
| | | return R.ok(technicianService.getTechnicianListByShopId(shopId)); |
| | | public R<TableDataInfo<TechnicianVO>> technicianListByShopId(@ApiParam("门店id") @RequestParam Long shopId) { |
| | | startPage(); |
| | | return R.ok(getDataTable(technicianService.getTechnicianListByShopId(shopId))); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.other.api.domain.VipGood; |
| | | import com.ruoyi.other.service.VipGoodService; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/vip-good") |
| | | public class VipGoodController { |
| | | public class VipGoodController extends BaseController { |
| | | @Resource |
| | | private VipGoodService vipGoodService; |
| | | |
| | | @GetMapping("getVipGoodsByVipId") |
| | | public R<List<VipGood>> getVipGoodsByVipId(@RequestParam("vipId") Integer vipId){ |
| | | return R.ok(vipGoodService.list(new LambdaQueryWrapper<VipGood>() |
| | | .eq(VipGood::getVipId, vipId))); |
| | | } |
| | | } |
| | | |
| | |
| | | @Resource |
| | | private VipGoodService vipGoodService; |
| | | |
| | | @GetMapping("/list") |
| | | public R<List<VipSetting>> list() { |
| | | @GetMapping("/info") |
| | | @ApiOperation(value = "获取各级会员信息", tags = {"小程序-个人中心首页", "小程序-会员中心"}) |
| | | public R<List<VipSetting>> info() { |
| | | List<VipSetting> list = vipSettingService.list(); |
| | | return R.ok(list); |
| | | } |
| | |
| | | |
| | | @Getter |
| | | public enum GoodsStatus { |
| | | DOWN(0, "下架"), |
| | | UP(1, "上架"); |
| | | DOWN(1, "下架"), |
| | | UP(2, "上架"); |
| | | |
| | | private final Integer code; |
| | | private final String desc; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @since 2024-11-20 |
| | | */ |
| | | public interface GoodsMapper extends BaseMapper<Goods> { |
| | | List<Goods> selectListByShopId(Integer shopId, Integer vip); |
| | | List<Goods> selectListByShopId(@Param("shopId") Integer shopId,@Param("vip") Integer vip); |
| | | } |
| | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.api.domain.GoodsArea; |
| | | import com.ruoyi.other.api.domain.GoodsVip; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.api.domain.*; |
| | | import com.ruoyi.other.enums.GoodsStatus; |
| | | import com.ruoyi.other.mapper.GoodsAreaMapper; |
| | | import com.ruoyi.other.mapper.GoodsMapper; |
| | | import com.ruoyi.other.mapper.GoodsShopMapper; |
| | | import com.ruoyi.other.mapper.ShopMapper; |
| | | import com.ruoyi.other.service.GoodsService; |
| | | import com.ruoyi.other.service.GoodsVipService; |
| | | import com.ruoyi.other.service.VipSettingService; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private GoodsVipService goodsVipService; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | @Resource |
| | | private GoodsShopMapper goodsShopMapper; |
| | | @Resource |
| | | private ShopMapper shopMapper; |
| | | |
| | | @Override |
| | | public List<GoodsVO> goodsList(Goods search) { |
| | | List<Goods> goodsList = this.list(new LambdaQueryWrapper<Goods>() |
| | | .eq(Goods::getStatus, GoodsStatus.UP) |
| | | .eq(Goods::getStatus, GoodsStatus.UP.getCode()) |
| | | .eq(Objects.nonNull(search.getGoodsCategoryId()), Goods::getGoodsCategoryId, search.getGoodsCategoryId()) |
| | | .like(StringUtils.isNotEmpty(search.getName()), Goods::getName, search.getName())); |
| | | |
| | |
| | | for (Goods goods : goodsList) { |
| | | GoodsVO goodsVO = new GoodsVO(); |
| | | BeanUtils.copyBeanProp(goodsVO, goods); |
| | | goodsVO.setGoodsId(goods.getId()); |
| | | goodsVO.setGoodsName(goods.getName()); |
| | | result.add(goodsVO); |
| | | } |
| | | return result; |
| | |
| | | } |
| | | |
| | | Goods goods = this.getById(goodsId); |
| | | |
| | | List<GoodsShop> goodsShopList = goodsShopMapper.selectList(new LambdaQueryWrapper<GoodsShop>() |
| | | .eq(GoodsShop::getGoodsId, goodsId)); |
| | | List<Integer> shopIds = goodsShopList.stream().map(GoodsShop::getShopId).collect(Collectors.toList()); |
| | | List<Shop> shopList = shopMapper.selectList(new LambdaQueryWrapper<Shop>() |
| | | .in(Shop::getId, shopIds)); |
| | | GoodsVO goodsVO = new GoodsVO(); |
| | | goodsVO.setShopList(shopList); |
| | | BeanUtils.copyBeanProp(goodsVO, goods); |
| | | goodsVO.setGoodsId(goods.getId()); |
| | | goodsVO.setGoodsName(goods.getName()); |
| | | goodsVO.setSellingPrice(sellingPrice); |
| | | goodsVO.setIntegral(integral); |
| | | return goodsVO; |
| | |
| | | package com.ruoyi.other.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @ApiModel(value="商品热销对象", description="热门商品") |
| | | @Data |
| | | public class GoodsVO { |
| | | |
| | | @ApiModelProperty(value = "商品id") |
| | | private Long goodsId; |
| | | private Integer goodsId; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | private String goodsName; |
| | |
| | | private Integer pointPayment; |
| | | |
| | | @ApiModelProperty(value = "基础积分") |
| | | @TableField("integral") |
| | | private Integer integral; |
| | | |
| | | @ApiModelProperty(value = "划线价") |
| | |
| | | |
| | | @ApiModelProperty(value = "已售数量") |
| | | private Integer saleNum; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | private Integer shopId; |
| | | |
| | | @ApiModelProperty(value = "门店列表") |
| | | private List<Shop> shopList; |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.other.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value="技师详情对象", description="技师详情对象") |
| | | public class TechnicianDetailVO { |
| | | |
| | | /** |
| | |
| | | package com.ruoyi.other.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value="技师对象", description="技师对象") |
| | | public class TechnicianVO { |
| | | @ApiModelProperty(value = "主键") |
| | | private Long id; |
| | |
| | | tt.introduction, |
| | | tt.home_picture, |
| | | COUNT(tts.id) AS serviceCount, |
| | | AVG(ttsc.score) AS score |
| | | AVG( IFNULL(ttsc.score,0) ) AS score |
| | | FROM |
| | | t_technician tt |
| | | LEFT JOIN t_technician_subscribe tts ON tt.id = tts.technician_id |
| | | LEFT JOIN t_technician_subscribe tts ON tt.id = tts.technician_id and tts.`status` != 0 |
| | | LEFT JOIN t_technician_score ttsc ON ttsc.technician_id = tt.id |
| | | WHERE |
| | | tts.`status` != 0 |
| | | AND tt.`status` = 2 |
| | | tt.`status` = 2 |
| | | AND tt.del_flag = 0 |
| | | AND tt.subscribe_status = 1 |
| | | AND tt.shop_id = #{shopId} |