Procházet zdrojové kódy

用户产生的直推奖加入条件分支,游客的加入到游客收益中,并加入商城首页

Yangzw před 4 měsíci
rodič
revize
9e661a29e0
22 změnil soubory, kde provedl 224 přidání a 73 odebrání
  1. 7 3
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ptprofit/vo/PtProfitRespVO.java
  2. 5 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ptprofit/vo/PtProfitSaveReqVO.java
  3. 8 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/ptprofit/PtProfitDO.java
  4. 6 0
      feifan-module-mall/feifan-module-product-biz/pom.xml
  5. 4 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/app/spu/AppProductSpuController.java
  6. 8 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/app/spu/vo/AppProductSpuDetailRespVO.java
  7. 2 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/dal/dataobject/spu/ProductSpuDO.java
  8. 7 4
      feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/controller/app/article/AppArticleController.java
  9. 26 0
      feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/controller/app/article/vo/article/HomeArticleRespVO.java
  10. 16 2
      feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/controller/app/diy/AppDiyPageController.java
  11. 2 1
      feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/dal/dataobject/diy/DiyPageDO.java
  12. 7 0
      feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/service/article/ArticleService.java
  13. 28 0
      feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/service/article/ArticleServiceImpl.java
  14. 3 2
      feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/service/diy/DiyPageService.java
  15. 6 2
      feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/service/diy/DiyPageServiceImpl.java
  16. 1 1
      feifan-module-mall/feifan-module-trade-biz/src/main/java/cn/newfeifan/mall/module/trade/dal/mysql/order/TradeOrderMapper.java
  17. 73 49
      feifan-module-mall/feifan-module-trade-biz/src/main/java/cn/newfeifan/mall/module/trade/service/order/TradeOrderUpdateServiceImpl.java
  18. 3 4
      feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/controller/app/auth/vo/AppAuthSmsRegisterReqVO.java
  19. 2 4
      feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/controller/app/auth/vo/AppAuthSocialRegisterReqVO.java
  20. 2 0
      feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/controller/app/user/vo/AppMemberUserInfoRespVO.java
  21. 4 0
      feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/dal/dataobject/user/MemberUserDO.java
  22. 4 1
      feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/service/user/MemberUserServiceImpl.java

+ 7 - 3
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ptprofit/vo/PtProfitRespVO.java

@@ -2,9 +2,6 @@ package cn.newfeifan.mall.module.distri.controller.admin.ptprofit.vo;
 
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;
-import java.util.*;
-import java.util.*;
-import org.springframework.format.annotation.DateTimeFormat;
 import java.time.LocalDateTime;
 import com.alibaba.excel.annotation.*;
 
