Browse Source

Merge branch 'dev/2024/1101/update-app-Y' of feifan/mall-backend-app into master

用户产生的直推奖加入条件分支,游客的加入到游客收益中,并加入商城首页
Yangzw 1 tháng trước cách đây
mục cha
commit
522fd05ff9
30 tập tin đã thay đổi với 274 bổ sung78 xóa
  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. 2 2
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/app/category/AppCategoryController.java
  6. 4 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/app/spu/AppProductSpuController.java
  7. 8 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/app/spu/vo/AppProductSpuDetailRespVO.java
  8. 6 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/app/spu/vo/AppProductSpuPageReqVO.java
  9. 2 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/dal/dataobject/spu/ProductSpuDO.java
  10. 2 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/dal/mysql/spu/ProductSpuMapper.java
  11. 1 1
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/category/ProductCategoryService.java
  12. 16 1
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/category/ProductCategoryServiceImpl.java
  13. 7 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spu/ProductSpuService.java
  14. 8 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spu/ProductSpuServiceImpl.java
  15. 7 4
      feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/controller/app/article/AppArticleController.java
  16. 26 0
      feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/controller/app/article/vo/article/HomeArticleRespVO.java
  17. 16 2
      feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/controller/app/diy/AppDiyPageController.java
  18. 2 1
      feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/dal/dataobject/diy/DiyPageDO.java
  19. 7 0
      feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/service/article/ArticleService.java
  20. 28 0
      feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/service/article/ArticleServiceImpl.java
  21. 3 2
      feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/service/diy/DiyPageService.java
  22. 6 2
      feifan-module-mall/feifan-module-promotion-biz/src/main/java/cn/newfeifan/mall/module/promotion/service/diy/DiyPageServiceImpl.java
  23. 4 0
      feifan-module-mall/feifan-module-trade-biz/src/main/java/cn/newfeifan/mall/module/trade/dal/dataobject/order/TradeOrderDO.java
  24. 2 1
      feifan-module-mall/feifan-module-trade-biz/src/main/java/cn/newfeifan/mall/module/trade/dal/mysql/order/TradeOrderMapper.java
  25. 76 50
      feifan-module-mall/feifan-module-trade-biz/src/main/java/cn/newfeifan/mall/module/trade/service/order/TradeOrderUpdateServiceImpl.java
  26. 3 4
      feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/controller/app/auth/vo/AppAuthSmsRegisterReqVO.java
  27. 2 4
      feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/controller/app/auth/vo/AppAuthSocialRegisterReqVO.java
  28. 2 0
      feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/controller/app/user/vo/AppMemberUserInfoRespVO.java
  29. 4 0
      feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/dal/dataobject/user/MemberUserDO.java
  30. 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>

+ 2 - 2
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/app/category/AppCategoryController.java

