yangyb преди 1 месец
родител
ревизия
63a7e1fc31
променени са 19 файла, в които са добавени 1047 реда и са изтрити 61 реда
  1. 4 0
      mall-api/pom.xml
  2. 38 61
      mall-api/src/main/java/com/txz/mall/dto/CategoryDTO.java
  3. 31 0
      mall-api/src/main/java/com/txz/mall/dto/CategorySearchDTO.java
  4. 215 0
      mall-api/src/main/java/com/txz/mall/dto/StoreProductAttrResultDTO.java
  5. 189 0
      mall-api/src/main/java/com/txz/mall/dto/StoreProductRuleDTO.java
  6. 27 0
      mall-interface/src/main/java/com/txz/mall/service/StoreProductAttrResultServiceClient.java
  7. 27 0
      mall-interface/src/main/java/com/txz/mall/service/StoreProductRuleServiceClient.java
  8. 137 0
      mall-service/src/main/java/com/txz/mall/controller/StoreProductAttrResultController.java
  9. 137 0
      mall-service/src/main/java/com/txz/mall/controller/StoreProductRuleController.java
  10. 7 0
      mall-service/src/main/java/com/txz/mall/dao/StoreProductAttrResultMapper.java
  11. 7 0
      mall-service/src/main/java/com/txz/mall/dao/StoreProductRuleMapper.java
  12. 67 0
      mall-service/src/main/java/com/txz/mall/model/StoreProductAttrResult.java
  13. 58 0
      mall-service/src/main/java/com/txz/mall/model/StoreProductRule.java
  14. 12 0
      mall-service/src/main/java/com/txz/mall/service/StoreProductAttrResultService.java
  15. 12 0
      mall-service/src/main/java/com/txz/mall/service/StoreProductRuleService.java
  16. 22 0
      mall-service/src/main/java/com/txz/mall/service/impl/StoreProductAttrResultServiceImpl.java
  17. 22 0
      mall-service/src/main/java/com/txz/mall/service/impl/StoreProductRuleServiceImpl.java
  18. 18 0
      mall-service/src/main/resources/mapper/StoreProductAttrResultMapper.xml
  19. 17 0
      mall-service/src/main/resources/mapper/StoreProductRuleMapper.xml

+ 4 - 0
mall-api/pom.xml

@@ -43,6 +43,10 @@
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-annotations</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.hibernate.validator</groupId>
+            <artifactId>hibernate-validator</artifactId>
+        </dependency>
         <!--        <dependency>-->
 <!--            <groupId>org.springframework.data</groupId>-->
 <!--            <artifactId>spring-data-redis</artifactId>-->

+ 38 - 61
mall-api/src/main/java/com/txz/mall/dto/CategoryDTO.java

@@ -1,79 +1,56 @@
-/*
- *
- * CategoryDTO.java
- * Copyright(C) 2017-2020 fendo公司
- * @date 2025-07-11
- */
 package com.txz.mall.dto;
 
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.hibernate.validator.constraints.Length;
+import org.hibernate.validator.constraints.Range;
+
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
 import java.io.Serializable;
