Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/qijisheng
| | |
| | | @GetMapping("/appletLogin/getUserAncestorList") |
| | | R<List<AppUser>> getUserAncestorList(@RequestParam("id") Long id); |
| | | |
| | | @GetMapping("/appletLogin/getSuperiorLeader") |
| | | @PostMapping("/app-user/getSuperiorLeader") |
| | | R<AppUser> getSuperiorLeader(@RequestParam("id") Long id); |
| | | |
| | | @GetMapping("/app-user/getTopUsers") |
| | | @PostMapping("/app-user/getTopUsers") |
| | | R<List<AppUser>> getTopUsers(); |
| | | |
| | | @PostMapping("/app-user/getVipCount") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Boolean delFlag; |
| | | |
| | | @ApiModelProperty(value = "0否1是第一次添加") |
| | |
| | | @TableField("available_point") |
| | | private Integer availablePoint; |
| | | |
| | | @ApiModelProperty(value = "可转增积分") |
| | | @TableField("transferable_point") |
| | | private Integer transferablePoint; |
| | | |
| | | @ApiModelProperty(value = "是否可更换推广人(0=否,1=是)") |
| | | @TableField("change_promoter") |
| | | private Integer changePromoter; |
| | |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | @ApiModel |
| | | public class PaymentUserCouponVo { |
| | | @ApiModelProperty("优惠券id") |
| | | private Long id; |
| | | private String id; |
| | | @ApiModelProperty("优惠券名称") |
| | | private String name; |
| | | @ApiModelProperty("优惠券类型 1=满减券,2=代金券,3=折扣券,4=商品券") |
| | |
| | | @ApiModelProperty("有效期结束时间") |
| | | private String periodEndTime; |
| | | @ApiModelProperty("适用商品id集合,为null表示全部适用") |
| | | private List<Integer> forGoodIds; |
| | | private List<String> forGoodIds; |
| | | @ApiModelProperty("是否可用") |
| | | private Boolean available; |
| | | } |
| | |
| | | * 查询指定商品订单 |
| | | */ |
| | | @PostMapping("/order-good/selectGoodsOrder") |
| | | public R<List<OrderGood>> goodsOrder(@RequestBody List<Long> goodsIds); |
| | | R<List<OrderGood>> goodsOrder(@RequestBody List<Long> goodsIds); |
| | | |
| | | /** |
| | | * 根据ids查找订单列表 |
| | | */ |
| | | @PostMapping("/order/getOrderListByIds") |
| | | public R<List<Order>> getOrderListByIds(@RequestBody List<Long> orderIds); |
| | | R<List<Order>> getOrderListByIds(@RequestBody List<Long> orderIds); |
| | | |
| | | @PostMapping("/order/byUserId") |
| | | public R<List<Order>> byUserId(@RequestParam("appUserId")Long appUserId); |
| | | R<List<Order>> byUserId(@RequestParam("appUserId") Long appUserId); |
| | | @PostMapping("/order/byShopId") |
| | | public R<List<Order>> byShopId(@RequestParam("shopId")Integer shopId); |
| | | R<List<Order>> byShopId(@RequestParam("shopId") Integer shopId); |
| | | |
| | | |
| | | /** |
| | | * 根据用户id和商品id查找订单列表 |
| | | */ |
| | | @GetMapping("/order/getOrderListByUserIdAndGoodsId") |
| | | public R<List<Order>> getOrderListByUserIdAndGoodsId(@RequestParam("userId") Long userId, @RequestParam("goodsId") Integer goodsId); |
| | | @GetMapping("/order-good/getOrderListByUserIdAndGoodsId") |
| | | R<List<Order>> getOrderListByUserIdAndGoodsId(@RequestParam("userId") Long userId, @RequestParam("goodsId") Integer goodsId); |
| | | |
| | | /** |
| | | * 更新订单状态 |
| | | */ |
| | | @PostMapping("/order/updateOrderStatus") |
| | | public R<Void> updateOrderStatus(@RequestBody Order order); |
| | | R<Void> updateOrderStatus(@RequestBody Order order); |
| | | |
| | | /** |
| | | * 预约技师 |
| | | */ |
| | | @PostMapping("/order/subscribe") |
| | | public R<Void> subscribe(@RequestParam(value = "id" , required = false) Long id ,@RequestParam(value = "technicianId", required = false) Integer technicianId); |
| | | R<Void> subscribe(@RequestParam(value = "id", required = false) Long id, @RequestParam(value = "technicianId", required = false) Integer technicianId); |
| | | |
| | | |
| | | |
| | | @GetMapping("/shopping-cart/getGoodsPrice") |
| | | public R<Price> getGoodsPrice(@RequestParam("appUserId") Long appUserId, @RequestParam("goodsId") Integer goodsId, @RequestParam("shopId") Integer shopId); |
| | | 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); |
| | | R<Order> getLastOrder(@RequestParam("appUserId") Long appUserId); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除标识(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | package com.ruoyi.other.api.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_goods") |
| | | @ApiModel(value="Goods对象", description="") |
| | | public class Goods implements Serializable { |
| | | public class Goods extends BasePage implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | @TableField("sale_num") |
| | | private Integer saleNum; |
| | | |
| | | @ApiModelProperty(value = "商品权限 逗号分隔(0=全部,1=游客,2=普通会员,3=黄金会员,4=钻石会员,5=准代理,6=代理,7=总代,8=合伙人)") |
| | | @ApiModelProperty(value = "商品权限 逗号分隔(-1=全部,0=游客,1=普通会员,2=黄金会员,3=钻石会员,4=准代理,5=代理,6=总代,7=合伙人)") |
| | | @TableField("commodity_authority") |
| | | private String commodityAuthority; |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "排序") |
| | | @TableField("sort") |
| | | private Integer sort; |
| | | |
| | | @TableField(exist = false) |
| | | private Integer vipId; |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除标志(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除状态(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | |
| | | @ApiModelProperty(value = "删除(0=否,1=是)") |
| | | @TableField("del_flag") |
| | | @TableLogic |
| | | private Integer delFlag; |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | |
| | | /** |
| | | * 是否删除 1未删除 0已删除 |
| | | */ |
| | | @TableLogic |
| | | @Excel(name = "是否删除 0未删除 1已删除") |
| | | @TableField(exist = false) |
| | | private Boolean disabled; |
| | |
| | | /** 是否删除 0未删除 1已删除 */ |
| | | @TableField("disabled") |
| | | @ApiModelProperty(value = "是否删除 0未删除 1已删除") |
| | | @TableLogic |
| | | private Boolean disabled; |
| | | |
| | | |
| | |
| | | /** 是否删除 0未删除 1已删除 */ |
| | | @TableField("del_flag") |
| | | @ApiModelProperty(value = "是否删除 0未删除 1已删除") |
| | | @TableLogic |
| | | private Boolean delFlag; |
| | | |
| | | public LocalDateTime getCreateTime() { |
| | |
| | | package com.ruoyi.common.core.web.page; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | |
| | | * 分页参数,当前页码 |
| | | */ |
| | | @ApiModelProperty(value = "分页参数,当前页码") |
| | | @TableField(exist = false) |
| | | private Integer pageCurr = 1; |
| | | /** |
| | | * 分页参数,每页数量 |
| | | */ |
| | | @ApiModelProperty(value = "分页参数,每页数量,默认为10") |
| | | @TableField(exist = false) |
| | | private Integer pageSize = 10; |
| | | |
| | | public Integer getPageCurr() { |
| | |
| | | user.setShopName(storeById.getData().getName()); |
| | | } |
| | | } |
| | | Long count1 = appUserService.lambdaQuery().eq(AppUser::getVipId, 1).eq(AppUser::getTopInviteId, 1).count(); |
| | | Long count2 = appUserService.lambdaQuery().eq(AppUser::getVipId, 2).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count3 = appUserService.lambdaQuery().eq(AppUser::getVipId, 3).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count4 = appUserService.lambdaQuery().eq(AppUser::getVipId, 4).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count5 = appUserService.lambdaQuery().eq(AppUser::getVipId, 5).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count6 = appUserService.lambdaQuery().eq(AppUser::getVipId, 6).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count7 = appUserService.lambdaQuery().eq(AppUser::getVipId, 7).eq(AppUser::getTopInviteId, userId).count(); |
| | | Long count1 = appUserService.lambdaQuery().eq(AppUser::getVipId, 1).eq(AppUser::getInviteUserId, userId).count(); |
| | | Long count2 = appUserService.lambdaQuery().eq(AppUser::getVipId, 2).eq(AppUser::getInviteUserId, userId).count(); |
| | | Long count3 = appUserService.lambdaQuery().eq(AppUser::getVipId, 3).eq(AppUser::getInviteUserId, userId).count(); |
| | | Long count4 = appUserService.lambdaQuery().eq(AppUser::getVipId, 4).eq(AppUser::getInviteUserId, userId).count(); |
| | | Long count5 = appUserService.lambdaQuery().eq(AppUser::getVipId, 5).eq(AppUser::getInviteUserId, userId).count(); |
| | | Long count6 = appUserService.lambdaQuery().eq(AppUser::getVipId, 6).eq(AppUser::getInviteUserId, userId).count(); |
| | | Long count7 = appUserService.lambdaQuery().eq(AppUser::getVipId, 7).eq(AppUser::getInviteUserId, userId).count(); |
| | | user.setCount1(count1); |
| | | user.setCount2(count2); |
| | | user.setCount3(count3); |
| | |
| | | //推广人 |
| | | if (byId.getInviteUserId() != null) { |
| | | AppUser byId1 = appUserService.getById(byId.getInviteUserId()); |
| | | byId.setInviteUserName(byId1.getInviteUserName()); |
| | | byId.setInviteUserName(byId1.getName()); |
| | | } |
| | | //最后下单时间 |
| | | R<Order> lastOrder = remoteOrderGoodsClient.getLastOrder(id); |
| | | if (lastOrder.getData() != null) { |
| | | byId.setLastOrderTime(lastOrder.getData().getCreateTime()); |
| | | } |
| | | List<AppUser> list = appUserService.lambdaQuery().eq(AppUser::getInviteUserId, id).list(); |
| | | byId.setBottomUsers(list); |
| | | //消费总金额 |
| | | return R.ok(byId); |
| | | } |
| | |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | if(null != pointSetting){ |
| | | Integer everySharePoint = pointSetting.getEverySharePoint(); |
| | | Integer everySharePoint1 = everySharePoint; |
| | | Integer everySharePoint1 = 0; |
| | | if(1 == pointSetting.getWorkPointOpen()){ |
| | | everySharePoint1 = new BigDecimal(everySharePoint1).multiply(pointSetting.getWorkPoint().divide(new BigDecimal(100))).intValue(); |
| | | everySharePoint1 = new BigDecimal(everySharePoint).multiply(pointSetting.getWorkPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | Integer lavePoint = appUser.getLavePoint(); |
| | | appUser.setTotalPoint(appUser.getTotalPoint() + everySharePoint); |
| | | appUser.setLavePoint(appUser.getLavePoint() + everySharePoint); |
| | | appUser.setAvailablePoint(appUser.getAvailablePoint() + everySharePoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getWorkPointGift()){ |
| | | appUser.setTransferablePoint(appUser.getTransferablePoint() + everySharePoint1); |
| | | } |
| | | appUser.setTotalSharePoint(appUser.getTotalSharePoint() + everySharePoint); |
| | | appUserService.updateById(appUser); |
| | | //添加积分变动记录 |
| | |
| | | userCoupon.setAppUserId(userid); |
| | | if (data.getPeriodType()==1) { |
| | | userCoupon.setStartTime(data.getPeriodStartTime().atTime(0,0,0)); |
| | | userCoupon.setEndTime(data.getPeriodEndTime().atTime(0,0,0)); |
| | | userCoupon.setEndTime(data.getPeriodEndTime().atTime(23, 59, 59)); |
| | | }else { |
| | | userCoupon.setStartTime(now); |
| | | userCoupon.setEndTime(now.plusDays(data.getPeriodDays())); |
| | |
| | | userSignRecord.setPoint(pointSetting.getSignPoint()); |
| | | int signPoint = pointSetting.getSignPoint(); |
| | | if(signPoint > 0){ |
| | | int signPoint1 = signPoint; |
| | | int signPoint1 = 0; |
| | | if(1 == pointSetting.getWorkPointOpen()){ |
| | | signPoint1 = new BigDecimal(signPoint1).multiply(pointSetting.getWorkPoint().divide(new BigDecimal(100))).intValue(); |
| | | signPoint1 = new BigDecimal(signPoint).multiply(pointSetting.getWorkPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | Integer lavePoint = appUser.getLavePoint(); |
| | | appUser.setTotalPoint(appUser.getTotalPoint() + signPoint); |
| | | appUser.setLavePoint(appUser.getLavePoint() + signPoint); |
| | | appUser.setAvailablePoint(appUser.getAvailablePoint() + signPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getWorkPointGift()){ |
| | | appUser.setTransferablePoint(appUser.getTransferablePoint() + signPoint1); |
| | | } |
| | | appUser.setTotalSignPoint(appUser.getTotalSignPoint() + signPoint); |
| | | appUserService.updateById(appUser); |
| | | |
| | |
| | | @Data |
| | | public class BalanceQuery { |
| | | @ApiModelProperty("用户名称") |
| | | private String name; |
| | | private String userName; |
| | | |
| | | @ApiModelProperty("电话") |
| | | private String phone; |
| | | private String userPhone; |
| | | @ApiModelProperty("类型:1充值2提现3红包4分佣5商城购物") |
| | | private Integer changeType; |
| | | |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class UserChangeQuery { |
| | | @ApiModelProperty("用户名称") |
| | | private String name; |
| | | private String userName; |
| | | |
| | | @ApiModelProperty("电话") |
| | | private String phone; |
| | | private String userPhone; |
| | | |
| | | @ApiModelProperty(value = "变更类型 0降级1升级") |
| | | @TableField("change_type") |
| | | private Integer changeType; |
| | | |
| | | private LocalDate localDate1; |
| | | private LocalDate localDate2; |
| | | private LocalDateTime localDate1; |
| | | private LocalDateTime localDate2; |
| | | private Integer pageNum; |
| | | private Integer pageSize; |
| | | |
| | |
| | | appUser.setTotalDistributionAmount(BigDecimal.ZERO); |
| | | appUser.setBalance(BigDecimal.ZERO); |
| | | //新用户才能奖励积分,老用户注销重新注册没有 |
| | | AppUser old = this.getOne(new LambdaQueryWrapper<AppUser>().eq(AppUser::getPhone, registerAccount.getPhone()).eq(AppUser::getDelFlag, 0)); |
| | | long old = this.count(new LambdaQueryWrapper<AppUser>().eq(AppUser::getPhone, registerAccount.getPhone()).eq(AppUser::getDelFlag, 0)); |
| | | R<PointSetting> pointSettingR = pointSettingClient.getPointSetting(1); |
| | | if (R.isError(pointSettingR)){ |
| | | throw new RuntimeException("获取积分设置失败"); |
| | |
| | | throw new RuntimeException("积分设置不存在"); |
| | | } |
| | | Integer regisPoint = pointSetting.getRegisPoint(); |
| | | if(null == old){ |
| | | Integer regisPoint1 = regisPoint; |
| | | if(0 == old){ |
| | | Integer regisPoint1 = 0; |
| | | //计算可用积分比例 |
| | | if(1 == pointSetting.getGetRegisPointOpen()){ |
| | | regisPoint1 = new BigDecimal(regisPoint1).multiply(pointSetting.getGetRegisPoint().divide(new BigDecimal(100))).intValue(); |
| | | regisPoint1 = new BigDecimal(regisPoint).multiply(pointSetting.getGetRegisPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | appUser.setLavePoint(regisPoint); |
| | | appUser.setAvailablePoint(regisPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getGetRegisPointGift()){ |
| | | appUser.setTransferablePoint(regisPoint1); |
| | | } |
| | | appUser.setTotalRegisterPoint(regisPoint); |
| | | appUser.setTotalPoint(regisPoint); |
| | | } |
| | |
| | | } |
| | | this.save(appUser); |
| | | //增加积分变动记录 |
| | | if(null == old && regisPoint > 0){ |
| | | if(0 == old && regisPoint > 0){ |
| | | //构建积分流水记录 |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(7); |
| | |
| | | //拉新分佣 |
| | | if(null != appUser2){ |
| | | Integer newPoint = pointSetting.getNewPoint(); |
| | | Integer newPoint1 = newPoint; |
| | | Integer newPoint1 = 0; |
| | | if(1 == pointSetting.getGetRegisPointOpen()){ |
| | | newPoint1 = new BigDecimal(newPoint1).multiply(pointSetting.getGetRegisPoint().divide(new BigDecimal(100))).intValue(); |
| | | newPoint1 = new BigDecimal(newPoint).multiply(pointSetting.getGetRegisPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | appUser2.setLavePoint(appUser2.getLavePoint() + newPoint); |
| | | appUser2.setAvailablePoint(appUser2.getAvailablePoint() + newPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getGetRegisPointGift()){ |
| | | appUser2.setTransferablePoint(appUser2.getTransferablePoint() + newPoint1); |
| | | } |
| | | appUser2.setTotalInvitePoint(appUser2.getTotalInvitePoint() + newPoint); |
| | | appUser2.setTotalPoint(appUser2.getTotalPoint() + newPoint); |
| | | this.updateById(appUser2); |
| | |
| | | AppUser appUser3 = this.getById(appUser2.getInviteUserId()); |
| | | appUser3.setLavePoint(appUser3.getLavePoint() + newPoint); |
| | | appUser3.setAvailablePoint(appUser3.getAvailablePoint() + newPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getGetRegisPointGift()){ |
| | | appUser3.setTransferablePoint(appUser3.getTransferablePoint() + newPoint1); |
| | | } |
| | | appUser3.setTotalInvitePoint(appUser3.getTotalInvitePoint() + newPoint); |
| | | appUser3.setTotalPoint(appUser3.getTotalPoint() + newPoint); |
| | | this.updateById(appUser3); |
| | |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | if(null != pointSetting){ |
| | | int hourPoint = pointSetting.getHourPoint().intValue(); |
| | | int hourPoint1 = hourPoint; |
| | | int hourPoint1 = 0; |
| | | if(1 == pointSetting.getWorkPointOpen()){ |
| | | hourPoint1 = new BigDecimal(hourPoint1).multiply(pointSetting.getWorkPoint().divide(new BigDecimal(100))).intValue(); |
| | | hourPoint1 = new BigDecimal(hourPoint).multiply(pointSetting.getWorkPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | Integer lavePoint = appUser.getLavePoint(); |
| | | appUser.setTotalPoint(appUser.getTotalPoint() + hourPoint); |
| | | appUser.setLavePoint(appUser.getLavePoint() + hourPoint); |
| | | appUser.setAvailablePoint(appUser.getAvailablePoint() + hourPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getWorkPointGift()){ |
| | | appUser.setTransferablePoint(appUser.getTransferablePoint() + hourPoint1); |
| | | } |
| | | appUser.setTotalHourPoint(appUser.getTotalHourPoint() + hourPoint); |
| | | this.updateById(appUser); |
| | | //添加积分变动记录 |
| | |
| | | import javax.annotation.Resource; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static org.aspectj.util.LangUtil.split; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | continue; |
| | | } |
| | | PaymentUserCouponVo couponInfoVo = new PaymentUserCouponVo(); |
| | | couponInfoVo.setId(userCoupon.getId()); |
| | | couponInfoVo.setId(userCoupon.getId().toString()); |
| | | couponInfoVo.setName(couponInfo.getCouponName()); |
| | | couponInfoVo.setCouponType(couponInfo.getCouponType()); |
| | | couponInfoVo.setConditionAmount(couponInfo.getConditionAmount()); |
| | | couponInfoVo.setDiscountAmount(couponInfo.getDiscountAmount()); |
| | | couponInfoVo.setMoneyAmount(couponInfo.getMoneyAmount()); |
| | | couponInfoVo.setDiscount(couponInfo.getDiscount()); |
| | | couponInfoVo.setPeriodEndTime(couponInfo.getPeriodStartTime().format(formatter)); |
| | | couponInfoVo.setPeriodStartTime(couponInfo.getPeriodStartTime().format(formatter)); |
| | | couponInfoVo.setPeriodEndTime(couponInfo.getPeriodEndTime().format(formatter)); |
| | | String forGoodIds = couponInfo.getForGoodIds(); |
| | | Integer instant = JSON.parseArray(forGoodIds).getInteger(0); |
| | | if(-1 == instant){ |
| | | String[] split = forGoodIds.split(","); |
| | | if("-1".equals(forGoodIds)){ |
| | | couponInfoVo.setForGoodIds(null); |
| | | }else{ |
| | | couponInfoVo.setForGoodIds(JSON.parseArray(forGoodIds, Integer.class)); |
| | | couponInfoVo.setForGoodIds(Arrays.asList(split)); |
| | | } |
| | | couponInfoVo.setAvailable(false); |
| | | infoVoList.add(couponInfoVo); |
| | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | UserPointDetailVO userPointDetailVO = new UserPointDetailVO(); |
| | | userPointDetailVO.setType(p.getType()); |
| | | userPointDetailVO.setVariablePoint(p.getVariablePoint()); |
| | | userPointDetailVO.setCreateTime(p.getCreateTime()); |
| | | String format = p.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | userPointDetailVO.setCreateTime(format); |
| | | return userPointDetailVO; |
| | | }).collect(Collectors.toList()); |
| | | } |
| | |
| | | VipSetting vipSetting = vipSettingService.getVipSettingById(4); |
| | | // 获取通过消费积分达成会员等级的开关 |
| | | Integer vipLevelUpShopRole = vipSetting.getVipLevelUpShopRole(); |
| | | if (null != vipLevelUpShopRole && vipLevelUpShopRole == 1){ |
| | | |
| | | // 获取指定购买商品 |
| | | boolean b = false; |
| | | String[] split = vipSetting.getGoodIds().split(","); |
| | | for (String s : split) { |
| | | R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, Integer.valueOf(s)); |
| | | if (R.isSuccess(orderListByUserIdAndGoodsId)){ |
| | | List<Order> orderList = orderListByUserIdAndGoodsId.getData(); |
| | | if (orderList.size() > 0){ |
| | | b = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if (b && null != vipLevelUpShopRole && vipLevelUpShopRole == 1){ |
| | | // 消费积分阈值 |
| | | Integer vipLevelUpShop = vipSetting.getVipLevelUpShop(); |
| | | // 返佣积分阈值 |
| | | Integer vipLevelUpShare = vipSetting.getVipLevelUpShare(); |
| | | // 判断是否满足消费积分和返佣积分 |
| | | if (shopPoint >=vipLevelUpShop && sharePoint >= vipLevelUpShare){ |
| | | if (shopPoint.compareTo(vipLevelUpShop) >= 0 && sharePoint.compareTo(vipLevelUpShare) >= 0){ |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | Integer vipLevelUpNumRole = vipSetting.getVipLevelUpNumRole(); |
| | | if (null != vipLevelUpNumRole && vipLevelUpNumRole == 1){ |
| | | if (b && null != vipLevelUpNumRole && vipLevelUpNumRole == 1){ |
| | | // 直推钻石用户数阈值 |
| | | Integer vipDirectNum = vipSetting.getVipDirectNum(); |
| | | // 获取用户直推钻石用户数量 |
| | | long userDiamondsCount = appUserService.count(new LambdaQueryWrapper<AppUser>() |
| | | .eq(AppUser::getInviteUserId, userId) |
| | | .eq(AppUser::getVipId, 3)); |
| | | .eq(AppUser::getDelFlag, 0) |
| | | .eq(AppUser::getStatus, 1) |
| | | .gt(AppUser::getVipId, 2)); |
| | | // 判断是否满足直推钻石用户数量 |
| | | if (userDiamondsCount >= vipDirectNum){ |
| | | return true; |
| | | return userDiamondsCount >= vipDirectNum.longValue(); |
| | | } |
| | | } |
| | | // 获取指定购买商品 |
| | | R<List<VipGood>> vipGoodsByVipId = vipGoodClient.getVipGoodsByVipId(4); |
| | | if (R.isSuccess(vipGoodsByVipId)){ |
| | | List<VipGood> vipGoods = vipGoodsByVipId.getData(); |
| | | if (CollectionUtil.isNotEmpty(vipGoods)){ |
| | | for (VipGood vipGood : vipGoods) { |
| | | Goods goods = JSON.parseObject(vipGood.getGood_json(), Goods.class); |
| | | R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, goods.getId()); |
| | | if (R.isSuccess(orderListByUserIdAndGoodsId)){ |
| | | List<Order> orderList = orderListByUserIdAndGoodsId.getData(); |
| | | if (CollectionUtil.isEmpty(orderList)){ |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | |
| | | VipSetting vipSetting = vipSettingService.getVipSettingById(5); |
| | | // 获取通过消费积分达成会员等级的开关 |
| | | Integer vipLevelUpShopRole = vipSetting.getVipLevelUpShopRole(); |
| | | if (null != vipLevelUpShopRole && vipLevelUpShopRole == 1){ |
| | | |
| | | boolean b = false; |
| | | String[] split = vipSetting.getGoodIds().split(","); |
| | | for (String s : split) { |
| | | R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, Integer.valueOf(s)); |
| | | if (R.isSuccess(orderListByUserIdAndGoodsId)){ |
| | | List<Order> orderList = orderListByUserIdAndGoodsId.getData(); |
| | | if (orderList.size() > 0){ |
| | | b = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if (b && null != vipLevelUpShopRole && vipLevelUpShopRole == 1){ |
| | | // 消费积分阈值 |
| | | Integer vipLevelUpShop = vipSetting.getVipLevelUpShop(); |
| | | // 返佣积分阈值 |
| | | Integer vipLevelUpShare = vipSetting.getVipLevelUpShare(); |
| | | // 判断是否满足消费积分和返佣积分 |
| | | if (shopPoint >=vipLevelUpShop && sharePoint >= vipLevelUpShare){ |
| | | if (shopPoint.compareTo(vipLevelUpShop) >= 0 && sharePoint.compareTo(vipLevelUpShare) >= 0){ |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | Integer vipLevelUpNumRole = vipSetting.getVipLevelUpNumRole(); |
| | | if (null != vipLevelUpNumRole && vipLevelUpNumRole == 1){ |
| | | if (b && null != vipLevelUpNumRole && vipLevelUpNumRole == 1){ |
| | | // 直推钻石用户数阈值 |
| | | Integer vipDirectNum = vipSetting.getVipDirectNum(); |
| | | // 获取用户直推钻石用户数量 |
| | |
| | | .eq(AppUser::getInviteUserId, userId) |
| | | .eq(AppUser::getVipId, 3)); |
| | | // 判断是否满足直推钻石用户数量 |
| | | if (userDiamondsCount >= vipDirectNum){ |
| | | return true; |
| | | return userDiamondsCount >= vipDirectNum.longValue(); |
| | | } |
| | | } |
| | | |
| | | R<List<VipGood>> vipGoodsByVipId = vipGoodClient.getVipGoodsByVipId(5); |
| | | if (R.isSuccess(vipGoodsByVipId)){ |
| | | List<VipGood> vipGoods = vipGoodsByVipId.getData(); |
| | | if (CollectionUtil.isNotEmpty(vipGoods)){ |
| | | for (VipGood vipGood : vipGoods) { |
| | | Goods goods = JSON.parseObject(vipGood.getGood_json(), Goods.class); |
| | | R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, goods.getId()); |
| | | if (R.isSuccess(orderListByUserIdAndGoodsId)){ |
| | | List<Order> orderList = orderListByUserIdAndGoodsId.getData(); |
| | | if (CollectionUtil.isEmpty(orderList)){ |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | |
| | | AppUser appUser = appUserService.getById(userId); |
| | | // 获取总代会员设置 |
| | | VipSetting vipSetting = vipSettingService.getVipSettingById(6); |
| | | |
| | | // 获取指定购买商品 |
| | | boolean b = false; |
| | | String[] split = vipSetting.getGoodIds().split(","); |
| | | for (String s : split) { |
| | | R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, Integer.valueOf(s)); |
| | | if (R.isSuccess(orderListByUserIdAndGoodsId)){ |
| | | List<Order> orderList = orderListByUserIdAndGoodsId.getData(); |
| | | if (orderList.size() > 0){ |
| | | b = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 获取会员等级是否必须达到代理 |
| | | Integer vipLevelUpProxyRole = vipSetting.getVipLevelUpProxyRole(); |
| | | if (vipLevelUpProxyRole == 1 && appUser.getVipId() == 5){ |
| | | if (b && vipLevelUpProxyRole == 1 && appUser.getVipId() == 5){ |
| | | return true; |
| | | } |
| | | |
| | |
| | | Integer sharePoint = appUser.getSharePoint(); |
| | | // 获取通过消费积分达成会员等级的开关 |
| | | Integer vipLevelUpShopRole = vipSetting.getVipLevelUpShopRole(); |
| | | if (null != vipLevelUpShopRole && vipLevelUpShopRole == 1){ |
| | | if (b && null != vipLevelUpShopRole && vipLevelUpShopRole == 1){ |
| | | // 消费积分阈值 |
| | | Integer vipLevelUpShop = vipSetting.getVipLevelUpShop(); |
| | | // 返佣积分阈值 |
| | | Integer vipLevelUpShare = vipSetting.getVipLevelUpShare(); |
| | | // 判断是否满足消费积分和返佣积分 |
| | | if (shopPoint >=vipLevelUpShop && sharePoint >= vipLevelUpShare){ |
| | | if (shopPoint.compareTo(vipLevelUpShop) >= 0 && sharePoint.compareTo(vipLevelUpShare) >= 0){ |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | Integer vipLevelUpNumRole = vipSetting.getVipLevelUpNumRole(); |
| | | if (null != vipLevelUpNumRole && vipLevelUpNumRole == 1){ |
| | | if (b && null != vipLevelUpNumRole && vipLevelUpNumRole == 1){ |
| | | // 直推代理用户数阈值 |
| | | Integer vipDirectNum = vipSetting.getVipDirectNum(); |
| | | // 准代理用户数阈值 |
| | |
| | | .eq(AppUser::getVipId, 4)); |
| | | |
| | | // 判断是否满足直推代理用户数量和准代理数量 |
| | | if (userAgentList.size() >= vipDirectNum && userQuasiAgentCount >= vipDirectVipNum){ |
| | | return true; |
| | | return userAgentList.size() >= vipDirectNum && userQuasiAgentCount >= vipDirectVipNum.longValue(); |
| | | } |
| | | } |
| | | // 获取指定购买商品 |
| | | R<List<VipGood>> vipGoodsByVipId = vipGoodClient.getVipGoodsByVipId(5); |
| | | if (R.isSuccess(vipGoodsByVipId)){ |
| | | List<VipGood> vipGoods = vipGoodsByVipId.getData(); |
| | | if (CollectionUtil.isNotEmpty(vipGoods)){ |
| | | for (VipGood vipGood : vipGoods) { |
| | | Goods goods = JSON.parseObject(vipGood.getGood_json(), Goods.class); |
| | | R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, goods.getId()); |
| | | if (R.isSuccess(orderListByUserIdAndGoodsId)){ |
| | | List<Order> orderList = orderListByUserIdAndGoodsId.getData(); |
| | | if (CollectionUtil.isEmpty(orderList)){ |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | |
| | | Integer sharePoint = appUser.getSharePoint(); |
| | | // 合伙人会员设置 |
| | | VipSetting vipSetting = vipSettingService.getVipSettingById(7); |
| | | // 获取指定购买商品 |
| | | boolean b = false; |
| | | String[] split = vipSetting.getGoodIds().split(","); |
| | | for (String s : split) { |
| | | R<List<Order>> orderListByUserIdAndGoodsId = remoteOrderGoodsClient.getOrderListByUserIdAndGoodsId(userId, Integer.valueOf(s)); |
| | | if (R.isSuccess(orderListByUserIdAndGoodsId)){ |
| | | List<Order> orderList = orderListByUserIdAndGoodsId.getData(); |
| | | if (orderList.size() > 0){ |
| | | b = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 获取通过消费积分达成会员等级的开关 |
| | | Integer vipLevelUpShopRole = vipSetting.getVipLevelUpShopRole(); |
| | | if (null != vipLevelUpShopRole && vipLevelUpShopRole == 1){ |
| | | if (b && null != vipLevelUpShopRole && vipLevelUpShopRole == 1){ |
| | | // 消费积分阈值 |
| | | Integer vipLevelUpShop = vipSetting.getVipLevelUpShop(); |
| | | // 返佣积分阈值 |
| | | Integer vipLevelUpShare = vipSetting.getVipLevelUpShare(); |
| | | // 判断是否满足消费积分和返佣积分 |
| | | if (shopPoint >=vipLevelUpShop && sharePoint >= vipLevelUpShare){ |
| | | if (shopPoint.compareTo(vipLevelUpShop) >= 0 && sharePoint.compareTo(vipLevelUpShare) >= 0){ |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | Integer vipLevelUpNumRole = vipSetting.getVipLevelUpNumRole(); |
| | | if (null != vipLevelUpNumRole && vipLevelUpNumRole == 1){ |
| | | if (b && null != vipLevelUpNumRole && vipLevelUpNumRole == 1){ |
| | | // 直推代理用户数阈值 |
| | | Integer vipDirectNum = vipSetting.getVipDirectNum(); |
| | | // 准代理用户数阈值 |
| | |
| | | // 判断是否满足直推代理用户数量和准代理数量 |
| | | return userTotalAgentList.size() >= vipTeamVipNum && userAgentList.size() >= vipDirectNum && |
| | | userQuasiAgentCount >= vipDirectVipNum; |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | private Integer variablePoint; |
| | | |
| | | @ApiModelProperty(value = "变动时间") |
| | | private LocalDateTime createTime; |
| | | private String createTime; |
| | | |
| | | } |
| | |
| | | from t_balance_change_record 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 test="agentQuery.userName != null and agentQuery.userName != ''"> |
| | | and t2.name like concat('%',#{agentQuery.userName},'%') |
| | | </if> |
| | | <if test="agentQuery.phone != null and agentQuery.phone != ''"> |
| | | and t2.phone like concat('%',#{agentQuery.phone},'%') |
| | | <if test="agentQuery.userPhone != null and agentQuery.userPhone != ''"> |
| | | and t2.phone like concat('%',#{agentQuery.userPhone},'%') |
| | | </if> |
| | | <if test="agentQuery.changeType != null"> |
| | | and t1.change_type = #{agentQuery.changeType} |
| | |
| | | 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 test="userChangeLog.userName !=null and userChangeLog.userName !=''"> |
| | | and t2.name like concat('%',#{userChangeLog.userName},'%') |
| | | </if> |
| | | <if test="userChangeLog.phone !=null and userChangeLog.phone !=''"> |
| | | and t2.phone like concat('%',#{userChangeLog.phone},'%') |
| | | <if test="userChangeLog.userPhone !=null and userChangeLog.userPhone !=''"> |
| | | and t2.phone like concat('%',#{userChangeLog.userPhone},'%') |
| | | </if> |
| | | <if test="userChangeLog.changeType !=null"> |
| | | and t1.change_type = #{userChangeLog.phone.changeType} |
| | | and t1.change_type = #{userChangeLog.changeType} |
| | | </if> |
| | | <if test="userChangeLog.localDate1 !=null"> |
| | | and DATE(t1.create_time) between #{userChangeLog.localDate1} and #{userChangeLog.localDate2} |
| | | and t1.create_time between #{userChangeLog.localDate1} and #{userChangeLog.localDate2} |
| | | </if> |
| | | </where> |
| | | order by t1.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | if (CollectionUtil.isNotEmpty(goodsShops)){ |
| | | for (GoodsShop goodsShop : goodsShops) { |
| | | R<Shop> shopR = shopClient.getShopById(goodsShop.getShopId()); |
| | | if (R.isSuccess(shopR)){ |
| | | if (R.isSuccess(shopR) && null != shopR.getData()){ |
| | | VerifiableShopVo verifiableShopVo = new VerifiableShopVo(); |
| | | verifiableShopVo.setId(shopR.getData().getId()); |
| | | verifiableShopVo.setName(shopR.getData().getName()); |
| | |
| | | //直推上级 |
| | | if("1".equals(s)){ |
| | | ztsj_price = ztsj_price.add(superiorSubcommission); |
| | | ztsj_point += superiorRebatePoints; |
| | | } |
| | | //直帮上级 |
| | | if("2".equals(s)){ |
| | | zbsj_price = zbsj_price.add(superiorSubcommission); |
| | | } |
| | | } |
| | | split = orderGood.getSuperiorType().split(","); |
| | | for (String s : split) { |
| | | //直推上级 |
| | | if("1".equals(s)){ |
| | | ztsj_point += superiorRebatePoints; |
| | | } |
| | | //直帮上级 |
| | | if("2".equals(s)){ |
| | | zbsj_point += superiorRebatePoints; |
| | | } |
| | | } |
| | |
| | | } |
| | | if(ztsj_point > 0){ |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | int earnPoint1 = ztsj_point; |
| | | int earnPoint1 = 0; |
| | | //计算可用积分比例 |
| | | if(null != pointSetting && 1 == pointSetting.getSharePointOpen()){ |
| | | earnPoint1 = new BigDecimal(earnPoint1).multiply(pointSetting.getSharePoint().divide(new BigDecimal(100))).intValue(); |
| | | earnPoint1 = new BigDecimal(ztsj_point).multiply(pointSetting.getSharePoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | inviteUser.setSharePoint(inviteUser.getSharePoint() + ztsj_point); |
| | | inviteUser.setLavePoint(inviteUser.getLavePoint() + ztsj_point); |
| | | inviteUser.setAvailablePoint(inviteUser.getAvailablePoint() + earnPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getSharePointGift()){ |
| | | inviteUser.setTransferablePoint(inviteUser.getTransferablePoint() + earnPoint1); |
| | | } |
| | | inviteUser.setTotalPoint(inviteUser.getTotalPoint() + ztsj_point); |
| | | } |
| | | appUserClient.editAppUserById(inviteUser); |
| | |
| | | } |
| | | if(zbsj_point > 0){ |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | int earnPoint1 = zbsj_point; |
| | | int earnPoint1 = 0; |
| | | //计算可用积分比例 |
| | | if(null != pointSetting && 1 == pointSetting.getSharePointOpen()){ |
| | | earnPoint1 = new BigDecimal(earnPoint1).multiply(pointSetting.getSharePoint().divide(new BigDecimal(100))).intValue(); |
| | | earnPoint1 = new BigDecimal(zbsj_point).multiply(pointSetting.getSharePoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | superiorLeader.setSharePoint(superiorLeader.getSharePoint() + zbsj_point); |
| | | superiorLeader.setLavePoint(superiorLeader.getLavePoint() + zbsj_point); |
| | | superiorLeader.setAvailablePoint(superiorLeader.getAvailablePoint() + earnPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getSharePointGift()){ |
| | | superiorLeader.setTransferablePoint(superiorLeader.getTransferablePoint() + earnPoint1); |
| | | } |
| | | superiorLeader.setTotalPoint(superiorLeader.getTotalPoint() + zbsj_point); |
| | | } |
| | | appUserClient.editAppUserById(superiorLeader); |
| | |
| | | } |
| | | if(hxmd_point > 0){ |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | int earnPoint1 = hxmd_point; |
| | | int earnPoint1 = 0; |
| | | //计算可用积分比例 |
| | | if(null != pointSetting && 1 == pointSetting.getShopPointOpen()){ |
| | | earnPoint1 = new BigDecimal(earnPoint1).multiply(pointSetting.getShopPoint().divide(new BigDecimal(100))).intValue(); |
| | | earnPoint1 = new BigDecimal(hxmd_point).multiply(pointSetting.getShopPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | shopAppUser.setLavePoint(shopAppUser.getLavePoint() + hxmd_point); |
| | | shopAppUser.setAvailablePoint(shopAppUser.getAvailablePoint() + earnPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getShopPointGift()){ |
| | | shopAppUser.setTransferablePoint(shopAppUser.getTransferablePoint() + earnPoint1); |
| | | } |
| | | shopAppUser.setTotalPoint(shopAppUser.getTotalPoint() + hxmd_point); |
| | | shopAppUser.setShopAchievementPoint(shopAppUser.getShopAchievementPoint() + bdmdsj_point); |
| | | shopAppUser.setShopAchievementPoint(shopAppUser.getShopAchievementPoint() + hxmd_point); |
| | | //门店返佣 |
| | | shop.setShopAllPoint(shop.getShopAllPoint() + hxmd_point); |
| | | shop.setServerPoint(shop.getServerPoint() + hxmd_point); |
| | |
| | | Integer lavePoint = technicianAppUser.getLavePoint(); |
| | | if(js_point > 0){ |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | int earnPoint1 = js_point; |
| | | int earnPoint1 = 0; |
| | | //计算可用积分比例 |
| | | if(null != pointSetting && 1 == pointSetting.getPersonPointOpen()){ |
| | | earnPoint1 = new BigDecimal(earnPoint1).multiply(pointSetting.getPersonPoint().divide(new BigDecimal(100))).intValue(); |
| | | earnPoint1 = new BigDecimal(js_point).multiply(pointSetting.getPersonPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | technicianAppUser.setLavePoint(technicianAppUser.getLavePoint() + js_point); |
| | | technicianAppUser.setAvailablePoint(technicianAppUser.getAvailablePoint() + earnPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getPersonPointGift()){ |
| | | technicianAppUser.setTransferablePoint(technicianAppUser.getTransferablePoint() + earnPoint1); |
| | | } |
| | | technicianAppUser.setTotalPoint(technicianAppUser.getTotalPoint() + js_point); |
| | | technicianAppUser.setTotalPerformancePoint(technicianAppUser.getTotalPerformancePoint() + js_point); |
| | | } |
| | |
| | | } |
| | | if(bdmd_point > 0){ |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | int earnPoint1 = bdmd_point; |
| | | int earnPoint1 = 0; |
| | | //计算可用积分比例 |
| | | if(null != pointSetting && 1 == pointSetting.getShopSharePointOpen()){ |
| | | earnPoint1 = new BigDecimal(earnPoint1).multiply(pointSetting.getShopSharePoint().divide(new BigDecimal(100))).intValue(); |
| | | earnPoint1 = new BigDecimal(bdmd_point).multiply(pointSetting.getShopSharePoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | bdShopAppUser.setLavePoint(bdShopAppUser.getLavePoint() + bdmd_point); |
| | | bdShopAppUser.setAvailablePoint(bdShopAppUser.getAvailablePoint() + earnPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getShopSharePointGift()){ |
| | | bdShopAppUser.setTransferablePoint(bdShopAppUser.getTransferablePoint() + earnPoint1); |
| | | } |
| | | bdShopAppUser.setTotalPoint(bdShopAppUser.getTotalPoint() + bdmd_point); |
| | | bdShopAppUser.setShopSharePoint(bdShopAppUser.getShopSharePoint() + bdmdsj_point); |
| | | bdShopAppUser.setShopSharePoint(bdShopAppUser.getShopSharePoint() + bdmd_point); |
| | | //门店返佣 |
| | | shop1.setShopAllPoint(shop1.getShopAllPoint() + bdmd_point); |
| | | shop1.setSharePoint(shop1.getSharePoint() + bdmd_point); |
| | |
| | | } |
| | | |
| | | //上级门店分佣 |
| | | Integer pid = shopClient.getShopById(order.getShopId()).getData().getPid(); |
| | | Integer pid = shop1.getPid(); |
| | | Shop shop2 = shopClient.getShopById(pid).getData(); |
| | | if(null != shop2){ |
| | | AppUser sjShopAppUser = appUserClient.getAppUserById(shop2.getAppUserId()); |
| | |
| | | } |
| | | if(bdmdsj_point > 0){ |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | int earnPoint1 = bdmdsj_point; |
| | | int earnPoint1 = 0; |
| | | //计算可用积分比例 |
| | | if(null != pointSetting && 1 == pointSetting.getShopSharePointOpen()){ |
| | | earnPoint1 = new BigDecimal(earnPoint1).multiply(pointSetting.getShopSharePoint().divide(new BigDecimal(100))).intValue(); |
| | | earnPoint1 = new BigDecimal(bdmdsj_point).multiply(pointSetting.getShopSharePoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | sjShopAppUser.setLavePoint(sjShopAppUser.getLavePoint() + bdmdsj_point); |
| | | sjShopAppUser.setAvailablePoint(sjShopAppUser.getAvailablePoint() + earnPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getShopSharePointGift()){ |
| | | sjShopAppUser.setTransferablePoint(sjShopAppUser.getTransferablePoint() + earnPoint1); |
| | | } |
| | | sjShopAppUser.setTotalPoint(sjShopAppUser.getTotalPoint() + bdmdsj_point); |
| | | sjShopAppUser.setLowerLevelSharePoint(sjShopAppUser.getLowerLevelSharePoint() + bdmdsj_point); |
| | | //门店返佣 |
| | |
| | | List<PaymentUserCouponVo> data = userCouponClient.getPaymentUserCoupon(paymentUserCoupon).getData(); |
| | | if(null != data){ |
| | | for (PaymentUserCouponVo couponInfo : data) { |
| | | List<Integer> forGoodIds = couponInfo.getForGoodIds(); |
| | | List<String> forGoodIds = couponInfo.getForGoodIds(); |
| | | //全部商品适用 |
| | | if(null == forGoodIds){ |
| | | //满减券 |
| | |
| | | orderMoney = orderMoney.add(myShoppingCartVo.getCash().multiply(new BigDecimal(myShoppingCartVo.getNumber()))); |
| | | } |
| | | }else{ |
| | | orderPoint = goodsList.stream().mapToInt(MyShoppingCartVo::getPoint).sum(); |
| | | for (MyShoppingCartVo myShoppingCartVo : goodsList) { |
| | | orderPoint += (myShoppingCartVo.getPoint() * myShoppingCartVo.getNumber()); |
| | | } |
| | |
| | | if(null != shoppingCartPayment.getUserCouponId() && 3 != shoppingCartPayment.getPaymentType()){ |
| | | couponInfoVo = userCouponClient.getCouponInfo(shoppingCartPayment.getUserCouponId()).getData(); |
| | | String forGoodIds = couponInfoVo.getForGoodIds(); |
| | | List<Integer> parseArray = JSON.parseArray(forGoodIds, Integer.class); |
| | | String[] split = forGoodIds.split(","); |
| | | List<String> parseArray = Arrays.asList(split); |
| | | //全部商品 |
| | | if(parseArray.contains(-1)){ |
| | | if("-1".equals(forGoodIds)){ |
| | | //满减 |
| | | if(1 == couponInfoVo.getCouponType() && couponInfoVo.getConditionAmount().compareTo(paymentMoney) <= 0){ |
| | | paymentMoney = paymentMoney.subtract(couponInfoVo.getDiscountAmount()); |
| | |
| | | paymentMoney = BigDecimal.ZERO; |
| | | BigDecimal goodsMoney = BigDecimal.ZERO; |
| | | for (MyShoppingCartVo myShoppingCartVo : goodsList) { |
| | | Integer goodsId = myShoppingCartVo.getGoodsId(); |
| | | String goodsId = myShoppingCartVo.getGoodsId().toString(); |
| | | BigDecimal cash = myShoppingCartVo.getCash(); |
| | | if(parseArray.contains(goodsId)){ |
| | | goodsMoney = goodsMoney.add(cash); |
| | |
| | | //构建积分流水记录 |
| | | if(earnPoint > 0){ |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | int earnPoint1 = earnPoint; |
| | | int earnPoint1 = 0; |
| | | if(null != pointSetting && 1 == pointSetting.getBuyPointOpen()){ |
| | | earnPoint1 = new BigDecimal(earnPoint1).multiply(pointSetting.getBuyPoint().divide(new BigDecimal(100))).intValue(); |
| | | earnPoint1 = new BigDecimal(earnPoint).multiply(pointSetting.getBuyPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | appUser.setShopPoint(appUser.getShopPoint() + earnPoint); |
| | | appUser.setLavePoint(appUser.getLavePoint() + earnPoint); |
| | | appUser.setTotalPoint(appUser.getTotalPoint() + earnPoint); |
| | | appUser.setAvailablePoint(appUser.getAvailablePoint() + earnPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getBuyPointGift()){ |
| | | appUser.setTransferablePoint(appUser.getTransferablePoint() + earnPoint1); |
| | | } |
| | | |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(1); |
| | |
| | | |
| | | Integer lavePoint = appUser.getLavePoint(); |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | int earnPoint1 = earnPoint; |
| | | int earnPoint1 = 0; |
| | | //计算可用积分比例 |
| | | if(null != pointSetting && 1 == pointSetting.getBuyPointOpen()){ |
| | | earnPoint1 = new BigDecimal(earnPoint1).multiply(pointSetting.getBuyPoint().divide(new BigDecimal(100))).intValue(); |
| | | earnPoint1 = new BigDecimal(earnPoint).multiply(pointSetting.getBuyPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | //扣减订单支付积分 |
| | | appUser.setLavePoint(appUser.getLavePoint() - orderPoint); |
| | |
| | | appUser.setShopPoint(appUser.getShopPoint() + earnPoint); |
| | | appUser.setLavePoint(appUser.getLavePoint() + earnPoint); |
| | | appUser.setAvailablePoint(appUser.getAvailablePoint() + earnPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getBuyPointGift()){ |
| | | appUser.setTransferablePoint(appUser.getTransferablePoint() + earnPoint1); |
| | | } |
| | | appUser.setTotalPoint(appUser.getTotalPoint() + earnPoint); |
| | | appUser.setLastShopTime(LocalDateTime.now()); |
| | | appUserClient.editAppUserById(appUser); |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDate; |
| | | import java.util.Arrays; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | |
| | | @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)){ |
| | | if (!"-1".equals(forGoodIds) && StringUtils.isNotEmpty(forGoodIds)){ |
| | | List<Goods> goods = goodsService.listByIds(Arrays.asList(forGoodIds.split(","))); |
| | | byId.setGoods(goods); |
| | | byId.setGoodsNameList(goods.stream().map(Goods::getName).collect(Collectors.toList())); |
| | | } |
| | | String personIds = byId.getPersonIds(); |
| | | if (StringUtils.isNotEmpty(personIds)){ |
| | |
| | | public R<Void> edit(@RequestBody CouponInfo couponInfo) { |
| | | List<String> goodsNameList = couponInfo.getGoodsNameList(); |
| | | couponInfo.setGoodsNameJson(JSON.toJSONString(goodsNameList)); |
| | | if(couponInfo.getPeriodType() == 2){ |
| | | Integer periodDays = couponInfo.getPeriodDays(); |
| | | couponInfo.setPeriodStartTime(LocalDate.now()); |
| | | couponInfo.setPeriodEndTime(LocalDate.now().plusDays(periodDays)); |
| | | } |
| | | couponInfoService.updateById(couponInfo); |
| | | return R.ok(); |
| | | } |
| | |
| | | List<String> goodsNameList = couponInfo.getGoodsNameList(); |
| | | couponInfo.setGoodsNameJson(JSON.toJSONString(goodsNameList)); |
| | | couponInfo.setShelfStatus(1); |
| | | if(couponInfo.getPeriodType() == 2){ |
| | | Integer periodDays = couponInfo.getPeriodDays(); |
| | | couponInfo.setPeriodStartTime(LocalDate.now()); |
| | | couponInfo.setPeriodEndTime(LocalDate.now().plusDays(periodDays)); |
| | | } |
| | | couponInfoService.save(couponInfo); |
| | | return R.ok(); |
| | | } |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation(value = "商品管理-商品分类-删除", tags = {"管理后台"}) |
| | | public R<Void> delete(@RequestParam("id") Integer id){ |
| | | goodsCategoryService.removeById(id); |
| | | goodsCategoryService.update(new LambdaUpdateWrapper<GoodsCategory>().eq(GoodsCategory::getId, id).set(GoodsCategory::getDelFlag, 1)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "商品分类", tags = {"小程序-首页"}) |
| | | public R<List<GoodsCategory>> indexlist(){ |
| | | List<GoodsCategory> indexlist = goodsCategoryService.lambdaQuery() |
| | | .eq(GoodsCategory::getDelFlag, 0) |
| | | .orderByDesc(GoodsCategory::getCreateTime) |
| | | .last("limit 8") |
| | | .list(); |
| | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "商品分类列表", tags = {"小程序-商城-商城-首页-筛选"}) |
| | | public R<List<GoodsCategory>> list(){ |
| | | return R.ok(goodsCategoryService.list()); |
| | | return R.ok(goodsCategoryService.list(new LambdaQueryWrapper<GoodsCategory>().eq(GoodsCategory::getDelFlag, 0))); |
| | | } |
| | | |
| | | } |
| | |
| | | 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.plugins.pagination.PageDTO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.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; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import io.swagger.annotations.*; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @PutMapping("/editGoodsSort") |
| | | @ApiOperation(value = "商品修改排序", tags = {"管理后台-商品管理"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "商品id", name = "id", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "排序", name = "sort", dataType = "int", required = true), |
| | | }) |
| | | public R editGoodsSort(@RequestParam("id") Integer id, @RequestParam("sort") Integer sort){ |
| | | Goods goods = goodsService.getById(id); |
| | | goods.setSort(sort); |
| | | goodsService.updateById(goods); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 更新上/下架状态 |
| | | */ |
| | |
| | | */ |
| | | @GetMapping("/goodsList") |
| | | @ApiOperation(value = "热门商品列表", tags = {"小程序-商城-首页", "小程序-首页"}) |
| | | public R<TableDataInfo> goodsList(Goods goods){ |
| | | startPage(); |
| | | return R.ok(getDataTable(goodsService.goodsList(goods))); |
| | | public R<PageInfo<GoodsVO>> goodsList(Goods goods){ |
| | | return R.ok(goodsService.goodsList(goods)); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | @GetMapping("/getGoodsListByShopId") |
| | | @ApiOperation(value = "商品购买列表", tags = {"小程序-首页-门店详情"}) |
| | | public R<TableDataInfo> getGoodsListByShopId(@ApiParam("门店id") @RequestParam Integer shopId) { |
| | | startPage(); |
| | | return R.ok(getDataTable(goodsService.getGoodsListByShopId(shopId))); |
| | | public R<PageInfo<Goods>> getGoodsListByShopId(@ApiParam("门店id") Integer shopId, Integer pageCurr, Integer pageSize) { |
| | | PageInfo<Goods> pageInfo = new PageInfo(pageCurr, pageSize); |
| | | List<Goods> goodsList = goodsService.getGoodsListByShopId(pageInfo, shopId); |
| | | return R.ok(pageInfo.setRecords(goodsList)); |
| | | } |
| | | |
| | | |
| | |
| | | List<GoodsEvaluate> list = goodsEvaluateService.lambdaQuery().eq(GoodsEvaluate::getGoodsId, goodsId).list(); |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | | AppUser appUserById = appUserClient.getAppUserById(goodsEvaluate.getAppUserId()); |
| | | if(null != appUserById){ |
| | | goodsEvaluate.setUserName(appUserById.getName()); |
| | | goodsEvaluate.setAvatar(appUserById.getAvatar()); |
| | | goodsEvaluate.setIdStr(String.valueOf(goodsEvaluate.getId())); |
| | | } |
| | | } |
| | | return R.ok(list); |
| | | } |
| | |
| | | |
| | | private void buildDetail(GoodsEvaluate item) { |
| | | AppUser appUser = appUserClient.getAppUserById(item.getAppUserId()); |
| | | if (appUser == null){ |
| | | throw new RuntimeException("获取用户信息失败"); |
| | | if (appUser != null){ |
| | | item.setPhone(appUser.getPhone()); |
| | | item.setUserName(appUser.getName()); |
| | | } |
| | | Goods goods = goodsService.getById(item.getGoodsId()); |
| | | item.setGoodsName(goods.getName()); |
| | | item.setPhone(appUser.getPhone()); |
| | | item.setUserName(appUser.getName()); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.api.domain.GoodsShop; |
| | | import com.ruoyi.other.api.vo.GetGoodsShopByGoodsIds; |
| | | import com.ruoyi.other.service.GoodsService; |
| | | import com.ruoyi.other.service.GoodsShopService; |
| | | import com.ruoyi.other.vo.ShopGoodsList; |
| | | import com.ruoyi.other.vo.ShopGoodsListVo; |
| | |
| | | @Resource |
| | | private GoodsShopService goodsShopService; |
| | | |
| | | @Resource |
| | | private GoodsService goodsService; |
| | | |
| | | |
| | | /** |
| | | * 获取商品门店关系数据 |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.vo.GoodsVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | * @since 2024-11-20 |
| | | */ |
| | | public interface GoodsMapper extends BaseMapper<Goods> { |
| | | List<Goods> selectListByShopId(@Param("shopId") Integer shopId,@Param("vip") Integer vip); |
| | | List<Goods> selectListByShopId(PageInfo<Goods> pageInfo, @Param("shopId") Integer shopId,@Param("vip") Integer vip); |
| | | |
| | | IPage<Goods> selectManageGoodsList(@Param("page") IPage<Goods> page, @Param("goods") Goods goods); |
| | | |
| | | |
| | | /** |
| | | * 获取商品列表 |
| | | * @param pageInfo |
| | | * @param goodsCategoryId |
| | | * @param name |
| | | * @return |
| | | */ |
| | | List<GoodsVO> goodsList(PageInfo<GoodsVO> pageInfo, @Param("goodsCategoryId") Integer goodsCategoryId, @Param("name") String name); |
| | | } |
| | |
| | | |
| | | IPage<SeckillActivityVO> querySeckillActivity(@Param("page") Page<SeckillActivityVO> page,@Param("goods") Goods goods); |
| | | |
| | | SeckillActivityDetailVO selectDetail(Integer seckillActivityId); |
| | | SeckillActivityDetailVO selectDetail(@Param("seckillActivityId") Integer seckillActivityId, @Param("vip") Integer vip); |
| | | } |
| | |
| | | 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.common.core.web.page.PageInfo; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.vo.GoodsVO; |
| | | |
| | |
| | | */ |
| | | public interface GoodsService extends IService<Goods> { |
| | | |
| | | List<GoodsVO> goodsList(Goods goods); |
| | | PageInfo<GoodsVO> goodsList(Goods goods); |
| | | |
| | | GoodsVO goodsDetail(Long goodsId); |
| | | |
| | | List<Goods> getGoodsListByShopId(Integer shopId); |
| | | List<Goods> getGoodsListByShopId(PageInfo<Goods> pageInfo, Integer shopId); |
| | | |
| | | void addGoods(Goods goods); |
| | | |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | 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.core.web.page.PageInfo; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.feignClient.RemoteOrderGoodsClient; |
| | | import com.ruoyi.order.vo.Price; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | |
| | | private RemoteOrderGoodsClient remoteOrderGoodsClient; |
| | | |
| | | @Override |
| | | public List<GoodsVO> goodsList(Goods search) { |
| | | List<Goods> goodsList = this.list(new LambdaQueryWrapper<Goods>() |
| | | .eq(Goods::getStatus, GoodsStatus.UP.getCode()) |
| | | .eq(Objects.nonNull(search.getGoodsCategoryId()), Goods::getGoodsCategoryId, search.getGoodsCategoryId()) |
| | | .like(StringUtils.isNotEmpty(search.getName()), Goods::getName, search.getName())); |
| | | |
| | | List<GoodsVO> result = new ArrayList<>(); |
| | | public PageInfo<GoodsVO> goodsList(Goods search) { |
| | | PageInfo<GoodsVO> pageInfo = new PageInfo(search.getPageCurr(), search.getPageSize()); |
| | | List<GoodsVO> list = this.baseMapper.goodsList(pageInfo, search.getGoodsCategoryId(), search.getName()); |
| | | 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); |
| | | for (GoodsVO goods : list) { |
| | | R<Price> r = remoteOrderGoodsClient.getGoodsPrice(loginUserApplet.getUserid(), goods.getGoodsId(), null); |
| | | if (null != r.getData()){ |
| | | Price price = r.getData(); |
| | | goodsVO.setSellingPrice(price.getCash()); |
| | | goodsVO.setIntegral(price.getPoint()); |
| | | goods.setSellingPrice(price.getCash()); |
| | | goods.setIntegral(price.getPoint()); |
| | | } |
| | | result.add(goodsVO); |
| | | } |
| | | return result; |
| | | return pageInfo.setRecords(list); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | GoodsArea goodsArea = goodsAreaMapper.selectOne(new LambdaQueryWrapper<GoodsArea>() |
| | | .eq(GoodsArea::getGoodsId, goodsId) |
| | | .eq(GoodsArea::getVip, appUser.getVipId()) |
| | | .eq(GoodsArea::getProvinceCode, appUser.getProvinceCode()) |
| | | .eq(StringUtils.isNotEmpty(appUser.getCityCode()), GoodsArea::getCityCode, appUser.getCityCode()) |
| | | .eq(StringUtils.isNotEmpty(appUser.getDistrictCode()), GoodsArea::getDistrictsCode, appUser.getDistrictCode())); |
| | |
| | | goodsVO.setSellingPrice(sellingPrice); |
| | | goodsVO.setIntegral(integral); |
| | | |
| | | if(goods.getType() == 1){ |
| | | if(goods.getAppointStore() == 2){ |
| | | List<Shop> shopList = shopMapper.selectList(new LambdaQueryWrapper<Shop>() |
| | | .in(Shop::getDelFlag, 0)); |
| | |
| | | goodsVO.setShopList(shopList); |
| | | } |
| | | } |
| | | }else{ |
| | | List<Shop> shopList = shopMapper.selectList(new LambdaQueryWrapper<Shop>() |
| | | .in(Shop::getDelFlag, 0)); |
| | | goodsVO.setShopList(shopList); |
| | | } |
| | | return goodsVO; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<Goods> getGoodsListByShopId(Integer shopId) { |
| | | public List<Goods> getGoodsListByShopId(PageInfo<Goods> pageInfo, Integer shopId) { |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | | VipSetting vipSetting = vipSettingService.getVipSettingByUserId(loginUserApplet.getUserid()); |
| | | return goodsMapper.selectListByShopId(shopId, vipSetting.getId()); |
| | | return goodsMapper.selectListByShopId(pageInfo, shopId, vipSetting.getId()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | // 指定门店 |
| | | Integer appointStore = goods.getAppointStore(); |
| | | if (appointStore == 1){ |
| | | if (null != appointStore && appointStore == 1){ |
| | | List<GoodsShop> goodsShopList = goods.getGoodsShopList(); |
| | | if (CollectionUtils.isEmpty(goodsShopList)){ |
| | | throw new NullPointerException("请选择指定门店"); |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | 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.other.mapper.SeckillActivityInfoMapper; |
| | | import com.ruoyi.other.mapper.ShopMapper; |
| | | import com.ruoyi.other.service.GoodsSeckillService; |
| | | import com.ruoyi.other.service.GoodsService; |
| | | import com.ruoyi.other.service.SeckillActivityInfoService; |
| | | import com.ruoyi.other.vo.SeckillActivityDetailVO; |
| | | import com.ruoyi.other.vo.SeckillActivityVO; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | private AppUserClient appUserClient; |
| | | @Resource |
| | | private GoodsSeckillService goodsSeckillService; |
| | | @Resource |
| | | private GoodsService goodsService; |
| | | |
| | | @Override |
| | | public List<SeckillActivityVO> listSeckillActivity(Goods goods) { |
| | |
| | | |
| | | @Override |
| | | public SeckillActivityDetailVO detail(Integer seckillActivityId) { |
| | | SeckillActivityDetailVO seckillActivityDetailVO = seckillActivityInfoMapper.selectDetail(seckillActivityId); |
| | | Long goodsId = seckillActivityDetailVO.getGoodsId(); |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | | AppUser appUser = appUserClient.getAppUserById(userid); |
| | | SeckillActivityDetailVO seckillActivityDetailVO = seckillActivityInfoMapper.selectDetail(seckillActivityId, appUser.getVipId()); |
| | | Integer goodsId = seckillActivityDetailVO.getGoodsId(); |
| | | |
| | | Goods goods = goodsService.getById(goodsId); |
| | | List<Shop> shops; |
| | | if(goods.getAppointStore() == 1){ |
| | | List<Integer> shopIdList = goodsShopMapper.selectList(new LambdaQueryWrapper<GoodsShop>() |
| | | .eq(GoodsShop::getGoodsId, goodsId)).stream().map(GoodsShop::getShopId).collect(Collectors.toList()); |
| | | |
| | | List<String> shopNames = shopMapper.selectObjs(new LambdaQueryWrapper<Shop>() |
| | | shops = shopMapper.selectObjs(new LambdaQueryWrapper<Shop>() |
| | | .select(Shop::getName) |
| | | .in(Shop::getId, shopIdList)) |
| | | .stream() |
| | | .map(Object::toString) |
| | | .collect(Collectors.toList()); |
| | | seckillActivityDetailVO.setShopList(shopNames); |
| | | .in(shopIdList.size() > 0, Shop::getId, shopIdList)); |
| | | }else{ |
| | | shops = shopMapper.selectList(new LambdaUpdateWrapper<Shop>().eq(Shop::getDelFlag, 0)); |
| | | } |
| | | seckillActivityDetailVO.setShopList(shops); |
| | | return seckillActivityDetailVO; |
| | | } |
| | | |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.other.api.domain.ShopPoint; |
| | |
| | | import com.ruoyi.other.vo.ShopPointStatistics; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | IPage<ShopPoint> shopPointIPage = this.baseMapper.queryShpointPage(page, shopPoint); |
| | | shopPointStatistics.setShopPointIPage(shopPointIPage); |
| | | |
| | | LocalDateTime startTime = shopPoint.getStartTime(); |
| | | LocalDateTime endTime = shopPoint.getEndTime(); |
| | | if(null != startTime){ |
| | | List<ShopPoint> list = this.list(new LambdaUpdateWrapper<ShopPoint>().eq(ShopPoint::getShopId, shopPoint.getShopId()) |
| | | .last(" and create_time between '" + startTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + "' and '" + endTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + "'")); |
| | | List<String> date = new ArrayList<>(); |
| | | List<Map<String, Integer>> data = new ArrayList<>(); |
| | | String format = "MM.dd"; |
| | | while (true){ |
| | | if(startTime.isAfter(endTime)){ |
| | | break; |
| | | } |
| | | date.add(startTime.format(DateTimeFormatter.ofPattern(format))); |
| | | Map<String, Integer> map = new HashMap<>(); |
| | | //返佣积分 |
| | | LocalDateTime finalStartTime = startTime; |
| | | List<ShopPoint> collect = list.stream().filter(s -> s.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) |
| | | .equals(finalStartTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) && s.getType() == 2).collect(Collectors.toList()); |
| | | map.put("fyjf", collect.stream().mapToInt(ShopPoint::getVariablePoint).sum()); |
| | | |
| | | //服务积分 |
| | | List<ShopPoint> collect1 = list.stream().filter(s -> s.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) |
| | | .equals(finalStartTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) && s.getType() == 4).collect(Collectors.toList()); |
| | | map.put("fwjf", collect1.stream().mapToInt(ShopPoint::getVariablePoint).sum()); |
| | | //绑定下级门店返佣积分 |
| | | List<ShopPoint> collect2 = list.stream().filter(s -> s.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) |
| | | .equals(finalStartTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) && s.getType() == 3).collect(Collectors.toList()); |
| | | map.put("xjmdfyjf", collect2.stream().mapToInt(ShopPoint::getVariablePoint).sum()); |
| | | data.add(map); |
| | | startTime = startTime.plusDays(1); |
| | | } |
| | | Map<String, Object> brokenLine = new HashMap<>(); |
| | | brokenLine.put("date", date); |
| | | brokenLine.put("data", data); |
| | | shopPointStatistics.setBrokenLine(brokenLine); |
| | | } |
| | | return shopPointStatistics; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.other.vo; |
| | | |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | public class SeckillActivityDetailVO extends SeckillActivityVO{ |
| | | |
| | | @ApiModelProperty(value = "产品id") |
| | | private Long goodsId; |
| | | private Integer goodsId; |
| | | |
| | | @ApiModelProperty(value = "详情图,多个逗号分隔") |
| | | private String detailPicture; |
| | |
| | | private LocalDateTime endTime; |
| | | |
| | | @ApiModelProperty(value = "可用门店") |
| | | private List<String> shopList; |
| | | private List<Shop> shopList; |
| | | |
| | | @ApiModelProperty(value = "商品详情") |
| | | private String detail; |
| | |
| | | public class SeckillActivityVO { |
| | | |
| | | @ApiModelProperty(value = "活动id") |
| | | private Integer id; |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "商品id") |
| | | private Integer goodsId; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | private String goodsName; |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | @ApiModel("门店积分统计") |
| | |
| | | private Integer subShopCommissionPoint; |
| | | |
| | | private IPage<ShopPoint> shopPointIPage; |
| | | |
| | | @ApiModelProperty("折线图数据") |
| | | private Map<String, Object> brokenLine; |
| | | } |
| | |
| | | tci.send_type, |
| | | tci.need_point, |
| | | tci.person_type, |
| | | tci.person_ids |
| | | tci.person_ids, |
| | | tci.shelf_status |
| | | FROM |
| | | t_coupon_info tci |
| | | <where> |
| | |
| | | LEFT JOIN t_goods tg ON tg.id = tgs.goods_id |
| | | where ts.id = #{shopId} and ts.del_flag = 0 |
| | | <if test="vip != null"> |
| | | and FIND_IN_SET(#{vip}, commodity_authority) > 0 |
| | | and FIND_IN_SET(#{vip}, tg.commodity_authority) > 0 |
| | | </if> |
| | | ORDER BY tg.sale_num DESC |
| | | </select> |
| | |
| | | and tg.`status` = #{goods.status} |
| | | </if> |
| | | </where> |
| | | order by tg.sort desc |
| | | </select> |
| | | |
| | | |
| | | <select id="goodsList" resultType="com.ruoyi.other.vo.GoodsVO"> |
| | | select *, id as goodsId, name as goodsName from t_goods where status = 2 and del_flag = 0 |
| | | <if test="null != goodsCategoryId"> |
| | | and goods_category_id = #{goodsCategoryId} |
| | | </if> |
| | | <if test="null != name and '' != name"> |
| | | and name like CONCAT('%', #{name}, '%') |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | <select id="listSeckillActivity" resultType="com.ruoyi.other.vo.SeckillActivityVO"> |
| | | SELECT |
| | | tsai.id, |
| | | tg.id as goodsId, |
| | | tg.`name`, |
| | | tg.introduction, |
| | | tg.home_page_picture, |
| | |
| | | FROM |
| | | 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() AND tsai.del_flag = 0 |
| | | LEFT JOIN t_goods_seckill tgs ON tgs.seckill_activity_info_id = tsai.id and tgs.vip = #{vipId} |
| | | WHERE tsai.is_shelves = 1 AND tsai.del_flag = 0 |
| | | <if test="name != null and name != ''"> |
| | | AND tg.`name` LIKE concat('%',#{goodsName},'%') |
| | | </if> |
| | |
| | | AND tg.goods_category_id = #{goodsCategoryId} |
| | | </if> |
| | | <if test="vipId != null"> |
| | | AND find_in_set(#{vipId},tgs.vip) > 0 |
| | | AND tgs.vip in (0, -1, #{vipId}) |
| | | </if> |
| | | <if test="vipId == null"> |
| | | AND tgs.vip in (0, -1) |
| | | </if> |
| | | </select> |
| | | <select id="selectDetail" resultType="com.ruoyi.other.vo.SeckillActivityDetailVO"> |
| | | SELECT |
| | | tsai.id, |
| | | tsai.good_id as goodsId, |
| | | tg.`name`, |
| | | tg.introduction, |
| | | tg.home_page_picture, |
| | |
| | | tg.sale_num, |
| | | tsai.start_time, |
| | | tg.detail_picture, |
| | | tsal.end_time, |
| | | tsai.end_time, |
| | | tg.detail |
| | | FROM |
| | | 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 |
| | | LEFT JOIN t_goods_seckill tgs ON tgs.seckill_activity_info_id = tsai.id and tgs.vip = #{vip} |
| | | WHERE tsai.id = #{seckillActivityId} AND tsai.del_flag = 0 |
| | | </select> |
| | | <select id="querySeckillActivity" resultType="com.ruoyi.other.vo.SeckillActivityVO"> |