@@ -33,8 +33,8 @@ public class AppCategoryController {
 
     @GetMapping("/list")
     @Operation(summary = "获得商品分类列表")
-    public CommonResult<List<AppCategoryRespVO>> getProductCategoryList() {
-        List<ProductCategoryDO> list = categoryService.getEnableCategoryList();
+    public CommonResult<List<AppCategoryRespVO>> getProductCategoryList(Long merchantId, Long shopId) {
+        List<ProductCategoryDO> list = categoryService.getEnableCategoryList(merchantId, shopId);
         list.sort(Comparator.comparing(ProductCategoryDO::getSort));
         return success(BeanUtils.toBean(list, AppCategoryRespVO.class));
     }

+ 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;
 }

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

@@ -39,6 +39,12 @@ public class AppProductSpuPageReqVO extends PageParam {
     @Schema(description = "排序方式", example = "true")
     private Boolean sortAsc;
 
+    @Schema(description = "店铺id", example = "true")
+    private Long shopId;
+
+    @Schema(description = "商户id", example = "true")
+    private Long merchantId;
+
     @AssertTrue(message = "排序字段不合法")
     @JsonIgnore
     public boolean isSortFieldValid() {

+ 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;
 }

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

@@ -60,6 +60,8 @@ public interface ProductSpuMapper extends BaseMapperX<ProductSpuDO> {
                 .inIfPresent(ProductSpuDO::getCategoryId, categoryIds);
         // 上架状态 且有库存
         query.eq(ProductSpuDO::getStatus, ProductSpuStatusEnum.ENABLE.getStatus());
+        query.eqIfPresent(ProductSpuDO::getShopId, pageReqVO.getShopId());
+        query.eqIfPresent(ProductSpuDO::getMerchantId, pageReqVO.getMerchantId());
 
         // 排序逻辑
         if (Objects.equals(pageReqVO.getSortField(), AppProductSpuPageReqVO.SORT_FIELD_SALES_COUNT)) {

+ 1 - 1
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/category/ProductCategoryService.java

@@ -73,7 +73,7 @@ public interface ProductCategoryService {
      *
      * @return 商品分类列表
      */
-    List<ProductCategoryDO> getEnableCategoryList();
+    List<ProductCategoryDO> getEnableCategoryList(Long merchantId, Long shopId);
 
     /**
      * 获得开启状态的商品分类列表,指定编号

+ 16 - 1
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/category/ProductCategoryServiceImpl.java

@@ -7,8 +7,10 @@ import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
 import cn.newfeifan.mall.module.product.controller.admin.category.vo.ProductCategoryListReqVO;
 import cn.newfeifan.mall.module.product.controller.admin.category.vo.ProductCategorySaveReqVO;
 import cn.newfeifan.mall.module.product.dal.dataobject.category.ProductCategoryDO;
+import cn.newfeifan.mall.module.product.dal.dataobject.spu.ProductSpuDO;
 import cn.newfeifan.mall.module.product.dal.mysql.category.ProductCategoryMapper;
 import cn.newfeifan.mall.module.product.service.spu.ProductSpuService;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.validation.annotation.Validated;
@@ -18,6 +20,7 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import java.util.stream.Collectors;
 
 import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static cn.newfeifan.mall.module.product.dal.dataobject.category.ProductCategoryDO.PARENT_ID_NULL;
@@ -165,7 +168,19 @@ public class ProductCategoryServiceImpl implements ProductCategoryService {
     }
 
     @Override
-    public List<ProductCategoryDO> getEnableCategoryList() {
+    public List<ProductCategoryDO> getEnableCategoryList(Long merchantId, Long shopId) {
+        if(merchantId != null && shopId != null) {
+            List<ProductSpuDO> spuDOS = productSpuService.getSpuListByMerchantIdAndShopId(merchantId, shopId);
+            List<Long> categoryIds = spuDOS.stream().map(ProductSpuDO::getCategoryId).distinct().collect(Collectors.toList());
+            List<ProductCategoryDO> productCategoryDOS = productCategoryMapper.selectList(new LambdaQueryWrapper<ProductCategoryDO>()
+                    .eq(ProductCategoryDO::getStatus, CommonStatusEnum.ENABLE.getStatus())
+                    .in(ProductCategoryDO::getId, categoryIds));
+            List<ProductCategoryDO> parentCategory = productCategoryMapper.selectList(new LambdaQueryWrapper<ProductCategoryDO>()
+                    .eq(ProductCategoryDO::getStatus, CommonStatusEnum.ENABLE.getStatus())
+                    .in(ProductCategoryDO::getId, productCategoryDOS.stream().map(ProductCategoryDO::getParentId).collect(Collectors.toList())));
+            productCategoryDOS.addAll(parentCategory);
+            return productCategoryDOS;
+        }
         return productCategoryMapper.selectListByStatus(CommonStatusEnum.ENABLE.getStatus());
     }
 

+ 7 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spu/ProductSpuService.java

@@ -131,4 +131,11 @@ public interface ProductSpuService {
     @Async
     void updateBrowseCount(Long id, int incrCount);
 
+    /**
+     * 通过商户id和店铺id获取商品列表
+     * @param merchantId 商户id
+     * @param shopId 店铺id
+     * @return 商品列表
+     */
+    List<ProductSpuDO> getSpuListByMerchantIdAndShopId(Long merchantId, Long shopId);
 }

+ 8 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spu/ProductSpuServiceImpl.java

@@ -19,6 +19,7 @@ import cn.newfeifan.mall.module.product.enums.spu.ProductSpuStatusEnum;
 import cn.newfeifan.mall.module.product.service.brand.ProductBrandService;
 import cn.newfeifan.mall.module.product.service.category.ProductCategoryService;
 import cn.newfeifan.mall.module.product.service.sku.ProductSkuService;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.google.common.collect.Maps;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
@@ -163,6 +164,13 @@ public class ProductSpuServiceImpl implements ProductSpuService {
         productSpuMapper.updateBrowseCount(id , incrCount);
     }
 
+    @Override
+    public List<ProductSpuDO> getSpuListByMerchantIdAndShopId(Long merchantId, Long shopId) {
+        return productSpuMapper.selectList(new LambdaQueryWrapper<ProductSpuDO>()
+                .eq(ProductSpuDO::getMerchantId, merchantId)
+                .eq(ProductSpuDO::getShopId, shopId));
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void deleteSpu(Long id) {

+ 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

+ 4 - 0
feifan-module-mall/feifan-module-trade-biz/src/main/java/cn/newfeifan/mall/module/trade/dal/dataobject/order/TradeOrderDO.java

@@ -342,5 +342,9 @@ public class TradeOrderDO extends BaseDO {
      * 退还的使用的消费分
      */
     private Long refundConsumption;
+    /**
+     * 用户是否删除
+     */
+    private Boolean userDeleted;
 
 }

+ 2 - 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) {
@@ -76,6 +76,7 @@ public interface TradeOrderMapper extends BaseMapperX<TradeOrderDO> {
                 .eq(TradeOrderDO::getUserId, userId)
                 .eqIfPresent(TradeOrderDO::getStatus, reqVO.getStatus())
                 .eqIfPresent(TradeOrderDO::getCommentStatus, reqVO.getCommentStatus())
+                .eq(TradeOrderDO::getUserDeleted, false)
                 .orderByDesc(TradeOrderDO::getId)); // TODO 非繁人:未来不同的 status,不同的排序
     }
 

+ 76 - 50
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);
                 }
 
@@ -2155,8 +2179,10 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
         if (ObjectUtil.notEqual(order.getStatus(), TradeOrderStatusEnum.CANCELED.getStatus())) {
             throw exception(ORDER_DELETE_FAIL_STATUS_NOT_CANCEL);
         }
+        // 用户删除作为给用户看的订单
+        order.setUserDeleted(true);
         // 2. 删除订单
-        tradeOrderMapper.deleteById(id);
+        tradeOrderMapper.updateById(order);
 
         // 3. 记录日志
         TradeOrderLogUtils.setOrderInfo(order.getId(), order.getStatus(), order.getStatus());

+ 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);