Browse Source

Merge branch 'master' of http://47.107.29.61:3000/feifan/mall-backend-admin into dev/2024/0531/update-admin-Y

Yangzw 5 months ago
parent
commit
6738203032

+ 11 - 1
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spu/ProductSpuController.java

@@ -9,6 +9,7 @@ import cn.newfeifan.mall.module.product.controller.admin.spu.vo.*;
 import cn.newfeifan.mall.module.product.convert.spu.ProductSpuConvert;
 import cn.newfeifan.mall.module.product.dal.dataobject.sku.ProductSkuDO;
 import cn.newfeifan.mall.module.product.dal.dataobject.spu.ProductSpuDO;
+import cn.newfeifan.mall.module.product.dal.mysql.spu.ProductSpuMapper;
 import cn.newfeifan.mall.module.product.enums.spu.ProductSpuStatusEnum;
 import cn.newfeifan.mall.module.product.service.sku.ProductSkuService;
 import cn.newfeifan.mall.module.product.service.spu.ProductSpuService;
@@ -43,6 +44,10 @@ public class ProductSpuController {
     @Resource
     private ProductSkuService productSkuService;
 
+    //add by Ben
+    @Resource
+    private ProductSpuMapper productSpuMapper;
+
     @PostMapping("/create")
     @Operation(summary = "创建商品 SPU")
     @PreAuthorize("@ss.hasPermission('product:spu:create')")
@@ -87,7 +92,12 @@ public class ProductSpuController {
         }
         // 查询商品 SKU
         List<ProductSkuDO> skus = productSkuService.getSkuListBySpuId(spu.getId());
-        return success(ProductSpuConvert.INSTANCE.convert(spu, skus));
+
+        String shopName = productSpuMapper.selectShopNameById(spu.getShopId());
+        CommonResult<ProductSpuRespVO> success = success(ProductSpuConvert.INSTANCE.convert(spu, skus));
+        success.getData().setShopName(shopName);
+
+        return success;
     }
 
     @GetMapping("/list-all-simple")

+ 4 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spu/vo/ProductSpuRespVO.java

@@ -17,6 +17,8 @@ import java.util.List;
 @ExcelIgnoreUnannotated
 public class ProductSpuRespVO {
 
+
+
     @Schema(description = "商品 SPU 编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "111")
     @ExcelProperty("商品编号")
     private Long id;
@@ -132,6 +134,8 @@ public class ProductSpuRespVO {
     @Schema(description = "店铺id", example = "20588")
     private Long shopId;
 
+    @Schema(description = "店铺名称", example = "中星温暖")
+    private String shopName;
 
     @Schema(description = "商户id", example = "8240")
     private Long merchantId;

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

@@ -12,6 +12,7 @@ import cn.newfeifan.mall.module.product.enums.spu.ProductSpuStatusEnum;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
 
 import java.util.List;
 import java.util.Objects;
@@ -20,6 +21,10 @@ import java.util.Set;
 @Mapper
 public interface ProductSpuMapper extends BaseMapperX<ProductSpuDO> {
 
+    //add by Ben
+    @Select("select name from sale_shop where id=#{id}")
+    String selectShopNameById(Long id);
+
     /**
      * 获取商品 SPU 分页列表数据
      *

+ 6 - 0
sql/mysql/建空库SQL/10_20240531.sql

@@ -0,0 +1,6 @@
+/* 登录、注册支持国际号码,消费者申请成为商户 */
+
+ALTER TABLE `member_user` ADD COLUMN `mobile_country_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '电话号码国家前缀';
+ALTER TABLE `member_user` ADD COLUMN `mobile_country_name` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '电话号码国家名';
+
+

+ 5 - 0
sql/mysql/建空库SQL/6_20240412.sql

@@ -83,6 +83,11 @@ CREATE TABLE `distri_user_sign_in_log`  (
 ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户签到日志表' ROW_FORMAT = Dynamic;
 
 
+ALTER TABLE `distri_pt_profit_log` ADD COLUMN `max_available_points_amount` BIGINT ( 11 ) DEFAULT NULL COMMENT '最大可用积分变化值' AFTER `after_freeze_amount`,
+ADD COLUMN `after_max_available_points_amount` BIGINT ( 11 ) DEFAULT NULL COMMENT '最大可用积分额度' AFTER `max_available_points_amount`,
+ADD COLUMN `accumulated_quota_amount` BIGINT ( 11 ) DEFAULT NULL COMMENT '合赢奖超出额度' AFTER `after_max_available_points_amount`,
+ADD COLUMN `ancestor_quota_amount` BIGINT ( 11 ) DEFAULT NULL COMMENT '直推奖超出额度' AFTER `accumulated_quota_amount`;
+
 -- 增加 会员签到表
 /*
 CREATE TABLE `distri_sign_in`  (

+ 9 - 0
sql/mysql/建空库SQL/9_20240529_changeMemberUser.sql

@@ -0,0 +1,9 @@
+-- 实现支持同一个手机号,对应多个消费者用户
+
+-- 为消费者用户表,增加独立的用户名username字段,原来的mobile字段,只作手机号使用
+ALTER TABLE member_user ADD COLUMN username varchar(256) COMMENT '登录用的用户名';
+ALTER TABLE `member_user` ADD UNIQUE (`username`) ;
+
+-- spu表加推广费
+ALTER TABLE product_spu ADD COLUMN `promotion_fee` int(11) NULL DEFAULT NULL COMMENT '推广费, 单位: 分,值为sku中最大的推广费';
+