@@ -33,4 +30,11 @@ public class PtProfitRespVO {
     @ExcelProperty("创建时间")
     private LocalDateTime createTime;
 
+    @Schema(description = "利润", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("利润")
+    private Long profit;
+
+    @Schema(description = "游客收益", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("游客收益")
+    private Long visitorEarnings;
 }

+ 5 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ptprofit/vo/PtProfitSaveReqVO.java

@@ -23,4 +23,9 @@ public class PtProfitSaveReqVO {
     @Schema(description = "平台总收益")
     private Long ptTotalAdd;
 
+    @Schema(description = "利润", requiredMode = Schema.RequiredMode.REQUIRED)
+    private Long profit;
+
+    @Schema(description = "游客收益", requiredMode = Schema.RequiredMode.REQUIRED)
+    private Long visitorEarnings;
 }

+ 8 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/ptprofit/PtProfitDO.java

@@ -36,5 +36,13 @@ public class PtProfitDO extends BaseDO {
      * 平台总收益
      */
     private Long ptTotalAdd;
+    /**
+     * 利润
+     */
+    private Long profit;
+    /**
+     * 游客收益
+     */
+    private Long visitorEarnings;
 
 }

+ 6 - 0
feifan-module-mall/feifan-module-product-biz/pom.xml

@@ -66,6 +66,12 @@
             <groupId>cn.newfeifan.zx</groupId>
             <artifactId>feifan-spring-boot-starter-excel</artifactId>
         </dependency>
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-module-sale-biz</artifactId>
+            <version>2.0.0-jdk8-snapshot</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 
 </project>

+ 4 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/app/spu/AppProductSpuController.java

@@ -17,6 +17,7 @@ import cn.newfeifan.mall.module.product.enums.spu.ProductSpuStatusEnum;
 import cn.newfeifan.mall.module.product.service.history.ProductBrowseHistoryService;
 import cn.newfeifan.mall.module.product.service.sku.ProductSkuService;
 import cn.newfeifan.mall.module.product.service.spu.ProductSpuService;
+import cn.newfeifan.mall.module.sale.service.shop.ShopService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.tags.Tag;
@@ -55,6 +56,8 @@ public class AppProductSpuController {
     private MemberLevelApi memberLevelApi;
     @Resource
     private MemberUserApi memberUserApi;
+    @Resource
+    private ShopService shopService;
 
     @GetMapping("/list-by-ids")
     @Operation(summary = "获得商品 SPU 列表")
@@ -118,6 +121,7 @@ public class AppProductSpuController {
         // 处理 vip 价格
         MemberLevelRespDTO memberLevel = getMemberLevel();
         spuVO.setVipPrice(calculateVipPrice(spuVO.getPrice(), memberLevel));
+        spuVO.setShopName(shopService.getShop(spu.getShopId()).getName());
         return success(spuVO);
     }
 

+ 8 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/app/spu/vo/AppProductSpuDetailRespVO.java

@@ -118,4 +118,12 @@ public class AppProductSpuDetailRespVO {
     @Schema(description = "高精度", requiredMode = Schema.RequiredMode.REQUIRED)
     private Boolean highPrecision;
 
+    @Schema(description = "店铺ID",  example = "123")
+    private Long shopId;
+
+    @Schema(description = "商户ID", example = "12")
+    private Long merchantId;
+
+    @Schema(description = "店铺名称", example = "小店")
+    private String shopName;
 }

+ 2 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/dal/dataobject/spu/ProductSpuDO.java

@@ -179,4 +179,6 @@ public class ProductSpuDO extends BaseDO {
      * 高精度价格
      */
     private BigDecimal highPrecisionPrice;
+    private Long shopId;
+    private Long merchantId;
 }

+ 7 - 4
feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/controller/app/article/AppArticleController.java

@@ -5,6 +5,7 @@ import cn.newfeifan.mall.framework.common.pojo.PageResult;
 import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
 import cn.newfeifan.mall.module.promotion.controller.app.article.vo.article.AppArticlePageReqVO;
 import cn.newfeifan.mall.module.promotion.controller.app.article.vo.article.AppArticleRespVO;
+import cn.newfeifan.mall.module.promotion.controller.app.article.vo.article.HomeArticleRespVO;
 import cn.newfeifan.mall.module.promotion.convert.article.ArticleConvert;
 import cn.newfeifan.mall.module.promotion.dal.dataobject.article.ArticleDO;
 import cn.newfeifan.mall.module.promotion.service.article.ArticleService;
@@ -13,10 +14,7 @@ import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.Parameters;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.util.List;
@@ -72,4 +70,9 @@ public class AppArticleController {
         return success(true);
     }
 
+    @GetMapping("/getHomeInfo")
+    @Operation(summary = "获取首页信息")
+    public CommonResult<HomeArticleRespVO> getHomeInfo(){
+        return success(articleService.getHomeInfo());
+    }
 }

+ 26 - 0
feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/controller/app/article/vo/article/HomeArticleRespVO.java

@@ -0,0 +1,26 @@
+package cn.newfeifan.mall.module.promotion.controller.app.article.vo.article;
+
+import cn.newfeifan.mall.module.promotion.dal.dataobject.article.ArticleDO;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Builder;
+import lombok.Data;
+import lombok.ToString;
+
+import java.util.List;
+
+@Schema(description = "管理后台 - 首页文章 Response VO")
+@Data
+@ToString(callSuper = true)
+@Builder
+public class HomeArticleRespVO {
+    @Schema(description = "轮播图文章列表")
+    private List<ArticleDO> slideshowArticleList;
+    @Schema(description = "公告")
+    private ArticleDO announcement;
+    @Schema(description = "平台简介")
+    private ArticleDO ptBriefIntroduction;
+    @Schema(description = "行业简介")
+    private ArticleDO industryIntroduction;
+    @Schema(description = "动态新闻")
+    private ArticleDO dynamicNews;
+}

+ 16 - 2
feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/controller/app/diy/AppDiyPageController.java

@@ -1,13 +1,18 @@
 package cn.newfeifan.mall.module.promotion.controller.app.diy;
 
 import cn.newfeifan.mall.framework.common.pojo.CommonResult;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
 import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+import cn.newfeifan.mall.module.promotion.controller.admin.diy.vo.page.DiyPagePageReqVO;
+import cn.newfeifan.mall.module.promotion.controller.admin.diy.vo.page.DiyPageRespVO;
 import cn.newfeifan.mall.module.promotion.controller.app.diy.vo.AppDiyPagePropertyRespVO;
+import cn.newfeifan.mall.module.promotion.convert.diy.DiyPageConvert;
 import cn.newfeifan.mall.module.promotion.dal.dataobject.diy.DiyPageDO;
 import cn.newfeifan.mall.module.promotion.service.diy.DiyPageService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -15,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
+import javax.validation.Valid;
 
 import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
 
@@ -30,9 +36,17 @@ public class AppDiyPageController {
     @GetMapping("/get")
     @Operation(summary = "获得装修页面")
     @Parameter(name = "id", description = "编号", required = true, example = "1024")
-    public CommonResult<AppDiyPagePropertyRespVO> getDiyPage(@RequestParam("id") Long id) {
-        DiyPageDO diyPage = diyPageService.getDiyPage(id);
+    public CommonResult<AppDiyPagePropertyRespVO> getDiyPage(@RequestParam("shopId") Long shopId,@RequestParam("merchantId") Long merchantId) {
+        DiyPageDO diyPage = diyPageService.getDiyPage(shopId, merchantId);
         return success(BeanUtils.toBean(diyPage, AppDiyPagePropertyRespVO.class));
     }
 
+    @GetMapping("/page")
+    @Operation(summary = "获得装修页面分页")
+    @PreAuthorize("@ss.hasPermission('promotion:diy-page:query')")
+    public CommonResult<PageResult<DiyPageRespVO>> getDiyPagePage(@Valid DiyPagePageReqVO pageVO) {
+        PageResult<DiyPageDO> pageResult = diyPageService.getDiyPagePage(pageVO);
+        return success(DiyPageConvert.INSTANCE.convertPage(pageResult));
+    }
+
 }

+ 2 - 1
feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/dal/dataobject/diy/DiyPageDO.java

@@ -32,7 +32,6 @@ public class DiyPageDO extends BaseDO {
     private Long id;
     /**
      * 装修模板编号
-     *
      * 关联 {@link DiyTemplateDO#getId()}
      */
     private Long templateId;
@@ -54,4 +53,6 @@ public class DiyPageDO extends BaseDO {
      */
     private String property;
 
+    private Long shopId;
+    private Long merchantId;
 }

+ 7 - 0
feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/service/article/ArticleService.java

@@ -5,6 +5,7 @@ import cn.newfeifan.mall.module.promotion.controller.admin.article.vo.article.Ar
 import cn.newfeifan.mall.module.promotion.controller.admin.article.vo.article.ArticlePageReqVO;
 import cn.newfeifan.mall.module.promotion.controller.admin.article.vo.article.ArticleUpdateReqVO;
 import cn.newfeifan.mall.module.promotion.controller.app.article.vo.article.AppArticlePageReqVO;
+import cn.newfeifan.mall.module.promotion.controller.app.article.vo.article.HomeArticleRespVO;
 import cn.newfeifan.mall.module.promotion.dal.dataobject.article.ArticleDO;
 
 import javax.validation.Valid;
@@ -97,4 +98,10 @@ public interface ArticleService {
      */
     void addArticleBrowseCount(Long id);
 
+    /**
+     * 获得首页信息
+     *
+     * @return 首页信息
+     */
+    HomeArticleRespVO getHomeInfo();
 }

+ 28 - 0
feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/service/article/ArticleServiceImpl.java

@@ -6,10 +6,12 @@ import cn.newfeifan.mall.module.promotion.controller.admin.article.vo.article.Ar
 import cn.newfeifan.mall.module.promotion.controller.admin.article.vo.article.ArticlePageReqVO;
 import cn.newfeifan.mall.module.promotion.controller.admin.article.vo.article.ArticleUpdateReqVO;
 import cn.newfeifan.mall.module.promotion.controller.app.article.vo.article.AppArticlePageReqVO;
+import cn.newfeifan.mall.module.promotion.controller.app.article.vo.article.HomeArticleRespVO;
 import cn.newfeifan.mall.module.promotion.convert.article.ArticleConvert;
 import cn.newfeifan.mall.module.promotion.dal.dataobject.article.ArticleCategoryDO;
 import cn.newfeifan.mall.module.promotion.dal.dataobject.article.ArticleDO;
 import cn.newfeifan.mall.module.promotion.dal.mysql.article.ArticleMapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import org.springframework.stereotype.Service;
 import org.springframework.validation.annotation.Validated;
 
@@ -120,4 +122,30 @@ public class ArticleServiceImpl implements ArticleService {
         articleMapper.updateBrowseCount(id);
     }
 
+
+    @Override
+    public HomeArticleRespVO getHomeInfo() {
+        HomeArticleRespVO homeArticleRespVO = HomeArticleRespVO.builder().build();
+        List<ArticleDO> slideshowArticleList = articleMapper.selectList(new LambdaQueryWrapper<ArticleDO>()
+                .eq(ArticleDO::getCategoryId, 4)
+                .orderByDesc(ArticleDO::getCreateTime));
+        ArticleDO announcement = articleMapper.selectList(new LambdaQueryWrapper<ArticleDO>()
+                .eq(ArticleDO::getCategoryId, 8)
+                .orderByDesc(ArticleDO::getCreateTime)).get(0);
+        ArticleDO ptBriefIntroduction = articleMapper.selectList(new LambdaQueryWrapper<ArticleDO>()
+                .eq(ArticleDO::getCategoryId, 5)
+                .orderByDesc(ArticleDO::getCreateTime)).get(0);
+        ArticleDO industryIntroduction = articleMapper.selectList(new LambdaQueryWrapper<ArticleDO>()
+                .eq(ArticleDO::getCategoryId, 7)
+                .orderByDesc(ArticleDO::getCreateTime)).get(0);
+        ArticleDO dynamicNews = articleMapper.selectList(new LambdaQueryWrapper<ArticleDO>()
+                .eq(ArticleDO::getCategoryId, 6)
+                .orderByDesc(ArticleDO::getCreateTime)).get(0);
+        return homeArticleRespVO.setSlideshowArticleList(slideshowArticleList)
+                .setAnnouncement(announcement)
+                .setPtBriefIntroduction(ptBriefIntroduction)
+                .setIndustryIntroduction(industryIntroduction)
+                .setDynamicNews(dynamicNews);
+    }
+
 }

+ 3 - 2
feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/service/diy/DiyPageService.java

@@ -43,10 +43,11 @@ public interface DiyPageService {
     /**
      * 获得装修页面
      *
-     * @param id 编号
+     * @param id         编号
+     * @param merchantId
      * @return 装修页面
      */
-    DiyPageDO getDiyPage(Long id);
+    DiyPageDO getDiyPage(Long id, Long merchantId);
 
     /**
      * 获得装修页面列表

+ 6 - 2
feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/service/diy/DiyPageServiceImpl.java

@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.collection.ListUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.newfeifan.mall.module.promotion.controller.admin.diy.vo.page.DiyPageCreateReqVO;
 import cn.newfeifan.mall.module.promotion.controller.admin.diy.vo.page.DiyPagePageReqVO;
 import cn.newfeifan.mall.module.promotion.controller.admin.diy.vo.page.DiyPagePropertyUpdateRequestVO;
@@ -95,8 +96,11 @@ public class DiyPageServiceImpl implements DiyPageService {
     }
 
     @Override
-    public DiyPageDO getDiyPage(Long id) {
-        return diyPageMapper.selectById(id);
+    public DiyPageDO getDiyPage(Long shopId, Long merchantId) {
+        return diyPageMapper.selectOne(new LambdaQueryWrapperX<DiyPageDO>()
+                .eqIfPresent(DiyPageDO::getShopId, shopId)
+                .eqIfPresent(DiyPageDO::getMerchantId, merchantId)
+                .eq(DiyPageDO::getName, "首页"));
     }
 
     @Override

+ 1 - 1
feifan-module-mall/feifan-module-trade-biz/src/main/java/cn/newfeifan/mall/module/trade/dal/mysql/order/TradeOrderMapper.java

@@ -21,7 +21,7 @@ import java.util.Set;
 public interface TradeOrderMapper extends BaseMapperX<TradeOrderDO> {
 
     //add by Ben 20240604
-    @Select("SELECT ancestor FROM `distri_share_path` where descendant = #{userId} and depth=1")
+    @Select("SELECT ancestor FROM `distri_share_path` where descendant = #{userId} and depth=1 and deleted = 0")
     Long selectAncesterByMemberUserId(@Param("userId") Long userId);
 
     default int updateByIdAndStatus(Long id, Integer status, TradeOrderDO update) {

+ 73 - 49
feifan-module-mall/feifan-module-trade-biz/src/main/java/cn/newfeifan/mall/module/trade/service/order/TradeOrderUpdateServiceImpl.java

@@ -7,6 +7,7 @@ import cn.hutool.core.util.ObjUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.RandomUtil;
 import cn.hutool.extra.spring.SpringUtil;
+import cn.hutool.json.JSONUtil;
 import cn.newfeifan.mall.framework.common.core.KeyValue;
 import cn.newfeifan.mall.framework.common.enums.UserTypeEnum;
 import cn.newfeifan.mall.framework.common.exception.ErrorCode;
@@ -33,6 +34,7 @@ import cn.newfeifan.mall.module.distri.service.ptprofitlog.PtProfitLogService;
 import cn.newfeifan.mall.module.distri.service.sharepath.SharePathService;
 import cn.newfeifan.mall.module.member.api.address.MemberAddressApi;
 import cn.newfeifan.mall.module.member.api.address.dto.MemberAddressRespDTO;
+import cn.newfeifan.mall.module.member.dal.dataobject.user.MemberUserDO;
 import cn.newfeifan.mall.module.member.service.user.MemberUserService;
 import cn.newfeifan.mall.module.pay.api.order.PayOrderApi;
 import cn.newfeifan.mall.module.pay.api.order.dto.PayOrderCreateReqDTO;
@@ -1247,6 +1249,9 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
         //20240604 推荐人(上级用户ID)
         Long ancesterUserId = tradeOrderMapper.selectAncesterByMemberUserId(memberUserIdOfTradeOrder);
 
+        // 当前订单用户
+        MemberUserDO user = memberUserService.getUser(memberUserIdOfTradeOrder);
+
         for (TradeOrderDO tradeOrderDO : TradeOrderDOList) {
 
             Long tradeOrderId = tradeOrderDO.getId();
@@ -1353,8 +1358,22 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
             //修改购物者本人获得的冻结积分
             integralService.updateUserIntegral(tradeOrderDO.getUserId(), tradeOrderDO.getUserId(), CaclEnum.ORDER_PAY_INTEGRAL_CONSUMER, 0L, totalFreezeAmount, tradeOrderId, OrderNum);
 
-            //修改推荐人(上级)获得的冻结积分
-            integralService.updateUserIntegral(tradeOrderDO.getUserId(), ancesterUserId, CaclEnum.ORDER_PAY_INTEGRAL_ANCESTER, 0L, totalAncestorFreezeAmount, tradeOrderId, OrderNum);
+            // 如果用户不是游客才会分配直推将,否者是计算到游客收益中的
+            if (!user.getVisitor()) {
+                //修改推荐人(上级)获得的冻结积分
+                integralService.updateUserIntegral(tradeOrderDO.getUserId(), ancesterUserId, CaclEnum.ORDER_PAY_INTEGRAL_ANCESTER, 0L, totalAncestorFreezeAmount, tradeOrderId, OrderNum);
+            } else {
+                // 游客收益
+                PtProfitDO ptProfitDO = ptProfitService.getPtProfit();
+
+                ptProfitDO.setVisitorEarnings(ptProfitDO.getVisitorEarnings() + totalAncestorFreezeAmount);
+                ptProfitDO.setPtTotalAdd(ptProfitDO.getPtTotalAdd() + totalAncestorFreezeAmount);
+                ptProfitService.updatePtProfit(cn.newfeifan.mall.framework.common.util.object.BeanUtils.toBean(ptProfitDO, PtProfitSaveReqVO.class));
+
+                // 记录日志
+                ptProfitLogService.addMessage(user.getId(), null, CaclEnum.RECOMMENDED_PERSON_QUOTA, totalAncestorFreezeAmount,
+                        ptProfitDO.getVisitorEarnings(), null, null, JSONUtil.toJsonStr(orderPercentageDO), tradeOrderId, OrderNum);
+            }
 
             //修改购物者本人获得的冻结峰值
             integralService.updateIntegralFreezeHighQuota(tradeOrderDO.getUserId(), tradeOrderDO.getUserId(), CaclEnum.ORDER_PAY_FREEZE_HIGH_QUOTA, totalFreezeHighQuota, tradeOrderId, OrderNum);
@@ -1380,9 +1399,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
         rs.add(newSocialStatus);
 
         // 七天获得变为即算即得,后续如果恢复把这里注释即可,并打开平台定时任务得订单结算
-//        CompletableFuture.runAsync(() -> {
         calc(TradeOrderDOList, orderPercentageDO, JsonUtils.toJsonString(orderPercentageDO));
-//        });
 
         return rs;
     }
@@ -1494,6 +1511,17 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
 
             // ========== 修改用户钱包 =================
 
+            // 每个订单计算的过程
+            // 增加平台收益
+            // 平台服务费
+            PtProfitSaveReqVO ptProfitSaveReqVO =
+                    PtProfitSaveReqVO.builder()
+                            .ptAdd(platformQuotaInt)
+                            .ptGrossAdd(grossProfitAfterBonusInt)
+                            .ptTotalAdd(platformQuotaInt + grossProfitAfterBonusInt).build();
+
+            MemberUserDO user = memberUserService.getUser(k.getUserId());
+
             //直推奖也要限制额度
             Long ancestorHighQuota = integralDOAncestor.getHighQuota() + new BigDecimal(orderPercentageDO.getBaseMaxQuota()).longValue();//加上基础的最大额度值
 
@@ -1517,25 +1545,35 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
                 }
             }
             changeUserWallet(integralDO, integralDOAncestor, ptIntegral, amount,
-                    descendantQuotaInt, highQuotaInt, grossProfitAfterBonusInt, platformQuotaInt, ptReplenish);
+                    descendantQuotaInt, highQuotaInt, grossProfitAfterBonusInt, platformQuotaInt, ptReplenish, user.getVisitor());
 
             // ========== 修改平台信息 =================
-            // 每个订单计算的过程
-            // 增加平台收益
-            // 平台服务费
-            PtProfitSaveReqVO ptProfitSaveReqVO =
-                    PtProfitSaveReqVO.builder()
-                            .ptAdd(platformQuotaInt)
-                            .ptGrossAdd(grossProfitAfterBonusInt)
-                            .ptTotalAdd(platformQuotaInt + grossProfitAfterBonusInt).build();
+            if (!user.getVisitor()) {
+                // 当直推人获取的积分额度不足时,平台收益要加回来,并生成log
+                if (ptReplenish.compareTo(0L) > 0) {
+                    calcIntegral(ptProfitSaveReqVOS, ptProfitSaveReqVO, ptReplenish,
+                            k.getId(), k.getNo());
+                }
 
 
-            // 当直推人获取的积分额度不足时,平台收益要加回来,并生成log
-            if (ptReplenish.compareTo(0L) > 0) {
-                calcIntegral(ptProfitSaveReqVOS, ptProfitSaveReqVO, ptReplenish,
-                        k.getId(), k.getNo());
+                // 直推奖记录
+                PtProfitLogSaveReqVO tjrLog = PtProfitLogSaveReqVO.builder()
+                        .orderId(k.getId())
+                        .profitStatus(CaclEnum.RECOMMENDED_PERSON_QUOTA.getType())
+                        .orderNo(k.getNo())
+                        .userId(sharePath.getAncestor())
+                        .amount(amount)
+                        .afterAmount(integralDOAncestor.getCurrentQuota())
+                        .freezeAmount(-amount)
+                        .afterFreezeAmount(integralDOAncestor.getFreezeQuota())
+                        .ancestorQuotaAmount(ptReplenish)
+                        .maxAvailablePointsAmount(-amount)
+                        .afterMaxAvailablePointsAmount(ancestorHighQuota - amount)
+                        .percentTemplate(percentTemplate)
+                        .generateUserId(integralDO.getUserId())
+                        .build();
+                ptProfitLogSaveReqVOS.add(tjrLog);
             }
-
             ptProfitSaveReqVOS.add(ptProfitSaveReqVO);
             // ========== 增加日志记录 =================
 
@@ -1574,24 +1612,6 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
                     .build();
 
 
-            // 直推奖记录
-            PtProfitLogSaveReqVO tjrLog = PtProfitLogSaveReqVO.builder()
-                    .orderId(k.getId())
-                    .profitStatus(CaclEnum.RECOMMENDED_PERSON_QUOTA.getType())
-                    .orderNo(k.getNo())
-                    .userId(sharePath.getAncestor())
-                    .amount(amount)
-                    .afterAmount(integralDOAncestor.getCurrentQuota())
-                    .freezeAmount(-amount)
-                    .afterFreezeAmount(integralDOAncestor.getFreezeQuota())
-                    .ancestorQuotaAmount(ptReplenish)
-                    .maxAvailablePointsAmount(-amount)
-                    .afterMaxAvailablePointsAmount(ancestorHighQuota - amount)
-                    .percentTemplate(percentTemplate)
-                    .generateUserId(integralDO.getUserId())
-                    .build();
-
-
             // 用户自得记录 + 户冻结积分转化成可用 + 扣减最高可用额度记录
             PtProfitLogSaveReqVO ztrLog = PtProfitLogSaveReqVO.builder()
                     .orderId(k.getId())
@@ -1613,7 +1633,6 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
             ptProfitLogSaveReqVOS.add(ptTotal);
             ptProfitLogSaveReqVOS.add(ptGrossAddLog);
             ptProfitLogSaveReqVOS.add(ptAddLog);
-            ptProfitLogSaveReqVOS.add(tjrLog);
             ptProfitLogSaveReqVOS.add(ztrLog);
 
 
@@ -1667,9 +1686,10 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
      * @param ptA                pt收益
      * @param ptB                pt服务费
      * @param ptReplenish        超出没有获取到的积分
+     * @param visitor            游客标识
      */
     private void changeUserWallet(IntegralDO integralDO, IntegralDO integralDOAncestor, IntegralDO pt,
-                                  Long ancestorQuota, Long descendantQuota, Long highQuota, Long ptA, Long ptB, Long ptReplenish) {
+                                  Long ancestorQuota, Long descendantQuota, Long highQuota, Long ptA, Long ptB, Long ptReplenish, Boolean visitor) {
         // 修改用户钱包
         // 增加直推人额度
         integralDO.setHighQuota(integralDO.getHighQuota() + highQuota);
@@ -1679,13 +1699,17 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
 
         integralDO.setCurrentQuota(integralDO.getCurrentQuota() + descendantQuota);
         integralDO.setFreezeQuota(integralDO.getFreezeQuota() - descendantQuota);
-        // 增加推荐人额度
-        integralDOAncestor.setCurrentQuota(integralDOAncestor.getCurrentQuota() + ancestorQuota);
-        // 减少推荐人的可获取额度
-        integralDOAncestor.setHighQuota(integralDOAncestor.getHighQuota() - ancestorQuota);
-        integralDOAncestor.setAncestorQuota(integralDOAncestor.getAncestorQuota() + ancestorQuota);
-        integralDOAncestor.setFreezeQuota(integralDOAncestor.getFreezeQuota() - ancestorQuota - ptReplenish);
-        integralService.updateIntegral(cn.newfeifan.mall.framework.common.util.object.BeanUtils.toBean(integralDOAncestor, IntegralSaveReqVO.class));
+
+        // 如果直推人是游客就没有直推奖
+        if (!visitor) {
+            // 增加推荐人额度
+            integralDOAncestor.setCurrentQuota(integralDOAncestor.getCurrentQuota() + ancestorQuota);
+            // 减少推荐人的可获取额度
+            integralDOAncestor.setHighQuota(integralDOAncestor.getHighQuota() - ancestorQuota);
+            integralDOAncestor.setAncestorQuota(integralDOAncestor.getAncestorQuota() + ancestorQuota);
+            integralDOAncestor.setFreezeQuota(integralDOAncestor.getFreezeQuota() - ancestorQuota - ptReplenish);
+            integralService.updateIntegral(cn.newfeifan.mall.framework.common.util.object.BeanUtils.toBean(integralDOAncestor, IntegralSaveReqVO.class));
+        }
 
         // 增加平台额度
         pt.setCurrentQuota(pt.getCurrentQuota() + ptA + ptB);
@@ -1748,7 +1772,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
     /**
      * 发送极光推送消息
      *
-     * @param order   订单
+     * @param order 订单
      */
     private void sentJPush(TradeOrderDO order) {
         String title = WcChatMessageTemplateIdEnum.ORDER_NO_DELIVERY2.getName();
@@ -1773,7 +1797,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
         for (Long adminUser : adminUsers) {
             // 如果没有权限就不用发送了
             Boolean havePermission = jPushUtils.isHavePermission(adminUser, title);
-            if(!havePermission){
+            if (!havePermission) {
                 continue;
             }
             List<String> userRsgIds = memberUserService.getUserRsgIds(adminUser, null);
@@ -2025,7 +2049,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
             integralService.updateUserIntegral(userId, userId, CaclEnum.ORDER_CANCEL_BY_USER_REFUND_INTEGRAL, payIntegral, 0L, tradeOrderId, orderNum);
         }
 
-        if(order.getPayConsumptionPoints() > 0){
+        if (order.getPayConsumptionPoints() > 0) {
             integralService.updateUserConsumptionPoints(userId, ConsumptionEnum.CANCEL_ORDER_BACK_CONSUMPTION_POINTS, order.getPayConsumptionPoints(), tradeOrderId, orderNum);
         }
     }
@@ -2061,7 +2085,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
                 if (payIntegral > 0) {
                     integralService.updateUserIntegral(userId, CaclEnum.ORDER_CANCEL_BY_SYSTEM_REFUND_INTEGRAL, payIntegral, tradeOrderId, orderNum);
                 }
-                if(order.getPayConsumptionPoints() > 0){
+                if (order.getPayConsumptionPoints() > 0) {
                     integralService.updateUserConsumptionPoints(userId, ConsumptionEnum.ORDER_CANCEL_BY_SYSTEM_REFUND_INTEGRAL, order.getPayConsumptionPoints(), tradeOrderId, orderNum);
                 }
 

+ 3 - 4
feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/controller/app/auth/vo/AppAuthSmsRegisterReqVO.java

@@ -6,15 +6,13 @@ import org.hibernate.validator.constraints.Length;
 
 import javax.validation.constraints.NotNull;
 
-import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
-import static cn.newfeifan.mall.module.member.enums.ErrorCodeConstants.LINK_ID_IS_NOT_EXISTS;
 
 @Schema(description = "用户 APP - 手机 + 验证码登录 Request VO,如果登录并绑定社交用户,需要传递 social 开头的参数")
 @Data
 public class AppAuthSmsRegisterReqVO extends AppAuthSmsLoginReqVO {
 
     @Schema(description = "分享链接ID")
-    @NotNull(message = "只能通过分享注册")
+//    @NotNull(message = "只能通过分享注册")
     private String linkId;
 
     @Schema(description = "密码")
@@ -24,7 +22,8 @@ public class AppAuthSmsRegisterReqVO extends AppAuthSmsLoginReqVO {
 
     public Long getLinkId() {
         if (linkId == null) {
-            throw exception(LINK_ID_IS_NOT_EXISTS);
+//            throw exception(LINK_ID_IS_NOT_EXISTS);
+            return null;
         }
         return Long.parseLong(linkId,16);
     }

+ 2 - 4
feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/controller/app/auth/vo/AppAuthSocialRegisterReqVO.java

@@ -3,14 +3,12 @@ package cn.newfeifan.mall.module.member.controller.app.auth.vo;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
-import javax.validation.constraints.NotEmpty;
-import javax.validation.constraints.NotNull;
 
 @Data
 public class AppAuthSocialRegisterReqVO  extends AppAuthSocialLoginReqVO{
     @Schema(description = "分享链接ID")
-    @NotNull(message = "只能通过分享注册")
-    @NotEmpty(message = "只能通过分享注册")
+//    @NotNull(message = "只能通过分享注册")
+//    @NotEmpty(message = "只能通过分享注册")
     private String linkId;
 
     @Schema(description = "用户名")

+ 2 - 0
feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/controller/app/user/vo/AppMemberUserInfoRespVO.java

@@ -80,5 +80,7 @@ public class AppMemberUserInfoRespVO {
     @Schema(description = "是否是代理商 0:否 1:是")
     private Boolean agent;
 
+    @Schema(description = "是否是游客 0:否 1:是")
+    private Boolean visitor;
 
 }

+ 4 - 0
feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/dal/dataobject/user/MemberUserDO.java

@@ -183,4 +183,8 @@ public class MemberUserDO extends TenantBaseDO {
      * 是否是代理商 0:否 1:是
      */
     private Boolean agent;
+    /**
+     * 是否是游客 0:否 1:是
+     */
+    private Boolean visitor;
 }

+ 4 - 1
feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/service/user/MemberUserServiceImpl.java

@@ -144,6 +144,7 @@ public class MemberUserServiceImpl implements MemberUserService {
         user.setRegisterIp(registerIp).setRegisterTerminal(terminal);
         user.setSystemUsersId(systemUserId);    //绑定系统用户
         user.setNickname(nickname).setAvatar(avtar); // 基础信息
+        user.setVisitor(linkId == null);
         if (StrUtil.isEmpty(nickname)) {
             // 昵称为空时,随机一个名字,避免一些依赖 nickname 的逻辑报错,或者有点丑。例如说,短信发送有昵称时~
             user.setNickname("用户" + RandomUtil.randomNumbers(6));
@@ -152,10 +153,12 @@ public class MemberUserServiceImpl implements MemberUserService {
 
         // 如果注册的时候关系链创建失败则需要返回让用户重新注册
         try {
-            sharePathProducer.sendSharePathCreatMessage(linkId, user.getId());
             if (linkId != null) {
                 shareLinkRegisterProducer.sendShareLinkRegisterMessage(linkId, user.getId());
+            }else {
+                linkId = 1L;
             }
+            sharePathProducer.sendSharePathCreatMessage(linkId, user.getId());
             memberUserProducer.sendUserCreateMessage(user.getId());
         } catch (Exception e) {
             throw exception(RELOAD_REGISTER);