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是第一次添加") 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
@@ -109,7 +109,6 @@ @ApiModelProperty(value = "删除(0=否,1=是)") @TableField("del_flag") @TableLogic private Integer delFlag; @ApiModelProperty(value = "添加时间") @@ -120,6 +119,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-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java
@@ -157,7 +157,7 @@ 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())); 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[] 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,20 +223,35 @@ 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(); // 准代理用户数阈值 @@ -300,8 +296,6 @@ // 判断是否满足直推代理用户数量和准代理数量 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-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; } } @@ -262,7 +271,7 @@ shopAppUser.setLavePoint(shopAppUser.getLavePoint() + hxmd_point); shopAppUser.setAvailablePoint(shopAppUser.getAvailablePoint() + 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); @@ -395,7 +404,7 @@ bdShopAppUser.setLavePoint(bdShopAppUser.getLavePoint() + bdmd_point); bdShopAppUser.setAvailablePoint(bdShopAppUser.getAvailablePoint() + 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 +472,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()); ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java
@@ -388,7 +388,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){ //满减券 @@ -641,9 +641,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()); @@ -670,7 +671,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); 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
@@ -12,9 +12,7 @@ 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 +75,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(); } /** * 更新上/下架状态 */ ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java
@@ -74,6 +74,7 @@ public List<GoodsVO> goodsList(Goods search) { List<Goods> goodsList = this.list(new LambdaQueryWrapper<Goods>() .eq(Goods::getStatus, GoodsStatus.UP.getCode()) .eq(Goods::getDelFlag, 0) .eq(Objects.nonNull(search.getGoodsCategoryId()), Goods::getGoodsCategoryId, search.getGoodsCategoryId()) .like(StringUtils.isNotEmpty(search.getName()), Goods::getName, search.getName())); @@ -108,6 +109,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())); @@ -173,7 +175,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
@@ -55,7 +55,7 @@ @Override public SeckillActivityDetailVO detail(Integer seckillActivityId) { SeckillActivityDetailVO seckillActivityDetailVO = seckillActivityInfoMapper.selectDetail(seckillActivityId); Long goodsId = seckillActivityDetailVO.getGoodsId(); Integer goodsId = seckillActivityDetailVO.getGoodsId(); List<Integer> shopIdList = goodsShopMapper.selectList(new LambdaQueryWrapper<GoodsShop>() .eq(GoodsShop::getGoodsId, goodsId)).stream().map(GoodsShop::getShopId).collect(Collectors.toList()); ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/SeckillActivityDetailVO.java
@@ -10,7 +10,7 @@ public class SeckillActivityDetailVO extends SeckillActivityVO{ @ApiModelProperty(value = "产品id") private Long goodsId; private Integer goodsId; @ApiModelProperty(value = "详情图,多个逗号分隔") private String detailPicture; 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/resources/mapper/other/GoodsMapper.xml
@@ -57,5 +57,6 @@ and tg.`status` = #{goods.status} </if> </where> order by tg.sort desc </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,