Merge remote-tracking branch 'origin/master'
# Conflicts:
# ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/factory/AppUserClientFallbackFactory.java
# ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java
# ruoyi-modules/ruoyi-system/src/main/resources/mapping/system/SysUserMapper.xml
# ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
# ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java
# ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java
11 文件已重命名
118个文件已修改
11个文件已添加
| | |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<List<AppUser>> getTopUsers() { |
| | | log.error("获取用户列表失败:{}", cause.getMessage()); |
| | | throw new RuntimeException("获取用户列表失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Long> getVipCount(Long userId, Integer vipId) { |
| | | log.error("获取直推会员数失败:{}", cause.getMessage()); |
| | | throw new RuntimeException("获取直推会员数失败"); |
| | |
| | | return R.fail("根据用户名称模糊搜索用户列表失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public R<List<AppUser>> getAppUserByPhone(String phone) { |
| | | return R.fail("根据用户电话模糊搜索用户列表失败:" + cause.getMessage()); |
| | | public R<Void> addAppUserShop(AppUserShop appUserShop) { |
| | | return R.fail("添加失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<AppUser> getAppUserByPhone(String phone) { |
| | | return R.fail("通过手机号查询用户失败"); |
| | | } |
| | | |
| | | @Override |
| | | public List<AppUser> listByIds(List<String> list) { |
| | | return Collections.emptyList(); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | public R<CouponInfoVo> getCouponInfo(Long userCouponId) { |
| | | return R.fail("根据用户优惠券id获取优惠券详情失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Long> getCouponCount(Integer couponId) { |
| | | return R.fail("根据优惠券id获取优惠券数量失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | @GetMapping("/appUserShop/shop/{userId}") |
| | | R<List<AppUserShop>> getAppUserShop(@PathVariable("userId") Long userId); |
| | | |
| | | @PostMapping("/appUserShop/addAppUserShop") |
| | | R<Void> addAppUserShop(@RequestBody AppUserShop appUserShop); |
| | | |
| | | /** |
| | | * 根据用户id获取用户的祖籍列表 |
| | | */ |
| | |
| | | @GetMapping("/appletLogin/getSuperiorLeader") |
| | | R<AppUser> getSuperiorLeader(@RequestParam("id") Long id); |
| | | |
| | | |
| | | @GetMapping("/app-user/getTopUsers") |
| | | R<List<AppUser>> getTopUsers(); |
| | | |
| | | @PostMapping("/app-user/getVipCount") |
| | | R<Long> getVipCount(@RequestParam("userId")Long userId, @RequestParam("vipId") Integer vipId ); |
| | | |
| | | |
| | | @GetMapping("/app-user/listByIds") |
| | | List<AppUser> listByIds(List<String> list); |
| | | |
| | | /** |
| | | * 根据用户名称模糊搜索用户列表 |
| | | * @param name |
| | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | 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; |
| | |
| | | */ |
| | | @PostMapping("/user-coupon/getCouponInfo") |
| | | R<CouponInfoVo> getCouponInfo(@RequestParam("userCouponId") Long userCouponId); |
| | | |
| | | @GetMapping("/user-coupon/getCouponCount") |
| | | R<Long> getCouponCount(@RequestParam("couponId") Integer couponId); |
| | | } |
| | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "用户姓名") |
| | | @TableField(exist = false) |
| | | private String userName; |
| | | @ApiModelProperty(value = "用户电话") |
| | | @TableField(exist = false) |
| | | private String userPhone; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @ApiModelProperty(value = "用户") |
| | | @TableField("name") |
| | | private String name; |
| | | @ApiModelProperty("会员名称") |
| | | @TableField(exist = false) |
| | | private String vipName; |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | @TableField("phone") |
| | |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | |
| | | @ApiModelProperty(value = "绑定门店名称") |
| | | @TableField(exist = false) |
| | | private String shopName; |
| | | @ApiModelProperty(value = "绑定门店列表") |
| | | @TableField(exist = false) |
| | | private List<String> shopNames; |
| | | @ApiModelProperty(value = "绑定门店封面") |
| | | @TableField(exist = false) |
| | | private String shopCover; |
| | |
| | | @TableField(exist = false) |
| | | private Integer isSign; |
| | | |
| | | @ApiModelProperty("绑定门店id列表") |
| | | @TableField(exist = false) |
| | | private Set<Integer> shopIds; |
| | | |
| | | @ApiModelProperty(value = "降级预警") |
| | | @TableField("is_danger") |
| | | private Integer isDanger; |
| | | |
| | | @ApiModelProperty(value = "最后下单时间") |
| | | @TableField(exist = false) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime lastOrderTime; |
| | | |
| | | |
| | | public String getIdStr(){ |
| | | return String.valueOf(id); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | @TableField("vip_id") |
| | | private Integer vipId; |
| | | |
| | | @TableField(exist = false) |
| | | private String userName; |
| | | @TableField(exist = false) |
| | | private String userPhone; |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | |
| | | @TableField("after_vip_id") |
| | | private Integer afterVipId; |
| | | |
| | | @ApiModelProperty(value = "变更类型") |
| | | @ApiModelProperty(value = "变更类型 0降级1升级") |
| | | @TableField("change_type") |
| | | private Integer changeType; |
| | | @ApiModelProperty("用户姓名") |
| | | @TableField(exist = false) |
| | | private String userName; |
| | | @ApiModelProperty("用户电话") |
| | | @TableField(exist = false) |
| | | private String userPhone; |
| | | |
| | | |
| | | } |
| | |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | |
| | | private Integer status; |
| | | |
| | | |
| | | @ApiModelProperty(value = "领取用户姓名") |
| | | @TableField(exist = false) |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value = "领取用户手机号") |
| | | @TableField(exist = false) |
| | | private String phone; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @TableField("object_id") |
| | | private Long objectId; |
| | | |
| | | @ApiModelProperty(value = "用户名称") |
| | | @TableField(exist = false) |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | @TableField(exist = false) |
| | | private String phone; |
| | | |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | | @TableField(exist = false) |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间") |
| | | @TableField(exist = false) |
| | | private LocalDateTime endTime; |
| | | |
| | | @TableField(exist = false) |
| | | private List<Long> userIds; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.feignClient.RemoteOrderGoodsClient; |
| | | import com.ruoyi.order.vo.Price; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.order.model.OrderGood; |
| | |
| | | public R<Void> calculationCommission(Set<String> orderIds) { |
| | | return R.fail("计算佣金失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Price> getGoodsPrice(Long appUserId, Integer goodsId, Integer shopId) { |
| | | return R.fail("获取商品价格失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Order> getLastOrder(Long appUserId) { |
| | | return R.fail("获取订单失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Order>> byUserId(Long appUserId) { |
| | | return R.fail(); |
| | | } |
| | | }; |
| | | |
| | | } |
| | |
| | | import com.ruoyi.order.factory.RemoteOrderGoodsFallbackFactory; |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.order.model.OrderGood; |
| | | import com.ruoyi.order.vo.Price; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | @PostMapping("/order/getOrderListByIds") |
| | | public R<List<Order>> getOrderListByIds(@RequestBody List<Long> orderIds); |
| | | |
| | | @PostMapping("/order/byUserId") |
| | | public R<List<Order>> byUserId(@RequestParam("appUserId")Long appUserId); |
| | | |
| | | |
| | | /** |
| | | * 根据用户id和商品id查找订单列表 |
| | | */ |
| | |
| | | */ |
| | | @PostMapping("/commission/calculationCommission") |
| | | public R<Void> calculationCommission(@RequestBody Set<String> orderIds); |
| | | |
| | | @GetMapping("/shopping-cart/getGoodsPrice") |
| | | public R<Price> getGoodsPrice(@RequestParam("appUserId") Long appUserId, @RequestParam("goodsId") Integer goodsId, @RequestParam("shopId") Integer shopId); |
| | | @PostMapping("/order/getLastOrder") |
| | | public R<Order> getLastOrder(@RequestParam("appUserId") Long appUserId); |
| | | } |
File was renamed from ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/ChargingOrderListInfoVO.java |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ChargingOrderListInfoVO对象",description = "充电时段统计列表查看详情VO") |
File was renamed from ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/ConfirmOrderVo.java |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import com.ruoyi.account.api.model.UserAddress; |
| | | import com.ruoyi.account.api.vo.CouponInfoVo; |
| | | import com.ruoyi.account.api.vo.PaymentUserCouponVo; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
File was renamed from ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/MyShoppingCartVo.java |
| | |
| | | @ApiModelProperty("积分支付") |
| | | private Boolean pointPayment; |
| | | @ApiModelProperty("配送方式(1=自提,2=快递)") |
| | | private Integer distributionMode; |
| | | private String distributionMode; |
| | | /** |
| | | * 可获得消费积分 |
| | | */ |
| | |
| | | private BigDecimal paymentAmount; |
| | | |
| | | @ApiModelProperty(value = "配送方式(1=自提,2=快递)") |
| | | private Integer distributionMode; |
| | | private String distributionMode; |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String shopName; |
File was renamed from ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/OrderVO.java |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class OrderVO { |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class Price { |
| | | /** |
| | | * 现金 |
| | | */ |
| | | private BigDecimal cash; |
| | | /** |
| | | * 积分 |
| | | */ |
| | | private Integer point; |
| | | /** |
| | | * 获取结束时间 |
| | | */ |
| | | private Long endTime; |
| | | /** |
| | | * 现金支付 |
| | | */ |
| | | private Boolean cashPayment; |
| | | /** |
| | | * 积分支付 |
| | | */ |
| | | private Boolean pointPayment; |
| | | /** |
| | | * 可获得消费积分 |
| | | */ |
| | | private Integer earnSpendingPoints; |
| | | /** |
| | | * 上级获得分佣金额 |
| | | */ |
| | | private BigDecimal superiorSubcommission; |
| | | /** |
| | | * 上级获得返佣积分 |
| | | */ |
| | | private Integer superiorRebatePoints; |
| | | /** |
| | | * 获取返佣积分上级类型(1=直推上级,2=直帮上级) |
| | | */ |
| | | private Integer superiorType; |
| | | /** |
| | | * 核销门店可获得服务费 |
| | | */ |
| | | private BigDecimal servuceShopCharges; |
| | | /** |
| | | * 核销门店可获得服务积分 |
| | | */ |
| | | private Integer servuceShopPoints; |
| | | /** |
| | | * 技师可获得服务积分 |
| | | */ |
| | | private Integer technicianPoints; |
| | | /** |
| | | * 绑定门店可获得分佣金额 |
| | | */ |
| | | private BigDecimal boundShopCharges; |
| | | /** |
| | | * 绑定门店可获得返佣积分 |
| | | */ |
| | | private Integer boundShopPoints; |
| | | /** |
| | | * 绑定门店上级门店可获得分佣金额 |
| | | */ |
| | | private BigDecimal boundShopSuperiorsCharges; |
| | | /** |
| | | * 绑定门店上级门店可获得返佣积分 |
| | | */ |
| | | private Integer boundShopSuperiorsPoints; |
| | | } |
| | |
| | | package com.ruoyi.other.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "优惠券名称") |
| | |
| | | |
| | | @ApiModelProperty(value = "有效期开始时间") |
| | | @TableField("period_start_time") |
| | | private LocalDateTime periodStartTime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate periodStartTime; |
| | | |
| | | @ApiModelProperty(value = "有效期结束时间") |
| | | @TableField("period_end_time") |
| | | private LocalDateTime periodEndTime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate periodEndTime; |
| | | |
| | | @ApiModelProperty(value = "领取后x天有效") |
| | | @TableField("period_days") |
| | |
| | | |
| | | @ApiModelProperty(value = "开始发放时间") |
| | | @TableField("send_start_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime sendStartTime; |
| | | |
| | | @ApiModelProperty(value = "结束发放时间") |
| | | @TableField("send_end_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime sendEndTime; |
| | | |
| | | @ApiModelProperty(value = "1免费发放2积分兑换") |
| | |
| | | @TableField("person_ids") |
| | | private String personIds; |
| | | |
| | | @ApiModelProperty(value = "上架状态:0-下架 1-上架") |
| | | @TableField("shelf_status") |
| | | private Integer shelfStatus; |
| | | |
| | | @ApiModelProperty(value = "指定会员等级,逗号隔开") |
| | | private String vipIds; |
| | | |
| | | @ApiModelProperty(value = "已发放数量") |
| | | @TableField(exist = false) |
| | | private Long sendNumNow; |
| | | |
| | | @ApiModelProperty(value = "其他商品名称") |
| | | private String goodsNameJson; |
| | | |
| | | |
| | | @ApiModelProperty(value = "其他商品名称") |
| | | @TableField(exist = false) |
| | | private List<String> goodsNameList; |
| | | |
| | | @TableField(exist = false) |
| | | private List<Goods> goods; |
| | | |
| | | @TableField(exist = false) |
| | | private List<AppUser> appUserList; |
| | | |
| | | |
| | | public String getIdStr(){ |
| | | return String.valueOf(id); |
| | | } |
| | | } |
| | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @TableField("purchase_limit") |
| | | private Integer purchaseLimit; |
| | | |
| | | @ApiModelProperty(value = "配送方式(1=自提,2=快递)") |
| | | @ApiModelProperty(value = "配送方式(1=自提,2=快递,1,2 = 自提+快递)") |
| | | @TableField("distribution_mode") |
| | | private Integer distributionMode; |
| | | private String distributionMode; |
| | | |
| | | @ApiModelProperty(value = "指定门店(1=指定,2=所有)") |
| | | @TableField("appoint_store") |
| | |
| | | @TableField(exist = false) |
| | | private Integer vipId; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "指定门店") |
| | | private List<GoodsShop> goodsShopList; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "指定用户") |
| | | private List<GoodsAppUser> goodsAppUserList; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "会员价格") |
| | | private List<GoodsVip> goodsVipList; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "地区价格") |
| | | private List<GoodsArea> goodsAreaList; |
| | | |
| | | |
| | | } |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_goods_app_user") |
| | | @ApiModel(value="GoodsAppUser对象", description="") |
| | | @ApiModel(value="指定用户对象", description="") |
| | | public class GoodsAppUser implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_goods_area") |
| | | @ApiModel(value="GoodsArea对象", description="") |
| | | @ApiModel(value="商品地区价格对象", description="") |
| | | public class GoodsArea implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_goods_bargain_price") |
| | | @ApiModel(value="GoodsBargainPrice对象", description="") |
| | | @ApiModel(value="门店特殊价格对象", description="") |
| | | public class GoodsBargainPrice implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | |
| | | @ApiModelProperty(value = "添加用户id") |
| | | @TableField("create_user_id") |
| | | private Integer createUserId; |
| | | private Long createUserId; |
| | | |
| | | @TableField(exist = false) |
| | | private List<GoodsBargainPriceDetail> goodsBargainPriceDetailList; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | @TableField(exist = false) |
| | | private String goodsName; |
| | | |
| | | @ApiModelProperty(value = "所属分类") |
| | | @TableField(exist = false) |
| | | private String categoryName; |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | @TableField(exist = false) |
| | | private String shopName; |
| | | |
| | | @ApiModelProperty(value = "店长名称") |
| | | @TableField(exist = false) |
| | | private String ownerName; |
| | | |
| | | @ApiModelProperty(value = "店长手机号") |
| | | @TableField(exist = false) |
| | | private String ownerPhone; |
| | | |
| | | } |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_goods_bargain_price_detail") |
| | | @ApiModel(value="GoodsBargainPriceDetail对象", description="") |
| | | @ApiModel(value="门店特殊价格明细对象", description="") |
| | | public class GoodsBargainPriceDetail implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | private String avatar; |
| | | |
| | | |
| | | @ApiModelProperty(value = "名字") |
| | | @ApiModelProperty(value = "评价用户") |
| | | @TableField(exist = false) |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | @TableField(exist = false) |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "商品名字") |
| | | @TableField(exist = false) |
| | | private String goodsName; |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_goods_shop") |
| | | @ApiModel(value="GoodsShop对象", description="") |
| | | @ApiModel(value="指定门店对象", description="") |
| | | public class GoodsShop implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_goods_vip") |
| | | @ApiModel(value="GoodsVip对象", description="") |
| | | @ApiModel(value="会员价格对象", description="") |
| | | public class GoodsVip implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | |
| | | @ApiModelProperty(value = "活动开始日期") |
| | | @TableField("start_time") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty(value = "活动结束日期") |
| | | @TableField("end_time") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime endTime; |
| | | |
| | | @ApiModelProperty(value = "满x元") |
| | |
| | | @TableField("discount") |
| | | private BigDecimal discount; |
| | | |
| | | @ApiModelProperty(value = "是否上架:0否 1是") |
| | | @TableField("is_shelf") |
| | | private Integer isShelf; |
| | | |
| | | @ApiModelProperty(value = "活动状态:0未开始,1已开始") |
| | | @TableField(exist = false) |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "主键字符串") |
| | | @TableField(exist = false) |
| | | private String idStr; |
| | | |
| | | @ApiModelProperty(value = "会员名称") |
| | | @TableField(exist = false) |
| | | private String vipName; |
| | | |
| | | public String getIdStr() { |
| | | return String.valueOf(id); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @TableField("end_time") |
| | | private LocalDateTime endTime; |
| | | |
| | | @ApiModelProperty(value = "是否上架:0否 1是") |
| | | @TableField("is_shelves") |
| | | private Integer isShelves; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | private List<GoodsSeckill> goodsSeckills; |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "对象id") |
| | | @TableField("object_id") |
| | | private String objectId; |
| | | @TableField(exist = false) |
| | | private String authName; |
| | | @TableField(exist = false) |
| | | private String authPhone; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "门店积分总数") |
| | | @TableField("shop_all_point") |
| | | private BigDecimal shopAllPoint; |
| | | private Integer shopAllPoint; |
| | | |
| | | @ApiModelProperty(value = "门店业绩积分") |
| | | @TableField("shop_point") |
| | | private BigDecimal shopPoint; |
| | | private Integer shopPoint; |
| | | |
| | | @ApiModelProperty(value = "门店返佣积分") |
| | | @TableField("share_point") |
| | | private BigDecimal sharePoint; |
| | | private Integer sharePoint; |
| | | |
| | | @ApiModelProperty(value = "门店服务积分") |
| | | @TableField("server_point") |
| | | private BigDecimal serverPoint; |
| | | private Integer serverPoint; |
| | | |
| | | @ApiModelProperty(value = "下级门店返佣积分") |
| | | @TableField("lower_level_rebate_points") |
| | | private BigDecimal lowerLevelRebatePoints; |
| | | private Integer lowerLevelRebatePoints; |
| | | |
| | | @ApiModelProperty(value = "门店已用积分") |
| | | @TableField("use_point") |
| | | private BigDecimal usePoint; |
| | | private Integer usePoint; |
| | | |
| | | @ApiModelProperty(value = "门店分佣总金额") |
| | | @TableField("giveaway_all_money") |
| | |
| | | private LocalDateTime createTime; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @TableField("user_address") |
| | | private String userAddress; |
| | | |
| | | @ApiModelProperty(value = "状态(0=待服务,1=已服务,2=已取消)") |
| | | @ApiModelProperty(value = "状态(0=待服务,1=已服务,2=已取消, 3=已到期)") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | |
| | | private Integer vipId; |
| | | |
| | | @ApiModelProperty(value = "指定购买后升级商品的json快照") |
| | | @TableField("good_json") |
| | | private String goodJson; |
| | | @TableField("good_id") |
| | | private Integer goodId; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @ApiModelProperty(value = "钱包提现权限:1开0关") |
| | | @TableField("vip_withdrawal_role") |
| | | private Integer vipWithdrawalRole; |
| | | |
| | | @ApiModelProperty(value = "钱包提现权限:1开0关") |
| | | @TableField("vip_agent_level_up_role") |
| | | private Integer vipAgentLevelUpRole; |
| | | |
| | | @ApiModelProperty(value = "最低提现门槛") |
| | | @TableField("vip_withdrawal_min_amount") |
| | |
| | | @TableField("vip_level_up_proxy_role") |
| | | private Integer vipLevelUpProxyRole; |
| | | |
| | | @ApiModelProperty(value = "指定会员升级商品") |
| | | @TableField("good_ids") |
| | | private String goodIds; |
| | | |
| | | |
| | | @ApiModelProperty("指定商品列表") |
| | | @TableField(exist = false) |
| | | private List<Goods> goodsList; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.other.api.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(description = "物流设置") |
| | | public class LogisticsSetDto { |
| | | /** |
| | | * 物流查询时间间隔 |
| | | */ |
| | | @ApiModelProperty(value = "物流查询时间间隔") |
| | | private Integer waitTime; |
| | | |
| | | /** |
| | | * 订单运费 |
| | | */ |
| | | @ApiModelProperty(value = "订单运费") |
| | | private Integer freight; |
| | | |
| | | /** |
| | | * 包邮订单金额 |
| | | */ |
| | | @ApiModelProperty(value = "包邮订单金额") |
| | | private Integer freeFreight; |
| | | |
| | | /** |
| | | * 包邮订单积分 |
| | | */ |
| | | @ApiModelProperty(value = "包邮订单积分") |
| | | private Integer freeIntegral; |
| | | |
| | | /** |
| | | * 包邮会员等级要求:1普通会员,2黄金会员,3钻石会员,4准代理,5代理,6总代,7合伙人 |
| | | */ |
| | | @ApiModelProperty(value = "包邮会员等级要求:1普通会员,2黄金会员,3钻石会员,4准代理,5代理,6总代,7合伙人") |
| | | private Integer freeVip; |
| | | } |
| | |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | @Slf4j |
| | | public class ShopClientFallbackFactory implements FallbackFactory<ShopClient> { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Shop>> getShopByUserId(Long id) { |
| | | return R.fail("根据用户id集合获取门店数据失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<Shop> getShopByPhone(String phone) { |
| | | return R.fail("根据店铺管理员电话获取门店数据失败:" + cause.getMessage()); |
| | | } |
| | |
| | | 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.feignClient.VipSettingClient; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/12/10 13:53 |
| | |
| | | public R<VipSetting> getVipSetting(Integer id) { |
| | | return R.fail("查询会员配置失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<VipSetting>> info() { |
| | | return R.fail("获取会员配置失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.other.api.domain.BaseSetting; |
| | | import com.ruoyi.other.api.factory.BaseSettingClientFallbackFactory; |
| | | 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.RequestParam; |
| | | |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/base-setting/getBaseSetting") |
| | | @GetMapping("/base-setting/getBaseSetting") |
| | | R<BaseSetting> getBaseSetting(@RequestParam("id") Integer id); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * 获取会员价格配置 |
| | | * 取获会员价格配置 |
| | | * @param vip |
| | | * @return |
| | | */ |
| | |
| | | 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("/shop/getShopById") |
| | | R<Shop> getShopById(@RequestParam("id") Integer id); |
| | | |
| | | @PostMapping("/shop/getShopByUserId") |
| | | R<List<Shop>> getShopByUserId(@RequestParam("id") Long id); |
| | | |
| | | /** |
| | | * 根据店铺管理员电话获取门店数据 |
| | |
| | | |
| | | @PostMapping("/getShopByUserIds") |
| | | public R<List<Shop>> getShopByUserIds(@RequestBody List<Long> userIds); |
| | | |
| | | @GetMapping("/getShopIdByName") |
| | | R<Set<Integer>> getShopIdByName(String shopName); |
| | | } |
| | |
| | | public interface VipGoodClient { |
| | | |
| | | @GetMapping("/vip-good/getVipGoodsByVipId") |
| | | public R<List<VipGood>> getVipGoodsByVipId(@RequestParam("subscribeId") Integer vipId); |
| | | R<List<VipGood>> getVipGoodsByVipId(@RequestParam("vipId") Integer vipId); |
| | | |
| | | @GetMapping("/vip-setting/getVipSettingById") |
| | | public R<VipSetting> getVipSettingById(@RequestParam("id") Integer id); |
| | | R<VipSetting> getVipSettingById(@RequestParam("id") Integer id); |
| | | } |
| | |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.api.factory.VipSettingClientFallbackFactory; |
| | | 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.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | */ |
| | | @PostMapping("/vip-setting/getVipSetting") |
| | | R<VipSetting> getVipSetting(@RequestParam("id") Integer id); |
| | | |
| | | @GetMapping("/vip-setting/info") |
| | | R<List<VipSetting>> info(); |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.feignClient.RemoteOrderGoodsClient; |
| | | import com.ruoyi.order.service.CommissionService; |
| | | import lombok.extern.log4j.Log4j2; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | 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)); |
| | | }); |
| | | } |
| | | } |
| | |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="forbiddenRemark" column="forbidden_remark"/> |
| | | <result property="remark" column="remark" /> |
| | | <result property="roleType" column="roleType" /> |
| | | <result property="roleType" column="role_type" /> |
| | | <result property="objectId" column="objectId" /> |
| | | <association property="dept" column="dept_id" javaType="com.ruoyi.system.api.domain.SysDept" resultMap="deptResult" /> |
| | | <collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectUserVo"> |
| | | select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, |
| | | select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.role_type, u.create_by, u.create_time, u.remark, |
| | | d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, |
| | | r.role_id, r.role_name, r.role_key, r.data_scope, r.status as role_status ,u.roleType as roleType,u.objectId AS objectId |
| | | r.role_id, r.role_name, r.role_key, r.data_scope, r.status as role_status ,u.role_type as roleType,u.objectId AS objectId |
| | | from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | |
| | | <if test="null != req.objectId"> |
| | | and objectId = #{req.objectId} |
| | | </if> |
| | | and del_flag = '0' and roleType =1 |
| | | and del_flag = '0' and role_type =1 |
| | | order by create_time desc |
| | | </select> |
| | | <select id="getAllList" resultType="com.ruoyi.system.api.domain.SysUser"> |
| | | select *,user_id userId,nick_name userName ,create_time createTime ,login_date loginDate from sys_user where roleType=3 and user_id in |
| | | select *,user_id userId,nick_name userName ,create_time createTime ,login_date loginDate from sys_user where role_type=3 and user_id in |
| | | |
| | | <foreach collection="ids" separator="," open="(" item="id" index="index" close=")" > |
| | | #{id} |
| | |
| | | and objectId = #{query.objectId} |
| | | </if> |
| | | AND del_flag = '0' |
| | | AND roleType = 1 |
| | | AND role_type = 1 |
| | | </where> |
| | | ORDER BY create_time DESC |
| | | </select> |
| | |
| | | <if test="password != null and password != ''">password,</if> |
| | | <if test="status != null and status != ''">status,</if> |
| | | <if test="createBy != null and createBy != ''">create_by,</if> |
| | | <if test="roleType != null and roleType != ''">roleType,</if> |
| | | <if test="roleType != null and roleType != ''">role_type,</if> |
| | | <if test="remark != null and remark != ''">remark,</if> |
| | | <if test="objectId != null and objectId != ''">objectId,</if> |
| | | create_time |
| | |
| | | package com.ruoyi.account.controller; |
| | | import java.time.LocalDateTime; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.model.AgentApplication; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.UserChangeLog; |
| | | import com.ruoyi.account.dto.AgentQuery; |
| | | import com.ruoyi.account.service.AgentApplicationService; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.UserChangeLogService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | |
| | | public class AgentApplicationController extends BaseController { |
| | | @Resource |
| | | private AgentApplicationService agentApplicationService; |
| | | @Resource |
| | | private AppUserService appUserService; |
| | | |
| | | @PostMapping("/apply") |
| | | @ApiOperation(value = "会员申请", tags = {"会员中心-小程序"}) |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/page") |
| | | @ApiOperation(value = "会员申请列表", tags = {"后台"}) |
| | | public R<IPage<AgentApplication>> page(@RequestBody AgentQuery agentQuery) { |
| | | |
| | | return R.ok(agentApplicationService.pageList(agentQuery)); |
| | | } |
| | | @GetMapping("/detail") |
| | | @ApiOperation(value = "会员申请详情", tags = {"会员中心-小程序"}) |
| | | public R<AgentApplication> detail(@RequestParam Long id) { |
| | | |
| | | return R.ok(agentApplicationService.getById(id)); |
| | | } |
| | | @Resource |
| | | private UserChangeLogService userChangeLogService; |
| | | |
| | | @GetMapping("/auth") |
| | | @ApiOperation(value = "会员申请审核", tags = {"会员中心-小程序"}) |
| | | public R<AgentApplication> auth(@RequestParam Long id, @ApiParam("2'已处理-同意',3'已处理-拒绝")Integer status,@ApiParam("处理意见") String remark) { |
| | | AgentApplication byId = agentApplicationService.getById(id); |
| | | byId.setStatus(status); |
| | | byId.setRemark(remark); |
| | | agentApplicationService.updateById(byId); |
| | | AppUser byId1 = appUserService.getById(byId.getAppUserId()); |
| | | //插入等级变化数据 |
| | | UserChangeLog userChangeLog = new UserChangeLog(); |
| | | userChangeLog.setCreateTime(LocalDateTime.now()); |
| | | userChangeLog.setAppUserId(byId.getAppUserId()); |
| | | userChangeLog.setBeforeVipId(byId1.getVipId()); |
| | | userChangeLog.setAfterVipId(byId.getApplicationVipId()); |
| | | if (userChangeLog.getBeforeVipId()>userChangeLog.getAfterVipId()) { |
| | | userChangeLog.setChangeType(0); |
| | | }else { |
| | | userChangeLog.setChangeType(1); |
| | | } |
| | | userChangeLogService.save(userChangeLog); |
| | | //变更会员等级 |
| | | byId1.setVipId(byId.getApplicationVipId()); |
| | | return R.ok(byId); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | import com.ruoyi.account.service.UserCancellationLogService; |
| | | import com.ruoyi.account.service.UserCouponService; |
| | | import com.ruoyi.account.service.UserSignRecordService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.model.*; |
| | | import com.ruoyi.account.dto.DangerInfoDto; |
| | | import com.ruoyi.account.service.*; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.feignClient.RemoteOrderGoodsClient; |
| | | import com.ruoyi.order.model.Order; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.api.feignClient.ShopClient; |
| | | import com.ruoyi.other.api.feignClient.StoreClient; |
| | | import com.ruoyi.other.api.feignClient.VipSettingClient; |
| | | import io.swagger.annotations.*; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDate; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.account.vo.*; |
| | |
| | | |
| | | @Resource |
| | | private UserSignRecordService userSignRecordService; |
| | | @Resource |
| | | private VipSettingClient vipSettingClient; |
| | | @Resource |
| | | private UserPointService userPointService; |
| | | @Resource |
| | | private VipSettingService vipSettingService; |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | public R<Void> editAppUserById(@RequestBody AppUser appUser) { |
| | | appUserService.updateById(appUser); |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/getTopUsers") |
| | | public R<List<AppUser>> getTopUsers(@RequestBody AppUser appUser) { |
| | | List<Integer> vipIds = new ArrayList<>(); |
| | | vipIds.add(5); |
| | | vipIds.add(6); |
| | | vipIds.add(7); |
| | | List<AppUser> list = appUserService.lambdaQuery().in(AppUser::getVipId, vipIds).list(); |
| | | return R.ok(list); |
| | | |
| | | } |
| | | |
| | |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户列表 |
| | | */ |
| | | @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); |
| | | } |
| | | |
| | | @GetMapping("/danger/info") |
| | | @ApiOperation(value = "用户列表-保级条件详情", tags = {"管理后台"}) |
| | | public R<DangerInfoDto> dangerinfo(Long id) |
| | | { |
| | | AppUser byId = appUserService.getById(id); |
| | | LocalDate now = LocalDate.now(); |
| | | R<VipSetting> vipSetting = vipSettingClient.getVipSetting(byId.getVipId()); |
| | | VipSetting data = vipSetting.getData(); |
| | | DangerInfoDto dangerInfoDto = new DangerInfoDto(); |
| | | BeanUtils.copyProperties(data,dangerInfoDto); |
| | | List<UserPoint> list1 = userPointService.lambdaQuery().eq(UserPoint::getType,1).ge(UserPoint::getCreateTime, now.minusDays(data.getKeepBuyDay())).list(); |
| | | List<UserPoint> list2 = userPointService.lambdaQuery().eq(UserPoint::getType,2).ge(UserPoint::getCreateTime, now.minusDays(data.getKeepBuyDay())).list(); |
| | | List<UserPoint> list3 = userPointService.lambdaQuery().eq(UserPoint::getType,5).ge(UserPoint::getCreateTime, now.minusDays(data.getKeepBuyDay())).list(); |
| | | Integer userKeepBuyPoint = 0; |
| | | for (UserPoint userPoint : list1) { |
| | | userKeepBuyPoint = userPoint.getVariablePoint()+userKeepBuyPoint; |
| | | } |
| | | Integer userKeepSharePoint = 0; |
| | | for (UserPoint userPoint : list2) { |
| | | userKeepSharePoint = userPoint.getVariablePoint()+userKeepSharePoint; |
| | | } |
| | | Integer userKeepShopPoint = 0; |
| | | for (UserPoint userPoint : list3) { |
| | | userKeepShopPoint = userPoint.getVariablePoint()+userKeepShopPoint; |
| | | } |
| | | dangerInfoDto.setUserKeepBuyPoint(userKeepBuyPoint); |
| | | dangerInfoDto.setUserKeepSharePoint(userKeepSharePoint); |
| | | dangerInfoDto.setUserKeepShopPoint(userKeepShopPoint); |
| | | return R.ok(dangerInfoDto); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/danger/down") |
| | | @ApiOperation(value = "用户列表-保级条件降级", tags = {"管理后台"}) |
| | | public R down(Long id) |
| | | { |
| | | AppUser byId = appUserService.getById(id); |
| | | byId.setVipId(byId.getVipId()-1); |
| | | appUserService.updateById(byId); |
| | | //执行降级标记代码 |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | { |
| | | vipSettingService.downUsers(); |
| | | } |
| | | } |
| | | } |
| | | ).start(); |
| | | return R.ok(); |
| | | } |
| | | @GetMapping("/frozen") |
| | | @ApiOperation(value = "用户列表-冻结解冻", tags = {"管理后台"}) |
| | | public R frozen(Long id,@ApiParam("1=正常,2=冻结")Integer status) |
| | | { |
| | | AppUser byId = appUserService.getById(id); |
| | | byId.setStatus(status); |
| | | appUserService.updateById(byId); |
| | | return R.ok(); |
| | | } |
| | | @Resource |
| | | private ShopClient shopClient; |
| | | @Resource |
| | | private RemoteOrderGoodsClient remoteOrderGoodsClient; |
| | | |
| | | @GetMapping("/detail") |
| | | @ApiOperation(value = "用户列表-详情", tags = {"管理后台"}) |
| | | public R<AppUser> detail(Long id) |
| | | { |
| | | AppUser byId = appUserService.getById(id); |
| | | if (byId.getShopId()!=null) { |
| | | R<Shop> shopById = shopClient.getShopById(Integer.parseInt(String.valueOf(byId.getShopId()))); |
| | | if (shopById.getData()!=null) { |
| | | byId.setShopName(shopById.getData().getName()); |
| | | } |
| | | } |
| | | R<List<Shop>> shopByUserId = shopClient.getShopByUserId(id); |
| | | if (shopByUserId.getData()!=null) { |
| | | List<String> shopName = new ArrayList<>(); |
| | | for (Shop datum : shopByUserId.getData()) { |
| | | shopName.add(datum.getName()); |
| | | } |
| | | byId.setShopNames(shopName); |
| | | } |
| | | //推广人 |
| | | if (byId.getInviteUserId()!=null) { |
| | | AppUser byId1 = appUserService.getById(byId.getInviteUserId()); |
| | | byId1.setInviteUserName(byId1.getInviteUserName()); |
| | | } |
| | | //最后下单时间 |
| | | R<Order> lastOrder = remoteOrderGoodsClient.getLastOrder(id); |
| | | if (lastOrder.getData()!=null){ |
| | | byId.setLastOrderTime(lastOrder.getData().getCreateTime()); |
| | | } |
| | | return R.ok(byId); |
| | | } |
| | | @GetMapping("/bottom") |
| | | @ApiOperation(value = "用户列表-绑定下级列表", tags = {"管理后台"}) |
| | | public R<Page<AppUser>> bottom(Long id,Integer pageNum,Integer pageSize) |
| | | { |
| | | //绑定下级 |
| | | Page<AppUser> page = appUserService.lambdaQuery().eq(AppUser::getInviteUserId, id).page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @GetMapping("/listByIds") |
| | | List<AppUser> listByIds(List<String> list){ |
| | | return appUserService.listByIds(list); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | @Resource |
| | | private AppUserShopService appUserShopService; |
| | | |
| | | @PostMapping("/addAppUserShop") |
| | | public R<Void> add(@RequestBody AppUserShop appUserShop) { |
| | | appUserShopService.save(appUserShop); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/shop/{userId}") |
| | | public R<List<AppUserShop>> getAppUserShop(@PathVariable("userId") Long userId) { |
| | | return R.ok(appUserShopService.list(new LambdaQueryWrapper<AppUserShop>() |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.account.api.model.AgentApplication; |
| | | import com.ruoyi.account.api.model.UserCancellationLog; |
| | | import com.ruoyi.account.dto.AgentQuery; |
| | | import com.ruoyi.account.dto.UserCancelQuery; |
| | | import com.ruoyi.account.service.UserCancellationLogService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/user-cancellation-log") |
| | | public class UserCancellationLogController { |
| | | @Resource |
| | | private UserCancellationLogService cancellationLogService; |
| | | @PostMapping("/page") |
| | | @ApiOperation(value = "注销记录列表", tags = {"后台"}) |
| | | public R<IPage<UserCancellationLog>> page(@RequestBody UserCancelQuery agentQuery) { |
| | | |
| | | return R.ok(cancellationLogService.pageList(agentQuery)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.account.api.model.AgentApplication; |
| | | import com.ruoyi.account.api.model.UserChangeLog; |
| | | import com.ruoyi.account.dto.UserChangeQuery; |
| | | import com.ruoyi.account.service.UserChangeLogService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/page") |
| | | public R<IPage<UserChangeLog>> page(@RequestBody UserChangeQuery userChangeLog){ |
| | | |
| | | return R.ok(userChangeLogService.pageList(userChangeLog)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | }else { |
| | | record.setStatus(2); |
| | | } |
| | | |
| | | |
| | | AppUser appUser = appUserService.getById(record.getAppUserId()); |
| | | record.setUserName(appUser.getName()); |
| | | record.setPhone(appUser.getPhone()); |
| | | } |
| | | return R.ok(page); |
| | | } |
| | |
| | | if (data==null){ |
| | | return R.fail("当前优惠券不存在,请刷新后重试"); |
| | | } |
| | | if (data.getSendType()!=1&&byId.getLavePoint().compareTo(data.getNeedPoint().intValue())==-1){ |
| | | if (data.getSendType()!=1&& byId.getLavePoint().compareTo(data.getNeedPoint().intValue()) < 0){ |
| | | return R.fail("当前积分不足,兑换失败"); |
| | | } |
| | | //检验发放时间 |
| | |
| | | UserCoupon userCoupon = new UserCoupon(); |
| | | userCoupon.setAppUserId(userid); |
| | | if (data.getPeriodType()==1) { |
| | | userCoupon.setStartTime(data.getPeriodStartTime()); |
| | | userCoupon.setEndTime(data.getPeriodEndTime()); |
| | | userCoupon.setStartTime(data.getPeriodStartTime().atTime(0,0,0)); |
| | | userCoupon.setEndTime(data.getPeriodEndTime().atTime(0,0,0)); |
| | | }else { |
| | | userCoupon.setStartTime(now); |
| | | userCoupon.setEndTime(now.plusDays(data.getPeriodDays())); |
| | |
| | | BeanUtils.copyProperties(data, couponInfoVo); |
| | | return R.ok(couponInfoVo); |
| | | } |
| | | |
| | | /** |
| | | * 获取优惠券发放数量 |
| | | */ |
| | | @GetMapping("/getCouponCount") |
| | | public R<Long> getCouponCount(@RequestParam Integer couponId){ |
| | | return R.ok(userCouponService.lambdaQuery().eq(UserCoupon::getCouponId, couponId).count()); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | 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.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.UserPoint; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.UserPointService; |
| | | import com.ruoyi.account.vo.UserPointDetailVO; |
| | | import com.ruoyi.account.vo.UserPointStatistics; |
| | | import com.ruoyi.account.vo.UserPointVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | |
| | | public class UserPointController extends BaseController { |
| | | @Resource |
| | | private UserPointService userPointService; |
| | | @Resource |
| | | private AppUserService appUserService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | |
| | | /** |
| | |
| | | userPointService.save(userPoint); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 积分统计 |
| | | */ |
| | | @GetMapping("/statistics") |
| | | @ApiOperation(value = "积分统计", tags = "管理后台-财务统计-用户积分统计") |
| | | public R<UserPointStatistics> statistics(UserPoint userPoint) { |
| | | return R.ok(userPointService.getStatistics(userPoint)); |
| | | } |
| | | |
| | | /** |
| | | * 变更记录 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "积分变更记录", tags = "管理后台-财务统计-用户积分统计") |
| | | public R<IPage<UserPoint>> list(@ApiParam("页码") @RequestParam Integer pageNum, @ApiParam("大小") Integer pageSize, UserPoint userPoint) { |
| | | IPage<UserPoint> userPointPage = userPointService.getUserPointPage(Page.of(pageNum, pageSize), userPoint); |
| | | return R.ok(userPointPage); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导出 |
| | | */ |
| | | @GetMapping("/export") |
| | | @ApiOperation(value = "积分变更记录导出", tags = "管理后台-财务统计-用户积分统计") |
| | | public void export(HttpServletResponse response, UserPoint userPoint) { |
| | | IPage<UserPoint> userPointPage = userPointService.getUserPointPage(Page.of(1, Integer.MAX_VALUE), userPoint); |
| | | List<UserPoint> userPointList = userPointPage.getRecords(); |
| | | ExcelUtil<UserPoint> util = new ExcelUtil<>(UserPoint.class); |
| | | util.exportExcel(response, userPointList, "用户积分统计"); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | 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.exception.ServiceException; |
| | | 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.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private VipCenterService vipCenterService; |
| | | @Resource |
| | | private VipGoodClient vipGoodClient; |
| | | @Resource |
| | | private GoodsClient goodsClient; |
| | | |
| | | |
| | | @GetMapping("getVipLevelList") |
| | |
| | | public R<VipLevel> vipLevelList() { |
| | | try { |
| | | R<List<VipSetting>> r = remoteVipSettingClient.list(); |
| | | if (checkSuccess(r)) { |
| | | if (R.isError(r)) { |
| | | return R.fail("会员等级获取失败"); |
| | | } |
| | | List<VipSetting> vipSettingList = r.getData(); |
| | |
| | | } |
| | | |
| | | R<BaseSetting> baseSettingR = baseSettingClient.getBaseSetting(3); |
| | | if (checkSuccess(baseSettingR)) { |
| | | if (R.isError(baseSettingR)) { |
| | | log.error("【会员设置说明】获取失败:{}", baseSettingR.getMsg()); |
| | | return R.fail("会员等级获取失败"); |
| | | } |
| | |
| | | |
| | | // 批量获取 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 -> { |
| | |
| | | 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)) { |
| | | if (R.isError(vipGoodR)) { |
| | | throw new ServiceException("会员商品获取失败"); |
| | | } |
| | | 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); |
| | | Integer goodId = vipGood.getGoodId(); |
| | | R<Goods> goodsR = goodsClient.getGoodsById(goodId); |
| | | if (R.isError(goodsR)) { |
| | | throw new ServiceException("商品信息获取失败"); |
| | | } |
| | | Goods goods = goodsR.getData(); |
| | | goodsNames.add(goods.getName()); |
| | | }); |
| | | level.setGoodsNames(goodsNames); |
| | | } |
| | | } |
| | | } |
| | | levelList.add(level); |
| | | }); |
| | |
| | | |
| | | |
| | | |
| | | 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) { |
| | |
| | | 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); |
| | | R<List<VipGood>> vipGoodR = vipGoodClient.getVipGoodsByVipId(vipId); |
| | | result.put(vipId, vipGoodR); |
| | | } |
| | | return result; |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class AgentQuery { |
| | | @ApiModelProperty("用户名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("会员等级") |
| | | private Integer vipId; |
| | | |
| | | @ApiModelProperty("1'待处理',2'已处理-同意',3'已处理-拒绝'") |
| | | private Integer status; |
| | | private Integer pageNum; |
| | | private Integer pageSize; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class DangerInfoDto { |
| | | @ApiModelProperty(value = "消费积分保级周期(天)") |
| | | @TableField("keep_buy_day") |
| | | private Integer keepBuyDay; |
| | | |
| | | @ApiModelProperty(value = "消费积分保级的积分阈值(分))") |
| | | @TableField("keep_buy_point") |
| | | private Integer keepBuyPoint; |
| | | |
| | | @ApiModelProperty(value = "当前消费积分") |
| | | private Integer userKeepBuyPoint; |
| | | |
| | | @ApiModelProperty(value = "返佣积分保的周期(天)") |
| | | @TableField("keep_share_day") |
| | | private Integer keepShareDay; |
| | | |
| | | @ApiModelProperty(value = "返佣积分保级的积分阈值(分)") |
| | | @TableField("keep_share_point") |
| | | private Integer keepSharePoint; |
| | | |
| | | @ApiModelProperty(value = "当前返佣积分") |
| | | @TableField("keep_share_point") |
| | | private Integer userKeepSharePoint; |
| | | |
| | | @ApiModelProperty(value = "门店业绩积分保级的周期(天)") |
| | | @TableField("keep_shop_day") |
| | | private Integer keepShopDay; |
| | | |
| | | @ApiModelProperty(value = "门店业绩积分保级的积分阈值(分)") |
| | | @TableField("keep_shop_point") |
| | | private Integer keepShopPoint; |
| | | |
| | | @ApiModelProperty(value = "当前门店业绩积分") |
| | | private Integer userKeepShopPoint; |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | public class UserCancelQuery { |
| | | @ApiModelProperty("用户名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("电话") |
| | | private String phone; |
| | | |
| | | private Integer vipId; |
| | | |
| | | private LocalDate localDate1; |
| | | private LocalDate localDate2; |
| | | private Integer pageNum; |
| | | private Integer pageSize; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | public class UserChangeQuery { |
| | | @ApiModelProperty("用户名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "变更类型 0降级1升级") |
| | | @TableField("change_type") |
| | | private Integer changeType; |
| | | |
| | | private LocalDate localDate1; |
| | | private LocalDate localDate2; |
| | | private Integer pageNum; |
| | | private Integer pageSize; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.account.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.model.AgentApplication; |
| | | import com.ruoyi.account.dto.AgentQuery; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface AgentApplicationMapper extends BaseMapper<AgentApplication> { |
| | | |
| | | IPage<AgentApplication> pageList(@Param("page") Page<Shop> page, @Param("agentQuery") AgentQuery agentQuery); |
| | | } |
| | |
| | | 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; |
| | |
| | | */ |
| | | 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.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.model.UserCancellationLog; |
| | | import com.ruoyi.account.dto.UserCancelQuery; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface UserCancellationLogMapper extends BaseMapper<UserCancellationLog> { |
| | | |
| | | IPage<UserCancellationLog> pageList(@Param("page")Page<Shop> page, @Param("agentQuery")UserCancelQuery agentQuery); |
| | | } |
| | |
| | | package com.ruoyi.account.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.model.UserChangeLog; |
| | | import com.ruoyi.account.dto.UserChangeQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-11-21 |
| | | */ |
| | | public interface UserChangeLogMapper extends BaseMapper<UserChangeLog> { |
| | | |
| | | IPage<UserChangeLog> pageList(@Param("page")Page<UserChangeLog> page, @Param("userChangeLog")UserChangeQuery userChangeLog); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.account.api.model.UserPoint; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | |
| | | */ |
| | | public interface UserPointMapper extends BaseMapper<UserPoint> { |
| | | |
| | | List<UserPoint> findLatestUserPointByTypeForUser(Long userId); |
| | | |
| | | List<UserPoint> findLatestChangeByType(UserPoint userPoint); |
| | | |
| | | } |
| | |
| | | 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.AgentApplication; |
| | | import com.ruoyi.account.dto.AgentQuery; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | void apply(AgentApplication agentApplication); |
| | | |
| | | IPage<AgentApplication> pageList(AgentQuery agentQuery); |
| | | } |
| | |
| | | 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); |
| | | } |
| | |
| | | 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.UserCancellationLog; |
| | | import com.ruoyi.account.dto.UserCancelQuery; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface UserCancellationLogService extends IService<UserCancellationLog> { |
| | | |
| | | IPage<UserCancellationLog> pageList(UserCancelQuery agentQuery); |
| | | } |
| | |
| | | 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.AgentApplication; |
| | | import com.ruoyi.account.api.model.UserChangeLog; |
| | | import com.ruoyi.account.dto.UserChangeQuery; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface UserChangeLogService extends IService<UserChangeLog> { |
| | | |
| | | IPage<UserChangeLog> pageList(UserChangeQuery userChangeLog); |
| | | } |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | 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.IService; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.UserPoint; |
| | | import com.ruoyi.account.vo.UserPointDetailVO; |
| | | import com.ruoyi.account.vo.UserPointStatistics; |
| | | import com.ruoyi.account.vo.UserPointVO; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | |
| | | List<UserPointDetailVO> getUserPointDetail(Long userId, LocalDateTime startTime, LocalDateTime endTime, Integer type); |
| | | |
| | | void transferPoint(BigDecimal point, String phone); |
| | | |
| | | UserPointStatistics getStatistics(UserPoint userPoint); |
| | | |
| | | |
| | | IPage<UserPoint> getUserPointPage(Page<UserPoint> page, UserPoint userPoint); |
| | | } |
| | |
| | | VipSetting getVipSettingById(Integer id); |
| | | |
| | | VipSetting getVipSettingByUserId(Long appUserId); |
| | | |
| | | void downUsers(); |
| | | } |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | 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.AgentApplication; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.dto.AgentQuery; |
| | | import com.ruoyi.account.mapper.AgentApplicationMapper; |
| | | import com.ruoyi.account.service.AgentApplicationService; |
| | | import com.ruoyi.account.service.AppUserService; |
| | |
| | | agentApplication.setBindShopNum(shopList.size()); |
| | | agentApplicationMapper.insert(agentApplication); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<AgentApplication> pageList(AgentQuery agentQuery) { |
| | | Page<Shop> page = new Page<>(); |
| | | page.setCurrent(agentQuery.getPageNum()); |
| | | page.setSize(agentQuery.getPageSize()); |
| | | IPage<AgentApplication> shopIPage = agentApplicationMapper.pageList(page, agentQuery); |
| | | return shopIPage; |
| | | } |
| | | } |
| | |
| | | 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; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | 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.AgentApplication; |
| | | import com.ruoyi.account.dto.UserCancelQuery; |
| | | import com.ruoyi.account.mapper.UserCancellationLogMapper; |
| | | import com.ruoyi.account.api.model.UserCancellationLog; |
| | | import com.ruoyi.account.service.UserCancellationLogService; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | @Service |
| | | public class UserCancellationLogServiceImpl extends ServiceImpl<UserCancellationLogMapper, UserCancellationLog> implements UserCancellationLogService { |
| | | |
| | | @Override |
| | | public IPage<UserCancellationLog> pageList(UserCancelQuery agentQuery) { |
| | | Page<Shop> page = new Page<>(); |
| | | page.setCurrent(agentQuery.getPageNum()); |
| | | page.setSize(agentQuery.getPageSize()); |
| | | IPage<UserCancellationLog> shopIPage = this.baseMapper.pageList(page, agentQuery); |
| | | return shopIPage; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | 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.AgentApplication; |
| | | import com.ruoyi.account.dto.UserChangeQuery; |
| | | import com.ruoyi.account.mapper.UserChangeLogMapper; |
| | | import com.ruoyi.account.api.model.UserChangeLog; |
| | | import com.ruoyi.account.service.UserChangeLogService; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | @Service |
| | | public class UserChangeLogServiceImpl extends ServiceImpl<UserChangeLogMapper, UserChangeLog> implements UserChangeLogService { |
| | | |
| | | @Override |
| | | public IPage<UserChangeLog> pageList(UserChangeQuery userChangeLog) { |
| | | Page<UserChangeLog> page = new Page<>(); |
| | | page.setCurrent(userChangeLog.getPageNum()); |
| | | page.setSize(userChangeLog.getPageSize()); |
| | | IPage<UserChangeLog> shopIPage = this.baseMapper.pageList(page, userChangeLog); |
| | | return shopIPage; |
| | | } |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | 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.AppUser; |
| | | import com.ruoyi.account.api.model.UserPoint; |
| | |
| | | import com.ruoyi.account.service.UserPointService; |
| | | import com.ruoyi.account.service.VipSettingService; |
| | | import com.ruoyi.account.vo.UserPointDetailVO; |
| | | import com.ruoyi.account.vo.UserPointStatistics; |
| | | import com.ruoyi.account.vo.UserPointVO; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.PhoneNumberValidator; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.PointSetting; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private VipSettingService vipSettingService; |
| | | @Resource |
| | | private PointSettingService pointSettingService; |
| | | @Resource |
| | | private UserPointMapper userPointMapper; |
| | | |
| | | @Override |
| | | public UserPointVO getUserPoint(Long userId) { |
| | | AppUser appUser = appUserService.getById(userId); |
| | | List<UserPoint> userPointList = list(new LambdaQueryWrapper<UserPoint>() |
| | | .eq(UserPoint::getAppUserId, userId)); |
| | | |
| | | List<UserPoint> userPointList = this.baseMapper.findLatestUserPointByTypeForUser(userId); |
| | | Map<Integer, Integer> userBalanceMap = userPointList.stream() |
| | | .collect(Collectors.toMap(UserPoint::getType, UserPoint::getBalance)); |
| | | VipSetting vipSetting = vipSettingService.getVipSettingByUserId(userId); |
| | | |
| | | Integer lavePoint = appUser.getLavePoint(); |
| | | UserPointVO userPointVO = new UserPointVO(); |
| | | userPointVO.setTotalPoint(lavePoint); |
| | | // userPointVO.setConsumePoint(lavePoint); |
| | | userPointVO.setShopPoint(userBalanceMap.get(PointChangeType.CONSUME.getCode())); |
| | | userPointVO.setSharePoint(userBalanceMap.get(PointChangeType.COMMISSION_RETURN.getCode())); |
| | | userPointVO.setTotalPoint(appUser.getTotalPoint()); |
| | | userPointVO.setConsumePoint(appUser.getLavePoint()); |
| | | userPointVO.setShopPoint(appUser.getShopPoint()); |
| | | userPointVO.setSharePoint(appUser.getSharePoint()); |
| | | userPointVO.setPullNewPoint(userBalanceMap.get(PointChangeType.NEW_USER_REFERRAL.getCode())); |
| | | userPointVO.setShopAchievementPoint(userBalanceMap.get(PointChangeType.STORE_PERFORMANCE.getCode())); |
| | | userPointVO.setShopSharePoint(userBalanceMap.get(PointChangeType.STORE_COMMISSION_RETURN.getCode())); |
| | | userPointVO.setGiftPoint(vipSetting.getVipGiftRole()); |
| | | userPointVO.setGiftPoint(vipSetting.getVipGiftRole() == 1 && vipSetting.getId() == 1 ? 1 : 0); |
| | | return userPointVO; |
| | | } |
| | | |
| | |
| | | if (vipSetting == null) { |
| | | throw new ServiceException("VIP 设置未找到"); |
| | | } |
| | | if (vipSetting.getVipGiftRole() == 0) { |
| | | if (vipSetting.getId() == 0 && vipSetting.getVipGiftRole() == 0) { |
| | | throw new ServiceException("转赠积分权限未开启"); |
| | | } |
| | | |
| | |
| | | } |
| | | Integer buyPointOpen = pointSetting.getBuyPointOpen(); |
| | | |
| | | List<UserPoint> userPointList = list(new LambdaQueryWrapper<UserPoint>() |
| | | .eq(UserPoint::getAppUserId, userid)); |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setAppUserId(userid); |
| | | List<UserPoint> userPointList = userPointMapper.findLatestChangeByType(userPoint); |
| | | Map<Integer, Integer> userBalanceMap = userPointList.stream() |
| | | .collect(Collectors.toMap(UserPoint::getType, UserPoint::getBalance)); |
| | | |
| | |
| | | private int getAdjustedPoint(Map<Integer, Integer> userBalanceMap, int pointTypeCode, boolean isOpen) { |
| | | return isOpen ? 0 : Optional.ofNullable(userBalanceMap.get(pointTypeCode)).orElse(0); |
| | | } |
| | | |
| | | @Override |
| | | public UserPointStatistics getStatistics(UserPoint userPoint) { |
| | | |
| | | if (StringUtils.isNotEmpty(userPoint.getUserName()) || StringUtils.isNotEmpty(userPoint.getPhone())) { |
| | | List<Long> userIds = appUserService.listObjs(new LambdaQueryWrapper<AppUser>() |
| | | .select(AppUser::getId) |
| | | .like(StringUtils.isNotEmpty(userPoint.getUserName()),AppUser::getName, userPoint.getUserName()) |
| | | .like(StringUtils.isNotEmpty(userPoint.getPhone()),AppUser::getPhone, userPoint.getPhone())) |
| | | .stream() |
| | | .map(appUserId -> (Long) appUserId) |
| | | .collect(Collectors.toList()); |
| | | userPoint.setUserIds(userIds); |
| | | } |
| | | |
| | | List<UserPoint> userPointList = userPointMapper.findLatestChangeByType(userPoint); |
| | | Map<Integer, Integer> userBalanceMap = userPointList.stream() |
| | | .collect(Collectors.toMap(UserPoint::getType, UserPoint::getBalance)); |
| | | |
| | | |
| | | Integer consumePoint = Optional.ofNullable(userBalanceMap.get(PointChangeType.CONSUME.getCode())).orElse(0); |
| | | Integer sharePoint = Optional.ofNullable(userBalanceMap.get(PointChangeType.COMMISSION_RETURN.getCode())).orElse(0); |
| | | Integer pullNewPoint = Optional.ofNullable(userBalanceMap.get(PointChangeType.NEW_USER_REFERRAL.getCode())).orElse(0); |
| | | Integer registerPoint = Optional.ofNullable(userBalanceMap.get(PointChangeType.REGISTRATION.getCode())).orElse(0); |
| | | Integer workPoint = Optional.ofNullable(userBalanceMap.get(PointChangeType.WORK_PERFORMANCE.getCode())).orElse(0); |
| | | Integer shopAchievementPoint = Optional.ofNullable(userBalanceMap.get(PointChangeType.TECHNICIAN_PERFORMANCE.getCode())).orElse(0); |
| | | Integer exchangeGoodsPoint = Optional.ofNullable(userBalanceMap.get(PointChangeType.EXCHANGE_GOODS.getCode())).orElse(0); |
| | | Integer storeAchievementPoint = Optional.ofNullable(userBalanceMap.get(PointChangeType.STORE_PERFORMANCE.getCode())).orElse(0); |
| | | Integer storeCommissionPoint = Optional.ofNullable(userBalanceMap.get(PointChangeType.STORE_COMMISSION_RETURN.getCode())).orElse(0); |
| | | Integer transferPoint = Optional.ofNullable(userBalanceMap.get(PointChangeType.TRANSFER_POINTS.getCode())).orElse(0); |
| | | Integer totalPoint = consumePoint + sharePoint + pullNewPoint + registerPoint + workPoint + shopAchievementPoint + exchangeGoodsPoint + storeAchievementPoint + storeCommissionPoint + transferPoint; |
| | | |
| | | |
| | | UserPointStatistics userPointStatistics = new UserPointStatistics(); |
| | | userPointStatistics.setTotalPoint(totalPoint); |
| | | userPointStatistics.setConsumePoint(consumePoint); |
| | | userPointStatistics.setSharePoint(sharePoint); |
| | | userPointStatistics.setPullNewPoint(pullNewPoint); |
| | | userPointStatistics.setRegisterPoint(registerPoint); |
| | | userPointStatistics.setWorkPoint(workPoint); |
| | | userPointStatistics.setShopAchievementPoint(shopAchievementPoint); |
| | | return userPointStatistics; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<UserPoint> getUserPointPage(Page<UserPoint> page, UserPoint userPoint) { |
| | | List<AppUser> appUserList = appUserService.list(new LambdaQueryWrapper<AppUser>() |
| | | .eq(AppUser::getPhone, userPoint.getPhone()) |
| | | .like(AppUser::getName, userPoint.getUserName())); |
| | | List<Long> userIds = appUserList.stream().map(AppUser::getId).collect(Collectors.toList()); |
| | | |
| | | Page<UserPoint> userPointPage = page(page, new LambdaQueryWrapper<UserPoint>() |
| | | .in(!CollectionUtils.isEmpty(userIds), UserPoint::getAppUserId, userIds) |
| | | .eq(userPoint.getType() != null, UserPoint::getType, userPoint.getType()) |
| | | .between( userPoint.getStartTime()!= null && userPoint.getEndTime() !=null,UserPoint::getCreateTime, userPoint.getStartTime(), userPoint.getEndTime()) |
| | | .orderByDesc(UserPoint::getCreateTime)); |
| | | |
| | | userPointPage.getRecords().forEach(userPoint1 -> appUserList.stream() |
| | | .filter(appUser -> appUser.getId().equals(userPoint1.getAppUserId())) |
| | | .findFirst().ifPresent(appUser -> { |
| | | userPoint1.setUserName(appUser.getName()); |
| | | userPoint1.setPhone(appUser.getPhone()); |
| | | })); |
| | | return userPointPage; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.domain.VipGood; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.api.feignClient.GoodsClient; |
| | | import com.ruoyi.other.api.feignClient.ShopClient; |
| | | import com.ruoyi.other.api.feignClient.VipGoodClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | |
| | | private ShopClient shopClient; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private GoodsClient goodsClient; |
| | | |
| | | |
| | | @Override |
| | |
| | | List<VipGood> vipGoods = vipGoodsByVipId.getData(); |
| | | if (CollectionUtil.isNotEmpty(vipGoods)){ |
| | | for (VipGood vipGood : vipGoods) { |
| | | String goodJson = vipGood.getGoodJson(); |
| | | Goods goods = JSONObject.parseObject(goodJson, Goods.class); |
| | | Integer goodId = vipGood.getGoodId(); |
| | | R<Goods> goodsR = goodsClient.getGoodsById(goodId); |
| | | if (R.isError(goodsR)){ |
| | | throw new ServiceException("商品信息获取失败"); |
| | | } |
| | | Goods goods = goodsR.getData(); |
| | | R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, goods.getId()); |
| | | if (R.isSuccess(orderListByUserIdAndGoodsId)){ |
| | | List<Order> orderList = orderListByUserIdAndGoodsId.getData(); |
| | |
| | | List<VipGood> vipGoods = vipGoodsByVipId.getData(); |
| | | if (CollectionUtil.isNotEmpty(vipGoods)){ |
| | | for (VipGood vipGood : vipGoods) { |
| | | String goodJson = vipGood.getGoodJson(); |
| | | Goods goods = JSONObject.parseObject(goodJson, Goods.class); |
| | | R<Goods> goodsR = goodsClient.getGoodsById(vipGood.getGoodId()); |
| | | if (R.isError(goodsR)){ |
| | | throw new ServiceException("商品信息获取失败"); |
| | | } |
| | | |
| | | Goods goods = goodsR.getData(); |
| | | R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, goods.getId()); |
| | | if (R.isSuccess(orderListByUserIdAndGoodsId)){ |
| | | List<Order> orderList = orderListByUserIdAndGoodsId.getData(); |
| | |
| | | List<VipGood> vipGoods = vipGoodsByVipId.getData(); |
| | | if (CollectionUtil.isNotEmpty(vipGoods)){ |
| | | for (VipGood vipGood : vipGoods) { |
| | | String goodJson = vipGood.getGoodJson(); |
| | | Goods goods = JSONObject.parseObject(goodJson, Goods.class); |
| | | R<Goods> goodsR = goodsClient.getGoodsById(vipGood.getGoodId()); |
| | | if (R.isError(goodsR)){ |
| | | throw new ServiceException("商品信息获取失败"); |
| | | } |
| | | Goods goods = goodsR.getData(); |
| | | R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, goods.getId()); |
| | | if (R.isSuccess(orderListByUserIdAndGoodsId)){ |
| | | List<Order> orderList = orderListByUserIdAndGoodsId.getData(); |
| | |
| | | |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.UserPoint; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.UserPointService; |
| | | import com.ruoyi.account.service.VipSettingService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.api.feignClient.RemoteVipSettingClient; |
| | | import com.ruoyi.other.api.feignClient.VipSettingClient; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDate; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class VipSettingServiceImpl implements VipSettingService { |
| | |
| | | private RemoteVipSettingClient remoteVipSettingClient; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | @Resource |
| | | private AppUserService appUserService; |
| | | @Resource |
| | | private VipSettingClient vipSettingClient; |
| | | @Resource |
| | | private UserPointService userPointService; |
| | | @Autowired |
| | | private PointSettingServiceImpl pointSettingServiceImpl; |
| | | |
| | | |
| | | @Override |
| | |
| | | } |
| | | return getVipSettingById(appUser.getVipId()); |
| | | } |
| | | |
| | | @Override |
| | | public void downUsers() { |
| | | //查出可能需要降级的人员 |
| | | List<Integer> vipIds = new ArrayList<>(); |
| | | vipIds.add(5); |
| | | vipIds.add(6); |
| | | vipIds.add(7); |
| | | List<AppUser> list = appUserService.lambdaQuery().in(AppUser::getVipId, vipIds).list(); |
| | | VipSetting vipSetting5 = vipSettingClient.getVipSetting(5).getData(); |
| | | VipSetting vipSetting6 = vipSettingClient.getVipSetting(6).getData(); |
| | | VipSetting vipSetting7 = vipSettingClient.getVipSetting(7).getData(); |
| | | LocalDate now = LocalDate.now(); |
| | | //循环判断是否要展示 |
| | | if (list.size()>0){ |
| | | for (AppUser appUser : list){ |
| | | boolean danger = false; |
| | | if (appUser.getVipId()==5){ |
| | | extracted(vipSetting5, now,danger); |
| | | } |
| | | if (appUser.getVipId()==6){ |
| | | extracted(vipSetting6, now,danger); |
| | | } |
| | | if (appUser.getVipId()==7){ |
| | | extracted(vipSetting7, now,danger); |
| | | } |
| | | if (danger){ |
| | | appUser.setIsDanger(1); |
| | | }else { |
| | | appUser.setIsDanger(0); |
| | | } |
| | | } |
| | | appUserService.updateBatchById(list); |
| | | } |
| | | } |
| | | |
| | | private void extracted(VipSetting vipSetting5, LocalDate now,boolean danger) { |
| | | |
| | | if (vipSetting5.getKeepBuyPoint()!=null){ |
| | | //如果消费不为空,查找对应天数的消费积分 |
| | | List<UserPoint> list1 = userPointService.lambdaQuery().eq(UserPoint::getType,1).ge(UserPoint::getCreateTime, now.minusDays(vipSetting5.getKeepBuyDay())).list(); |
| | | //如果消费积分小于保级积分,设置用户降级标志并将降级信息 |
| | | Integer point = 0; |
| | | for (UserPoint userPoint : list1) { |
| | | point = point+userPoint.getVariablePoint(); |
| | | } |
| | | if (point<= vipSetting5.getKeepBuyPoint()){ |
| | | danger = true; |
| | | } |
| | | } |
| | | if (vipSetting5.getKeepSharePoint()!=null){ |
| | | //如果消费不为空,查找对应天数的消费积分 |
| | | List<UserPoint> list1 = userPointService.lambdaQuery().eq(UserPoint::getType,2).ge(UserPoint::getCreateTime, now.minusDays(vipSetting5.getKeepBuyDay())).list(); |
| | | //如果消费积分小于保级积分,设置用户降级标志并将降级信息 |
| | | Integer point = 0; |
| | | for (UserPoint userPoint : list1) { |
| | | point = point+userPoint.getVariablePoint(); |
| | | } |
| | | if (point<= vipSetting5.getKeepBuyPoint()){ |
| | | danger = true; |
| | | } |
| | | } |
| | | if (vipSetting5.getKeepShopPoint()!=null){ |
| | | //如果消费不为空,查找对应天数的消费积分 |
| | | List<UserPoint> list1 = userPointService.lambdaQuery().eq(UserPoint::getType,5).ge(UserPoint::getCreateTime, now.minusDays(vipSetting5.getKeepBuyDay())).list(); |
| | | //如果消费积分小于保级积分,设置用户降级标志并将降级信息 |
| | | Integer point = 0; |
| | | for (UserPoint userPoint : list1) { |
| | | point = point+userPoint.getVariablePoint(); |
| | | } |
| | | if (point<= vipSetting5.getKeepBuyPoint()){ |
| | | danger = true; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.VipSettingService; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private AppUserService appUserService; |
| | | @Resource |
| | | private VipSettingService vipSettingService; |
| | | |
| | | |
| | | |
| | |
| | | appUserService.unbindThePromoter(); |
| | | } |
| | | |
| | | /** |
| | | * 每天的凌晨执行的任务 |
| | | */ |
| | | @Scheduled(cron = "0 0 0 * * *") |
| | | public void taskDay(){ |
| | | try { |
| | | |
| | | |
| | | vipSettingService.downUsers(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.account.vo; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @Api("积分统计") |
| | | public class UserPointStatistics { |
| | | |
| | | @ApiModelProperty(value = "总积分") |
| | | private Integer totalPoint; |
| | | |
| | | @ApiModelProperty(value = "消费积分总数") |
| | | private Integer consumePoint; |
| | | |
| | | @ApiModelProperty(value = "返佣积分总数") |
| | | private Integer sharePoint; |
| | | |
| | | @ApiModelProperty(value = "拉新人积分总数") |
| | | private Integer pullNewPoint; |
| | | |
| | | @ApiModelProperty(value = "注册积分总数") |
| | | private Integer registerPoint; |
| | | |
| | | @ApiModelProperty(value = "做工积分总数") |
| | | private Integer workPoint; |
| | | |
| | | @ApiModelProperty(value = "技师业绩积分总数") |
| | | private Integer shopAchievementPoint; |
| | | |
| | | } |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, application_vip_id, application_time, status, shop_point, share_point, direct_vip_num, direct_agent_num, bind_shop_num, remark, del_flag, create_time |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.account.api.model.AgentApplication"> |
| | | select t1.*,t2.name as userName,t2.phone as userPhone |
| | | from t_agent_application t1 |
| | | left join t_app_user t2 on t1.app_user_id = t2.id |
| | | <where> |
| | | <if test="agentQuery.name !=null and agentQuery.name !=''"> |
| | | and t2.name like concat('%',#{agentQuery.name},'%') |
| | | </if> |
| | | <if test="agentQuery.phone !=null and agentQuery.phone !=''"> |
| | | and t2.phone like concat('%',#{agentQuery.phone},'%') |
| | | </if> |
| | | <if test="agentQuery.vipId !=null"> |
| | | and t1.applicationVipId = #{agentQuery.vipId} |
| | | </if> |
| | | <if test="agentQuery.status !=null"> |
| | | and t1.status = #{agentQuery.status} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </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.status"> |
| | | and ta.status = #{appUser.status} |
| | | </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> |
| | | order by ta.is_danger desc |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, del_flag, create_time, app_user_id, vip_id |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.account.api.model.UserCancellationLog"> |
| | | select t1.*,t2.name as userName,t2.phone as userPhone |
| | | from t_user_cancellation_log t1 |
| | | left join t_app_user t2 on t1.app_user_id = t2.id |
| | | <where> |
| | | <if test="agentQuery.name != null and agentQuery.name != ''"> |
| | | and t2.name like concat('%',#{agentQuery.name},'%') |
| | | </if> |
| | | <if test="agentQuery.phone != null and agentQuery.phone != ''"> |
| | | and t2.phone like concat('%',#{agentQuery.phone},'%') |
| | | </if> |
| | | <if test="agentQuery.vipId != null"> |
| | | and t1.vip_id = #{agentQuery.vipId} |
| | | </if> |
| | | <if test="agentQuery.localDate1 != null"> |
| | | and DATE(t1.create_time) between #{agentQuery.localDate1} and #{agentQuery.localDate2} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, del_flag, create_time, app_user_id, before_vip_id, after_vip_id, change_type |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.account.api.model.UserChangeLog"> |
| | | SELECT t1.*,t2.`name` as userName,t2.phone as userPhone |
| | | from t_user_change_log t1 |
| | | LEFT JOIN t_app_user t2 on t1.app_user_id = t2.id |
| | | <where> |
| | | <if test="userChangeLog.name !=null and userChangeLog.name !=''"> |
| | | and t2.name like concat('%',#{userChangeLog.name},'%') |
| | | </if> |
| | | <if test="userChangeLog.phone !=null and userChangeLog.phone !=''"> |
| | | and t2.phone like concat('%',#{userChangeLog.phone},'%') |
| | | </if> |
| | | <if test="userChangeLog.changeType !=null"> |
| | | and t1.change_type = #{userChangeLog.phone.changeType} |
| | | </if> |
| | | <if test="userChangeLog.localDate1 !=null"> |
| | | and DATE(t1.create_time) between #{userChangeLog.localDate1} and #{userChangeLog.localDate2} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, type, historical_point, variable_point, create_time, app_user_id, object_id |
| | | </sql> |
| | | <select id="findLatestUserPointByTypeForUser" resultType="com.ruoyi.account.api.model.UserPoint"> |
| | | SELECT |
| | | t1.* |
| | | FROM |
| | | t_user_point t1 |
| | | INNER JOIN ( SELECT type, MAX( create_time ) AS max_create_time FROM t_user_point WHERE app_user_id = #{userId} GROUP BY type ) t2 ON t1.type = t2.type |
| | | AND t1.create_time = t2.max_create_time |
| | | WHERE |
| | | t1.app_user_id = #{userId} |
| | | </select> |
| | | <select id="findLatestChangeByType" resultType="com.ruoyi.account.api.model.UserPoint"> |
| | | SELECT |
| | | id, |
| | | type, |
| | | historical_point, |
| | | variable_point, |
| | | balance, |
| | | create_time, |
| | | app_user_id, |
| | | object_id |
| | | FROM ( |
| | | SELECT |
| | | id, |
| | | type, |
| | | historical_point, |
| | | variable_point, |
| | | balance, |
| | | create_time, |
| | | app_user_id, |
| | | object_id, |
| | | ROW_NUMBER() OVER (PARTITION BY type ORDER BY create_time DESC) AS rn |
| | | FROM |
| | | t_user_point |
| | | <where> |
| | | <if test="startTime != null and endTime != null"> |
| | | create_time BETWEEN #{startTime} AND #{endTime} |
| | | </if> |
| | | <if test="type != null"> |
| | | AND type = #{type} |
| | | </if> |
| | | <if test="userIds != null and userIds.size !=0"> |
| | | AND app_user_id IN |
| | | <foreach item="item" collection="userIds" separator="," open="(" close=")" index=""> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | ) AS subquery |
| | | WHERE |
| | | rn = 1 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigInteger; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | |
| | | /** |
| | | * 订单详情 |
| | | */ |
| | | @ApiOperation(value = "订单详情", tags = {"小程序-订单详情"}) |
| | | @ApiOperation(value = "订单详情", tags = {"小程序-个人中心-我的订单-订单详情"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | }) |
| | |
| | | /** |
| | | * 扫码校验 |
| | | */ |
| | | @ApiOperation(value = "扫码校验", tags = {"小程序-个人中心-门店管理-扫码核销校验"}) |
| | | @ApiOperation(value = "扫码校验", tags = {"小程序-个人中心-门店管理"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "分享id", name = "shareId", required = true, dataType = "int", paramType="query"), |
| | | }) |
| | |
| | | /** |
| | | * 订单核销 |
| | | */ |
| | | @ApiOperation(value = "订单核销", tags = {"小程序-个人中心-门店管理-扫码核销"}) |
| | | @ApiOperation(value = "订单核销", tags = {"小程序-个人中心-门店管理"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单号", name = "code", required = true, dataType = "String"), |
| | | }) |
| | |
| | | /** |
| | | * 取消订单 |
| | | */ |
| | | @ApiOperation(value = "取消订单", tags = {"小程序-个人中心-我的订单-取消订单"}) |
| | | @ApiOperation(value = "取消订单", tags = {"小程序-个人中心-我的订单"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | }) |
| | |
| | | /** |
| | | * 确认收货 |
| | | */ |
| | | @ApiOperation(value = "确认收货", tags = {"小程序-个人中心-我的订单-确认收货"}) |
| | | @ApiOperation(value = "确认收货", tags = {"小程序-个人中心-我的订单"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | }) |
| | |
| | | /** |
| | | * 更换收货地址 |
| | | */ |
| | | @ApiOperation(value = "更换收货地址", tags = {"小程序-个人中心-我的订单-更换收货地址"}) |
| | | @ApiOperation(value = "更换收货地址", tags = {"小程序-个人中心-我的订单"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | }) |
| | |
| | | /** |
| | | * 更新订单状态 |
| | | */ |
| | | @ApiOperation(value = "更新订单状态", tags = {"后台-订单管理-更新订单状态"}) |
| | | @ApiOperation(value = "更新订单状态", tags = {"后台-订单管理"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单对象", name = "order", required = true, dataType = "Order"), |
| | | }) |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/getLastOrder") |
| | | public R<Order> getLastOrder(@RequestParam("appUserId") Long appUserId){ |
| | | Order one = orderService.lambdaQuery().eq(Order::getAppUserId, appUserId).orderByDesc(Order::getCreateTime).last("limit 1").one(); |
| | | return R.ok(one); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getOrderPageList") |
| | |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | |
| | | private GoodsShopClient goodsShopClient; |
| | | @Resource |
| | | private ShopClient shopClient; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getGoodsPrice") |
| | | public R<Price> getGoodsPrice(Long appUserId, Integer goodsId, Integer shopId){ |
| | | AppUser appUser = appUserClient.getAppUserById(appUserId); |
| | | Price price = shoppingCartService.getPrice(appUser, goodsId, shopId); |
| | | return R.ok(price); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | 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> |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.model.ShoppingCart; |
| | | import com.ruoyi.order.vo.*; |
| | |
| | | * @return |
| | | */ |
| | | R shoppingCartPayment(ShoppingCartPayment shoppingCartPayment); |
| | | |
| | | Price getPrice(AppUser appUser, Integer goodsId, Integer shopId); |
| | | } |
| | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.enums.OrderStatus; |
| | | import com.ruoyi.order.enums.OrderType; |
| | | import com.ruoyi.order.mapper.OrderGoodMapper; |
| | | import com.ruoyi.order.mapper.OrderMapper; |
| | | import com.ruoyi.order.model.Order; |
| | |
| | | import com.ruoyi.other.api.vo.GetGoodsBargainPrice; |
| | | import com.ruoyi.other.api.vo.GetGoodsShopByGoodsIds; |
| | | import com.ruoyi.other.api.vo.GetSeckillActivityInfo; |
| | | import lombok.Data; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | import java.math.RoundingMode; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | @Resource |
| | | private UserChangeLogClient userChangeLogClient; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private PointSettingClient pointSettingClient; |
| | | |
| | |
| | | GetGoodsBargainPrice goodsBargainPrice = new GetGoodsBargainPrice(); |
| | | goodsBargainPrice.setGoodsId(goodsId); |
| | | goodsBargainPrice.setVip(appUser.getVipId()); |
| | | GoodsBargainPriceDetail bargainPriceDetail = null; |
| | | if (shopId != null){ |
| | | goodsBargainPrice.setShopId(shopId); |
| | | GoodsBargainPriceDetail bargainPriceDetail = goodsBargainPriceClient.getGoodsBargainPrice(goodsBargainPrice).getData(); |
| | | bargainPriceDetail = goodsBargainPriceClient.getGoodsBargainPrice(goodsBargainPrice).getData(); |
| | | } |
| | | if(null == bargainPriceDetail){ |
| | | //没有门店特价,判断地区价格配置 |
| | | GoodsArea area = new GoodsArea(); |
| | |
| | | }else{ |
| | | price.setCash(goodsVip.getSellingPrice()); |
| | | price.setPoint(goodsVip.getIntegral()); |
| | | price.setCashPayment(goodsVip.getCashPayment() == 1 ? true : false); |
| | | price.setPointPayment(goodsVip.getPointPayment() == 1 ? true : false); |
| | | price.setCashPayment(goodsVip.getCashPayment() == 1); |
| | | price.setPointPayment(goodsVip.getPointPayment() == 1); |
| | | price.setEarnSpendingPoints(goodsVip.getEarnSpendingPoints()); |
| | | price.setSuperiorSubcommission(goodsVip.getSuperiorSubcommission()); |
| | | price.setSuperiorRebatePoints(goodsVip.getSuperiorRebatePoints()); |
| | |
| | | }else{ |
| | | price.setCash(goodsArea.getSellingPrice()); |
| | | price.setPoint(goodsArea.getIntegral()); |
| | | price.setCashPayment(goodsArea.getCashPayment() == 1 ? true : false); |
| | | price.setPointPayment(goodsArea.getPointPayment() == 1 ? true : false); |
| | | price.setCashPayment(goodsArea.getCashPayment() == 1); |
| | | price.setPointPayment(goodsArea.getPointPayment() == 1); |
| | | price.setEarnSpendingPoints(goodsArea.getEarnSpendingPoints()); |
| | | price.setSuperiorSubcommission(goodsArea.getSuperiorSubcommission()); |
| | | price.setSuperiorRebatePoints(goodsArea.getSuperiorRebatePoints()); |
| | |
| | | }else{ |
| | | price.setCash(bargainPriceDetail.getSellingPrice()); |
| | | price.setPoint(bargainPriceDetail.getIntegral()); |
| | | price.setCashPayment(bargainPriceDetail.getSellingPrice() != null ? true : false); |
| | | price.setPointPayment(bargainPriceDetail.getIntegral() != null ? true : false); |
| | | price.setCashPayment(bargainPriceDetail.getSellingPrice() != null); |
| | | price.setPointPayment(bargainPriceDetail.getIntegral() != null); |
| | | //门店特价,消费积分使用会员等级的消费积分 |
| | | GoodsArea area = new GoodsArea(); |
| | | area.setDistrictsCode(appUser.getDistrictCode()); |
| | |
| | | if(goodsSeckill.getCashPayment() == 0 && goodsSeckill.getPointPayment() == 1){ |
| | | price.setPoint(goodsSeckill.getIntegral()); |
| | | } |
| | | price.setCashPayment(goodsSeckill.getCashPayment() == 1 ? true : false); |
| | | price.setPointPayment(goodsSeckill.getPointPayment() == 1 ? true : false); |
| | | price.setCashPayment(goodsSeckill.getCashPayment() == 1); |
| | | price.setPointPayment(goodsSeckill.getPointPayment() == 1); |
| | | price.setEndTime(goodsSeckill.getEndTime()); |
| | | price.setEarnSpendingPoints(goodsSeckill.getEarnSpendingPoints()); |
| | | price.setSuperiorSubcommission(goodsSeckill.getSuperiorSubcommission()); |
| | |
| | | } |
| | | |
| | | |
| | | @Data |
| | | class Price { |
| | | /** |
| | | * 现金 |
| | | */ |
| | | private BigDecimal cash; |
| | | /** |
| | | * 积分 |
| | | */ |
| | | private Integer point; |
| | | /** |
| | | * 获取结束时间 |
| | | */ |
| | | private Long endTime; |
| | | /** |
| | | * 现金支付 |
| | | */ |
| | | private Boolean cashPayment; |
| | | /** |
| | | * 积分支付 |
| | | */ |
| | | private Boolean pointPayment; |
| | | /** |
| | | * 可获得消费积分 |
| | | */ |
| | | private Integer earnSpendingPoints; |
| | | /** |
| | | * 上级获得分佣金额 |
| | | */ |
| | | private BigDecimal superiorSubcommission; |
| | | /** |
| | | * 上级获得返佣积分 |
| | | */ |
| | | private Integer superiorRebatePoints; |
| | | /** |
| | | * 获取返佣积分上级类型(1=直推上级,2=直帮上级) |
| | | */ |
| | | private Integer superiorType; |
| | | /** |
| | | * 核销门店可获得服务费 |
| | | */ |
| | | private BigDecimal servuceShopCharges; |
| | | /** |
| | | * 核销门店可获得服务积分 |
| | | */ |
| | | private Integer servuceShopPoints; |
| | | /** |
| | | * 技师可获得服务积分 |
| | | */ |
| | | private Integer technicianPoints; |
| | | /** |
| | | * 绑定门店可获得分佣金额 |
| | | */ |
| | | private BigDecimal boundShopCharges; |
| | | /** |
| | | * 绑定门店可获得返佣积分 |
| | | */ |
| | | private Integer boundShopPoints; |
| | | /** |
| | | * 绑定门店上级门店可获得分佣金额 |
| | | */ |
| | | private BigDecimal boundShopSuperiorsCharges; |
| | | /** |
| | | * 绑定门店上级门店可获得返佣积分 |
| | | */ |
| | | private Integer boundShopSuperiorsPoints; |
| | | } |
| | | |
| | | |
| | | @Override |
| | |
| | | //使用商品的基础价格 |
| | | price.setCash(1 == goods.getCashPayment() ? goods.getSellingPrice() : null); |
| | | price.setPoint(1 == goods.getPointPayment() ? goods.getIntegral() : null); |
| | | price.setCashPayment(goods.getCashPayment() == 1 ? true : false); |
| | | price.setPointPayment(goods.getPointPayment() == 1 ? true : false); |
| | | price.setCashPayment(goods.getCashPayment() == 1); |
| | | price.setPointPayment(goods.getPointPayment() == 1); |
| | | } |
| | | vo.setCash(price.getCash()); |
| | | vo.setPoint(price.getPoint()); |
| | |
| | | goodsShop.setGoodsId(shoppingCart.getGoodsId()); |
| | | goodsShop.setShopId(shopId); |
| | | GoodsShop goodsShop1 = goodsShopClient.getGoodsShop(goodsShop).getData(); |
| | | vo.setVerifiable(goods.getAppointStore() == 1 && null == goodsShop1 ? false : true); |
| | | vo.setVerifiable(goods.getAppointStore() != 1 || null != goodsShop1); |
| | | //判断当前数量是否已经超出限购数量(需要计算已经购买的数量) |
| | | if(null == goods.getPurchaseLimit() || -1 == goods.getPurchaseLimit()){ |
| | | vo.setPurchaseLimit(false); |
| | |
| | | List<Order> orders = orderService.list(new LambdaQueryWrapper<Order>().eq(Order::getAppUserId, appUser.getId()).eq(Order::getDelFlag, 0).in(Order::getOrderStatus, Arrays.asList(4, 8))); |
| | | List<Long> orderIds = orders.stream().map(Order::getId).collect(Collectors.toList()); |
| | | int sum = 0; |
| | | if(orderIds.size() > 0){ |
| | | if(!orderIds.isEmpty()){ |
| | | List<OrderGood> orderGoodList = orderGoodService.list(new LambdaQueryWrapper<OrderGood>().in(OrderGood::getOrderId, orderIds) |
| | | .eq(OrderGood::getGoodsId, shoppingCart.getGoodsId()).eq(OrderGood::getDelFlag, 0)); |
| | | sum = orderGoodList.stream().mapToInt(OrderGood::getNum).sum(); |
| | | } |
| | | vo.setPurchaseLimit((num + sum) > goods.getPurchaseLimit() ? true : false); |
| | | vo.setPurchaseLimit((num + sum) > goods.getPurchaseLimit()); |
| | | } |
| | | vo.setDistributionMode(goods.getDistributionMode()); |
| | | vo.setEarnSpendingPoints(price.getEarnSpendingPoints()); |
| | |
| | | OrderActivityInfo orderActivityInfo = orderActivityInfoClient.getNowOrderActivityInfo(appUser.getVipId()).getData(); |
| | | BaseSetting baseSetting = baseSettingClient.getBaseSetting(4).getData(); |
| | | //系统活动设置(优惠券和活动能否同时使用) |
| | | boolean useSimultaneously = baseSetting.getContent().equals("1") ? true : false; |
| | | boolean useSimultaneously = baseSetting.getContent().equals("1"); |
| | | //满XX才打折,只有现金才能优惠 |
| | | //如果使用优惠券,则需要判断是否可以和同时使用,且活动满足使用条件。 |
| | | //没有使用优惠券,只需要判断是都满足使用条件 |
| | | if(((useSimultaneously && null != shoppingCartPayment.getUserCouponId()) || null == shoppingCartPayment.getUserCouponId()) && |
| | | if((useSimultaneously || null == shoppingCartPayment.getUserCouponId()) && |
| | | null != orderActivityInfo && shoppingCartPayment.getPaymentType() != 3 && orderActivityInfo.getConditionAmount().compareTo(paymentMoney) <= 0){ |
| | | BigDecimal paymentMoney1 = orderActivityInfo.getDiscount().divide(new BigDecimal(10)).multiply(paymentMoney); |
| | | BigDecimal bigDecimal = paymentMoney.subtract(paymentMoney1).setScale(2, RoundingMode.HALF_EVEN); |
| | |
| | | balanceChangeRecordClient.saveBalanceChangeRecord(balanceChangeRecord); |
| | | //修改订支付状态 |
| | | order.setPayStatus(2); |
| | | if(goods.getType() == 2 && null == shoppingCartPayment.getUserAddressId()){ |
| | | order.setOrderStatus(2); |
| | | } |
| | | orderService.updateById(order); |
| | | //删除购物车数据 |
| | | this.removeBatchByIds(ids); |
| | |
| | | balanceChangeRecordClient.saveBalanceChangeRecord(balanceChangeRecord); |
| | | //修改订支付状态 |
| | | order.setPayStatus(2); |
| | | if(goods.getType() == 2 && null == shoppingCartPayment.getUserAddressId()){ |
| | | order.setOrderStatus(2); |
| | | } |
| | | orderService.updateById(order); |
| | | //删除购物车数据 |
| | | this.removeBatchByIds(ids); |
| | |
| | | }else{ |
| | | //修改订支付状态 |
| | | order.setPayStatus(2); |
| | | if(goods.getType() == 2 && null == shoppingCartPayment.getUserAddressId()){ |
| | | order.setOrderStatus(2); |
| | | } |
| | | orderService.updateById(order); |
| | | //删除购物车数据 |
| | | this.removeBatchByIds(ids); |
| | |
| | | VipSetting vipSetting3 = vipSettingClient.getVipSetting(3).getData(); |
| | | Integer vipLevelUpShopRole = vipSetting3.getVipLevelUpShopRole(); |
| | | Integer vipLevelUpShop = vipSetting3.getVipLevelUpShop(); |
| | | if(1 == vipLevelUpShopRole && appUser.getVipId() < 3 && shopPoint >= vipLevelUpShop){ |
| | | if(null != vipLevelUpShopRole && 1 == vipLevelUpShopRole && appUser.getVipId() < 3 && shopPoint >= vipLevelUpShop){ |
| | | appUser.setVipId(3); |
| | | appUserClient.editAppUserById(appUser); |
| | | //添加等级变化记录 |
| | |
| | | VipSetting vipSetting2 = vipSettingClient.getVipSetting(2).getData(); |
| | | vipLevelUpShopRole = vipSetting2.getVipLevelUpShopRole(); |
| | | vipLevelUpShop = vipSetting2.getVipLevelUpShop(); |
| | | if(1 == vipLevelUpShopRole && appUser.getVipId() < 2 && shopPoint >= vipLevelUpShop){ |
| | | if(null != vipLevelUpShopRole && 1 == vipLevelUpShopRole && appUser.getVipId() < 2 && shopPoint >= vipLevelUpShop){ |
| | | appUser.setVipId(2); |
| | | appUserClient.editAppUserById(appUser); |
| | | //添加等级变化记录 |
| | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getAgreementByType/{type}") |
| | | @ApiOperation(value = "获取协议详情", tags = {"管理后台-协议管理"}) |
| | | @ApiOperation(value = "协议管理-详情", tags = {"管理后台"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "类型(1=用户协议,2=隐私协议,3=技师上门免责声明,4=注销协议,5门店提现免责声明)", name = "type", required = true, dataType = "int"), |
| | | }) |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/saveAgreement") |
| | | @ApiOperation(value = "保存协议", tags = {"管理后台-协议管理"}) |
| | | @ApiOperation(value = "协议管理-保存协议", tags = {"管理后台"}) |
| | | public R saveAgreement(@RequestBody Agreement agreement){ |
| | | if(null != agreement.getId()){ |
| | | agreementService.updateById(agreement); |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/banner") |
| | | @Api(tags = "轮播图") |
| | | @Api("轮播图") |
| | | public class BannerController { |
| | | @Resource |
| | | private BannerService bannerService; |
| | |
| | | return R.ok(list); |
| | | } |
| | | @PostMapping("/add") |
| | | @ApiOperation(value = "添加", tags = {"后台-广告管理-banner管理"}) |
| | | @ApiOperation(value = "广告管理-banner管理-添加", tags = {"管理后台"}) |
| | | public R add(@RequestBody Banner banner){ |
| | | bannerService.save(banner); |
| | | return R.ok(); |
| | | } |
| | | @PostMapping("/delete") |
| | | @ApiOperation(value = "删除", tags = {"后台-广告管理-banner管理"}) |
| | | @GetMapping("/delete") |
| | | @ApiOperation(value = "广告管理-banner管理-删除", tags = {"管理后台"}) |
| | | public R delete(@RequestParam Integer id){ |
| | | bannerService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | @PostMapping("/edit") |
| | | @ApiOperation(value = "修改", tags = {"后台-广告管理-banner管理"}) |
| | | @ApiOperation(value = "广告管理-banner管理-修改", tags = {"管理后台"}) |
| | | public R edit(@RequestBody Banner banner){ |
| | | bannerService.updateById(banner); |
| | | return R.ok(); |
| | | } |
| | | @PostMapping("/detail") |
| | | @ApiOperation(value = "详情", tags = {"后台-广告管理-banner管理"}) |
| | | @GetMapping("/detail") |
| | | @ApiOperation(value = "广告管理-banner管理-详情", tags = {"管理后台"}) |
| | | public R detail(@RequestParam Integer id){ |
| | | Banner byId = bannerService.getById(id); |
| | | return R.ok(byId); |
| | | } |
| | | @PostMapping("/page/list") |
| | | @ApiOperation(value = "列表", tags = {"后台-广告管理--banner"}) |
| | | @GetMapping("/page/list") |
| | | @ApiOperation(value = "广告管理-banner-列表", tags = {"管理后台"}) |
| | | public R<Page<Banner>> pagelist(String name, Integer jumpType, Integer position,Integer pageNum,Integer pageSize){ |
| | | Page<Banner> page = bannerService.lambdaQuery().like(StringUtils.isNotEmpty(name), Banner::getName, name) |
| | | .eq(Banner::getJumpType, jumpType) |
| | | .eq(Banner::getPosition, position) |
| | | .eq(jumpType!=null,Banner::getJumpType, jumpType) |
| | | .eq(position!=null,Banner::getPosition, position) |
| | | .page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.BaseSetting; |
| | | import com.ruoyi.other.service.BaseSettingService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/base-setting") |
| | | @Api("基础配置") |
| | | public class BaseSettingController { |
| | | |
| | | @Resource |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/getBaseSetting") |
| | | @GetMapping("/getBaseSetting") |
| | | @ApiOperation(value = "获取基础配置", tags = {"管理后台-基础配置"}) |
| | | public R<BaseSetting> getBaseSetting(@RequestParam("id") Integer id){ |
| | | BaseSetting baseSetting = baseSettingService.getById(id); |
| | | return R.ok(baseSetting); |
| | | } |
| | | |
| | | /** |
| | | * 保存设置 |
| | | */ |
| | | @ApiOperation(value = "保存设置", tags = {"管理后台-基础配置"}) |
| | | @PostMapping("/save") |
| | | public R saveActivityConfig(@RequestBody String json){ |
| | | JSONObject jsonObject = JSONObject.parseObject(json); |
| | | Integer id = jsonObject.getInteger("id"); |
| | | BaseSetting baseSetting = baseSettingService.getById(id); |
| | | baseSetting.setContent(jsonObject.getString("content")); |
| | | baseSettingService.saveOrUpdate(baseSetting); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | 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.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.feignClient.UserCouponClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.UserCoupon; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.CouponInfo; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.service.CouponInfoService; |
| | | import com.ruoyi.other.service.GoodsService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | import java.time.LocalDateTime; |
| | |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | @Resource |
| | | private UserCouponClient userCouponClient; |
| | | @Resource |
| | | private GoodsService goodsService; |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "优惠劵管理-列表", tags = {"管理后台-活动管理"}) |
| | | public R<IPage<CouponInfo>> list(@RequestParam("pageNum") Integer pageNum, |
| | | @RequestParam("pageSize") Integer pageSize, |
| | | CouponInfo couponInfo) { |
| | | IPage<CouponInfo> couponInfoIPage = couponInfoService.queryCouponInfoPage(Page.of(pageNum, pageSize), couponInfo); |
| | | for (CouponInfo record : couponInfoIPage.getRecords()) { |
| | | R<Long> r = userCouponClient.getCouponCount(record.getId()); |
| | | record.setSendNumNow(r.getData()); |
| | | } |
| | | return R.ok(couponInfoIPage); |
| | | } |
| | | |
| | | |
| | | //查看详情 |
| | | @PostMapping("/detail") |
| | | @ApiOperation(value = "详情", tags = {"后台-优惠劵"}) |
| | | @GetMapping("/detail") |
| | | @ApiOperation(value = "优惠劵管理-详情", tags = {"管理后台-活动管理"}) |
| | | public R<CouponInfo> detail(@RequestParam("id") Integer id){ |
| | | CouponInfo byId = couponInfoService.getById(id); |
| | | byId.setGoodsNameList(JSON.parseArray(byId.getGoodsNameJson(), String.class)); |
| | | String forGoodIds = byId.getForGoodIds(); |
| | | if (StringUtils.isNotEmpty(forGoodIds)){ |
| | | List<Goods> goods = goodsService.listByIds(Arrays.asList(forGoodIds.split(","))); |
| | | byId.setGoods(goods); |
| | | } |
| | | String personIds = byId.getPersonIds(); |
| | | if (StringUtils.isNotEmpty(personIds)){ |
| | | List<AppUser> appUserList = appUserClient.listByIds(Arrays.asList(personIds.split(","))); |
| | | byId.setAppUserList(appUserList); |
| | | } |
| | | |
| | | return R.ok(byId); |
| | | } |
| | | |
| | | // 删除优惠劵 |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation(value = "优惠劵管理-删除", tags = {"管理后台-活动管理"}) |
| | | public R<Void> delete(@RequestParam("id") Integer id) { |
| | | couponInfoService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | // 编辑优惠劵 |
| | | @PostMapping("/edit") |
| | | @ApiOperation(value = "优惠劵管理-编辑", tags = {"管理后台-活动管理"}) |
| | | public R<Void> edit(@RequestBody CouponInfo couponInfo) { |
| | | List<String> goodsNameList = couponInfo.getGoodsNameList(); |
| | | couponInfo.setGoodsNameJson(JSON.toJSONString(goodsNameList)); |
| | | couponInfoService.updateById(couponInfo); |
| | | return R.ok(); |
| | | } |
| | | |
| | | // 修改上/下架状态 |
| | | @PostMapping("/editStatus") |
| | | @ApiOperation(value = "优惠劵管理-修改上/下架状态", tags = {"管理后台-活动管理"}) |
| | | public R<Void> editStatus(@RequestParam("id") Integer id, |
| | | @RequestParam("shelfStatus") Integer shelfStatus) { |
| | | CouponInfo couponInfo = new CouponInfo(); |
| | | couponInfo.setId(id); |
| | | couponInfo.setShelfStatus(shelfStatus); |
| | | couponInfoService.updateById(couponInfo); |
| | | return R.ok(); |
| | | } |
| | | |
| | | // 添加优惠券 |
| | | @PostMapping("/add") |
| | | @ApiOperation(value = "优惠劵管理-添加", tags = {"管理后台-活动管理"}) |
| | | public R<Void> add(@RequestBody CouponInfo couponInfo) { |
| | | couponInfo.setShelfStatus(0); |
| | | List<String> goodsNameList = couponInfo.getGoodsNameList(); |
| | | couponInfo.setGoodsNameJson(JSON.toJSONString(goodsNameList)); |
| | | couponInfoService.save(couponInfo); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @GetMapping("/gift/list") |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据id获取优惠券数据 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | |
| | | return R.ok(couponInfos); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取领取记录 |
| | | */ |
| | | |
| | | @GetMapping("/getReceiveRecord") |
| | | public R<IPage<UserCoupon>> getReceiveRecord(@ApiParam("页码") @RequestParam Integer pageNum, @ApiParam("大小") Integer pageSize,UserCoupon userCoupon) { |
| | | return null; |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.GoodsBargainPrice; |
| | | import com.ruoyi.other.api.domain.GoodsBargainPriceDetail; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.*; |
| | | import com.ruoyi.other.api.vo.GetGoodsBargainPrice; |
| | | import com.ruoyi.other.service.GoodsBargainPriceDetailService; |
| | | import com.ruoyi.other.service.GoodsBargainPriceService; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.other.service.*; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import io.swagger.models.auth.In; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.alibaba.nacos.shaded.org.checkerframework.checker.units.UnitsTools.g; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/goods-bargain-price") |
| | | @Api("门店特殊售价") |
| | | public class GoodsBargainPriceController { |
| | | |
| | | @Resource |
| | |
| | | @Resource |
| | | private GoodsBargainPriceDetailService goodsBargainPriceDetailService; |
| | | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | @Resource |
| | | private GoodsService goodsService; |
| | | |
| | | @Resource |
| | | private GoodsCategoryService goodsCategoryService; |
| | | |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | @Resource |
| | | private ShopService shopService; |
| | | |
| | | |
| | | /** |
| | | * 根据商品id和会员等级获取门店特价 |
| | | * @param goodsBargainPrice |
| | | * @return |
| | | * |
| | | */ |
| | | @PostMapping("/getGoodsBargainPrice") |
| | | public R<GoodsBargainPriceDetail> getGoodsBargainPrice(@RequestBody GetGoodsBargainPrice goodsBargainPrice){ |
| | | GoodsBargainPrice one = goodsBargainPriceService.getOne(new LambdaQueryWrapper<GoodsBargainPrice>().eq(GoodsBargainPrice::getGoodsId, goodsBargainPrice.getGoodsId()) |
| | | .eq(GoodsBargainPrice::getShopId, goodsBargainPrice.getShopId()).eq(GoodsBargainPrice::getAuditStatus, 1).eq(GoodsBargainPrice::getDelFlag, 0) |
| | | .orderByDesc(GoodsBargainPrice::getCreateTime).last(" limit 0,1")); |
| | | GoodsBargainPrice one = goodsBargainPriceService.getOne(new LambdaQueryWrapper<GoodsBargainPrice>() |
| | | .eq(GoodsBargainPrice::getGoodsId, goodsBargainPrice.getGoodsId()) |
| | | .eq(GoodsBargainPrice::getShopId, goodsBargainPrice.getShopId()) |
| | | .eq(GoodsBargainPrice::getAuditStatus, 1) |
| | | .eq(GoodsBargainPrice::getDelFlag, 0) |
| | | .orderByDesc(GoodsBargainPrice::getCreateTime) |
| | | .last(" limit 0,1")); |
| | | if(null == one){ |
| | | return R.ok(); |
| | | } |
| | |
| | | return R.ok(detailServiceOne); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation(value = "新增", tags = {"管理后台-商品管理-门店特殊售价"}) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<Void> add(@RequestBody GoodsBargainPrice goodsBargainPrice) { |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | goodsBargainPrice.setAuditStatus(0); |
| | | goodsBargainPrice.setCreateUserId(loginUserApplet.getUserid()); |
| | | goodsBargainPriceService.save(goodsBargainPrice); |
| | | saveGoodsBargainPriceDetail(goodsBargainPrice); |
| | | return R.ok(); |
| | | } |
| | | |
| | | private void saveGoodsBargainPriceDetail(@RequestBody GoodsBargainPrice goodsBargainPrice) { |
| | | List<GoodsBargainPriceDetail> goodsBargainPriceDetailList = goodsBargainPrice.getGoodsBargainPriceDetailList(); |
| | | if (goodsBargainPriceDetailList == null || goodsBargainPriceDetailList.isEmpty()) { |
| | | throw new RuntimeException("请输入明细"); |
| | | } |
| | | for (GoodsBargainPriceDetail goodsBargainPriceDetail : goodsBargainPriceDetailList) { |
| | | goodsBargainPriceDetail.setGoodsBargainPriceId(goodsBargainPrice.getId()); |
| | | } |
| | | goodsBargainPriceDetailService.saveBatch(goodsBargainPriceDetailList); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation(value = "删除", tags = {"管理后台-商品管理-门店特殊售价-"}) |
| | | public R<Void> delete(@ApiParam("id") @RequestParam("id") Integer id) { |
| | | goodsBargainPriceService.removeById(id); |
| | | goodsBargainPriceDetailService.remove(new LambdaQueryWrapper<GoodsBargainPriceDetail>() |
| | | .eq(GoodsBargainPriceDetail::getGoodsBargainPriceId, id)); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @PutMapping("/edit") |
| | | @ApiOperation(value = "修改", tags = {"管理后台-商品管理-门店特殊售价"}) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<Void> edit(@RequestBody GoodsBargainPrice goodsBargainPrice) { |
| | | goodsBargainPriceService.updateById(goodsBargainPrice); |
| | | goodsBargainPriceDetailService.remove(new LambdaQueryWrapper<GoodsBargainPriceDetail>() |
| | | .eq(GoodsBargainPriceDetail::getGoodsBargainPriceId, goodsBargainPrice.getId())); |
| | | saveGoodsBargainPriceDetail(goodsBargainPrice); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperation(value = "详情", tags = {"管理后台-商品管理-门店特殊售价"}) |
| | | public R<GoodsBargainPrice> detail(@ApiParam("id") @RequestParam("id") Integer id) { |
| | | GoodsBargainPrice goodsBargainPrice = goodsBargainPriceService.getById(id); |
| | | List<GoodsBargainPriceDetail> goodsBargainPriceDetailList = goodsBargainPriceDetailService.list(new LambdaQueryWrapper<GoodsBargainPriceDetail>() |
| | | .eq(GoodsBargainPriceDetail::getGoodsBargainPriceId, id)); |
| | | goodsBargainPrice.setGoodsBargainPriceDetailList(goodsBargainPriceDetailList); |
| | | return R.ok(goodsBargainPrice); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "列表", tags = {"管理后台-商品管理-门店特殊售价"}) |
| | | public R<Page<GoodsBargainPrice>> list(@ApiParam("页码") @RequestParam(value = "pageNum", required = false) Integer pageNum, |
| | | @ApiParam("每页数量") @RequestParam(value = "pageSize", required = false) Integer pageSize, |
| | | @ApiParam("商品id") @RequestParam(value = "goodsId", required = false) Integer goodsId, |
| | | @ApiParam("商品名称") @RequestParam(value = "goodsName", required = false) String goodsName, |
| | | @ApiParam("商品类型") @RequestParam(value = "goodsType", required = false) Integer goodsType, |
| | | @ApiParam("所属分类") @RequestParam(value = "categoryId", required = false) Integer categoryId, |
| | | @ApiParam("审核状态") @RequestParam(value = "auditStatus", required = false) Integer auditStatus) { |
| | | |
| | | |
| | | List<Goods> goodsList = goodsService.list(new LambdaQueryWrapper<Goods>() |
| | | .eq(StringUtils.isNotEmpty(goodsName), Goods::getName, goodsName) |
| | | .eq(goodsType != null, Goods::getType, goodsType) |
| | | .eq(categoryId != null, Goods::getGoodsCategoryId, categoryId)); |
| | | List<Integer> goodsIds = goodsList.stream().map(Goods::getId).collect(Collectors.toList()); |
| | | if (goodsId != null){ |
| | | goodsIds.add(goodsId); |
| | | } |
| | | |
| | | Page<GoodsBargainPrice> page = goodsBargainPriceService.page(Page.of(pageNum, pageSize), new LambdaQueryWrapper<GoodsBargainPrice>() |
| | | .eq(!CollectionUtils.isEmpty(goodsIds), GoodsBargainPrice::getGoodsId, goodsId) |
| | | .eq(auditStatus != null, GoodsBargainPrice::getAuditStatus, auditStatus)); |
| | | |
| | | page.getRecords().forEach(goodsBargainPrice -> goodsList.stream() |
| | | .filter(goods -> goods.getId().equals(goodsBargainPrice.getGoodsId())) |
| | | .findFirst().ifPresent(g -> { |
| | | GoodsCategory goodsCategory = goodsCategoryService.getById(g.getGoodsCategoryId()); |
| | | Integer shopId = goodsBargainPrice.getShopId(); |
| | | Shop shop = shopService.getById(shopId); |
| | | R<AppUser> r = appUserClient.getAppUserByPhone(shop.getPhone()); |
| | | if (R.isError(r)){ |
| | | throw new RuntimeException("获取店长信息失败"); |
| | | } |
| | | goodsBargainPrice.setOwnerName(r.getData().getName()); |
| | | goodsBargainPrice.setOwnerPhone(shop.getPhone()); |
| | | goodsBargainPrice.setShopName(shop.getName()); |
| | | goodsBargainPrice.setGoodsName(g.getName()); |
| | | goodsBargainPrice.setCategoryName(goodsCategory.getName()); |
| | | })); |
| | | |
| | | return R.ok(page); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | @PostMapping("/addGoodsCategory") |
| | | @ApiOperation(value = "添加商品分类", tags = {"管理后台-商品分类"}) |
| | | @ApiOperation(value = "商品管理-商品分类-添加", tags = {"管理后台"}) |
| | | public R<Void> addGoodsCategory(@RequestBody GoodsCategory goodsCategory){ |
| | | goodsCategoryService.save(goodsCategory); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PutMapping("/updateGoodsCategory") |
| | | @ApiOperation(value = "修改商品分类", tags = {"管理后台-商品分类"}) |
| | | @ApiOperation(value = "商品管理-商品分类-修改", tags = {"管理后台"}) |
| | | public R<Void> updateGoodsCategory(@RequestBody GoodsCategory goodsCategory){ |
| | | goodsCategoryService.updateById(goodsCategory); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/getGoodsCategoryById") |
| | | @ApiOperation(value = "商品分类详情", tags = {"管理后台-商品分类"}) |
| | | @ApiOperation(value = "商品管理-商品分类-详情", tags = {"管理后台"}) |
| | | public R<GoodsCategory> getGoodsCategoryById(@RequestParam("id") Integer id){ |
| | | return R.ok(goodsCategoryService.getById(id)); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getList") |
| | | @ApiOperation(value = "商品分类列表", tags = {"管理后台-商品分类"}) |
| | | public R<Page<GoodsCategory>> list(@ApiParam("页码") @RequestParam Integer PageNum,@ApiParam("每一页数据大小") Integer pageSize, GoodsCategory goodsCategory){ |
| | | @ApiOperation(value = "商品管理-商品分类-列表", tags = {"管理后台"}) |
| | | public R<Page<GoodsCategory>> list(@ApiParam("页码") @RequestParam Integer pageNum,@ApiParam("每一页数据大小") Integer pageSize, GoodsCategory goodsCategory){ |
| | | Page<GoodsCategory> page = goodsCategoryService.lambdaQuery() |
| | | .like(StringUtils.isNotEmpty(goodsCategory.getName()),GoodsCategory::getName, goodsCategory.getName()) |
| | | .page(Page.of(PageNum, pageSize)); |
| | | .page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation(value = "删除商品分类", tags = {"管理后台-商品分类"}) |
| | | @ApiOperation(value = "商品管理-商品分类-删除", tags = {"管理后台"}) |
| | | public R<Void> delete(@RequestParam("id") Integer id){ |
| | | goodsCategoryService.removeById(id); |
| | | return R.ok(); |
| | |
| | | |
| | | |
| | | 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.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.api.feignClient.VipSettingClient; |
| | | import com.ruoyi.other.service.GoodsService; |
| | | import com.ruoyi.other.vo.GoodsVO; |
| | | import io.swagger.annotations.Api; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/goods") |
| | | @Api(tags = "商品") |
| | | @Api("商品") |
| | | public class GoodsController extends BaseController { |
| | | @Resource |
| | | private GoodsService goodsService; |
| | | @Resource |
| | | private VipSettingClient settingClient; |
| | | |
| | | /** |
| | | * 添加商品 |
| | | */ |
| | | @PostMapping("/addGoods") |
| | | @ApiOperation(value = "添加商品", tags = {"管理后台-发布商品"}) |
| | | @ApiOperation(value = "发布商品", tags = {"管理后台-商品管理"}) |
| | | public R<Void> addGoods(@RequestBody Goods goods) { |
| | | goodsService.addGoods(goods); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 管理后台商品列表 |
| | | */ |
| | | @GetMapping("/manageGoodsList") |
| | | @ApiOperation(value = "商品列表", tags = {"管理后台-商品管理"}) |
| | | public R<IPage<Goods>> manageGoodsList(@ApiParam("页码") @RequestParam Integer pageNum, |
| | | @ApiParam("每一页数据大小") Integer pageSize, |
| | | Goods goods){ |
| | | return R.ok(goodsService.getManageGoodsList(new Page<>(pageNum, pageSize), goods)); |
| | | } |
| | | |
| | | /** |
| | | * 后台商品详情 |
| | | */ |
| | | @GetMapping("/manageGoodsDetail/{goodsId}") |
| | | @ApiOperation(value = "商品详情", tags = {"管理后台-商品管理"}) |
| | | public R<Goods> manageGoodsDetail(@PathVariable("goodsId") Long goodsId){ |
| | | return R.ok(goodsService.getManageGoodsDetail(goodsId)); |
| | | } |
| | | |
| | | /** |
| | | * 后台商品修改 |
| | | */ |
| | | @PutMapping("/manageGoodsUpdate") |
| | | @ApiOperation(value = "商品修改", tags = {"管理后台-商品管理"}) |
| | | public R<Void> manageGoodsUpdate(@RequestBody Goods goods){ |
| | | goodsService.updateManageGoods(goods); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 后台商品删除 |
| | | */ |
| | | @DeleteMapping("/manageGoodsDelete/{goodsId}") |
| | | @ApiOperation(value = "商品删除", tags = {"管理后台-商品管理"}) |
| | | public R<Void> manageGoodsDelete(@PathVariable("goodsId") Long goodsId){ |
| | | goodsService.removeById(goodsId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 获取会员等级信息 |
| | | */ |
| | | @GetMapping("/getVipSetting") |
| | | @ApiOperation(value = "会员等级信息", tags = {"管理后台-商品管理"}) |
| | | public R<List<VipSetting>> getVipSetting(){ |
| | | return settingClient.info(); |
| | | } |
| | | |
| | | |
| | |
| | | * 商品列表 |
| | | */ |
| | | @GetMapping("/goodsList") |
| | | @ApiOperation(value = "商品列表", tags = {"小程序-商城-首页-热门商品列表", "首页热门商品-小程序"}) |
| | | @ApiOperation(value = "热门商品列表", tags = {"小程序-商城-首页", "小程序-首页"}) |
| | | public R<TableDataInfo> goodsList(Goods goods){ |
| | | startPage(); |
| | | return R.ok(getDataTable(goodsService.goodsList(goods))); |
| | |
| | | * 指定门店商品 |
| | | */ |
| | | @GetMapping("/getGoodsListByShopId") |
| | | @ApiOperation(value = "商品列表", tags = {"小程序-首页-门店详情-商品购买列表"}) |
| | | @ApiOperation(value = "商品购买列表", tags = {"小程序-首页-门店详情"}) |
| | | public R<TableDataInfo> getGoodsListByShopId(@ApiParam("门店id") @RequestParam Integer shopId) { |
| | | startPage(); |
| | | return R.ok(getDataTable(goodsService.getGoodsListByShopId(shopId))); |
| | |
| | | * 商品详情 |
| | | */ |
| | | @GetMapping("/goodsDetail/{goodsId}") |
| | | @ApiOperation(value = "商品详情", tags = {"小程序-商城-首页-商品详情"}) |
| | | @ApiOperation(value = "商品详情", tags = {"小程序-商城-首页"}) |
| | | public R<GoodsVO> goodsDetail(@PathVariable("goodsId") Long goodsId){ |
| | | return R.ok(goodsService.goodsDetail(goodsId)); |
| | | } |
| | |
| | | @ResponseBody |
| | | @PostMapping("/getGoodsByIds") |
| | | public R<List<Goods>> getGoodsByIds(@RequestParam("ids") String [] ids){ |
| | | List<Goods> goods = goodsService.lambdaQuery().in(Goods::getId, ids).eq(Goods::getStatus, 0).list(); |
| | | List<Goods> goods = goodsService.lambdaQuery().in(Goods::getId, ids).list(); |
| | | return R.ok(goods); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.api.domain.GoodsEvaluate; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * 发布商品评价 |
| | | */ |
| | | @PostMapping("/addGoodsEvaluate") |
| | | @ApiOperation(value = "发布商品评价", tags = {"小程序-发布商品评价"}) |
| | | @ApiOperation(value = "发布商品评价", tags = {"小程序-个人中心-我的订单"}) |
| | | public R<Void> addGoodsEvaluate(@RequestBody GoodsEvaluateVO goodsEvaluateVO){ |
| | | goodsEvaluateService.addGoodsEvaluate(goodsEvaluateVO); |
| | | return R.ok(); |
| | |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除评论 |
| | | */ |
| | | @DeleteMapping("/delete/{id}") |
| | | @ApiOperation(value = "删除评论", tags = {"管理后台-商品管理-评价管理"}) |
| | | public R<Void> delete(@PathVariable("id") Long id){ |
| | | goodsEvaluateService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 评论列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "评论列表", tags = {"管理后台-商品管理-评价管理"}) |
| | | public R<List<GoodsEvaluate>> list(GoodsEvaluate goodsEvaluate){ |
| | | List<GoodsEvaluate> list = goodsEvaluateService.lambdaQuery() |
| | | .like(StringUtils.isNotEmpty(goodsEvaluate.getGoodsName()),GoodsEvaluate::getGoodsName, goodsEvaluate.getComment()) |
| | | .like(StringUtils.isNotEmpty(goodsEvaluate.getUserName()),GoodsEvaluate::getUserName, goodsEvaluate.getUserName()) |
| | | .like(StringUtils.isNotEmpty(goodsEvaluate.getPhone()),GoodsEvaluate::getPhone, goodsEvaluate.getPhone()) |
| | | .eq(goodsEvaluate.getStatus()!=null,GoodsEvaluate::getStatus, goodsEvaluate.getStatus()) |
| | | .orderByDesc(GoodsEvaluate::getCreateTime) |
| | | .list(); |
| | | |
| | | list.forEach(this::buildDetail); |
| | | |
| | | return R.ok(list); |
| | | } |
| | | |
| | | private void buildDetail(GoodsEvaluate item) { |
| | | AppUser appUser = appUserClient.getAppUserById(item.getAppUserId()); |
| | | if (appUser == null){ |
| | | throw new RuntimeException("获取用户信息失败"); |
| | | } |
| | | Goods goods = goodsService.getById(item.getGoodsId()); |
| | | item.setGoodsName(goods.getName()); |
| | | item.setPhone(appUser.getPhone()); |
| | | item.setUserName(appUser.getName()); |
| | | } |
| | | |
| | | /** |
| | | * 评论详情 |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "评论详情", tags = {"管理后台-商品管理-评价管理"}) |
| | | public R<GoodsEvaluate> getDetail(@PathVariable("id") Long id){ |
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(id); |
| | | buildDetail(goodsEvaluate); |
| | | return R.ok(goodsEvaluate); |
| | | } |
| | | |
| | | /** |
| | | * 评论上/下架 |
| | | */ |
| | | @PutMapping("/changeStatus") |
| | | @ApiOperation(value = "上/下架", tags = {"管理后台-商品管理-评价管理"}) |
| | | public R<Void> changeStatus(@RequestBody GoodsEvaluate goodsEvaluate){ |
| | | goodsEvaluateService.update(new LambdaUpdateWrapper<GoodsEvaluate>() |
| | | .eq(GoodsEvaluate::getId, goodsEvaluate.getId()) |
| | | .set(GoodsEvaluate::getStatus, goodsEvaluate.getStatus())); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.other.api.domain.OrderActivityInfo; |
| | | import com.ruoyi.other.service.OrderActivityInfoService; |
| | | import com.ruoyi.other.service.VipSettingService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/order-activity-info") |
| | | @Api("订单优惠活动") |
| | | public class OrderActivityInfoController { |
| | | |
| | | @Resource |
| | | private OrderActivityInfoService orderActivityInfoService; |
| | | @Resource |
| | | private VipSettingService vipSettingService; |
| | | |
| | | |
| | | /** |
| | |
| | | return R.ok(one); |
| | | } |
| | | |
| | | /** |
| | | * 添加活动 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperation(value = "订单优惠活动-添加活动", tags = {"管理后台-活动管理"}) |
| | | public R<Void> saveActivityConfig(@RequestBody OrderActivityInfo orderActivityInfo){ |
| | | orderActivityInfo.setIsShelf(0); |
| | | orderActivityInfoService.save(orderActivityInfo); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除活动 |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation(value = "订单优惠活动-删除活动", tags = {"管理后台-活动管理"}) |
| | | public R<Void> deleteActivityConfig(@RequestParam("id") Long id){ |
| | | orderActivityInfoService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 修改活动 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperation(value = "修改活动", tags = {"管理后台-活动管理"}) |
| | | public R<Void> updateActivityConfig(@RequestBody OrderActivityInfo orderActivityInfo){ |
| | | orderActivityInfo.setId(Long.valueOf(orderActivityInfo.getIdStr())); |
| | | orderActivityInfoService.updateById(orderActivityInfo); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 获取活动列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "订单优惠活动-获取活动列表", tags = {"管理后台-活动管理"}) |
| | | public R<Page<OrderActivityInfo>> list(@ApiParam("页码") @RequestParam Integer pageNum, |
| | | @ApiParam("每一页数据大小") Integer pageSize, |
| | | OrderActivityInfo orderActivityInfo){ |
| | | |
| | | Page<OrderActivityInfo> page = orderActivityInfoService.page(Page.of(pageNum, pageSize), new LambdaQueryWrapper<OrderActivityInfo>() |
| | | .eq(orderActivityInfo.getId() != null, OrderActivityInfo::getId, orderActivityInfo.getId()) |
| | | .eq(StringUtils.isNotEmpty(orderActivityInfo.getActivityName()), OrderActivityInfo::getActivityName, orderActivityInfo.getActivityName()) |
| | | .lt(orderActivityInfo.getStatus() != null && orderActivityInfo.getStatus() == 0, OrderActivityInfo::getStartTime, orderActivityInfo.getStartTime()) |
| | | .ge(orderActivityInfo.getStatus() != null && orderActivityInfo.getStatus() == 1, OrderActivityInfo::getEndTime, orderActivityInfo.getStartTime()) |
| | | .eq(orderActivityInfo.getIsShelf() != null, OrderActivityInfo::getIsShelf, orderActivityInfo.getIsShelf())); |
| | | page.getRecords().forEach(item -> { |
| | | LocalDateTime startTime = item.getStartTime(); |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalDateTime endTime = item.getEndTime(); |
| | | if (endTime.isBefore(now)){ |
| | | item.setStatus(2); //已结束 |
| | | }else if (startTime.isBefore(now)){ |
| | | item.setStatus(1); // 已开始 |
| | | }else { |
| | | item.setStatus(0); // 未开始 |
| | | } |
| | | |
| | | String vipIds = item.getVipIds(); |
| | | if (StringUtils.isNotEmpty(vipIds)){ |
| | | String[] vipIdArr = vipIds.split(","); |
| | | if (vipIdArr.length == 7){ |
| | | item.setVipName("全部"); |
| | | }else { |
| | | List<String> vipNameList = new ArrayList<>(); |
| | | for (String vipId : vipIdArr) { |
| | | String vipName = vipSettingService.getById(Long.parseLong(vipId)).getVipName(); |
| | | vipNameList.add(vipName); |
| | | } |
| | | item.setVipName(String.join(",", vipNameList)); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | /** |
| | | * 获取活动详情 |
| | | */ |
| | | @GetMapping("/getDetailById") |
| | | @ApiOperation(value = "订单优惠活动-获取活动详情", tags = {"管理后台-活动管理"}) |
| | | public R<OrderActivityInfo> getDetailById(@RequestParam("id") String id){ |
| | | return R.ok(orderActivityInfoService.getById(Long.parseLong(id))); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | * 查询指定门店手机号 |
| | | */ |
| | | @GetMapping("/selectPhoneByShopId") |
| | | @ApiOperation(value = "查询指定门店手机号", tags = {"小程序-门店详情-查询客服电话"}) |
| | | @ApiOperation(value = "查询指定门店手机号", tags = {"小程序-首页-门店详情"}) |
| | | public R<List<Phone>> getPhoneByShopId(@ApiParam("门店id") @RequestParam Integer shopId) { |
| | | return R.ok(phoneService.list(new LambdaQueryWrapper<Phone>() |
| | | .eq(Phone::getType, PhoneType.SHOP.getCode()) |
| | |
| | | @GetMapping("/getSysPhone") |
| | | @ApiOperation(value = "获取客服电话", tags = {"管理后台-客服电话", "门店后台-客服电话"}) |
| | | public R<Phone> getSysPhone(){ |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = sysUserClient.getSysUser(userid).getData(); |
| | | Long userId = tokenService.getLoginUser().getSysUser().getUserId(); |
| | | SysUser sysUser = sysUserClient.getSysUser(userId).getData(); |
| | | LambdaQueryWrapper<Phone> wrapper = new LambdaQueryWrapper<>(); |
| | | if(sysUser.getRoleType() == 1){ |
| | | wrapper.eq(Phone::getType, 1); |
| | |
| | | @PostMapping("/savePhone") |
| | | @ApiOperation(value = "保存客服电话", tags = {"管理后台-客服电话", "门店后台-客服电话"}) |
| | | public R savePhone(@RequestBody Phone phone){ |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = sysUserClient.getSysUser(userid).getData(); |
| | | Long userId = tokenService.getLoginUser().getSysUser().getUserId(); |
| | | SysUser sysUser = sysUserClient.getSysUser(userId).getData(); |
| | | //平台配置 |
| | | if(sysUser.getRoleType() == 1){ |
| | | Phone one = phoneService.getOne(new LambdaQueryWrapper<Phone>().eq(Phone::getType, 1)); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取红包配置 |
| | | */ |
| | | @ApiOperation(value = "获取红包配置", tags = {"管理后台-活动管理-签到红包"}) |
| | | @GetMapping("/getRedPackegeSet") |
| | | public R<RedPackegeSet> getRedPackegeSet(){ |
| | | return R.ok(redPackegeSetService.getOne(null)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加红包配置 |
| | | */ |
| | | @ApiOperation(value = "添加红包配置", tags = {"管理后台-活动管理-签到红包"}) |
| | | @GetMapping("/addRedPackegeSet") |
| | | public R<Void> addRedPackegeSet(RedPackegeSet redPackegeSet){ |
| | | RedPackegeSet one = redPackegeSetService.getOne(null); |
| | | if (one==null){ |
| | | redPackegeSet.setId(1); |
| | | redPackegeSetService.save(redPackegeSet); |
| | | }else { |
| | | if (one.getId()==null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | redPackegeSetService.updateById(redPackegeSet); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除红包配置 |
| | | */ |
| | | @ApiOperation(value = "删除红包配置", tags = {"管理后台-活动管理-签到红包"}) |
| | | @GetMapping("/delRedPackegeSet") |
| | | public R<Void> delRedPackegeSet(){ |
| | | redPackegeSetService.removeById(1); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | @RestController |
| | | @RequestMapping("/region") |
| | | @Api("地区") |
| | | @Api(tags = "地区") |
| | | public class RegionController { |
| | | @Resource |
| | | private RegionService regionService; |
| | | |
| | | /** |
| | | * 获取省份列表 |
| | | * 省市区级联 |
| | | */ |
| | | @GetMapping("/getProvinceList") |
| | | @ApiOperation("获取省份列表") |
| | | public R<List<Region>> getProvinceList() { |
| | | @ApiOperation("省市区级联") |
| | | public R<List<Region>> getProvinceList(@ApiParam("父级id") @RequestParam Long parentId) { |
| | | return R.ok(regionService.list(new LambdaQueryWrapper<Region>() |
| | | .eq(Region::getParentId, 0))); |
| | | .eq(Region::getParentId, parentId))); |
| | | } |
| | | |
| | | /** |
| | | * 获取下级地区列表 |
| | | */ |
| | | @GetMapping("/getNextRegionList") |
| | | @ApiOperation("获取下级地区列表") |
| | | public R<List<Region>> getNextRegionList(@ApiParam("父级id") @RequestParam Long id) { |
| | | return R.ok(regionService.list(new LambdaQueryWrapper<Region>() |
| | | .eq(Region::getParentId, id))); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | |
| | | * @author luodangjia |
| | | * @since 2024-11-20 |
| | | */ |
| | | @Api(tags = "秒杀活动信息") |
| | | @Api("秒杀活动信息") |
| | | @RestController |
| | | @RequestMapping("/seckill-activity-info") |
| | | public class SeckillActivityInfoController extends BaseController { |
| | |
| | | * 秒杀活动列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "秒杀活动列表",tags = {"小程序-商城-首页-秒杀活动列表"}) |
| | | @ApiOperation(value = "秒杀活动列表",tags = {"小程序-商城-首页","后台管理-活动管理-秒杀活动"}) |
| | | public R<TableDataInfo> list(Goods goods) |
| | | { |
| | | startPage(); |
| | |
| | | * 秒杀活动详情 |
| | | */ |
| | | @GetMapping("/detail/{id}") |
| | | @ApiOperation(value = "秒杀活动详情", tags = {"小程序-商城-首页-秒杀活动列表-秒杀活动详情"}) |
| | | @ApiOperation(value = "秒杀活动详情", tags = {"小程序-商城-首页"}) |
| | | public R<SeckillActivityDetailVO> detail(@PathVariable("id") Integer id) |
| | | { |
| | | return R.ok(seckillActivityInfoService.detail(id)); |
| | |
| | | return R.ok(goodsSeckill); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增秒杀活动 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperation(value = "新增秒杀活动", tags = {"后台管理-活动管理-秒杀活动" }) |
| | | public R<Void> save(@RequestBody SeckillActivityInfo seckillActivityInfo) |
| | | { |
| | | seckillActivityInfoService.saveSeckillActivityInfo(seckillActivityInfo); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 修改秒杀活动 |
| | | */ |
| | | @PutMapping("/update") |
| | | @ApiOperation(value = "修改秒杀活动", tags = {"后台管理-活动管理-秒杀活动" }) |
| | | public R<Void> update(@RequestBody SeckillActivityInfo seckillActivityInfo) |
| | | { |
| | | seckillActivityInfoService.updateSeckillActivityInfo(seckillActivityInfo); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除秒杀活动 |
| | | */ |
| | | @DeleteMapping("/remove/{id}") |
| | | @ApiOperation(value = "删除秒杀活动", tags = {"后台管理-活动管理-秒杀活动" }) |
| | | public R<Void> remove(@PathVariable Integer id) |
| | | { |
| | | seckillActivityInfoService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 获取秒杀活动明细 |
| | | */ |
| | | @GetMapping("/getSeckillActivityDetail") |
| | | @ApiOperation(value = "获取秒杀活动明细", tags = {"后台管理-活动管理-秒杀活动" }) |
| | | public R<SeckillActivityInfo> getSeckillActivityDetail(Integer id) |
| | | { |
| | | SeckillActivityInfo seckillActivityInfo = seckillActivityInfoService.getById(id); |
| | | List<GoodsSeckill> goodsSeckills = goodsSeckillService.list(new LambdaQueryWrapper<GoodsSeckill>() |
| | | .eq(GoodsSeckill::getSeckillActivityInfoId, id)); |
| | | seckillActivityInfo.setGoodsSeckills(goodsSeckills); |
| | | return R.ok(seckillActivityInfo); |
| | | } |
| | | |
| | | /** |
| | | * 修改上/下架状态 |
| | | */ |
| | | @PutMapping("/updateShowStatus") |
| | | @ApiOperation(value = "修改上/下架状态", tags = {"后台管理-活动管理-秒杀活动" }) |
| | | public R<Void> updateShowStatus(@RequestBody SeckillActivityVO seckillActivityVO) |
| | | { |
| | | seckillActivityInfoService.update(new LambdaUpdateWrapper<SeckillActivityInfo>() |
| | | .eq(SeckillActivityInfo::getId, seckillActivityVO.getId()) |
| | | .set(SeckillActivityInfo::getIsShelves, seckillActivityVO.getShowStatus())); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.other.api.domain.Share; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.feignClient.ShopClient; |
| | | import com.ruoyi.other.enums.ShareAddType; |
| | | import com.ruoyi.other.enums.ShareAuditStatus; |
| | | import com.ruoyi.other.service.ShareService; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.*; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | * @author luodangjia |
| | | * @since 2024-11-20 |
| | | */ |
| | | @Api(tags = "分享") |
| | | @Api("分享") |
| | | @RestController |
| | | @RequestMapping("/share") |
| | | public class ShareController extends BaseController { |
| | |
| | | private ShareService shareService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | @Resource |
| | | private ShopClient shopClient; |
| | | |
| | | /** |
| | | * 分享列表 |
| | | */ |
| | | @ApiOperation(value = "分享列表", tags = {"小程序-个人中心-门店管理-分享列表"}) |
| | | @ApiOperation(value = "分享列表", tags = {"小程序-个人中心-门店管理"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "对象id(addType=1:平台添加,addType=2:推广人添加,addType=3:门店添加)", name = "objectId", required = true, dataType = "int"), |
| | | }) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 分享添加 |
| | | */ |
| | | @ApiOperation(value = "分享添加", tags = {"小程序-个人中心-门店管理-分享添加"}) |
| | | @ApiOperation(value = "分享添加", tags = {"小程序-个人中心-门店管理"}) |
| | | @PostMapping |
| | | public R<Void> add(@RequestBody Share share){ |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | |
| | | /** |
| | | * 分享删除 |
| | | */ |
| | | @ApiOperation(value = "分享删除", tags = {"小程序-个人中心-门店管理-分享删除-小程序"}) |
| | | @ApiOperation(value = "分享删除", tags = {"小程序-个人中心-门店管理"}) |
| | | @DeleteMapping |
| | | public R<Void> delete(@RequestBody Share share){ |
| | | shareService.removeById(share); |
| | |
| | | /** |
| | | * 分享编辑 |
| | | */ |
| | | @ApiOperation(value = "分享编辑", tags = {"小程序-个人中心-门店管理-分享编辑-小程序"}) |
| | | @ApiOperation(value = "分享编辑", tags = {"小程序-个人中心-门店管理"}) |
| | | @PutMapping |
| | | public R<Void> edit(@RequestBody Share share){ |
| | | share.setAuditStatus(ShareAuditStatus.WAIT.getCode()); |
| | |
| | | /** |
| | | * 分享详情 |
| | | */ |
| | | @ApiOperation(value = "分享详情", tags = {"小程序-个人中心-门店管理-分享详情-小程序"}) |
| | | @ApiOperation(value = "分享详情", tags = {"小程序-个人中心-门店管理"}) |
| | | @GetMapping("/detail/{id}") |
| | | public R<Share> detail(@PathVariable("id") Integer id){ |
| | | return R.ok(shareService.getById(id)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "添加", tags = {"后台-分享管理"}) |
| | | @ApiOperation(value = "广告管理-分享管理-添加", tags = {"管理后台"}) |
| | | @PostMapping("/manage/add") |
| | | public R<Void> manage(@RequestBody Share share){ |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | Long userid = loginUser.getSysUser().getUserId(); |
| | | share.setAddType(1); |
| | | share.setAppletShare(0); |
| | | share.setAuditStatus(ShareAuditStatus.SUCCESS.getCode()); |
| | | share.setObjectId(userid.toString()); |
| | | share.setDelFlag(0); |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑", tags = {"后台-分享管理"}) |
| | | @ApiOperation(value = "广告管理-分享管理-编辑", tags = {"管理后台"}) |
| | | @PostMapping("/manage/edit") |
| | | public R<Void> manageedit(@RequestBody Share share){ |
| | | |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除", tags = {"后台-分享管理"}) |
| | | @ApiOperation(value = "广告管理-分享管理-删除", tags = {"管理后台"}) |
| | | @GetMapping("/manage/delete") |
| | | public R<Void> managedelete(@RequestParam Integer id){ |
| | | |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "列表", tags = {"后台-分享管理"}) |
| | | @ApiOperation(value = "广告管理-分享管理-列表", tags = {"管理后台"}) |
| | | @GetMapping("/manage/list") |
| | | public R<Page<Share>> managelist(String name,Integer addType,@RequestParam Integer PageNum,Integer pageSize){ |
| | | Page<Share> page = shareService.lambdaQuery().eq(Share::getAuditStatus,1).like(name != null, Share::getName, name).eq(addType != null, Share::getAddType, addType).page(Page.of(pageSize, pageSize)); |
| | | public R<Page<Share>> managelist(String name, Integer addType, @RequestParam Integer pageNum, Integer pageSize) { |
| | | Page<Share> page = shareService.lambdaQuery().eq(Share::getAuditStatus, 1).like(name != null, Share::getName, name).eq(addType != null, Share::getAddType, addType).page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @ApiOperation(value = "设为小程序分享", tags = {"后台-分享管理"}) |
| | | @ApiOperation(value = "广告管理-分享管理-设为小程序分享", tags = {"管理后台"}) |
| | | @GetMapping("/manage/set") |
| | | public R<Void> set(@RequestParam Integer id){ |
| | | //将所有分享设为不是小程序分享 |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "列表", tags = {"后台-分享管理-审核"}) |
| | | @ApiOperation(value = "广告管理-分享管理-审核列表", tags = {"管理后台"}) |
| | | @GetMapping("/manage/auth/list") |
| | | public R<Page<Share>> authmanagelist(String name,Integer addType,@RequestParam Integer PageNum,Integer pageSize){ |
| | | Page<Share> page = shareService.lambdaQuery().ne(Share::getAuditStatus,1).like(name != null, Share::getName, name).eq(addType != null, Share::getAddType, addType).page(Page.of(pageSize, pageSize)); |
| | | public R<Page<Share>> authmanagelist(String name, Integer addType, @RequestParam Integer pageNum, Integer pageSize) { |
| | | Page<Share> page = shareService.lambdaQuery().ne(Share::getAuditStatus, 1).like(name != null, Share::getName, name).eq(addType != null, Share::getAddType, addType).page(Page.of(pageNum, pageSize)); |
| | | for (Share record : page.getRecords()) { |
| | | if (record.getAddType() == 2) { |
| | | AppUser appUserById = appUserClient.getAppUserById(Long.valueOf(record.getObjectId())); |
| | | record.setAuthName(appUserById.getName()); |
| | | record.setAuthPhone(appUserById.getPhone()); |
| | | } |
| | | if (record.getAddType() == 3) { |
| | | R<Shop> shopById = shopClient.getShopById(Integer.valueOf(record.getObjectId())); |
| | | if (shopById.getData() != null) { |
| | | record.setAuthName(shopById.getData().getName()); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @ApiOperation(value = "广告管理-分享管理-详情", tags = {"管理后台"}) |
| | | @GetMapping("/manage/auth/detail") |
| | | public R<Share> authmanagelist(Integer id) { |
| | | Share byId = shareService.getById(id); |
| | | return R.ok(byId); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "广告管理-分享管理-审核", tags = {"管理后台"}) |
| | | @GetMapping("/manage/auth/check") |
| | | public R<Share> authmanagecheck(Integer id, @ApiParam("1=审核通过,2=审核失败") Integer auditStatus, @ApiParam("备注") String auditMsg) { |
| | | Share byId = shareService.getById(id); |
| | | byId.setAuditStatus(auditStatus); |
| | | byId.setAuditMsg(auditMsg); |
| | | shareService.updateById(byId); |
| | | return R.ok(byId); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.AppUserShop; |
| | |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.domain.ShopScore; |
| | | import com.ruoyi.other.enums.ShopStatus; |
| | | import com.ruoyi.other.service.ShopScoreService; |
| | | import com.ruoyi.other.service.ShopService; |
| | | import com.ruoyi.other.service.TechnicianService; |
| | | import com.ruoyi.other.vo.NearbyShopVO; |
| | | import com.ruoyi.other.vo.ShopDetailVO; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/shop") |
| | | @Api(tags = "门店") |
| | | @Api("门店") |
| | | public class ShopController extends BaseController { |
| | | @Resource |
| | | private TechnicianService technicianService; |
| | | @Resource |
| | | private ShopService shopService; |
| | | @Resource |
| | |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "新增门店", tags = {"后台管理-门店管理-新增门店"}) |
| | | @ApiOperation(value = "新增门店", tags = {"管理后台-门店管理"}) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<Void> add(@RequestBody Shop shop){ |
| | | String phone = shop.getPhone(); |
| | | if (!shopService.cheUserByPhone(phone)) { |
| | | return R.fail("该手机号未注册"); |
| | | } |
| | | shop.setShopAllPoint(0); |
| | | shop.setShopPoint(0); |
| | | shop.setSharePoint(0); |
| | | shop.setServerPoint(0); |
| | | shop.setLowerLevelRebatePoints(0); |
| | | shop.setUsePoint(0); |
| | | shop.setGiveawayAllMoney(BigDecimal.ZERO); |
| | | shop.setGiveawayMoney(BigDecimal.ZERO); |
| | | shop.setLowerLevelGiveawayMoney(BigDecimal.ZERO); |
| | | shop.setServerGiveawayMoney(BigDecimal.ZERO); |
| | | shop.setCanWithdrawMoney(BigDecimal.ZERO); |
| | | shop.setWithdrawMoney(BigDecimal.ZERO); |
| | | shop.setOrderNumber(0); |
| | | shop.setServerOrderNumber(0); |
| | | shop.setCustomOrderNumber(0); |
| | | shopService.save(shop); |
| | | |
| | | LoginUser loginUserApplet = tokenService.getLoginUser(); |
| | | AppUserShop appUserShop = new AppUserShop(); |
| | | appUserShop.setAppUserId(loginUserApplet.getUserid()); |
| | | appUserShop.setShopId(shop.getId()); |
| | | R<Void> r = appUserClient.addAppUserShop(appUserShop); |
| | | if (R.isError(r)){ |
| | | throw new RuntimeException("添加失败"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/getDetailById") |
| | | @GetMapping("/getDetailById") |
| | | @ApiOperation(value = "门店详情", tags = {"管理后台-门店管理"}) |
| | | public R<Shop> getDetailById(@RequestParam("id") Long id){ |
| | | Shop byId = shopService.getById(id); |
| | | return R.ok(byId); |
| | | } |
| | | |
| | | @DeleteMapping("/deleteShop") |
| | | @ApiOperation(value = "删除门店", tags = {"管理后台-门店管理"}) |
| | | public R<Void> deleteShop(@ApiParam("门店id") @RequestParam("id") Integer id){ |
| | | shopService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PutMapping("/editShop") |
| | | @ApiOperation(value = "门店管理-编辑门店", tags = {"管理后台-门店管理"}) |
| | | public R<Void> editShop(@RequestBody Shop shop){ |
| | | shopService.updateById(shop); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "门店列表", tags = {"管理后台-门店管理"}) |
| | | public R<IPage<Shop>> list(@ApiParam("页码") @RequestParam Integer pageNum,@ApiParam("每一页数据大小") Integer pageSize,Shop shop){ |
| | | IPage<Shop> shopIPage = shopService.getShopList(pageNum, pageSize, shop); |
| | | return R.ok(shopIPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过手机号校验店长 |
| | | */ |
| | | @PostMapping("/cheUserByPhone") |
| | | @ApiOperation(value = "通过手机号校验店长", tags = {"管理后台-门店管理"}) |
| | | public R<Boolean> cheUserByPhone(@RequestParam("phone") String phone) { |
| | | return R.ok(shopService.cheUserByPhone(phone)); |
| | | } |
| | | |
| | | |
| | |
| | | * 附近门店列表 |
| | | */ |
| | | @GetMapping("/nearbyShopList") |
| | | @ApiOperation(value = "附近门店列表", tags = {"小程序-首页-附近门店列表"}) |
| | | @ApiOperation(value = "附近门店列表", tags = {"小程序-首页"}) |
| | | public R<List<NearbyShopVO>> nearbyShopList(@ApiParam("经度") @RequestParam BigDecimal longitude, |
| | | @ApiParam("纬度") @RequestParam BigDecimal latitude) { |
| | | return R.ok(shopService.nearbyShopList(longitude, latitude)); |
| | |
| | | |
| | | |
| | | @GetMapping("/shopDetail") |
| | | @ApiOperation(value = "门店详情", tags = {"小程序-首页-门店详情"}) |
| | | @ApiOperation(value = "门店详情", tags = {"小程序-首页"}) |
| | | public R<ShopDetailVO> shopDetail(@ApiParam("门店id") @RequestParam Integer shopId, |
| | | @ApiParam("经度") @RequestParam BigDecimal longitude, |
| | | @ApiParam("纬度") @RequestParam BigDecimal latitude) { |
| | |
| | | * 查询当前店长所属门店 |
| | | */ |
| | | @GetMapping("/shopByUser") |
| | | @ApiOperation(value = "查询当前店长所属门店", tags = {"小程序-个人中心-首页"}, notes = "可绑定的门店列表") |
| | | @ApiOperation(value = "查询当前店长所属门店", tags = {"小程序-个人中心"}, notes = "可绑定的门店列表") |
| | | public R<List<Shop>> shopByUser() { |
| | | R<List<AppUserShop>> r = appUserClient.getAppUserShop(SecurityUtils.getUserId()); |
| | | if (R.isSuccess(r)){ |
| | |
| | | * 绑定门店 |
| | | */ |
| | | @GetMapping("/bindShop") |
| | | @ApiOperation(value = "绑定门店", tags = {"小程序-个人中心-绑定门店"}) |
| | | @ApiOperation(value = "绑定门店", tags = {"小程序-个人中心"}) |
| | | public R<Void> bindShop(@ApiParam("门店id") @RequestParam Long shopId) { |
| | | AppUser appUser = appUserClient.getAppUserById(SecurityUtils.getUserId()); |
| | | appUser.setShopId(shopId); |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/shopScore") |
| | | @ApiOperation(value = "门店打分", tags = {"小程序-个人中心-门店打分"}) |
| | | @ApiOperation(value = "门店打分", tags = {"小程序-个人中心"}) |
| | | public R<Void> shopScore(@RequestBody ShopScore shopScore) { |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | shopScore.setAppUserId(loginUserApplet.getUserid()); |
| | |
| | | return R.ok(shop); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/getShopByUserId") |
| | | public R<List<Shop>> getShopByUserId(@RequestParam("id") Integer id){ |
| | | List<Shop> list = shopService.lambdaQuery().eq(Shop::getAppUserId, id).list(); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据店铺管理员电话获取门店数据 |
| | |
| | | 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())); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import com.ruoyi.other.service.ShopPointService; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/shop-point") |
| | | @Api(tags = "管理后台-财务统计-门店积分统计") |
| | | public class ShopPointController { |
| | | @Resource |
| | | private ShopPointService shopPointService; |
| | | |
| | | |
| | | /** |
| | | * 门店积分统计 |
| | | */ |
| | | public Object statistics() { |
| | | return shopPointService.statistics(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.SystemConfig; |
| | | import com.ruoyi.other.api.dto.IndexConfigSetDto; |
| | | import com.ruoyi.other.api.dto.LogisticsSetDto; |
| | | import com.ruoyi.other.api.dto.StartPageSetDto; |
| | | import com.ruoyi.other.service.SystemConfigService; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @Resource |
| | | private SystemConfigService systemConfigService; |
| | | @PostMapping("/index/add") |
| | | @ApiOperation(value = "添加", tags = {"后台-广告管理-首页配置"}) |
| | | @ApiOperation(value = "广告管理-首页配置-添加", tags = {"管理后台"}) |
| | | public R add(@RequestBody IndexConfigSetDto indexConfigSetDto){ |
| | | //先删除type=2的数据 |
| | | List<SystemConfig> list = systemConfigService.lambdaQuery().eq(SystemConfig::getType, 2).list(); |
| | |
| | | return R.ok(); |
| | | } |
| | | @GetMapping("/index/detail") |
| | | @ApiOperation(value = "宣传图片-公司简介", tags = {"后台-广告管理-首页配置","小程序-首页"}) |
| | | @ApiOperation(value = "广告管理-首页配置-宣传图片-公司简介", tags = {"管理后台","小程序-首页"}) |
| | | public R<IndexConfigSetDto> detail(){ |
| | | SystemConfig one = systemConfigService.lambdaQuery().eq(SystemConfig::getType, 2).one(); |
| | | if (one==null){ |
| | |
| | | } |
| | | |
| | | @PostMapping("/startPage/add") |
| | | @ApiOperation(value = "添加", tags = {"后台-广告管理-启动页管理"}) |
| | | @ApiOperation(value = "广告管理-启动页管理-添加", tags = {"管理后台"}) |
| | | public R startPageadd(@RequestBody StartPageSetDto startPageSetDto){ |
| | | //先删除type=1的数据 |
| | | List<SystemConfig> list = systemConfigService.lambdaQuery().eq(SystemConfig::getType, 1).list(); |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 订单包邮设置 |
| | | */ |
| | | @PostMapping("/logistics/add") |
| | | @ApiOperation(value = "添加", tags = {"管理后台-商品管理-订单包邮设置"}) |
| | | public R add(@RequestBody LogisticsSetDto logisticsSetDto){ |
| | | List<SystemConfig> list = systemConfigService.lambdaQuery().eq(SystemConfig::getType, 3).list(); |
| | | systemConfigService.removeBatchByIds(list); |
| | | SystemConfig systemConfig = new SystemConfig(); |
| | | systemConfig.setType(3); |
| | | systemConfig.setContent(JSON.toJSONString(logisticsSetDto)); |
| | | systemConfigService.save(systemConfig); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 获取订单包邮设置 |
| | | */ |
| | | @GetMapping("/logistics/detail") |
| | | @ApiOperation(value = "订单包邮设置", tags = {"管理后台-商品管理-订单包邮设置"}) |
| | | public R<LogisticsSetDto> logisticsDetail(){ |
| | | SystemConfig one = systemConfigService.lambdaQuery().eq(SystemConfig::getType, 3).one(); |
| | | if (one==null){ |
| | | return R.ok(); |
| | | } |
| | | LogisticsSetDto logisticsSetDto = JSONObject.parseObject(one.getContent(), LogisticsSetDto.class); |
| | | return R.ok(logisticsSetDto); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/technician") |
| | | @Api(tags = "技师") |
| | | @Api("技师") |
| | | public class TechnicianController extends BaseController { |
| | | @Resource |
| | | private TechnicianService technicianService; |
| | |
| | | * @author luodangjia |
| | | * @since 2024-11-20 |
| | | */ |
| | | @Api(tags = "技师预约管理") |
| | | @Api("技师预约管理") |
| | | @RestController |
| | | @RequestMapping("/technician-subscribe") |
| | | public class TechnicianSubscribeController extends BaseController { |
| | |
| | | * 预约技师 |
| | | */ |
| | | @PostMapping("/subscribe") |
| | | @ApiOperation(value = "预约技师", notes = "预约技师", tags = {"小程序-个人中心-门店管理-预约列表-预约技师"}) |
| | | @ApiOperation(value = "预约技师", notes = "预约技师", tags = {"小程序-个人中心-门店管理-预约列表"}) |
| | | public R<Void> subscribe(@RequestBody TechnicianSubscribe technicianSubscribe) { |
| | | technicianSubscribeService.subscribe(technicianSubscribe); |
| | | return R.ok(); |
| | |
| | | * 取消服务 |
| | | */ |
| | | @GetMapping("/cancel") |
| | | @ApiOperation(value = "取消服务", notes = "取消服务", tags = {"小程序-个人中心-门店管理-预约列表-取消服务"}) |
| | | @ApiOperation(value = "取消服务", notes = "取消服务", tags = {"小程序-个人中心-门店管理,小程序-个人中心-我的预约"}) |
| | | public R<Void> cancel(@ApiParam(value = "预约id") @RequestParam Long id) { |
| | | |
| | | TechnicianSubscribe subscribe = technicianSubscribeService.getOne(new LambdaQueryWrapper<TechnicianSubscribe>() |
| | |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.BaseSetting; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.api.domain.VipGood; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.api.feignClient.GoodsClient; |
| | | import com.ruoyi.other.dto.VipSetDto; |
| | | import com.ruoyi.other.service.BaseSettingService; |
| | | import com.ruoyi.other.service.VipGoodService; |
| | | import com.ruoyi.other.service.VipSettingService; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import io.swagger.annotations.ApiParam; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private VipGoodService vipGoodService; |
| | | @Resource |
| | | private BaseSettingService baseSettingService; |
| | | @Resource |
| | | private GoodsClient goodsClient; |
| | | |
| | | @Resource |
| | | private VipGoodService getVipGoodService; |
| | | |
| | | @GetMapping("/info") |
| | | @ApiOperation(value = "获取各级会员信息", tags = {"小程序-个人中心首页", "小程序-会员中心"}) |
| | |
| | | public R<VipSetting> getVipSetting(@RequestParam("id") Integer id) { |
| | | return R.ok(vipSettingService.getById(id)); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | public R<List<VipSetting>> getList(){ |
| | | return R.ok(vipSettingService.list()); |
| | | } |
| | | |
| | | @GetMapping("/manage/info") |
| | | @ApiOperation(value = "查询", tags = {"后台-会员设置"}) |
| | | public R<VipSetDto> managesetinfo() { |
| | | VipSetDto vipSetDto = new VipSetDto(); |
| | | VipSetting byId1 = vipSettingService.getById(1); |
| | | vipSetDto.setLevel1Name(byId1.getVipName()); |
| | | VipSetting byId2 = vipSettingService.getById(2); |
| | | vipSetDto.setLevel2Name(byId2.getVipName()); |
| | | VipSetting byId3 = vipSettingService.getById(3); |
| | | vipSetDto.setLevel3Name(byId3.getVipName()); |
| | | VipSetting byId4 = vipSettingService.getById(4); |
| | | vipSetDto.setLevel4Name(byId4.getVipName()); |
| | | VipSetting byId5 = vipSettingService.getById(5); |
| | | vipSetDto.setLevel5Name(byId5.getVipName()); |
| | | VipSetting byId6 = vipSettingService.getById(6); |
| | | vipSetDto.setLevel6Name(byId6.getVipName()); |
| | | VipSetting byId7 = vipSettingService.getById(7); |
| | | vipSetDto.setLevel7Name(byId7.getVipName()); |
| | | |
| | | BaseSetting base1 = baseSettingService.getById(1); |
| | | vipSetDto.setPartPoint(new BigDecimal(base1.getContent())); |
| | | BaseSetting base2 = baseSettingService.getById(2); |
| | | vipSetDto.setBottomPartPoint(new BigDecimal(base2.getContent())); |
| | | return R.ok(vipSetDto); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/manage/set") |
| | | @ApiOperation(value = "设置", tags = {"后台-会员设置"}) |
| | | public R<List<VipSetting>> manageset(@RequestBody VipSetDto vipSetDto) { |
| | | List<VipSetting> vipSettingList = new ArrayList<>(); |
| | | VipSetting byId1 = vipSettingService.getById(1); |
| | | byId1.setVipName(vipSetDto.getLevel1Name()); |
| | | vipSettingList.add(byId1); |
| | | VipSetting byId2 = vipSettingService.getById(2); |
| | | byId2.setVipName(vipSetDto.getLevel2Name()); |
| | | vipSettingList.add(byId2); |
| | | VipSetting byId3 = vipSettingService.getById(3); |
| | | byId3.setVipName(vipSetDto.getLevel3Name()); |
| | | vipSettingList.add(byId3); |
| | | VipSetting byId4 = vipSettingService.getById(4); |
| | | byId4.setVipName(vipSetDto.getLevel4Name()); |
| | | vipSettingList.add(byId4); |
| | | VipSetting byId5 = vipSettingService.getById(5); |
| | | byId5.setVipName(vipSetDto.getLevel5Name()); |
| | | vipSettingList.add(byId5); |
| | | VipSetting byId6 = vipSettingService.getById(6); |
| | | byId6.setVipName(vipSetDto.getLevel6Name()); |
| | | vipSettingList.add(byId6); |
| | | VipSetting byId7 = vipSettingService.getById(7); |
| | | byId7.setVipName(vipSetDto.getLevel7Name()); |
| | | vipSettingList.add(byId7); |
| | | vipSettingService.updateBatchById(vipSettingList); |
| | | |
| | | BaseSetting base1 = baseSettingService.getById(1); |
| | | base1.setContent(String.valueOf(vipSetDto.getPartPoint())); |
| | | baseSettingService.updateById(base1); |
| | | BaseSetting base2 = baseSettingService.getById(2); |
| | | base2.setContent(String.valueOf(vipSetDto.getBottomPartPoint())); |
| | | baseSettingService.updateById(base2); |
| | | BaseSetting base3 = baseSettingService.getById(3); |
| | | base3.setContent(vipSetDto.getVipInfo()); |
| | | baseSettingService.updateById(base3); |
| | | |
| | | return R.ok(); |
| | | } |
| | | @PostMapping("/manage/level/set") |
| | | @ApiOperation(value = "设置", tags = {"后台-会员等级设置"}) |
| | | public R<Void> managelevelset(@RequestBody List<VipSetting> vipSettingList) { |
| | | vipSettingService.updateBatchById(vipSettingList); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/manage/level/info") |
| | | @ApiOperation(value = "查询", tags = {"后台-会员等级设置"}) |
| | | public R<List<VipSetting>> managelevelinfo() { |
| | | List<VipSetting> list = vipSettingService.list(); |
| | | for (VipSetting vipSetting : list) { |
| | | if (vipSetting.getGoodIds()!=null){ |
| | | String[] split = vipSetting.getGoodIds().split(","); |
| | | R<List<Goods>> goodsById = goodsClient.getGoodsById(split); |
| | | if (goodsById.getData()!=null){ |
| | | vipSetting.setGoodsList(goodsById.getData()); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(list); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.ruoyi.other.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class VipSetDto { |
| | | private String level1Name; |
| | | private String level2Name; |
| | | private String level3Name; |
| | | private String level4Name; |
| | | private String level5Name; |
| | | private String level6Name; |
| | | private String level7Name; |
| | | @ApiModelProperty("合伙人积分设置一") |
| | | private BigDecimal partPoint; |
| | | @ApiModelProperty("合伙人积分设置二") |
| | | private BigDecimal bottomPartPoint; |
| | | @ApiModelProperty("会员说明设置") |
| | | private String vipInfo; |
| | | } |
| | |
| | | public enum TechnicianStatus { |
| | | UNSUBSCRIBE(0, "待服务"), |
| | | SERVE(1, "已服务"), |
| | | CANCEL(2, "已取消"); |
| | | CANCEL(2, "已取消"), |
| | | EXPIRED(3, "已到期"); |
| | | private final Integer code; |
| | | private final String message; |
| | | |
| | |
| | | package com.ruoyi.other.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.other.api.domain.CouponInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-11-20 |
| | | */ |
| | | public interface CouponInfoMapper extends BaseMapper<CouponInfo> { |
| | | |
| | | IPage<CouponInfo> queryCouponInfoPage(@Param("page") IPage<CouponInfo> page, @Param("couponInfo") CouponInfo couponInfo); |
| | | } |
| | |
| | | package com.ruoyi.other.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | */ |
| | | public interface GoodsMapper extends BaseMapper<Goods> { |
| | | List<Goods> selectListByShopId(@Param("shopId") Integer shopId,@Param("vip") Integer vip); |
| | | |
| | | IPage<Goods> selectManageGoodsList(@Param("page") IPage<Goods> page, @Param("goods") Goods goods); |
| | | } |
| | |
| | | package com.ruoyi.other.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.vo.NearbyShopVO; |
| | | import com.ruoyi.other.vo.ShopDetailVO; |
| | |
| | | */ |
| | | public interface ShopMapper extends BaseMapper<Shop> { |
| | | |
| | | IPage<Shop> selectShopList(@Param("page") Page<Shop> page,@Param("shop") Shop shop); |
| | | |
| | | List<NearbyShopVO> selectNearbyShopList(@Param("longitude") BigDecimal longitude,@Param("latitude") BigDecimal latitude); |
| | | |
| | | ShopDetailVO selectShopDetail(Integer shopId); |
| | |
| | | package com.ruoyi.other.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.other.api.domain.CouponInfo; |
| | | |
| | |
| | | */ |
| | | public interface CouponInfoService extends IService<CouponInfo> { |
| | | |
| | | IPage<CouponInfo> queryCouponInfoPage(IPage<CouponInfo> page, CouponInfo couponInfo); |
| | | |
| | | } |
| | |
| | | */ |
| | | public interface GoodsSeckillService extends IService<GoodsSeckill> { |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.other.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.vo.GoodsVO; |
| | |
| | | GoodsVO goodsDetail(Long goodsId); |
| | | |
| | | List<Goods> getGoodsListByShopId(Integer shopId); |
| | | |
| | | void addGoods(Goods goods); |
| | | |
| | | void updateManageGoods(Goods goods); |
| | | |
| | | IPage<Goods> getManageGoodsList(Page<Goods> page, Goods goods); |
| | | |
| | | Goods getManageGoodsDetail(Long goodsId); |
| | | } |
| | |
| | | List<SeckillActivityVO> listSeckillActivity(Goods goods); |
| | | |
| | | SeckillActivityDetailVO detail(Integer seckillActivityId); |
| | | |
| | | void saveSeckillActivityInfo(SeckillActivityInfo seckillActivityInfo); |
| | | |
| | | void updateSeckillActivityInfo(SeckillActivityInfo seckillActivityInfo); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.other.api.domain.ShopPoint; |
| | | import com.ruoyi.other.vo.ShopPointStatistics; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface ShopPointService extends IService<ShopPoint> { |
| | | |
| | | ShopPointStatistics statistics(); |
| | | } |
| | |
| | | package com.ruoyi.other.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.vo.NearbyShopVO; |
| | | import com.ruoyi.other.vo.ShopDetailVO; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | |
| | | */ |
| | | public interface ShopService extends IService<Shop> { |
| | | |
| | | IPage<Shop> getShopList(Integer PageNum, Integer pageSize, Shop shop); |
| | | |
| | | List<NearbyShopVO> nearbyShopList(BigDecimal longitude, BigDecimal latitude); |
| | | |
| | | ShopDetailVO getShopDetail(Integer shopId, BigDecimal longitude, BigDecimal latitude); |
| | | |
| | | Boolean cheUserByPhone(String phone); |
| | | |
| | | } |
| | |
| | | public interface VipSettingService extends IService<VipSetting> { |
| | | |
| | | VipSetting getVipSettingByUserId(Long userId); |
| | | |
| | | void downUsers(); |
| | | } |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.other.mapper.CouponInfoMapper; |
| | | import com.ruoyi.other.api.domain.CouponInfo; |
| | |
| | | @Service |
| | | public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponInfo> implements CouponInfoService { |
| | | |
| | | @Override |
| | | public IPage<CouponInfo> queryCouponInfoPage(IPage<CouponInfo> page, CouponInfo couponInfo) { |
| | | return this.baseMapper.queryCouponInfoPage(page, couponInfo); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | 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.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.common.core.domain.R; |
| | | 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.order.feignClient.RemoteOrderGoodsClient; |
| | | import com.ruoyi.order.vo.Price; |
| | | 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 com.ruoyi.other.service.*; |
| | | import com.ruoyi.other.vo.GoodsVO; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | |
| | | @Resource |
| | | private GoodsShopMapper goodsShopMapper; |
| | | @Resource |
| | | private GoodsShopService goodsShopService; |
| | | @Resource |
| | | private GoodsAppUserService goodsAppUserService; |
| | | @Resource |
| | | private ShopMapper shopMapper; |
| | | @Resource |
| | | private GoodsAreaService goodsAreaService; |
| | | @Resource |
| | | private RemoteOrderGoodsClient remoteOrderGoodsClient; |
| | | |
| | | @Override |
| | | public List<GoodsVO> goodsList(Goods search) { |
| | |
| | | .like(StringUtils.isNotEmpty(search.getName()), Goods::getName, search.getName())); |
| | | |
| | | List<GoodsVO> result = new ArrayList<>(); |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | for (Goods goods : goodsList) { |
| | | GoodsVO goodsVO = new GoodsVO(); |
| | | BeanUtils.copyBeanProp(goodsVO, goods); |
| | | goodsVO.setGoodsId(goods.getId()); |
| | | goodsVO.setGoodsName(goods.getName()); |
| | | R<Price> r = remoteOrderGoodsClient.getGoodsPrice(loginUserApplet.getUserid(), goods.getId(), null); |
| | | if (R.isSuccess(r)){ |
| | | Price price = r.getData(); |
| | | goodsVO.setSellingPrice(price.getCash()); |
| | | goodsVO.setIntegral(price.getPoint()); |
| | | } |
| | | result.add(goodsVO); |
| | | } |
| | | return result; |
| | |
| | | return goodsMapper.selectListByShopId(shopId, vipSetting.getId()); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Goods> getManageGoodsList(Page<Goods> page, Goods goods) { |
| | | return goodsMapper.selectManageGoodsList(page, goods); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addGoods(Goods goods) { |
| | | goods.setSaleNum(0); |
| | | goods.setStatus(GoodsStatus.DOWN.getCode()); |
| | | goodsMapper.insert(goods); |
| | | |
| | | // 指定门店 |
| | | Integer appointStore = goods.getAppointStore(); |
| | | if (appointStore == 1){ |
| | | List<GoodsShop> goodsShopList = goods.getGoodsShopList(); |
| | | if (CollectionUtils.isEmpty(goodsShopList)){ |
| | | throw new NullPointerException("请选择指定门店"); |
| | | } |
| | | goodsShopService.saveBatch(goodsShopList); |
| | | } |
| | | |
| | | // 指定用户 |
| | | List<GoodsAppUser> goodsAppUserList = goods.getGoodsAppUserList(); |
| | | if (!CollectionUtils.isEmpty(goodsAppUserList)){ |
| | | goodsAppUserService.saveBatch(goodsAppUserList); |
| | | } |
| | | |
| | | // 会员价格配置 |
| | | List<GoodsVip> goodsVipList = goods.getGoodsVipList(); |
| | | goodsVipService.saveBatch(goodsVipList); |
| | | |
| | | // 特殊地区售价设置 |
| | | List<GoodsArea> goodsAreaList = goods.getGoodsAreaList(); |
| | | if (!CollectionUtils.isEmpty(goodsAreaList)){ |
| | | goodsAreaService.saveBatch(goodsAreaList); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void updateManageGoods(Goods goods) { |
| | | goodsMapper.updateById(goods); |
| | | // 指定门店 |
| | | List<GoodsShop> goodsShopList = goods.getGoodsShopList(); |
| | | goodsShopService.updateBatchById(goodsShopList); |
| | | |
| | | // 指定用户 |
| | | List<GoodsAppUser> goodsAppUserList = goods.getGoodsAppUserList(); |
| | | goodsAppUserService.updateBatchById(goodsAppUserList); |
| | | |
| | | // 会员价格配置 |
| | | List<GoodsVip> goodsVipList = goods.getGoodsVipList(); |
| | | goodsVipService.updateBatchById(goodsVipList); |
| | | |
| | | // 特殊地区售价设置 |
| | | List<GoodsArea> goodsAreaList = goods.getGoodsAreaList(); |
| | | goodsAreaService.updateBatchById(goodsAreaList); |
| | | } |
| | | |
| | | @Override |
| | | public Goods getManageGoodsDetail(Long goodsId) { |
| | | Goods goods = getById(goodsId); |
| | | // 指定门店 |
| | | List<GoodsShop> goodsShops = goodsShopService.list(new LambdaQueryWrapper<GoodsShop>() |
| | | .eq(GoodsShop::getGoodsId, goodsId)); |
| | | goods.setGoodsShopList(goodsShops); |
| | | |
| | | // 指定用户 |
| | | List<GoodsAppUser> goodsAppUserList = goodsAppUserService.list(new LambdaQueryWrapper<GoodsAppUser>() |
| | | .eq(GoodsAppUser::getGoodsId, goodsId)); |
| | | goods.setGoodsAppUserList(goodsAppUserList); |
| | | |
| | | // 会员价格 |
| | | List<GoodsVip> goodsVipList = goodsVipService.list(new LambdaQueryWrapper<GoodsVip>() |
| | | .eq(GoodsVip::getGoodsId, goodsId)); |
| | | goods.setGoodsVipList(goodsVipList); |
| | | |
| | | // 特殊地区售价设置 |
| | | List<GoodsArea> goodsAreaList = goodsAreaService.list(new LambdaQueryWrapper<GoodsArea>() |
| | | .eq(GoodsArea::getGoodsId, goodsId)); |
| | | goods.setGoodsAreaList(goodsAreaList); |
| | | return goods; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.api.domain.GoodsShop; |
| | | import com.ruoyi.other.api.domain.SeckillActivityInfo; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.domain.*; |
| | | import com.ruoyi.other.mapper.GoodsShopMapper; |
| | | import com.ruoyi.other.mapper.SeckillActivityInfoMapper; |
| | | import com.ruoyi.other.mapper.ShopMapper; |
| | | import com.ruoyi.other.service.GoodsSeckillService; |
| | | import com.ruoyi.other.service.SeckillActivityInfoService; |
| | | import com.ruoyi.other.vo.SeckillActivityDetailVO; |
| | | import com.ruoyi.other.vo.SeckillActivityVO; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | @Resource |
| | | private GoodsSeckillService goodsSeckillService; |
| | | |
| | | @Override |
| | | public List<SeckillActivityVO> listSeckillActivity(Goods goods) { |
| | |
| | | seckillActivityDetailVO.setShopList(shopNames); |
| | | return seckillActivityDetailVO; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveSeckillActivityInfo(SeckillActivityInfo seckillActivityInfo) { |
| | | this.baseMapper.insert(seckillActivityInfo); |
| | | List<GoodsSeckill> goodsSeckills = seckillActivityInfo.getGoodsSeckills(); |
| | | goodsSeckills.forEach(goodsSeckill -> goodsSeckill.setSeckillActivityInfoId(seckillActivityInfo.getId())); |
| | | goodsSeckillService.saveBatch(goodsSeckills); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateSeckillActivityInfo(SeckillActivityInfo seckillActivityInfo) { |
| | | this.baseMapper.updateById(seckillActivityInfo); |
| | | goodsSeckillService.remove(new LambdaQueryWrapper<GoodsSeckill>().eq(GoodsSeckill::getSeckillActivityInfoId, seckillActivityInfo.getId())); |
| | | List<GoodsSeckill> goodsSeckills = seckillActivityInfo.getGoodsSeckills(); |
| | | goodsSeckills.forEach(goodsSeckill -> goodsSeckill.setSeckillActivityInfoId(seckillActivityInfo.getId())); |
| | | goodsSeckillService.saveBatch(goodsSeckills); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.other.mapper.ShopPointMapper; |
| | | import com.ruoyi.other.api.domain.ShopPoint; |
| | | import com.ruoyi.other.service.ShopPointService; |
| | | import com.ruoyi.other.vo.ShopPointStatistics; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | @Service |
| | | public class ShopPointServiceImpl extends ServiceImpl<ShopPointMapper, ShopPoint> implements ShopPointService { |
| | | |
| | | @Override |
| | | public ShopPointStatistics statistics() { |
| | | ShopPointStatistics shopPointStatistics = new ShopPointStatistics(); |
| | | return null; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | 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.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.GeodesyUtil; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.domain.ShopScore; |
| | | import com.ruoyi.other.mapper.ShopMapper; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.service.ShopScoreService; |
| | | import com.ruoyi.other.service.ShopService; |
| | | import com.ruoyi.other.vo.NearbyShopVO; |
| | |
| | | private ShopMapper shopMapper; |
| | | @Resource |
| | | private ShopScoreService shopScoreService; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | |
| | | @Override |
| | | public IPage<Shop> getShopList(Integer PageNum, Integer pageSize, Shop shop) { |
| | | Page<Shop> page = new Page<>(); |
| | | page.setCurrent(PageNum); |
| | | page.setSize(pageSize); |
| | | return shopMapper.selectShopList(page, shop); |
| | | } |
| | | |
| | | @Override |
| | | public List<NearbyShopVO> nearbyShopList(BigDecimal longitude, BigDecimal latitude) { |
| | |
| | | return shopDetailVO; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Boolean cheUserByPhone(String phone) { |
| | | R<AppUser> r = appUserClient.getAppUserByPhone(phone); |
| | | if (R.isError(r)){ |
| | | return false; |
| | | } |
| | | return r.getData() != null; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.other.mapper.VipSettingMapper; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | } |
| | | return this.getById(appUser.getVipId()); |
| | | } |
| | | |
| | | @Override |
| | | public void downUsers() { |
| | | // //查出可能需要降级的人员 |
| | | // R<List<AppUser>> topUsers = appUserClient.getTopUsers(); |
| | | // //循环判断是否要展示 |
| | | // if (topUsers.getData()!=null && topUsers.getData().size()>0){ |
| | | // for (AppUser appUser : topUsers.getData()){ |
| | | // if (appUser.getVipId()==5){ |
| | | // VipSetting vipSetting = this.baseMapper.selectById(5); |
| | | // if (vipSetting.getKeepBuyPoint()!=null){ |
| | | // //如果消费不为空,查找对应天数的消费积分 |
| | | // |
| | | // //如果消费积分小于保级积分,设置用户降级标志并将降级信息 |
| | | // } |
| | | // |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | //然后设置降级提示 |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.other.task; |
| | | |
| | | |
| | | import com.ruoyi.other.service.VipSettingService; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 定时任务工具类 |
| | | */ |
| | | @Component |
| | | public class TaskUtil { |
| | | |
| | | @Resource |
| | | private VipSettingService vipSettingService; |
| | | |
| | | |
| | | /** |
| | | * 每天的凌晨执行的任务 |
| | | */ |
| | | @Scheduled(cron = "0 0 0 * * *") |
| | | public void taskDay(){ |
| | | try { |
| | | |
| | | |
| | | vipSettingService.downUsers(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "商品简介") |
| | | private String introduction; |
| | | |
| | | @ApiModelProperty(value = "商品类型") |
| | | private String goodsType; |
| | | |
| | | @ApiModelProperty(value = "商品分类名称") |
| | | private String goodsCategoryName; |
| | | |
| | | @ApiModelProperty(value = "运营成本") |
| | | private BigDecimal operatingCost; |
| | | |
| | | @ApiModelProperty(value = "门店成本") |
| | | private BigDecimal shopCost; |
| | | |
| | | @ApiModelProperty(value = "限购数量") |
| | | private Integer maxNum; |
| | | |
| | | @ApiModelProperty(value = "销量") |
| | | private Integer saleNum; |
| | | |
| | | @ApiModelProperty(value = "封面图") |
| | | private String homePagePicture; |
| | | |
| | |
| | | @ApiModelProperty(value = "基础售价") |
| | | private BigDecimal sellingPrice; |
| | | |
| | | @ApiModelProperty(value = "已售数量") |
| | | private Integer saleNum; |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime endTime; |
| | | |
| | | @ApiModelProperty(value = "状态:1未开始 2已开始 3已结束") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "展示状态:0下架中 1上架中") |
| | | private Integer showStatus; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.other.vo; |
| | | |
| | | import com.ruoyi.other.api.domain.ShopPoint; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("门店积分统计") |
| | | public class ShopPointStatistics { |
| | | |
| | | /** |
| | | * 门店获得总积分 |
| | | */ |
| | | @ApiModelProperty("门店获得总积分") |
| | | private Integer totalPoint; |
| | | |
| | | /** |
| | | * 门店业绩积分 |
| | | */ |
| | | @ApiModelProperty("门店业绩积分") |
| | | private Integer shopPoint; |
| | | |
| | | /** |
| | | * 门店返佣积分 |
| | | */ |
| | | @ApiModelProperty("门店返佣积分") |
| | | private Integer shopCommissionPoint; |
| | | |
| | | /** |
| | | * 下级门店返佣积分 |
| | | */ |
| | | @ApiModelProperty("下级门店返佣积分") |
| | | private Integer subShopCommissionPoint; |
| | | |
| | | private List<ShopPoint> shopPointList; |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.other.mapper.CouponInfoMapper"> |
| | | |
| | | <select id="queryCouponInfoPage" resultType="com.ruoyi.other.api.domain.CouponInfo"> |
| | | SELECT |
| | | tci.id, |
| | | tci.create_time, |
| | | tci.coupon_name, |
| | | tci.coupon_type, |
| | | tci.condition_amount, |
| | | tci.discount_amount, |
| | | tci.money_amount, |
| | | tci.discount, |
| | | tci.for_good_ids, |
| | | tci.send_num, |
| | | tci.max_num, |
| | | tci.period_type, |
| | | tci.period_start_time, |
| | | tci.period_end_time, |
| | | tci.period_days, |
| | | tci.send_start_time, |
| | | tci.send_end_time, |
| | | tci.send_type, |
| | | tci.need_point, |
| | | tci.person_type, |
| | | tci.person_ids |
| | | FROM |
| | | t_coupon_info tci |
| | | <where> |
| | | tci.del_flag = 0 |
| | | <if test="couponInfo.couponName != null and couponInfo.couponName != ''"> |
| | | AND tci.coupon_name LIKE concat('%', #{couponInfo.couponName}, '%') |
| | | </if> |
| | | <if test="couponInfo.couponType != null"> |
| | | AND tci.coupon_type = #{couponInfo.couponType} |
| | | </if> |
| | | <if test="couponInfo.sendType != null"> |
| | | AND tci.send_type = #{couponInfo.sendType} |
| | | </if> |
| | | <if test="couponInfo.personType != null"> |
| | | AND tci.person_type = #{couponInfo.personType} |
| | | </if> |
| | | <if test="couponInfo.shelfStatus != null"> |
| | | AND tci.shelf_status = #{couponInfo.shelfStatus} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | 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> |
| | | ORDER BY tg.sale_num DESC |
| | | </select> |
| | | <select id="selectManageGoodsList" resultType="com.ruoyi.other.api.domain.Goods"> |
| | | SELECT |
| | | tg.id, |
| | | tg.`name`, |
| | | tg.type, |
| | | tg.goods_category_id, |
| | | tgc.`name`, |
| | | tg.operating_cost, |
| | | tg.shop_cost, |
| | | tg.`status` |
| | | FROM |
| | | t_goods tg |
| | | LEFT JOIN t_goods_category tgc ON tg.goods_category_id = tgc.id |
| | | <where> |
| | | tg.del_flag = 0 |
| | | <if test="goods.id != null"> |
| | | <if test="goods.id != null"> |
| | | and tg.id = #{goods.id} |
| | | </if> |
| | | <if test="goods.name != null and goods.name != ''"> |
| | | and tg.`name` like concat('%',#{goods.name},'%') |
| | | </if> |
| | | <if test="goods.type != null"> |
| | | and tg.type = #{goods.type} |
| | | </if> |
| | | <if test="goods.goodsCategoryId != null"> |
| | | and tg.goodsCategoryId = #{goods.goodsCategoryId} |
| | | </if> |
| | | <if test="goods.status != null"> |
| | | and tg.`status` = #{goods.status} |
| | | </if> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | 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> |
| | |
| | | ts.longitude, |
| | | ts.latitude |
| | | </select> |
| | | <select id="selectShopList" resultType="com.ruoyi.other.api.domain.Shop"> |
| | | SELECT |
| | | ts.id, |
| | | ts.`name`, |
| | | ts.business_date, |
| | | ts.start_time, |
| | | ts.end_time, |
| | | ts.phone, |
| | | ts.address, |
| | | ts.`status`, |
| | | ts.shop_manager |
| | | FROM |
| | | t_shop ts |
| | | <where> |
| | | ts.del_flag = 0 |
| | | <if test="shop.name != null and shop.name != ''"> |
| | | and ts.name like concat('%',#{shop.name},'%') |
| | | </if> |
| | | <if test="shop.shopManager != null and shop.shopManager != ''"> |
| | | and ts.shop_manager like concat('%',#{shop.shopManager},'%') |
| | | </if> |
| | | <if test="shop.phone != null and shop.phone != ''"> |
| | | and ts.phone like concat('%',#{shop.phone},'%') |
| | | </if> |
| | | <if test="shop.status != null and shop.status != ''"> |
| | | and ts.status = #{shop.status} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |