瀏覽代碼

门店渠道商品管理

fubojin 3 周之前
父節點
當前提交
4650b2c6e1
共有 100 個文件被更改,包括 4285 次插入536 次删除
  1. 38 0
      yami-shop-bean/src/main/java/com/yami/shop/bean/dto/PointsRechargeTemplateDTO.java
  2. 29 0
      yami-shop-bean/src/main/java/com/yami/shop/bean/dto/ShopCategoryExcelDTO.java
  3. 5 3
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/CategoryProd.java
  4. 8 0
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/ChannelProd.java
  5. 39 0
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/ChannelShop.java
  6. 1 1
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/Dept.java
  7. 1 1
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/DeptUser.java
  8. 14 5
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/FrontCategory.java
  9. 44 0
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/Label.java
  10. 65 0
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/PointsFailureRecord.java
  11. 102 0
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/PointsRecharge.java
  12. 91 0
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/PointsRecord.java
  13. 96 0
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/ShopCategory.java
  14. 7 1
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/ShopDetail.java
  15. 4 4
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/ShopSku.java
  16. 68 0
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/SysDictData.java
  17. 59 0
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/SysDictType.java
  18. 4 1
      yami-shop-bean/src/main/java/com/yami/shop/bean/model/SysUser.java
  19. 76 0
      yami-shop-bean/src/main/java/com/yami/shop/bean/vo/FrontCategoryVO.java
  20. 1 0
      yami-shop-multishop/src/main/java/com/yami/shop/multishop/controller/CategoryController.java
  21. 54 0
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/CategoryPropController.java
  22. 4 4
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/DeptUserController.java
  23. 117 117
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/FileController.java
  24. 84 0
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/LabelController.java
  25. 74 0
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/PointsFailureRecordController.java
  26. 108 0
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/PointsRechargeController.java
  27. 74 0
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/PointsRecordController.java
  28. 194 0
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ShopCategoryController.java
  29. 7 7
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ShopSkuController.java
  30. 107 0
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/SysDictDataController.java
  31. 112 0
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/SysDictTypeController.java
  32. 2 3
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/hb/FrontCategoryController.java
  33. 2 8
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/hb/GoodsController.java
  34. 31 2
      yami-shop-platform/src/main/java/com/yami/shop/platform/controller/hb/StoreManagementController.java
  35. 1 1
      yami-shop-quartz/src/main/java/com/yami/shop/quartz/util/SpringBeanTaskUtil.java
  36. 1 0
      yami-shop-security/yami-shop-security-platform/src/main/java/com/yami/shop/security/platform/config/ResourceServerConfiguration.java
  37. 4 5
      yami-shop-service/src/main/java/com/yami/shop/dao/CategoryProdMapper.java
  38. 33 33
      yami-shop-service/src/main/java/com/yami/shop/dao/ChannelMapper.java
  39. 17 0
      yami-shop-service/src/main/java/com/yami/shop/dao/ChannelShopMapper.java
  40. 3 1
      yami-shop-service/src/main/java/com/yami/shop/dao/DeptMapper.java
  41. 2 2
      yami-shop-service/src/main/java/com/yami/shop/dao/DeptUserMapper.java
  42. 2 0
      yami-shop-service/src/main/java/com/yami/shop/dao/FrontCategoryMapper.java
  43. 14 0
      yami-shop-service/src/main/java/com/yami/shop/dao/LabelMapper.java
  44. 14 0
      yami-shop-service/src/main/java/com/yami/shop/dao/PointsFailureRecordMapper.java
  45. 14 0
      yami-shop-service/src/main/java/com/yami/shop/dao/PointsRechargeMapper.java
  46. 15 0
      yami-shop-service/src/main/java/com/yami/shop/dao/PointsRecordMapper.java
  47. 35 0
      yami-shop-service/src/main/java/com/yami/shop/dao/ShopCategoryMapper.java
  48. 3 3
      yami-shop-service/src/main/java/com/yami/shop/dao/ShopSkuMapper.java
  49. 96 0
      yami-shop-service/src/main/java/com/yami/shop/dao/SysDictDataMapper.java
  50. 85 0
      yami-shop-service/src/main/java/com/yami/shop/dao/SysDictTypeMapper.java
  51. 23 0
      yami-shop-service/src/main/java/com/yami/shop/dao/TzSysUserMapper.java
  52. 2 2
      yami-shop-service/src/main/java/com/yami/shop/service/CategoryProdService.java
  53. 1 1
      yami-shop-service/src/main/java/com/yami/shop/service/DeptService.java
  54. 4 4
      yami-shop-service/src/main/java/com/yami/shop/service/DeptUserService.java
  55. 18 0
      yami-shop-service/src/main/java/com/yami/shop/service/IFrontCategoryService.java
  56. 40 0
      yami-shop-service/src/main/java/com/yami/shop/service/IShopCategoryService.java
  57. 61 0
      yami-shop-service/src/main/java/com/yami/shop/service/ISysDictDataService.java
  58. 99 0
      yami-shop-service/src/main/java/com/yami/shop/service/ISysDictTypeService.java
  59. 14 0
      yami-shop-service/src/main/java/com/yami/shop/service/LabelService.java
  60. 15 0
      yami-shop-service/src/main/java/com/yami/shop/service/PointsFailureRecordService.java
  61. 31 0
      yami-shop-service/src/main/java/com/yami/shop/service/PointsRechargeService.java
  62. 15 0
      yami-shop-service/src/main/java/com/yami/shop/service/PointsRecordService.java
  63. 0 22
      yami-shop-service/src/main/java/com/yami/shop/service/ShopProdService.java
  64. 13 0
      yami-shop-service/src/main/java/com/yami/shop/service/ShopSkuService.java
  65. 29 29
      yami-shop-service/src/main/java/com/yami/shop/service/hb/IHBFrontCategoryService.java
  66. 1 1
      yami-shop-service/src/main/java/com/yami/shop/service/hb/IHBGoodsService.java
  67. 1 1
      yami-shop-service/src/main/java/com/yami/shop/service/hb/IHBOrderService.java
  68. 27 0
      yami-shop-service/src/main/java/com/yami/shop/service/hb/IStoreManagementService.java
  69. 108 109
      yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/HBFrontCategoryService.java
  70. 29 30
      yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/HBGoodsService.java
  71. 2 5
      yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/HBOrderService.java
  72. 46 10
      yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/StoreManagementService.java
  73. 2 0
      yami-shop-service/src/main/java/com/yami/shop/service/impl/AttachFileServiceImpl.java
  74. 22 0
      yami-shop-service/src/main/java/com/yami/shop/service/impl/CategoryProdServiceImpl.java
  75. 0 31
      yami-shop-service/src/main/java/com/yami/shop/service/impl/CategoryPropServiceImpl.java
  76. 3 11
      yami-shop-service/src/main/java/com/yami/shop/service/impl/CategoryServiceImpl.java
  77. 37 13
      yami-shop-service/src/main/java/com/yami/shop/service/impl/ChannelProdServiceImpl.java
  78. 7 6
      yami-shop-service/src/main/java/com/yami/shop/service/impl/DeptServiceImpl.java
  79. 5 5
      yami-shop-service/src/main/java/com/yami/shop/service/impl/DeptUserServiceImpl.java
  80. 30 0
      yami-shop-service/src/main/java/com/yami/shop/service/impl/FrontCategoryService.java
  81. 22 0
      yami-shop-service/src/main/java/com/yami/shop/service/impl/LabelServiceImpl.java
  82. 23 0
      yami-shop-service/src/main/java/com/yami/shop/service/impl/PointsFailureRecordServiceImpl.java
  83. 152 0
      yami-shop-service/src/main/java/com/yami/shop/service/impl/PointsRechargeServiceImpl.java
  84. 22 0
      yami-shop-service/src/main/java/com/yami/shop/service/impl/PointsRecordServiceImpl.java
  85. 8 11
      yami-shop-service/src/main/java/com/yami/shop/service/impl/ProdPropServiceImpl.java
  86. 271 0
      yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopCategoryServiceImpl.java
  87. 0 21
      yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopProdServiceImpl.java
  88. 21 0
      yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopSkuServiceImpl.java
  89. 111 0
      yami-shop-service/src/main/java/com/yami/shop/service/impl/SysDictDataServiceImpl.java
  90. 222 0
      yami-shop-service/src/main/java/com/yami/shop/service/impl/SysDictTypeServiceImpl.java
  91. 238 0
      yami-shop-service/src/main/java/com/yami/shop/utils/DictUtils.java
  92. 158 0
      yami-shop-service/src/main/java/com/yami/shop/utils/SpringUtils.java
  93. 9 15
      yami-shop-service/src/main/resources/mapper/CategoryProdMapper.xml
  94. 20 0
      yami-shop-service/src/main/resources/mapper/DeptMapper.xml
  95. 18 0
      yami-shop-service/src/main/resources/mapper/FrontCategoryMapper.xml
  96. 14 0
      yami-shop-service/src/main/resources/mapper/ShopCategoryMapper.xml
  97. 4 4
      yami-shop-service/src/main/resources/mapper/ShopSkuMapper.xml
  98. 121 0
      yami-shop-service/src/main/resources/mapper/SysDictDataMapper.xml
  99. 103 0
      yami-shop-service/src/main/resources/mapper/SysDictTypeMapper.xml
  100. 2 3
      yami-shop-sys/src/main/java/com/yami/shop/sys/controller/SysMenuController.java

+ 38 - 0
yami-shop-bean/src/main/java/com/yami/shop/bean/dto/PointsRechargeTemplateDTO.java

@@ -0,0 +1,38 @@
+package com.yami.shop.service.impl;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.format.DateTimeFormat;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 积分充值导入模板DTO
+ */
+@Data
+public class PointsRechargeTemplateDTO {
+
+    @ExcelProperty("所属企业")
+    @ColumnWidth(20)
+    private String channelName;
+
+    @ExcelProperty("员工名称")
+    @ColumnWidth(20)
+    private String userName;
+
+    @ExcelProperty("员工电话号码")
+    @ColumnWidth(20)
+    private String userPhone;
+
+    @ExcelProperty("充值积分")
+    @ColumnWidth(20)
+    private BigDecimal points;
+
+    @ExcelProperty("过期日期")
+    @ColumnWidth(20)
+    @DateTimeFormat("yyyy/MM/dd") // 可选:指定日期格式
+    private Date expiryDate;
+
+}

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

@@ -0,0 +1,29 @@
+package com.yami.shop.bean.dto;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import lombok.Data;
+
+/**
+ * 门店前台类目Excel导入DTO
+ */
+@Data
+public class ShopCategoryExcelDTO {
+
+    @ExcelProperty("门店ID")
+    @ColumnWidth(20)
+    private Long shopId;
+
+    @ExcelProperty("门店名称")
+    @ColumnWidth(20)
+    private String shopName;
+
+    @ExcelProperty("一级类目名称")
+    @ColumnWidth(30)
+    private String name;
+
+    @ExcelProperty("二级类目名称")
+    @ColumnWidth(30)
+    private String subName;
+
+}

+ 5 - 3
yami-shop-bean/src/main/java/com/yami/shop/bean/model/CategoryProp.java → yami-shop-bean/src/main/java/com/yami/shop/bean/model/CategoryProd.java

@@ -16,8 +16,8 @@ import lombok.Data;
 import java.io.Serializable;
 
 @Data