-import java.util.Date;
 
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "Category对象", description = "分类表")
 public class CategoryDTO implements Serializable {
-    private Long id;
 
-    /**
-     * 父级ID
-     */
-    private Long pid;
+    private static final long serialVersionUID = 1L;
 
-    /**
-     * 路径
-     */
-    private String path;
+    @ApiModelProperty(value = "父级ID")
+    @NotNull(message = "请选择父级分类")
+    @Min(value = 0, message = "请选择父级分类")
+    private Integer pid;
 
-    /**
-     * 分类名称
-     */
+    @ApiModelProperty(value = "分类名称")
+    @NotBlank(message = "分类名称必须填写")
+    @Length(max = 50, message = "分类名称不能超过50个字符")
     private String name;
 
-    /**
-     * 类型,1 产品分类,2 附件分类,3 文章分类, 4 设置分类, 5 菜单分类,6 配置分类, 7 秒杀配置
-     */
+    @ApiModelProperty(value = "类型,类型,1 产品分类,2 附件分类,3 文章分类, 4 设置分类, 5 菜单分类, 6 配置分类, 7 秒杀配置")
+    @NotNull(message = "类型必须选择")
+    @Range(min = 1, max = 6, message = "类型,1 产品分类,2 附件分类,3 文章分类, 4 设置分类, 5 菜单分类, 6 配置分类, 7 秒杀配置之间")
     private Integer type;
 
-    /**
-     * 地址
-     */
+    @ApiModelProperty(value = "地址")
+//    @NotBlank(message = "地址名称必须填写")
     private String url;
 
-    /**
-     * 状态, 1正常,0失效
-     */
-    private Integer status;
-
-    /**
-     * 排序
-     */
-    private Integer sort;
-
-    /**
-     * 创建时间
-     */
-    private Date createTime;
-
-    /**
-     * 更新时间
-     */
-    private Date updateTime;
-
-    /**
-     * 扩展字段 Jsos格式
-     */
+    @ApiModelProperty(value = "扩展字段")
     private String extra;
 
-    /**
-     * 创建人id
-     */
-    private Long createUserId;
+    @ApiModelProperty(value = "状态, 0正常,1失效")
+    @NotNull(message = "状态必须选择")
+    private Boolean status;
 
-    /**
-     * 更新人id
-     */
-    private Long updateUserId;
+    @ApiModelProperty(value = "排序")
+    @NotNull(message = "排序数字为空")
+    @Min(value = 0, message = "排序数字必须大于等于0")
+    private Integer sort;
 
-    /**
-     * 是否删除
-     */
-    private Integer isDelete;
-}
+}

+ 31 - 0
mall-api/src/main/java/com/txz/mall/dto/CategorySearchDTO.java

@@ -0,0 +1,31 @@
+package com.txz.mall.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "Category对象", description = "分类表")
+public class CategorySearchDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "父级ID")
+    private Integer pid;
+
+    @ApiModelProperty(value = "分类名称")
+    private String name;
+
+    @ApiModelProperty(value = "类型ID | 类型,1 产品分类,2 附件分类,3 文章分类, 4 设置分类, 5 菜单分类, 6 配置分类, 7 秒杀配置")
+    private Integer type;
+
+    @ApiModelProperty(value = "状态, 1正常,0失效 -1全部")
+    private Integer status;
+
+}

+ 215 - 0
mall-api/src/main/java/com/txz/mall/dto/StoreProductAttrResultDTO.java

@@ -0,0 +1,215 @@
+/*
+ *
+ * StoreProductAttrResultDTO.java
+ * Copyright(C) 2017-2020 fendo公司
+ * @date 2025-07-11
+ */
+package com.txz.mall.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class StoreProductAttrResultDTO implements Serializable {
+    /**
+     * m_store_product_attr_result
+     */
+    private static final long serialVersionUID = 1L;
+    /**
+     * 主键
+     */
+    private Long id;
+    /**
+     * 商品ID
+     */
+    private Long productId;
+    /**
+     * 活动类型 0=商品,1=秒杀,2=砍价,3=拼团
+     */
+    private Boolean type;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+    /**
+     * 创建人id
+     */
+    private Long createUserId;
+    /**
+     * 更新人id
+     */
+    private Long updateUserId;
+    /**
+     * 是否删除
+     */
+    private Byte isDelete;
+    /**
+     * 商品属性参数
+     */
+    private String result;
+
+    /**
+     * 主键
+     *
+     * @return id 主键
+     */
+    public Long getId() {
+        return id;
+    }
+
+    /**
+     * 主键
+     *
+     * @param id 主键
+     */
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    /**
+     * 商品ID
+     *
+     * @return product_id 商品ID
+     */
+    public Long getProductId() {
+        return productId;
+    }
+
+    /**
+     * 商品ID
+     *
+     * @param productId 商品ID
+     */
+    public void setProductId(Long productId) {
+        this.productId = productId;
+    }
+
+    /**
+     * 活动类型 0=商品,1=秒杀,2=砍价,3=拼团
+     *
+     * @return type 活动类型 0=商品,1=秒杀,2=砍价,3=拼团
+     */
+    public Boolean getType() {
+        return type;
+    }
+
+    /**
+     * 活动类型 0=商品,1=秒杀,2=砍价,3=拼团
+     *
+     * @param type 活动类型 0=商品,1=秒杀,2=砍价,3=拼团
+     */
+    public void setType(Boolean type) {
+        this.type = type;
+    }
+
+    /**
+     * 创建时间
+     *
+     * @return create_time 创建时间
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    /**
+     * 创建时间
+     *
+     * @param createTime 创建时间
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * 更新时间
+     *
+     * @return update_time 更新时间
+     */
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    /**
+     * 更新时间
+     *
+     * @param updateTime 更新时间
+     */
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    /**
+     * 创建人id
+     *
+     * @return create_user_id 创建人id
+     */
+    public Long getCreateUserId() {
+        return createUserId;
+    }
+
+    /**
+     * 创建人id
+     *
+     * @param createUserId 创建人id
+     */
+    public void setCreateUserId(Long createUserId) {
+        this.createUserId = createUserId;
+    }
+
+    /**
+     * 更新人id
+     *
+     * @return update_user_id 更新人id
+     */
+    public Long getUpdateUserId() {
+        return updateUserId;
+    }
+
+    /**
+     * 更新人id
+     *
+     * @param updateUserId 更新人id
+     */
+    public void setUpdateUserId(Long updateUserId) {
+        this.updateUserId = updateUserId;
+    }
+
+    /**
+     * 是否删除
+     *
+     * @return is_delete 是否删除
+     */
+    public Byte getIsDelete() {
+        return isDelete;
+    }
+
+    /**
+     * 是否删除
+     *
+     * @param isDelete 是否删除
+     */
+    public void setIsDelete(Byte isDelete) {
+        this.isDelete = isDelete;
+    }
+
+    /**
+     * 商品属性参数
+     *
+     * @return result 商品属性参数
+     */
+    public String getResult() {
+        return result;
+    }
+
+    /**
+     * 商品属性参数
+     *
+     * @param result 商品属性参数
+     */
+    public void setResult(String result) {
+        this.result = result;
+    }
+}

