Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

wangming 3 settimane fa
parent
commit
8fbac8b1aa
58 ha cambiato i file con 980 aggiunte e 635 eliminazioni
  1. 1 1
      yami-shop-api/src/main/java/com/yami/shop/api/controller/AddrController.java
  2. 5 1
      yami-shop-api/src/main/java/com/yami/shop/api/controller/CategoryController.java
  3. 20 20
      yami-shop-api/src/main/resources/application-dev.yml
  4. 20 20
      yami-shop-api/src/main/resources/application-prod.yml
  5. 21 0
      yami-shop-bean/src/main/java/com/yami/shop/bean/dto/SetChannelPriceDto.java
  6. 1 1
      yami-shop-bean/src/main/java/com/yami/shop/bean/dto/ShopCategoryExcelDTO.java
  7. 42 0
      yami-shop-bean/src/main/java/com/yami/shop/bean/dto/UpdateShannerProdDTO.java
  8. 1 2
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/CategoryBrand.java
  9. 0 1
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/CategoryProd.java
  10. 7 2
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/Channel.java
  11. 9 1
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/ChannelProd.java
  12. 9 0
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/FrontCategory.java
  13. 5 0
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/Label.java
  14. 1 1
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/Product.java
  15. 10 1
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/ShopCategory.java
  16. 20 2
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/ShopDetail.java
  17. 16 0
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/ShopSku.java
  18. 7 3
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/Sku.java
  19. 2 3
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/Transport2.java
  20. 13 6
      yami-shop-bean/src/main/java/com/yami/shop/bean/vo/ChannelProdExportVO.java
  21. 6 8
      yami-shop-bean/src/main/java/com/yami/shop/bean/vo/ChannelProdImportVO.java
  22. 1 5
      yami-shop-delivery/yami-shop-delivery-comment/src/main/java/com/yami/shop/delivery/comment/dao/Transport2Mapper.java
  23. 1 4
      yami-shop-delivery/yami-shop-delivery-comment/src/main/java/com/yami/shop/delivery/comment/service/Transport2Service.java
  24. 1 1
      yami-shop-delivery/yami-shop-delivery-comment/src/main/java/com/yami/shop/delivery/comment/service/TransportManagerService.java
  25. 1 4
      yami-shop-delivery/yami-shop-delivery-comment/src/main/java/com/yami/shop/delivery/comment/service/impl/Transport2ServiceImpl.java
  26. 1 3
      yami-shop-delivery/yami-shop-delivery-comment/src/main/java/com/yami/shop/delivery/comment/service/impl/TransportManagerServiceImpl.java
  27. 2 2
      yami-shop-delivery/yami-shop-delivery-comment/src/main/resources/mapper/Transport2Mapper.xml
  28. 1 5
      yami-shop-delivery/yami-shop-delivery-multishop/src/main/java/com/yami/shop/delivery/multishop/controller/Transport2Controller.java
  29. 20 20
      yami-shop-multishop/src/main/resources/application-dev.yml
  30. 85 0
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ChannelController.java
  31. 32 16
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ChannelProdController.java
  32. 19 6
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/LabelController.java
  33. 23 3
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ShopDetailController.java
  34. 12 4
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ShopSkuController.java
  35. 0 107
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/SysDictDataController.java
  36. 0 112
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/SysDictTypeController.java
  37. 0 11
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/hb/GoodsController.java
  38. 25 1
      yami-shop-service/src/main/java/com/yami/shop/dao/ChannelProdMapper.java
  39. 22 0
      yami-shop-service/src/main/java/com/yami/shop/dao/HBTransport2Mapper.java
  40. 1 1
      yami-shop-service/src/main/java/com/yami/shop/dao/ProductMapper.java
  41. 14 7
      yami-shop-service/src/main/java/com/yami/shop/service/ChannelProdService.java
  42. 14 0
      yami-shop-service/src/main/java/com/yami/shop/service/ChannelService.java
  43. 9 0
      yami-shop-service/src/main/java/com/yami/shop/service/IShopCategoryService.java
  44. 10 0
      yami-shop-service/src/main/java/com/yami/shop/service/ShopSkuService.java
  45. 0 6
      yami-shop-service/src/main/java/com/yami/shop/service/hb/IHBGoodsService.java
  46. 2 0
      yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/HBFrontCategoryService.java
  47. 48 30
      yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/HBGoodsService.java
  48. 30 2
      yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/StoreManagementService.java
  49. 26 4
      yami-shop-service/src/main/java/com/yami/shop/service/impl/ChannelProdServiceImpl.java
  50. 21 0
      yami-shop-service/src/main/java/com/yami/shop/service/impl/ChannelServiceImpl.java
  51. 19 13
      yami-shop-service/src/main/java/com/yami/shop/service/impl/PointsRechargeServiceImpl.java
  52. 0 1
      yami-shop-service/src/main/java/com/yami/shop/service/impl/ProductServiceImpl.java
  53. 95 56
      yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopCategoryServiceImpl.java
  54. 35 0
      yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopSkuServiceImpl.java
  55. 76 13
      yami-shop-service/src/main/resources/mapper/ChannelProdMapper.xml
  56. 1 1
      yami-shop-service/src/main/resources/mapper/ShopSkuMapper.xml
  57. 5 5
      yami-shop-user/yami-shop-user-api/src/main/java/com/yami/shop/user/api/controller/UserScoreController.java
  58. 112 119
      yami-shop-user/yami-shop-user-comment/src/main/java/com/yami/shop/user/comment/service/impl/UserLevelServiceImpl.java

+ 1 - 1
yami-shop-api/src/main/java/com/yami/shop/api/controller/AddrController.java

@@ -16,7 +16,7 @@ import com.yami.shop.bean.app.dto.UserAddrDto;
 import com.yami.shop.bean.app.param.AddrParam;
 import com.yami.shop.bean.model.UserAddr;
 import com.yami.shop.common.exception.GlobalException;
-import com.yami.shop.delivery.comment.model.Transport2;
+import com.yami.shop.bean.model.Transport2;
 import com.yami.shop.delivery.comment.service.Transport2Service;
 import com.yami.shop.delivery.comment.service.TransportManagerService;
 import com.yami.shop.security.api.util.SecurityUtils;

+ 5 - 1
yami-shop-api/src/main/java/com/yami/shop/api/controller/CategoryController.java

@@ -17,6 +17,7 @@ import com.yami.shop.bean.app.dto.CategoryDto;
 import com.yami.shop.bean.model.Category;
 import com.yami.shop.bean.vo.ListCategoryForUserVO;
 import com.yami.shop.service.CategoryService;
