ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/feignClient/AppUserClient.java
@@ -49,10 +49,10 @@ @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") ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AgentApplication.java
@@ -76,7 +76,6 @@ @ApiModelProperty(value = "删除(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUser.java
@@ -77,7 +77,6 @@ @ApiModelProperty(value = "删除(0=否,1=是)") @TableField("del_flag") @TableLogic private Boolean delFlag; @ApiModelProperty(value = "0否1是第一次添加") @@ -228,6 +227,10 @@ @ApiModelProperty(value = "可用积分") @TableField("available_point") private Integer availablePoint; @ApiModelProperty(value = "可转增积分") @TableField("transferable_point") private Integer transferablePoint; @ApiModelProperty(value = "是否可更换推广人(0=否,1=是)") @TableField("change_promoter") ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/UserAddress.java
@@ -60,7 +60,6 @@ @ApiModelProperty(value = "删除(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/UserCancellationLog.java
@@ -34,7 +34,6 @@ @ApiModelProperty(value = "删除标志(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/UserChangeLog.java
@@ -35,7 +35,6 @@ @ApiModelProperty(value = "删除标志(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/UserClickLog.java
@@ -34,7 +34,6 @@ @ApiModelProperty(value = "删除标志(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/UserCoupon.java
@@ -35,7 +35,6 @@ @ApiModelProperty(value = "删除标志(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/UserSignRecord.java
@@ -51,7 +51,6 @@ @ApiModelProperty(value = "删除(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/WithdrawalRequests.java
@@ -34,7 +34,6 @@ @ApiModelProperty(value = "删除标志(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/vo/CouponInfoVo.java
@@ -34,7 +34,6 @@ @ApiModelProperty(value = "删除标志(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/vo/PaymentUserCouponVo.java
@@ -15,7 +15,7 @@ @ApiModel public class PaymentUserCouponVo { @ApiModelProperty("优惠券id") private Long id; private String id; @ApiModelProperty("优惠券名称") private String name; @ApiModelProperty("优惠券类型 1=满减券,2=代金券,3=折扣券,4=商品券") @@ -33,7 +33,7 @@ @ApiModelProperty("有效期结束时间") private String periodEndTime; @ApiModelProperty("适用商品id集合,为null表示全部适用") private List<Integer> forGoodIds; private List<String> forGoodIds; @ApiModelProperty("是否可用") private Boolean available; } ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/feignClient/RemoteOrderGoodsClient.java
@@ -23,42 +23,42 @@ * 查询指定商品订单 */ @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); } ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/model/Order.java
@@ -2,7 +2,6 @@ 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; @@ -162,7 +161,6 @@ @ApiModelProperty(value = "删除标志(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/model/OrderGood.java
@@ -55,7 +55,6 @@ @ApiModelProperty(value = "删除标志(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/model/RefundPass.java
@@ -65,7 +65,6 @@ @ApiModelProperty(value = "删除标志(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Banner.java
@@ -59,7 +59,6 @@ @ApiModelProperty(value = "删除标识(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/CouponInfo.java
@@ -36,7 +36,6 @@ @ApiModelProperty(value = "删除标志(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Goods.java
@@ -1,6 +1,7 @@ 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; @@ -23,7 +24,7 @@ @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; @@ -103,13 +104,12 @@ @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 = "添加时间") @@ -120,6 +120,10 @@ @TableField("status") private Integer status; @ApiModelProperty(value = "排序") @TableField("sort") private Integer sort; @TableField(exist = false) private Integer vipId; ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/GoodsBargainPrice.java
@@ -56,7 +56,6 @@ @ApiModelProperty(value = "删除(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/GoodsCategory.java
@@ -39,7 +39,6 @@ @ApiModelProperty(value = "删除(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/GoodsEvaluate.java
@@ -62,7 +62,6 @@ @ApiModelProperty(value = "删除(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/OrderActivityInfo.java
@@ -37,7 +37,6 @@ @ApiModelProperty(value = "删除标志(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/PointSetting.java
@@ -32,7 +32,6 @@ @ApiModelProperty(value = "删除标志(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/RedPackegeSet.java
@@ -34,7 +34,6 @@ @ApiModelProperty(value = "删除标志(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/SeckillActivityInfo.java
@@ -34,7 +34,6 @@ @ApiModelProperty(value = "删除标志(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Share.java
@@ -63,7 +63,6 @@ @ApiModelProperty(value = "删除状态(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java
@@ -163,7 +163,6 @@ @ApiModelProperty(value = "删除(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/ShopWithdraw.java
@@ -67,7 +67,6 @@ @ApiModelProperty(value = "删除(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Technician.java
@@ -68,7 +68,6 @@ @ApiModelProperty(value = "删除(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/TechnicianSubscribe.java
@@ -61,7 +61,6 @@ @ApiModelProperty(value = "删除(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/domain/BaseEntity.java
@@ -61,7 +61,6 @@ /** * 是否删除 1未删除 0已删除 */ @TableLogic @Excel(name = "是否删除 0未删除 1已删除") @TableField(exist = false) private Boolean disabled; ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/domain/BaseModel.java
@@ -48,7 +48,6 @@ /** 是否删除 0未删除 1已删除 */ @TableField("disabled") @ApiModelProperty(value = "是否删除 0未删除 1已删除") @TableLogic private Boolean disabled; ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/domain/BasePojo.java
@@ -28,7 +28,6 @@ /** 是否删除 0未删除 1已删除 */ @TableField("del_flag") @ApiModelProperty(value = "是否删除 0未删除 1已删除") @TableLogic private Boolean delFlag; public LocalDateTime getCreateTime() { ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/page/BasePage.java
@@ -1,5 +1,6 @@ package com.ruoyi.common.core.web.page; import com.baomidou.mybatisplus.annotation.TableField; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -15,11 +16,13 @@ * 分页参数,当前页码 */ @ApiModelProperty(value = "分页参数,当前页码") @TableField(exist = false) private Integer pageCurr = 1; /** * 分页参数,每页数量 */ @ApiModelProperty(value = "分页参数,每页数量,默认为10") @TableField(exist = false) private Integer pageSize = 10; public Integer getPageCurr() { ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
@@ -290,13 +290,13 @@ 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); @@ -554,13 +554,15 @@ //推广人 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); } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserShareController.java
@@ -63,14 +63,17 @@ 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); //添加积分变动记录 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java
@@ -156,8 +156,8 @@ UserCoupon userCoupon = new UserCoupon(); userCoupon.setAppUserId(userid); if (data.getPeriodType()==1) { userCoupon.setStartTime(data.getPeriodStartTime().atTime(0,0,0)); userCoupon.setEndTime(data.getPeriodEndTime().atTime(0,0,0)); userCoupon.setStartTime(data.getPeriodStartTime().atTime(0, 0, 0)); userCoupon.setEndTime(data.getPeriodEndTime().atTime(23, 59, 59)); }else { userCoupon.setStartTime(now); userCoupon.setEndTime(now.plusDays(data.getPeriodDays())); ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserSignRecordController.java
@@ -71,14 +71,17 @@ 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); ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/dto/BalanceQuery.java
@@ -8,10 +8,10 @@ @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; ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/dto/UserChangeQuery.java
@@ -5,21 +5,22 @@ 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; ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java
@@ -312,7 +312,7 @@ 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("获取积分设置失败"); @@ -322,14 +322,17 @@ 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); } @@ -352,7 +355,7 @@ } this.save(appUser); //增加积分变动记录 if(null == old && regisPoint > 0){ if(0 == old && regisPoint > 0){ //构建积分流水记录 UserPoint userPoint = new UserPoint(); userPoint.setType(7); @@ -368,12 +371,15 @@ //拉新分佣 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); @@ -394,6 +400,9 @@ 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); @@ -688,14 +697,17 @@ 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); //添加积分变动记录 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/UserCouponServiceImpl.java
@@ -14,8 +14,11 @@ 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> @@ -58,21 +61,21 @@ 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 forGoodIds = couponInfo.getForGoodIds(); 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); ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/UserPointServiceImpl.java
@@ -29,6 +29,7 @@ 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; @@ -82,7 +83,8 @@ 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()); } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/VipCenterServiceImpl.java
@@ -58,49 +58,44 @@ 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; } @@ -115,19 +110,32 @@ 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(); // 获取用户直推钻石用户数量 @@ -135,29 +143,8 @@ .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; } @@ -166,9 +153,24 @@ 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; } @@ -178,19 +180,19 @@ 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(); // 准代理用户数阈值 @@ -207,29 +209,8 @@ .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; } @@ -242,66 +223,79 @@ 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){ // 直推代理用户数阈值 Integer vipDirectNum = vipSetting.getVipDirectNum(); // 准代理用户数阈值 Integer vipDirectVipNum = vipSetting.getVipDirectVipNum(); // 总代用户数阈值 Integer vipTeamVipNum = vipSetting.getVipTeamVipNum(); // 获取开店数量阈值 Integer vipOpenShopNum = vipSetting.getVipOpenShopNum(); Integer vipLevelUpNumRole = vipSetting.getVipLevelUpNumRole(); if (b && null != vipLevelUpNumRole && vipLevelUpNumRole == 1){ // 直推代理用户数阈值 Integer vipDirectNum = vipSetting.getVipDirectNum(); // 准代理用户数阈值 Integer vipDirectVipNum = vipSetting.getVipDirectVipNum(); // 总代用户数阈值 Integer vipTeamVipNum = vipSetting.getVipTeamVipNum(); // 获取开店数量阈值 Integer vipOpenShopNum = vipSetting.getVipOpenShopNum(); // 获取直推用户有超过指定门店数量的用户 List<Long> userShopList = appUserService.list(new LambdaQueryWrapper<AppUser>() .eq(AppUser::getInviteUserId, userId)) .stream().map(AppUser::getId).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(userShopList)){ R<List<Shop>> r = shopClient.getShopByUserIds(userShopList); List<Shop> shopList = r.getData(); if (CollectionUtil.isNotEmpty(shopList)){ Map<Long, List<Shop>> shopUserMap = shopList.stream().collect(Collectors.groupingBy(Shop::getAppUserId)); // 获取直推用户有超过指定门店数量的用户 List<Long> userShopList = appUserService.list(new LambdaQueryWrapper<AppUser>() .eq(AppUser::getInviteUserId, userId)) .stream().map(AppUser::getId).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(userShopList)){ R<List<Shop>> r = shopClient.getShopByUserIds(userShopList); List<Shop> shopList = r.getData(); if (CollectionUtil.isNotEmpty(shopList)){ Map<Long, List<Shop>> shopUserMap = shopList.stream().collect(Collectors.groupingBy(Shop::getAppUserId)); // 查找 list 长度大于 3 的 key Set<Long> shopUserIdSet = shopUserMap.entrySet().stream() .filter(entry -> entry.getValue().size() >= vipOpenShopNum) .map(Map.Entry::getKey) .collect(Collectors.toSet()); // 查找 list 长度大于 3 的 key Set<Long> shopUserIdSet = shopUserMap.entrySet().stream() .filter(entry -> entry.getValue().size() >= vipOpenShopNum) .map(Map.Entry::getKey) .collect(Collectors.toSet()); // 获取用户直推总代理数量 List<AppUser> userTotalAgentList = appUserService.list(new LambdaQueryWrapper<AppUser>() .in(AppUser::getInviteUserId, shopUserIdSet) .eq(AppUser::getVipId, 6)); // 获取用户直推总代理数量 List<AppUser> userTotalAgentList = appUserService.list(new LambdaQueryWrapper<AppUser>() .in(AppUser::getInviteUserId, shopUserIdSet) .eq(AppUser::getVipId, 6)); // 获取用户直推代理用户数量 List<AppUser> userAgentList = appUserService.list(new LambdaQueryWrapper<AppUser>() .in(AppUser::getInviteUserId, shopUserIdSet) .eq(AppUser::getVipId, 5)); // 获取用户直推代理用户数量 List<AppUser> userAgentList = appUserService.list(new LambdaQueryWrapper<AppUser>() .in(AppUser::getInviteUserId, shopUserIdSet) .eq(AppUser::getVipId, 5)); // 代理下的准代理数量 List<Long> userQuasiAgent = userAgentList.stream().map(AppUser::getId).collect(Collectors.toList()); long userQuasiAgentCount = appUserService.count(new LambdaQueryWrapper<AppUser>() .in(AppUser::getInviteUserId, userQuasiAgent) .eq(AppUser::getVipId, 4)); // 代理下的准代理数量 List<Long> userQuasiAgent = userAgentList.stream().map(AppUser::getId).collect(Collectors.toList()); long userQuasiAgentCount = appUserService.count(new LambdaQueryWrapper<AppUser>() .in(AppUser::getInviteUserId, userQuasiAgent) .eq(AppUser::getVipId, 4)); // 判断是否满足直推代理用户数量和准代理数量 return userTotalAgentList.size() >= vipTeamVipNum && userAgentList.size() >= vipDirectNum && userQuasiAgentCount >= vipDirectVipNum; } // 判断是否满足直推代理用户数量和准代理数量 return userTotalAgentList.size() >= vipTeamVipNum && userAgentList.size() >= vipDirectNum && userQuasiAgentCount >= vipDirectVipNum; } } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/UserPointDetailVO.java
@@ -19,6 +19,6 @@ private Integer variablePoint; @ApiModelProperty(value = "变动时间") private LocalDateTime createTime; private String createTime; } ruoyi-service/ruoyi-account/src/main/resources/mapper/account/BalanceChangeRecordMapper.xml
@@ -7,11 +7,11 @@ 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} ruoyi-service/ruoyi-account/src/main/resources/mapper/account/UserChangeLogMapper.xml
@@ -22,19 +22,20 @@ 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> ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ShoppingCartController.java
@@ -180,7 +180,7 @@ 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()); ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/CommissionServiceImpl.java
@@ -102,11 +102,20 @@ //直推上级 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; } } @@ -140,14 +149,17 @@ } 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); @@ -192,14 +204,17 @@ } 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); @@ -254,15 +269,18 @@ } 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); @@ -336,13 +354,16 @@ 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); } @@ -387,15 +408,18 @@ } 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); @@ -463,7 +487,7 @@ } //上级门店分佣 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()); @@ -484,13 +508,16 @@ } 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); //门店返佣 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java
@@ -401,7 +401,7 @@ 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){ //满减券 @@ -630,7 +630,6 @@ 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()); } @@ -654,9 +653,10 @@ 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()); @@ -683,7 +683,7 @@ 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); @@ -928,14 +928,17 @@ //构建积分流水记录 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); @@ -993,10 +996,10 @@ 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); @@ -1005,6 +1008,9 @@ 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); ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/CouponInfoController.java
@@ -25,6 +25,7 @@ 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; @@ -74,11 +75,11 @@ @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)){ @@ -104,6 +105,11 @@ 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(); } @@ -128,6 +134,11 @@ 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(); } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java
@@ -2,6 +2,8 @@ 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; @@ -65,7 +67,7 @@ @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(); } @@ -76,6 +78,7 @@ @ApiOperation(value = "商品分类", tags = {"小程序-首页"}) public R<List<GoodsCategory>> indexlist(){ List<GoodsCategory> indexlist = goodsCategoryService.lambdaQuery() .eq(GoodsCategory::getDelFlag, 0) .orderByDesc(GoodsCategory::getCreateTime) .last("limit 8") .list(); @@ -84,7 +87,7 @@ @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))); } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java
@@ -4,17 +4,17 @@ 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; @@ -77,6 +77,23 @@ 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(); } /** * 更新上/下架状态 */ @@ -115,9 +132,8 @@ */ @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)); } @@ -126,9 +142,10 @@ */ @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)); } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java
@@ -50,9 +50,11 @@ List<GoodsEvaluate> list = goodsEvaluateService.lambdaQuery().eq(GoodsEvaluate::getGoodsId, goodsId).list(); for (GoodsEvaluate goodsEvaluate : list) { AppUser appUserById = appUserClient.getAppUserById(goodsEvaluate.getAppUserId()); goodsEvaluate.setUserName(appUserById.getName()); goodsEvaluate.setAvatar(appUserById.getAvatar()); goodsEvaluate.setIdStr(String.valueOf(goodsEvaluate.getId())); if(null != appUserById){ goodsEvaluate.setUserName(appUserById.getName()); goodsEvaluate.setAvatar(appUserById.getAvatar()); goodsEvaluate.setIdStr(String.valueOf(goodsEvaluate.getId())); } } return R.ok(list); } @@ -120,13 +122,12 @@ 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()); } /** ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsShopController.java
@@ -6,8 +6,10 @@ 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; @@ -31,6 +33,9 @@ @Resource private GoodsShopService goodsShopService; @Resource private GoodsService goodsService; /** ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/GoodsMapper.java
@@ -2,7 +2,9 @@ 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; @@ -16,7 +18,17 @@ * @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); } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/SeckillActivityInfoMapper.java
@@ -25,5 +25,5 @@ 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); } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/GoodsService.java
@@ -3,6 +3,7 @@ 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; @@ -18,11 +19,11 @@ */ 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); ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java
@@ -1,6 +1,7 @@ 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; @@ -9,6 +10,7 @@ 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; @@ -28,10 +30,7 @@ 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; @@ -71,28 +70,19 @@ 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 @@ -108,6 +98,7 @@ 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())); @@ -134,29 +125,35 @@ goodsVO.setSellingPrice(sellingPrice); goodsVO.setIntegral(integral); if(goods.getAppointStore() == 2){ 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<GoodsShop> goodsShopList = goodsShopMapper.selectList(new LambdaQueryWrapper<GoodsShop>() .eq(GoodsShop::getGoodsId, goodsId)); if (!CollectionUtils.isEmpty(goodsShopList)){ List<Integer> shopIds = goodsShopList.stream().map(GoodsShop::getShopId).collect(Collectors.toList()); List<Shop> shopList = shopMapper.selectList(new LambdaQueryWrapper<Shop>() .in(Shop::getId, shopIds)); goodsVO.setShopList(shopList); } } }else{ List<Shop> shopList = shopMapper.selectList(new LambdaQueryWrapper<Shop>() .in(Shop::getDelFlag, 0)); goodsVO.setShopList(shopList); }else{ List<GoodsShop> goodsShopList = goodsShopMapper.selectList(new LambdaQueryWrapper<GoodsShop>() .eq(GoodsShop::getGoodsId, goodsId)); if (!CollectionUtils.isEmpty(goodsShopList)){ List<Integer> shopIds = goodsShopList.stream().map(GoodsShop::getShopId).collect(Collectors.toList()); List<Shop> shopList = shopMapper.selectList(new LambdaQueryWrapper<Shop>() .in(Shop::getId, shopIds)); 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 @@ -173,7 +170,7 @@ // 指定门店 Integer appointStore = goods.getAppointStore(); if (appointStore == 1){ if (null != appointStore && appointStore == 1){ List<GoodsShop> goodsShopList = goods.getGoodsShopList(); if (CollectionUtils.isEmpty(goodsShopList)){ throw new NullPointerException("请选择指定门店"); ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/SeckillActivityInfoServiceImpl.java
@@ -1,6 +1,7 @@ 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; @@ -10,6 +11,7 @@ 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; @@ -18,6 +20,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -43,6 +46,8 @@ private AppUserClient appUserClient; @Resource private GoodsSeckillService goodsSeckillService; @Resource private GoodsService goodsService; @Override public List<SeckillActivityVO> listSeckillActivity(Goods goods) { @@ -54,19 +59,23 @@ @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(); 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>() .select(Shop::getName) .in(Shop::getId, shopIdList)) .stream() .map(Object::toString) .collect(Collectors.toList()); seckillActivityDetailVO.setShopList(shopNames); 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()); shops = shopMapper.selectObjs(new LambdaQueryWrapper<Shop>() .select(Shop::getName) .in(shopIdList.size() > 0, Shop::getId, shopIdList)); }else{ shops = shopMapper.selectList(new LambdaUpdateWrapper<Shop>().eq(Shop::getDelFlag, 0)); } seckillActivityDetailVO.setShopList(shops); return seckillActivityDetailVO; } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopPointServiceImpl.java
@@ -1,5 +1,6 @@ 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; @@ -9,6 +10,10 @@ 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; @@ -45,6 +50,42 @@ 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; } } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/SeckillActivityDetailVO.java
@@ -1,5 +1,6 @@ package com.ruoyi.other.vo; import com.ruoyi.other.api.domain.Shop; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -10,7 +11,7 @@ public class SeckillActivityDetailVO extends SeckillActivityVO{ @ApiModelProperty(value = "产品id") private Long goodsId; private Integer goodsId; @ApiModelProperty(value = "详情图,多个逗号分隔") private String detailPicture; @@ -19,7 +20,7 @@ private LocalDateTime endTime; @ApiModelProperty(value = "可用门店") private List<String> shopList; private List<Shop> shopList; @ApiModelProperty(value = "商品详情") private String detail; ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/SeckillActivityVO.java
@@ -12,7 +12,10 @@ public class SeckillActivityVO { @ApiModelProperty(value = "活动id") private Integer id; private String id; @ApiModelProperty(value = "商品id") private Integer goodsId; @ApiModelProperty(value = "商品名称") private String goodsName; ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/ShopPointStatistics.java
@@ -7,6 +7,7 @@ import lombok.Data; import java.util.List; import java.util.Map; @Data @ApiModel("门店积分统计") @@ -37,4 +38,7 @@ private Integer subShopCommissionPoint; private IPage<ShopPoint> shopPointIPage; @ApiModelProperty("折线图数据") private Map<String, Object> brokenLine; } ruoyi-service/ruoyi-other/src/main/resources/mapper/other/CouponInfoMapper.xml
@@ -24,7 +24,8 @@ tci.send_type, tci.need_point, tci.person_type, tci.person_ids tci.person_ids, tci.shelf_status FROM t_coupon_info tci <where> ruoyi-service/ruoyi-other/src/main/resources/mapper/other/GoodsMapper.xml
@@ -18,7 +18,7 @@ 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> @@ -57,5 +57,17 @@ 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> ruoyi-service/ruoyi-other/src/main/resources/mapper/other/SeckillActivityInfoMapper.xml
@@ -5,6 +5,7 @@ <select id="listSeckillActivity" resultType="com.ruoyi.other.vo.SeckillActivityVO"> SELECT tsai.id, tg.id as goodsId, tg.`name`, tg.introduction, tg.home_page_picture, @@ -15,8 +16,8 @@ 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> @@ -24,12 +25,16 @@ 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, @@ -38,12 +43,12 @@ 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">