+ 189 - 0
mall-api/src/main/java/com/txz/mall/dto/StoreProductRuleDTO.java

@@ -0,0 +1,189 @@
+/*
+ *
+ * StoreProductRuleDTO.java
+ * Copyright(C) 2017-2020 fendo公司
+ * @date 2025-07-11
+ */
+package com.txz.mall.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class StoreProductRuleDTO implements Serializable {
+    /**
+     * m_store_product_rule
+     */
+    private static final long serialVersionUID = 1L;
+    /**
+     *
+     */
+    private Long id;
+    /**
+     * 规格名称
+     */
+    private String ruleName;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+    /**
+     * 创建人id
+     */
+    private Long createUserId;
+    /**
+     * 更新人id
+     */
+    private Long updateUserId;
+    /**
+     * 是否删除
+     */
+    private Byte isDelete;
+    /**
+     * 规格值
+     */
+    private String ruleValue;
+
+    /**
+     * @return id
+     */
+    public Long getId() {
+        return id;
+    }
+
+    /**
+     * @param id
+     */
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    /**
+     * 规格名称
+     *
+     * @return rule_name 规格名称
+     */
+    public String getRuleName() {
+        return ruleName;
+    }
+
+    /**
+     * 规格名称
+     *
+     * @param ruleName 规格名称
+     */
+    public void setRuleName(String ruleName) {
+        this.ruleName = ruleName;
+    }
+
+    /**
+     * 创建时间
+     *
+     * @return create_time 创建时间
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    /**
+     * 创建时间
+     *
+     * @param createTime 创建时间
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * 更新时间
+     *
+     * @return update_time 更新时间
+     */
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    /**
+     * 更新时间
+     *
+     * @param updateTime 更新时间
+     */
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    /**
+     * 创建人id
+     *
+     * @return create_user_id 创建人id
+     */
+    public Long getCreateUserId() {
+        return createUserId;
+    }
+
+    /**
+     * 创建人id
+     *
+     * @param createUserId 创建人id
+     */
+    public void setCreateUserId(Long createUserId) {
+        this.createUserId = createUserId;
+    }
+
+    /**
+     * 更新人id
+     *
+     * @return update_user_id 更新人id
+     */
+    public Long getUpdateUserId() {
+        return updateUserId;
+    }
+
+    /**
+     * 更新人id
+     *
+     * @param updateUserId 更新人id
+     */
+    public void setUpdateUserId(Long updateUserId) {
+        this.updateUserId = updateUserId;
+    }
+
+    /**
+     * 是否删除
+     *
+     * @return is_delete 是否删除
+     */
+    public Byte getIsDelete() {
+        return isDelete;
+    }
+
+    /**
+     * 是否删除
+     *
+     * @param isDelete 是否删除
+     */
+    public void setIsDelete(Byte isDelete) {
+        this.isDelete = isDelete;
+    }
+
+    /**
+     * 规格值
+     *
+     * @return rule_value 规格值
+     */
+    public String getRuleValue() {
+        return ruleValue;
+    }
+
+    /**
+     * 规格值
+     *
+     * @param ruleValue 规格值
+     */
+    public void setRuleValue(String ruleValue) {
+        this.ruleValue = ruleValue;
+    }
+}