+import com.yami.shop.service.IShopCategoryService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -45,6 +46,9 @@ public class CategoryController {
     @Autowired
     private CategoryService categoryService;
 
+    @Autowired
+    private IShopCategoryService shopCategoryService;
+
     @Autowired
     private MapperFacade mapperFacade;
 
@@ -62,7 +66,7 @@ public class CategoryController {
                                                            @RequestParam(value = "shopId",required = false) Long shopId,
                                                            @RequestParam(value = "current", defaultValue = "1") Integer current,
                                                            @RequestParam(value = "size", defaultValue = "10") Integer size) {
-        IPage<Category> categories = categoryService.listByParentIdAndShopId(parentId,shopId, current, size);
+        IPage<Category> categories = shopCategoryService.listByParentIdAndShopId(parentId,shopId, current, size);
 //        List<CategoryDto> categoryDtos = mapperFacade.mapAsList(categories, CategoryDto.class);
         List<Category> records = categories.getRecords();
         List<CategoryDto> categoryDtos = new ArrayList<>(records.size());

+ 20 - 20
yami-shop-api/src/main/resources/application-dev.yml

@@ -1,21 +1,21 @@
-server:
-  port: 8112
-spring:
-  datasource:
-    url: jdbc:mysql://192.168.1.242:3306/yami_bbc?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
-    username: root
-    password: FaajjVy8rl(k
-    driver-class-name: com.mysql.cj.jdbc.Driver
-    type: com.zaxxer.hikari.HikariDataSource
-    hikari:
-      minimum-idle: 0
-      maximum-pool-size: 100
-      idle-timeout: 10000
-      auto-commit: true
-      connection-test-query: select 1
-  redis:
-    redisson:
-      config: classpath:redisson/redisson-dev.yml
-
-logging:
+server:
+  port: 8112
+spring:
+  datasource:
+    url: jdbc:mysql://192.168.1.242:3306/yami_bbc?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
+    username: root
+    password: FaajjVy8rl(k
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    type: com.zaxxer.hikari.HikariDataSource
+    hikari:
+      minimum-idle: 0
+      maximum-pool-size: 100
+      idle-timeout: 10000
+      auto-commit: true
+      connection-test-query: select 1
+  redis:
+    redisson:
+      config: classpath:redisson/redisson-dev.yml
+
+logging:
   config: classpath:logback/logback-dev.xml

+ 20 - 20
yami-shop-api/src/main/resources/application-prod.yml

@@ -1,20 +1,20 @@
-server:
-  port: 8112
-spring:
-  datasource:
-    url: jdbc:mysql://172.23.240.101:3306/yami_bbc?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
-    username: root
-    password: TtbTeGJBnDvH4hMx
-    driver-class-name: com.mysql.cj.jdbc.Driver
-    type: com.zaxxer.hikari.HikariDataSource
-    hikari:
-      minimum-idle: 0
-      maximum-pool-size: 20
-      idle-timeout: 25000
-      auto-commit: true
-      connection-test-query: select 1
-  redis:
-    redisson:
-      config: classpath:redisson/redisson-prod.yml
-logging:
-  config: classpath:logback/logback-prod.xml
+server:
+  port: 8112
+spring:
+  datasource:
+    url: jdbc:mysql://172.23.240.101:3306/yami_bbc?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
+    username: root
+    password: TtbTeGJBnDvH4hMx
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    type: com.zaxxer.hikari.HikariDataSource
+    hikari:
+      minimum-idle: 0
+      maximum-pool-size: 20
+      idle-timeout: 25000
+      auto-commit: true
+      connection-test-query: select 1
+  redis:
+    redisson:
+      config: classpath:redisson/redisson-prod.yml
+logging:
+  config: classpath:logback/logback-prod.xml

+ 21 - 0
yami-shop-bean/src/main/java/com/yami/shop/bean/dto/SetChannelPriceDto.java

@@ -0,0 +1,21 @@
+
+package com.yami.shop.bean.dto;
+
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@ApiModel("设置渠道价格")
+@Data
+public class SetChannelPriceDto {
+
+    @ApiModelProperty("渠道ID")
+    private Long channelId;
+
+    @ApiModelProperty("渠道售价")
+    private BigDecimal channelProdPrice;
+
+}

+ 1 - 1
yami-shop-bean/src/main/java/com/yami/shop/bean/dto/ShopCategoryExcelDTO.java

@@ -12,7 +12,7 @@ public class ShopCategoryExcelDTO {
 
     @ExcelProperty("门店ID")
     @ColumnWidth(20)
-    private Long shopId;
+    private String shopId;
 
     @ExcelProperty("门店名称")
     @ColumnWidth(20)

+ 42 - 0
yami-shop-bean/src/main/java/com/yami/shop/bean/dto/UpdateShannerProdDTO.java

@@ -0,0 +1,42 @@
+package com.yami.shop.bean.dto;
+
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * 更新渠道商品价格
+ * @author fbj
+ */
+@Data
+public class UpdateShannerProdDTO {
+
+    /**
+     * 店铺id
+     */
+    private Long shopId;
+    /**
+     * 商品id
+     */
+    private Long skuId;
+
+
+    /**
+     * 进货价
+     */
+    private BigDecimal purchasePrice;
+
+    /**
+     * 出货价
+     */
+    private BigDecimal deliveryPrice;
+
+
+    /**
+     * 渠道价格
+     */
+    private List<SetChannelPriceDto> setChannelPriceDtoList;
+
+}

+ 1 - 2
yami-shop-bean/src/main/java/com/yami/shop/bean/model/CategoryBrand.java

@@ -19,7 +19,6 @@ import java.io.Serializable;
 @TableName("tz_category_brand")
 public class CategoryBrand implements Serializable {
     @TableId
-
     private Long id;
 
     /**
@@ -33,4 +32,4 @@ public class CategoryBrand implements Serializable {
      */
 
     private Long brandId;
-}
+}

+ 0 - 1
yami-shop-bean/src/main/java/com/yami/shop/bean/model/CategoryProd.java

@@ -19,7 +19,6 @@ import java.io.Serializable;
 @TableName("tz_category_prod")
 public class CategoryProd implements Serializable {
     @TableId
-
     private Long id;
 
     /**

+ 7 - 2
yami-shop-bean/src/main/java/com/yami/shop/bean/model/Channel.java

@@ -30,12 +30,17 @@ public class Channel implements Serializable {
     /**
      * 主键
      */
-    @TableId(type = IdType.INPUT)
+    @TableId
     private Long id;
 
     /**
      * 渠道名称
      */
-    private Long channelName;
+    private String channelName;
+
+    /**
+     * 渠道类型(1-企业用户,2-B端用户,3-C端用户)
+     */
+    private String type;
 
 }

+ 9 - 1
yami-shop-bean/src/main/java/com/yami/shop/bean/model/ChannelProd.java

@@ -11,6 +11,7 @@
 package com.yami.shop.bean.model;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
@@ -32,13 +33,15 @@ public class ChannelProd implements Serializable {
     /**
      * 主键
      */
-    @TableId(type = IdType.INPUT)
+    @TableId
     private Long id;
 
     /**
      * 渠道ID
      */
     private Long channelId;
+    @TableField(exist = false)
+    private String channelName;
 
     /**
      * 单品ID
@@ -48,6 +51,11 @@ public class ChannelProd implements Serializable {
      * 门店ID
      */
     private Long shopId;
+    /**
+     *  渠道类型(1-企业用户,2-B端用户,3-C端用户)
+     */
+    @TableField(exist = false)
+    private String channelType;
     /**
      * 门店名称
      */

+ 9 - 0
yami-shop-bean/src/main/java/com/yami/shop/bean/model/FrontCategory.java

@@ -80,6 +80,15 @@ public class FrontCategory implements Serializable {
      */
     private String icon;
 
+    /**
+     * 图片
+     */
+    private String pic;
+    /**
+     *标签ID
+     */
+    private Long label;
+
     /**
      * 是否叶子(1-是,2-不是)
      */

+ 5 - 0
yami-shop-bean/src/main/java/com/yami/shop/bean/model/Label.java

@@ -36,6 +36,11 @@ public class Label implements Serializable {
      */
     private Integer type;
 
+    /**
+     * 是否删除(0-未删除,1-已删除)
+     */
+    private Integer isDelete;
+
     /**
      * 创建日期
      */

+ 1 - 1
yami-shop-bean/src/main/java/com/yami/shop/bean/model/Product.java

@@ -54,7 +54,7 @@ public class Product implements Serializable {
     /**
      * 在海博平台中的前台分类id
      */
-    private Long hbFrontCategoryId;
+    private String hbFrontCategoryId;
 
     /**
      * 在店铺当中的分类id

+ 10 - 1
yami-shop-bean/src/main/java/com/yami/shop/bean/model/ShopCategory.java

@@ -24,13 +24,22 @@ public class ShopCategory implements Serializable {
     @TableId
     private Long id;
 
+    /**
+     * pid
+     */
+    private Long pid;
+
     /**
      * 类目名称
      */
     private String name;
 
     /**
-     * 门店ID
+     * 海博门店ID
+     */
+    private String hbShopId;
+    /**
+     * 店铺ID
      */
     private Long shopId;
 

+ 20 - 2
yami-shop-bean/src/main/java/com/yami/shop/bean/model/ShopDetail.java

@@ -41,9 +41,13 @@ public class ShopDetail implements Serializable {
      */
     private String outStationNo;
     /**
-     * 海博门店编码
+     * 海博门店ID
      */
     private String hbStationId;
+    /**
+     * 海博门店编码
+     */
+    private String hbStationNo;
 
     /**
      * 店长用户id
@@ -129,7 +133,6 @@ public class ShopDetail implements Serializable {
     /**
      * 店铺状态(-1:未开通 0: 停业中 1:营业中),可修改
      */
-
     private Integer shopStatus;
 
     /**
@@ -181,6 +184,20 @@ public class ShopDetail implements Serializable {
      */
     private String mapType;
 
+    /**
+     * 店铺公告
+     */
+    private String notice;
+
+    /**
+     *
+     * 经营状态(0:停业,1正常)
+     */
+    private Integer runStatus;
+    /**
+     * 营业时间
+     */
+    private String businessTime;
     /**
      * 物品类型
      */
@@ -190,4 +207,5 @@ public class ShopDetail implements Serializable {
      * 第三方id
      */
     private String thirdPartyCode;
+
 }

+ 16 - 0
yami-shop-bean/src/main/java/com/yami/shop/bean/model/ShopSku.java

@@ -10,6 +10,7 @@
 
 package com.yami.shop.bean.model;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
@@ -18,6 +19,7 @@ import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 
 @Data
 @TableName("tz_shop_sku")
@@ -39,6 +41,10 @@ public class ShopSku implements Serializable {
      * 单品ID
      */
     private Long skuId;
+    /**
+     * 单品ID
+     */
+    private Long spuId;
 
     /**
      * 商品对应门店价格
@@ -67,4 +73,14 @@ public class ShopSku implements Serializable {
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date recTime;
 
+    /**
+     * 渠道商品
+     */
+    @TableField(exist = false)
+    private List<ChannelProd> channelProdList;
+    /**
+     * 商品详细
+     */
+    @TableField(exist = false)
+    private Sku sku;
 }

+ 7 - 3
yami-shop-bean/src/main/java/com/yami/shop/bean/model/Sku.java

@@ -27,7 +27,7 @@ public class Sku implements Serializable {
     /**
      * 单品ID
      */
-    @TableId(type = IdType.INPUT)
+    @TableId
     private Long skuId;
     /**
      * 商品ID
@@ -37,11 +37,11 @@ public class Sku implements Serializable {
     /**
      * 商品编码(海博)
      */
-    private Long hbSpuId;
+    private String hbSpuId;
     /**
      * 单品编码(海博)
      */
-    private Long hbSkuId;
+    private String hbSkuId;
 
     /**
      * 销售属性组合字符串,格式是p1:v1;p2:v2
@@ -49,6 +49,10 @@ public class Sku implements Serializable {
     private String properties;
 
     private String skuCode;
+    /**
+     * 规格
+     */
+    private String spec;
 
     /**
      * 原价

+ 2 - 3
yami-shop-delivery/yami-shop-delivery-comment/src/main/java/com/yami/shop/delivery/comment/model/Transport2.java → yami-shop-bean/src/main/java/com/yami/shop/bean/model/Transport2.java

@@ -8,9 +8,8 @@
  * 版权所有,侵权必究!
  */
 
-package com.yami.shop.delivery.comment.model;
+package com.yami.shop.bean.model;
 
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.annotations.ApiModelProperty;
@@ -19,11 +18,11 @@ import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 import java.util.Date;
-import java.util.List;
 
 @Data
 @TableName("tz_transport2")
 public class Transport2 implements Serializable {
+
     private static final long serialVersionUID = 1876655654053364580L;
     /**
      * 运费模板id

+ 13 - 6
yami-shop-bean/src/main/java/com/yami/shop/bean/vo/ChannelProdExportVO.java

@@ -2,6 +2,7 @@ package com.yami.shop.bean.vo;
 
 
 import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
 import lombok.Data;
 
 import java.math.BigDecimal;
@@ -13,25 +14,31 @@ import java.math.BigDecimal;
 public class ChannelProdExportVO {
 
     @ExcelProperty(value = "海博商品ID", index = 0)
+    @ColumnWidth(20)
     private String skuId;
 
     @ExcelProperty(value = "商品名称", index = 1)
+    @ColumnWidth(40)
     private String skuName;
 
-    @ExcelProperty(value = "销售渠道", index = 2)
-    private String channelName;
-
     @ExcelProperty(value = "门店名称", index = 3)
+    @ColumnWidth(20)
     private String shopName;
 
+    @ExcelProperty(value = "销售渠道", index = 2)
+    @ColumnWidth(20)
+    private String channelName;
 
-    @ExcelProperty(value = "进货价", index = 4)
+    @ExcelProperty(value = "进货价(元)", index = 4)
+    @ColumnWidth(20)
     private BigDecimal purchasePrice;
 
-    @ExcelProperty(value = "出货价", index = 5)
+    @ExcelProperty(value = "出货价(元)", index = 5)
+    @ColumnWidth(20)
     private BigDecimal deliveryPrice;
 
-    @ExcelProperty(value = "渠道售价", index = 6)
+    @ExcelProperty(value = "渠道售价(元)", index = 6)
+    @ColumnWidth(20)
     private BigDecimal channelProdPrice;
 
 }

+ 6 - 8
yami-shop-bean/src/main/java/com/yami/shop/bean/vo/ChannelProdImportVO.java

@@ -17,38 +17,36 @@ import java.math.BigDecimal;
 @ContentStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 9) // 内容背景色(9=淡黄色)
 public class ChannelProdImportVO {
 
-
     @ExcelProperty(value = "海博商品ID", index = 0)
     @ColumnWidth(20) // 列宽
     @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER) // 居中对齐
     private String skuId;
 
     @ExcelProperty(value = "商品名称", index = 1)
-    @ColumnWidth(40) // 列宽
+    @ColumnWidth(40)
     @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.LEFT)
     private String skuName;
 
     @ExcelProperty(value = "销售渠道", index = 2)
-    @ColumnWidth(20) // 列宽
+    @ColumnWidth(20)
     @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.LEFT)
     private String channelName;
 
     @ExcelProperty(value = "门店名称", index = 3)
-    @ColumnWidth(20) // 列宽
+    @ColumnWidth(20)
     @ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.LEFT)
     private String shopName;
 
-
     @ExcelProperty(value = "进货价(元)", index = 4)
-    @ColumnWidth(20) // 列宽
+    @ColumnWidth(20)
     private BigDecimal purchasePrice;
 
     @ExcelProperty(value = "出货价(元)", index = 5)
-    @ColumnWidth(20) // 列宽
+    @ColumnWidth(20)
     private BigDecimal deliveryPrice;
 
     @ExcelProperty(value = "渠道售价(元)", index = 6)
-    @ColumnWidth(20) // 列宽
+    @ColumnWidth(20)
     private BigDecimal channelProdPrice;
 
 }

+ 1 - 5
yami-shop-delivery/yami-shop-delivery-comment/src/main/java/com/yami/shop/delivery/comment/dao/Transport2Mapper.java

@@ -11,14 +11,10 @@
 package com.yami.shop.delivery.comment.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.yami.shop.delivery.comment.model.TransfeeFree;
-import com.yami.shop.delivery.comment.model.Transport;
-import com.yami.shop.delivery.comment.model.Transport2;
+import com.yami.shop.bean.model.Transport2;
 import com.yami.shop.delivery.comment.param.ShopTransport;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.List;
-
 public interface Transport2Mapper extends BaseMapper<Transport2> {
 
 

+ 1 - 4
yami-shop-delivery/yami-shop-delivery-comment/src/main/java/com/yami/shop/delivery/comment/service/Transport2Service.java

@@ -12,13 +12,10 @@ package com.yami.shop.delivery.comment.service;
 
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.yami.shop.delivery.comment.model.Transport;
-import com.yami.shop.delivery.comment.model.Transport2;
+import com.yami.shop.bean.model.Transport2;
 import com.yami.shop.delivery.comment.param.ShopTransport;
 import org.springframework.cache.annotation.CacheEvict;
 
-import java.util.List;
-
 /**
  * @author lgh on 2018/11/16.
  */

+ 1 - 1
yami-shop-delivery/yami-shop-delivery-comment/src/main/java/com/yami/shop/delivery/comment/service/TransportManagerService.java

@@ -13,7 +13,7 @@ package com.yami.shop.delivery.comment.service;
 import com.yami.shop.bean.app.dto.ProductItemDto;
 import com.yami.shop.bean.app.dto.ShopCartItemDto;
 import com.yami.shop.bean.model.UserAddr;
-import com.yami.shop.delivery.comment.model.Transport2;
+import com.yami.shop.bean.model.Transport2;
 
 import java.util.List;
 

+ 1 - 4
yami-shop-delivery/yami-shop-delivery-comment/src/main/java/com/yami/shop/delivery/comment/service/impl/Transport2ServiceImpl.java

@@ -12,7 +12,7 @@ package com.yami.shop.delivery.comment.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.yami.shop.delivery.comment.dao.Transport2Mapper;
-import com.yami.shop.delivery.comment.model.Transport2;
+import com.yami.shop.bean.model.Transport2;
 import com.yami.shop.delivery.comment.param.ShopTransport;
 import com.yami.shop.delivery.comment.service.Transport2Service;
 import lombok.AllArgsConstructor;
@@ -21,9 +21,6 @@ import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.Collections;
-import java.util.List;
-
 /**
  * @author lgh on 2018/11/16.
  */

+ 1 - 3
yami-shop-delivery/yami-shop-delivery-comment/src/main/java/com/yami/shop/delivery/comment/service/impl/TransportManagerServiceImpl.java

@@ -11,20 +11,18 @@
 package com.yami.shop.delivery.comment.service.impl;
 
 import cn.hutool.core.collection.CollectionUtil;
-import cn.hutool.core.util.NumberUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.yami.shop.bean.app.dto.ProductItemDto;
 import com.yami.shop.bean.app.dto.ShopCartItemDto;
 import com.yami.shop.bean.enums.TransportChargeType;
 import com.yami.shop.bean.model.*;
 import com.yami.shop.common.exception.GlobalException;
-import com.yami.shop.common.exception.YamiShopBindException;
 import com.yami.shop.common.util.Arith;
 import com.yami.shop.common.util.Json;
 import com.yami.shop.delivery.comment.model.Transfee;
 import com.yami.shop.delivery.comment.model.TransfeeFree;
 import com.yami.shop.delivery.comment.model.Transport;
-import com.yami.shop.delivery.comment.model.Transport2;
+import com.yami.shop.bean.model.Transport2;
 import com.yami.shop.delivery.comment.service.Transport2Service;
 import com.yami.shop.delivery.comment.service.TransportManagerService;
 import com.yami.shop.delivery.comment.service.TransportService;

+ 2 - 2
yami-shop-delivery/yami-shop-delivery-comment/src/main/resources/mapper/Transport2Mapper.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.yami.shop.delivery.comment.dao.Transport2Mapper">
-    <resultMap id="BaseResultMap" type="com.yami.shop.delivery.comment.model.Transport2">
+    <resultMap id="BaseResultMap" type="com.yami.shop.bean.model.Transport2">
         <id column="transport_id" jdbcType="BIGINT" property="transportId"/>
         <result column="trans_name" jdbcType="VARCHAR" property="transName"/>
         <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
@@ -36,7 +36,7 @@
     <select id="findByTransportId" resultMap="BaseResultMap">
         select *
         from tz_transport2 p
-        where port.transport_id = #{transportId}
+        where p.transport_id = #{transportId}
     </select>
 
 

+ 1 - 5
yami-shop-delivery/yami-shop-delivery-multishop/src/main/java/com/yami/shop/delivery/multishop/controller/Transport2Controller.java

@@ -12,15 +12,11 @@ package com.yami.shop.delivery.multishop.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.yami.shop.bean.app.dto.ShopHeadInfoDto;
 import com.yami.shop.common.util.PageParam;
-import com.yami.shop.delivery.comment.model.Transport2;
+import com.yami.shop.bean.model.Transport2;
 import com.yami.shop.delivery.comment.param.ShopTransport;
 import com.yami.shop.delivery.comment.service.Transport2Service;
 import com.yami.shop.security.multishop.util.SecurityUtils;
-import com.yami.shop.service.ShopDetailService;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.*;

+ 20 - 20
yami-shop-multishop/src/main/resources/application-dev.yml

@@ -1,20 +1,20 @@
-server:
-  port: 8113
-spring:
-  datasource:
-    url: jdbc:mysql://192.168.1.242:3306/yami_bbc?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
-    username: root
-    password: FaajjVy8rl(k
-    driver-class-name: com.mysql.cj.jdbc.Driver
-    type: com.zaxxer.hikari.HikariDataSource
-    hikari:
-      minimum-idle: 0
-      maximum-pool-size: 20
-      idle-timeout: 10000
-      auto-commit: true
-      connection-test-query: SELECT 1
-  redis:
-    redisson:
-      config: classpath:redisson/redisson-dev.yml
-logging:
-  config: classpath:logback/logback-dev.xml
+server:
+  port: 8113
+spring:
+  datasource:
+    url: jdbc:mysql://192.168.1.242:3306/yami_bbc?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
+    username: root
+    password: FaajjVy8rl(k
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    type: com.zaxxer.hikari.HikariDataSource
+    hikari:
+      minimum-idle: 0
+      maximum-pool-size: 20
+      idle-timeout: 10000
+      auto-commit: true
+      connection-test-query: SELECT 1
+  redis:
+    redisson:
+      config: classpath:redisson/redisson-dev.yml
+logging:
+  config: classpath:logback/logback-dev.xml

+ 85 - 0
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ChannelController.java

@@ -0,0 +1,85 @@
+
+package com.yami.shop.platform.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yami.shop.bean.model.Channel;
+import com.yami.shop.bean.model.ChannelProd;
+import com.yami.shop.bean.model.ShopDetail;
+import com.yami.shop.common.util.PageParam;
+import com.yami.shop.common.util.R;
+import com.yami.shop.service.ChannelService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang3.ObjectUtils;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 渠道管理控制器
+ *
+ * @author lgh on 2024/01/01.
+ */
+@RestController
+@RequestMapping("/platform/channel")
+@Api(tags = "渠道管理接口")
+@AllArgsConstructor
+public class ChannelController {
+    private final ChannelService channelService;
+
+    /**
+     * 查询全部
+     */
+    @GetMapping("/listAll")
+    @ApiOperation(value = "根据渠道ID获取商品列表")
+    public R<List<Channel>> listAll() {
+        List<Channel> channels = channelService.list();
+
+        return R.SUCCESS(channels);
+    }
+
+    /**
+     * 根据渠道ID获取商品列表
+     */
+    @GetMapping("/listProd/{id}")
+    @ApiOperation(value = "根据渠道ID获取商品列表")
+    public R<Channel> listProd(@PathVariable String id) {
+        Channel channel = channelService.getById(id);
+        return R.SUCCESS(channel);
+    }
+    /**
+     * 分页获取
+     */
+    @GetMapping("/page")
+    @ApiOperation(value = "分页获取")
+    public R<IPage<Channel>> page(@ModelAttribute PageParam pageParam,
+                                 @ModelAttribute Channel channel ) {
+        IPage<Channel> page = channelService.page(pageParam,new LambdaQueryWrapper<Channel>()
+                .eq(ObjectUtils.isNotEmpty(channel.getChannelName()),Channel::getChannelName, channel.getChannelName())
+                .eq(ObjectUtils.isNotEmpty(channel.getType()), Channel::getType, channel.getType()));
+
+        return R.SUCCESS(page);
+    }
+
+    /**
+     * 添加
+     */
+    @PostMapping
+    @ApiOperation(value = "添加")
+    public R add(@RequestBody Channel channel) {
+        channelService.save(channel);
+        return R.SUCCESS();
+    }
+    /**
+     * 修改
+     */
+    @PutMapping
+    @ApiOperation(value = "修改")
+    public R update(@RequestBody Channel channel) {
+        channelService.updateById(channel);
+        return R.SUCCESS();
+    }
+}

+ 32 - 16
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ChannelProdController.java

@@ -2,6 +2,7 @@ package com.yami.shop.platform.controller;
 
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yami.shop.bean.dto.UpdateShannerProdDTO;
 import com.yami.shop.bean.model.ChannelProd;
 import com.yami.shop.common.util.PageParam;
 import com.yami.shop.common.util.R;
@@ -18,6 +19,7 @@ import java.util.List;
 
 /**
  * 渠道商品管理控制器
+ *
  * @author lgh on 2024/01/01.
  */
 @RestController
@@ -35,6 +37,7 @@ public class ChannelProdController {
         return R.SUCCESS(channelProds);
     }
 
+
     @GetMapping("/sku/{skuId}")
     @ApiOperation(value = "根据SKU ID获取渠道商品列表")
     public R<List<ChannelProd>> getChannelProdsBySkuId(@PathVariable Long skuId) {
@@ -53,49 +56,63 @@ public class ChannelProdController {
 
     @GetMapping("/page")
     @ApiOperation(value = "分页查询渠道商品")
-    public R<IPage<ChannelProd>> getChannelProdPage(PageParam<ChannelProd> page, ChannelProd channelProd) {
-        IPage<ChannelProd> channelProdPage = channelProdService.getChannelProdPage(page, channelProd);
+    public R<IPage<ChannelProd>> getChannelProdPage(
+            @RequestParam(defaultValue = "1") Integer current,
+            @RequestParam(defaultValue = "10") Integer size,
+            ChannelProd channelProd) {
+
+        PageParam page = new PageParam();
+        page.setCurrent(current);
+        page.setSize(size);
+        IPage<ChannelProd> channelProdPage = channelProdService.page(page);
         return R.SUCCESS(channelProdPage);
     }
 
     @PostMapping
     @ApiOperation(value = "保存渠道商品")
-    public R<Void> saveChannelProd(@RequestBody @Valid ChannelProd channelProd) {
+    public R saveChannelProd(@RequestBody @Valid ChannelProd channelProd) {
         channelProdService.saveChannelProd(channelProd);
         return R.SUCCESS();
     }
 
+    @PutMapping("/setUpChannels")
+    @ApiOperation(value = "设置销售渠道及价格")
+    public R setUpChannels(@RequestBody UpdateShannerProdDTO updateShannerProdDTO) {
+        channelProdService.setUpChannels(updateShannerProdDTO);
+        return R.SUCCESS();
+    }
+
     @PutMapping
     @ApiOperation(value = "更新渠道商品")
-    public R<Void> updateChannelProd(@RequestBody @Valid ChannelProd channelProd) {
+    public R updateChannelProd(@RequestBody @Valid ChannelProd channelProd) {
         channelProdService.updateChannelProd(channelProd);
         return R.SUCCESS();
     }
 
     @DeleteMapping("/{id}")
     @ApiOperation(value = "根据ID删除渠道商品")
-    public R<Void> deleteChannelProdById(@PathVariable Long id) {
+    public R deleteChannelProdById(@PathVariable Long id) {
         channelProdService.deleteChannelProdById(id);
         return R.SUCCESS();
     }
 
     @DeleteMapping("/channel/{channelId}")
     @ApiOperation(value = "根据渠道ID删除渠道商品")
-    public R<Void> deleteChannelProdsBychannelId(@PathVariable Long channelId) {
+    public R deleteChannelProdsBychannelId(@PathVariable Long channelId) {
         channelProdService.deleteChannelProdsBychannelId(channelId);
         return R.SUCCESS();
     }
 
     @DeleteMapping("/sku/{skuId}")
     @ApiOperation(value = "根据SKU ID删除渠道商品")
-    public R<Void> deleteChannelProdsBySkuId(@PathVariable Long skuId) {
+    public R deleteChannelProdsBySkuId(@PathVariable Long skuId) {
         channelProdService.deleteChannelProdsBySkuId(skuId);
         return R.SUCCESS();
     }
 
     @PutMapping("/batch/prices")
     @ApiOperation(value = "批量更新渠道商品价格")
-    public R<Void> updateBatchPrices(@RequestBody List<ChannelProd> channelProds) {
+    public R updateBatchPrices(@RequestBody List<ChannelProd> channelProds) {
         channelProdService.updateBatchPrices(channelProds);
         return R.SUCCESS();
     }
@@ -124,24 +141,23 @@ public class ChannelProdController {
     }
 
 
-
     @GetMapping("/template/download")
     @ApiOperation(value = "下载渠道商品导入模板")
-    public void downloadTemplate(HttpServletResponse response){
-            channelProdService.downloadTemplate(response);
+    public void downloadTemplate(HttpServletResponse response) {
+        channelProdService.downloadTemplate(response);
     }
 
     @PostMapping("/import")
     @ApiOperation(value = "导入渠道商品数据")
     public R<String> importChannelProds(@RequestParam("file") MultipartFile file) {
-            String result = channelProdService.importChannelProds(file);
-            return R.SUCCESS(result);
+        String result = channelProdService.importChannelProds(file);
+        return R.SUCCESS(result);
     }
 
-    @PostMapping("/export")
+    @GetMapping("/export")
     @ApiOperation(value = "导出渠道商品数据")
-    public void exportChannelProds(@RequestBody ChannelProd channelProd, HttpServletResponse response) {
-            channelProdService.exportChannelProds(channelProd, response);
+    public void exportChannelProds(ChannelProd channelProd, HttpServletResponse response) {
+        channelProdService.exportChannelProds(channelProd, response);
     }
 
 }

+ 19 - 6
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/LabelController.java

@@ -1,6 +1,7 @@
 // LabelController.java
 package com.yami.shop.platform.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.yami.shop.bean.model.Label;
 import com.yami.shop.common.util.PageParam;
@@ -32,8 +33,20 @@ public class LabelController {
      * 分页获取标签列表
      */
     @GetMapping("/page")
-    public R<IPage<Label>> page(PageParam<Label> pageParam) {
-        IPage<Label> page = labelService.page(pageParam);
+    public R<IPage<Label>> page(@RequestParam(defaultValue = "1") Integer current,
+                                @RequestParam(defaultValue = "10") Integer size,
+                                Label label) {
+        PageParam<Label> pageParam = new PageParam<>();
+        pageParam.setCurrent(current);
+        pageParam.setSize(size);
+
+        LambdaQueryWrapper<Label> queryWrapper = new LambdaQueryWrapper<>();
+        if (label.getName() != null && !label.getName().trim().isEmpty()) {
+            queryWrapper.like(Label::getName, label.getName().trim());
+        }
+        queryWrapper.eq(Label::getIsDelete, 0);
+
+        IPage<Label> page = labelService.page(pageParam, queryWrapper);
         return R.SUCCESS(page);
     }
 
@@ -42,7 +55,7 @@ public class LabelController {
      */
     @GetMapping("/listAll")
     public R<List<Label>> listAll() {
-        List<Label> list = labelService.list();
+        List<Label> list = labelService.list(new LambdaQueryWrapper<Label>().eq(Label::getIsDelete, 0));
         return R.SUCCESS(list);
     }
 
@@ -59,7 +72,7 @@ public class LabelController {
      * 添加标签
      */
     @PostMapping
-    public R<Void> save(@Valid @RequestBody Label label) {
+    public R save(@Valid @RequestBody Label label) {
         labelService.save(label);
         return R.SUCCESS();
     }
@@ -68,7 +81,7 @@ public class LabelController {
      * 更新标签
      */
     @PutMapping
-    public R<Void> update(@Valid @RequestBody Label label) {
+    public R update(@Valid @RequestBody Label label) {
         labelService.updateById(label);
         return R.SUCCESS();
     }
@@ -77,7 +90,7 @@ public class LabelController {
      * 删除标签
      */
     @DeleteMapping
-    public R<Void> delete(@RequestBody Long[] ids) {
+    public R delete(@RequestBody Long[] ids) {
         labelService.removeByIds(Arrays.asList(ids));
         return R.SUCCESS();
     }

+ 23 - 3
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ShopDetailController.java

@@ -9,6 +9,7 @@ package com.yami.shop.platform.controller;
 
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.yami.shop.bean.enums.OfflineHandleEventType;
 import com.yami.shop.bean.enums.ShopStatus;
 import com.yami.shop.bean.model.OfflineHandleEvent;
@@ -17,6 +18,7 @@ import com.yami.shop.bean.model.User;
 import com.yami.shop.bean.param.OfflineHandleEventAuditParam;
 import com.yami.shop.common.exception.GlobalException;
 import com.yami.shop.common.exception.YamiShopBindException;
+import com.yami.shop.common.util.PageParam;
 import com.yami.shop.common.util.RedisUtil;
 import com.yami.shop.security.comment.constants.SecurityConstants;
 import com.yami.shop.security.comment.model.AppConnect;
@@ -27,6 +29,7 @@ import com.yami.shop.service.ShopDetailService;
 import com.yami.shop.service.UserService;
 import lombok.AllArgsConstructor;
 import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -43,7 +46,7 @@ import java.util.*;
 import com.yami.shop.common.util.R;
 
 /**
- * 商家详细信息管理实现
+ * 门店详细信息管理实现
  *
  * @author lgh
  * @version 1.0.0
@@ -60,6 +63,23 @@ public class ShopDetailController {
     private final TokenStore tokenStore;
     private final UserService userService;
 
+
+    /**
+     * 分页获取门店详细列表
+     */
+    @GetMapping("/page")
+    public R<IPage<ShopDetail>> page(@ModelAttribute PageParam pageParam,
+                                      @ModelAttribute ShopDetail shopDetail ) {
+        IPage<ShopDetail> page = shopDetailService.page(pageParam,new LambdaQueryWrapper<ShopDetail>()
+                .eq(ObjectUtils.isNotEmpty(shopDetail.getShopName()),ShopDetail::getShopName, shopDetail.getShopName())
+                .eq(ObjectUtils.isNotEmpty(shopDetail.getHbStationNo()),ShopDetail::getHbStationNo, shopDetail.getHbStationNo()));
+
+
+        return R.SUCCESS(page);
+    }
+
+
+
     /**
      * 通过活动id获取下线信息
      */
@@ -75,7 +95,7 @@ public class ShopDetailController {
      */
     @PostMapping("/offline")
     @PreAuthorize("@pms.hasPermission('shop:shopAuditing:audit')")
-    public R<Void> offline(@RequestBody OfflineHandleEvent offlineHandleEvent) {
+    public R offline(@RequestBody OfflineHandleEvent offlineHandleEvent) {
         Long sysUserId = SecurityUtils.getSysUser().getUserId();
         ShopDetail shopDetail = shopDetailService.getShopDetailByShopId(offlineHandleEvent.getHandleId());
         if (shopDetail == null) {
@@ -115,7 +135,7 @@ public class ShopDetailController {
      */
     @PostMapping("/auditShop")
     @PreAuthorize("@pms.hasPermission('shop:shopAuditing:audit')")
-    public R<Void> auditOfflineShop(@RequestBody OfflineHandleEventAuditParam offlineHandleEventAuditParam) {
+    public R auditOfflineShop(@RequestBody OfflineHandleEventAuditParam offlineHandleEventAuditParam) {
         Long sysUserId = SecurityUtils.getSysUser().getUserId();
         ShopDetail shopDetail = shopDetailService.getShopDetailByShopId(offlineHandleEventAuditParam.getHandleId());
         if (shopDetail == null) {

+ 12 - 4
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ShopSkuController.java

@@ -7,14 +7,12 @@
 
 package com.yami.shop.platform.controller;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.yami.shop.bean.model.ShopSku;
 import com.yami.shop.common.util.R;
 import com.yami.shop.service.ShopSkuService;
 import lombok.AllArgsConstructor;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * 门店对应商品价格和库存管理
@@ -39,6 +37,16 @@ public class ShopSkuController {
         shopProdService.insertSku(shopSku);
         return R.SUCCESS(shopSku);
     }
+    /**
+     * 分页查询门店对应商品详细
+     */
+    @GetMapping("/page")
+    public R<IPage<ShopSku>> page(@RequestParam(defaultValue = "1") Integer current,
+                                  @RequestParam(defaultValue = "10") Integer size,
+                                  ShopSku shopSku) {
+        IPage<ShopSku> page = shopProdService.shopSkuPage(current,size,shopSku);
+        return R.SUCCESS(page);
+    }
 
 
 }

+ 0 - 107
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/SysDictDataController.java

@@ -1,107 +0,0 @@
-package com.yami.shop.platform.controller;
-
-
-import cn.hutool.poi.excel.ExcelUtil;
-import com.yami.shop.bean.model.SysDictData;
-import com.yami.shop.common.util.R;
-import com.yami.shop.service.ISysDictDataService;
-import com.yami.shop.service.ISysDictTypeService;
-import lombok.extern.java.Log;
-import org.apache.commons.lang3.ObjectUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletResponse;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 数据字典信息(字典数据)
- *
- * @author ruoyi
- */
-@RestController
-@RequestMapping("/platform/dict/data")
-public class SysDictDataController
-{
-    @Autowired
-    private ISysDictDataService dictDataService;
-
-    @Autowired
-    private ISysDictTypeService dictTypeService;
-
-//    @PreAuthorize("@ss.hasPermi('system:dict:list')")
-    @GetMapping("/list")
-    public R< List<SysDictData>> list(SysDictData dictData)
-    {
-        List<SysDictData> list = dictDataService.selectDictDataList(dictData);
-        return R.SUCCESS(list);
-    }
-
-//    @PreAuthorize("@ss.hasPermi('system:dict:export')")
-//    @PostMapping("/export")
-//    public void export(HttpServletResponse response, SysDictData dictData)
-//    {
-//        List<SysDictData> list = dictDataService.selectDictDataList(dictData);
-//        ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
-//        util.exportExcel(response, list, "字典数据");
-//    }
-
-    /**
-     * 查询字典数据详细
-     */
-    @PreAuthorize("@ss.hasPermi('system:dict:query')")
-    @GetMapping(value = "/{dictCode}")
-    public R<SysDictData> getInfo(@PathVariable Long dictCode)
-    {
-        return R.SUCCESS(dictDataService.selectDictDataById(dictCode));
-    }
-
-    /**
-     * 根据字典类型查询字典数据信息
-     */
-    @GetMapping(value = "/type/{dictType}")
-    public R dictType(@PathVariable String dictType)
-    {
-        List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
-        if (ObjectUtils.isEmpty(data))
-        {
-            data = new ArrayList<SysDictData>();
-        }
-        return R.SUCCESS(data);
-    }
-
-    /**
-     * 新增字典类型
-     */
-    @PreAuthorize("@ss.hasPermi('system:dict:add')")
-    @PostMapping
-    public R add(@Validated @RequestBody SysDictData dict)
-    {
-//        dict.setCreateBy(getUsername());
-        return R.SUCCESS(dictDataService.insertDictData(dict));
-    }
-
-    /**
-     * 修改保存字典类型
-     */
-    @PreAuthorize("@ss.hasPermi('system:dict:edit')")
-    @PutMapping
-    public R edit(@Validated @RequestBody SysDictData dict)
-    {
-        return R.SUCCESS(dictDataService.updateDictData(dict));
-    }
-
-    /**
-     * 删除字典类型
-     */
-    @PreAuthorize("@ss.hasPermi('system:dict:remove')")
-    @DeleteMapping("/{dictCodes}")
-    public R remove(@PathVariable Long[] dictCodes)
-    {
-        dictDataService.deleteDictDataByIds(dictCodes);
-        return R.SUCCESS();
-    }
-}

+ 0 - 112
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/SysDictTypeController.java

@@ -1,112 +0,0 @@
-package com.yami.shop.platform.controller;
-
-
-import com.yami.shop.bean.model.SysDictType;
-import com.yami.shop.common.util.R;
-import com.yami.shop.service.ISysDictTypeService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- * 数据字典信息(字典类型表)
- *
- * @author ruoyi
- */
-@RestController
-@RequestMapping("/platform/dict/type")
-public class SysDictTypeController
-{
-    @Autowired
-    private ISysDictTypeService dictTypeService;
-
-    @PreAuthorize("@ss.hasPermi('system:dict:list')")
-    @GetMapping("/list")
-    public R<List<SysDictType>> list(SysDictType dictType)
-    {
-        List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
-        return R.SUCCESS(list);
-    }
-
-//    @PreAuthorize("@ss.hasPermi('system:dict:export')")
-//    @PostMapping("/export")
-//    public void export(HttpServletResponse response, SysDictType dictType)
-//    {
-//        List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
-//        ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
-//        util.exportExcel(response, list, "字典类型");
-//    }
-
-    /**
-     * 查询字典类型详细
-     */
-    @PreAuthorize("@ss.hasPermi('system:dict:query')")
-    @GetMapping(value = "/{dictId}")
-    public R<SysDictType> getInfo(@PathVariable Long dictId)
-    {
-        return R.SUCCESS(dictTypeService.selectDictTypeById(dictId));
-    }
-
-    /**
-     * 新增字典类型
-     */
-    @PreAuthorize("@ss.hasPermi('system:dict:add')")
-    @PostMapping
-    public R add(@Validated @RequestBody SysDictType dict)
-    {
-        if (!dictTypeService.checkDictTypeUnique(dict))
-        {
-            return R.FAIL("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
-        }
-        return R.SUCCESS(dictTypeService.insertDictType(dict));
-    }
-
-    /**
-     * 修改字典类型
-     */
-    @PreAuthorize("@ss.hasPermi('system:dict:edit')")
-    @PutMapping
-    public R edit(@Validated @RequestBody SysDictType dict)
-    {
-        if (!dictTypeService.checkDictTypeUnique(dict))
-        {
-            return R.FAIL("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
-        }
-        return R.SUCCESS(dictTypeService.updateDictType(dict));
-    }
-
-    /**
-     * 删除字典类型
-     */
-    @PreAuthorize("@ss.hasPermi('system:dict:remove')")
-    @DeleteMapping("/{dictIds}")
-    public R remove(@PathVariable Long[] dictIds)
-    {
-        dictTypeService.deleteDictTypeByIds(dictIds);
-        return R.SUCCESS();
-    }
-
-    /**
-     * 刷新字典缓存
-     */
-    @PreAuthorize("@ss.hasPermi('system:dict:remove')")
-    @DeleteMapping("/refreshCache")
-    public R refreshCache()
-    {
-        dictTypeService.resetDictCache();
-        return R.SUCCESS();
-    }
-
-    /**
-     * 获取字典选择框列表
-     */
-    @GetMapping("/optionselect")
-    public R optionselect()
-    {
-        List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll();
-        return R.SUCCESS(dictTypes);
-    }
-}

+ 0 - 11
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/hb/GoodsController.java

@@ -107,17 +107,6 @@ public class GoodsController {
     }
 
 
-    /**
-     * 商品-门店品售卖状态查询接口
-     *
-     * @return 商品响应
-     */
-    @GetMapping("/getSelfSkuStatus")
-    public HBR getSelfSkuStatus() {
-        return HBR.success(goodsService.getSelfSkuStatus());
-    }
-
-
 
 
 }

+ 25 - 1
yami-shop-service/src/main/java/com/yami/shop/dao/ChannelProdMapper.java

@@ -12,7 +12,9 @@ package com.yami.shop.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yami.shop.bean.dto.UpdateShannerProdDTO;
 import com.yami.shop.bean.model.ChannelProd;
+import com.yami.shop.bean.vo.ChannelProdExportVO;
 import com.yami.shop.common.util.PageParam;
 import org.apache.ibatis.annotations.Param;
 
@@ -51,7 +53,7 @@ public interface ChannelProdMapper extends BaseMapper<ChannelProd> {
      * @param channelProd 查询条件
      * @return 分页结果
      */
-    IPage<ChannelProd> getChannelProdPage(PageParam<ChannelProd> page, @Param("channelProd") ChannelProd channelProd);
+    IPage<ChannelProd> getChannelProdPage( @Param("page")PageParam page, @Param("channelProd") ChannelProd channelProd);
 
     /**
      * 根据渠道ID删除渠道商品
@@ -84,4 +86,26 @@ public interface ChannelProdMapper extends BaseMapper<ChannelProd> {
      * @return 渠道数量
      */
     Integer countBySkuId(@Param("skuId") Long skuId);
+
+
+    /**
+     * 根据SKU ID和商家ID查询渠道商品列表
+     * @param skuId SKU ID
+     * @param shopId 商家ID
+     * @return 渠道商品列表
+     */
+    List<ChannelProd> selectListAll(@Param("skuId")Long skuId, @Param("shopId")Long shopId);
+
+    /**
+     * 导出渠道商品列表
+     * @param channelProd 查询条件
+     * @return 渠道商品列表
+     */
+    List<ChannelProdExportVO> exportList(ChannelProd channelProd);
+
+    /**
+     * 根据门店和商品ID删除渠道商品
+     * @param updateShannerProdDTO 渠道商品
+     */
+    void deleteChannelProd(UpdateShannerProdDTO updateShannerProdDTO);
 }

+ 22 - 0
yami-shop-service/src/main/java/com/yami/shop/dao/HBTransport2Mapper.java

@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
+ *
+ * https://www.gz-yami.com/
+ *
+ * 未经允许,不可做商业用途!
+ *
+ * 版权所有,侵权必究!
+ */
+
+package com.yami.shop.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yami.shop.bean.model.Transport2;
+import org.apache.ibatis.annotations.Param;
+
+public interface HBTransport2Mapper extends BaseMapper<Transport2> {
+
+
+
+
+}

+ 1 - 1
yami-shop-service/src/main/java/com/yami/shop/dao/ProductMapper.java

@@ -170,5 +170,5 @@ public interface ProductMapper extends BaseMapper<Product> {
      * @param hbSpuId 海博商品编码
      * @return 商品信息
      */
-    Product selectByHbSpuId(@Param("hbSpuId") Long hbSpuId);
+    Product selectByHbSpuId(@Param("hbSpuId") String hbSpuId);
 }

+ 14 - 7
yami-shop-service/src/main/java/com/yami/shop/service/ChannelProdService.java

@@ -12,6 +12,7 @@ package com.yami.shop.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.yami.shop.bean.dto.UpdateShannerProdDTO;
 import com.yami.shop.bean.model.ChannelProd;
 import com.yami.shop.common.util.PageParam;
 import org.springframework.web.multipart.MultipartFile;
@@ -48,13 +49,13 @@ public interface ChannelProdService extends IService<ChannelProd> {
      */
     ChannelProd getChannelProdBychannelIdAndSkuId(Long channelId, Long skuId);
 
-    /**
-     * 分页查询渠道商品
-     * @param page 分页参数
-     * @param channelProd 查询条件
-     * @return 分页结果
-     */
-    IPage<ChannelProd> getChannelProdPage(PageParam<ChannelProd> page, ChannelProd channelProd);
+//    /**
+//     * 分页查询渠道商品
+//     * @param page 分页参数
+//     * @param channelProd 查询条件
+//     * @return 分页结果
+//     */
+//    IPage<ChannelProd> getChannelProdPage(PageParam page, ChannelProd channelProd);
 
     /**
      * 保存渠道商品
@@ -138,4 +139,10 @@ public interface ChannelProdService extends IService<ChannelProd> {
      * @throws IOException IO异常
      */
     void exportChannelProds(ChannelProd channelProd, HttpServletResponse response);
+
+    /**
+     * 设置销售渠道及价格
+     * @param updateShannerProdDTO 更新渠道商品价格
+     */
+    void setUpChannels(UpdateShannerProdDTO updateShannerProdDTO);
 }

+ 14 - 0
yami-shop-service/src/main/java/com/yami/shop/service/ChannelService.java

@@ -0,0 +1,14 @@
+package com.yami.shop.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yami.shop.bean.model.Channel;
+import com.yami.shop.bean.model.ChannelProd;
+
+/**
+ * 渠道管理服务接口
+ * @author fbj 2024/01/01.
+ */
+public interface ChannelService extends IService<Channel> {
+
+}
+

+ 9 - 0
yami-shop-service/src/main/java/com/yami/shop/service/IShopCategoryService.java

@@ -1,6 +1,8 @@
 package com.yami.shop.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.yami.shop.bean.model.Category;
 import com.yami.shop.bean.model.FrontCategory;
 import com.yami.shop.bean.model.ShopCategory;
 import com.yami.shop.bean.vo.FrontCategoryVO;
@@ -37,4 +39,11 @@ public interface IShopCategoryService extends IService<ShopCategory> {
      * @param file  文件
      */
     void importCategory(MultipartFile file);
+    /**
+     * 根据店铺id和顶级分类id,获取分类
+     * @param parentId
+     * @param shopId
+     * @return
+     */
+    IPage<Category> listByParentIdAndShopId(Long parentId, Long shopId, Integer current, Integer size);
 }

+ 10 - 0
yami-shop-service/src/main/java/com/yami/shop/service/ShopSkuService.java

@@ -1,6 +1,7 @@
 
 package com.yami.shop.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.yami.shop.bean.model.ShopSku;
 
@@ -10,4 +11,13 @@ import com.yami.shop.bean.model.ShopSku;
 public interface ShopSkuService extends IService<ShopSku> {
 
     void insertSku(ShopSku shopSku);
+
+    /**
+     * 分页查询
+     * @param current 当前页
+     * @param size 每页数量
+     * @param shopSku 查询参数
+     * @return 分页数据
+     */
+    IPage<ShopSku> shopSkuPage(Integer current, Integer size, ShopSku shopSku);
 }

+ 0 - 6
yami-shop-service/src/main/java/com/yami/shop/service/hb/IHBGoodsService.java

@@ -57,11 +57,5 @@ public interface IHBGoodsService {
      */
     void deleteGoods(JSONObject hbRequest);
 
-    /**
-     * 商品-门店品售卖状态查询接口
-     * @return 门店品售卖状态信息
-     */
-    String getSelfSkuStatus();
-
 
 }

+ 2 - 0
yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/HBFrontCategoryService.java

@@ -67,6 +67,8 @@ public class HBFrontCategoryService implements IHBFrontCategoryService {
                 frontCategory.setLevel(jsonObjectInfo.getInteger("level"));
                 frontCategory.setOperateUser(jsonObjectInfo.getString("operateUser"));
                 frontCategory.setIsLeaves(jsonObjectInfo.getInteger("isLeaves"));
+                frontCategory.setIcon(jsonObjectInfo.getString("https://zswl-shop.oss-cn-chengdu.aliyuncs.com/2025/09/fe56414a161b498b8f263d3e6afdab92.png"));
+                frontCategory.setPic(jsonObjectInfo.getString("https://zswl-shop.oss-cn-chengdu.aliyuncs.com/2025/09/fe56414a161b498b8f263d3e6afdab92.png"));
                 log.info("添加前台类目信息{}",frontCategory);
                 // 3. 保存门店信息
                 frontCategoryMapper.insert(frontCategory);

+ 48 - 30
yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/HBGoodsService.java

@@ -43,7 +43,7 @@ public class HBGoodsService implements IHBGoodsService {
     private final HBSignUtil hbSignUtil;
     private final ProductMapper productMapper;
     private final SkuMapper skuMapper;
-    private final ShopSkuMapper shopProdMapper;
+    private final ShopSkuMapper shopSkuMapper;
     private final ShopDetailMapper shopDetailMapper;
 
     @Override
@@ -57,13 +57,12 @@ public class HBGoodsService implements IHBGoodsService {
         for (Object product : productList) {
             JSONObject jsonObject = JSON.parseObject(product.toString());
             Long prodId;
+            String hbSpuId;
             //判断海博传过来的是单规格还是多规格
             if (ObjectUtil.isEmpty(jsonObject.getString("multiSpec"))) {
                 log.info("===================进入普通商品操作===================");
                 String goodsInfoStr = selectHBGoodsInfo(jsonObject.getString("outSkuId"));
-
                 JSONObject goodsInfoJson = JSON.parseObject(goodsInfoStr);
-
                 // 2. 逐层解析获取productHostInfoDTOS数组
                 JSONObject result = goodsInfoJson.getJSONObject("result");
                 JSONObject innerResult = result.getJSONObject("result");
@@ -75,11 +74,11 @@ public class HBGoodsService implements IHBGoodsService {
                     JSONObject productInfo = productHostInfoDTOS.getJSONObject(i);
 
                     // 创建并填充Product对象
-                    Product productInfoById = productMapper.selectByHbSpuId(productInfo.getLong("spuId"));
+                    hbSpuId = productInfo.getString("spuId");
+                    Product productInfoById = productMapper.selectByHbSpuId(hbSpuId);
                     if (ObjectUtil.isNotEmpty(productInfoById) && productInfoById.getIsDelete() == 0) {
                         prodId = productInfoById.getProdId();
                         log.info("商品spuID={},spuName={}已经存在无需添加", productInfo.getLong("spuId"), productInfo.getString("spuName"));
-
                     } else {
                         Product productAdd = createProductFromProductInfo(productInfo);
                         setSpuMapper(productInfo, productAdd);
@@ -94,15 +93,18 @@ public class HBGoodsService implements IHBGoodsService {
                         log.info("商品skuId={},skuName={}已经存在无需添加", productInfo.getString("skuId"), productInfo.getString("skuName"));
                     } else {
                         // 创建并填充Sku对象
+
                         Sku sku = createSkuFromProductInfo(productInfo);
                         sku.setProdId(prodId);
+                        sku.setHbSpuId(hbSpuId);
                         skuMapper.insert(sku);
                         log.info("SKU创建成功: skuId={}, skuName={}", sku.getSkuId(), sku.getSkuName());
                     }
                 }
             } else {
                 log.info("===================进入多规格商品操作===================");
-                String selectHBGoodsSpuInfo = selectHBGoodsSpuInfo(jsonObject.getString("spuId"));
+                hbSpuId = jsonObject.getString("spuId");
+                String selectHBGoodsSpuInfo = selectHBGoodsSpuInfo(hbSpuId);
                 JSONObject goodsInfoJson = JSON.parseObject(selectHBGoodsSpuInfo);
                 // 2. 逐层解析获取productHostInfoDTOS数组
                 JSONObject result = goodsInfoJson.getJSONObject("result");
@@ -111,9 +113,8 @@ public class HBGoodsService implements IHBGoodsService {
 
                 for (Object productHostInfoDTO : productHostInfoDTOS) {
                     JSONObject productInfo = JSON.parseObject(productHostInfoDTO.toString());
-
                     // 创建并填充Product对象
-                    Product productInfoById = productMapper.selectByHbSpuId(productInfo.getLong("spuId"));
+                    Product productInfoById = productMapper.selectByHbSpuId(hbSpuId);
                     if (ObjectUtil.isNotEmpty(productInfoById) && productInfoById.getIsDelete() == 0) {
                         log.info("商品spuID={},spuName={}已经存在无需添加", productInfo.getLong("spuId"), productInfo.getString("spuName"));
                         prodId = productInfoById.getProdId();
@@ -137,6 +138,7 @@ public class HBGoodsService implements IHBGoodsService {
                         } else {
                             Sku sku = createSkuFromProductInfo(jsonObjectSku);
                             sku.setProdId(prodId);
+                            sku.setHbSpuId(hbSpuId);
                             skuMapper.insert(sku);
                         }
                     }
@@ -167,7 +169,14 @@ public class HBGoodsService implements IHBGoodsService {
             String bodyStr = hbRequest.getString("body");
             log.info("商品,body:{}", bodyStr);
             JSONObject bodyJson = JSON.parseObject(bodyStr); // 使用Fastjson的解析方法
-            String outStationNo = bodyJson.getString("outStationNo");
+//            String outStationNo = bodyJson.getString("outStationNo");
+            String skuId = bodyJson.getString("skuId");
+            String stationId = bodyJson.getString("stationId");
+
+            String selfSkuStatus = getSelfSkuStatus(skuId, stationId);
+
+
+
         } catch (Exception e) {
             log.error("商品失败:{}", e.getMessage(), e);
             return HBR.error("未知异常");
@@ -202,7 +211,7 @@ public class HBGoodsService implements IHBGoodsService {
                     return HBR.error("更改价格系统找不到对应商品(单品):" + skuId);
                 }
 
-                ShopSku shopSku = shopProdMapper.selectByShopAndProd(sku.getSkuId(), shopDetail.getShopId());
+                ShopSku shopSku = shopSkuMapper.selectByShopAndProd(sku.getSkuId(), shopDetail.getShopId());
                 if (ObjectUtil.isEmpty(shopSku)) {
                     ShopSku shopSkuInfo = new ShopSku();
                     shopSkuInfo.setShopId(shopDetail.getShopId());
@@ -210,12 +219,12 @@ public class HBGoodsService implements IHBGoodsService {
                     shopSkuInfo.setSkuId(sku.getSkuId());
                     shopSkuInfo.setIsDelete(0);
                     shopSkuInfo.setRecTime(new Date());
-                    shopProdMapper.insert(shopSkuInfo);
+                    shopSkuMapper.insert(shopSkuInfo);
                     log.info("门店对应商品系统不存在直接添加");
                 } else {
                     shopSku.setShopSkuPrice(currentPrice == null ? 0.0 : currentPrice);
                     shopSku.setUpdateTime(new Date());
-                    shopProdMapper.updateById(shopSku);
+                    shopSkuMapper.updateById(shopSku);
                     log.info("库存更改成功");
                 }
             }
@@ -253,20 +262,22 @@ public class HBGoodsService implements IHBGoodsService {
                     return HBR.error("系统找不到对应商品(单品):" + skuId);
                 }
 
-                ShopSku shopSku = shopProdMapper.selectByShopAndProd(sku.getSkuId(), shopDetail.getShopId());
+                ShopSku shopSku = shopSkuMapper.selectByShopAndProd(sku.getSkuId(), shopDetail.getShopId());
                 if (ObjectUtil.isEmpty(shopSku)) {
                     ShopSku shopSkuInfo = new ShopSku();
                     shopSkuInfo.setShopId(shopDetail.getShopId());
                     shopSkuInfo.setShopSkuStocks(currentStock);
                     shopSkuInfo.setSkuId(sku.getSkuId());
+                    shopSkuInfo.setSpuId(sku.getProdId());
                     shopSkuInfo.setIsDelete(0);
                     shopSkuInfo.setRecTime(new Date());
-                    shopProdMapper.insert(shopSkuInfo);
+                    shopSkuInfo.setUpdateTime(new Date());
+                    shopSkuMapper.insert(shopSkuInfo);
                     log.info("库存添加成功");
                 } else {
                     shopSku.setShopSkuStocks(currentStock);
                     shopSku.setUpdateTime(new Date());
-                    shopProdMapper.updateById(shopSku);
+                    shopSkuMapper.updateById(shopSku);
                     log.info("库存更改成功");
                 }
             }
@@ -353,14 +364,17 @@ public class HBGoodsService implements IHBGoodsService {
     }
 
 
-    @Override
-    public String getSelfSkuStatus() {
+    /**
+     * 商品-门店品售卖状态查询接口
+     * @return 门店品售卖状态信息
+     */
+    public String getSelfSkuStatus(String skuId, String stationId) {
         HBBaseReq<Object> build = HBBaseReq.create();
         build.setAppId(hbSignUtil.getAppId());
         JSONObject jsonObject = new JSONObject();
         List<JSONObject> onlineProductDTO = new ArrayList();
-        jsonObject.put("skuId", "0");//海博商品编码
-        jsonObject.put("stationId", "0");//海博门店编码
+        jsonObject.put("skuId", skuId);//海博商品编码
+        jsonObject.put("stationId", stationId);//海博门店编码
         onlineProductDTO.add(jsonObject);
         build.setBody(JSON.toJSONString(onlineProductDTO));
         build.setSign(hbSignUtil.signMd5(build));
@@ -377,12 +391,9 @@ public class HBGoodsService implements IHBGoodsService {
     private Product createProductFromProductInfo(JSONObject productInfo) {
         Product product = new Product();
 
-
         // 直接映射字段
-        product.setProdId(productInfo.getLong("spuId"));
+        product.setHbSpuId(productInfo.getLong("spuId"));
         product.setProdName(productInfo.getString("spuName"));
-//        Product.setShopId(productInfo.getString("shopId"));
-
         product.setBrief(productInfo.getString("sellPoint"));//简要描述,卖点等
         product.setVideo(productInfo.getString(""));//商品视频
         product.setStatus(1);
@@ -391,10 +402,16 @@ public class HBGoodsService implements IHBGoodsService {
         product.setCreateTime(new Date());
         product.setUpdateTime(new Date());
         product.setPutawayTime(new Date());
-        product.setBrandId(productInfo.getLong("brandId"));//品牌ID
-        product.setBrandName(productInfo.getString("brandName"));//品牌名称
-        product.setCategoryId(productInfo.getLong("frontCategoryCode")); // 分类转换
-        product.setHbFrontCategoryId(productInfo.getLong("frontCategoryCode"));//后台类目平台对应ID
+        //品牌ID
+        product.setBrandId(productInfo.getLong("brandId"));
+        //品牌名称
+        product.setBrandName(productInfo.getString("brandName"));
+        // 分类转换
+        product.setCategoryId(productInfo.getLong("frontCategoryCode"));
+        //后台类目平台对应ID
+//        product.setHbFrontCategoryId(productInfo.getLong("frontCategoryCode"));
+        product.setPic(productInfo.getString("spuMainImage"));
+        product.setImgs(productInfo.getString("spuImages"));
         // 需要转换或默认值的字段
 //        Product.setTotalStocks(productInfo.getString(""));//总库存
 //        Product.setDeliveryMode(productInfo.getString(""));//配送方式
@@ -431,13 +448,14 @@ public class HBGoodsService implements IHBGoodsService {
         log.info("创建Sku对象数据==========={}===========", productInfo);
         Sku sku = new Sku();
         // 直接映射字段
-        sku.setSkuId(productInfo.getLong("skuId"));//单品id - 关联海博同步
-        sku.setProdId(productInfo.getLong("spuId"));//商品id - 关联海博同步
+        sku.setHbSkuId(productInfo.getString("skuId"));//单品id - 关联海博同步
         sku.setSkuName(productInfo.getString("skuName"));//单品名称
         sku.setProdName(productInfo.getString("spuName"));//商品名称
         sku.setModelId(productInfo.getString("upc")); // 商品条码
         sku.setPartyCode(productInfo.getString("outSkuId"));//商家商品编码
         sku.setSkuCode(productInfo.getString("outSkuId"));//商家商品编码
+        sku.setSpec(productInfo.getString("spec"));//规格
+//        sku.setPic(productInfo.getString("skuImages"));//sku图片
 //        Sku.setVolume(productInfo.getString(""));//体积
         sku.setStatus(1);
         sku.setIsDelete(0);
@@ -447,7 +465,7 @@ public class HBGoodsService implements IHBGoodsService {
         sku.setWeightUnit(productInfo.getString("unit"));//单位
         // 商品原价
         sku.setOriPrice(productInfo.getDouble("basicPrice") != null ?
-                productInfo.getDouble("basicPrice") : null);
+                productInfo.getDouble("basicPrice") : 0);
         //实际库存
         sku.setActualStocks(productInfo.getInteger("initStock") == null ? 0 :
                 productInfo.getInteger("initStock"));

+ 30 - 2
yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/StoreManagementService.java

@@ -1,6 +1,7 @@
 package com.yami.shop.service.hb.impl;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -8,9 +9,11 @@ import com.yami.shop.bean.dto.hb.HBBaseReq;
 import com.yami.shop.bean.dto.hb.HBStoreBaseInfoReq;
 import com.yami.shop.bean.dto.hb.StoreRegister;
 import com.yami.shop.bean.model.ShopDetail;
+import com.yami.shop.bean.model.Transport2;
 import com.yami.shop.common.util.PageParam;
 import com.yami.shop.common.util.R;
 import com.yami.shop.common.util.hb.HBR;
+import com.yami.shop.dao.HBTransport2Mapper;
 import com.yami.shop.dao.ShopDetailMapper;
 import com.yami.shop.service.hb.IStoreManagementService;
 import com.yami.shop.utils.HBSignUtil;
@@ -20,6 +23,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 
+import java.util.Date;
 import java.util.List;
 
 import static com.yami.shop.common.util.HttpUtil.post;
@@ -39,6 +43,7 @@ import static com.yami.shop.common.util.HttpUtil.post;
 public class StoreManagementService implements IStoreManagementService {
     private final ShopDetailMapper shopDetailMapper;
     private final HBSignUtil hbSignUtil;
+    private final HBTransport2Mapper transport2Mapper;
 
 
     /**
@@ -139,9 +144,32 @@ public class StoreManagementService implements IStoreManagementService {
             shopDetailInfo.setShopLat(resultData.getString("longitude"));
             shopDetailInfo.setShopLng(resultData.getString("latitude"));
             shopDetailInfo.setThirdPartyCode(resultData.getString("stationId"));
-            shopDetailInfo.setHbStationId(resultData.getString("stationId"));//海博门店编码
-            shopDetailInfo.setOutStationNo(resultData.getString("outStationNo"));//商家门店编码
+            shopDetailInfo.setNotice(resultData.getString("notice"));
+            //海博门店ID
+            shopDetailInfo.setHbStationId(resultData.getString("stationId"));
+            //商家门店编码
+            shopDetailInfo.setOutStationNo(resultData.getString("outStationNo"));
+            //经营状态
+            shopDetailInfo.setRunStatus(resultData.getInteger("runStatus"));
+            //营业状态
+            shopDetailInfo.setShopStatus(resultData.getInteger("businessStatus"));
+            //营业时间
+            shopDetailInfo.setBusinessTime(resultData.getString("businessTime"));
             shopDetailMapper.insert(shopDetailInfo);
+            //添加默认配送模板
+
+            Transport2 transport2 = new Transport2();
+            //所有数据设置默认值
+            //配送范围经纬度
+            JSONArray coordinates = resultData.getJSONArray("coordinates");
+            transport2.setTransName("默认配送模板");
+            transport2.setDistance(100.0);
+            transport2.setAmount(1.0);
+            transport2.setPiece(5.0);
+            transport2.setCreateTime(new Date());
+            transport2.setShopId(shopDetailInfo.getShopId());
+            transport2Mapper.insert(transport2);
+
             return HBR.success();
         } catch (Exception e) {
             log.error("门店变更失败:{}", e.getMessage(), e);

+ 26 - 4
yami-shop-service/src/main/java/com/yami/shop/service/impl/ChannelProdServiceImpl.java

@@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yami.shop.bean.dto.SetChannelPriceDto;
+import com.yami.shop.bean.dto.UpdateShannerProdDTO;
 import com.yami.shop.bean.model.*;
 import com.yami.shop.bean.vo.ChannelProdExportVO;
 import com.yami.shop.bean.vo.ChannelProdImportVO;
@@ -75,10 +77,10 @@ public class ChannelProdServiceImpl extends ServiceImpl<ChannelProdMapper, Chann
         return channelProdMapper.getChannelProdBychannelIdAndSkuId(channelId, skuId);
     }
 
-    @Override
-    public IPage<ChannelProd> getChannelProdPage(PageParam<ChannelProd> page, ChannelProd channelProd) {
-        return channelProdMapper.getChannelProdPage(page, channelProd);
-    }
+//    @Override
+//    public IPage<ChannelProd> getChannelProdPage(PageParam<ChannelProd> page, ChannelProd channelProd) {
+//        return channelProdMapper.getChannelProdPage(page, channelProd);
+//    }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -340,4 +342,24 @@ public class ChannelProdServiceImpl extends ServiceImpl<ChannelProdMapper, Chann
         }
     }
 
+    @Override
+    public void setUpChannels(UpdateShannerProdDTO updateShannerProdDTO) {
+        //根据门店和商品ID删除
+        channelProdMapper.deleteChannelProd(updateShannerProdDTO);
+        List<SetChannelPriceDto> setChannelPriceDtoList = updateShannerProdDTO.getSetChannelPriceDtoList();
+        if (setChannelPriceDtoList != null){
+            for (SetChannelPriceDto setChannelPriceDto : setChannelPriceDtoList) {
+                ChannelProd channelProd = new ChannelProd();
+                channelProd.setChannelId(setChannelPriceDto.getChannelId());
+                channelProd.setSkuId(updateShannerProdDTO.getSkuId());
+                channelProd.setShopId(updateShannerProdDTO.getShopId());
+                channelProd.setPurchasePrice(updateShannerProdDTO.getPurchasePrice());
+                channelProd.setDeliveryPrice(updateShannerProdDTO.getDeliveryPrice());
+                channelProd.setChannelProdPrice(setChannelPriceDto.getChannelProdPrice());
+                channelProd.setRecTime(new Date());
+                channelProdMapper.insert(channelProd);
+            }
+        }
+    }
+
 }

+ 21 - 0
yami-shop-service/src/main/java/com/yami/shop/service/impl/ChannelServiceImpl.java

@@ -0,0 +1,21 @@
+package com.yami.shop.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yami.shop.bean.model.Channel;
+import com.yami.shop.dao.ChannelMapper;
+import com.yami.shop.service.ChannelService;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+/**
+ * 渠道管理服务实现类
+ *
+ * @author fbj 2024/01/01.
+ */
+@Slf4j
+@Service
+@AllArgsConstructor
+public class ChannelServiceImpl extends ServiceImpl<ChannelMapper, Channel> implements ChannelService {
+
+}

+ 19 - 13
yami-shop-service/src/main/java/com/yami/shop/service/impl/PointsRechargeServiceImpl.java

@@ -73,6 +73,7 @@ public class PointsRechargeServiceImpl extends ServiceImpl<PointsRechargeMapper,
         for (int i = 0; i < importData.size(); i++) {
             com.yami.shop.service.impl.PointsRechargeTemplateDTO templateDTO = importData.get(i);
             try {
+
                 // 数据校验
                 if (templateDTO.getChannelName() == null) {
                     throw new GlobalException("所属企业不能为空");
@@ -87,17 +88,7 @@ public class PointsRechargeServiceImpl extends ServiceImpl<PointsRechargeMapper,
                 if (templateDTO.getUserName() == null) {
                     throw new GlobalException("员工名称不能为空");
                 }
-                if (templateDTO.getUserPhone() == null) {
-                    throw new GlobalException("员工电话号码不能为空");
-                }
-                //通过用户名称和电话号码校验员工是否存在
-                SysUser sysUser = sysUserMapper.selectOne(new LambdaQueryWrapper<SysUser>()
-                        .eq(SysUser::getUsername, templateDTO.getUserName().trim())
-                        .eq(SysUser::getMobile, templateDTO.getUserPhone().trim())
-                        .last("LIMIT 1"));
-                if (sysUser == null) {
-                    throw new GlobalException("员工不存在");
-                }
+
                 if (templateDTO.getPoints() == null) {
                     throw new GlobalException("充值积分不能为空");
                 }
@@ -105,11 +96,26 @@ public class PointsRechargeServiceImpl extends ServiceImpl<PointsRechargeMapper,
                 if (templateDTO.getExpiryDate() == null) {
                     throw new GlobalException("过期时间不能为空");
                 }
-
                 // 构造实体对象
                 PointsRecharge pointsRecharge = new PointsRecharge();
+                String userPhone = templateDTO.getUserPhone();
+                if (userPhone == null) {
+                    throw new GlobalException("员工电话号码不能为空");
+                }
+                userPhone = userPhone.trim();
+                //电话号码格式验证
+                if (!userPhone.matches("^1[3-9]\\d{8}$")) {
+                    throw new GlobalException("手机号码格式错误");
+                }
+                //通过用户名称和电话号码校验员工是否存在(存在用户绑定用户,不存在正常添加数据)
+                SysUser sysUser = sysUserMapper.selectOne(new LambdaQueryWrapper<SysUser>()
+                        .eq(SysUser::getUsername, templateDTO.getUserName().trim())
+                        .eq(SysUser::getMobile, userPhone)
+                        .last("LIMIT 1"));
+                if (sysUser != null) {
+                    pointsRecharge.setUserId(sysUser.getUserId());
+                }
 
-                pointsRecharge.setUserId(sysUser.getUserId());
                 pointsRecharge.setUserName(templateDTO.getUserName());
                 pointsRecharge.setUserPhone(templateDTO.getUserPhone());
                 pointsRecharge.setChannelId(channel.getId());

+ 0 - 1
yami-shop-service/src/main/java/com/yami/shop/service/impl/ProductServiceImpl.java

@@ -219,7 +219,6 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
             }
             IPage<SearchProdDto> searchProdDtoPage = productMapper.getSearchProdDtoPageByProdNameNew(page, searchParam, shopIds);
             for (SearchProdDto searchProdDto : searchProdDtoPage.getRecords()) {
-                //TODO wangjian 查询具体的价格
                 List<SkuDto> skuList = skuMapper.listByProdId(searchProdDto.getProdId()).stream().map((sku) -> SkuDto.builder()
                         .skuName(sku.getSkuName()).pic(sku.getPic()).skuScore(sku.getSkuScore()).price(sku.getPrice())
                         .stocks(sku.getStocks()).properties(sku.getProperties()).skuId(sku.getSkuId())

+ 95 - 56
yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopCategoryServiceImpl.java

@@ -4,17 +4,24 @@ import com.alibaba.excel.EasyExcel;
 import com.alibaba.excel.context.AnalysisContext;
 import com.alibaba.excel.event.AnalysisEventListener;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.yami.shop.bean.dto.ShopCategoryExcelDTO;
+import com.yami.shop.bean.model.Category;
 import com.yami.shop.bean.model.FrontCategory;
 import com.yami.shop.bean.model.ShopCategory;
 import com.yami.shop.bean.model.ShopCategory;
+import com.yami.shop.bean.model.ShopDetail;
 import com.yami.shop.bean.vo.FrontCategoryVO;
 import com.yami.shop.common.exception.GlobalException;
 import com.yami.shop.dao.FrontCategoryMapper;
 import com.yami.shop.dao.ShopCategoryMapper;
+import com.yami.shop.dao.ShopDetailMapper;
 import com.yami.shop.service.IShopCategoryService;
 import lombok.AllArgsConstructor;
+import org.apache.commons.lang3.ObjectUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
@@ -23,6 +30,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 门店前台类目服务实现类
@@ -38,6 +46,7 @@ public class ShopCategoryServiceImpl extends ServiceImpl<ShopCategoryMapper, Sho
 
     private final FrontCategoryMapper frontCategoryMapper;
 
+    private final ShopDetailMapper shopDetailMapper;
 
 
     @Override
@@ -50,6 +59,7 @@ public class ShopCategoryServiceImpl extends ServiceImpl<ShopCategoryMapper, Sho
         // 构建树形结构
         return buildCategoryTree(shopCategories, "0"); // 假设根节点的parentCode为"0"
     }
+
     /**
      * 构建类目树形结构
      *
@@ -107,15 +117,19 @@ public class ShopCategoryServiceImpl extends ServiceImpl<ShopCategoryMapper, Sho
 
             // 批量保存数据
             if (!shopCategories.isEmpty()) {
-                // 检查数据有效性
-                validateShopCategories(shopCategories);
-                for (ShopCategory shopCategory : shopCategories) {
-                    this.save(shopCategory);
+
+                for (int i = 0; i < shopCategories.size(); i++) {
+                    ShopCategory category = shopCategories.get(i);
+                    // 检查数据有效性
+                    Long shopId = validateShopCategories(category, i);
+                    category.setShopId(shopId);
+                    category.setPid(0L);
+                    this.save(category);
                     //添加对应的二级和三级类目
-                    FrontCategory  frontCategoryByName = frontCategoryMapper.selectListName(shopCategory.getSubName());
-                    frontCategoryByName.setParentCode(shopCategory.getCode());
-                    frontCategoryByName.setParentName(shopCategory.getName());
-                    addShopCategory(frontCategoryByName,shopCategory.getShopId());
+                    FrontCategory frontCategoryByName = frontCategoryMapper.selectListName(category.getSubName());
+                    frontCategoryByName.setParentCode(category.getCode());
+                    frontCategoryByName.setParentName(category.getName());
+                    addShopCategory(frontCategoryByName, category.getHbShopId(), shopId, category.getId());
                 }
             }
         } catch (Exception e) {
@@ -124,16 +138,43 @@ public class ShopCategoryServiceImpl extends ServiceImpl<ShopCategoryMapper, Sho
         }
     }
 
+    @Override
+    public IPage<Category> listByParentIdAndShopId(Long parentId, Long shopId, Integer current, Integer size) {
+        IPage<ShopCategory> page = page(new Page<>(current, size), new LambdaQueryWrapper<ShopCategory>()
+                .eq(ShopCategory::getShopId, shopId)
+                .eq(ShopCategory::getPid, parentId)
+                .orderByDesc(ShopCategory::getNum)
+                .orderByDesc(ShopCategory::getId));
+        Page res = new Page();
+        BeanUtils.copyProperties(page, res);
+        List<Category> categories = page.getRecords().stream().map((sc) -> {
+            Category category = new Category();
+            category.setCategoryId(sc.getId());
+            category.setShopId(sc.getShopId());
+            category.setParentId(sc.getPid());
+            category.setCategoryName(sc.getName());
+            category.setIcon(sc.getIcon());
+            category.setPic(sc.getPic());
+            category.setSeq(sc.getNum());
+            category.setGrade(sc.getLevel());
+            return category;
+        }).collect(Collectors.toList());
+        res.setRecords(categories);
+        return res;
+    }
+
     /**
      * 添加对应的二级和三级类目
+     *
      * @param frontCategory 前台类目模板
-     * @param shopId 门店ID
+     * @param hbShopId      海报
+     * @param shopId        门店ID
      */
-    private void addShopCategory(FrontCategory frontCategory, Long shopId) {
+    private void addShopCategory(FrontCategory frontCategory, String hbShopId, Long shopId, Long id) {
         ShopCategory shopCategory = new ShopCategory();
+        shopCategory.setPid(id);
         shopCategory.setName(frontCategory.getName());
         shopCategory.setCode(frontCategory.getCode());
-        shopCategory.setShopId(shopId);
         shopCategory.setParentCode(frontCategory.getParentCode());
         shopCategory.setParentName(frontCategory.getName());
         shopCategory.setLevel(frontCategory.getLevel());
@@ -141,11 +182,15 @@ public class ShopCategoryServiceImpl extends ServiceImpl<ShopCategoryMapper, Sho
         shopCategory.setIsDelete(0);
         shopCategory.setOperateUser("admin");
         shopCategory.setIsLeaves(1);
+
+        shopCategory.setHbShopId(hbShopId);
+        shopCategory.setShopId(shopId);
+
         this.save(shopCategory);
         List<FrontCategory> frontCategoryList = frontCategoryMapper.selectList(new LambdaQueryWrapper<FrontCategory>()
                 .eq(FrontCategory::getParentCode, frontCategory.getCode()));
         for (FrontCategory frontCategory1 : frontCategoryList) {
-            addShopCategory(frontCategory1,shopId);
+            addShopCategory(frontCategory1, hbShopId, shopId, shopCategory.getId());
         }
     }
 
@@ -193,7 +238,7 @@ public class ShopCategoryServiceImpl extends ServiceImpl<ShopCategoryMapper, Sho
         shopCategory.setName(excelDTO.getName());
         shopCategory.setSubName(excelDTO.getSubName());
         shopCategory.setCode(generateUniqueCode());
-        shopCategory.setShopId(excelDTO.getShopId());
+        shopCategory.setHbShopId(excelDTO.getShopId());
         shopCategory.setIsDelete(0); // 默认未删除
         shopCategory.setParentCode("0"); // 默认未删除
 
@@ -209,63 +254,57 @@ public class ShopCategoryServiceImpl extends ServiceImpl<ShopCategoryMapper, Sho
         // 使用时间戳+随机数生成唯一编码
         long timestamp = System.currentTimeMillis();
         int randomNum = (int) (Math.random() * 9999);
-        return "BM"+timestamp + String.format("%04d", randomNum);
+        return "BM" + timestamp + String.format("%04d", randomNum);
     }
+
     /**
      * 验证门店前台类目数据有效性
      *
-     * @param shopCategories 门店前台类目列表
+     * @param category 门店前台类目
      */
-    private void validateShopCategories(List<ShopCategory> shopCategories) {
-        if (shopCategories == null || shopCategories.isEmpty()) {
-            return;
+    private Long validateShopCategories(ShopCategory category, int i) {
+        // 检查必填字段
+        if (ObjectUtils.isEmpty(category.getName())) {
+            throw new GlobalException("第" + (i + 1) + "行:类目名称不能为空");
+        }
+        if (ObjectUtils.isEmpty(category.getHbShopId())) {
+            throw new GlobalException("第" + (i + 1) + "行:门店ID不能为空");
+        }
+        ShopDetail shopDetail = shopDetailMapper.selectByHbStationId(category.getHbShopId());
+        if (ObjectUtils.isEmpty(shopDetail)) {
+            throw new GlobalException("第" + (i + 1) + "行:门店不存在");
         }
 
-        for (int i = 0; i < shopCategories.size(); i++) {
-            ShopCategory category = shopCategories.get(i);
-
-            // 检查必填字段
-            if (category.getName() == null || category.getName().trim().isEmpty()) {
-                throw new GlobalException("第" + (i + 1) + "行:类目名称不能为空");
-            }
-
-            if (category.getShopId() == null) {
-                throw new GlobalException("第" + (i + 1) + "行:门店ID不能为空");
-            }
-
-            // 检查类目名称长度
-            if (category.getName().length() > 255) {
-                throw new GlobalException("第" + (i + 1) + "行:类目名称长度不能超过255个字符");
-            }
+        // 检查类目名称长度
+        if (category.getName().length() > 255) {
+            throw new GlobalException("第" + (i + 1) + "行:类目名称长度不能超过255个字符");
+        }
 
-            // 检查是否已存在相同记录(根据类目名称+门店ID)
-            ShopCategory existingCategory = this.getOne(new LambdaQueryWrapper<ShopCategory>()
-                    .eq(ShopCategory::getName, category.getName())
-                    .eq(ShopCategory::getShopId, category.getShopId())
-                    .last("LIMIT 1"));
+        // 检查是否已存在相同记录(根据类目名称+门店ID)
+        ShopCategory existingCategory = this.getOne(new LambdaQueryWrapper<ShopCategory>()
+                .eq(ShopCategory::getName, category.getName())
+                .eq(ShopCategory::getShopId, category.getShopId())
+                .last("LIMIT 1"));
 
-            if (existingCategory != null) {
-                throw new GlobalException("第" + (i + 1) + "行:门店'" + category.getShopId() +
-                        "'下已存在类目名称为'" + category.getName() + "'的记录");
-            }
-
-            //查看前台类目模板里面是否存在二级类目
-            Integer integer = frontCategoryMapper.selectCount(new LambdaQueryWrapper<FrontCategory>()
-                    .eq(FrontCategory::getName, category.getSubName())
-                    .eq(FrontCategory::getIsDelete, 0));
+        if (existingCategory != null) {
+            throw new GlobalException("第" + (i + 1) + "行:门店'" + category.getShopId() +
+                    "'下已存在类目名称为'" + category.getName() + "'的记录");
+        }
 
-            if (integer < 1) {
-                throw new GlobalException("第" + (i + 1) + "行:二级类目"+category.getSubName()+"不存在");
-            }
+        //查看前台类目模板里面是否存在二级类目
+        Integer integer = frontCategoryMapper.selectCount(new LambdaQueryWrapper<FrontCategory>()
+                .eq(FrontCategory::getName, category.getSubName())
+                .eq(FrontCategory::getIsDelete, 0));
 
-            if (integer > 1) {
-                throw new GlobalException("第" + (i + 1) + "行:二级类目"+category.getSubName()+"存在多个");
-            }
+        if (integer < 1) {
+            throw new GlobalException("第" + (i + 1) + "行:二级类目" + category.getSubName() + "存在");
+        }
 
-//            .eq(FrontCategory::getLevel, 1));
+        if (integer > 1) {
+            throw new GlobalException("第" + (i + 1) + "行:二级类目" + category.getSubName() + "存在多个");
         }
+        return shopDetail.getShopId();
     }
 
 
-
 }

+ 35 - 0
yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopSkuServiceImpl.java

@@ -1,21 +1,56 @@
 package com.yami.shop.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yami.shop.bean.model.ChannelProd;
+import com.yami.shop.bean.model.Label;
 import com.yami.shop.bean.model.ShopSku;
+import com.yami.shop.common.util.PageParam;
+import com.yami.shop.dao.ChannelProdMapper;
+import com.yami.shop.dao.ProductMapper;
 import com.yami.shop.dao.ShopSkuMapper;
+import com.yami.shop.dao.SkuMapper;
 import com.yami.shop.service.ShopSkuService;
 import lombok.AllArgsConstructor;
+import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service
 @AllArgsConstructor
 public class ShopSkuServiceImpl extends ServiceImpl<ShopSkuMapper, ShopSku> implements ShopSkuService {
 
     private final ShopSkuMapper shopProdMapper;
+    private final ChannelProdMapper channelProdMapper;
+    private final SkuMapper skuMapper;
+    private final ProductMapper productMapper;
 
 
     @Override
     public void insertSku(ShopSku shopSku) {
         shopProdMapper.insert(shopSku);
     }
+
+    @Override
+    public IPage<ShopSku> shopSkuPage(Integer current, Integer size, ShopSku shopSku) {
+        PageParam<ShopSku> pageParam = new PageParam<>();
+        pageParam.setCurrent(current);
+        pageParam.setSize(size);
+
+        LambdaQueryWrapper<ShopSku> queryWrapper = new LambdaQueryWrapper<>();
+                queryWrapper.eq(ObjectUtils.isNotEmpty(shopSku.getShopId()),ShopSku::getShopId, shopSku.getShopId());
+                queryWrapper.eq(ObjectUtils.isNotEmpty(shopSku.getSkuId()),ShopSku::getSkuId, shopSku.getSkuId());
+                queryWrapper.eq(ShopSku::getIsDelete, 0);
+        IPage<ShopSku> page = shopProdMapper.selectPage(pageParam, queryWrapper);
+        //循环获取sku和渠道价格设置信息
+        for (ShopSku record : page.getRecords()) {
+            record.setSku(skuMapper.selectById(record.getSkuId()));
+            List<ChannelProd> channelProds = channelProdMapper.selectListAll(record.getSkuId(), record.getShopId());
+            record.setChannelProdList(channelProds);
+        }
+        return page;
+    }
 }

+ 76 - 13
yami-shop-service/src/main/resources/mapper/ChannelProdMapper.xml

@@ -14,23 +14,31 @@
     </resultMap>
 
     <select id="getChannelProdsBychannelId" resultMap="BaseResultMap">
-        SELECT * FROM tz_channel_prod
-        WHERE channel_id = #{channelId} AND is_delete = 0
+        SELECT *
+        FROM tz_channel_prod
+        WHERE channel_id = #{channelId}
+          AND is_delete = 0
         ORDER BY rec_time DESC
     </select>
 
     <select id="getChannelProdsBySkuId" resultMap="BaseResultMap">
-        SELECT * FROM tz_channel_prod
-        WHERE sku_id = #{skuId} AND is_delete = 0
+        SELECT *
+        FROM tz_channel_prod
+        WHERE sku_id = #{skuId}
+          AND is_delete = 0
         ORDER BY rec_time DESC
     </select>
 
     <select id="getChannelProdBychannelIdAndSkuId" resultMap="BaseResultMap">
-        SELECT * FROM tz_channel_prod
-        WHERE channel_id = #{channelId} AND sku_id = #{skuId} AND is_delete = 0
+        SELECT *
+        FROM tz_channel_prod
+        WHERE channel_id = #{channelId}
+          AND sku_id = #{skuId}
+          AND is_delete = 0
     </select>
 
     <select id="getChannelProdPage" resultMap="BaseResultMap">
+        # 关联查询查询条件
         SELECT * FROM tz_channel_prod
         <where>
             is_delete = 0
@@ -54,29 +62,84 @@
     </select>
 
     <update id="deleteBychannelId">
-        UPDATE tz_channel_prod SET is_delete = 1, update_time = NOW() WHERE channel_id = #{channelId}
+        UPDATE tz_channel_prod
+        SET is_delete   = 1,
+            update_time = NOW()
+        WHERE channel_id = #{channelId}
     </update>
 
     <update id="deleteBySkuId">
-        UPDATE tz_channel_prod SET is_delete = 1, update_time = NOW() WHERE sku_id = #{skuId}
+        UPDATE tz_channel_prod
+        SET is_delete   = 1,
+            update_time = NOW()
+        WHERE sku_id = #{skuId}
+    </update>
+
+    <update id="deleteChannelProd">
+        UPDATE tz_channel_prod
+        SET is_delete = 1,
+            update_time = NOW()
+        WHERE sku_id = #{skuId} AND shop_id = #{shopId}
     </update>
 
+
     <update id="updateBatchPrices">
         <foreach collection="channelProds" item="channelProd" separator=";">
             UPDATE tz_channel_prod
             SET purchase_price = #{channelProd.purchasePrice},
-                delivery_price = #{channelProd.deliveryPrice},
-                channel_prod_price = #{channelProd.channelProdPrice},
-                update_time = NOW()
+            delivery_price = #{channelProd.deliveryPrice},
+            channel_prod_price = #{channelProd.channelProdPrice},
+            update_time = NOW()
             WHERE id = #{channelProd.id}
         </foreach>
     </update>
 
     <select id="countBychannelId" resultType="java.lang.Integer">
-        SELECT COUNT(*) FROM tz_channel_prod WHERE channel_id = #{channelId} AND is_delete = 0
+        SELECT COUNT(*)
+        FROM tz_channel_prod
+        WHERE channel_id = #{channelId}
+          AND is_delete = 0
     </select>
 
     <select id="countBySkuId" resultType="java.lang.Integer">
-        SELECT COUNT(*) FROM tz_channel_prod WHERE sku_id = #{skuId} AND is_delete = 0
+        SELECT COUNT(*)
+        FROM tz_channel_prod
+        WHERE sku_id = #{skuId}
+          AND is_delete = 0
+    </select>
+
+    <select id="selectListAll" resultType="com.yami.shop.bean.model.ChannelProd">
+        SELECT c.*, s.shop_name shopName,channel.channel_name channelName,channel.type channelType
+        FROM tz_channel_prod c
+                 left join tz_shop_detail s on c.shop_id = s.shop_id
+                 left join tz_channel channel on c.channel_id = channel.id
+        WHERE c.sku_id = #{skuId}
+          AND c.shop_id = #{shopId}
+          AND c.is_delete = 0
     </select>
+    <select id="exportList" resultType="com.yami.shop.bean.vo.ChannelProdExportVO">
+        SELECT
+        p.hb_sku_id AS skuId,
+        sha.sku_name AS skuName,
+        p.channel_id AS channelId,
+        c.channel_name AS channelName,
+        d.shop_name AS shopName,
+        p.purchase_price AS purchasePrice,
+        p.delivery_price AS deliveryPrice,
+        p.channel_prod_price AS channelProdPrice
+        FROM
+        tz_channel_prod p
+        LEFT JOIN tz_sku sha ON p.sku_id = sha.sku_id
+        LEFT JOIN tz_channel c ON p.channel_id = c.id
+        LEFT JOIN tz_shop_detail d ON p.shop_id = d.shop_id
+        WHERE
+        p.is_delete = 0
+        <if test="channelId != null">
+            AND p.channel_id = #{channelId}
+        </if>
+        <if test="skuId != null">
+            AND p.sku_id = #{skuId}
+        </if>
+    </select>
+
 </mapper>

+ 1 - 1
yami-shop-service/src/main/resources/mapper/ShopSkuMapper.xml

@@ -16,7 +16,7 @@
   </resultMap>
 
   <select id="selectByShopAndProd" resultMap="shopProdMap">
-    SELECT * FROM tz_shop_prod
+    SELECT * FROM tz_shop_sku
     WHERE shop_id = #{shopId} AND sku_id = #{skuId} AND is_delete = 0
   </select>
 

+ 5 - 5
yami-shop-user/yami-shop-user-api/src/main/java/com/yami/shop/user/api/controller/UserScoreController.java

@@ -134,11 +134,11 @@ public class UserScoreController {
         scoreDataDto.setShopScore(scoreParam.getShopGetScore());
         scoreDataDto.setIsSignIn(isSignIn(userId)? 1:0);
         scoreDataDto.setLevelType(userExtension.getLevelType());
-        UserLevel userLevel = userLevelService.getOne(new LambdaQueryWrapper<UserLevel>()
-                .eq(UserLevel::getLevel, userExtension.getLevel())
-                .eq(UserLevel::getLevelType, userExtension.getLevelType())
-        );
-        scoreDataDto.setLevelName(userLevel.getLevelName());
+//        UserLevel userLevel = userLevelService.getOne(new LambdaQueryWrapper<UserLevel>()
+//                .eq(UserLevel::getLevel, userExtension.getLevel())
+//                .eq(UserLevel::getLevelType, userExtension.getLevelType())
+//        );
+        //scoreDataDto.setLevelName(userLevel.getLevelName());
         //计算签到天数
         Integer count = scoreLogService.getConsecutiveDays(userId);
         //如果没有记录就是第一天签到

+ 112 - 119
yami-shop-user/yami-shop-user-comment/src/main/java/com/yami/shop/user/comment/service/impl/UserLevelServiceImpl.java

@@ -31,6 +31,7 @@ import com.yami.shop.user.comment.service.*;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.cache.annotation.CacheEvict;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.context.ApplicationContext;
@@ -63,7 +64,7 @@ public class UserLevelServiceImpl extends ServiceImpl<UserLevelMapper, UserLevel
     private final UserRightsService userRightsService;
     private final UserLevelRightsService userLevelRightsService;
 
-//    @Override
+    //    @Override
 //    @Cacheable(cacheNames = "UserLevelsByLevelType", key = "#userLevelType")
 //    public List<UserLevel> listUserLevelsByUserLevelType(Integer userLevelType) {
 //        return userLevelMapper.selectList(new LambdaQueryWrapper<UserLevel>().eq(UserLevel::getLevelType, userLevelType));
@@ -84,17 +85,19 @@ public class UserLevelServiceImpl extends ServiceImpl<UserLevelMapper, UserLevel
 //        }
         return userLevelList;
     }
+
     @Override
     @CacheEvict(cacheNames = "UserLevelsByLevelType", key = "#userLevelType")
     public void removeUserLevelsByUserLevelTypeCache(Integer userLevelType) {
 
     }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void paySuccess(String payNo) {
         //根据内部订单号更新用户会员信息
-        UserLevelLog userLevelLog = userLevelLogService.getOne(new LambdaQueryWrapper<UserLevelLog>().eq(UserLevelLog::getPayNo,payNo));
-        if(userLevelLog == null){
+        UserLevelLog userLevelLog = userLevelLogService.getOne(new LambdaQueryWrapper<UserLevelLog>().eq(UserLevelLog::getPayNo, payNo));
+        if (userLevelLog == null) {
             log.info("订单异常,");
             return;
         }
@@ -104,61 +107,62 @@ public class UserLevelServiceImpl extends ServiceImpl<UserLevelMapper, UserLevel
             return;
         }
         UserLevel userLevel = userLevelMapper.selectLevelAndCoupons(userLevelLog.getLevel());
-        if(userLevel == null){
-            log.info("订单异常,会员等级找不到!",userLevelLog.getPayNo());
+        if (userLevel == null) {
+            log.info("订单异常,会员等级找不到!", userLevelLog.getPayNo());
             return;
         }
         //修改用户会员信息
         User user = userService.getById(userLevelLog.getUserId());
-        UserExtension userExtension = userExtensionMapper.selectOne(new LambdaQueryWrapper<UserExtension>().eq(UserExtension::getUserId,userLevelLog.getUserId()));
+        UserExtension userExtension = userExtensionMapper.selectOne(new LambdaQueryWrapper<UserExtension>().eq(UserExtension::getUserId, userLevelLog.getUserId()));
         //修改用户等级
-        updateUserLevel(user,userLevel,userExtension);
+        updateUserLevel(user, userLevel, userExtension);
         //发放奖励
         ArrayList<UserLevel> userLevels = new ArrayList<>();
         userLevels.add(userLevel);
-        levelUp(userLevels,userLevelLog,userExtension,null);
+        levelUp(userLevels, userLevelLog, userExtension, null);
 
     }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     @CacheEvict(cacheNames = "UserLevelsByLevelType", key = "#userLevel.levelType")
     public void updateUserLevelList(UserLevel userLevel) {
         UserLevel dbUserLevel = new UserLevel();
         //根据成长值,更新已有用户的等级
-        if (!Objects.isNull(userLevel.getId())){
+        if (!Objects.isNull(userLevel.getId())) {
             dbUserLevel = userLevelMapper.selectOne(new LambdaQueryWrapper<UserLevel>()
-                    .eq(UserLevel::getId,userLevel.getId())
-                    .eq(UserLevel::getLevelType,userLevel.getLevelType()));
+                    .eq(UserLevel::getId, userLevel.getId())
+                    .eq(UserLevel::getLevelType, userLevel.getLevelType()));
         }
         // 若是普通会员,新增或修改时成长值有变化,状态设置为未更新用户等级'
-        if (Objects.equals(userLevel.getLevelType(),0) && !Objects.equals(dbUserLevel.getNeedGrowth(),userLevel.getNeedGrowth())){
+        if (Objects.equals(userLevel.getLevelType(), 0) && !Objects.equals(dbUserLevel.getNeedGrowth(), userLevel.getNeedGrowth())) {
             userLevel.setStatus(-1);
-        }else {
+        } else {
             userLevel.setStatus(1);
         }
         this.saveOrUpdate(userLevel);
         // 插入/更新等级分类数据
-        this.delOrAddCategory(userLevel,dbUserLevel);
+        this.delOrAddCategory(userLevel, dbUserLevel);
         //插入/更新等级优惠券数据
         this.delOrAddCoupon(userLevel);
         //插入/更新等级用户权益数据
         this.delOrAddRights(userLevel);
-        }
+    }
 
     @Override
     @CacheEvict(cacheNames = "UserLevelsByLevelType", key = "#userLevel.levelType")
     @Transactional(rollbackFor = Exception.class)
     public Boolean deleteUserLevel(UserLevel userLevel) {
-        if (Objects.equals(userLevel.getLevel(),1)){
+        if (Objects.equals(userLevel.getLevel(), 1)) {
             throw new GlobalException("此等级不能删除,必须要保留最少一个等级");
         }
         UserLevel dbUserLevel = userLevelMapper.selectById(userLevel.getId());
         //删除等级关联权益
-        userLevelRightsService.remove(new LambdaQueryWrapper<UserLevelRights>().eq(UserLevelRights::getLevelId,userLevel.getId()));
+        userLevelRightsService.remove(new LambdaQueryWrapper<UserLevelRights>().eq(UserLevelRights::getLevelId, userLevel.getId()));
         //删除等级关联的优惠券
-        userLevelCouponService.remove(new LambdaQueryWrapper<UserLevelCoupon>().eq(UserLevelCoupon::getLevelId,userLevel.getId()));
+        userLevelCouponService.remove(new LambdaQueryWrapper<UserLevelCoupon>().eq(UserLevelCoupon::getLevelId, userLevel.getId()));
         //删除等级关联的分类
-        userLevelCategoryService.remove(new LambdaQueryWrapper<UserLevelCategory>().eq(UserLevelCategory::getLevelId,userLevel.getId()));
+        userLevelCategoryService.remove(new LambdaQueryWrapper<UserLevelCategory>().eq(UserLevelCategory::getLevelId, userLevel.getId()));
         userService.setUserLevelBylevelId(dbUserLevel.getLevel());
         this.removeById(userLevel.getId());
         return true;
@@ -167,11 +171,11 @@ public class UserLevelServiceImpl extends ServiceImpl<UserLevelMapper, UserLevel
     @Override
     public UserLevel getUserLevelById(Long id) {
         UserLevel userLevel = userLevelMapper.selectById(id);
-        if (Objects.equals(userLevel.getDiscountType(),1)){
-            List<Long> categoryIds =  userLevelCategoryService.getCategoryIdByLevelId(userLevel.getId());
+        if (Objects.equals(userLevel.getDiscountType(), 1)) {
+            List<Long> categoryIds = userLevelCategoryService.getCategoryIdByLevelId(userLevel.getId());
             userLevel.setCategorys(categoryIds);
         }
-        userLevel.setUserRightsIds(userRightsService.getUserRightsIdListByLevelId(userLevel.getId(),1));
+        userLevel.setUserRightsIds(userRightsService.getUserRightsIdListByLevelId(userLevel.getId(), 1));
         userLevel.setCouponList(userLevelCouponService.getCouponListByLevelId(userLevel.getId()));
         return userLevel;
     }
@@ -185,11 +189,11 @@ public class UserLevelServiceImpl extends ServiceImpl<UserLevelMapper, UserLevel
     @Cacheable(cacheNames = "getUserLevelName", key = "#userExtension.userId")
     public String getUserLevelName(UserExtension userExtension) {
         List<UserLevel> userLevels = list(new LambdaQueryWrapper<UserLevel>()
-                .le(UserLevel::getNeedGrowth,userExtension.getGrowth()).orderByDesc(UserLevel::getNeedGrowth));
+                .le(UserLevel::getNeedGrowth, userExtension.getGrowth()).orderByDesc(UserLevel::getNeedGrowth));
         String levelName;
-        if(userExtension.getLevel() == null){
+        if (userExtension.getLevel() == null) {
             levelName = userLevels.get(0).getLevelName();
-        }else{
+        } else {
             levelName = String.valueOf(userExtension.getLevel());
         }
         return levelName;
@@ -203,14 +207,14 @@ public class UserLevelServiceImpl extends ServiceImpl<UserLevelMapper, UserLevel
         Boolean isUpdate = false;
         Integer level = 0;
         Integer minNeedGrowth = 0;
-        for (UserLevelDto userLevelDto:userLevelDtoList){
-            if (isUpdate){
-                userService.setUserLevelByGrowth(level,minNeedGrowth-1,userLevelDto.getNeedGrowth());
+        for (UserLevelDto userLevelDto : userLevelDtoList) {
+            if (isUpdate) {
+                userService.setUserLevelByGrowth(level, minNeedGrowth - 1, userLevelDto.getNeedGrowth());
                 isUpdate = false;
             }
-            if (Objects.equals(userLevelDto.getStatus(),-1) && Objects.equals(userLevelDto.getLevel(),userLevelDtoList.size())){
-                userService.setUserLevelByGrowth(userLevelDto.getLevel(),userLevelDto.getNeedGrowth()-1,null);
-            }else if(Objects.equals(userLevelDto.getStatus(),-1)){
+            if (Objects.equals(userLevelDto.getStatus(), -1) && Objects.equals(userLevelDto.getLevel(), userLevelDtoList.size())) {
+                userService.setUserLevelByGrowth(userLevelDto.getLevel(), userLevelDto.getNeedGrowth() - 1, null);
+            } else if (Objects.equals(userLevelDto.getStatus(), -1)) {
                 isUpdate = true;
             }
             level = userLevelDto.getLevel();
@@ -222,66 +226,69 @@ public class UserLevelServiceImpl extends ServiceImpl<UserLevelMapper, UserLevel
 
     /**
      * 修改用户等级中的商品分类
+     *
      * @param userLevel
      * @param dbUserLevel
      */
     private void delOrAddCategory(UserLevel userLevel, UserLevel dbUserLevel) {
-        List<Long> dbCategoryIds =  userLevelCategoryService.getCategoryIdByLevelId(userLevel.getId());
+        List<Long> dbCategoryIds = userLevelCategoryService.getCategoryIdByLevelId(userLevel.getId());
         List<Long> categoryList = userLevel.getCategorys();
         //如果分类数据发生改变,执行方法进行增删操作
-        Map<String,List<Long>> map = this.compare(categoryList,dbCategoryIds);
+        Map<String, List<Long>> map = this.compare(categoryList, dbCategoryIds);
         List<Long> delCategory = map.get("del");
-        if (delCategory.size()>0){
-            userLevelCategoryService.delBatch(delCategory.toArray(new Long[delCategory.size()]),userLevel.getId());
+        if (delCategory.size() > 0) {
+            userLevelCategoryService.delBatch(delCategory.toArray(new Long[delCategory.size()]), userLevel.getId());
         }
         List<Long> addCategory = map.get("add");
-        if (addCategory.size()>0){
-            userLevelCategoryService.insertBatch(addCategory.toArray(new Long[addCategory.size()]),userLevel.getId());
+        if (addCategory.size() > 0) {
+            userLevelCategoryService.insertBatch(addCategory.toArray(new Long[addCategory.size()]), userLevel.getId());
         }
     }
 
     /**
      * 修改用户等级中的赠送优惠券
+     *
      * @param userLevel
      */
     private void delOrAddCoupon(UserLevel userLevel) {
         List<UserLevelCoupon> userLevelCouponList = userLevelCouponService.list(new LambdaQueryWrapper<UserLevelCoupon>().eq(UserLevelCoupon::getLevelId, userLevel.getId()));
         List<Long> dbCouponIds = new ArrayList<>();
         List<Long> couponIds = new ArrayList<>();
-        if (!Objects.isNull(userLevelCouponList)){
-            for (UserLevelCoupon userLevelCoupon:userLevelCouponList){
+        if (!Objects.isNull(userLevelCouponList)) {
+            for (UserLevelCoupon userLevelCoupon : userLevelCouponList) {
                 dbCouponIds.add(userLevelCoupon.getCouponId());
             }
         }
-        if (!Objects.isNull(userLevel.getCouponList())){
-            for (Coupon coupon:userLevel.getCouponList()){
+        if (!Objects.isNull(userLevel.getCouponList())) {
+            for (Coupon coupon : userLevel.getCouponList()) {
                 couponIds.add(coupon.getCouponId());
             }
         }
-        Map<String,List<Long>> map = this.compare(couponIds,dbCouponIds);
+        Map<String, List<Long>> map = this.compare(couponIds, dbCouponIds);
         List<Long> delCoupon = map.get("del");
-        if (delCoupon.size()>0){
-            userLevelCouponService.delBatchCoupon(delCoupon.toArray(new Long[delCoupon.size()]),userLevel.getId());
+        if (delCoupon.size() > 0) {
+            userLevelCouponService.delBatchCoupon(delCoupon.toArray(new Long[delCoupon.size()]), userLevel.getId());
         }
         List<Long> addCoupon = map.get("add");
-        if (addCoupon.size()>0){
-            userLevelCouponService.insertBatchCoupon(addCoupon.toArray(new Long[addCoupon.size()]),userLevel.getId());
+        if (addCoupon.size() > 0) {
+            userLevelCouponService.insertBatchCoupon(addCoupon.toArray(new Long[addCoupon.size()]), userLevel.getId());
         }
 
     }
 
     /**
      * 修改用户等级中的权益
+     *
      * @param userLevel
      */
     private void delOrAddRights(UserLevel userLevel) {
-        List<Long> userRightsList = userRightsService.getUserRightsIdListByLevelId(userLevel.getId(),null);
+        List<Long> userRightsList = userRightsService.getUserRightsIdListByLevelId(userLevel.getId(), null);
         List<Long> dbRightsIds = new ArrayList<>();
         List<Long> rightsIds = new ArrayList<>();
-        if (!Objects.isNull(userRightsList)){
-           dbRightsIds.addAll(userRightsList);
+        if (!Objects.isNull(userRightsList)) {
+            dbRightsIds.addAll(userRightsList);
         }
-        if (!Objects.isNull(userLevel.getUserRightsIds())){
+        if (!Objects.isNull(userLevel.getUserRightsIds())) {
             rightsIds.addAll(userLevel.getUserRightsIds());
             //折扣
             if (!Objects.equals(userLevel.getDiscount(), 10D)) {
@@ -296,7 +303,7 @@ public class UserLevelServiceImpl extends ServiceImpl<UserLevelMapper, UserLevel
                 rightsIds.add(UserRightsInfo.SCORE.value());
             }
             //优惠券
-            if (userLevel.getCouponList().size()>0) {
+            if (userLevel.getCouponList().size() > 0) {
                 rightsIds.add(UserRightsInfo.COUPON.value());
             }
             //积分倍率
@@ -304,25 +311,26 @@ public class UserLevelServiceImpl extends ServiceImpl<UserLevelMapper, UserLevel
                 rightsIds.add(UserRightsInfo.RATE_SCORE.value());
             }
         }
-        Map<String,List<Long>> map = this.compare(rightsIds,dbRightsIds);
+        Map<String, List<Long>> map = this.compare(rightsIds, dbRightsIds);
         List<Long> delCoupon = map.get("del");
-        if (delCoupon.size()>0){
-            userLevelRightsService.delBatchRights(delCoupon.toArray(new Long[delCoupon.size()]),userLevel.getId());
+        if (delCoupon.size() > 0) {
+            userLevelRightsService.delBatchRights(delCoupon.toArray(new Long[delCoupon.size()]), userLevel.getId());
         }
         List<Long> addCoupon = map.get("add");
-        if (addCoupon.size()>0){
-            userLevelRightsService.insertBatchRights(addCoupon.toArray(new Long[addCoupon.size()]),userLevel.getId());
+        if (addCoupon.size() > 0) {
+            userLevelRightsService.insertBatchRights(addCoupon.toArray(new Long[addCoupon.size()]), userLevel.getId());
         }
     }
 
 
     /**
      * 得到需要新增或删除的数据
+     *
      * @param ids
      * @param dbIds
      */
-    private Map<String,List<Long>> compare(List<Long> ids, List<Long> dbIds) {
-        if (Objects.isNull(ids)){
+    private Map<String, List<Long>> compare(List<Long> ids, List<Long> dbIds) {
+        if (Objects.isNull(ids)) {
             ids = new ArrayList<>();
         }
         List<Long> del = new ArrayList<>();
@@ -331,44 +339,45 @@ public class UserLevelServiceImpl extends ServiceImpl<UserLevelMapper, UserLevel
         add.addAll(ids);
         add.removeAll(dbIds);
         del.removeAll(ids);
-        Map<String,List<Long>> map = new HashMap<>();
+        Map<String, List<Long>> map = new HashMap<>();
         //需要新增的数据
-        map.put("add",add);
+        map.put("add", add);
         //需要删除的数据
-        map.put("del",del);
+        map.put("del", del);
         return map;
     }
 
     /**
      * 增加用户成长值和积分
+     *
      * @param growthPrice 增加的成长值
-     * @param score    增加的积分
-     * @param order    确认收货的订单信息
+     * @param score       增加的积分
+     * @param order       确认收货的订单信息
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void addGrowthAndScore(double growthPrice, Integer score, Order order,UserExtension userExtension) {
+    public void addGrowthAndScore(double growthPrice, Integer score, Order order, UserExtension userExtension) {
         String userId = order.getUserId();
         User user = userService.getById(userId);
-        if(user.getLevel() == null){
+        if (user.getLevel() == null) {
             user.setLevel(Constant.USER_LEVEL_INIT);
         }
         Integer growth = (int) growthPrice;
 
-        addScoreAndGrowth(order.getOrderId(),user.getUserId(),growth,score);
+        addScoreAndGrowth(order.getOrderId(), user.getUserId(), growth, score);
         //判断是否升级
         //修改用户信息
         //用户+增加成长值
-        Integer nowGrowth = userExtension.getGrowth() == null ?growth:userExtension.getGrowth() + growth;
+        Integer nowGrowth = userExtension.getGrowth() == null ? growth : userExtension.getGrowth() + growth;
         userExtension.setScore(userExtension.getScore() == null ? score : userExtension.getScore() + score);
         userExtension.setGrowth(nowGrowth);
         userExtension.setUpdateTime(new Date());
         //如果用户是付费会员则不提升等级,只修改成长值
         //判断用户是否提升过等级,如果是修改用户等级并添加用户等级提升日志
-        List<UserLevel> userLevels = userLevelMapper.selectListAndCoupons(nowGrowth,userExtension.getLevel());
-        if(user.getLevelType() == 1 || CollectionUtils.isEmpty(userLevels)){
+        List<UserLevel> userLevels = userLevelMapper.selectListAndCoupons(nowGrowth, userExtension.getLevel());
+        if (user.getLevelType() == 1 || CollectionUtils.isEmpty(userLevels)) {
             userExtensionMapper.updateById(userExtension);
-        }else{
+        } else {
             Integer level = userLevels.get(0).getLevel();
             //修改用户等级
             user.setLevel(level);
@@ -376,19 +385,20 @@ public class UserLevelServiceImpl extends ServiceImpl<UserLevelMapper, UserLevel
             //判断用户是否提升过等级
             Integer historyLevel = userLevelLogService.getMaxLevelByUserId(user.getUserId());
             //等级提升发放奖品及添加等级提升日志
-            levelUp(userLevels,null,userExtension,historyLevel);
+            levelUp(userLevels, null, userExtension, historyLevel);
         }
     }
 
     /**
      * 添加积分明细、积分日志、成长值日志
+     *
      * @param orderId 订单号
-     * @param userId 用户id
-     * @param growth 成长值
-     * @param score 积分
+     * @param userId  用户id
+     * @param growth  成长值
+     * @param score   积分
      */
     private void addScoreAndGrowth(Long orderId, String userId, Integer growth, Integer score) {
-        if(score > 0) {
+        if (score > 0) {
             //添加积分明细
             UserScoreDetail addDetail = new UserScoreDetail();
             addDetail.setCreateTime(new Date());
@@ -408,7 +418,7 @@ public class UserLevelServiceImpl extends ServiceImpl<UserLevelMapper, UserLevel
             userScoreLog.setIoType(1);
             userScoreLogService.save(userScoreLog);
         }
-        if(growth > 0) {
+        if (growth > 0) {
             //添加成长值日志
             UserGrowthLog userGrowthLog = new UserGrowthLog();
             userGrowthLog.setChangeGrowth(growth);
@@ -462,24 +472,25 @@ public class UserLevelServiceImpl extends ServiceImpl<UserLevelMapper, UserLevel
 
     /**
      * 用户购买会员后提升会员等级
-     * @param user 用户信息
-     * @param userLevel 用户等级
+     *
+     * @param user          用户信息
+     * @param userLevel     用户等级
      * @param userExtension 用户扩展信息
      */
     private void updateUserLevel(User user, UserLevel userLevel, UserExtension userExtension) {
         Integer level = userLevel.getLevel();
         DateTime endTime;
-        Map<Integer,Integer> dateMap = new HashMap<>(12);
-        dateMap.put(1,1);
-        dateMap.put(2,7);
-        dateMap.put(3,31);
-        dateMap.put(4,93);
-        dateMap.put(5,366);
+        Map<Integer, Integer> dateMap = new HashMap<>(12);
+        dateMap.put(1, 1);
+        dateMap.put(2, 7);
+        dateMap.put(3, 31);
+        dateMap.put(4, 93);
+        dateMap.put(5, 366);
         //修改用户等级
-        if (user.getVipEndTime() == null || user.getLevel() < level || user.getLevel() >level) {
+        if (user.getVipEndTime() == null || user.getLevel() < level || user.getLevel() > level) {
             endTime = DateUtil.offset(new Date(), DateField.HOUR_OF_DAY, 24 * userLevel.getTerm() * dateMap.get(userLevel.getTermType()));
-        } else{
-            endTime = DateUtil.offset(user.getVipEndTime(), DateField.HOUR_OF_DAY, 24 * userLevel.getTerm()* dateMap.get(userLevel.getTermType()));
+        } else {
+            endTime = DateUtil.offset(user.getVipEndTime(), DateField.HOUR_OF_DAY, 24 * userLevel.getTerm() * dateMap.get(userLevel.getTermType()));
         }
         user.setVipEndTime(endTime);
         user.setLevel(level);
@@ -498,56 +509,38 @@ public class UserLevelServiceImpl extends ServiceImpl<UserLevelMapper, UserLevel
 
     /**
      * 等级提升
-     * @param userLevels 多个等级,奖励发放时
+     *
+     * @param userLevels   多个等级,奖励发放时
      * @param userLevelLog 等级日志,在购买付费会员时存在
-     * @param user 用户详细信息
+     * @param user         用户详细信息
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void levelUp(List<UserLevel> userLevels, UserLevelLog userLevelLog, UserExtension user,Integer historyLevel) {
+    public void levelUp(List<UserLevel> userLevels, UserLevelLog userLevelLog, UserExtension user, Integer historyLevel) {
         List<UserScoreLog> userScoreLogs = new ArrayList<>();
         List<UserScoreDetail> userScoreDetails = new ArrayList<>();
         //用户可能升多级,批量插入升级日志
         List<UserLevelLog> levelLogs = new ArrayList<>();
         List<Long> couponIds = new ArrayList<>();
         for (UserLevel level : userLevels) {
+            if (ObjectUtils.isEmpty(level)) break;
             //修改用户扩展表等级
             user.setLevel(level.getLevel());
             user.setLevelType(level.getLevelType());
-            boolean isLevelUp = historyLevel != null &&(level.getLevel() <= historyLevel || level.getLevel().equals(user.getLevel()));
+            boolean isLevelUp = historyLevel != null && (level.getLevel() <= historyLevel || level.getLevel().equals(user.getLevel()));
             //如果历史提升过此等级并且为普通会员就退出循环
-            if(level.getLevelType() == 0 && isLevelUp){
+            if (level.getLevelType() == 0 && isLevelUp) {
                 break;
             }
             //升级奖励计算(积分,优惠券,商品)
-            //1.积分
-            if(level.getPresScore() != null && level.getPresScore()  > 0) {
-                UserScoreLog userScoreLog = new UserScoreLog();
-                Integer score = level.getPresScore();
-                userScoreLog.setUserId(user.getUserId());
-                userScoreLog.setScore(score);
-                userScoreLog.setSource(ScoreLogType.LEVEL_UP.value());
-                userScoreLog.setCreateTime(DateUtil.date());
-                userScoreLog.setIoType(1);
-                userScoreLogs.add(userScoreLog);
-
-                //添加积分明细
-                UserScoreDetail addDetail = new UserScoreDetail();
-                addDetail.setCreateTime(new Date());
-                addDetail.setStatus(1);
-                addDetail.setUserId(user.getUserId());
-                addDetail.setUsableScore(score);
-                userScoreDetails.add(addDetail);
-
-                user.setScore(user.getScore() == null ? score : user.getScore() + score);
-            }
+
             //2.优惠券
             //TODO
-            if(CollectionUtils.isNotEmpty(level.getCouponIds())){
+            if (CollectionUtils.isNotEmpty(level.getCouponIds())) {
                 couponIds.addAll(level.getCouponIds());
             }
             //3.等级日志,如果不为空则为会员购买提升的等级就直接退出,修改一行
-            if(userLevelLog != null){
+            if (userLevelLog != null) {
                 userLevelLog.setIsPayed(1);
                 userLevelLog.setState(1);
                 userLevelLog.setLevelType(1);
@@ -566,16 +559,16 @@ public class UserLevelServiceImpl extends ServiceImpl<UserLevelMapper, UserLevel
         }
         //修改扩展表信息
         userExtensionMapper.updateById(user);
-        if(CollectionUtils.isNotEmpty(couponIds)){
-            applicationContext.publishEvent(new BatchBindCouponEvent(couponIds,user.getUserId(),0L));
+        if (CollectionUtils.isNotEmpty(couponIds)) {
+            applicationContext.publishEvent(new BatchBindCouponEvent(couponIds, user.getUserId(), 0L));
         }
         //保存积分日志、积分明细日志
-        if(CollectionUtils.isNotEmpty(userScoreLogs)){
+        if (CollectionUtils.isNotEmpty(userScoreLogs)) {
             userScoreLogService.saveBatch(userScoreLogs);
             userScoreDetailService.saveBatch(userScoreDetails);
         }
         //批量保存等级日志
-        if(CollectionUtils.isNotEmpty(levelLogs)){
+        if (CollectionUtils.isNotEmpty(levelLogs)) {
             userLevelLogService.saveBatch(levelLogs);
         }
     }