fubojin 1 kuukausi sitten
vanhempi
commit
4b91ebfc36

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

@@ -17,7 +17,7 @@ import lombok.*;
 @NoArgsConstructor
 @AllArgsConstructor
 @JsonInclude(JsonInclude.Include.NON_NULL)
-@ApiModel(description = "请求海博门店基础信息的实体")
+@ApiModel(description = "请求海博基础信息的实体")
 public class HBBaseReq<T> {
     private String appId;
     private String sign;

+ 2 - 3
yami-shop-bean/src/main/java/com/yami/shop/bean/model/hb/GoodsPriceHistory.java → yami-shop-bean/src/main/java/com/yami/shop/bean/model/GoodsPriceHistory.java

@@ -1,7 +1,6 @@
-package com.yami.shop.bean.model.hb;
+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;
@@ -23,7 +22,7 @@ public class GoodsPriceHistory {
     /**
      * 主键
      */
-    @TableId(value = "id", type = IdType.ASSIGN_ID) // 根据实际情况调整ID策略
+    @TableId(value = "id") // 根据实际情况调整ID策略
     private Long id;
 
     /**

+ 0 - 94
yami-shop-bean/src/main/java/com/yami/shop/bean/model/hb/GoodsSku.java

@@ -1,94 +0,0 @@
-package com.yami.shop.bean.model.hb;
-
-
-import com.baomidou.mybatisplus.annotation.*;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.math.BigDecimal;
-import java.time.LocalDateTime;
-
-/**
- * 商品SKU实体
- *
- * @author fubojin
- * @version 1.0.0
- * @since 2025-09-8
- */
-@TableName("zs_goods_sku")
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class GoodsSku {
-
-    @TableId(value = "sku_id", type = IdType.AUTO)
-    private Long skuId;
-
-    @TableField("spu_id")
-    private Long spuId;
-
-    @TableField("sku_code")
-    private String skuCode;
-
-    @TableField("sku_name")
-    private String skuName;
-
-    @TableField("price")
-    private BigDecimal price;
-
-    @TableField("stock")
-    private Integer stock;
-
-    @TableField("weight")
-    private BigDecimal weight;
-
-    @TableField("volume")
-    private BigDecimal volume;
-
-    @TableField("main_image")
-    private String mainImage;
-
-    @TableField("status")
-    private Integer status;
-
-    @TableField("deleted")
-    private Integer deleted;
-
-    @TableField(value = "create_time", fill = FieldFill.INSERT)
-    private LocalDateTime createTime;
-
-    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
-    private LocalDateTime updateTime;
-
-    /**
-     * 设置默认值
-     */
-    public void setDefaultValues() {
-        LocalDateTime now = LocalDateTime.now();
-        if (createTime == null) {
-            createTime = now;
-        }
-        if (updateTime == null) {
-            updateTime = now;
-        }
-        if (price == null) {
-            price = BigDecimal.ZERO;
-        }
-        if (stock == null) {
-            stock = 0;
-        }
-        if (status == null) {
-            status = 1; // 默认正常状态
-        }
-        if (deleted == null) {
-            deleted = 0; // 默认未删除
-        }
-    }
-
-
-}

+ 0 - 118
yami-shop-bean/src/main/java/com/yami/shop/bean/model/hb/GoodsSpu.java

@@ -1,118 +0,0 @@
-package com.yami.shop.bean.model.hb;
-
-import com.baomidou.mybatisplus.annotation.*;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.time.LocalDateTime;
-import java.util.List;
-
-/**
- * 商品SPU实体
- *
- * @author fubojin
- * @version 1.0.0
- * @since 2025-09-8
- */
-@TableName("zs_goods_spu")
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class GoodsSpu {
-
-    @TableId(value = "spu_id", type = IdType.AUTO)
-    private Long spuId;
-
-    @TableField("merchant_id")
-    private Long merchantId;
-
-    @TableField("spu_name")
-    private String spuName;
-
-    @TableField("description")
-    private String description;
-
-    /**
-     * 类目ID
-     */
-    @TableField("category_id")
-    private Long categoryId;
-
-    /**
-     * 品牌ID
-     */
-    @TableField("brand_id")
-    private Long brandId;
-
-    @TableField("status")
-    private Integer status;
-
-    @TableField("deleted")
-    private Integer deleted;
-
-    @TableField(value = "create_time", fill = FieldFill.INSERT)
-    private LocalDateTime createTime;
-
-    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
-    private LocalDateTime updateTime;
-
-    /**
-     * 设置默认值
-     */
-    public void setDefaultValues() {
-        LocalDateTime now = LocalDateTime.now();
-        if (createTime == null) {
-            createTime = now;
-        }
-        if (status == null) {
-            status = Status.ON_SHELF.getCode(); // 默认上架
-        }
-        if (deleted == null) {
-            deleted = Status.NO_DELETE.getCode(); // 默认未删除
-        }
-    }
-
-
-    /**
-     * 状态枚举
-     */
-    public enum Status {
-        OFF_SHELF(0, "下架"),
-        ON_SHELF(1, "上架"),
-
-        NO_DELETE(0, "未删除"),
-        DELETE(1, "删除");
-
-        private final int code;
-        private final String desc;
-
-        Status(int code, String desc) {
-            this.code = code;
-            this.desc = desc;
-        }
-
-        public int getCode() {
-            return code;
-        }
-
-        public String getDesc() {
-            return desc;
-        }
-
-        public static Status fromCode(int code) {
-            for (Status status : values()) {
-                if (status.code == code) {
-                    return status;
-                }
-            }
-            return ON_SHELF; // 默认返回上架
-        }
-    }
-
-    private List<GoodsSku> goodsSkuList;
-}

+ 0 - 83
yami-shop-bean/src/main/java/com/yami/shop/bean/model/hb/StoreManagement.java

@@ -1,83 +0,0 @@
-package com.yami.shop.bean.model.hb;
-
-import com.baomidou.mybatisplus.annotation.*;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.time.LocalDateTime;
-
-/**
- * 门店实体
- *
- * @author fubojin
- * @version 1.0.0
- * @since 2025-09-1
- */
-@TableName("zs_store_management")
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class StoreManagement {
-
-    @TableId(type = IdType.AUTO)
-    private Long id;
-
-    @TableField("station_id")
-    private String stationId;
-
-    @TableField("out_station_no")
-    private String outStationNo;
-
-    @TableField("remark")
-    private String remark;
-
-    @TableField("status")
-    private String status;
-
-    @TableField(value = "create_time", fill = FieldFill.INSERT)
-    private LocalDateTime createTime;
-
-    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
-    private LocalDateTime updateTime;
-
-    @TableField("create_by")
-    private String createBy;
-
-    @TableField("update_by")
-    private String updateBy;
-
-    @TableField("deleted")
-    private Boolean deleted;
-
-    /**
-     * 设置默认值
-     */
-    public void setDefaultValues() {
-        LocalDateTime now = LocalDateTime.now();
-        if (createTime == null) {
-            createTime = now;
-        }
-        if (updateTime == null) {
-            updateTime = now;
-        }
-        if (status == null) {
-            status = "1"; // 默认启用
-        }
-
-        if (deleted == null) {
-            deleted = false; // 默认未删除
-        }
-    }
-
-    /**
-     * 设置更新时间
-     */
-    public void setUpdateTime() {
-        updateTime = LocalDateTime.now();
-    }
-}

+ 6 - 5
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/hb/GoodsController.java

@@ -1,8 +1,9 @@
 package com.yami.shop.platform.controller.hb;
 
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.yami.shop.bean.model.hb.GoodsSpu;
+import com.yami.shop.bean.model.Product;
 import com.yami.shop.common.util.hb.HBR;
 import com.yami.shop.service.hb.IGoodsService;
 import io.swagger.annotations.Api;
@@ -126,14 +127,14 @@ public class GoodsController {
  * 商品分页查询接口
  * @param pageNum 当前页码,默认为1
  * @param pageSize 每页数量,默认为10
- * @param goods 商品查询条件对象(非必须)
+ * @param product 商品查询条件对象(非必须)
  * @return 分页数据
  */
 @GetMapping("/selectPage")
-public ResponseEntity<Page<GoodsSpu>> selectGoodsPage(
+public ResponseEntity<IPage<Product>> selectGoodsPage(
         @RequestParam(defaultValue = "1") Integer pageNum,
         @RequestParam(defaultValue = "10") Integer pageSize,
-        @RequestBody(required = false) GoodsSpu goods) {
+        @RequestBody(required = false) Product product) {
 
     // 参数校验
     if (pageNum < 1) {
@@ -143,7 +144,7 @@ public ResponseEntity<Page<GoodsSpu>> selectGoodsPage(
         pageSize = 10;
     }
     // 调用Service层获取分页数据
-    Page<GoodsSpu> page = goodsService.selectGoodsPage(pageNum, pageSize, goods);
+    IPage<Product> page = goodsService.selectGoodsPage(pageNum, pageSize, product);
     // 返回统一格式的响应
     return ResponseEntity.ok(page);
 }

+ 0 - 2
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/hb/StoreManagementController.java

@@ -1,14 +1,12 @@
 package com.yami.shop.platform.controller.hb;
 
 import com.alibaba.fastjson.JSONObject;
-import com.yami.shop.bean.model.hb.StoreManagement;
 import com.yami.shop.common.util.hb.HBR;
 import com.yami.shop.service.hb.IStoreManagementService;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 
 /**

+ 3 - 2
yami-shop-service/src/main/java/com/yami/shop/service/hb/IGoodsService.java

@@ -1,8 +1,9 @@
 package com.yami.shop.service.hb;
 
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.yami.shop.bean.model.hb.GoodsSpu;
+import com.yami.shop.bean.model.Product;
 import com.yami.shop.common.util.hb.HBR;
 
 /**
@@ -67,5 +68,5 @@ public interface IGoodsService {
      * 分页获取商品信息
      * @return 商品信息
      */
-    Page<GoodsSpu> selectGoodsPage(Integer pageNum, Integer pageSize, GoodsSpu goods);
+    IPage<Product> selectGoodsPage(Integer pageNum, Integer pageSize, Product product);
 }

+ 0 - 46
yami-shop-service/src/main/java/com/yami/shop/service/hb/IStoreManagementService.java

@@ -2,7 +2,6 @@ package com.yami.shop.service.hb;
 
 import com.alibaba.fastjson.JSONObject;
 import com.yami.shop.bean.dto.hb.StoreRegister;
-import com.yami.shop.bean.model.hb.StoreManagement;
 import com.yami.shop.common.util.hb.HBR;
 
 import java.util.List;
@@ -43,50 +42,5 @@ public interface IStoreManagementService {
     HBR updateRegisterStore(JSONObject registerRequest);
 
 
-    /**
-     * 查询所有门店
-     *
-     * @return 门店列表
-     */
-    List<StoreManagement> findAllStores();
-
-    /**
-     * 更新门店信息
-     *
-     * @param store 门店信息
-     * @return 更新后的门店信息
-     */
-    StoreManagement updateStore(StoreManagement store);
-
-    /**
-     * 删除门店(逻辑删除)
-     *
-     * @param storeId 门店ID
-     * @return true表示删除成功,false表示删除失败
-     */
-    boolean deleteStore(Long storeId);
 
-    /**
-     * 启用门店
-     *
-     * @param storeId 门店ID
-     * @return true表示启用成功,false表示启用失败
-     */
-    boolean enableStore(Long storeId);
-
-    /**
-     * 禁用门店
-     *
-     * @param storeId 门店ID
-     * @return true表示禁用成功,false表示禁用失败
-     */
-    boolean disableStore(Long storeId);
-
-    /**
-     * 门店配送费模板变更通知
-     *
-     * @param registerRequest 门店配送费模板变更通知内容
-     * @return 模板变更通知响应
-     */
-    StoreRegister updateStoreDeliveryFeeTemplate(JSONObject registerRequest);
 }

+ 2 - 13
yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/CategoryService.java

@@ -3,7 +3,6 @@ package com.yami.shop.service.hb.impl;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.yami.shop.bean.dto.hb.HBBaseReq;
-import com.yami.shop.bean.model.hb.StoreManagement;
 import com.yami.shop.common.util.hb.HBR;
 import com.yami.shop.service.hb.ICategoryService;
 import com.yami.shop.utils.HBSignUtil;
@@ -29,7 +28,6 @@ import static com.yami.shop.common.util.HttpUtil.post;
 public class CategoryService implements ICategoryService {
     private final HBSignUtil hbSignUtil;
 
-
     @Override
     @Transactional
     public HBR addHBCategory(JSONObject hbRequest) {
@@ -40,20 +38,11 @@ public class CategoryService implements ICategoryService {
             String outStationNo = bodyJson.getString("outStationNo");
 
             // 2. 构建门店实体
-            StoreManagement store = StoreManagement.builder()
-                    .outStationNo(outStationNo)
-                    .stationId(bodyJson.getString("stationId"))
-                    .createBy("hb")
-                    .updateBy("hb")
-                    .build();
-
-            // 设置默认值
-            store.setDefaultValues();
 
             // 3. 保存门店信息
-            log.info("后台分类信息{}", store);
+            log.info("后台分类信息");
 
-            log.info("后台分类成功,门店ID:{}", store.getId());
+            log.info("后台分类成功,门店ID:");
 
             System.out.println("================");
             // 4. 构建响应

+ 3 - 13
yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/FrontCategoryService.java

@@ -3,7 +3,6 @@ package com.yami.shop.service.hb.impl;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.yami.shop.bean.dto.hb.HBBaseReq;
-import com.yami.shop.bean.model.hb.StoreManagement;
 import com.yami.shop.common.util.hb.HBR;
 import com.yami.shop.service.hb.IFrontCategoryService;
 import com.yami.shop.utils.HBSignUtil;
@@ -39,21 +38,12 @@ public class FrontCategoryService implements IFrontCategoryService {
             JSONObject bodyJson = JSON.parseObject(bodyStr); // 使用Fastjson的解析方法
             String outStationNo = bodyJson.getString("outStationNo");
 
-            // 2. 构建门店实体
-            StoreManagement store = StoreManagement.builder()
-                    .outStationNo(outStationNo)
-                    .stationId(bodyJson.getString("stationId"))
-                    .createBy("hb")
-                    .updateBy("hb")
-                    .build();
-
-            // 设置默认值
-            store.setDefaultValues();
+            // 2. 构建实体
 
             // 3. 保存门店信息
-            log.info("前台分类信息{}", store);
+            log.info("前台分类信息");
 
-            log.info("前台分类成功,门店ID:{}", store.getId());
+            log.info("前台分类成功,门店ID:");
 
 
             selectHBFrontCategory();

+ 70 - 74
yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/GoodsService.java

@@ -4,11 +4,14 @@ 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;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.yami.shop.bean.dto.hb.HBBaseReq;
-import com.yami.shop.bean.model.hb.GoodsSku;
-import com.yami.shop.bean.model.hb.GoodsSpu;
+import com.yami.shop.bean.model.Product;
+import com.yami.shop.bean.model.Sku;
 import com.yami.shop.common.util.hb.HBR;
+import com.yami.shop.dao.ProductMapper;
+import com.yami.shop.dao.SkuMapper;
 import com.yami.shop.service.hb.IGoodsService;
 import com.yami.shop.utils.HBSignUtil;
 import lombok.AllArgsConstructor;
@@ -37,8 +40,8 @@ import static com.yami.shop.common.util.HttpUtil.post;
 @Transactional(readOnly = true)
 public class GoodsService implements IGoodsService {
     private final HBSignUtil hbSignUtil;
-    private final GoodsSpuDao goodsSpuDao;
-    private final GoodsSkuDao goodsSkuDao;
+    private final ProductMapper productMapper;
+    private final SkuMapper skuMapper;
 
     @Override
     @Transactional
@@ -48,8 +51,8 @@ public class GoodsService implements IGoodsService {
             log.info("商品信息,body:{}", bodyStr);
             JSONObject bodyJson = JSON.parseObject(bodyStr);
             JSONArray productList = bodyJson.getJSONArray("productList");
-            List<GoodsSpu> spuList = new ArrayList<>();
-            List<GoodsSku> skuList = new ArrayList<>();
+            List<Product> spuList = new ArrayList<>();
+            List<Sku> skuList = new ArrayList<>();
 
             for (Object product : productList) {
                 JSONObject jsonObject = JSON.parseObject(product.toString());
@@ -67,27 +70,27 @@ public class GoodsService implements IGoodsService {
                 for (int i = 0; i < productHostInfoDTOS.size(); i++) {
                     JSONObject productInfo = productHostInfoDTOS.getJSONObject(i);
 
-                    // 创建并填充GoodsSpu对象
-                    GoodsSpu goodsSpu = createGoodsSpuFromProductInfo(productInfo);
-                    // 创建并填充GoodsSku对象
-                    GoodsSku goodsSku = createGoodsSkuFromProductInfo(productInfo);
-                    goodsSku.setSpuId(goodsSpu.getSpuId()); // 设置关联关系
+                    // 创建并填充Product对象
+                    Product Product = createProductFromProductInfo(productInfo);
+                    // 创建并填充Sku对象
+                    Sku Sku = createSkuFromProductInfo(productInfo);
+                    Sku.setProdId(Product.getProdId()); // 设置关联关系
 
 
                     //添加到数据库
-                    goodsSpuDao.insert(goodsSpu);
-                    goodsSkuDao.insert(goodsSku);
+                    productMapper.insert(Product);
+                    skuMapper.insert(Sku);
 
-                    spuList.add(goodsSpu);
-                    skuList.add(goodsSku);
+                    spuList.add(Product);
+                    skuList.add(Sku);
 
-                    log.info("SPU创建成功: spuId={}, spuName={}", goodsSpu.getSpuId(), goodsSpu.getSpuName());
-                    log.info("SKU创建成功: skuId={}, skuName={}", goodsSku.getSkuId(), goodsSku.getSkuName());
+                    log.info("SPU创建成功: spuId={}, spuName={}", Product.getProdId(), Product.getProdName());
+                    log.info("SKU创建成功: skuId={}, skuName={}", Sku.getSkuId(), Sku.getSkuName());
                 }
             }
             // 这里可以保存到数据库
-            // goodsSpuService.saveBatch(spuList);
-            // goodsSkuService.saveBatch(skuList);
+            // ProductService.saveBatch(spuList);
+            // SkuService.saveBatch(skuList);
 
             return HBR.success("商品信息处理成功,共处理 " + spuList.size() + " 个SPU和SKU");
 
@@ -214,95 +217,88 @@ public class GoodsService implements IGoodsService {
     }
 
     @Override
-    public Page<GoodsSpu> selectGoodsPage(Integer pageNum, Integer pageSize,GoodsSpu goods) {
+    public IPage<Product> selectGoodsPage(Integer pageNum, Integer pageSize,Product product) {
         // 1. 构建分页对象
-        Page<GoodsSpu> page = new Page<>(pageNum, pageSize);
+        Page<Product> page = new Page<>(pageNum, pageSize);
 
         // 2. 构建查询条件
-        LambdaQueryWrapper<GoodsSpu> queryWrapper = new LambdaQueryWrapper<>();
-
-        if (goods != null) {
-            queryWrapper.like(StringUtils.isNotBlank(goods.getSpuName()),
-                    GoodsSpu::getSpuName, goods.getSpuName());
-            queryWrapper.eq(goods.getCategoryId() != null,
-                    GoodsSpu::getCategoryId, goods.getCategoryId());
-            queryWrapper.eq(goods.getBrandId() != null,
-                    GoodsSpu::getBrandId, goods.getBrandId());
-            queryWrapper.eq(goods.getStatus() != null,
-                    GoodsSpu::getStatus, goods.getStatus());
-            queryWrapper.eq(goods.getMerchantId() != null,
-                    GoodsSpu::getMerchantId, goods.getMerchantId());
+        LambdaQueryWrapper<Product> queryWrapper = new LambdaQueryWrapper<>();
+
+        if (product != null) {
+            queryWrapper.like(StringUtils.isNotBlank(product.getProdName()),
+                    Product::getProdName, product.getProdName());
+            queryWrapper.eq(product.getCategoryId() != null,
+                    Product::getCategoryId, product.getCategoryId());
+            queryWrapper.eq(product.getBrandId() != null,
+                    Product::getBrandId, product.getBrandId());
+            queryWrapper.eq(product.getStatus() != null,
+                    Product::getStatus, product.getStatus());
         }
 
         // 3. 添加排序
-        queryWrapper.orderByDesc(GoodsSpu::getCreateTime);
+        queryWrapper.orderByDesc(Product::getCreateTime);
 
         // 4. 执行分页查询
-        Page<GoodsSpu> goodsSpuPage = goodsSpuDao.selectPage(page, queryWrapper);
-        List<GoodsSpu> records = goodsSpuPage.getRecords();
-        for (GoodsSpu record : records) {
+        IPage<Product> ProductPage = productMapper.selectPage(page, queryWrapper);
+        List<Product> records = ProductPage.getRecords();
+        for (Product record : records) {
 
-            LambdaQueryWrapper<GoodsSku> skuQueryWrapper = new LambdaQueryWrapper<>();
-            skuQueryWrapper.like(GoodsSku::getSpuId, record.getSpuId());
+            LambdaQueryWrapper<Sku> skuQueryWrapper = new LambdaQueryWrapper<>();
+            skuQueryWrapper.like(Sku::getProdId, record.getProdId());
 
             // 3. 添加排序
-            skuQueryWrapper.orderByDesc(GoodsSku::getCreateTime);
-            record.setGoodsSkuList(goodsSkuDao.selectList(skuQueryWrapper));
+            skuQueryWrapper.orderByDesc(Sku::getRecTime);
+            record.setSkuList(skuMapper.selectList(skuQueryWrapper));
         }
-        return goodsSpuPage;
+        return ProductPage;
     }
 
     /**
-     * 从productInfo创建GoodsSpu对象
+     * 从productInfo创建Product对象
      */
-    private GoodsSpu createGoodsSpuFromProductInfo(JSONObject productInfo) {
-        GoodsSpu goodsSpu = new GoodsSpu();
+    private Product createProductFromProductInfo(JSONObject productInfo) {
+        Product Product = new Product();
 
         // 设置默认值
-        goodsSpu.setDefaultValues();
         // 直接映射字段
-        goodsSpu.setSpuId(productInfo.getLong("spuId"));
-        goodsSpu.setSpuName(productInfo.getString("spuName"));
-        goodsSpu.setDescription(productInfo.getString("sellPoint"));
+        Product.setProdId(productInfo.getLong("spuId"));
+        Product.setProdName(productInfo.getString("spuName"));
 
         // 需要转换或默认值的字段
-        goodsSpu.setMerchantId(1L); // 默认商家ID,根据实际情况修改
-        goodsSpu.setCategoryId(convertCategoryCodeToId(productInfo.getString("frontCategoryCode"))); // 分类转换
-        goodsSpu.setBrandId(convertBrandToId(productInfo.getString("brandName"))); // 品牌转换
+        Product.setCategoryId(convertCategoryCodeToId(productInfo.getString("frontCategoryCode"))); // 分类转换
+        Product.setBrandId(convertBrandToId(productInfo.getString("brandName"))); // 品牌转换
 
         // 其他可能需要处理的字段
         if (productInfo.containsKey("desc")) {
-//            goodsSpu.setDesc(productInfo.getString("desc"));
+//            Product.setDesc(productInfo.getString("desc"));
         }
 
-        return goodsSpu;
+        return Product;
     }
 
     /**
-     * 从productInfo创建GoodsSku对象
+     * 从productInfo创建Sku对象
      */
-    private GoodsSku createGoodsSkuFromProductInfo(JSONObject productInfo) {
-        GoodsSku goodsSku = new GoodsSku();
-        // 设置默认值
-        goodsSku.setDefaultValues();
+    private Sku createSkuFromProductInfo(JSONObject productInfo) {
+        Sku Sku = new Sku();
         // 直接映射字段
-        goodsSku.setSkuId(productInfo.getLong("skuId"));
-        goodsSku.setSpuId(productInfo.getLong("spuId"));
-        goodsSku.setSkuCode(productInfo.getString("skuId")); // 使用海博skuId作为skuCode
-        goodsSku.setSkuName(productInfo.getString("skuName"));
-        goodsSku.setMainImage(productInfo.getString("images"));
+        Sku.setSkuId(productInfo.getLong("skuId"));
+        Sku.setProdId(productInfo.getLong("spuId"));
+        Sku.setSkuCode(productInfo.getString("skuId")); // 使用海博skuId作为skuCode
+        Sku.setSkuName(productInfo.getString("skuName"));
+        Sku.setPic(productInfo.getString("images"));//sku图片
 
         // 数值类型字段处理
-        goodsSku.setPrice(productInfo.getBigDecimal("basicPrice") != null ?
-                productInfo.getBigDecimal("basicPrice") : BigDecimal.ZERO);
-        goodsSku.setStock(productInfo.getInteger("initStock") != null ?
+        Sku.setPrice(productInfo.getDouble("basicPrice") != null ?
+                productInfo.getDouble("basicPrice") : Double.NaN);
+        Sku.setActualStocks(productInfo.getInteger("initStock") != null ?
                 productInfo.getInteger("initStock") : 0);
 
         // 重量和体积转换(需要根据实际数据格式处理)
         if (productInfo.containsKey("weight")) {
             try {
                 String weightStr = productInfo.getString("weight");
-                goodsSku.setWeight(new BigDecimal(weightStr));
+                Sku.setWeight(Double.NaN);
             } catch (Exception e) {
                 log.warn("重量格式转换失败: {}", productInfo.getString("weight"));
             }
@@ -311,23 +307,23 @@ public class GoodsService implements IGoodsService {
         // 状态处理
         Integer status = productInfo.getInteger("flag");
         if (status != null && status == 0) {
-            goodsSku.setStatus(0); // 停售
+            Sku.setStatus(0); // 停售
         } else {
-            goodsSku.setStatus(1); // 正常
+            Sku.setStatus(1); // 正常
         }
 
         // 其他字段映射
         if (productInfo.containsKey("spec")) {
             // spec字段可能包含规格信息,可以用于skuName或单独存储
-            goodsSku.setSkuName(goodsSku.getSkuName() + " " + productInfo.getString("spec"));
+            Sku.setSkuName(Sku.getSkuName() + " " + productInfo.getString("spec"));
         }
 
         if (productInfo.containsKey("unit")) {
             // 单位信息可以用于skuName
-            goodsSku.setSkuName(goodsSku.getSkuName() + "(" + productInfo.getString("unit") + ")");
+            Sku.setSkuName(Sku.getSkuName() + "(" + productInfo.getString("unit") + ")");
         }
 
-        return goodsSku;
+        return Sku;
     }
 
     /**

+ 8 - 208
yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/StoreManagementService.java

@@ -5,9 +5,9 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 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.hb.StoreManagement;
+import com.yami.shop.bean.model.ShopDetail;
 import com.yami.shop.common.util.hb.HBR;
+import com.yami.shop.dao.ShopDetailMapper;
 import com.yami.shop.service.hb.IStoreManagementService;
 import com.yami.shop.utils.HBSignUtil;
 import lombok.AllArgsConstructor;
@@ -16,9 +16,6 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 
-import java.util.List;
-import java.util.Optional;
-
 import static com.yami.shop.common.util.HttpUtil.post;
 
 
@@ -34,7 +31,7 @@ import static com.yami.shop.common.util.HttpUtil.post;
 @AllArgsConstructor
 @Transactional(readOnly = true)
 public class StoreManagementService implements IStoreManagementService {
-    private final StoreManagementDao storeManagementDao;
+    private final ShopDetailMapper shopDetailMapper;
     private final HBSignUtil hbSignUtil;
 
 
@@ -75,26 +72,16 @@ public class StoreManagementService implements IStoreManagementService {
             JSONObject bodyJson = JSON.parseObject(bodyStr); // 使用Fastjson的解析方法
             String outStationNo = bodyJson.getString("outStationNo");
             // 1. 验证门店编码是否已存在
-            if (existsByStoreCode(outStationNo)) {
-                log.warn("门店编码 {} 已存在", outStationNo);
-                return HBR.error("门店编码 {"+outStationNo+"} 已存在");
-            }
 
             // 2. 构建门店实体
-            StoreManagement store = StoreManagement.builder()
-                    .outStationNo(outStationNo)
-                    .stationId(bodyJson.getString("stationId"))
-                    .createBy("hb")
-                    .updateBy("hb")
-                    .build();
-
-            // 设置默认值
-            store.setDefaultValues();
+            ShopDetail store = new ShopDetail();
+            store.setShopName(outStationNo);
+            store.setCategory(bodyJson.getString("stationId"));
 
             // 3. 保存门店信息
             log.info("门店注册信息{}", store);
-            storeManagementDao.insert(store);
-            log.info("门店注册成功,门店ID:{}", store.getId());
+            shopDetailMapper.insert(store);
+            log.info("门店注册成功,门店ID:{}", store.getShopId());
 
             // 4. 构建响应
             return HBR.success();
@@ -118,28 +105,6 @@ public class StoreManagementService implements IStoreManagementService {
                 return HBR.error("门店编码不能为空");
             }
 
-            // 查询现有门店
-            LambdaQueryWrapper<StoreManagement> wrapper = new LambdaQueryWrapper<>();
-            wrapper.eq(StoreManagement::getOutStationNo, outStationNo)
-                   .eq(StoreManagement::getDeleted, false);
-            StoreManagement existing = storeManagementDao.selectOne(wrapper);
-
-            if (existing == null) {
-                return HBR.error("门店编码 {" + outStationNo + "} 不存在");
-            }
-
-            // 允许变更的字段(按需扩展)
-            String stationId = bodyJson.getString("outStationNo");
-            if (StringUtils.hasText(stationId)) {
-                existing.setStationId(stationId);
-            }
-
-            existing.setUpdateBy("hb");
-            existing.setUpdateTime();
-
-            storeManagementDao.updateById(existing);
-            log.info("门店变更成功,门店ID:{}", existing.getId());
-
             return HBR.success();
         } catch (Exception e) {
             log.error("门店变更失败:{}", e.getMessage(), e);
@@ -148,169 +113,4 @@ public class StoreManagementService implements IStoreManagementService {
     }
 
 
-    @Override
-    public List<StoreManagement> findAllStores() {
-        LambdaQueryWrapper<StoreManagement> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(StoreManagement::getDeleted, false);
-        return storeManagementDao.selectList(wrapper);
-    }
-
-    @Override
-    @Transactional
-    public StoreManagement updateStore(StoreManagement store) {
-        try {
-            log.info("开始更新门店信息,门店ID:{}", store.getId());
-
-            // 1. 检查门店是否存在
-            Optional<StoreManagement> existingStoreOpt = findById(store.getId());
-            if (existingStoreOpt.isEmpty()) {
-                throw new RuntimeException("门店不存在");
-            }
-
-            StoreManagement existingStore = existingStoreOpt.get();
-
-            // 2. 检查门店编码是否重复(排除自己)
-            if (StringUtils.hasText(store.getOutStationNo()) &&
-                !store.getOutStationNo().equals(existingStore.getOutStationNo())) {
-                if (existsByStoreCode(store.getOutStationNo())) {
-                    throw new RuntimeException("门店编码已存在");
-                }
-            }
-
-            // 3. 更新门店信息
-            existingStore.setUpdateBy("system"); // 可以从当前用户上下文获取
-            existingStore.setUpdateTime();
-
-            // 4. 保存更新
-            storeManagementDao.updateById(existingStore);
-            log.info("门店信息更新成功,门店ID:{}", existingStore.getId());
-
-            return existingStore;
-
-        } catch (Exception e) {
-            log.error("更新门店信息失败:{}", e.getMessage(), e);
-            throw new RuntimeException("更新门店信息失败:" + e.getMessage());
-        }
-    }
-
-    @Override
-    @Transactional
-    public boolean deleteStore(Long storeId) {
-        try {
-            log.info("开始删除门店,门店ID:{}", storeId);
-
-            // 1. 检查门店是否存在
-            Optional<StoreManagement> existingStoreOpt = findById(storeId);
-            if (existingStoreOpt.isEmpty()) {
-                log.warn("门店不存在,门店ID:{}", storeId);
-                return false;
-            }
-
-            StoreManagement existingStore = existingStoreOpt.get();
-
-            // 2. 逻辑删除
-            existingStore.setDeleted(true);
-            existingStore.setUpdateBy("system");
-            existingStore.setUpdateTime();
-
-            storeManagementDao.updateById(existingStore);
-            log.info("门店删除成功,门店ID:{}", storeId);
-
-            return true;
-
-        } catch (Exception e) {
-            log.error("删除门店失败:{}", e.getMessage(), e);
-            return false;
-        }
-    }
-
-    @Override
-    @Transactional
-    public boolean enableStore(Long storeId) {
-        try {
-            log.info("开始启用门店,门店ID:{}", storeId);
-
-            // 1. 检查门店是否存在
-            Optional<StoreManagement> existingStoreOpt = findById(storeId);
-            if (existingStoreOpt.isEmpty()) {
-                log.warn("门店不存在,门店ID:{}", storeId);
-                return false;
-            }
-
-            StoreManagement existingStore = existingStoreOpt.get();
-
-            // 2. 启用门店
-            existingStore.setStatus("1");
-            existingStore.setUpdateBy("system");
-            existingStore.setUpdateTime();
-
-            storeManagementDao.updateById(existingStore);
-            log.info("门店启用成功,门店ID:{}", existingStore.getId());
-
-            return true;
-
-        } catch (Exception e) {
-            log.error("启用门店失败:{}", e.getMessage(), e);
-            return false;
-        }
-    }
-
-    @Override
-    @Transactional
-    public boolean disableStore(Long storeId) {
-        try {
-            log.info("开始禁用门店,门店ID:{}", storeId);
-
-            // 1. 检查门店是否存在
-            Optional<StoreManagement> existingStoreOpt = findById(storeId);
-            if (existingStoreOpt.isEmpty()) {
-                log.warn("门店不存在,门店ID:{}", storeId);
-                return false;
-            }
-
-            // 2. 禁用门店
-            StoreManagement existingStore = existingStoreOpt.get();
-            existingStore.setStatus("0");
-            existingStore.setUpdateBy("system");
-            existingStore.setUpdateTime();
-
-            storeManagementDao.updateById(existingStore);
-            log.info("门店禁用成功,门店ID:{}", existingStore.getId());
-
-            return true;
-
-        } catch (Exception e) {
-            log.error("禁用门店失败:{}", e.getMessage(), e);
-            return false;
-        }
-    }
-
-    @Override
-    public StoreRegister updateStoreDeliveryFeeTemplate(JSONObject registerRequest) {
-        return null;
-    }
-
-    /**
-     * 根据ID查询门店
-     *
-     * @param id 门店ID
-     * @return 门店信息
-     */
-    private Optional<StoreManagement> findById(Long id) {
-        return Optional.ofNullable(storeManagementDao.selectById(id));
-    }
-
-    /**
-     * 检查门店编码是否已存在
-     *
-     * @param storeCode 门店编码
-     * @return true表示已存在,false表示不存在
-     */
-    private boolean existsByStoreCode(String storeCode) {
-        LambdaQueryWrapper<StoreManagement> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(StoreManagement::getOutStationNo, storeCode)
-               .eq(StoreManagement::getDeleted, false);
-        return storeManagementDao.selectCount(wrapper) > 0;
-    }
-
 }