+ 27 - 0
mall-interface/src/main/java/com/txz/mall/service/StoreProductAttrResultServiceClient.java

@@ -0,0 +1,27 @@
+package com.txz.mall.service;
+
+
+import com.txz.mall.dto.*;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.*;
+import java.util.List;
+
+
+@FeignClient("mall")
+public interface StoreProductAttrResultServiceClient {
+
+	@RequestMapping( value = {"/store/product/attr/result/add"}, method = {RequestMethod.POST} )
+    public Result add(@RequestBody StoreProductAttrResultDPO storeProductAttrResult,@RequestParam("userId") Long userId);
+
+	@RequestMapping( value = {"/store/product/attr/result/delete"}, method = {RequestMethod.POST} )
+	public Result delete(@RequestParam("id") Integer id,@RequestParam("userId") Long userId);
+
+	@RequestMapping( value = {"/store/product/attr/result/update"}, method = {RequestMethod.POST} )
+	public Result update(@RequestBody StoreProductAttrResultDPO storeProductAttrResult,@RequestParam("userId") Long userId);
+
+	@RequestMapping( value = {"/store/product/attr/result/detail"}, method = {RequestMethod.POST} )
+	public Result<StoreProductAttrResultDPO> detail(@RequestParam("id") Integer id,@RequestParam("userId") Long userId);
+
+	@RequestMapping( value = {"/store/product/attr/result/list"}, method = {RequestMethod.POST} )
+	public Result<List<StoreProductAttrResultDPO>> list(@RequestBody StoreProductAttrResultDPO storeProductAttrResult, @RequestParam("page") Integer page, @RequestParam("size") Integer size,@RequestParam("userId") Long userId);
+}

+ 27 - 0
mall-interface/src/main/java/com/txz/mall/service/StoreProductRuleServiceClient.java

@@ -0,0 +1,27 @@
+package com.txz.mall.service;
+
+
+import com.txz.mall.dto.*;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.*;
+import java.util.List;
+
+
+@FeignClient("mall")
+public interface StoreProductRuleServiceClient {
+
+	@RequestMapping( value = {"/store/product/rule/add"}, method = {RequestMethod.POST} )
+    public Result add(@RequestBody StoreProductRuleDPO storeProductRule,@RequestParam("userId") Long userId);
+
+	@RequestMapping( value = {"/store/product/rule/delete"}, method = {RequestMethod.POST} )
+	public Result delete(@RequestParam("id") Integer id,@RequestParam("userId") Long userId);
+
+	@RequestMapping( value = {"/store/product/rule/update"}, method = {RequestMethod.POST} )
+	public Result update(@RequestBody StoreProductRuleDPO storeProductRule,@RequestParam("userId") Long userId);
+
+	@RequestMapping( value = {"/store/product/rule/detail"}, method = {RequestMethod.POST} )
+	public Result<StoreProductRuleDPO> detail(@RequestParam("id") Integer id,@RequestParam("userId") Long userId);
+
+	@RequestMapping( value = {"/store/product/rule/list"}, method = {RequestMethod.POST} )
+	public Result<List<StoreProductRuleDPO>> list(@RequestBody StoreProductRuleDPO storeProductRule, @RequestParam("page") Integer page, @RequestParam("size") Integer size,@RequestParam("userId") Long userId);
+}

+ 137 - 0
mall-service/src/main/java/com/txz/mall/controller/StoreProductAttrResultController.java