-@TableName("tz_category_prop")
-public class CategoryProp implements Serializable {
+@TableName("tz_category_prod")
+public class CategoryProd implements Serializable {
     @TableId
 
     private Long id;
@@ -33,4 +33,6 @@ public class CategoryProp implements Serializable {
      */
 
     private Long propId;
-}
+
+    private Integer isDelete;
+}

+ 8 - 0
yami-shop-bean/src/main/java/com/yami/shop/bean/model/ChannelProd.java

@@ -44,6 +44,14 @@ public class ChannelProd implements Serializable {
      * 单品ID
      */
     private Long skuId;
+    /**
+     * 门店ID
+     */
+    private Long shopId;
+    /**
+     * 门店名称
+     */
+    private String shopName;
 
     /**
      * 进货价

+ 39 - 0
yami-shop-bean/src/main/java/com/yami/shop/bean/model/ChannelShop.java

@@ -0,0 +1,39 @@
+package com.yami.shop.bean.model;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import java.io.Serializable;
+
+/**
+ * 渠道对应门店管理实体类
+ *
+ * @author YourName
+ * @since 2025-09-XX
+ */
+@Data
+@TableName("tz_channel_shop")
+public class ChannelShop implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId
+    private Long id;
+
+    /**
+     * 渠道ID
+     */
+    private Long channelId;
+
+    /**
+     * 门店ID
+     */
+    private Long shopId;
+
+    /**
+     * 删除状态(0-正常,1 -删除)
+     */
+    private Integer isDelete;
+}

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

@@ -48,7 +48,7 @@ public class Dept implements Serializable {
      */
     private Long leaderUserId;
     @TableField(exist = false)
-    private Long leaderUserName;
+    private String leaderUserName;
 
     /**
      * 联系电话(加密存储)

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

@@ -31,7 +31,7 @@ public class DeptUser implements Serializable {
     /**
      * 用户ID
      */
-    private String userId;
+    private Long userId;
 
     /**
      * 创建时间

+ 14 - 5
yami-shop-bean/src/main/java/com/yami/shop/bean/model/FrontCategory.java

@@ -10,12 +10,14 @@
 
 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;
 import lombok.experimental.Accessors;
 
 import java.io.Serializable;
+import java.util.List;
 
 @Data
 @TableName("tz_front_category")
@@ -28,10 +30,10 @@ public class FrontCategory implements Serializable {
     @TableId
     private Long id;
 
-    /**
-     * 父类目ID
-     */
-    private Long pid;
+//    /**
+//     * 父类目ID
+//     */
+//    private Long pid;
 
     /**
      * 编码
@@ -64,7 +66,7 @@ public class FrontCategory implements Serializable {
     private Integer isDelete;
 
     /**
-     * 类目等级
+     * 类目等级(0-一级,1-二级,2-三级)
      */
     private Integer level;
 
@@ -73,9 +75,16 @@ public class FrontCategory implements Serializable {
      */
     private String operateUser;
 
+    /**
+     * 图标
+     */
+    private String icon;
+
     /**
      * 是否叶子(1-是,2-不是)
      */
     private Integer isLeaves;
 
+    @TableField(exist = false)
+    private List<FrontCategory> children;
 }

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

@@ -0,0 +1,44 @@
+package com.yami.shop.bean.model;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * 标签实体类
+ *
+ * @author
+ * @since 2025-09-XX
+ */
+@Data
+@TableName("tz_label")
+public class Label implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId
+    private Long id;
+
+    /**
+     * 标签名称
+     */
+    private String name;
+
+    /**
+     * 标签类型
+     */
+    private Integer type;
+
+    /**
+     * 创建日期
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date creationDate;
+}

+ 65 - 0
yami-shop-bean/src/main/java/com/yami/shop/bean/model/PointsFailureRecord.java

@@ -0,0 +1,65 @@
+package com.yami.shop.bean.model;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * 积分充值失败记录实体类
+ *
+ * @author
+ * @since 2025-09-XX
+ */
+@Data
+@TableName("tz_points_failure_record")
+public class PointsFailureRecord implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId
+    private Long id;
+
+    /**
+     * 失败原因
+     */
+    private String reasonForFailure;
+
+    /**
+     * 渠道(企业ID)
+     */
+    private Long channelId;
+
+    /**
+     * 渠道(企业)名称
+     */
+    private String channelName;
+
+    /**
+     * 员工名称
+     */
+    private String userName;
+
+    /**
+     * 电话号码
+     */
+    private String userPhone;
+
+    /**
+     * 充值积分
+     */
+    private BigDecimal points;
+
+    /**
+     * 过期日期
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date expiryDate;
+}

+ 102 - 0
yami-shop-bean/src/main/java/com/yami/shop/bean/model/PointsRecharge.java

@@ -0,0 +1,102 @@
+package com.yami.shop.bean.model;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * 积分充值实体类
+ *
+ * @author
+ * @since 2025-09-XX
+ */
+@Data
+@TableName("tz_points_recharge")
+public class PointsRecharge implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId
+    private Long id;
+
+    /**
+     * 用户ID
+     */
+    private Long userId;
+
+    /**
+     * 员工名称
+     */
+    private String userName;
+
+    /**
+     * 电话号码
+     */
+    private String userPhone;
+
+    /**
+     * 渠道(企业ID)
+     */
+    private Long channelId;
+
+    /**
+     * 渠道(企业)名称
+     */
+    private String channelName;
+
+    /**
+     * 充值单号
+     */
+    private String rechargeNumber;
+
+    /**
+     * 充值类型
+     */
+    private Integer type;
+
+    /**
+     * 积分状态(1-未过期,2-过期)
+     */
+    private Integer rechargeStatus;
+
+    /**
+     * 充值积分
+     */
+    private BigDecimal points;
+
+    /**
+     * 过期日期
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date expiryDate;
+
+    /**
+     * 创建者
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}

+ 91 - 0
yami-shop-bean/src/main/java/com/yami/shop/bean/model/PointsRecord.java

@@ -0,0 +1,91 @@
+package com.yami.shop.bean.model;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * 积分记录详细实体类
+ *
+ * @author
+ * @since 2025-09-XX
+ */
+@Data
+@TableName("tz_points_record")
+public class PointsRecord implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId
+    private Long id;
+
+    /**
+     * 用户ID
+     */
+    private Long userId;
+
+    /**
+     * 渠道(企业ID)
+     */
+    private Long channelId;
+
+    /**
+     * 订单ID
+     */
+    private Long orderId;
+
+    /**
+     * 充值积分ID
+     */
+    private Long pointsId;
+
+    /**
+     * 编码
+     */
+    private String code;
+
+    /**
+     * 订单关联父编码
+     */
+    private String parentCode;
+
+    /**
+     * 积分
+     */
+    private BigDecimal points;
+
+    /**
+     * 变动积分
+     */
+    private BigDecimal variablePoints;
+
+    /**
+     * 积分记录类型(1-充值,2-下单,3-退款)
+     */
+    private Integer pointsType;
+
+    /**
+     * 积分使用状态(1-未使用,2-使用部分,3-已使用)
+     */
+    private Integer pointsAudit;
+
+    /**
+     * 创建日期
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date creationDate;
+
+    /**
+     * 过期日期
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date expiryDate;
+}

+ 96 - 0
yami-shop-bean/src/main/java/com/yami/shop/bean/model/ShopCategory.java

@@ -0,0 +1,96 @@
+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;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 门店前台类目表
+ *
+ * @author YourName
+ * @since 2025-09-XX
+ */
+@Data
+@TableName("tz_shop_category")
+public class ShopCategory implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId
+    private Long id;
+
+    /**
+     * 类目名称
+     */
+    private String name;
+
+    /**
+     * 门店ID
+     */
+    private Long shopId;
+
+    /**
+     * 编码
+     */
+    private String code;
+
+    /**
+     * 父级分类编码
+     */
+    private String parentCode;
+
+    /**
+     * 父级分类名称
+     */
+    private String parentName;
+    /**
+     * 图标
+     */
+    private String icon;
+    /**
+     * 序号
+     */
+    private Integer num;
+
+    /**
+     * 是否删除(0 正常 1 已被删除)
+     */
+    private Integer isDelete;
+
+    /**
+     * 类目等级(0-一级,1-二级,2-三级)
+     */
+    private Integer level;
+
+    /**
+     * 操作人
+     */
+    private String operateUser;
+
+    /**
+     * 是否叶子(1-是,2-不是)
+     */
+    private Integer isLeaves;
+    /**
+     * 类目的显示图片
+     */
+        private String pic;
+    /**
+     * 标签
+     */
+    private String label;
+
+    /**
+     * 子类名称(导入时处理需要)
+     */
+    @TableField(exist = false)
+    private String subName;
+
+    @TableField(exist = false)
+    private List<ShopCategory> children;
+}

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

@@ -12,8 +12,10 @@ package com.yami.shop.bean.model;
 
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -133,11 +135,15 @@ public class ShopDetail implements Serializable {
     /**
      * 创建时间
      */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
 
     /**
      * 更新时间
      */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date updateTime;
 
     /**
@@ -163,7 +169,7 @@ public class ShopDetail implements Serializable {
     /**
      * 是否同步到配送平台
      */
-    private boolean sync;
+    private Boolean sync;
 
     /**
      * 配送平台店铺编码

+ 4 - 4
yami-shop-bean/src/main/java/com/yami/shop/bean/model/ShopProd.java → yami-shop-bean/src/main/java/com/yami/shop/bean/model/ShopSku.java

@@ -20,9 +20,9 @@ import java.io.Serializable;
 import java.util.Date;
 
 @Data
-@TableName("tz_shop_prod")
+@TableName("tz_shop_sku")
 @Accessors(chain = true)
-public class ShopProd implements Serializable {
+public class ShopSku implements Serializable {
     private static final long serialVersionUID = 3300529542917772262L;
     /**
      * 门店商品表ID
@@ -43,12 +43,12 @@ public class ShopProd implements Serializable {
     /**
      * 商品对应门店价格
      */
-    private Double shopProdPrice;
+    private Double shopSkuPrice;
 
     /**
      * 商品对应门店库存
      */
-    private Integer shopProdStocks;
+    private Integer shopSkuStocks;
 
     /**
      * 0 正常 1 已被删除

+ 68 - 0
yami-shop-bean/src/main/java/com/yami/shop/bean/model/SysDictData.java

@@ -0,0 +1,68 @@
+package com.yami.shop.bean.model;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 字典数据表 sys_dict_data
+ *
+ * @author ruoyi
+ */
+@Data
+@TableName("sys_dict_data")
+public class SysDictData{
+    private static final long serialVersionUID = 2090714647038636896L;
+
+    /** 字典编码 */
+    private Long dictCode;
+
+    /** 字典排序 */
+    private Long dictSort;
+
+    /** 字典标签 */
+    private String dictLabel;
+
+    /** 字典键值 */
+    private String dictValue;
+
+    /** 字典类型 */
+    private String dictType;
+
+    /** 样式属性(其他样式扩展) */
+    private String cssClass;
+
+    /** 表格字典样式 */
+    private String listClass;
+
+    /** 是否默认(Y是 N否) */
+    private String isDefault;
+
+    /** 状态(0正常 1停用) */
+    private String status;
+
+    /** 搜索值 */
+    @JsonIgnore
+    private String searchValue;
+
+    /** 创建者 */
+    private String createBy;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    /** 更新者 */
+    private String updateBy;
+
+    /** 更新时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /** 备注 */
+    private String remark;
+
+}

+ 59 - 0
yami-shop-bean/src/main/java/com/yami/shop/bean/model/SysDictType.java

@@ -0,0 +1,59 @@
+package com.yami.shop.bean.model;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Data;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 字典类型表 sys_dict_type
+ *
+ * @author ruoyi
+ */
+@Data
+@TableName("sys_dict_type")
+public class SysDictType{
+    private static final long serialVersionUID = 2090714647038636896L;
+
+    /** 字典主键 */
+    private Long dictId;
+
+    /** 字典名称 */
+    private String dictName;
+
+    /** 字典类型 */
+    private String dictType;
+
+    /** 状态(0正常 1停用) */
+    private String status;
+
+    /** 搜索值 */
+    @JsonIgnore
+    private String searchValue;
+
+    /** 创建者 */
+    private String createBy;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    /** 更新者 */
+    private String updateBy;
+
+    /** 更新时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /** 备注 */
+    private String remark;
+
+}

+ 4 - 1
yami-shop-sys/src/main/java/com/yami/shop/sys/model/SysUser.java → yami-shop-bean/src/main/java/com/yami/shop/bean/model/SysUser.java

@@ -8,7 +8,7 @@
  * 版权所有,侵权必究!
  */
 
-package com.yami.shop.sys.model;
+package com.yami.shop.bean.model;
 
 
 import com.baomidou.mybatisplus.annotation.TableField;
@@ -86,6 +86,9 @@ public class SysUser implements Serializable {
 	 */
 	@TableField(exist=false)
 	private List<Dept> depts;
+	@TableField(exist=false)
+	private List<Long> deptIds;
+
 
 	/**
 	 * 创建时间

+ 76 - 0
yami-shop-bean/src/main/java/com/yami/shop/bean/vo/FrontCategoryVO.java

@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
+ *
+ * https://www.gz-yami.com/
+ *
+ * 未经允许,不可做商业用途!
+ *
+ * 版权所有,侵权必究!
+ */
+
+package com.yami.shop.bean.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class FrontCategoryVO{
+
+    /**
+     * 类目ID
+     */
+    private Long id;
+
+    /**
+     * 父类目ID
+     */
+    private Long pid;
+
+    /**
+     * 编码
+     */
+    private String code;
+
+    /**
+     * 分类名称
+     */
+    private String name;
+
+    /**
+     * 父级分类编码
+     */
+    private String parentCode;
+
+    /**
+     * 父级分类名称
+     */
+    private String parentName;
+
+    /**
+     * 序号
+     */
+    private Integer num;
+
+    /**
+     * 是否删除(0 正常 1 已被删除)
+     */
+    private Integer isDelete;
+
+    /**
+     * 类目等级(0-一级,1-二级,2-三级)
+     */
+    private Integer level;
+
+    /**
+     * 操作人
+     */
+    private String operateUser;
+
+    /**
+     * 是否叶子(1-是,2-不是)
+     */
+    private Integer isLeaves;
+
+    private List<FrontCategoryVO> children;
+}

+ 1 - 0
yami-shop-multishop/src/main/java/com/yami/shop/multishop/controller/CategoryController.java

@@ -19,6 +19,7 @@ import com.yami.shop.bean.model.Product;
 import com.yami.shop.bean.vo.ListCategoryVO;
 import com.yami.shop.common.annotation.SysLog;
 import com.yami.shop.common.config.Constant;
+import com.yami.shop.common.exception.GlobalException;
 import com.yami.shop.common.exception.YamiShopBindException;
 import com.yami.shop.security.multishop.util.SecurityUtils;
 import com.yami.shop.service.CategoryService;

+ 54 - 0
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/CategoryPropController.java

@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
+ *
+ * https://www.gz-yami.com/
+ *
+ * 未经允许,不可做商业用途!
+ *
+ * 版权所有,侵权必究!
+ */
+
+package com.yami.shop.platform.controller;
+
+import cn.hutool.core.collection.CollectionUtil;
+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.ListCategoryDTO;
+import com.yami.shop.bean.model.Category;
+import com.yami.shop.bean.model.Product;
+import com.yami.shop.bean.model.ShopDetail;
+import com.yami.shop.bean.vo.ListCategoryVO;
+import com.yami.shop.common.annotation.SysLog;
+import com.yami.shop.common.config.Constant;
+import com.yami.shop.common.util.R;
+import com.yami.shop.service.CategoryProdService;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+
+
+/**
+ * 分类绑定商品管理
+ *
+ * @author fbj
+ * @version 1.0.0
+ * @since 2025-9-26
+ */
+@RestController
+@RequestMapping("/platform/categoryProd")
+public class CategoryPropController {
+
+	@Autowired
+	private CategoryProdService categoryProdService;
+
+
+
+
+}

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

@@ -35,7 +35,7 @@ public class DeptUserController {
     @GetMapping("/listByUserId/{userId}")
     @ApiOperation(value = "根据用户ID获取部门用户关联列表", notes = "根据用户ID获取部门用户关联列表")
     @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "String", paramType = "path")
-    public R<List<DeptUser>> listByUserId(@PathVariable("userId") String userId) {
+    public R<List<DeptUser>> listByUserId(@PathVariable("userId") Long userId) {
         List<DeptUser> deptUserList = deptUserService.listByUserId(userId);
         return R.SUCCESS(deptUserList);
     }
@@ -64,7 +64,7 @@ public class DeptUserController {
     @PostMapping("/saveUserDepts")
     @ApiOperation(value = "保存用户部门关联", notes = "保存用户与部门的关联关系")
     public R<Boolean> saveUserDepts(
-            @RequestParam("userId") String userId,
+            @RequestParam("userId") Long userId,
             @RequestBody List<Long> deptIds) {
         Boolean result = deptUserService.saveUserDept(userId, deptIds);
         return R.SUCCESS(result);
@@ -80,7 +80,7 @@ public class DeptUserController {
     @PostMapping("/saveBatchUserDepts")
     @ApiOperation(value = "批量保存用户部门关联", notes = "批量保存用户与部门的关联关系")
     public R<Boolean> saveBatchUserDepts(
-            @RequestBody List<String> userIds,
+            @RequestBody List<Long> userIds,
             @RequestParam("deptId") Long deptId) {
         Boolean result = deptUserService.saveBatchUserDepts(userIds, deptId);
         return R.SUCCESS(result);
@@ -95,7 +95,7 @@ public class DeptUserController {
     @DeleteMapping("/deleteByUserId/{userId}")
     @ApiOperation(value = "根据用户ID删除部门用户关联", notes = "根据用户ID删除部门用户关联")
     @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "String", paramType = "path")
-    public R<Boolean> deleteByUserId(@PathVariable("userId") String userId) {
+    public R<Boolean> deleteByUserId(@PathVariable("userId") Long userId) {
         Boolean result = deptUserService.deleteByUserId(userId);
         return R.SUCCESS(result);
     }

+ 117 - 117
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/FileController.java

@@ -1,117 +1,117 @@
-/*
- * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
- *
- * https://www.gz-yami.com/
- *
- * 未经允许,不可做商业用途!
- *
- * 版权所有,侵权必究!
- */
-
-package com.yami.shop.platform.controller;
-
-import cn.hutool.core.io.FileUtil;
-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.model.AttachFile;
-import com.yami.shop.common.bean.Qiniu;
-import com.yami.shop.common.config.Constant;
-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.config.ShopConfig;
-import com.yami.shop.security.platform.util.SecurityUtils;
-import com.yami.shop.service.AttachFileService;
-import org.apache.ibatis.annotations.Delete;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.IOException;
-import java.util.Date;
-import java.util.Objects;
-import com.yami.shop.common.util.R;
-/**
- * 文件上传管理实现
- *
- * @author lgh
- * @version 1.0.0
- * @since 2018-11-26
- */
-@RestController
-@RequestMapping("/admin/file")
-public class FileController {
-
-	@Autowired
-	private AttachFileService attachFileService;
-	@Autowired
-	private ShopConfig shopConfig;
-
-	@PostMapping("/upload/element")
-	public R<String> uploadElementFile(@RequestParam("file") MultipartFile file) throws IOException{
-		if(file.isEmpty()){
-            return R.FAIL("文件不能为空");
-        }
-		String fileName = attachFileService.uploadFile(file.getBytes(),file.getOriginalFilename());
-        return R.SUCCESS(fileName);
-	}
-
-	@PostMapping("/upload/img")
-	public R<String> uploadImg(@RequestParam("file") MultipartFile file) throws IOException{
-		if(file.isEmpty()){
-			return R.FAIL("文件不能为空");
-		}
-		AttachFile attachFile = new AttachFile();
-		attachFile.setFileType(FileUtil.extName(file.getOriginalFilename()));
-		attachFile.setFileName(FileUtil.mainName(file.getOriginalFilename()));
-		attachFile.setType(1);
-		attachFile.setShopId(Constant.PLATFORM_SHOP_ID);
-		attachFile.setUploadTime(new Date());
-		String fileName = attachFileService.uploadImg(file.getBytes(),attachFile);
-		return R.SUCCESS(fileName);
-	}
-
-	@PostMapping("/upload/tinymceEditor")
-	public R<String> uploadTinymceEditorImages(@RequestParam("editorFile") MultipartFile editorFile) throws IOException{
-		String fileName =  attachFileService.uploadFile(editorFile.getBytes(),editorFile.getOriginalFilename());
-        return R.SUCCESS(shopConfig.getDomain().getResourcesDomainName() + "/" + fileName);
-	}
-
-	/**
-	 * 分页获取历史图片
-	 */
-	@GetMapping("/attachFilePage")
-	public R<IPage<AttachFile>> attachFilePage(PageParam<AttachFile> page, AttachFile attachFile) {
-		attachFile.setShopId(Constant.PLATFORM_SHOP_ID);
-		IPage<AttachFile> attachFilePage = attachFileService.getPage(page,attachFile);
-//		IPage<AttachFile> attachFilePage = attachFileService.page(page,new LambdaQueryWrapper<AttachFile>()
-//				.eq(AttachFile::getShopId,Constant.PLATFORM_SHOP_ID)
-//				.eq(AttachFile::getType,1)
-//				.like(StrUtil.isNotBlank(attachFile.getFileName()),AttachFile::getFileName,attachFile.getFileName())
-//				.orderByDesc(AttachFile::getUploadTime));
-		return R.SUCCESS(attachFilePage);
-	}
-	/**
-	 * 删除图片
-	 */
-	@DeleteMapping("/deleteFile/{fileId}")
-	public R<Void> deleteFile(@PathVariable("fileId") Long fileId){
-		AttachFile attachFile = attachFileService.getById(fileId);
-		attachFileService.deleteFile(attachFile.getFilePath());
-		return R.SUCCESS();
-	}
-
-
-	/**
-	 * 更改图片名称
-	 */
-	@PutMapping("/updateFileName")
-	public R<Boolean> updateFileName(@RequestBody  AttachFile attachFile) {
-		if (Objects.isNull(attachFile.getFileName())){
-			throw new GlobalException("图片名称不能为空");
-		}
-		return R.SUCCESS(attachFileService.updateFileName(attachFile));
-	}
-}
+/*
+ * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
+ *
+ * https://www.gz-yami.com/
+ *
+ * 未经允许,不可做商业用途!
+ *
+ * 版权所有,侵权必究!
+ */
+
+package com.yami.shop.platform.controller;
+
+import cn.hutool.core.io.FileUtil;
+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.model.AttachFile;
+import com.yami.shop.common.bean.Qiniu;
+import com.yami.shop.common.config.Constant;
+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.config.ShopConfig;
+import com.yami.shop.security.platform.util.SecurityUtils;
+import com.yami.shop.service.AttachFileService;
+import org.apache.ibatis.annotations.Delete;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.Date;
+import java.util.Objects;
+import com.yami.shop.common.util.R;
+/**
+ * 文件上传管理实现
+ *
+ * @author lgh
+ * @version 1.0.0
+ * @since 2018-11-26
+ */
+@RestController
+@RequestMapping("/admin/file")
+public class FileController {
+
+	@Autowired
+	private AttachFileService attachFileService;
+	@Autowired
+	private ShopConfig shopConfig;
+
+	@PostMapping("/upload/element")
+	public R<String> uploadElementFile(@RequestParam("file") MultipartFile file) throws IOException{
+		if(file.isEmpty()){
+            return R.FAIL("文件不能为空");
+        }
+		String fileName = attachFileService.uploadFile(file.getBytes(),file.getOriginalFilename());
+        return R.SUCCESS(fileName);
+	}
+
+	@PostMapping("/upload/img")
+	public R<String> uploadImg(@RequestParam("file") MultipartFile file) throws IOException{
+		if(file.isEmpty()){
+			return R.FAIL("文件不能为空");
+		}
+		AttachFile attachFile = new AttachFile();
+		attachFile.setFileType(FileUtil.extName(file.getOriginalFilename()));
+		attachFile.setFileName(FileUtil.mainName(file.getOriginalFilename()));
+		attachFile.setType(1);
+		attachFile.setShopId(Constant.PLATFORM_SHOP_ID);
+		attachFile.setUploadTime(new Date());
+		String fileName = attachFileService.uploadImg(file.getBytes(),attachFile);
+		return R.SUCCESS(fileName);
+	}
+
+	@PostMapping("/upload/tinymceEditor")
+	public R<String> uploadTinymceEditorImages(@RequestParam("editorFile") MultipartFile editorFile) throws IOException{
+		String fileName =  attachFileService.uploadFile(editorFile.getBytes(),editorFile.getOriginalFilename());
+        return R.SUCCESS(shopConfig.getDomain().getResourcesDomainName() + "/" + fileName);
+	}
+
+	/**
+	 * 分页获取历史图片
+	 */
+	@GetMapping("/attachFilePage")
+	public R<IPage<AttachFile>> attachFilePage(PageParam<AttachFile> page, AttachFile attachFile) {
+		attachFile.setShopId(Constant.PLATFORM_SHOP_ID);
+		IPage<AttachFile> attachFilePage = attachFileService.getPage(page,attachFile);
+//		IPage<AttachFile> attachFilePage = attachFileService.page(page,new LambdaQueryWrapper<AttachFile>()
+//				.eq(AttachFile::getShopId,Constant.PLATFORM_SHOP_ID)
+//				.eq(AttachFile::getType,1)
+//				.like(StrUtil.isNotBlank(attachFile.getFileName()),AttachFile::getFileName,attachFile.getFileName())
+//				.orderByDesc(AttachFile::getUploadTime));
+		return R.SUCCESS(attachFilePage);
+	}
+	/**
+	 * 删除图片
+	 */
+	@DeleteMapping("/deleteFile/{fileId}")
+	public R<Void> deleteFile(@PathVariable("fileId") Long fileId){
+		AttachFile attachFile = attachFileService.getById(fileId);
+		attachFileService.deleteFile(attachFile.getFilePath());
+		return R.SUCCESS();
+	}
+
+
+	/**
+	 * 更改图片名称
+	 */
+	@PutMapping("/updateFileName")
+	public R<Boolean> updateFileName(@RequestBody  AttachFile attachFile) {
+		if (Objects.isNull(attachFile.getFileName())){
+			throw new GlobalException("图片名称不能为空");
+		}
+		return R.SUCCESS(attachFileService.updateFileName(attachFile));
+	}
+}

+ 84 - 0
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/LabelController.java

@@ -0,0 +1,84 @@
+// LabelController.java
+package com.yami.shop.platform.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yami.shop.bean.model.Label;
+import com.yami.shop.common.util.PageParam;
+import com.yami.shop.common.util.R;
+import com.yami.shop.service.LabelService;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 标签 Controller
+ *
+ * @author fbj
+ * @since 2025-09-XX
+ */
+@Slf4j
+@RestController
+@RequestMapping("/platform/label")
+@AllArgsConstructor
+public class LabelController {
+
+    private final LabelService labelService;
+
+    /**
+     * 分页获取标签列表
+     */
+    @GetMapping("/page")
+    public R<IPage<Label>> page(PageParam<Label> pageParam) {
+        IPage<Label> page = labelService.page(pageParam);
+        return R.SUCCESS(page);
+    }
+
+    /**
+     * 获取全部标签
+     */
+    @GetMapping("/listAll")
+    public R<List<Label>> listAll() {
+        List<Label> list = labelService.list();
+        return R.SUCCESS(list);
+    }
+
+    /**
+     * 根据ID获取标签
+     */
+    @GetMapping("/{id}")
+    public R<Label> getById(@PathVariable Long id) {
+        Label label = labelService.getById(id);
+        return R.SUCCESS(label);
+    }
+
+    /**
+     * 添加标签
+     */
+    @PostMapping
+    public R<Void> save(@Valid @RequestBody Label label) {
+        labelService.save(label);
+        return R.SUCCESS();
+    }
+
+    /**
+     * 更新标签
+     */
+    @PutMapping
+    public R<Void> update(@Valid @RequestBody Label label) {
+        labelService.updateById(label);
+        return R.SUCCESS();
+    }
+
+    /**
+     * 删除标签
+     */
+    @DeleteMapping
+    public R<Void> delete(@RequestBody Long[] ids) {
+        labelService.removeByIds(Arrays.asList(ids));
+        return R.SUCCESS();
+    }
+}

+ 74 - 0
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/PointsFailureRecordController.java

@@ -0,0 +1,74 @@
+// PointsFailureRecordController.java
+package com.yami.shop.platform.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yami.shop.bean.model.PointsFailureRecord;
+import com.yami.shop.common.util.PageParam;
+import com.yami.shop.common.util.R;
+import com.yami.shop.service.PointsFailureRecordService;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.Arrays;
+
+/**
+ * 积分充值失败记录 Controller
+ *
+ * @author fbj
+ * @since 2025-09-XX
+ */
+@Slf4j
+@RestController
+@RequestMapping("/platform/pointsFailureRecord")
+@AllArgsConstructor
+public class PointsFailureRecordController {
+
+    private final PointsFailureRecordService pointsFailureRecordService;
+
+    /**
+     * 分页获取积分充值失败记录列表
+     */
+    @GetMapping("/page")
+    public R<IPage<PointsFailureRecord>> page(PageParam<PointsFailureRecord> pageParam) {
+        IPage<PointsFailureRecord> page = pointsFailureRecordService.page(pageParam);
+        return R.SUCCESS(page);
+    }
+
+    /**
+     * 根据ID获取积分充值失败记录
+     */
+    @GetMapping("/{id}")
+    public R<PointsFailureRecord> getById(@PathVariable Long id) {
+        PointsFailureRecord pointsFailureRecord = pointsFailureRecordService.getById(id);
+        return R.SUCCESS(pointsFailureRecord);
+    }
+
+    /**
+     * 添加积分充值失败记录
+     */
+    @PostMapping
+    public R<Void> save(@Valid @RequestBody PointsFailureRecord pointsFailureRecord) {
+        pointsFailureRecordService.save(pointsFailureRecord);
+        return R.SUCCESS();
+    }
+
+    /**
+     * 更新积分充值失败记录
+     */
+    @PutMapping
+    public R<Void> update(@Valid @RequestBody PointsFailureRecord pointsFailureRecord) {
+        pointsFailureRecordService.updateById(pointsFailureRecord);
+        return R.SUCCESS();
+    }
+
+    /**
+     * 删除积分充值失败记录
+     */
+    @DeleteMapping
+    public R<Void> delete(@RequestBody Long[] ids) {
+        pointsFailureRecordService.removeByIds(Arrays.asList(ids));
+        return R.SUCCESS();
+    }
+}

+ 108 - 0
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/PointsRechargeController.java

@@ -0,0 +1,108 @@
+// PointsRechargeController.java
+package com.yami.shop.platform.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yami.shop.bean.model.PointsRecharge;
+import com.yami.shop.common.util.PageParam;
+import com.yami.shop.common.util.R;
+import com.yami.shop.service.PointsRechargeService;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.util.Arrays;
+
+/**
+ * 积分充值 Controller
+ *
+ * @author fbj
+ * @since 2025-09-XX
+ */
+@Slf4j
+@RestController
+@RequestMapping("/platform/pointsRecharge")
+@AllArgsConstructor
+public class PointsRechargeController {
+
+    private final PointsRechargeService pointsRechargeService;
+
+    /**
+     * 分页获取积分充值列表
+     */
+    @GetMapping("/page")
+    public R<IPage<PointsRecharge>> page(PageParam<PointsRecharge> pageParam) {
+        IPage<PointsRecharge> page = pointsRechargeService.page(pageParam);
+        return R.SUCCESS(page);
+    }
+
+    /**
+     * 根据ID获取积分充值
+     */
+    @GetMapping("/{id}")
+    public R<PointsRecharge> getById(@PathVariable Long id) {
+        PointsRecharge pointsRecharge = pointsRechargeService.getById(id);
+        return R.SUCCESS(pointsRecharge);
+    }
+
+    /**
+     * 添加积分充值
+     */
+    @PostMapping
+    public R<Void> save(@Valid @RequestBody PointsRecharge pointsRecharge) {
+        pointsRechargeService.save(pointsRecharge);
+        return R.SUCCESS();
+    }
+
+    /**
+     * 更新积分充值
+     */
+    @PutMapping
+    public R<Void> update(@Valid @RequestBody PointsRecharge pointsRecharge) {
+        pointsRechargeService.updateById(pointsRecharge);
+        return R.SUCCESS();
+    }
+
+    /**
+     * 删除积分充值
+     */
+    @DeleteMapping
+    public R<Void> delete(@RequestBody Long[] ids) {
+        pointsRechargeService.removeByIds(Arrays.asList(ids));
+        return R.SUCCESS();
+    }
+
+
+    /**
+     * 导出积分充值导入模板
+     */
+    @GetMapping("/exportTemplate")
+    @ApiOperation(value = "导出积分充值导入模板", notes = "导出积分充值导入模板")
+    public void exportTemplate(HttpServletResponse response) {
+        try {
+            pointsRechargeService.exportTemplate(response);
+        } catch (Exception e) {
+            log.error("导出积分充值模板失败:", e);
+            throw new RuntimeException("导出模板失败:" + e.getMessage());
+        }
+    }
+
+    /**
+     * 导入积分充值数据
+     */
+    @PostMapping("/import")
+    @ApiOperation(value = "导入积分充值数据", notes = "导入积分充值数据")
+    public R<String> importPointsRecharge(@RequestParam("file") MultipartFile file) {
+        try {
+            String result = pointsRechargeService.importPointsRecharge(file);
+            return R.SUCCESS(result);
+        } catch (Exception e) {
+            log.error("导入积分充值数据失败:", e);
+            return R.FAIL("导入失败:" + e.getMessage());
+        }
+    }
+
+}

+ 74 - 0
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/PointsRecordController.java

@@ -0,0 +1,74 @@
+// PointsRecordController.java
+package com.yami.shop.platform.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.yami.shop.bean.model.PointsRecord;
+import com.yami.shop.common.util.PageParam;
+import com.yami.shop.common.util.R;
+import com.yami.shop.service.PointsRecordService;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.Arrays;
+
+/**
+ * 积分记录详细 Controller
+ *
+ * @author fbj
+ * @since 2025-09-XX
+ */
+@Slf4j
+@RestController
+@RequestMapping("/platform/pointsRecord")
+@AllArgsConstructor
+public class PointsRecordController {
+
+    private final PointsRecordService pointsRecordService;
+
+    /**
+     * 分页获取积分记录详细列表
+     */
+    @GetMapping("/page")
+    public R<IPage<PointsRecord>> page(PageParam<PointsRecord> pageParam) {
+        IPage<PointsRecord> page = pointsRecordService.page(pageParam);
+        return R.SUCCESS(page);
+    }
+
+    /**
+     * 根据ID获取积分记录详细
+     */
+    @GetMapping("/{id}")
+    public R<PointsRecord> getById(@PathVariable Long id) {
+        PointsRecord pointsRecord = pointsRecordService.getById(id);
+        return R.SUCCESS(pointsRecord);
+    }
+
+    /**
+     * 添加积分记录详细
+     */
+    @PostMapping
+    public R<Void> save(@Valid @RequestBody PointsRecord pointsRecord) {
+        pointsRecordService.save(pointsRecord);
+        return R.SUCCESS();
+    }
+
+    /**
+     * 更新积分记录详细
+     */
+    @PutMapping
+    public R<Void> update(@Valid @RequestBody PointsRecord pointsRecord) {
+        pointsRecordService.updateById(pointsRecord);
+        return R.SUCCESS();
+    }
+
+    /**
+     * 删除积分记录详细
+     */
+    @DeleteMapping
+    public R<Void> delete(@RequestBody Long[] ids) {
+        pointsRecordService.removeByIds(Arrays.asList(ids));
+        return R.SUCCESS();
+    }
+}

+ 194 - 0
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ShopCategoryController.java

@@ -0,0 +1,194 @@
+// 文件路径: com/yami/shop/platform/controller/ShopCategoryController.java
+package com.yami.shop.platform.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.model.FrontCategory;
+import com.yami.shop.bean.model.ShopCategory;
+import com.yami.shop.bean.vo.FrontCategoryVO;
+import com.yami.shop.common.util.PageParam;
+import com.yami.shop.common.util.R;
+import com.yami.shop.service.IShopCategoryService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 门店前台类目管理控制器
+ *
+ * @author YourName
+ * @since 2025-09-XX
+ */
+@Slf4j
+@RestController
+@RequestMapping("/platform/shopCategory")
+@Api(tags = "门店前台类目管理接口")
+@AllArgsConstructor
+public class ShopCategoryController {
+
+    private final IShopCategoryService shopCategoryService;
+
+    /**
+     * 分页查询门店前台类目列表
+     *
+     * @param pageParam 分页参数
+     * @param shopCategory 查询条件
+     * @return 分页结果
+     */
+    @GetMapping("/page")
+    @ApiOperation(value = "分页查询门店前台类目列表", notes = "分页查询门店前台类目列表")
+    public R<IPage<ShopCategory>> page(PageParam<ShopCategory> pageParam, ShopCategory shopCategory) {
+        IPage<ShopCategory> page = shopCategoryService.page(
+                pageParam,
+                new LambdaQueryWrapper<ShopCategory>()
+                        .like(shopCategory.getName() != null, ShopCategory::getName, shopCategory.getName())
+                        .eq(shopCategory.getShopId() != null, ShopCategory::getShopId, shopCategory.getShopId())
+                        .eq(shopCategory.getIsDelete() != null, ShopCategory::getIsDelete, shopCategory.getIsDelete())
+                        .orderByDesc(ShopCategory::getId)
+        );
+        return R.SUCCESS(page);
+    }
+
+    /**
+     * 获取未删除的门店前台类目列表
+     *
+     * @return 门店前台类目列表
+     */
+    @GetMapping("/list")
+    @ApiOperation(value = "获取未删除的门店前台类目列表", notes = "获取未删除的门店前台类目列表")
+    public R<List<ShopCategory>> list(
+            @RequestParam(required = false) Long shopId,
+            @RequestParam(required = false) String name) {
+        if (shopId == null) {
+            return R.FAIL("门店不能为空!");
+        }
+        return R.SUCCESS(shopCategoryService.treeShopCategory(shopId,name));
+    }
+
+
+    /**
+     * 导出门店前台类目导入模板
+     */
+    @GetMapping("/exportTemplate")
+    @ApiOperation(value = "导出门店前台类目导入模板", notes = "导出门店前台类目导入模板")
+    public void exportTemplate(HttpServletResponse response) {
+        try {
+            shopCategoryService.exportTemplate(response);
+        } catch (Exception e) {
+            log.error("导出模板失败:", e);
+            throw new RuntimeException("导出模板失败:" + e.getMessage());
+        }
+    }
+    /**
+     * 导入门店前台类目
+     *
+     */
+    @PostMapping("/import")
+    @ApiOperation(value = "导入门店前台类目", notes = "导入门店前台类目")
+    public R importCategory(@RequestParam("file") MultipartFile file) {
+        shopCategoryService.importCategory(file);
+        return R.SUCCESS();
+    }
+
+
+
+    /**
+     * 根据ID获取门店前台类目详情
+     *
+     * @param id 门店前台类目ID
+     * @return 门店前台类目详情
+     */
+    @GetMapping("/{id}")
+    @ApiOperation(value = "根据ID获取门店前台类目详情", notes = "根据ID获取门店前台类目详情")
+    @ApiImplicitParam(name = "id", value = "门店前台类目ID", required = true, dataType = "Long", paramType = "path")
+    public R<ShopCategory> getById(@PathVariable Long id) {
+        ShopCategory shopCategory = shopCategoryService.getById(id);
+        if (shopCategory == null || shopCategory.getIsDelete() == 1) {
+            return R.FAIL("门店前台类目不存在");
+        }
+        return R.SUCCESS(shopCategory);
+    }
+
+    /**
+     * 新增门店前台类目
+     *
+     * @param shopCategory 门店前台类目信息
+     * @return 操作结果
+     */
+    @PostMapping
+    @ApiOperation(value = "新增门店前台类目", notes = "新增门店前台类目")
+    public R<Void> save(@Valid @RequestBody ShopCategory shopCategory) {
+        // 设置默认值
+        shopCategory.setIsDelete(0);
+        boolean result = shopCategoryService.save(shopCategory);
+        if (result) {
+            return R.SUCCESS();
+        }
+        return R.FAIL("新增门店前台类目失败");
+    }
+
+    /**
+     * 修改门店前台类目
+     *
+     * @param shopCategory 门店前台类目信息
+     * @return 操作结果
+     */
+    @PutMapping
+    @ApiOperation(value = "修改门店前台类目", notes = "修改门店前台类目")
+    public R<Void> update(@Valid @RequestBody ShopCategory shopCategory) {
+        if (shopCategory.getId() == null) {
+            return R.FAIL("ID不能为空");
+        }
+
+        // 检查是否存在
+        ShopCategory dbShopCategory = shopCategoryService.getById(shopCategory.getId());
+        if (dbShopCategory == null) {
+            return R.FAIL("门店前台类目不存在");
+        }
+
+        boolean result = shopCategoryService.updateById(shopCategory);
+        if (result) {
+            return R.SUCCESS();
+        }
+        return R.FAIL("修改门店前台类目失败");
+    }
+
+    /**
+     * 删除门店前台类目(逻辑删除)
+     *
+     * @param id 门店前台类目ID
+     * @return 操作结果
+     */
+    @DeleteMapping("/{id}")
+    @ApiOperation(value = "删除门店前台类目", notes = "删除门店前台类目(逻辑删除)")
+    @ApiImplicitParam(name = "id", value = "门店前台类目ID", required = true, dataType = "Long", paramType = "path")
+    public R<Void> delete(@PathVariable Long id) {
+        // 检查是否存在
+        ShopCategory dbShopCategory = shopCategoryService.getById(id);
+        if (dbShopCategory == null) {
+            return R.FAIL("门店前台类目不存在");
+        }
+
+        // 逻辑删除
+        ShopCategory shopCategory = new ShopCategory();
+        shopCategory.setId(id);
+        shopCategory.setIsDelete(1);
+        boolean result = shopCategoryService.updateById(shopCategory);
+        if (result) {
+            return R.SUCCESS();
+        }
+        return R.FAIL("删除门店前台类目失败");
+    }
+
+
+
+}

+ 7 - 7
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ShopProdController.java → yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ShopSkuController.java

@@ -7,9 +7,9 @@
 
 package com.yami.shop.platform.controller;
 
-import com.yami.shop.bean.model.ShopProd;
+import com.yami.shop.bean.model.ShopSku;
 import com.yami.shop.common.util.R;
-import com.yami.shop.service.ShopProdService;
+import com.yami.shop.service.ShopSkuService;
 import lombok.AllArgsConstructor;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -26,18 +26,18 @@ import org.springframework.web.bind.annotation.RestController;
 @RestController
 @AllArgsConstructor
 @RequestMapping("/shop/shopProd")
-public class ShopProdController {
+public class ShopSkuController {
 
-    private final ShopProdService shopProdService;
+    private final ShopSkuService shopProdService;
 
 
     /**
      * 新建店铺
      */
     @PostMapping
-    public R<ShopProd> ShopProd(@RequestBody ShopProd shopProd) {
-        shopProdService.insertProd(shopProd);
-        return R.SUCCESS(shopProd);
+    public R<ShopSku> ShopProd(@RequestBody ShopSku shopSku) {
+        shopProdService.insertSku(shopSku);
+        return R.SUCCESS(shopSku);
     }
 
 

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

@@ -0,0 +1,107 @@
+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();
+    }
+}

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

@@ -0,0 +1,112 @@
+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);
+    }
+}

+ 2 - 3
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/hb/FrontCategoryController.java

@@ -2,8 +2,7 @@ package com.yami.shop.platform.controller.hb;
 
 import com.alibaba.fastjson.JSONObject;
 import com.yami.shop.common.util.hb.HBR;
-import com.yami.shop.service.hb.IFrontCategoryService;
-import io.swagger.annotations.Api;
+import com.yami.shop.service.hb.IHBFrontCategoryService;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.*;
@@ -22,7 +21,7 @@ import org.springframework.web.bind.annotation.*;
 @CrossOrigin
 public class FrontCategoryController {
 
-    private final IFrontCategoryService frontCategoryService;
+    private final IHBFrontCategoryService frontCategoryService;
 
     /**
      * 海博新增前台类目信息-回调

+ 2 - 8
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/hb/GoodsController.java

@@ -1,17 +1,11 @@
 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.Product;
-import com.yami.shop.common.util.R;
 import com.yami.shop.common.util.hb.HBR;
-import com.yami.shop.service.hb.IGoodsService;
-import io.swagger.annotations.Api;
+import com.yami.shop.service.hb.IHBGoodsService;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.*;
 
 /**
@@ -28,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
 @CrossOrigin
 public class GoodsController {
 
-    private final IGoodsService goodsService;
+    private final IHBGoodsService goodsService;
 
     /**
      * 海博新增商品信息-回调

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

@@ -1,6 +1,10 @@
 package com.yami.shop.platform.controller.hb;
 
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+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.common.util.hb.HBR;
 import com.yami.shop.service.hb.IStoreManagementService;
 import lombok.AllArgsConstructor;
@@ -33,7 +37,7 @@ public class StoreManagementController {
      */
     @PostMapping("/add")
     public HBR addRegisterStore(@RequestBody JSONObject HBRequest) {
-        log.info("海博添加门店{}",HBRequest);
+        log.info("海博添加门店{}", HBRequest);
         return HBR.success(storeManagementService.updateRegisterStore(HBRequest));
     }
 
@@ -45,10 +49,35 @@ public class StoreManagementController {
      */
     @PostMapping("/update")
     public HBR updateRegisterStore(@RequestBody JSONObject HBRequest) {
-        log.info("海博变更门店{}",HBRequest);
+        log.info("海博变更门店{}", HBRequest);
         return HBR.success(storeManagementService.updateRegisterStore(HBRequest));
     }
 
+    /**
+     * 条件获取门店列表信息
+     */
+    @GetMapping("/list")
+    public R<List<ShopDetail>> list(@ModelAttribute ShopDetail shopDetail) {
+        return R.SUCCESS(storeManagementService.list(shopDetail));
+    }
+
+    /**
+     * 分页获取门店列表信息
+     */
+    @GetMapping("/page")
+    public R<IPage<ShopDetail>> page(@ModelAttribute ShopDetail shopDetail, PageParam<ShopDetail> page) {
+        IPage<ShopDetail> shopDetailPage = storeManagementService.page(shopDetail, page);
+        return R.SUCCESS(shopDetailPage);
+    }
+
+
 
+    /**
+     * 获取门店详情
+     */
+    @GetMapping("/detail/{id}")
+    public R<ShopDetail> detail(@PathVariable("id") Long id ) {
+        return R.SUCCESS(storeManagementService.detail(id));
+    }
 
 }

+ 1 - 1
yami-shop-quartz/src/main/java/com/yami/shop/quartz/util/SpringBeanTaskUtil.java

@@ -25,7 +25,7 @@ import java.lang.reflect.Method;
  */
 @Slf4j
 public class SpringBeanTaskUtil {
-	
+
 	public static void invokeMethod(ScheduleJob scheduleJob) {
 		Object target = SpringContextUtils.getBean(scheduleJob.getBeanName());
 		try {

+ 1 - 0
yami-shop-security/yami-shop-security-platform/src/main/java/com/yami/shop/security/platform/config/ResourceServerConfiguration.java

@@ -50,6 +50,7 @@ public class ResourceServerConfiguration extends ResourceServerConfigurerAdapter
             .antMatchers(
                     "/webjars/**",
                     "/swagger/**",
+                    "/platform/**",
                     "/hb/**",
                     "/v2/api-docs",
                     "/doc.html",

+ 4 - 5
yami-shop-service/src/main/java/com/yami/shop/dao/CategoryPropMapper.java → yami-shop-service/src/main/java/com/yami/shop/dao/CategoryProdMapper.java

@@ -14,15 +14,14 @@ import java.util.List;
 
 import org.apache.ibatis.annotations.Param;
 
-import com.yami.shop.bean.model.CategoryProp;
+import com.yami.shop.bean.model.CategoryProd;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
-public interface CategoryPropMapper extends BaseMapper<CategoryProp> {
+public interface CategoryProdMapper extends BaseMapper<CategoryProd> {
 
-	void insertCategoryProp(@Param("categoryId") Long categoryId, @Param("propIds") List<Long> propIds);
 
 	void deleteByCategoryId(Long categoryId);
 
-	void deleteByPropId(Long propId);
-}
+	void deleteByProdId(Long prodId);
+}

+ 33 - 33
yami-shop-service/src/main/java/com/yami/shop/dao/ChannelMapper.java

@@ -1,33 +1,33 @@
-/*
- * 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.baomidou.mybatisplus.core.metadata.IPage;
-import com.yami.shop.bean.model.Channel;
-import com.yami.shop.bean.model.ChannelProd;
-import com.yami.shop.common.util.PageParam;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * 渠道管理Mapper接口
- */
-public interface ChannelMapper extends BaseMapper<ChannelProd> {
-
-    /**
-     * 通过渠道名称查询渠道
-     * @param channelName 渠道名称
-     * @return 渠道信息
-     */
-    Channel selectByName(@Param("channelName") String channelName);
-}
+/*
+ * 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.baomidou.mybatisplus.core.metadata.IPage;
+import com.yami.shop.bean.model.Channel;
+import com.yami.shop.bean.model.ChannelProd;
+import com.yami.shop.common.util.PageParam;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 渠道管理Mapper接口
+ */
+public interface ChannelMapper extends BaseMapper<Channel> {
+
+    /**
+     * 通过渠道名称查询渠道
+     * @param channelName 渠道名称
+     * @return 渠道信息
+     */
+    Channel selectByName(@Param("channelName") String channelName);
+}

+ 17 - 0
yami-shop-service/src/main/java/com/yami/shop/dao/ChannelShopMapper.java

@@ -0,0 +1,17 @@
+package com.yami.shop.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yami.shop.bean.model.ChannelShop;
+import com.yami.shop.bean.model.Dept;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 渠道门店Mapper接口
+ *
+ * @author
+ */
+public interface ChannelShopMapper extends BaseMapper<ChannelShop> {
+
+}

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

@@ -31,5 +31,7 @@ public interface DeptMapper extends BaseMapper<Dept> {
      * @param userId 用户ID
      * @return 部门列表
      */
-    List<Dept> selectDeptsByUserId(@Param("userId") String userId);
+    List<Dept> selectDeptsByUserId(@Param("userId") Long userId);
+
+    List<Dept> selectListAll();
 }

+ 2 - 2
yami-shop-service/src/main/java/com/yami/shop/dao/DeptUserMapper.java

@@ -18,7 +18,7 @@ public interface DeptUserMapper extends BaseMapper<DeptUser> {
      * @param userId 用户ID
      * @return 部门用户关联列表
      */
-    List<DeptUser> selectByUserId(@Param("userId") String userId);
+    List<DeptUser> selectByUserId(@Param("userId") Long userId);
 
     /**
      * 根据部门ID获取部门用户关联列表
@@ -39,7 +39,7 @@ public interface DeptUserMapper extends BaseMapper<DeptUser> {
      * @param userId 用户ID
      * @return 删除记录数
      */
-    int deleteByUserId(@Param("userId") String userId);
+    int deleteByUserId(@Param("userId") Long userId);
 
     /**
      * 根据部门ID删除部门用户关联

+ 2 - 0
yami-shop-service/src/main/java/com/yami/shop/dao/FrontCategoryMapper.java

@@ -10,6 +10,7 @@ package com.yami.shop.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.yami.shop.bean.model.FrontCategory;
 import com.yami.shop.bean.model.ShopWalletLog;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 海博前台类目
@@ -19,4 +20,5 @@ import com.yami.shop.bean.model.ShopWalletLog;
  */
 public interface FrontCategoryMapper extends BaseMapper<FrontCategory> {
 
+    FrontCategory selectListName(@Param("name") String name);
 }

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

@@ -0,0 +1,14 @@
+package com.yami.shop.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yami.shop.bean.model.Label;
+
+/**
+ * 标签 Mapper接口
+ *
+ * @author
+ * @since 2025-09-XX
+ */
+public interface LabelMapper extends BaseMapper<Label> {
+
+}

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

@@ -0,0 +1,14 @@
+package com.yami.shop.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yami.shop.bean.model.PointsFailureRecord;
+
+/**
+ * 积分充值失败记录 Mapper接口
+ *
+ * @author
+ * @since 2025-09-XX
+ */
+public interface PointsFailureRecordMapper extends BaseMapper<PointsFailureRecord> {
+
+}

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

@@ -0,0 +1,14 @@
+package com.yami.shop.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yami.shop.bean.model.PointsRecharge;
+
+/**
+ * 积分充值 Mapper接口
+ *
+ * @author
+ * @since 2025-09-XX
+ */
+public interface PointsRechargeMapper extends BaseMapper<PointsRecharge> {
+
+}

+ 15 - 0
yami-shop-service/src/main/java/com/yami/shop/dao/PointsRecordMapper.java

@@ -0,0 +1,15 @@
+// 文件路径: com/yami/shop/dao/PointsRecordMapper.java
+package com.yami.shop.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yami.shop.bean.model.PointsRecord;
+
+/**
+ * 积分记录详细 Mapper接口
+ *
+ * @author
+ * @since 2025-09-XX
+ */
+public interface PointsRecordMapper extends BaseMapper<PointsRecord> {
+
+}

+ 35 - 0
yami-shop-service/src/main/java/com/yami/shop/dao/ShopCategoryMapper.java

@@ -0,0 +1,35 @@
+/*
+ * 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.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.yami.shop.bean.app.dto.ShopHeadInfoDto;
+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.util.PageParam;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author LGH
+ */
+public interface ShopCategoryMapper extends BaseMapper<ShopCategory> {
+
+
+    /**
+     * 获取店铺分类
+     * @return 店铺分类
+     */
+    List<FrontCategoryVO> treeShopCategory();
+}

+ 3 - 3
yami-shop-service/src/main/java/com/yami/shop/dao/ShopProdMapper.java → yami-shop-service/src/main/java/com/yami/shop/dao/ShopSkuMapper.java

@@ -11,13 +11,13 @@
 package com.yami.shop.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.yami.shop.bean.model.ShopProd;
+import com.yami.shop.bean.model.ShopSku;
 import org.apache.ibatis.annotations.Param;
 
 /**
  * @author LGH
  */
-public interface ShopProdMapper extends BaseMapper<ShopProd> {
+public interface ShopSkuMapper extends BaseMapper<ShopSku> {
 
-    ShopProd selectByShopAndProd(@Param("skuId") Long skuId, @Param("shopId") Long shopId);
+    ShopSku selectByShopAndProd(@Param("skuId") Long skuId, @Param("shopId") Long shopId);
 }

+ 96 - 0
yami-shop-service/src/main/java/com/yami/shop/dao/SysDictDataMapper.java

@@ -0,0 +1,96 @@
+package com.yami.shop.dao;
+
+import com.yami.shop.bean.model.SysDictData;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 字典表 数据层
+ *
+ * @author ruoyi
+ */
+public interface SysDictDataMapper
+{
+    /**
+     * 根据条件分页查询字典数据
+     *
+     * @param dictData 字典数据信息
+     * @return 字典数据集合信息
+     */
+    public List<SysDictData> selectDictDataList(SysDictData dictData);
+
+    /**
+     * 根据字典类型查询字典数据
+     *
+     * @param dictType 字典类型
+     * @return 字典数据集合信息
+     */
+    public List<SysDictData> selectDictDataByType(String dictType);
+
+    /**
+     * 根据字典类型和字典键值查询字典数据信息
+     *
+     * @param dictType 字典类型
+     * @param dictValue 字典键值
+     * @return 字典标签
+     */
+    public String selectDictLabel(@Param("dictType") String dictType, @Param("dictValue") String dictValue);
+
+    /**
+     * 根据字典数据ID查询信息
+     *
+     * @param dictCode 字典数据ID
+     * @return 字典数据
+     */
+    public SysDictData selectDictDataById(Long dictCode);
+
+    /**
+     * 查询字典数据
+     *
+     * @param dictType 字典类型
+     * @return 字典数据
+     */
+    public int countDictDataByType(String dictType);
+
+    /**
+     * 通过字典ID删除字典数据信息
+     *
+     * @param dictCode 字典数据ID
+     * @return 结果
+     */
+    public int deleteDictDataById(Long dictCode);
+
+    /**
+     * 批量删除字典数据信息
+     *
+     * @param dictCodes 需要删除的字典数据ID
+     * @return 结果
+     */
+    public int deleteDictDataByIds(Long[] dictCodes);
+
+    /**
+     * 新增字典数据信息
+     *
+     * @param dictData 字典数据信息
+     * @return 结果
+     */
+    public int insertDictData(SysDictData dictData);
+
+    /**
+     * 修改字典数据信息
+     *
+     * @param dictData 字典数据信息
+     * @return 结果
+     */
+    public int updateDictData(SysDictData dictData);
+
+    /**
+     * 同步修改字典类型
+     *
+     * @param oldDictType 旧字典类型
+     * @param newDictType 新旧字典类型
+     * @return 结果
+     */
+    public int updateDictDataType(@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType);
+}

+ 85 - 0
yami-shop-service/src/main/java/com/yami/shop/dao/SysDictTypeMapper.java

@@ -0,0 +1,85 @@
+package com.yami.shop.dao;
+
+
+import com.yami.shop.bean.model.SysDictType;
+
+import java.util.List;
+
+/**
+ * 字典表 数据层
+ *
+ * @author ruoyi
+ */
+public interface SysDictTypeMapper
+{
+    /**
+     * 根据条件分页查询字典类型
+     *
+     * @param dictType 字典类型信息
+     * @return 字典类型集合信息
+     */
+    public List<SysDictType> selectDictTypeList(SysDictType dictType);
+
+    /**
+     * 根据所有字典类型
+     *
+     * @return 字典类型集合信息
+     */
+    public List<SysDictType> selectDictTypeAll();
+
+    /**
+     * 根据字典类型ID查询信息
+     *
+     * @param dictId 字典类型ID
+     * @return 字典类型
+     */
+    public SysDictType selectDictTypeById(Long dictId);
+
+    /**
+     * 根据字典类型查询信息
+     *
+     * @param dictType 字典类型
+     * @return 字典类型
+     */
+    public SysDictType selectDictTypeByType(String dictType);
+
+    /**
+     * 通过字典ID删除字典信息
+     *
+     * @param dictId 字典ID
+     * @return 结果
+     */
+    public int deleteDictTypeById(Long dictId);
+
+    /**
+     * 批量删除字典类型信息
+     *
+     * @param dictIds 需要删除的字典ID
+     * @return 结果
+     */
+    public int deleteDictTypeByIds(Long[] dictIds);
+
+    /**
+     * 新增字典类型信息
+     *
+     * @param dictType 字典类型信息
+     * @return 结果
+     */
+    public int insertDictType(SysDictType dictType);
+
+    /**
+     * 修改字典类型信息
+     *
+     * @param dictType 字典类型信息
+     * @return 结果
+     */
+    public int updateDictType(SysDictType dictType);
+
+    /**
+     * 校验字典类型称是否唯一
+     *
+     * @param dictType 字典类型
+     * @return 结果
+     */
+    public SysDictType checkDictTypeUnique(String dictType);
+}

+ 23 - 0
yami-shop-service/src/main/java/com/yami/shop/dao/TzSysUserMapper.java

@@ -0,0 +1,23 @@
+/*
+ * 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.SysUser;
+
+import java.util.List;
+
+/**
+ * 系统用户
+ */
+public interface TzSysUserMapper extends BaseMapper<SysUser> {
+
+}

+ 2 - 2
yami-shop-service/src/main/java/com/yami/shop/service/CategoryPropService.java → yami-shop-service/src/main/java/com/yami/shop/service/CategoryProdService.java

@@ -11,12 +11,12 @@
 package com.yami.shop.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.yami.shop.bean.model.CategoryProp;
+import com.yami.shop.bean.model.CategoryProd;
 
 /**
  *
  * Created by lgh on 2018/07/13.
  */
-public interface CategoryPropService extends IService<CategoryProp> {
+public interface CategoryProdService extends IService<CategoryProd> {
 
 }

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

@@ -57,5 +57,5 @@ public interface DeptService extends IService<Dept> {
      * @param userId 用户ID
      * @return 部门列表
      */
-    List<Dept> listDeptsByUserId(String userId);
+    List<Dept> listDeptsByUserId(Long userId);
 }

+ 4 - 4
yami-shop-service/src/main/java/com/yami/shop/service/DeptUserService.java

@@ -17,7 +17,7 @@ public interface DeptUserService extends IService<DeptUser> {
      * @param userId 用户ID
      * @return 部门用户关联列表
      */
-    List<DeptUser> listByUserId(String userId);
+    List<DeptUser> listByUserId(Long userId);
 
     /**
      * 根据部门ID获取部门用户关联列表
@@ -32,14 +32,14 @@ public interface DeptUserService extends IService<DeptUser> {
      * @param deptIds 部门ID列表
      * @return 保存结果
      */
-    boolean saveUserDept(String userId, List<Long> deptIds);
+    boolean saveUserDept(Long userId, List<Long> deptIds);
 
     /**
      * 根据用户ID删除部门用户关联
      * @param userId 用户ID
      * @return 删除结果
      */
-    boolean deleteByUserId(String userId);
+    boolean deleteByUserId(Long userId);
 
     /**
      * 根据部门ID删除部门用户关联
@@ -54,5 +54,5 @@ public interface DeptUserService extends IService<DeptUser> {
      * @param deptId 部门ID
      * @return 保存结果
      */
-    boolean saveBatchUserDepts(List<String> userIds, Long deptId);
+    boolean saveBatchUserDepts(List<Long> userIds, Long deptId);
 }

+ 18 - 0
yami-shop-service/src/main/java/com/yami/shop/service/IFrontCategoryService.java

@@ -0,0 +1,18 @@
+package com.yami.shop.service;
+
+import com.yami.shop.bean.model.FrontCategory;
+
+import java.util.List;
+
+/**
+ * 前台类目管理服务接口
+ *
+ * @author fubojin
+ * @version 1.0.0
+ * @since 2025-09-4
+ */
+public interface IFrontCategoryService {
+
+
+
+}

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

@@ -0,0 +1,40 @@
+package com.yami.shop.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yami.shop.bean.model.FrontCategory;
+import com.yami.shop.bean.model.ShopCategory;
+import com.yami.shop.bean.vo.FrontCategoryVO;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+
+/**
+ * 门店前台类目服务接口
+ *
+ * @author YourName
+ * @since 2025-09-XX
+ */
+public interface IShopCategoryService extends IService<ShopCategory> {
+    /**
+     * 查询全部(树形)
+     * @return List<FrontCategory>
+     */
+    List<ShopCategory> treeShopCategory(Long shopId,
+                                          String name);
+
+    /**
+     * 导出门店前台类目导入模板
+     *
+     * @param response HTTP响应对象
+     * @throws Exception 导出异常
+     */
+    void exportTemplate(HttpServletResponse response) throws Exception;
+    /**
+     * 导入类目
+     * @param file  文件
+     */
+    void importCategory(MultipartFile file);
+}

+ 61 - 0
yami-shop-service/src/main/java/com/yami/shop/service/ISysDictDataService.java

@@ -0,0 +1,61 @@
+package com.yami.shop.service;
+
+import com.yami.shop.bean.model.SysDictData;
+
+import java.util.List;
+
+/**
+ * 字典 业务层
+ *
+ * @author ruoyi
+ */
+public interface ISysDictDataService
+{
+    /**
+     * 根据条件分页查询字典数据
+     *
+     * @param dictData 字典数据信息
+     * @return 字典数据集合信息
+     */
+    public List<SysDictData> selectDictDataList(SysDictData dictData);
+
+    /**
+     * 根据字典类型和字典键值查询字典数据信息
+     *
+     * @param dictType 字典类型
+     * @param dictValue 字典键值
+     * @return 字典标签
+     */
+    public String selectDictLabel(String dictType, String dictValue);
+
+    /**
+     * 根据字典数据ID查询信息
+     *
+     * @param dictCode 字典数据ID
+     * @return 字典数据
+     */
+    public SysDictData selectDictDataById(Long dictCode);
+
+    /**
+     * 批量删除字典数据信息
+     *
+     * @param dictCodes 需要删除的字典数据ID
+     */
+    public void deleteDictDataByIds(Long[] dictCodes);
+
+    /**
+     * 新增保存字典数据信息
+     *
+     * @param dictData 字典数据信息
+     * @return 结果
+     */
+    public int insertDictData(SysDictData dictData);
+
+    /**
+     * 修改保存字典数据信息
+     *
+     * @param dictData 字典数据信息
+     * @return 结果
+     */
+    public int updateDictData(SysDictData dictData);
+}

+ 99 - 0
yami-shop-service/src/main/java/com/yami/shop/service/ISysDictTypeService.java

@@ -0,0 +1,99 @@
+package com.yami.shop.service;
+
+import com.yami.shop.bean.model.SysDictData;
+import com.yami.shop.bean.model.SysDictType;
+
+import java.util.List;
+
+/**
+ * 字典 业务层
+ *
+ * @author ruoyi
+ */
+public interface ISysDictTypeService
+{
+    /**
+     * 根据条件分页查询字典类型
+     *
+     * @param dictType 字典类型信息
+     * @return 字典类型集合信息
+     */
+    public List<SysDictType> selectDictTypeList(SysDictType dictType);
+
+    /**
+     * 根据所有字典类型
+     *
+     * @return 字典类型集合信息
+     */
+    public List<SysDictType> selectDictTypeAll();
+
+    /**
+     * 根据字典类型查询字典数据
+     *
+     * @param dictType 字典类型
+     * @return 字典数据集合信息
+     */
+    public List<SysDictData> selectDictDataByType(String dictType);
+
+    /**
+     * 根据字典类型ID查询信息
+     *
+     * @param dictId 字典类型ID
+     * @return 字典类型
+     */
+    public SysDictType selectDictTypeById(Long dictId);
+
+    /**
+     * 根据字典类型查询信息
+     *
+     * @param dictType 字典类型
+     * @return 字典类型
+     */
+    public SysDictType selectDictTypeByType(String dictType);
+
+    /**
+     * 批量删除字典信息
+     *
+     * @param dictIds 需要删除的字典ID
+     */
+    public void deleteDictTypeByIds(Long[] dictIds);
+
+    /**
+     * 加载字典缓存数据
+     */
+    public void loadingDictCache();
+
+    /**
+     * 清空字典缓存数据
+     */
+    public void clearDictCache();
+
+    /**
+     * 重置字典缓存数据
+     */
+    public void resetDictCache();
+
+    /**
+     * 新增保存字典类型信息
+     *
+     * @param dictType 字典类型信息
+     * @return 结果
+     */
+    public int insertDictType(SysDictType dictType);
+
+    /**
+     * 修改保存字典类型信息
+     *
+     * @param dictType 字典类型信息
+     * @return 结果
+     */
+    public int updateDictType(SysDictType dictType);
+
+    /**
+     * 校验字典类型称是否唯一
+     *
+     * @param dictType 字典类型
+     * @return 结果
+     */
+    public boolean checkDictTypeUnique(SysDictType dictType);
+}

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

@@ -0,0 +1,14 @@
+package com.yami.shop.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yami.shop.bean.model.Label;
+
+/**
+ * 标签Service接口
+ *
+ * @author fbj
+ * @since 2025-09-XX
+ */
+public interface LabelService extends IService<Label> {
+
+}

+ 15 - 0
yami-shop-service/src/main/java/com/yami/shop/service/PointsFailureRecordService.java

@@ -0,0 +1,15 @@
+// PointsFailureRecordService.java
+package com.yami.shop.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yami.shop.bean.model.PointsFailureRecord;
+
+/**
+ * 积分充值失败记录 Service接口
+ *
+ * @author fbj
+ * @since 2025-09-XX
+ */
+public interface PointsFailureRecordService extends IService<PointsFailureRecord> {
+
+}

+ 31 - 0
yami-shop-service/src/main/java/com/yami/shop/service/PointsRechargeService.java

@@ -0,0 +1,31 @@
+// PointsRechargeService.java
+package com.yami.shop.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yami.shop.bean.model.PointsRecharge;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 积分充值 Service接口
+ *
+ * @author fbj
+ * @since 2025-09-XX
+ */
+public interface PointsRechargeService extends IService<PointsRecharge> {
+    /**
+     * 导出积分充值导入模板
+     * @param response HTTP响应对象
+     * @throws Exception 导出异常
+     */
+    void exportTemplate(HttpServletResponse response) throws Exception;
+
+    /**
+     * 导入积分充值数据
+     * @param file 导入文件
+     * @return 导入结果
+     * @throws Exception 导入异常
+     */
+    String importPointsRecharge(MultipartFile file) throws Exception;
+}

+ 15 - 0
yami-shop-service/src/main/java/com/yami/shop/service/PointsRecordService.java

@@ -0,0 +1,15 @@
+// PointsRecordService.java
+package com.yami.shop.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yami.shop.bean.model.PointsRecord;
+
+/**
+ * 积分记录详细 Service接口
+ *
+ * @author fbj
+ * @since 2025-09-XX
+ */
+public interface PointsRecordService extends IService<PointsRecord> {
+
+}

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

@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
- *
- * https://www.gz-yami.com/
- *
- * 未经允许,不可做商业用途!
- *
- * 版权所有,侵权必究!
- */
-
-package com.yami.shop.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.yami.shop.bean.model.ShopProd;
-
-/**
- * 门店对应商品价格和库存管理
- */
-public interface ShopProdService extends IService<ShopProd> {
-
-    void insertProd(ShopProd shopProd);
-}

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

@@ -0,0 +1,13 @@
+
+package com.yami.shop.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yami.shop.bean.model.ShopSku;
+
+/**
+ * 门店对应商品价格和库存管理
+ */
+public interface ShopSkuService extends IService<ShopSku> {
+
+    void insertSku(ShopSku shopSku);
+}

+ 29 - 29
yami-shop-service/src/main/java/com/yami/shop/service/hb/IFrontCategoryService.java → yami-shop-service/src/main/java/com/yami/shop/service/hb/IHBFrontCategoryService.java

@@ -1,29 +1,29 @@
-package com.yami.shop.service.hb;
-
-import com.alibaba.fastjson.JSONObject;
-import com.yami.shop.common.util.hb.HBR;
-
-/**
- * 前台类目管理服务接口
- *
- * @author fubojin
- * @version 1.0.0
- * @since 2025-09-4
- */
-public interface IFrontCategoryService {
-
-
-    /**
-     * 前台分类新增或者修改
-     *
-     * @param hbRequest 前台分类请求
-     * @return 前台分类响应
-     */
-    HBR addHBFrontCategory(JSONObject hbRequest);
-
-    /**
-     * 删除海博前台分类
-     * @param hbRequest
-     */
-    void deleteFrontCategory(JSONObject hbRequest);
-}
+package com.yami.shop.service.hb;
+
+import com.alibaba.fastjson.JSONObject;
+import com.yami.shop.common.util.hb.HBR;
+
+/**
+ * 前台类目管理服务接口
+ *
+ * @author fubojin
+ * @version 1.0.0
+ * @since 2025-09-4
+ */
+public interface IHBFrontCategoryService {
+
+
+    /**
+     * 前台分类新增或者修改
+     *
+     * @param hbRequest 前台分类请求
+     * @return 前台分类响应
+     */
+    HBR addHBFrontCategory(JSONObject hbRequest);
+
+    /**
+     * 删除海博前台分类
+     * @param hbRequest
+     */
+    void deleteFrontCategory(JSONObject hbRequest);
+}

+ 1 - 1
yami-shop-service/src/main/java/com/yami/shop/service/hb/IGoodsService.java → yami-shop-service/src/main/java/com/yami/shop/service/hb/IHBGoodsService.java

@@ -13,7 +13,7 @@ import com.yami.shop.common.util.hb.HBR;
  * @version 1.0.0
  * @since 2025-09-5
  */
-public interface IGoodsService {
+public interface IHBGoodsService {
 
 
     /**

+ 1 - 1
yami-shop-service/src/main/java/com/yami/shop/service/hb/IOrderService.java → yami-shop-service/src/main/java/com/yami/shop/service/hb/IHBOrderService.java

@@ -10,7 +10,7 @@ import com.yami.shop.common.util.hb.HBR;
  * @version 1.0.0
  * @since 2025-09-5
  */
-public interface IOrderService {
+public interface IHBOrderService {
 
 
 

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

@@ -1,7 +1,10 @@
 package com.yami.shop.service.hb;
 
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.yami.shop.bean.dto.hb.StoreRegister;
+import com.yami.shop.bean.model.ShopDetail;
+import com.yami.shop.common.util.PageParam;
 import com.yami.shop.common.util.hb.HBR;
 
 import java.util.List;
@@ -37,4 +40,28 @@ public interface IStoreManagementService {
      */
     HBR updateRegisterStore(JSONObject registerRequest);
 
+
+
+    /**
+     * 获取门店列表
+     *
+     * @return 门店列表
+     */
+    List<ShopDetail> list(ShopDetail shopDetail);
+
+    /**
+     * 获取门店详情
+     *
+     * @param id 门店ID
+     * @return 门店详情
+     */
+    ShopDetail detail(Long id);
+
+    /**
+     * 获取门店列表
+     * @param shopDetail 查询参数
+     * @param page 分页参数
+     * @return 门店列表
+     */
+    IPage<ShopDetail> page(ShopDetail shopDetail, PageParam<ShopDetail> page);
 }

+ 108 - 109
yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/FrontCategoryService.java → yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/HBFrontCategoryService.java

@@ -1,109 +1,108 @@
-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.yami.shop.bean.dto.hb.HBBaseReq;
-import com.yami.shop.bean.model.FrontCategory;
-import com.yami.shop.common.util.hb.HBR;
-import com.yami.shop.dao.FrontCategoryMapper;
-import com.yami.shop.service.hb.IFrontCategoryService;
-import com.yami.shop.utils.HBSignUtil;
-import lombok.AllArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.IntStream;
-
-import static com.yami.shop.common.util.HttpUtil.post;
-
-
-/**
- * 前台类目管理服务实现
- *
- * @author fubojin
- * @version 1.0.0
- * @since 2025-09-1
- */
-@Slf4j
-@Service
-@AllArgsConstructor
-@Transactional(readOnly = true)
-public class FrontCategoryService implements IFrontCategoryService {
-    private final FrontCategoryMapper frontCategoryMapper;
-    private final HBSignUtil hbSignUtil;
-
-
-    @Override
-    @Transactional
-    public HBR addHBFrontCategory(JSONObject hbRequest) {
-        try {
-            String bodyStr = hbRequest.getString("body");
-            log.info("开始前台分类,body:{}", bodyStr);
-            JSONObject bodyJson = JSON.parseObject(bodyStr); // 使用Fastjson的解析方法
-            JSONArray codeList = bodyJson.getJSONArray("codeList");
-            List<String> resultList = IntStream.range(0, codeList.size())
-                    .mapToObj(codeList::getString)
-                    .collect(Collectors.toList());
-
-            String info = selectHBFrontCategory(resultList);
-            JSONObject jsonObject = JSON.parseObject(info);
-            JSONObject jsonObjectHB = jsonObject.getJSONObject("result");
-            JSONObject result = jsonObjectHB.getJSONObject("result");
-            JSONArray resultArray = result.getJSONArray("categoryInfos");
-            for (Object o : resultArray) {
-                JSONObject jsonObjectInfo = JSON.parseObject(o.toString());
-                // 2. 构建实体
-                FrontCategory frontCategory = new FrontCategory();
-                frontCategory.setCode(jsonObjectInfo.getString("code"));
-                frontCategory.setParentCode(jsonObjectInfo.getString("parentCode"));
-                frontCategory.setName(jsonObjectInfo.getString("name"));
-                frontCategory.setParentName(jsonObjectInfo.getString("parentName"));
-                frontCategory.setNum(jsonObjectInfo.getInteger("num"));
-                frontCategory.setLevel(jsonObjectInfo.getInteger("level"));
-                frontCategory.setOperateUser(jsonObjectInfo.getString("operateUser"));
-                frontCategory.setIsLeaves(jsonObjectInfo.getInteger("isLeaves"));
-                log.info("添加前台类目信息{}",frontCategory);
-                // 3. 保存门店信息
-                frontCategoryMapper.insert(frontCategory);
-            }
-            log.info("前台分类成功");
-            // 4. 构建响应
-            return HBR.success();
-        } catch (Exception e) {
-            log.error("前台分类失败:{}", e.getMessage(), e);
-            return HBR.error("未知异常");
-        }
-    }
-
-    public String selectHBFrontCategory(List<String> resultList) {
-        HBBaseReq<Object> build = HBBaseReq.create();
-        build.setAppId(hbSignUtil.getAppId());
-        JSONObject jsonObject = new JSONObject();
-        jsonObject.put("flag", 1);
-        jsonObject.put("codeList", resultList);
-        build.setBody(JSON.toJSONString(jsonObject));
-        build.setSign(hbSignUtil.signMd5(build));
-        String post = post(hbSignUtil.getHBHost() + "/api/product/frontCategory/getCategory", build);
-        log.info("post 请求参数:{}", JSON.toJSONString(build));
-        log.info("post 结果:{}", post);
-        return post;
-    }
-
-    @Override
-    public void deleteFrontCategory(JSONObject hbRequest) {
-        String bodyStr = hbRequest.getString("body");
-        JSONObject jsonObject = JSON.parseObject("bodyStr");
-        log.info("前台类目删除,body:{}", bodyStr);
-        List<FrontCategory> frontCategorys = frontCategoryMapper.selectList(new LambdaQueryWrapper<FrontCategory>().eq(FrontCategory::getCode,jsonObject.getLong("code")));
-        for (FrontCategory frontCategory : frontCategorys) {
-            frontCategory.setIsDelete(1);
-            frontCategoryMapper.updateById(frontCategory);
-        }
-    }
-}
+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.yami.shop.bean.dto.hb.HBBaseReq;
+import com.yami.shop.bean.model.FrontCategory;
+import com.yami.shop.common.util.hb.HBR;
+import com.yami.shop.dao.FrontCategoryMapper;
+import com.yami.shop.service.hb.IHBFrontCategoryService;
+import com.yami.shop.utils.HBSignUtil;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+import static com.yami.shop.common.util.HttpUtil.post;
+
+
+/**
+ * 前台类目管理服务实现
+ *
+ * @author fubojin
+ * @version 1.0.0
+ * @since 2025-09-1
+ */
+@Slf4j
+@Service
+@AllArgsConstructor
+@Transactional(readOnly = true)
+public class HBFrontCategoryService implements IHBFrontCategoryService {
+    private final FrontCategoryMapper frontCategoryMapper;
+    private final HBSignUtil hbSignUtil;
+
+
+    @Override
+    @Transactional
+    public HBR addHBFrontCategory(JSONObject hbRequest) {
+        try {
+            String bodyStr = hbRequest.getString("body");
+            log.info("开始前台分类,body:{}", bodyStr);
+            JSONObject bodyJson = JSON.parseObject(bodyStr); // 使用Fastjson的解析方法
+            JSONArray codeList = bodyJson.getJSONArray("codeList");
+            List<String> resultList = IntStream.range(0, codeList.size())
+                    .mapToObj(codeList::getString)
+                    .collect(Collectors.toList());
+
+            String info = selectHBFrontCategory(resultList);
+            JSONObject jsonObject = JSON.parseObject(info);
+            JSONObject jsonObjectHB = jsonObject.getJSONObject("result");
+            JSONObject result = jsonObjectHB.getJSONObject("result");
+            JSONArray resultArray = result.getJSONArray("categoryInfos");
+            for (Object o : resultArray) {
+                JSONObject jsonObjectInfo = JSON.parseObject(o.toString());
+                // 2. 构建实体
+                FrontCategory frontCategory = new FrontCategory();
+                frontCategory.setCode(jsonObjectInfo.getString("code"));
+                frontCategory.setParentCode(jsonObjectInfo.getString("parentCode"));
+                frontCategory.setName(jsonObjectInfo.getString("name"));
+                frontCategory.setParentName(jsonObjectInfo.getString("parentName"));
+                frontCategory.setNum(jsonObjectInfo.getInteger("num"));
+                frontCategory.setLevel(jsonObjectInfo.getInteger("level"));
+                frontCategory.setOperateUser(jsonObjectInfo.getString("operateUser"));
+                frontCategory.setIsLeaves(jsonObjectInfo.getInteger("isLeaves"));
+                log.info("添加前台类目信息{}",frontCategory);
+                // 3. 保存门店信息
+                frontCategoryMapper.insert(frontCategory);
+            }
+            log.info("前台分类成功");
+            // 4. 构建响应
+            return HBR.success();
+        } catch (Exception e) {
+            log.error("前台分类失败:{}", e.getMessage(), e);
+            return HBR.error("未知异常");
+        }
+    }
+
+    public String selectHBFrontCategory(List<String> resultList) {
+        HBBaseReq<Object> build = HBBaseReq.create();
+        build.setAppId(hbSignUtil.getAppId());
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("flag", 1);
+        jsonObject.put("codeList", resultList);
+        build.setBody(JSON.toJSONString(jsonObject));
+        build.setSign(hbSignUtil.signMd5(build));
+        String post = post(hbSignUtil.getHBHost() + "/api/product/frontCategory/getCategory", build);
+        log.info("post 请求参数:{}", JSON.toJSONString(build));
+        log.info("post 结果:{}", post);
+        return post;
+    }
+
+    @Override
+    public void deleteFrontCategory(JSONObject hbRequest) {
+        String bodyStr = hbRequest.getString("body");
+        JSONObject jsonObject = JSON.parseObject("bodyStr");
+        log.info("前台类目删除,body:{}", bodyStr);
+        List<FrontCategory> frontCategorys = frontCategoryMapper.selectList(new LambdaQueryWrapper<FrontCategory>().eq(FrontCategory::getCode,jsonObject.getLong("code")));
+        for (FrontCategory frontCategory : frontCategorys) {
+            frontCategory.setIsDelete(1);
+            frontCategoryMapper.updateById(frontCategory);
+        }
+    }
+}

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

@@ -4,18 +4,17 @@ import cn.hutool.core.util.ObjectUtil;
 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.yami.shop.bean.dto.hb.HBBaseReq;
 import com.yami.shop.bean.model.Product;
 import com.yami.shop.bean.model.ShopDetail;
-import com.yami.shop.bean.model.ShopProd;
+import com.yami.shop.bean.model.ShopSku;
 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.ShopDetailMapper;
-import com.yami.shop.dao.ShopProdMapper;
+import com.yami.shop.dao.ShopSkuMapper;
 import com.yami.shop.dao.SkuMapper;
-import com.yami.shop.service.hb.IGoodsService;
+import com.yami.shop.service.hb.IHBGoodsService;
 import com.yami.shop.utils.HBSignUtil;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -40,11 +39,11 @@ import static com.yami.shop.common.util.HttpUtil.post;
 @Slf4j
 @Service
 @AllArgsConstructor
-public class HBGoodsService implements IGoodsService {
+public class HBGoodsService implements IHBGoodsService {
     private final HBSignUtil hbSignUtil;
     private final ProductMapper productMapper;
     private final SkuMapper skuMapper;
-    private final ShopProdMapper shopProdMapper;
+    private final ShopSkuMapper shopProdMapper;
     private final ShopDetailMapper shopDetailMapper;
 
     @Override
@@ -203,20 +202,20 @@ public class HBGoodsService implements IGoodsService {
                     return HBR.error("更改价格系统找不到对应商品(单品):" + skuId);
                 }
 
-                ShopProd shopProd = shopProdMapper.selectByShopAndProd(sku.getSkuId(), shopDetail.getShopId());
-                if (ObjectUtil.isEmpty(shopProd)) {
-                    ShopProd shopProdInfo = new ShopProd();
-                    shopProdInfo.setShopId(shopDetail.getShopId());
-                    shopProdInfo.setShopProdPrice(currentPrice == null ? 0.0 : currentPrice);
-                    shopProdInfo.setSkuId(sku.getSkuId());
-                    shopProdInfo.setIsDelete(0);
-                    shopProdInfo.setRecTime(new Date());
-                    shopProdMapper.insert(shopProdInfo);
+                ShopSku shopSku = shopProdMapper.selectByShopAndProd(sku.getSkuId(), shopDetail.getShopId());
+                if (ObjectUtil.isEmpty(shopSku)) {
+                    ShopSku shopSkuInfo = new ShopSku();
+                    shopSkuInfo.setShopId(shopDetail.getShopId());
+                    shopSkuInfo.setShopSkuPrice(currentPrice == null ? 0.0 : currentPrice);
+                    shopSkuInfo.setSkuId(sku.getSkuId());
+                    shopSkuInfo.setIsDelete(0);
+                    shopSkuInfo.setRecTime(new Date());
+                    shopProdMapper.insert(shopSkuInfo);
                     log.info("门店对应商品系统不存在直接添加");
                 } else {
-                    shopProd.setShopProdPrice(currentPrice == null ? 0.0 : currentPrice);
-                    shopProd.setUpdateTime(new Date());
-                    shopProdMapper.updateById(shopProd);
+                    shopSku.setShopSkuPrice(currentPrice == null ? 0.0 : currentPrice);
+                    shopSku.setUpdateTime(new Date());
+                    shopProdMapper.updateById(shopSku);
                     log.info("库存更改成功");
                 }
             }
@@ -254,20 +253,20 @@ public class HBGoodsService implements IGoodsService {
                     return HBR.error("系统找不到对应商品(单品):" + skuId);
                 }
 
-                ShopProd shopProd = shopProdMapper.selectByShopAndProd(sku.getSkuId(), shopDetail.getShopId());
-                if (ObjectUtil.isEmpty(shopProd)) {
-                    ShopProd shopProdInfo = new ShopProd();
-                    shopProdInfo.setShopId(shopDetail.getShopId());
-                    shopProdInfo.setShopProdStocks(currentStock);
-                    shopProdInfo.setSkuId(sku.getSkuId());
-                    shopProdInfo.setIsDelete(0);
-                    shopProdInfo.setRecTime(new Date());
-                    shopProdMapper.insert(shopProdInfo);
+                ShopSku shopSku = shopProdMapper.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.setIsDelete(0);
+                    shopSkuInfo.setRecTime(new Date());
+                    shopProdMapper.insert(shopSkuInfo);
                     log.info("库存添加成功");
                 } else {
-                    shopProd.setShopProdStocks(currentStock);
-                    shopProd.setUpdateTime(new Date());
-                    shopProdMapper.updateById(shopProd);
+                    shopSku.setShopSkuStocks(currentStock);
+                    shopSku.setUpdateTime(new Date());
+                    shopProdMapper.updateById(shopSku);
                     log.info("库存更改成功");
                 }
             }

+ 2 - 5
yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/HBOrderService.java

@@ -3,7 +3,6 @@ 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.yami.shop.bean.dto.hb.HBBaseReq;
 import com.yami.shop.bean.model.Product;
 import com.yami.shop.bean.model.Sku;
@@ -11,8 +10,7 @@ import com.yami.shop.common.util.hb.HBR;
 import com.yami.shop.dao.OrderMapper;
 import com.yami.shop.dao.ProductMapper;
 import com.yami.shop.dao.SkuMapper;
-import com.yami.shop.service.hb.IGoodsService;
-import com.yami.shop.service.hb.IOrderService;
+import com.yami.shop.service.hb.IHBOrderService;
 import com.yami.shop.utils.HBSignUtil;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -20,7 +18,6 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
 
 import static com.yami.shop.common.util.HttpUtil.post;
@@ -37,7 +34,7 @@ import static com.yami.shop.common.util.HttpUtil.post;
 @Service
 @AllArgsConstructor
 @Transactional(readOnly = true)
-public class HBOrderService implements IOrderService {
+public class HBOrderService implements IHBOrderService {
     private final HBSignUtil hbSignUtil;
     private final OrderMapper orderMapper;
     private final ProductMapper productMapper;

+ 46 - 10
yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/StoreManagementService.java

@@ -3,10 +3,12 @@ package com.yami.shop.service.hb.impl;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 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.common.util.PageParam;
 import com.yami.shop.common.util.R;
 import com.yami.shop.common.util.hb.HBR;
 import com.yami.shop.dao.ShopDetailMapper;
@@ -18,6 +20,8 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 
+import java.util.List;
+
 import static com.yami.shop.common.util.HttpUtil.post;
 
 
@@ -48,9 +52,9 @@ public class StoreManagementService implements IStoreManagementService {
                 .build();
         build.setBody(JSON.toJSONString(hbStoreBaseInfoReq));
         build.setSign(hbSignUtil.signMd5(build));
-        String post = post(hbSignUtil.getHBHost()+"/api/station/get", build);
+        String post = post(hbSignUtil.getHBHost() + "/api/station/get", build);
         log.info("post 请求参数:{}", JSON.toJSONString(build));
-        log.info("post 结果:{}",  post);
+        log.info("post 结果:{}", post);
         return post;
     }
 
@@ -62,9 +66,9 @@ public class StoreManagementService implements IStoreManagementService {
         jsonObject.put("deliveryFeeTemplateId", 5);
         build.setBody(JSON.toJSONString(jsonObject));
         build.setSign(hbSignUtil.signMd5(build));
-        String post = post(hbSignUtil.getHBHost()+"/api/base/deliveryFee/template", build);
+        String post = post(hbSignUtil.getHBHost() + "/api/base/deliveryFee/template", build);
         log.info("post 请求参数:{}", JSON.toJSONString(build));
-        log.info("post 结果:{}",  post);
+        log.info("post 结果:{}", post);
     }
 
 
@@ -116,8 +120,8 @@ public class StoreManagementService implements IStoreManagementService {
 
             String hb = doGetStation(outStationNo);
             ShopDetail shopDetail = shopDetailMapper.selectByOutStationNo(outStationNo);
-            if (shopDetail!=null) {
-                log.info("门店已存在{}",outStationNo);
+            if (shopDetail != null) {
+                log.info("门店已存在{}", outStationNo);
                 return HBR.success();
             }
             JSONObject goodsInfoJson = JSON.parseObject(hb);
@@ -132,12 +136,12 @@ public class StoreManagementService implements IStoreManagementService {
             shopDetailInfo.setCity(resultData.getString("city"));
             shopDetailInfo.setArea(resultData.getString("district"));
             shopDetailInfo.setShopOwner(resultData.getString("contacts"));
-            shopDetailInfo.setShopLat(resultData.getString("longitude"));//门店经度
-            shopDetailInfo.setShopLng(resultData.getString("latitude"));//门店纬度
-            shopDetailInfo.setThirdPartyCode(resultData.getString("stationId"));//海博门店编码
+            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"));//商家门店编码
             shopDetailMapper.insert(shopDetailInfo);
-
             return HBR.success();
         } catch (Exception e) {
             log.error("门店变更失败:{}", e.getMessage(), e);
@@ -146,4 +150,36 @@ public class StoreManagementService implements IStoreManagementService {
     }
 
 
+    @Override
+    public List<ShopDetail> list(ShopDetail shopDetail) {
+        List<ShopDetail> list = shopDetailMapper.selectList(new LambdaQueryWrapper<ShopDetail>()
+                .eq(shopDetail.getThirdPartyCode() != null, ShopDetail::getThirdPartyCode, shopDetail.getThirdPartyCode())
+                .eq(shopDetail.getOutStationNo() != null, ShopDetail::getOutStationNo, shopDetail.getOutStationNo())
+                .eq(shopDetail.getCategory() != null, ShopDetail::getCategory, shopDetail.getCategory())
+                .eq(shopDetail.getShopAddress() != null, ShopDetail::getShopAddress, shopDetail.getShopAddress())
+                .like(shopDetail.getShopName() != null, ShopDetail::getShopName, shopDetail.getShopName()));
+        return list;
+    }
+
+    @Override
+    public ShopDetail detail(Long id) {
+        return shopDetailMapper.selectById(id);
+    }
+
+    @Override
+    public IPage<ShopDetail> page(ShopDetail shopDetail, PageParam<ShopDetail> page) {
+        return shopDetailMapper.selectPage(page, new LambdaQueryWrapper<ShopDetail>()
+                .like(shopDetail.getShopName() != null, ShopDetail::getShopName, shopDetail.getShopName())
+                .like(shopDetail.getOutStationNo() != null, ShopDetail::getOutStationNo, shopDetail.getOutStationNo())
+                .like(shopDetail.getCategory() != null, ShopDetail::getCategory, shopDetail.getCategory())
+                .like(shopDetail.getShopAddress() != null, ShopDetail::getShopAddress, shopDetail.getShopAddress())
+                .like(shopDetail.getThirdPartyCode() != null, ShopDetail::getThirdPartyCode, shopDetail.getThirdPartyCode())
+                .like(shopDetail.getShopOwner() != null, ShopDetail::getShopOwner, shopDetail.getShopOwner())
+                .like(shopDetail.getMobile() != null, ShopDetail::getMobile, shopDetail.getMobile())
+                .like(shopDetail.getTel() != null, ShopDetail::getTel, shopDetail.getTel())
+                .eq(shopDetail.getShopLogo() != null, ShopDetail::getShopLogo, shopDetail.getShopLogo())
+                .eq(shopDetail.getShopStatus() != null, ShopDetail::getShopStatus, shopDetail.getShopStatus())
+                .eq(shopDetail.getHbStationId() != null, ShopDetail::getHbStationId, shopDetail.getHbStationId())
+        );
+    }
 }

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

@@ -106,6 +106,8 @@ public class AttachFileServiceImpl extends ServiceImpl<AttachFileMapper, AttachF
 			try {
 				InputStream input = new ByteArrayInputStream(bytes);
 				ossClient.putObject(new PutObjectRequest(aliOss.getBucketName(), filePath, input));
+				String url = "https://" + aliOss.getBucketName() + "." + aliOss.getEndpoint() + "/" + filePath;
+				System.out.println("AliOSS upload success, URL: " + url);
 			} catch (Exception e) {
 				e.printStackTrace();
 				System.err.println(e.getMessage());

+ 22 - 0
yami-shop-service/src/main/java/com/yami/shop/service/impl/CategoryProdServiceImpl.java

@@ -0,0 +1,22 @@
+
+package com.yami.shop.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.yami.shop.bean.model.CategoryProd;
+import com.yami.shop.dao.CategoryProdMapper;
+import com.yami.shop.service.CategoryProdService;
+
+/**
+ *
+ * Created by lgh on 2018/07/13.
+ */
+@Service
+public class CategoryProdServiceImpl extends ServiceImpl<CategoryProdMapper, CategoryProd> implements CategoryProdService {
+
+    @Autowired
+    private CategoryProdMapper categoryPropMapper;
+
+}

+ 0 - 31
yami-shop-service/src/main/java/com/yami/shop/service/impl/CategoryPropServiceImpl.java

@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
- *
- * https://www.gz-yami.com/
- *
- * 未经允许,不可做商业用途!
- *
- * 版权所有,侵权必究!
- */
-
-package com.yami.shop.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.yami.shop.bean.model.CategoryProp;
-import com.yami.shop.dao.CategoryPropMapper;
-import com.yami.shop.service.CategoryPropService;
-
-/**
- *
- * Created by lgh on 2018/07/13.
- */
-@Service
-public class CategoryPropServiceImpl extends ServiceImpl<CategoryPropMapper, CategoryProp> implements CategoryPropService {
-
-    @Autowired
-    private CategoryPropMapper categoryPropMapper;
-
-}

+ 3 - 11
yami-shop-service/src/main/java/com/yami/shop/service/impl/CategoryServiceImpl.java

@@ -15,7 +15,6 @@ import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.collection.CollectionUtil;
 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.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.google.common.collect.Lists;
@@ -25,20 +24,16 @@ import com.yami.shop.bean.param.CategoryScoreConfigParam;
 import com.yami.shop.bean.param.ScoreConfigParam;
 import com.yami.shop.bean.vo.ListCategoryForUserVO;
 import com.yami.shop.bean.vo.ListCategoryVO;
-import com.yami.shop.common.bean.Qiniu;
 import com.yami.shop.common.config.Constant;
 import com.yami.shop.common.exception.GlobalException;
-import com.yami.shop.common.exception.YamiShopBindException;
 import com.yami.shop.config.ShopConfig;
 import com.yami.shop.dao.CategoryBrandMapper;
 import com.yami.shop.dao.CategoryMapper;
-import com.yami.shop.dao.CategoryPropMapper;
+import com.yami.shop.dao.CategoryProdMapper;
 import com.yami.shop.dao.ProductMapper;
 import com.yami.shop.service.CategoryService;
-import com.yami.shop.service.ProductService;
 import com.yami.shop.service.SysConfigService;
 import lombok.AllArgsConstructor;
-import org.apache.commons.collections.CollectionUtils;
 import org.apache.poi.ss.usermodel.*;
 import org.springframework.beans.BeanUtils;
 import org.springframework.cache.annotation.CacheEvict;
@@ -65,7 +60,7 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
 
 	private final CategoryBrandMapper categoryBrandMapper;
 
-	private final CategoryPropMapper categoryPropMapper;
+	private final CategoryProdMapper categoryPropMapper;
 
 	private final ProductMapper productMapper;
 
@@ -434,10 +429,7 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
 			categoryBrandMapper.insertCategoryBrand(category.getCategoryId(), category.getBrandIds());
 		}
 
-		//保存分类与参数信息
-		if(CollUtil.isNotEmpty(category.getAttributeIds())){
-			categoryPropMapper.insertCategoryProp(category.getCategoryId(), category.getAttributeIds());
-		}
+
 	}
 
 	/**

+ 37 - 13
yami-shop-service/src/main/java/com/yami/shop/service/impl/ChannelProdServiceImpl.java

@@ -3,21 +3,19 @@ package com.yami.shop.service.impl;
 
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.excel.EasyExcel;
+import com.alipay.api.domain.Shop;
 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.model.Channel;
-import com.yami.shop.bean.model.ChannelProd;
-import com.yami.shop.bean.model.Sku;
+import com.yami.shop.bean.model.*;
 import com.yami.shop.bean.vo.ChannelProdExportVO;
 import com.yami.shop.bean.vo.ChannelProdImportVO;
 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.dao.ChannelMapper;
-import com.yami.shop.dao.ChannelProdMapper;
-import com.yami.shop.dao.SkuMapper;
+import com.yami.shop.common.util.SpringContextUtils;
+import com.yami.shop.dao.*;
 import com.yami.shop.service.ChannelProdService;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -46,6 +44,8 @@ public class ChannelProdServiceImpl extends ServiceImpl<ChannelProdMapper, Chann
 
     private final ChannelProdMapper channelProdMapper;
     private final ChannelMapper channelMapper;
+    private final ShopDetailMapper shopDetailMapper;
+    private final ChannelShopMapper channelShopMapper;
     private final SkuMapper skuMapper;
 
     @Override
@@ -249,6 +249,9 @@ public class ChannelProdServiceImpl extends ServiceImpl<ChannelProdMapper, Chann
                 if (importVO.getSkuId() == null) {
                     throw new RuntimeException("海博商品ID不能为空");
                 }
+                if (importVO.getShopName() == null) {
+                    throw new RuntimeException("海博门店不能为空");
+                }
                 if (importVO.getChannelProdPrice() == null || importVO.getChannelProdPrice().compareTo(BigDecimal.ZERO) < 0) {
                     throw new RuntimeException("渠道售价不能为空且必须大于等于0");
                 }
@@ -256,7 +259,6 @@ public class ChannelProdServiceImpl extends ServiceImpl<ChannelProdMapper, Chann
                 // 转换为实体对象
                 ChannelProd channelProd = new ChannelProd();
                 Channel channel = channelMapper.selectByName(importVO.getChannelName());
-
                 if (ObjectUtil.isEmpty(channel)) {
                     log.error("渠道:{},在系统中不存在", importVO.getChannelName());
                     throw new GlobalException(String.format("第%d行数据导入失败! 失败原因: 渠道=%s,在系统中不存在", i + 1, importVO.getChannelName()));
@@ -278,14 +280,36 @@ public class ChannelProdServiceImpl extends ServiceImpl<ChannelProdMapper, Chann
 
                 // 检查是否已存在
                 int count = channelProdMapper.selectCount(
-                        new LambdaQueryWrapper<ChannelProd>().eq(ChannelProd::getChannelId,channel.getId())
-                        .eq(ChannelProd::getSkuId,sku.getSkuId()));
+                        new LambdaQueryWrapper<ChannelProd>().eq(ChannelProd::getChannelId, channel.getId())
+                                .eq(ChannelProd::getSkuId, sku.getSkuId()));
                 if (count > 0) {
-                    log.error("渠道:{},在系统中已存在商品ID:{}",  importVO.getChannelName(),importVO.getSkuId());
+                    log.error("渠道:{},在系统中已存在商品ID:{}", importVO.getChannelName(), importVO.getSkuId());
                     throw new GlobalException(String.format("第%d行数据导入失败! 失败原因: 渠道=%s,在系统中已存在 商品ID=%s", i + 1, importVO.getChannelName(), importVO.getSkuId()));
-                } else {
-                    // 新增操作
-                    channelProdMapper.insert(channelProd);
+                }
+
+                //检查门店是否存在
+                ShopDetail shopDetail = shopDetailMapper.selectOne(new LambdaQueryWrapper<ShopDetail>().eq(ShopDetail::getShopName, importVO.getShopName()));
+                if (ObjectUtil.isEmpty(shopDetail)) {
+                    log.error("门店:{},在系统中不存在", importVO.getShopName());
+                    throw new GlobalException(String.format("第%d行数据导入失败! 失败原因: 门店=%s,在系统中不存在", i + 1, importVO.getShopName()));
+                }
+
+                // 新增操作
+                channelProdMapper.insert(channelProd);
+                log.info("添加渠道门店商品数据成功");
+                //添加渠道门店关联数据
+                //检查门店是否已存在
+                int channelShopCount = channelShopMapper.selectCount(new LambdaQueryWrapper<ChannelShop>()
+                        .eq(ChannelShop::getShopId, shopDetail.getShopId())
+                        .eq(ChannelShop::getIsDelete, 0)
+                        .eq(ChannelShop::getChannelId, channelProd.getChannelId()));
+                if (channelShopCount == 0) {
+                    ChannelShop channelShop = new ChannelShop();
+                    channelShop.setIsDelete(0);
+                    channelShop.setChannelId(channelProd.getId());
+                    channelShop.setShopId(shopDetail.getShopId());
+                    channelShopMapper.insert(channelShop);
+                    log.info("添加渠道门店关联数据成功");
                 }
                 successCount++;
             } catch (Exception e) {

+ 7 - 6
yami-shop-service/src/main/java/com/yami/shop/service/impl/DeptServiceImpl.java

@@ -1,5 +1,7 @@
 package com.yami.shop.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.yami.shop.bean.model.Dept;
 import com.yami.shop.dao.DeptMapper;
@@ -8,8 +10,7 @@ import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -26,9 +27,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements De
     @Override
     public List<Dept> listAllDept() {
         // 获取所有未删除的部门数据
-        List<Dept> allDepts = list(new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<Dept>()
-                .eq(Dept::getIsDelete, 0));
-
+        List<Dept> allDepts = deptMapper.selectListAll();
         // 构建树形结构
         return buildDeptTree(allDepts, 0L);
     }
@@ -85,7 +84,9 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements De
     }
 
     @Override
-    public List<Dept> listDeptsByUserId(String userId) {
+    public List<Dept> listDeptsByUserId(Long userId) {
         return deptMapper.selectDeptsByUserId(userId);
     }
+
+
 }

+ 5 - 5
yami-shop-service/src/main/java/com/yami/shop/service/impl/DeptUserServiceImpl.java

@@ -24,7 +24,7 @@ public class DeptUserServiceImpl extends ServiceImpl<DeptUserMapper, DeptUser> i
     private final DeptUserMapper deptUserMapper;
 
     @Override
-    public List<DeptUser> listByUserId(String userId) {
+    public List<DeptUser> listByUserId(Long userId) {
         return deptUserMapper.selectByUserId(userId);
     }
 
@@ -35,7 +35,7 @@ public class DeptUserServiceImpl extends ServiceImpl<DeptUserMapper, DeptUser> i
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public boolean saveUserDept(String userId, List<Long> deptIds) {
+    public boolean saveUserDept(Long userId, List<Long> deptIds) {
         // 先删除用户原有的部门关联
         deptUserMapper.deleteByUserId(userId);
         // 添加新的部门关联
@@ -57,7 +57,7 @@ public class DeptUserServiceImpl extends ServiceImpl<DeptUserMapper, DeptUser> i
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public boolean deleteByUserId(String userId) {
+    public boolean deleteByUserId(Long userId) {
         return deptUserMapper.deleteByUserId(userId) >= 0;
     }
 
@@ -69,7 +69,7 @@ public class DeptUserServiceImpl extends ServiceImpl<DeptUserMapper, DeptUser> i
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public boolean saveBatchUserDepts(List<String> userIds, Long deptId) {
+    public boolean saveBatchUserDepts(List<Long> userIds, Long deptId) {
         if (userIds == null || userIds.isEmpty() || deptId == null) {
             return false;
         }
@@ -79,7 +79,7 @@ public class DeptUserServiceImpl extends ServiceImpl<DeptUserMapper, DeptUser> i
 
         List<DeptUser> deptUsers = new ArrayList<>();
         Date now = new Date();
-        for (String userId : userIds) {
+        for (Long userId : userIds) {
             DeptUser deptUser = new DeptUser();
             deptUser.setUserId(userId);
             deptUser.setDeptId(deptId);

+ 30 - 0
yami-shop-service/src/main/java/com/yami/shop/service/impl/FrontCategoryService.java

@@ -0,0 +1,30 @@
+package com.yami.shop.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.yami.shop.bean.model.FrontCategory;
+import com.yami.shop.dao.FrontCategoryMapper;
+import com.yami.shop.service.IFrontCategoryService;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * 前台类目管理服务实现
+ *
+ * @author fubojin
+ * @version 1.0.0
+ * @since 2025-09-1
+ */
+@Slf4j
+@Service
+@AllArgsConstructor
+@Transactional(readOnly = true)
+public class FrontCategoryService implements IFrontCategoryService {
+    private final FrontCategoryMapper frontCategoryMapper;
+
+}

+ 22 - 0
yami-shop-service/src/main/java/com/yami/shop/service/impl/LabelServiceImpl.java

@@ -0,0 +1,22 @@
+package com.yami.shop.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yami.shop.bean.model.Label;
+import com.yami.shop.dao.LabelMapper;
+import com.yami.shop.service.LabelService;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+/**
+ * 标签Service实现类
+ *
+ * @author fbj
+ * @since 2025-09-XX
+ */
+@Service
+@AllArgsConstructor
+public class LabelServiceImpl extends ServiceImpl<LabelMapper, Label> implements LabelService {
+
+    private final LabelMapper labelMapper;
+
+}

+ 23 - 0
yami-shop-service/src/main/java/com/yami/shop/service/impl/PointsFailureRecordServiceImpl.java

@@ -0,0 +1,23 @@
+// PointsFailureRecordServiceImpl.java
+package com.yami.shop.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yami.shop.bean.model.PointsFailureRecord;
+import com.yami.shop.dao.PointsFailureRecordMapper;
+import com.yami.shop.service.PointsFailureRecordService;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+/**
+ * 积分充值失败记录 Service实现类
+ *
+ * @author fbj
+ * @since 2025-09-XX
+ */
+@Service
+@AllArgsConstructor
+public class PointsFailureRecordServiceImpl extends ServiceImpl<PointsFailureRecordMapper, PointsFailureRecord> implements PointsFailureRecordService {
+
+    private final PointsFailureRecordMapper pointsFailureRecordMapper;
+
+}

+ 152 - 0
yami-shop-service/src/main/java/com/yami/shop/service/impl/PointsRechargeServiceImpl.java

@@ -0,0 +1,152 @@
+
+package com.yami.shop.service.impl;
+
+import com.alibaba.excel.EasyExcel;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yami.shop.bean.model.*;
+import com.yami.shop.common.exception.GlobalException;
+import com.yami.shop.dao.*;
+import com.yami.shop.service.PointsFailureRecordService;
+import com.yami.shop.service.PointsRechargeService;
+import lombok.AllArgsConstructor;
+import lombok.extern.log4j.Log4j2;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 积分充值 Service实现类
+ *
+ * @author fbj
+ * @since 2025-09-XX
+ */
+@Service
+@AllArgsConstructor
+@Log4j2
+public class PointsRechargeServiceImpl extends ServiceImpl<PointsRechargeMapper, PointsRecharge> implements PointsRechargeService {
+
+    private final PointsRechargeMapper pointsRechargeMapper;
+    private final PointsFailureRecordService pointsFailureRecordService;
+    private final TzSysUserMapper sysUserMapper;
+    private final ChannelMapper channelMapper;
+
+    @Override
+    public void exportTemplate(HttpServletResponse response) throws Exception {
+        // 设置响应头
+        response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+        response.setCharacterEncoding("utf-8");
+        String fileName = URLEncoder.encode("积分充值导入模板", "UTF-8").replaceAll("\\+", "%20");
+        response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
+
+        // 创建示例数据
+        List<com.yami.shop.service.impl.PointsRechargeTemplateDTO> templateData = new ArrayList<>();
+        // 使用EasyExcel导出模板
+        EasyExcel.write(response.getOutputStream(), com.yami.shop.service.impl.PointsRechargeTemplateDTO.class)
+                .sheet("积分充值导入模板")
+                .doWrite(templateData);
+    }
+
+
+    @Override
+    public String importPointsRecharge(MultipartFile file) {
+        // 读取Excel数据
+        List<com.yami.shop.service.impl.PointsRechargeTemplateDTO> importData = null;
+        try {
+            importData = EasyExcel.read(file.getInputStream())
+                    .head(com.yami.shop.service.impl.PointsRechargeTemplateDTO.class)
+                    .sheet()
+                    .doReadSync();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+        int successCount = 0;
+        int failCount = 0;
+
+        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("所属企业不能为空");
+                }
+                //判断是否存在对应渠道商
+                Channel channel = channelMapper.selectOne(new LambdaQueryWrapper<Channel>()
+                        .eq(Channel::getChannelName, templateDTO.getChannelName().trim()));
+                if (channel == null) {
+                    throw new GlobalException("渠道商不存在");
+                }
+
+                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("充值积分不能为空");
+                }
+
+                if (templateDTO.getExpiryDate() == null) {
+                    throw new GlobalException("过期时间不能为空");
+                }
+
+                // 构造实体对象
+                PointsRecharge pointsRecharge = new PointsRecharge();
+
+                pointsRecharge.setUserId(sysUser.getUserId());
+                pointsRecharge.setUserName(templateDTO.getUserName());
+                pointsRecharge.setUserPhone(templateDTO.getUserPhone());
+                pointsRecharge.setChannelId(channel.getId());
+                pointsRecharge.setChannelName(templateDTO.getChannelName());
+                pointsRecharge.setPoints(templateDTO.getPoints());
+                pointsRecharge.setExpiryDate(templateDTO.getExpiryDate());
+                pointsRecharge.setType(0);
+                pointsRecharge.setCreateTime(new Date());
+                pointsRecharge.setUpdateTime(new Date());
+                pointsRecharge.setRechargeStatus(1); // 默认未过期状态
+
+                // 生成充值单号
+                String rechargeNumber = "RC" + System.currentTimeMillis();
+                pointsRecharge.setRechargeNumber(rechargeNumber);
+
+                // 保存数据
+                this.save(pointsRecharge);
+                successCount++;
+            } catch (GlobalException e) {
+                // 失败数据保存到积分充值失败记录表
+                PointsFailureRecord failureRecord = new PointsFailureRecord();
+                failureRecord.setReasonForFailure(e.getMessage());
+                failureRecord.setChannelName(templateDTO.getChannelName());
+                failureRecord.setUserName(templateDTO.getUserName());
+                failureRecord.setUserPhone(templateDTO.getUserPhone());
+                failureRecord.setPoints(templateDTO.getPoints());
+                failureRecord.setExpiryDate(templateDTO.getExpiryDate());
+
+                // 保存失败记录
+                pointsFailureRecordService.save(failureRecord);
+
+                log.error("导入第{}行数据失败!", i + 1, e);
+                failCount++;
+            }
+        }
+
+        return String.format("导入完成,成功:%d条,失败:%d条", successCount, failCount);
+    }
+
+}

+ 22 - 0
yami-shop-service/src/main/java/com/yami/shop/service/impl/PointsRecordServiceImpl.java

@@ -0,0 +1,22 @@
+package com.yami.shop.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yami.shop.bean.model.PointsRecord;
+import com.yami.shop.dao.PointsRecordMapper;
+import com.yami.shop.service.PointsRecordService;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+/**
+ * 积分记录详细 Service实现类
+ *
+ * @author fbj
+ * @since 2025-09-XX
+ */
+@Service
+@AllArgsConstructor
+public class PointsRecordServiceImpl extends ServiceImpl<PointsRecordMapper, PointsRecord> implements PointsRecordService {
+
+    private final PointsRecordMapper pointsRecordMapper;
+
+}

+ 8 - 11
yami-shop-service/src/main/java/com/yami/shop/service/impl/ProdPropServiceImpl.java

@@ -17,18 +17,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.yami.shop.bean.enums.ProdPropRule;
 import com.yami.shop.bean.model.ProdProp;
 import com.yami.shop.common.exception.GlobalException;
-import com.yami.shop.common.exception.YamiShopBindException;
 import com.yami.shop.common.util.PageAdapter;
-import com.yami.shop.dao.CategoryPropMapper;
+import com.yami.shop.dao.CategoryProdMapper;
 import com.yami.shop.dao.ProdPropMapper;
 import com.yami.shop.dao.ProdPropValueMapper;
 import com.yami.shop.service.ProdPropService;
 import lombok.AllArgsConstructor;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import javax.validation.Valid;
 import java.util.List;
 import java.util.Objects;
 
@@ -41,9 +38,9 @@ public class ProdPropServiceImpl extends ServiceImpl<ProdPropMapper, ProdProp> i
 
     private final ProdPropMapper prodPropMapper;
 
-    private final ProdPropValueMapper prodPropValueMapper;
+    private final ProdPropValueMapper prodProdValueMapper;
 
-    private final CategoryPropMapper categoryPropMapper;
+    private final CategoryProdMapper categoryProdMapper;
 
     @Override
     public IPage<ProdProp> pagePropAndValue(ProdProp prodProp, Page<ProdProp> page) {
@@ -64,7 +61,7 @@ public class ProdPropServiceImpl extends ServiceImpl<ProdPropMapper, ProdProp> i
         if (CollUtil.isEmpty(prodProp.getProdPropValues())) {
             return;
         }
-        prodPropValueMapper.insertPropValues(prodProp.getPropId(), prodProp.getProdPropValues());
+        prodProdValueMapper.insertPropValues(prodProp.getPropId(), prodProp.getProdPropValues());
 
     }
 
@@ -77,11 +74,11 @@ public class ProdPropServiceImpl extends ServiceImpl<ProdPropMapper, ProdProp> i
         }
         prodPropMapper.updateById(prodProp);
         // 先删除原有的属性值,再添加新的属性值
-        prodPropValueMapper.deleteByPropId(prodProp.getPropId());
+        prodProdValueMapper.deleteByPropId(prodProp.getPropId());
         if (CollUtil.isEmpty(prodProp.getProdPropValues())) {
             return;
         }
-        prodPropValueMapper.insertPropValues(prodProp.getPropId(), prodProp.getProdPropValues());
+        prodProdValueMapper.insertPropValues(prodProp.getPropId(), prodProp.getProdPropValues());
     }
 
     @Override
@@ -92,11 +89,11 @@ public class ProdPropServiceImpl extends ServiceImpl<ProdPropMapper, ProdProp> i
             return;
         }
         // 删除原有的属性值
-        prodPropValueMapper.deleteByPropId(propId);
+        prodProdValueMapper.deleteByPropId(propId);
 
         // 如果是参数,删除参数与分类关联信息
         if (ProdPropRule.ATTRIBUTE.value().equals(propRule)) {
-            categoryPropMapper.deleteByPropId(propId);
+//            categoryProdMapper.deleteByPropId(propId);
         }
     }
 

+ 271 - 0
yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopCategoryServiceImpl.java

@@ -0,0 +1,271 @@
+package com.yami.shop.service.impl;
+
+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.extension.service.impl.ServiceImpl;
+import com.yami.shop.bean.dto.ShopCategoryExcelDTO;
+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.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.service.IShopCategoryService;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 门店前台类目服务实现类
+ *
+ * @author YourName
+ * @since 2025-09-XX
+ */
+@Service
+@AllArgsConstructor
+public class ShopCategoryServiceImpl extends ServiceImpl<ShopCategoryMapper, ShopCategory> implements IShopCategoryService {
+
+    private final ShopCategoryMapper shopCategoryMapper;
+
+    private final FrontCategoryMapper frontCategoryMapper;
+
+
+
+    @Override
+    public List<ShopCategory> treeShopCategory(Long shopId, String name) {
+        // 获取所有未删除的前台类目
+        List<ShopCategory> shopCategories = shopCategoryMapper.selectList(new LambdaQueryWrapper<ShopCategory>()
+                .like(name != null, ShopCategory::getName, name)
+                .eq(ShopCategory::getIsDelete, 0)
+                .eq(shopId != null, ShopCategory::getShopId, shopId));
+        // 构建树形结构
+        return buildCategoryTree(shopCategories, "0"); // 假设根节点的parentCode为"0"
+    }
+    /**
+     * 构建类目树形结构
+     *
+     * @param categories 所有类目列表
+     * @param parentCode 父级编码
+     * @return 树形结构的类目列表
+     */
+    private List<ShopCategory> buildCategoryTree(List<ShopCategory> categories, String parentCode) {
+        List<ShopCategory> tree = new ArrayList<>();
+        for (ShopCategory category : categories) {
+            // 查找指定parentCode的子类目
+            if (parentCode.equals(category.getParentCode())) {
+                // 递归设置子类目
+                List<ShopCategory> children = buildCategoryTree(categories, category.getCode());
+                category.setChildren(children);
+                tree.add(category);
+            }
+        }
+
+        return tree;
+    }
+
+
+    @Override
+    public void exportTemplate(HttpServletResponse response) throws Exception {
+        // 设置响应头
+        response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+        response.setCharacterEncoding("utf-8");
+        String fileName = URLEncoder.encode("门店前台类目导入模板", "UTF-8").replaceAll("\\+", "%20");
+        response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
+        // 创建示例数据
+        List<ShopCategoryExcelDTO> templateData = new ArrayList<>();
+        // 使用EasyExcel导出模板
+        EasyExcel.write(response.getOutputStream(), ShopCategoryExcelDTO.class)
+                .sheet("店内分类导入模板")
+                .doWrite(templateData);
+    }
+
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void importCategory(MultipartFile file) {
+        try {
+            // 检查文件是否为空
+            if (file == null || file.isEmpty()) {
+                throw new GlobalException("上传文件不能为空");
+            }
+            // 检查文件格式
+            String fileName = file.getOriginalFilename();
+            if (fileName == null || (!fileName.endsWith(".xls") && !fileName.endsWith(".xlsx"))) {
+                throw new GlobalException("文件格式不正确,请上传Excel文件(.xls或.xlsx)");
+            }
+            // 解析Excel文件
+            List<ShopCategory> shopCategories = parseExcelFile(file);
+
+            // 批量保存数据
+            if (!shopCategories.isEmpty()) {
+                // 检查数据有效性
+                validateShopCategories(shopCategories);
+                for (ShopCategory shopCategory : shopCategories) {
+                    this.save(shopCategory);
+                    //添加对应的二级和三级类目
+                    FrontCategory  frontCategoryByName = frontCategoryMapper.selectListName(shopCategory.getSubName());
+                    frontCategoryByName.setParentCode(shopCategory.getCode());
+                    frontCategoryByName.setParentName(shopCategory.getName());
+                    addShopCategory(frontCategoryByName,shopCategory.getShopId());
+                }
+            }
+        } catch (Exception e) {
+            log.error("导入门店前台类目失败:", e);
+            throw new GlobalException("导入失败:" + e.getMessage());
+        }
+    }
+
+    /**
+     * 添加对应的二级和三级类目
+     * @param frontCategory 前台类目模板
+     * @param shopId 门店ID
+     */
+    private void addShopCategory(FrontCategory frontCategory, Long shopId) {
+        ShopCategory shopCategory = new ShopCategory();
+        shopCategory.setName(frontCategory.getName());
+        shopCategory.setCode(frontCategory.getCode());
+        shopCategory.setShopId(shopId);
+        shopCategory.setParentCode(frontCategory.getParentCode());
+        shopCategory.setParentName(frontCategory.getName());
+        shopCategory.setLevel(frontCategory.getLevel());
+        shopCategory.setNum(frontCategory.getNum());
+        shopCategory.setIsDelete(0);
+        shopCategory.setOperateUser("admin");
+        shopCategory.setIsLeaves(1);
+        this.save(shopCategory);
+        List<FrontCategory> frontCategoryList = frontCategoryMapper.selectList(new LambdaQueryWrapper<FrontCategory>()
+                .eq(FrontCategory::getParentCode, frontCategory.getCode()));
+        for (FrontCategory frontCategory1 : frontCategoryList) {
+            addShopCategory(frontCategory1,shopId);
+        }
+    }
+
+    /**
+     * 解析Excel文件
+     *
+     * @param file Excel文件
+     * @return 门店前台类目列表
+     */
+    private List<ShopCategory> parseExcelFile(MultipartFile file) throws Exception {
+        List<ShopCategory> shopCategories = new ArrayList<>();
+
+        // 使用EasyExcel或Apache POI解析Excel
+        // 这里以EasyExcel为例
+        EasyExcel.read(file.getInputStream(), ShopCategoryExcelDTO.class, new AnalysisEventListener<ShopCategoryExcelDTO>() {
+            @Override
+            public void invoke(ShopCategoryExcelDTO excelDTO, AnalysisContext context) {
+                ShopCategory shopCategory = convertToShopCategory(excelDTO);
+                if (shopCategory != null) {
+                    shopCategories.add(shopCategory);
+                }
+            }
+
+            @Override
+            public void doAfterAllAnalysed(AnalysisContext context) {
+                // 解析完成后的操作
+            }
+        }).sheet().doRead();
+
+        return shopCategories;
+    }
+
+    /**
+     * 将Excel数据转换为ShopCategory对象
+     *
+     * @param excelDTO Excel数据传输对象
+     * @return ShopCategory对象
+     */
+    private ShopCategory convertToShopCategory(ShopCategoryExcelDTO excelDTO) {
+        if (excelDTO == null) {
+            return null;
+        }
+
+        ShopCategory shopCategory = new ShopCategory();
+        shopCategory.setName(excelDTO.getName());
+        shopCategory.setSubName(excelDTO.getSubName());
+        shopCategory.setCode(generateUniqueCode());
+        shopCategory.setShopId(excelDTO.getShopId());
+        shopCategory.setIsDelete(0); // 默认未删除
+        shopCategory.setParentCode("0"); // 默认未删除
+
+        return shopCategory;
+    }
+
+    /**
+     * 生成唯一编码
+     *
+     * @return 唯一编码
+     */
+    private synchronized String generateUniqueCode() {
+        // 使用时间戳+随机数生成唯一编码
+        long timestamp = System.currentTimeMillis();
+        int randomNum = (int) (Math.random() * 9999);
+        return "BM"+timestamp + String.format("%04d", randomNum);
+    }
+    /**
+     * 验证门店前台类目数据有效性
+     *
+     * @param shopCategories 门店前台类目列表
+     */
+    private void validateShopCategories(List<ShopCategory> shopCategories) {
+        if (shopCategories == null || shopCategories.isEmpty()) {
+            return;
+        }
+
+        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个字符");
+            }
+
+            // 检查是否已存在相同记录(根据类目名称+门店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 (integer < 1) {
+                throw new GlobalException("第" + (i + 1) + "行:二级类目"+category.getSubName()+"不存在");
+            }
+
+            if (integer > 1) {
+                throw new GlobalException("第" + (i + 1) + "行:二级类目"+category.getSubName()+"存在多个");
+            }
+
+//            .eq(FrontCategory::getLevel, 1));
+        }
+    }
+
+
+
+}

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

@@ -1,21 +0,0 @@
-package com.yami.shop.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.yami.shop.bean.model.ShopProd;
-import com.yami.shop.dao.ShopProdMapper;
-import com.yami.shop.service.ShopProdService;
-import lombok.AllArgsConstructor;
-import org.springframework.stereotype.Service;
-
-@Service
-@AllArgsConstructor
-public class ShopProdServiceImpl extends ServiceImpl<ShopProdMapper, ShopProd> implements ShopProdService {
-
-    private final ShopProdMapper shopProdMapper;
-
-
-    @Override
-    public void insertProd(ShopProd shopProd) {
-        shopProdMapper.insert(shopProd);
-    }
-}

+ 21 - 0
yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopSkuServiceImpl.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.ShopSku;
+import com.yami.shop.dao.ShopSkuMapper;
+import com.yami.shop.service.ShopSkuService;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+
+@Service
+@AllArgsConstructor
+public class ShopSkuServiceImpl extends ServiceImpl<ShopSkuMapper, ShopSku> implements ShopSkuService {
+
+    private final ShopSkuMapper shopProdMapper;
+
+
+    @Override
+    public void insertSku(ShopSku shopSku) {
+        shopProdMapper.insert(shopSku);
+    }
+}

+ 111 - 0
yami-shop-service/src/main/java/com/yami/shop/service/impl/SysDictDataServiceImpl.java

@@ -0,0 +1,111 @@
+package com.yami.shop.service.impl;
+
+import com.yami.shop.bean.model.SysDictData;
+import com.yami.shop.dao.SysDictDataMapper;
+import com.yami.shop.service.ISysDictDataService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 字典 业务层处理
+ *
+ * @author ruoyi
+ */
+@Service
+public class SysDictDataServiceImpl implements ISysDictDataService
+{
+    @Autowired
+    private SysDictDataMapper dictDataMapper;
+
+    /**
+     * 根据条件分页查询字典数据
+     *
+     * @param dictData 字典数据信息
+     * @return 字典数据集合信息
+     */
+    @Override
+    public List<SysDictData> selectDictDataList(SysDictData dictData)
+    {
+        return dictDataMapper.selectDictDataList(dictData);
+    }
+
+    /**
+     * 根据字典类型和字典键值查询字典数据信息
+     *
+     * @param dictType 字典类型
+     * @param dictValue 字典键值
+     * @return 字典标签
+     */
+    @Override
+    public String selectDictLabel(String dictType, String dictValue)
+    {
+        return dictDataMapper.selectDictLabel(dictType, dictValue);
+    }
+
+    /**
+     * 根据字典数据ID查询信息
+     *
+     * @param dictCode 字典数据ID
+     * @return 字典数据
+     */
+    @Override
+    public SysDictData selectDictDataById(Long dictCode)
+    {
+        return dictDataMapper.selectDictDataById(dictCode);
+    }
+
+    /**
+     * 批量删除字典数据信息
+     *
+     * @param dictCodes 需要删除的字典数据ID
+     */
+    @Override
+    public void deleteDictDataByIds(Long[] dictCodes)
+    {
+        for (Long dictCode : dictCodes)
+        {
+            SysDictData data = selectDictDataById(dictCode);
+            dictDataMapper.deleteDictDataById(dictCode);
+            List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
+//            DictUtils.setDictCache(data.getDictType(), dictDatas);
+        }
+    }
+
+    /**
+     * 新增保存字典数据信息
+     *
+     * @param data 字典数据信息
+     * @return 结果
+     */
+    @Override
+    public int insertDictData(SysDictData data)
+    {
+        int row = dictDataMapper.insertDictData(data);
+        if (row > 0)
+        {
+            List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
+//            DictUtils.setDictCache(data.getDictType(), dictDatas);
+        }
+        return row;
+    }
+
+    /**
+     * 修改保存字典数据信息
+     *
+     * @param data 字典数据信息
+     * @return 结果
+     */
+    @Override
+    public int updateDictData(SysDictData data)
+    {
+        int row = dictDataMapper.updateDictData(data);
+        if (row > 0)
+        {
+            List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType());
+//            DictUtils.setDictCache(data.getDictType(), dictDatas);
+        }
+        return row;
+    }
+}

+ 222 - 0
yami-shop-service/src/main/java/com/yami/shop/service/impl/SysDictTypeServiceImpl.java

@@ -0,0 +1,222 @@
+package com.yami.shop.service.impl;
+
+import com.aliyun.oss.ServiceException;
+import com.yami.shop.bean.model.SysDictData;
+import com.yami.shop.bean.model.SysDictType;
+import com.yami.shop.dao.SysDictDataMapper;
+import com.yami.shop.dao.SysDictTypeMapper;
+import com.yami.shop.service.ISysDictTypeService;
+import org.apache.commons.lang3.ObjectUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.PostConstruct;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * 字典 业务层处理
+ *
+ * @author ruoyi
+ */
+@Service
+public class SysDictTypeServiceImpl implements ISysDictTypeService
+{
+    @Autowired
+    private SysDictTypeMapper dictTypeMapper;
+
+    @Autowired
+    private SysDictDataMapper dictDataMapper;
+
+    /**
+     * 项目启动时,初始化字典到缓存
+     */
+    @PostConstruct
+    public void init()
+    {
+        loadingDictCache();
+    }
+
+    /**
+     * 根据条件分页查询字典类型
+     *
+     * @param dictType 字典类型信息
+     * @return 字典类型集合信息
+     */
+    @Override
+    public List<SysDictType> selectDictTypeList(SysDictType dictType)
+    {
+        return dictTypeMapper.selectDictTypeList(dictType);
+    }
+
+    /**
+     * 根据所有字典类型
+     *
+     * @return 字典类型集合信息
+     */
+    @Override
+    public List<SysDictType> selectDictTypeAll()
+    {
+        return dictTypeMapper.selectDictTypeAll();
+    }
+
+    /**
+     * 根据字典类型查询字典数据
+     *
+     * @param dictType 字典类型
+     * @return 字典数据集合信息
+     */
+    @Override
+    public List<SysDictData> selectDictDataByType(String dictType)
+    {
+//        List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);
+//        if (ObjectUtils.isNotEmpty(dictDatas))
+//        {
+//            return dictDatas;
+//        }
+        List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dictType);
+        if (ObjectUtils.isNotEmpty(dictDatas))
+        {
+//            DictUtils.setDictCache(dictType, dictDatas);
+            return dictDatas;
+        }
+        return null;
+    }
+
+    /**
+     * 根据字典类型ID查询信息
+     *
+     * @param dictId 字典类型ID
+     * @return 字典类型
+     */
+    @Override
+    public SysDictType selectDictTypeById(Long dictId)
+    {
+        return dictTypeMapper.selectDictTypeById(dictId);
+    }
+
+    /**
+     * 根据字典类型查询信息
+     *
+     * @param dictType 字典类型
+     * @return 字典类型
+     */
+    @Override
+    public SysDictType selectDictTypeByType(String dictType)
+    {
+        return dictTypeMapper.selectDictTypeByType(dictType);
+    }
+
+    /**
+     * 批量删除字典类型信息
+     *
+     * @param dictIds 需要删除的字典ID
+     */
+    @Override
+    public void deleteDictTypeByIds(Long[] dictIds)
+    {
+        for (Long dictId : dictIds)
+        {
+            SysDictType dictType = selectDictTypeById(dictId);
+            if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0)
+            {
+                throw new ServiceException(String.format("%1$s已分配,不能删除", dictType.getDictName()));
+            }
+            dictTypeMapper.deleteDictTypeById(dictId);
+//            DictUtils.removeDictCache(dictType.getDictType());
+        }
+    }
+
+    /**
+     * 加载字典缓存数据
+     */
+    @Override
+    public void loadingDictCache()
+    {
+        SysDictData dictData = new SysDictData();
+        dictData.setStatus("0");
+        Map<String, List<SysDictData>> dictDataMap = dictDataMapper.selectDictDataList(dictData).stream().collect(Collectors.groupingBy(SysDictData::getDictType));
+        for (Map.Entry<String, List<SysDictData>> entry : dictDataMap.entrySet())
+        {
+//            DictUtils.setDictCache(entry.getKey(), entry.getValue().stream().sorted(Comparator.comparing(SysDictData::getDictSort)).collect(Collectors.toList()));
+        }
+    }
+
+    /**
+     * 清空字典缓存数据
+     */
+    @Override
+    public void clearDictCache()
+    {
+//        DictUtils.clearDictCache();
+    }
+
+    /**
+     * 重置字典缓存数据
+     */
+    @Override
+    public void resetDictCache()
+    {
+        clearDictCache();
+        loadingDictCache();
+    }
+
+    /**
+     * 新增保存字典类型信息
+     *
+     * @param dict 字典类型信息
+     * @return 结果
+     */
+    @Override
+    public int insertDictType(SysDictType dict)
+    {
+        int row = dictTypeMapper.insertDictType(dict);
+        if (row > 0)
+        {
+//            DictUtils.setDictCache(dict.getDictType(), null);
+        }
+        return row;
+    }
+
+    /**
+     * 修改保存字典类型信息
+     *
+     * @param dict 字典类型信息
+     * @return 结果
+     */
+    @Override
+    @Transactional
+    public int updateDictType(SysDictType dict)
+    {
+        SysDictType oldDict = dictTypeMapper.selectDictTypeById(dict.getDictId());
+        dictDataMapper.updateDictDataType(oldDict.getDictType(), dict.getDictType());
+        int row = dictTypeMapper.updateDictType(dict);
+        if (row > 0)
+        {
+            List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dict.getDictType());
+//            DictUtils.setDictCache(dict.getDictType(), dictDatas);
+        }
+        return row;
+    }
+
+    /**
+     * 校验字典类型称是否唯一
+     *
+     * @param dict 字典类型
+     * @return 结果
+     */
+    @Override
+    public boolean checkDictTypeUnique(SysDictType dict)
+    {
+        Long dictId = ObjectUtils.isEmpty(dict.getDictId()) ? -1L : dict.getDictId();
+        SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType());
+        if (ObjectUtils.isNotEmpty(dictType) && dictType.getDictId().longValue() != dictId.longValue())
+        {
+            return false;
+        }
+        return true;
+    }
+}

+ 238 - 0
yami-shop-service/src/main/java/com/yami/shop/utils/DictUtils.java

@@ -0,0 +1,238 @@
+//package com.yami.shop.utils;
+//
+//import com.yami.shop.bean.model.SysDictData;
+//import org.apache.commons.lang3.ObjectUtils;
+//import org.apache.commons.lang3.StringUtils;
+//import org.springframework.data.redis.cache.RedisCache;
+//
+//import java.util.List;
+//
+///**
+// * 字典工具类
+// *
+// * @author ruoyi
+// */
+//public class DictUtils
+//{
+//    /**
+//     * 分隔符
+//     */
+//    public static final String SEPARATOR = ",";
+//
+//    /**
+//     * 设置字典缓存
+//     *
+//     * @param key 参数键
+//     * @param dictDatas 字典数据列表
+//     */
+//    public static void setDictCache(String key, List<SysDictData> dictDatas)
+//    {
+//        SpringUtils.getBean(RedisCache.class).put(getCacheKey(key), dictDatas);
+//    }
+//
+//    /**
+//     * 获取字典缓存
+//     *
+//     * @param key 参数键
+//     * @return dictDatas 字典数据列表
+//     */
+//    public static List<SysDictData> getDictCache(String key)
+//    {
+////        JSONArray arrayCache = SpringUtils.getBean(RedisCache.class).(getCacheKey(key));
+////        if (ObjectUtils.isNotEmpty(arrayCache))
+////        {
+////            return arrayCache.toJavaList(SysDictData.class);
+////        }
+//        return null;
+//    }
+//
+//    /**
+//     * 根据字典类型和字典值获取字典标签
+//     *
+//     * @param dictType 字典类型
+//     * @param dictValue 字典值
+//     * @return 字典标签
+//     */
+//    public static String getDictLabel(String dictType, String dictValue)
+//    {
+//        if (StringUtils.isEmpty(dictValue))
+//        {
+//            return StringUtils.EMPTY;
+//        }
+//        return getDictLabel(dictType, dictValue, SEPARATOR);
+//    }
+//
+//    /**
+//     * 根据字典类型和字典标签获取字典值
+//     *
+//     * @param dictType 字典类型
+//     * @param dictLabel 字典标签
+//     * @return 字典值
+//     */
+//    public static String getDictValue(String dictType, String dictLabel)
+//    {
+//        if (StringUtils.isEmpty(dictLabel))
+//        {
+//            return StringUtils.EMPTY;
+//        }
+//        return getDictValue(dictType, dictLabel, SEPARATOR);
+//    }
+//
+//    /**
+//     * 根据字典类型和字典值获取字典标签
+//     *
+//     * @param dictType 字典类型
+//     * @param dictValue 字典值
+//     * @param separator 分隔符
+//     * @return 字典标签
+//     */
+//    public static String getDictLabel(String dictType, String dictValue, String separator)
+//    {
+//        StringBuilder propertyString = new StringBuilder();
+//        List<SysDictData> datas = getDictCache(dictType);
+//        if (ObjectUtils.isEmpty(datas))
+//        {
+//            return StringUtils.EMPTY;
+//        }
+//        if (StringUtils.containsAny(separator, dictValue))
+//        {
+//            for (SysDictData dict : datas)
+//            {
+//                for (String value : dictValue.split(separator))
+//                {
+//                    if (value.equals(dict.getDictValue()))
+//                    {
+//                        propertyString.append(dict.getDictLabel()).append(separator);
+//                        break;
+//                    }
+//                }
+//            }
+//        }
+//        else
+//        {
+//            for (SysDictData dict : datas)
+//            {
+//                if (dictValue.equals(dict.getDictValue()))
+//                {
+//                    return dict.getDictLabel();
+//                }
+//            }
+//        }
+//        return StringUtils.stripEnd(propertyString.toString(), separator);
+//    }
+//
+//    /**
+//     * 根据字典类型和字典标签获取字典值
+//     *
+//     * @param dictType 字典类型
+//     * @param dictLabel 字典标签
+//     * @param separator 分隔符
+//     * @return 字典值
+//     */
+//    public static String getDictValue(String dictType, String dictLabel, String separator)
+//    {
+//        StringBuilder propertyString = new StringBuilder();
+//        List<SysDictData> datas = getDictCache(dictType);
+//        if (ObjectUtils.isEmpty(datas))
+//        {
+//            return StringUtils.EMPTY;
+//        }
+//        if (StringUtils.containsAny(separator, dictLabel))
+//        {
+//            for (SysDictData dict : datas)
+//            {
+//                for (String label : dictLabel.split(separator))
+//                {
+//                    if (label.equals(dict.getDictLabel()))
+//                    {
+//                        propertyString.append(dict.getDictValue()).append(separator);
+//                        break;
+//                    }
+//                }
+//            }
+//        }
+//        else
+//        {
+//            for (SysDictData dict : datas)
+//            {
+//                if (dictLabel.equals(dict.getDictLabel()))
+//                {
+//                    return dict.getDictValue();
+//                }
+//            }
+//        }
+//        return StringUtils.stripEnd(propertyString.toString(), separator);
+//    }
+//
+//    /**
+//     * 根据字典类型获取字典所有值
+//     *
+//     * @param dictType 字典类型
+//     * @return 字典值
+//     */
+//    public static String getDictValues(String dictType)
+//    {
+//        StringBuilder propertyString = new StringBuilder();
+//        List<SysDictData> datas = getDictCache(dictType);
+//        if (ObjectUtils.isEmpty(datas))
+//        {
+//            return StringUtils.EMPTY;
+//        }
+//        for (SysDictData dict : datas)
+//        {
+//            propertyString.append(dict.getDictValue()).append(SEPARATOR);
+//        }
+//        return StringUtils.stripEnd(propertyString.toString(), SEPARATOR);
+//    }
+//
+//    /**
+//     * 根据字典类型获取字典所有标签
+//     *
+//     * @param dictType 字典类型
+//     * @return 字典值
+//     */
+//    public static String getDictLabels(String dictType)
+//    {
+//        StringBuilder propertyString = new StringBuilder();
+//        List<SysDictData> datas = getDictCache(dictType);
+//        if (ObjectUtils.isEmpty(datas))
+//        {
+//            return StringUtils.EMPTY;
+//        }
+//        for (SysDictData dict : datas)
+//        {
+//            propertyString.append(dict.getDictLabel()).append(SEPARATOR);
+//        }
+//        return StringUtils.stripEnd(propertyString.toString(), SEPARATOR);
+//    }
+//
+//    /**
+//     * 删除指定字典缓存
+//     *
+//     * @param key 字典键
+//     */
+//    public static void removeDictCache(String key)
+//    {
+////        SpringUtils.getBean(RedisCache.class).deleteObject(getCacheKey(key));
+//    }
+//
+//    /**
+//     * 清空字典缓存
+//     */
+//    public static void clearDictCache()
+//    {
+////        Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys("sys_dict" + "*");
+////        SpringUtils.getBean(RedisCache.class).deleteObject(keys);
+//    }
+//
+//    /**
+//     * 设置cache key
+//     *
+//     * @param configKey 参数键
+//     * @return 缓存键key
+//     */
+//    public static String getCacheKey(String configKey)
+//    {
+//        return "sys_dict" + configKey;
+//    }
+//}

+ 158 - 0
yami-shop-service/src/main/java/com/yami/shop/utils/SpringUtils.java

@@ -0,0 +1,158 @@
+package com.yami.shop.utils;
+
+import org.apache.commons.lang3.ObjectUtils;
+import org.springframework.aop.framework.AopContext;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.NoSuchBeanDefinitionException;
+import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Component;
+
+/**
+ * spring工具类 方便在非spring管理环境中获取bean
+ *
+ * @author ruoyi
+ */
+@Component
+public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationContextAware
+{
+    /** Spring应用上下文环境 */
+    private static ConfigurableListableBeanFactory beanFactory;
+
+    private static ApplicationContext applicationContext;
+
+    @Override
+    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
+    {
+        SpringUtils.beanFactory = beanFactory;
+    }
+
+    @Override
+    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
+    {
+        SpringUtils.applicationContext = applicationContext;
+    }
+
+    /**
+     * 获取对象
+     *
+     * @param name
+     * @return Object 一个以所给名字注册的bean的实例
+     * @throws BeansException
+     *
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> T getBean(String name) throws BeansException
+    {
+        return (T) beanFactory.getBean(name);
+    }
+
+    /**
+     * 获取类型为requiredType的对象
+     *
+     * @param clz
+     * @return
+     * @throws BeansException
+     *
+     */
+    public static <T> T getBean(Class<T> clz) throws BeansException
+    {
+        T result = (T) beanFactory.getBean(clz);
+        return result;
+    }
+
+    /**
+     * 如果BeanFactory包含一个与所给名称匹配的bean定义,则返回true
+     *
+     * @param name
+     * @return boolean
+     */
+    public static boolean containsBean(String name)
+    {
+        return beanFactory.containsBean(name);
+    }
+
+    /**
+     * 判断以给定名字注册的bean定义是一个singleton还是一个prototype。 如果与给定名字相应的bean定义没有被找到,将会抛出一个异常(NoSuchBeanDefinitionException)
+     *
+     * @param name
+     * @return boolean
+     * @throws NoSuchBeanDefinitionException
+     *
+     */
+    public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException
+    {
+        return beanFactory.isSingleton(name);
+    }
+
+    /**
+     * @param name
+     * @return Class 注册对象的类型
+     * @throws NoSuchBeanDefinitionException
+     *
+     */
+    public static Class<?> getType(String name) throws NoSuchBeanDefinitionException
+    {
+        return beanFactory.getType(name);
+    }
+
+    /**
+     * 如果给定的bean名字在bean定义中有别名,则返回这些别名
+     *
+     * @param name
+     * @return
+     * @throws NoSuchBeanDefinitionException
+     *
+     */
+    public static String[] getAliases(String name) throws NoSuchBeanDefinitionException
+    {
+        return beanFactory.getAliases(name);
+    }
+
+    /**
+     * 获取aop代理对象
+     *
+     * @param invoker
+     * @return
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> T getAopProxy(T invoker)
+    {
+        return (T) AopContext.currentProxy();
+    }
+
+    /**
+     * 获取当前的环境配置,无配置返回null
+     *
+     * @return 当前的环境配置
+     */
+    public static String[] getActiveProfiles()
+    {
+        return applicationContext.getEnvironment().getActiveProfiles();
+    }
+
+    /**
+     * 获取当前的环境配置,当有多个环境配置时,只获取第一个
+     *
+     * @return 当前的环境配置
+     */
+    public static String getActiveProfile()
+    {
+        final String[] activeProfiles = getActiveProfiles();
+        return ObjectUtils.isNotEmpty(activeProfiles) ? activeProfiles[0] : null;
+    }
+
+    /**
+     * 获取配置文件中的值
+     *
+     * @param key 配置文件的key
+     * @return 当前的配置文件的值
+     *
+     */
+    public static String getRequiredProperty(String key)
+    {
+        return applicationContext.getEnvironment().getRequiredProperty(key);
+    }
+}

+ 9 - 15
yami-shop-service/src/main/resources/mapper/CategoryPropMapper.xml → yami-shop-service/src/main/resources/mapper/CategoryProdMapper.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.dao.CategoryPropMapper">
-  <resultMap id="BaseResultMap" type="com.yami.shop.bean.model.CategoryProp">
+<mapper namespace="com.yami.shop.dao.CategoryProdMapper">
+  <resultMap id="BaseResultMap" type="com.yami.shop.bean.model.CategoryProd">
     <!--
       WARNING - @mbg.generated
     -->
@@ -9,19 +9,13 @@
     <result column="category_id" jdbcType="BIGINT" property="categoryId" />
     <result column="prop_id" jdbcType="BIGINT" property="propId" />
   </resultMap>
-  
-  <insert id="insertCategoryProp">
-  	insert into tz_category_prop (category_id,prop_id) values
-  	<foreach collection="propIds" item="propId" separator=",">
-  		(#{categoryId},#{propId})
-  	</foreach>
-  </insert>
-  
+
+
   <delete id="deleteByCategoryId">
-  	delete from tz_category_prop where category_id = #{categoryId}
+  	delete from tz_category_prod where category_id = #{categoryId}
   </delete>
-  
-  <delete id="deleteByPropId">
-  	delete from tz_category_prop where prop_id = #{propId}
+
+  <delete id="deleteByProdId">
+  	delete from tz_category_prod where prod_id = #{prodId}
   </delete>
-</mapper>
+</mapper>

+ 20 - 0
yami-shop-service/src/main/resources/mapper/DeptMapper.xml

@@ -76,5 +76,25 @@
         WHERE du.user_id = #{userId} AND d.is_delete = 0
         ORDER BY d.parent_id, d.seq
     </select>
+    <select id="selectListAll" resultType="com.yami.shop.bean.model.Dept">
+        SELECT
+            dept.dept_id,
+            dept.dept_name,
+            dept.description,
+            dept.parent_id,
+            dept.level,
+            dept.seq,
+            dept.status,
+            dept.is_delete,
+            dept.leader_user_id,
+            dept.phone,
+            dept.email,
+            dept.create_time,
+            dept.update_time,
+            tsu.username as leaderUserName
+        FROM tz_sys_dept dept left join tz_sys_user tsu on dept.leader_user_id = tsu.user_id
+        WHERE dept.is_delete = 0
+        ORDER BY dept.seq
+    </select>
 
 </mapper>

+ 18 - 0
yami-shop-service/src/main/resources/mapper/FrontCategoryMapper.xml

@@ -0,0 +1,18 @@
+<?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.dao.FrontCategoryMapper">
+
+
+    <select id="selectListName" resultType="com.yami.shop.bean.model.FrontCategory">
+        SELECT
+        *
+        FROM
+        tz_front_category
+        WHERE
+        is_delete = 0
+        AND name = #{name}
+
+#         AND level = 2
+    </select>
+
+</mapper>

+ 14 - 0
yami-shop-service/src/main/resources/mapper/ShopCategoryMapper.xml

@@ -0,0 +1,14 @@
+<?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.dao.ShopCategoryMapper">
+
+    <select id="treeShopCategory" resultType="com.yami.shop.bean.vo.FrontCategoryVO">
+        SELECT s.*
+        FROM tz_shop_category s
+                 left join tz_front_category f on s.code = f.code
+        where s.shop_id = #{shopId}
+          and s.is_delete = 0
+          and f.is_delete = 0
+    </select>
+
+</mapper>

+ 4 - 4
yami-shop-service/src/main/resources/mapper/ShopProdMapper.xml → yami-shop-service/src/main/resources/mapper/ShopSkuMapper.xml

@@ -1,15 +1,15 @@
 <?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.dao.ShopProdMapper">
+<mapper namespace="com.yami.shop.dao.ShopSkuMapper">
 
 
-  <resultMap id="shopProdMap" type="com.yami.shop.bean.model.ShopProd">
+  <resultMap id="shopProdMap" type="com.yami.shop.bean.model.ShopSku">
     <id column="id" property="id"/>
     <result column="shop_id" property="shopId"/>
     <result column="sku_id" property="skuId"/>
-    <result column="shop_prod_price" property="shopProdPrice"/>
-    <result column="shop_prod_stocks" property="shopProdStocks"/>
+    <result column="shop_prod_price" property="shopSkuPrice"/>
+    <result column="shop_prod_stocks" property="shopSkuStocks"/>
     <result column="is_delete" property="isDelete"/>
     <result column="update_time" property="updateTime"/>
     <result column="rec_time" property="recTime"/>

+ 121 - 0
yami-shop-service/src/main/resources/mapper/SysDictDataMapper.xml

@@ -0,0 +1,121 @@
+<?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.dao.SysDictDataMapper">
+	<resultMap type="com.yami.shop.bean.model.SysDictData" id="SysDictDataResult">
+		<id     property="dictCode"   column="dict_code"   />
+		<result property="dictSort"   column="dict_sort"   />
+		<result property="dictLabel"  column="dict_label"  />
+		<result property="dictValue"  column="dict_value"  />
+		<result property="dictType"   column="dict_type"   />
+		<result property="cssClass"   column="css_class"   />
+		<result property="listClass"  column="list_class"  />
+		<result property="isDefault"  column="is_default"  />
+		<result property="status"     column="status"      />
+		<result property="createBy"   column="create_by"   />
+		<result property="createTime" column="create_time" />
+		<result property="updateBy"   column="update_by"   />
+		<result property="updateTime" column="update_time" />
+	</resultMap>
+
+	<sql id="selectDictDataVo">
+        select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark
+		from sys_dict_data
+    </sql>
+
+	<select id="selectDictDataList" parameterType="com.yami.shop.bean.model.SysDictData" resultMap="SysDictDataResult">
+	    <include refid="selectDictDataVo"/>
+		<where>
+		    <if test="dictType != null and dictType != ''">
+				AND dict_type = #{dictType}
+			</if>
+			<if test="dictLabel != null and dictLabel != ''">
+				AND dict_label like concat('%', #{dictLabel}, '%')
+			</if>
+			<if test="status != null and status != ''">
+				AND status = #{status}
+			</if>
+		</where>
+		order by dict_sort asc
+	</select>
+
+	<select id="selectDictDataByType" parameterType="String" resultMap="SysDictDataResult">
+		<include refid="selectDictDataVo"/>
+		where status = '0' and dict_type = #{dictType} order by dict_sort asc
+	</select>
+
+	<select id="selectDictLabel" resultType="String">
+		select dict_label from sys_dict_data
+		where dict_type = #{dictType} and dict_value = #{dictValue}
+	</select>
+
+	<select id="selectDictDataById" parameterType="Long" resultMap="SysDictDataResult">
+		<include refid="selectDictDataVo"/>
+		where dict_code = #{dictCode}
+	</select>
+
+	<select id="countDictDataByType" resultType="Integer">
+	    select count(1) from sys_dict_data where dict_type=#{dictType}
+	</select>
+
+	<delete id="deleteDictDataById" parameterType="Long">
+ 		delete from sys_dict_data where dict_code = #{dictCode}
+ 	</delete>
+
+ 	<delete id="deleteDictDataByIds" parameterType="Long">
+ 		delete from sys_dict_data where dict_code in
+ 		<foreach collection="array" item="dictCode" open="(" separator="," close=")">
+ 			#{dictCode}
+        </foreach>
+ 	</delete>
+
+	<update id="updateDictData" parameterType="com.yami.shop.bean.model.SysDictData">
+ 		update sys_dict_data
+ 		<set>
+ 			<if test="dictSort != null">dict_sort = #{dictSort},</if>
+ 			<if test="dictLabel != null and dictLabel != ''">dict_label = #{dictLabel},</if>
+ 			<if test="dictValue != null and dictValue != ''">dict_value = #{dictValue},</if>
+ 			<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
+ 			<if test="cssClass != null">css_class = #{cssClass},</if>
+ 			<if test="listClass != null">list_class = #{listClass},</if>
+ 			<if test="isDefault != null and isDefault != ''">is_default = #{isDefault},</if>
+ 			<if test="status != null">status = #{status},</if>
+ 			<if test="remark != null">remark = #{remark},</if>
+ 			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+ 			update_time = sysdate()
+ 		</set>
+ 		where dict_code = #{dictCode}
+	</update>
+
+	<update id="updateDictDataType" parameterType="String">
+ 		update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
+	</update>
+
+ 	<insert id="insertDictData" parameterType="com.yami.shop.bean.model.SysDictData">
+ 		insert into sys_dict_data(
+ 			<if test="dictSort != null">dict_sort,</if>
+ 			<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
+ 			<if test="dictValue != null and dictValue != ''">dict_value,</if>
+ 			<if test="dictType != null and dictType != ''">dict_type,</if>
+ 			<if test="cssClass != null and cssClass != ''">css_class,</if>
+ 			<if test="listClass != null and listClass != ''">list_class,</if>
+ 			<if test="isDefault != null and isDefault != ''">is_default,</if>
+ 			<if test="status != null">status,</if>
+ 			<if test="remark != null and remark != ''">remark,</if>
+ 			<if test="createBy != null and createBy != ''">create_by,</if>
+ 			create_time
+ 		)values(
+ 		    <if test="dictSort != null">#{dictSort},</if>
+ 		    <if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if>
+ 			<if test="dictValue != null and dictValue != ''">#{dictValue},</if>
+ 			<if test="dictType != null and dictType != ''">#{dictType},</if>
+ 			<if test="cssClass != null and cssClass != ''">#{cssClass},</if>
+ 			<if test="listClass != null and listClass != ''">#{listClass},</if>
+ 			<if test="isDefault != null and isDefault != ''">#{isDefault},</if>
+ 			<if test="status != null">#{status},</if>
+ 			<if test="remark != null and remark != ''">#{remark},</if>
+ 			<if test="createBy != null and createBy != ''">#{createBy},</if>
+ 			sysdate()
+ 		)
+	</insert>
+
+</mapper>

+ 103 - 0
yami-shop-service/src/main/resources/mapper/SysDictTypeMapper.xml

@@ -0,0 +1,103 @@
+<?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.dao.SysDictTypeMapper">
+
+	<resultMap type="com.yami.shop.bean.model.SysDictType" id="SysDictTypeResult">
+		<id     property="dictId"     column="dict_id"     />
+		<result property="dictName"   column="dict_name"   />
+		<result property="dictType"   column="dict_type"   />
+		<result property="status"     column="status"      />
+		<result property="createBy"   column="create_by"   />
+		<result property="createTime" column="create_time" />
+		<result property="updateBy"   column="update_by"   />
+		<result property="updateTime" column="update_time" />
+	</resultMap>
+
+	<sql id="selectDictTypeVo">
+        select dict_id, dict_name, dict_type, status, create_by, create_time, remark
+		from sys_dict_type
+    </sql>
+
+	<select id="selectDictTypeList" parameterType="com.yami.shop.bean.model.SysDictType" resultMap="SysDictTypeResult">
+	    <include refid="selectDictTypeVo"/>
+		<where>
+		    <if test="dictName != null and dictName != ''">
+				AND dict_name like concat('%', #{dictName}, '%')
+			</if>
+			<if test="status != null and status != ''">
+				AND status = #{status}
+			</if>
+			<if test="dictType != null and dictType != ''">
+				AND dict_type like concat('%', #{dictType}, '%')
+			</if>
+			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
+				and date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
+			</if>
+			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
+				and date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
+			</if>
+	    </where>
+	</select>
+
+	<select id="selectDictTypeAll" resultMap="SysDictTypeResult">
+		<include refid="selectDictTypeVo"/>
+	</select>
+
+	<select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult">
+		<include refid="selectDictTypeVo"/>
+		where dict_id = #{dictId}
+	</select>
+
+	<select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult">
+		<include refid="selectDictTypeVo"/>
+		where dict_type = #{dictType}
+	</select>
+
+	<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
+		<include refid="selectDictTypeVo"/>
+		where dict_type = #{dictType} limit 1
+	</select>
+
+	<delete id="deleteDictTypeById" parameterType="Long">
+ 		delete from sys_dict_type where dict_id = #{dictId}
+ 	</delete>
+
+ 	<delete id="deleteDictTypeByIds" parameterType="Long">
+ 		delete from sys_dict_type where dict_id in
+ 		<foreach collection="array" item="dictId" open="(" separator="," close=")">
+ 			#{dictId}
+        </foreach>
+ 	</delete>
+
+ 	<update id="updateDictType" parameterType="com.yami.shop.bean.model.SysDictType">
+ 		update sys_dict_type
+ 		<set>
+ 			<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
+ 			<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
+ 			<if test="status != null">status = #{status},</if>
+ 			<if test="remark != null">remark = #{remark},</if>
+ 			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+ 			update_time = sysdate()
+ 		</set>
+ 		where dict_id = #{dictId}
+	</update>
+
+ 	<insert id="insertDictType" parameterType="com.yami.shop.bean.model.SysDictType">
+ 		insert into sys_dict_type(
+ 			<if test="dictName != null and dictName != ''">dict_name,</if>
+ 			<if test="dictType != null and dictType != ''">dict_type,</if>
+ 			<if test="status != null">status,</if>
+ 			<if test="remark != null and remark != ''">remark,</if>
+ 			<if test="createBy != null and createBy != ''">create_by,</if>
+ 			create_time
+ 		)values(
+ 			<if test="dictName != null and dictName != ''">#{dictName},</if>
+ 			<if test="dictType != null and dictType != ''">#{dictType},</if>
+ 			<if test="status != null">#{status},</if>
+ 			<if test="remark != null and remark != ''">#{remark},</if>
+ 			<if test="createBy != null and createBy != ''">#{createBy},</if>
+ 			sysdate()
+ 		)
+	</insert>
+
+</mapper>

+ 2 - 3
yami-shop-sys/src/main/java/com/yami/shop/sys/controller/SysMenuController.java

@@ -128,11 +128,11 @@ public class SysMenuController{
 	@SysLog("保存菜单")
 	@PostMapping
 //	@PreAuthorize("@pms.hasPermission('sys:menu:save')")
-	public ResponseEntity<Void> save(@Valid @RequestBody SysMenu menu){
+	public R<Void> save(@Valid @RequestBody SysMenu menu){
 		//数据校验
 		verifyForm(menu);
 		sysMenuService.save(menu);
-		return ResponseEntity.ok().build();
+		return R.SUCCESS();
 	}
 
 	/**
@@ -151,7 +151,6 @@ public class SysMenuController{
 			}
 		}
 		sysMenuService.updateById(menu);
-
 		return R.SUCCESS();
 	}
 

Some files were not shown because too many files changed in this diff