@@ -0,0 +1,137 @@
+package com.txz.mall.controller;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.txz.mall.core.Result;
+import com.txz.mall.core.ResultCode;
+import com.txz.mall.model.StoreProductAttrResult;
+import com.txz.mall.service.StoreProductAttrResultService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.bind.annotation.*;
+import tk.mybatis.mapper.entity.Condition;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created by CodeGenerator on 2025/07/11.
+ */
+@Api(tags = "[后台]商品属性管理")
+@RestController
+@RequestMapping("/store/product/attr/result")
+public class StoreProductAttrResultController {
+
+    private static Logger log = LoggerFactory.getLogger(StoreProductAttrResultController.class);
+
+    @Resource
+    private StoreProductAttrResultService storeProductAttrResultService;
+
+    @PostMapping("/add")
+    @ApiOperation(value = "商品属性新增", httpMethod = "POST")
+    public Result add(@RequestBody StoreProductAttrResult storeProductAttrResult, Long userId) {
+        if (storeProductAttrResult == null) {
+            return Result.fail(ResultCode.OBJECT_IS_NULL);
+        }
+        if (userId == null) {
+            return Result.fail(ResultCode.USERID_IS_NULL);
+        }
+        try {
+            storeProductAttrResult.setCreateTime(new Date());
+            storeProductAttrResult.setCreateUserId(userId);
+            storeProductAttrResultService.save(storeProductAttrResult);
+        } catch (Exception e) {
+            log.error("新增对象操作异常e:{}", e);
+            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        return Result.success();
+    }
+
+    @PostMapping("/delete")
+    @ApiOperation(value = "商品属性删除", httpMethod = "POST")
+    public Result delete(@RequestParam Long id, Long userId) {
+        if (id == null) {
+            return Result.fail(ResultCode.ID_IS_NULL);
+        }
+        if (userId == null) {
+            return Result.fail(ResultCode.USERID_IS_NULL);
+        }
+        try {
+            StoreProductAttrResult storeProductAttrResult = new StoreProductAttrResult();
+            storeProductAttrResult.setId(id);
+            storeProductAttrResult.setIsDelete(1);
+            storeProductAttrResultService.update(storeProductAttrResult);
+        } catch (Exception e) {
+            log.error("删除对象操作异常e:{}", e);
+            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        return Result.success();
+    }
+
+    @PostMapping("/update")
+    @ApiOperation(value = "商品属性更新", httpMethod = "POST")
+    public Result update(@RequestBody StoreProductAttrResult storeProductAttrResult, Long userId) {
+        if (storeProductAttrResult == null) {
+            return Result.fail(ResultCode.OBJECT_IS_NULL);
+        }
+        if (storeProductAttrResult.getId() == null) {
+            return Result.fail(ResultCode.ID_IS_NULL);
+        }
+        if (userId == null) {
+            return Result.fail(ResultCode.USERID_IS_NULL);
+        }
+        try {
+            storeProductAttrResult.setUpdateTime(new Date());
+            storeProductAttrResult.setUpdateUserId(userId);
+            storeProductAttrResultService.update(storeProductAttrResult);
+        } catch (Exception e) {
+            log.error("更新对象操作异常e:{}", e);
+            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        return Result.success();
+    }
+
+    @PostMapping("/detail")
+    @ApiOperation(value = "商品属性获取详情", httpMethod = "POST")
+    public Result<StoreProductAttrResult> detail(@RequestParam Long id, Long userId) {
+        if (id == null) {
+            return Result.fail(ResultCode.ID_IS_NULL);
+        }
+        if (userId == null) {
+            return Result.fail(ResultCode.USERID_IS_NULL);
+        }
+        StoreProductAttrResult storeProductAttrResult = null;
+        try {
+            storeProductAttrResult = storeProductAttrResultService.findById(id);
+        } catch (Exception e) {
+            log.error("查询对象操作异常e:{}", e);
+            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        return Result.success(storeProductAttrResult);
+    }
+
+    @PostMapping("/list")
+    @ApiOperation(value = "商品属性获取列表", httpMethod = "POST")
+    public Result<List<StoreProductAttrResult>> list(@RequestBody StoreProductAttrResult storeProductAttrResult, @RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "0") Integer size, Long userId) {
+        if (userId == null) {
+            return Result.fail(ResultCode.USERID_IS_NULL);
+        }
+        PageHelper.startPage(page, size);
+
+        Condition condition = new Condition(storeProductAttrResult.getClass());
+//        Criteria criteria = condition.createCriteria();
+//        criteria.andEqualTo("name", city.getName());
+        PageInfo pageInfo = null;
+        try {
+            List<StoreProductAttrResult> list = storeProductAttrResultService.findByCondition(condition);
+            pageInfo = new PageInfo(list);
+        } catch (Exception e) {
+            log.error("查询对象操作异常e:{}", e);
+            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        return Result.success(pageInfo);
+    }
+}

+ 137 - 0
mall-service/src/main/java/com/txz/mall/controller/StoreProductRuleController.java

@@ -0,0 +1,137 @@
+package com.txz.mall.controller;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.txz.mall.core.Result;
+import com.txz.mall.core.ResultCode;
+import com.txz.mall.model.StoreProductRule;
+import com.txz.mall.service.StoreProductRuleService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.bind.annotation.*;
+import tk.mybatis.mapper.entity.Condition;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created by CodeGenerator on 2025/07/11.
+ */
+@Api(tags = "[后台]storeProductRule管理")
+@RestController
+@RequestMapping("/store/product/rule")
+public class StoreProductRuleController {
+
+    private static Logger log = LoggerFactory.getLogger(StoreProductRuleController.class);
+
+    @Resource
+    private StoreProductRuleService storeProductRuleService;
+
+    @PostMapping("/add")
+    @ApiOperation(value = "storeProductRule新增", httpMethod = "POST")
+    public Result add(@RequestBody StoreProductRule storeProductRule, Long userId) {
+        if (storeProductRule == null) {
+            return Result.fail(ResultCode.OBJECT_IS_NULL);
+        }
+        if (userId == null) {
+            return Result.fail(ResultCode.USERID_IS_NULL);
+        }
+        try {
+            storeProductRule.setCreateTime(new Date());
+            storeProductRule.setCreateUserId(userId);
+            storeProductRuleService.save(storeProductRule);
+        } catch (Exception e) {
+            log.error("新增对象操作异常e:{}", e);
+            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        return Result.success();
+    }
+
+    @PostMapping("/delete")
+    @ApiOperation(value = "storeProductRule删除", httpMethod = "POST")
+    public Result delete(@RequestParam Long id, Long userId) {
+        if (id == null) {
+            return Result.fail(ResultCode.ID_IS_NULL);
+        }
+        if (userId == null) {
+            return Result.fail(ResultCode.USERID_IS_NULL);
+        }
+        try {
+            StoreProductRule storeProductRule = new StoreProductRule();
+            storeProductRule.setId(id);
+            storeProductRule.setIsDelete(1);
+            storeProductRuleService.update(storeProductRule);
+        } catch (Exception e) {
+            log.error("删除对象操作异常e:{}", e);
+            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        return Result.success();
+    }
+
+    @PostMapping("/update")
+    @ApiOperation(value = "storeProductRule更新", httpMethod = "POST")
+    public Result update(@RequestBody StoreProductRule storeProductRule, Long userId) {
+        if (storeProductRule == null) {
+            return Result.fail(ResultCode.OBJECT_IS_NULL);
+        }
+        if (storeProductRule.getId() == null) {
+            return Result.fail(ResultCode.ID_IS_NULL);
+        }
+        if (userId == null) {
+            return Result.fail(ResultCode.USERID_IS_NULL);
+        }
+        try {
+            storeProductRule.setUpdateTime(new Date());
+            storeProductRule.setUpdateUserId(userId);
+            storeProductRuleService.update(storeProductRule);
+        } catch (Exception e) {
+            log.error("更新对象操作异常e:{}", e);
+            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        return Result.success();
+    }
+
+    @PostMapping("/detail")
+    @ApiOperation(value = "storeProductRule获取详情", httpMethod = "POST")
+    public Result<StoreProductRule> detail(@RequestParam Long id, Long userId) {
+        if (id == null) {
+            return Result.fail(ResultCode.ID_IS_NULL);
+        }
+        if (userId == null) {
+            return Result.fail(ResultCode.USERID_IS_NULL);
+        }
+        StoreProductRule storeProductRule = null;
+        try {
+            storeProductRule = storeProductRuleService.findById(id);
+        } catch (Exception e) {
+            log.error("查询对象操作异常e:{}", e);
+            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        return Result.success(storeProductRule);
+    }
+
+    @PostMapping("/list")
+    @ApiOperation(value = "storeProductRule获取列表", httpMethod = "POST")
+    public Result<List<StoreProductRule>> list(@RequestBody StoreProductRule storeProductRule, @RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "0") Integer size, Long userId) {
+        if (userId == null) {
+            return Result.fail(ResultCode.USERID_IS_NULL);
+        }
+        PageHelper.startPage(page, size);
+
+        Condition condition = new Condition(storeProductRule.getClass());
+//        Criteria criteria = condition.createCriteria();
+//        criteria.andEqualTo("name", city.getName());
+        PageInfo pageInfo = null;
+        try {
+            List<StoreProductRule> list = storeProductRuleService.findByCondition(condition);
+            pageInfo = new PageInfo(list);
+        } catch (Exception e) {
+            log.error("查询对象操作异常e:{}", e);
+            return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        return Result.success(pageInfo);
+    }
+}

+ 7 - 0
mall-service/src/main/java/com/txz/mall/dao/StoreProductAttrResultMapper.java

@@ -0,0 +1,7 @@
+package com.txz.mall.dao;
+
+import com.txz.mall.core.Mapper;
+import com.txz.mall.model.StoreProductAttrResult;
+
+public interface StoreProductAttrResultMapper extends Mapper<StoreProductAttrResult> {
+}

+ 7 - 0
mall-service/src/main/java/com/txz/mall/dao/StoreProductRuleMapper.java

@@ -0,0 +1,7 @@
+package com.txz.mall.dao;
+
+import com.txz.mall.core.Mapper;
+import com.txz.mall.model.StoreProductRule;
+
+public interface StoreProductRuleMapper extends Mapper<StoreProductRule> {
+}

+ 67 - 0
mall-service/src/main/java/com/txz/mall/model/StoreProductAttrResult.java

@@ -0,0 +1,67 @@
+package com.txz.mall.model;
+
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Data
+@Table(name = "m_store_product_attr_result")
+public class StoreProductAttrResult {
+    /**
+     * 主键
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    /**
+     * 商品ID
+     */
+    @Column(name = "product_id")
+    private Long productId;
+
+    /**
+     * 活动类型 0=商品,1=秒杀,2=砍价,3=拼团
+     */
+    private Integer type;
+
+    /**
+     * 创建时间
+     */
+    @Column(name = "create_time")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @Column(name = "update_time")
+    private Date updateTime;
+
+    /**
+     * 创建人id
+     */
+    @Column(name = "create_user_id")
+    private Long createUserId;
+
+    /**
+     * 更新人id
+     */
+    @Column(name = "update_user_id")
+    private Long updateUserId;
+
+    /**
+     * 是否删除
+     */
+    @TableLogic
+    @Column(name = "is_delete")
+    private Integer isDelete;
+
+    /**
+     * 商品属性参数
+     */
+    private String result;
+
+
+}

+ 58 - 0
mall-service/src/main/java/com/txz/mall/model/StoreProductRule.java

@@ -0,0 +1,58 @@
+package com.txz.mall.model;
+
+import lombok.Data;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Data
+@Table(name = "m_store_product_rule")
+public class StoreProductRule {
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    /**
+     * 规格名称
+     */
+    @Column(name = "rule_name")
+    private String ruleName;
+
+    /**
+     * 创建时间
+     */
+    @Column(name = "create_time")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @Column(name = "update_time")
+    private Date updateTime;
+
+    /**
+     * 创建人id
+     */
+    @Column(name = "create_user_id")
+    private Long createUserId;
+
+    /**
+     * 更新人id
+     */
+    @Column(name = "update_user_id")
+    private Long updateUserId;
+
+    /**
+     * 是否删除
+     */
+    @Column(name = "is_delete")
+    private Integer isDelete;
+
+    /**
+     * 规格值
+     */
+    @Column(name = "rule_value")
+    private String ruleValue;
+
+
+}

+ 12 - 0
mall-service/src/main/java/com/txz/mall/service/StoreProductAttrResultService.java

@@ -0,0 +1,12 @@
+package com.txz.mall.service;
+
+import com.txz.mall.core.Service;
+import com.txz.mall.model.StoreProductAttrResult;
+
+
+/**
+ * Created by CodeGenerator on 2025/07/11.
+ */
+public interface StoreProductAttrResultService extends Service<StoreProductAttrResult> {
+
+}

+ 12 - 0
mall-service/src/main/java/com/txz/mall/service/StoreProductRuleService.java

@@ -0,0 +1,12 @@
+package com.txz.mall.service;
+
+import com.txz.mall.core.Service;
+import com.txz.mall.model.StoreProductRule;
+
+
+/**
+ * Created by CodeGenerator on 2025/07/11.
+ */
+public interface StoreProductRuleService extends Service<StoreProductRule> {
+
+}

+ 22 - 0
mall-service/src/main/java/com/txz/mall/service/impl/StoreProductAttrResultServiceImpl.java

@@ -0,0 +1,22 @@
+package com.txz.mall.service.impl;
+
+import com.txz.mall.core.AbstractService;
+import com.txz.mall.dao.StoreProductAttrResultMapper;
+import com.txz.mall.model.StoreProductAttrResult;
+import com.txz.mall.service.StoreProductAttrResultService;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+
+
+/**
+ * Created by CodeGenerator on 2025/07/11.
+ */
+@Service
+@Transactional
+public class StoreProductAttrResultServiceImpl extends AbstractService<StoreProductAttrResult> implements StoreProductAttrResultService {
+    @Resource
+    private StoreProductAttrResultMapper mStoreProductAttrResultMapper;
+
+}

+ 22 - 0
mall-service/src/main/java/com/txz/mall/service/impl/StoreProductRuleServiceImpl.java

@@ -0,0 +1,22 @@
+package com.txz.mall.service.impl;
+
+import com.txz.mall.core.AbstractService;
+import com.txz.mall.dao.StoreProductRuleMapper;
+import com.txz.mall.model.StoreProductRule;
+import com.txz.mall.service.StoreProductRuleService;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+
+
+/**
+ * Created by CodeGenerator on 2025/07/11.
+ */
+@Service
+@Transactional
+public class StoreProductRuleServiceImpl extends AbstractService<StoreProductRule> implements StoreProductRuleService {
+    @Resource
+    private StoreProductRuleMapper mStoreProductRuleMapper;
+
+}

+ 18 - 0
mall-service/src/main/resources/mapper/StoreProductAttrResultMapper.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.txz.mall.dao.StoreProductAttrResultMapper">
+    <resultMap id="BaseResultMap" type="com.txz.mall.model.StoreProductAttrResult">
+        <!--
+          WARNING - @mbg.generated
+        -->
+        <id column="id" jdbcType="BIGINT" property="id"/>
+        <result column="product_id" jdbcType="BIGINT" property="productId"/>
+        <result column="type" jdbcType="INTEGER" property="type"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
+        <result column="create_user_id" jdbcType="BIGINT" property="createUserId"/>
+        <result column="update_user_id" jdbcType="BIGINT" property="updateUserId"/>
+        <result column="is_delete" jdbcType="INTEGER" property="isDelete"/>
+        <result column="result" jdbcType="VARCHAR" property="result"/>
+    </resultMap>
+</mapper>

+ 17 - 0
mall-service/src/main/resources/mapper/StoreProductRuleMapper.xml

@@ -0,0 +1,17 @@
+<?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.txz.mall.dao.StoreProductRuleMapper">
+    <resultMap id="BaseResultMap" type="com.txz.mall.model.StoreProductRule">
+        <!--
+          WARNING - @mbg.generated
+        -->
+        <id column="id" jdbcType="BIGINT" property="id"/>
+        <result column="rule_name" jdbcType="VARCHAR" property="ruleName"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
+        <result column="create_user_id" jdbcType="BIGINT" property="createUserId"/>
+        <result column="update_user_id" jdbcType="BIGINT" property="updateUserId"/>
+        <result column="is_delete" jdbcType="INTEGER" property="isDelete"/>
+        <result column="rule_value" jdbcType="VARCHAR" property="ruleValue"/>
+    </resultMap>
+</mapper>