From 3c231b0b6c24d58971542d2cc7b8e6ef56dcb75c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B2=B3=E5=B9=B3?= <14767849+liuehping@user.noreply.gitee.com> Date: Wed, 20 Nov 2024 01:14:29 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=B8=83=E5=A4=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../muyu-marketing/marketing-common/pom.xml | 40 ++++++ .../marketing/domain/ActivityTeamInfo.java | 70 ++++++++++ .../domain/req/ActivityTeamInfoReq.java | 26 ++++ .../muyu-marketing/marketing-remote/pom.xml | 20 +++ .../src/main/java/com/muyu/Main.java | 7 + .../muyu-marketing/marketing-serve/pom.xml | 124 ++++++++++++++++++ .../marketing/MuYuMarketingApplication.java | 22 ++++ .../ActivityTeamInfoController.java | 44 +++++++ .../mapper/ActivityTeamInfoMapper.java | 10 ++ .../service/ActivityTeamInfoService.java | 19 +++ .../impl/ActivityTeamInfoServiceImpl.java | 36 +++++ .../src/main/resources/banner.txt | 2 + .../src/main/resources/bootstrap.yml | 30 +++++ .../src/main/resources/logback.xml | 74 +++++++++++ .../mapper/system/ActivityTeamInfoMapper.xml | 10 ++ muyu-modules/muyu-marketing/pom.xml | 27 ++++ .../com/muyu/product/domain/ProjectInfo.java | 73 +++++++---- .../model/TemplateAttributeGroupModel.java | 6 +- .../domain/req/ProjectInfoQueryReq.java | 4 + .../domain/resp/ProjectInfoListResp.java | 32 +++++ .../controller/AttributeGroupController.java | 6 +- .../controller/ProjectInfoController.java | 7 +- .../muyu/product/mapper/BrandInfoMapper.java | 3 + .../product/mapper/ProjectInfoMapper.java | 1 + .../muyu/product/mapper/RuleInfoMapper.java | 4 + .../product/service/BrandInfoService.java | 1 + .../product/service/ProjectInfoService.java | 6 + .../muyu/product/service/RuleInfoService.java | 2 + .../impl/AsBrandProjectServiceImpl.java | 5 - .../AsCategoryAttributeGroupServiceImpl.java | 5 - .../impl/AsCategoryAttributeServiceImpl.java | 6 - .../impl/AsCategoryBrandServiceImpl.java | 5 - .../impl/AttributeGroupServiceImpl.java | 6 +- .../service/impl/BrandInfoServiceImpl.java | 8 ++ .../service/impl/CategoryInfoServiceImpl.java | 10 +- .../service/impl/ProjectInfoServiceImpl.java | 70 +++++++++- .../service/impl/RuleInfoServiceImpl.java | 7 + .../mapper/product/BrandInfoMapper.xml | 6 + .../mapper/product/ProjectInfoMapper.xml | 3 + .../mapper/product/RuleInfoMapper.xml | 6 + muyu-modules/pom.xml | 1 + 41 files changed, 783 insertions(+), 61 deletions(-) create mode 100644 muyu-modules/muyu-marketing/marketing-common/pom.xml create mode 100644 muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/ActivityTeamInfo.java create mode 100644 muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/ActivityTeamInfoReq.java create mode 100644 muyu-modules/muyu-marketing/marketing-remote/pom.xml create mode 100644 muyu-modules/muyu-marketing/marketing-remote/src/main/java/com/muyu/Main.java create mode 100644 muyu-modules/muyu-marketing/marketing-serve/pom.xml create mode 100644 muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/MuYuMarketingApplication.java create mode 100644 muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/controller/ActivityTeamInfoController.java create mode 100644 muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/mapper/ActivityTeamInfoMapper.java create mode 100644 muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/ActivityTeamInfoService.java create mode 100644 muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/impl/ActivityTeamInfoServiceImpl.java create mode 100644 muyu-modules/muyu-marketing/marketing-serve/src/main/resources/banner.txt create mode 100644 muyu-modules/muyu-marketing/marketing-serve/src/main/resources/bootstrap.yml create mode 100644 muyu-modules/muyu-marketing/marketing-serve/src/main/resources/logback.xml create mode 100644 muyu-modules/muyu-marketing/marketing-serve/src/main/resources/mapper/system/ActivityTeamInfoMapper.xml create mode 100644 muyu-modules/muyu-marketing/pom.xml create mode 100644 muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/ProjectInfoListResp.java diff --git a/muyu-modules/muyu-marketing/marketing-common/pom.xml b/muyu-modules/muyu-marketing/marketing-common/pom.xml new file mode 100644 index 0000000..8f79286 --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-common/pom.xml @@ -0,0 +1,40 @@ + + + 4.0.0 + + com.muyu + muyu-marketing + 3.6.3 + + + marketing-common + + + 17 + 17 + UTF-8 + + + + org.projectlombok + lombok + + + com.baomidou + mybatis-plus-annotation + 3.4.2 + compile + + + io.swagger + swagger-annotations + + + com.muyu + muyu-common-core + + + + \ No newline at end of file diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/ActivityTeamInfo.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/ActivityTeamInfo.java new file mode 100644 index 0000000..7c60e52 --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/ActivityTeamInfo.java @@ -0,0 +1,70 @@ +package com.muyu.marketing.domain; + +import com.alibaba.ttl.threadpool.agent.internal.javassist.bytecode.AttributeInfo; +import com.baomidou.mybatisplus.annotation.TableName; +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.web.domain.BaseEntity; +import com.muyu.marketing.domain.req.ActivityTeamInfoReq; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import org.apache.xmlbeans.impl.xb.xsdschema.AttributeGroup; + +import java.math.BigInteger; +import java.util.Date; +import java.util.List; +import java.util.function.Function; + +/** + * 商品拼团信息 + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@TableName("activity_team_info") +@ApiModel(value = "activity_team_info", description = "商品拼团信息") +public class ActivityTeamInfo extends BaseEntity { + private static final long serialVersionUID = 1L; + private Long id; + private String name; + private BigInteger productId; + private String productName; + private String productImage; + private String introduction; + private String unit; + private String imageList; + private String endTime; + private Integer sort; + private String content; + private String status; + private String strategyType; + private BigInteger strategyId; + private String remark; + private String createBy; + private Date createTime; + private String updateBy; + private Date updateTime; + private Integer pageNum=1; + private Integer pageSize=3; + + + public static ActivityTeamInfo queryBuild(ActivityTeamInfoReq activityTeamInfoReq) { + return ActivityTeamInfo.builder() + .name(activityTeamInfoReq.getName()) + .status(activityTeamInfoReq.getStatus()) + .build(); + } + + public static ActivityTeamInfo groupFunBuild (ActivityTeamInfo activityTeamInfo, Function> function) { + return ActivityTeamInfo.builder() + .id(activityTeamInfo.getId()) + .name(activityTeamInfo.getName()) + .status(activityTeamInfo.status) + .build(); + } +} diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/ActivityTeamInfoReq.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/ActivityTeamInfoReq.java new file mode 100644 index 0000000..c2a2d9e --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/ActivityTeamInfoReq.java @@ -0,0 +1,26 @@ +package com.muyu.marketing.domain.req; + +import com.muyu.marketing.domain.ActivityTeamInfo; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ActivityTeamInfoReq extends ActivityTeamInfo { + private static final long serialVersionUID = 1L; + + /** + * 组名称 + */ + @ApiModelProperty(name = "组名称", value = "组名称") + private String name; + + /** + * 状态 + */ + @ApiModelProperty(name = "状态", value = "状态") + private String states; +} diff --git a/muyu-modules/muyu-marketing/marketing-remote/pom.xml b/muyu-modules/muyu-marketing/marketing-remote/pom.xml new file mode 100644 index 0000000..c1ef469 --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-remote/pom.xml @@ -0,0 +1,20 @@ + + + 4.0.0 + + com.muyu + muyu-marketing + 3.6.3 + + + marketing-remote + + + 17 + 17 + UTF-8 + + + \ No newline at end of file diff --git a/muyu-modules/muyu-marketing/marketing-remote/src/main/java/com/muyu/Main.java b/muyu-modules/muyu-marketing/marketing-remote/src/main/java/com/muyu/Main.java new file mode 100644 index 0000000..95690d4 --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-remote/src/main/java/com/muyu/Main.java @@ -0,0 +1,7 @@ +package com.muyu; + +public class Main { + public static void main(String[] args) { + System.out.println("Hello world!"); + } +} \ No newline at end of file diff --git a/muyu-modules/muyu-marketing/marketing-serve/pom.xml b/muyu-modules/muyu-marketing/marketing-serve/pom.xml new file mode 100644 index 0000000..e05cbb4 --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-serve/pom.xml @@ -0,0 +1,124 @@ + + + + com.muyu + muyu-marketing + 3.6.3 + + + + 4.0.0 + + marketing-server + + + marketing-server系统模块 + + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + io.springfox + springfox-swagger-ui + ${swagger.fox.version} + + + + + com.mysql + mysql-connector-j + + + + + com.muyu + muyu-common-datasource + + + + + com.muyu + muyu-common-datascope + + + + + com.muyu + muyu-common-log + + + + + com.muyu + muyu-common-swagger + + + + com.dtflys.forest + forest-spring-boot-starter + + + com.muyu + muyu-common-core + + + com.muyu + marketing-common + 3.6.3 + compile + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + + + diff --git a/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/MuYuMarketingApplication.java b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/MuYuMarketingApplication.java new file mode 100644 index 0000000..8f5f255 --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/MuYuMarketingApplication.java @@ -0,0 +1,22 @@ +package com.muyu.marketing; + +import com.muyu.common.security.annotation.EnableCustomConfig; +import com.muyu.common.security.annotation.EnableMyFeignClients; +import com.muyu.common.swagger.annotation.EnableCustomSwagger2; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * 系统模块 + * + * @author muyu + */ +@EnableCustomConfig +@EnableCustomSwagger2 +@EnableMyFeignClients +@SpringBootApplication +public class MuYuMarketingApplication { + public static void main (String[] args) { + SpringApplication.run(MuYuMarketingApplication.class, args); + } +} diff --git a/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/controller/ActivityTeamInfoController.java b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/controller/ActivityTeamInfoController.java new file mode 100644 index 0000000..9b84b2c --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/controller/ActivityTeamInfoController.java @@ -0,0 +1,44 @@ +package com.muyu.marketing.controller; + +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.common.log.annotation.Log; +import com.muyu.common.log.enums.BusinessType; +import com.muyu.common.security.annotation.RequiresPermissions; +import com.muyu.marketing.domain.ActivityTeamInfo; +import com.muyu.marketing.domain.req.ActivityTeamInfoReq; +import com.muyu.marketing.service.ActivityTeamInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +import static com.muyu.common.core.utils.PageUtils.startPage; + +/** + * 商品拼团信息 controller + */ + +@Api(tags = "商品拼团信息") +@RestController +@RequestMapping("/activityTeamInfo") +public class ActivityTeamInfoController { + + @Autowired + private ActivityTeamInfoService activityTeamInfoService; + + /** + * 商品拼团信息列表 + */ + @ApiModelProperty("获取商品拼团信息列表") + @GetMapping("/list") + public Result> list(@RequestBody ActivityTeamInfoReq activityTeamInfoReq) { + return activityTeamInfoService.list(activityTeamInfoReq); + } + +} diff --git a/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/mapper/ActivityTeamInfoMapper.java b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/mapper/ActivityTeamInfoMapper.java new file mode 100644 index 0000000..ca6cc75 --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/mapper/ActivityTeamInfoMapper.java @@ -0,0 +1,10 @@ +package com.muyu.marketing.mapper; + +import com.muyu.marketing.domain.ActivityTeamInfo; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +@Mapper +public interface ActivityTeamInfoMapper { + List list(); +} diff --git a/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/ActivityTeamInfoService.java b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/ActivityTeamInfoService.java new file mode 100644 index 0000000..1895f64 --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/ActivityTeamInfoService.java @@ -0,0 +1,19 @@ +package com.muyu.marketing.service; + +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.marketing.domain.ActivityTeamInfo; + +import java.util.List; + +public interface ActivityTeamInfoService { + /** + * 分页查询 + * @param activityTeamInfo + * @return + */ + Result list(ActivityTeamInfo activityTeamInfo); + + + +} diff --git a/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/impl/ActivityTeamInfoServiceImpl.java b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/impl/ActivityTeamInfoServiceImpl.java new file mode 100644 index 0000000..c53898e --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/impl/ActivityTeamInfoServiceImpl.java @@ -0,0 +1,36 @@ +package com.muyu.marketing.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.marketing.domain.ActivityTeamInfo; +import com.muyu.marketing.mapper.ActivityTeamInfoMapper; +import com.muyu.marketing.service.ActivityTeamInfoService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Collections; +import java.util.List; + +@Slf4j +@Service +public class ActivityTeamInfoServiceImpl implements ActivityTeamInfoService { + + @Autowired + private ActivityTeamInfoMapper activityTeamInfoMapper; + + @Override + public Result list(ActivityTeamInfo activityTeamInfo) { + PageHelper.startPage(activityTeamInfo.getPageNum(),activityTeamInfo.getPageSize()); + List list=activityTeamInfoMapper.list(); + PageInfo pageInfo = new PageInfo(list); + return Result.success(pageInfo); + } + + + + +} diff --git a/muyu-modules/muyu-marketing/marketing-serve/src/main/resources/banner.txt b/muyu-modules/muyu-marketing/marketing-serve/src/main/resources/banner.txt new file mode 100644 index 0000000..0dd5eee --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-serve/src/main/resources/banner.txt @@ -0,0 +1,2 @@ +Spring Boot Version: ${spring-boot.version} +Spring Application Name: ${spring.application.name} diff --git a/muyu-modules/muyu-marketing/marketing-serve/src/main/resources/bootstrap.yml b/muyu-modules/muyu-marketing/marketing-serve/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..7c403f7 --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-serve/src/main/resources/bootstrap.yml @@ -0,0 +1,30 @@ +# Tomcat +server: + port: 9209 + +# Spring +spring: + application: + # 应用名称 + name: muyu-marketing + profiles: + # 环境配置 + active: dev + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 113.44.45.42:8848 + namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa + config: + # 配置中心地址 + server-addr: 113.44.45.42:8848 + namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} +logging: + level: + com.muyu.system.mapper: DEBUG diff --git a/muyu-modules/muyu-marketing/marketing-serve/src/main/resources/logback.xml b/muyu-modules/muyu-marketing/marketing-serve/src/main/resources/logback.xml new file mode 100644 index 0000000..aa340cd --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-serve/src/main/resources/logback.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + + + + + + + + + + + + + diff --git a/muyu-modules/muyu-marketing/marketing-serve/src/main/resources/mapper/system/ActivityTeamInfoMapper.xml b/muyu-modules/muyu-marketing/marketing-serve/src/main/resources/mapper/system/ActivityTeamInfoMapper.xml new file mode 100644 index 0000000..f8e5bed --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-serve/src/main/resources/mapper/system/ActivityTeamInfoMapper.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/muyu-modules/muyu-marketing/pom.xml b/muyu-modules/muyu-marketing/pom.xml new file mode 100644 index 0000000..aa4b672 --- /dev/null +++ b/muyu-modules/muyu-marketing/pom.xml @@ -0,0 +1,27 @@ + + + + com.muyu + muyu-modules + 3.6.3 + + pom + + + marketing-remote + marketing-serve + marketing-common + + + 4.0.0 + + muyu-marketing + + + muyu-modules-system系统模块 + + + + diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/ProjectInfo.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/ProjectInfo.java index 9420db8..e8bc30d 100644 --- a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/ProjectInfo.java +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/ProjectInfo.java @@ -38,61 +38,86 @@ public class ProjectInfo extends BaseEntity { private static final long serialVersionUID = 1L; - /** 主键 */ - @TableId(value = "id",type = IdType.AUTO) + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) @ApiModelProperty(name = "主键", value = "主键") private Long id; - /** 商品名称 */ + /** + * 商品名称 + */ @Excel(name = "商品名称") @ApiModelProperty(name = "商品名称", value = "商品名称") private String name; - /** 商品描述 */ + /** + * 商品描述 + */ @Excel(name = "商品描述") @ApiModelProperty(name = "商品描述", value = "商品描述") private String introduction; - /** 主类型 */ + /** + * 主类型 + */ @Excel(name = "主类型") @ApiModelProperty(name = "主类型", value = "主类型") private Long mianType; - /** 父类型 */ + /** + * 父类型 + */ @Excel(name = "父类型") @ApiModelProperty(name = "父类型", value = "父类型") private Long parentType; - /** 商品类型 */ + /** + * 商品类型 + */ @Excel(name = "商品类型") @ApiModelProperty(name = "商品类型", value = "商品类型") private Long type; - /** 商品图片 */ + /** + * 商品图片 + */ @Excel(name = "商品图片") @ApiModelProperty(name = "商品图片", value = "商品图片") private String image; - /** 商品轮播图 */ + /** + * 商品轮播图 + */ @Excel(name = "商品轮播图") @ApiModelProperty(name = "商品轮播图", value = "商品轮播图") private String carouselImages; - /** 商品状态 */ + /** + * 商品状态 + */ @Excel(name = "商品状态") @ApiModelProperty(name = "商品状态", value = "商品状态") private String status; - /** 规格 */ + /** + * 规格 + */ @Excel(name = "规格") @ApiModelProperty(name = "规格", value = "规格") private Long ruleId; - /** 品牌 */ + + /** + * 品牌 + */ @Excel(name = "品牌") @ApiModelProperty(name = "品牌", value = "品牌") private Long brandId; + + @Excel(name = "备注") @ApiModelProperty(name = "备注", value = "备注") private String remark; @@ -105,7 +130,9 @@ public class ProjectInfo extends BaseEntity { @ApiModelProperty(name = "创建时间", value = "创建时间") private Date createTime; - /** 品牌 */ + /** + * 品牌 + */ @Excel(name = "更新人") @ApiModelProperty(name = "更新人", value = "更新人") private String updateBy; @@ -115,9 +142,9 @@ public class ProjectInfo extends BaseEntity { private Date updateTime; /** - * 查询构造器 - */ - public static ProjectInfo queryBuild( ProjectInfoQueryReq projectInfoQueryReq){ + * 查询构造器 + */ + public static ProjectInfo queryBuild(ProjectInfoQueryReq projectInfoQueryReq) { return ProjectInfo.builder() .name(projectInfoQueryReq.getName()) .introduction(projectInfoQueryReq.getIntroduction()) @@ -133,9 +160,9 @@ public class ProjectInfo extends BaseEntity { } /** - * 添加构造器 - */ - public static ProjectInfo saveModelBuild(ProjectAddModel projectAddModel, Supplier createBy){ + * 添加构造器 + */ + public static ProjectInfo saveModelBuild(ProjectAddModel projectAddModel, Supplier createBy) { return ProjectInfo.builder() .name(projectAddModel.getName()) .introduction(projectAddModel.getIntroduction()) @@ -153,11 +180,11 @@ public class ProjectInfo extends BaseEntity { } /** - * 修改构造器 - */ - public static ProjectInfo editBuild(Long id, ProjectInfoEditReq projectInfoEditReq){ + * 修改构造器 + */ + public static ProjectInfo editBuild(Long id, ProjectInfoEditReq projectInfoEditReq) { return ProjectInfo.builder() - .id(id) + .id(id) .name(projectInfoEditReq.getName()) .introduction(projectInfoEditReq.getIntroduction()) .mianType(projectInfoEditReq.getMianType()) diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/TemplateAttributeGroupModel.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/TemplateAttributeGroupModel.java index 3258cc8..0e44377 100644 --- a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/TemplateAttributeGroupModel.java +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/TemplateAttributeGroupModel.java @@ -34,6 +34,10 @@ public class TemplateAttributeGroupModel extends BaseEntity { * 属性组下属性集合 */ private List attributeList; + /** + * 共有属性组 + */ + private List templateAttributeGroupList; /** * 是否有效 @@ -51,10 +55,10 @@ public class TemplateAttributeGroupModel extends BaseEntity { */ public static TemplateAttributeGroupModel attributeGroupBuild(AttributeGroup attributeGroup, Function> attributeList){ + return TemplateAttributeGroupModel.builder() .groupName(attributeGroup.getName()) .attributeList(attributeList.apply(attributeGroup.getId())) .build(); - } } diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectInfoQueryReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectInfoQueryReq.java index dd509ac..b5f9321 100644 --- a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectInfoQueryReq.java +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ProjectInfoQueryReq.java @@ -59,8 +59,12 @@ public class ProjectInfoQueryReq extends BaseEntity { @ApiModelProperty(name = "规格", value = "规格") private Long ruleId; + + + /** 品牌 */ @ApiModelProperty(name = "品牌", value = "品牌") private Long brandId; + } diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/ProjectInfoListResp.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/ProjectInfoListResp.java new file mode 100644 index 0000000..b5e62ff --- /dev/null +++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/ProjectInfoListResp.java @@ -0,0 +1,32 @@ +package com.muyu.product.domain.resp; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class ProjectInfoListResp { + private Long id; + private String name; + private String introduction; + private Long mianType; + private String mianTypeName; + private Long parentType; + private Long type; + private String image; + private String carouselImages; + private String status; + private Long ruleId; + private String ruleName; + private Long brandId; + private String brandName; + private String parentTypeName; + private String typeName; + + + +} diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/AttributeGroupController.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/AttributeGroupController.java index 0d75698..3578d8b 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/AttributeGroupController.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/AttributeGroupController.java @@ -50,8 +50,10 @@ public class AttributeGroupController extends BaseController { @GetMapping("/list") public Result> list(AttributeGroupQueryReq attributeGroupQueryReq) { startPage(); - TableDataInfo tableDataInfo = - attributeGroupService.page(AttributeGroup.queryBuild(attributeGroupQueryReq)); + TableDataInfo + tableDataInfo = + attributeGroupService. + page(AttributeGroup.queryBuild(attributeGroupQueryReq)); return Result.success(tableDataInfo); } diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/ProjectInfoController.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/ProjectInfoController.java index da46fd8..d614e09 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/ProjectInfoController.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/ProjectInfoController.java @@ -3,14 +3,13 @@ package com.muyu.product.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; -import com.muyu.product.cache.ProjectInfoCache; import com.muyu.product.domain.BrandInfo; import com.muyu.product.domain.RuleInfo; import com.muyu.product.domain.resp.ProjectDetailResp; +import com.muyu.product.domain.resp.ProjectInfoListResp; import com.muyu.product.service.BrandInfoService; import com.muyu.product.service.RuleInfoService; import io.swagger.annotations.*; -import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -58,9 +57,9 @@ public class ProjectInfoController extends BaseController { @ApiOperation("获取商品信息列表") @RequiresPermissions("product:info:list") @GetMapping("/list") - public Result> list(ProjectInfoQueryReq projectInfoQueryReq) { + public Result> list(ProjectInfoQueryReq projectInfoQueryReq) { startPage(); - List list = projectInfoService.list(ProjectInfo.queryBuild(projectInfoQueryReq)); + List list = projectInfoService.pageInfo(ProjectInfo.queryBuild(projectInfoQueryReq)); return getDataTable(list); } diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/BrandInfoMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/BrandInfoMapper.java index 97519e1..74ee44c 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/BrandInfoMapper.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/BrandInfoMapper.java @@ -12,4 +12,7 @@ import com.muyu.product.domain.BrandInfo; */ public interface BrandInfoMapper extends BaseMapper { + String getName(Long brandId); + + BrandInfo getById(Long brandId); } diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/ProjectInfoMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/ProjectInfoMapper.java index 2eb6558..128897f 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/ProjectInfoMapper.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/ProjectInfoMapper.java @@ -12,4 +12,5 @@ import com.muyu.product.domain.ProjectInfo; */ public interface ProjectInfoMapper extends BaseMapper { + ProjectInfo getProjectName(String name); } diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/RuleInfoMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/RuleInfoMapper.java index e73928b..786fab8 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/RuleInfoMapper.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/RuleInfoMapper.java @@ -24,4 +24,8 @@ public interface RuleInfoMapper extends BaseMapper { void addRuleAttrModel(@Param("id") Long id, @Param("name") String name, @Param("valueData") String substring); Integer have(Long id); + + String getName(Long ruleId); + + RuleInfo getById(Long ruleId); } diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/BrandInfoService.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/BrandInfoService.java index fa6ada7..13e9ec7 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/BrandInfoService.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/BrandInfoService.java @@ -19,4 +19,5 @@ public interface BrandInfoService extends IService { */ public List list(BrandInfo brandInfo); + String getName(Long brandId); } diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/ProjectInfoService.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/ProjectInfoService.java index e4a9feb..d50d426 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/ProjectInfoService.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/ProjectInfoService.java @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.muyu.product.domain.req.ProjectInfoEditReq; import com.muyu.product.domain.req.ProjectInfoSaveReq; import com.muyu.product.domain.resp.ProjectDetailResp; +import com.muyu.product.domain.resp.ProjectInfoListResp; /** * 商品信息Service接口 @@ -45,4 +46,9 @@ public interface ProjectInfoService extends IService { * @return */ Result updProject(Long id, ProjectInfoEditReq projectInfoEditReq); + + List pageInfo(ProjectInfo projectInfo); + + +// ProjectInfo getProjectName(String name); } diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/RuleInfoService.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/RuleInfoService.java index 5c0e2cb..a12ca76 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/RuleInfoService.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/RuleInfoService.java @@ -44,4 +44,6 @@ public interface RuleInfoService extends IService { void edit(Long id, RuleAttrInfoReq ruleInfoEditReq); Result have(Long id); + + String getName(Long ruleId); } diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/AsBrandProjectServiceImpl.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/AsBrandProjectServiceImpl.java index e5c906d..3ee571d 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/AsBrandProjectServiceImpl.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/AsBrandProjectServiceImpl.java @@ -39,11 +39,6 @@ public class AsBrandProjectServiceImpl extends ServiceImpl list(AsCategoryAttribute asCategoryAttribute) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - if (ObjUtils.notNull(asCategoryAttribute.getCategoryId())){ queryWrapper.eq(AsCategoryAttribute::getCategoryId, asCategoryAttribute.getCategoryId()); } @@ -39,11 +38,6 @@ public class AsCategoryAttributeServiceImpl extends ServiceImpl list(AsCategoryBrand asCategoryBrand) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - if (ObjUtils.notNull(asCategoryBrand.getCategoryId())){ queryWrapper.eq(AsCategoryBrand::getCategoryId, asCategoryBrand.getCategoryId()); } @@ -40,10 +39,6 @@ public class AsCategoryBrandServiceImpl extends ServiceImpl page (AttributeGroup attributeGroupQuery) { List list = this.list(attributeGroupQuery); - List pageRespList = list.stream() + List pageRespList + = list.stream() .map(attributeGroup -> AttributeGroupPageResp.groupFunBuild( - attributeGroup, groupId -> attributeInfoService.attributeListByGroupId(groupId) + attributeGroup, groupId + -> attributeInfoService.attributeListByGroupId(groupId) ) ) .toList(); diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/BrandInfoServiceImpl.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/BrandInfoServiceImpl.java index 3c2f6c9..1ced230 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/BrandInfoServiceImpl.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/BrandInfoServiceImpl.java @@ -6,6 +6,7 @@ import java.util.List; import com.muyu.common.core.utils.ObjUtils; import com.muyu.common.security.utils.SecurityUtils; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.muyu.product.mapper.BrandInfoMapper; import com.muyu.product.domain.BrandInfo; @@ -23,6 +24,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @Service public class BrandInfoServiceImpl extends ServiceImpl implements BrandInfoService { + @Autowired + private BrandInfoMapper brandInfoMapper; /** * 查询品牌信息列表 * @@ -53,6 +56,11 @@ public class BrandInfoServiceImpl extends ServiceImpl cateGoryIdList = new ArrayList<>(); - getParentIdListByCateGoryId(cateGoryIdList, cateGoryId); + getParentIdListByCateGoryId(cateGoryIdList,cateGoryId); // 取出和品类相关联的属性组关系 - 中间表 - LambdaQueryWrapper asCategoryAttributeGroupLambdaQueryWrapper = new LambdaQueryWrapper<>(){{ + LambdaQueryWrapper asCategoryAttributeGroupLambdaQueryWrapper = + new LambdaQueryWrapper<>(){{ in(AsCategoryAttributeGroup::getCategoryId, cateGoryIdList); }}; - List categoryAttributeGroupList = asCategoryAttributeGroupService.list(asCategoryAttributeGroupLambdaQueryWrapper); + List categoryAttributeGroupList = + asCategoryAttributeGroupService.list(asCategoryAttributeGroupLambdaQueryWrapper); List attributeGroupModelList = categoryAttributeGroupList.stream() .map(AsCategoryAttributeGroup::getAttributeGroupId) .distinct() diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/ProjectInfoServiceImpl.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/ProjectInfoServiceImpl.java index 76b60e2..14ab706 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/ProjectInfoServiceImpl.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/ProjectInfoServiceImpl.java @@ -1,9 +1,6 @@ package com.muyu.product.service.impl; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; +import java.util.*; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.muyu.common.core.domain.Result; @@ -16,6 +13,9 @@ import com.muyu.product.domain.req.ProjectInfoEditReq; import com.muyu.product.domain.req.ProjectInfoSaveReq; import com.muyu.product.domain.resp.CategoryCommonElementResp; import com.muyu.product.domain.resp.ProjectDetailResp; +import com.muyu.product.domain.resp.ProjectInfoListResp; +import com.muyu.product.mapper.BrandInfoMapper; +import com.muyu.product.mapper.RuleInfoMapper; import com.muyu.product.service.*; import io.netty.util.internal.StringUtil; import lombok.extern.slf4j.Slf4j; @@ -54,6 +54,12 @@ public class ProjectInfoServiceImpl extends ServiceImpl attributeInfos = projectInfoEditReq.getAttrValueList().stream() @@ -286,4 +305,47 @@ public class ProjectInfoServiceImpl extends ServiceImpl pageInfo(ProjectInfo projectInfo) { + List list = list(projectInfo); + LinkedList listRespLinkedList = new LinkedList<>(); + list.forEach(item->{ + CategoryInfo mainTypeName = categoryInfoService.getById(item.getMianType()); + CategoryInfo parentTypeName = categoryInfoService.getById(item.getParentType()); + CategoryInfo typeName = item.getType() != null ? categoryInfoService.getById(item.getType()) : null; + + //获取规则 + RuleInfo ruleName=ruleInfoMapper.getById(item.getRuleId()); + //获取品牌信息 + BrandInfo brandName=brandInfoMapper.getById(item.getBrandId()); + + //构建响应对象 + ProjectInfoListResp projectInfoListResp=ProjectInfoListResp.builder() + .id(item.getId()) + .name(item.getName()) + .introduction(item.getIntroduction()) + .mianType(item.getMianType()) + .parentType(item.getParentType()) + .type(item.getType()) + .image(item.getImage()) + .carouselImages(item.getCarouselImages()) + .status(item.getStatus()) + .mianTypeName(mainTypeName!=null?mainTypeName.getName():"") + .parentTypeName(parentTypeName!=null?parentTypeName.getName():"") + .typeName(typeName!=null?typeName.getName():"") + .ruleName(ruleName != null ? ruleName.getName() : null) + .brandName(brandName != null ? brandName.getNam() : null) + .build(); + //添加到结果列表 + listRespLinkedList.add(projectInfoListResp); + }); + + return listRespLinkedList; + } + +// @Override +// public ProjectInfo getProjectName(String name) { +// return projectInfoMapper.getProjectName(name); +// } } diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/RuleInfoServiceImpl.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/RuleInfoServiceImpl.java index fc5e030..2e96eab 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/RuleInfoServiceImpl.java +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/RuleInfoServiceImpl.java @@ -50,6 +50,8 @@ public class RuleInfoServiceImpl extends ServiceImpl i private RuleInfoMapper ruleAttrInfoMapper; @Autowired private ProjectInfoService projectInfoService; + @Autowired + private RuleInfoMapper ruleInfoMapper; /** * 查询商品规格列表 @@ -194,4 +196,9 @@ public class RuleInfoServiceImpl extends ServiceImpl i } return Result.success(count); } + + @Override + public String getName(Long ruleId) { + return ruleInfoMapper.getName(ruleId); + } } diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/BrandInfoMapper.xml b/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/BrandInfoMapper.xml index eeeea6d..a89c79f 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/BrandInfoMapper.xml +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/BrandInfoMapper.xml @@ -20,4 +20,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select id, nam, logo, start, introduction, remark, create_by, create_time, update_by, update_time from brand_info + + diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/ProjectInfoMapper.xml b/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/ProjectInfoMapper.xml index 52ca6e6..8cd0211 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/ProjectInfoMapper.xml +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/ProjectInfoMapper.xml @@ -26,4 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select id, name, introduction, mian_type, parent_type, type, image, carousel_images, status, rule_id, brand_id, remark, create_by, create_time, update_by, update_time from project_info + diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/RuleInfoMapper.xml b/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/RuleInfoMapper.xml index ca4dfc0..c21c417 100644 --- a/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/RuleInfoMapper.xml +++ b/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/RuleInfoMapper.xml @@ -56,4 +56,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + diff --git a/muyu-modules/pom.xml b/muyu-modules/pom.xml index 24447f2..ff15472 100644 --- a/muyu-modules/pom.xml +++ b/muyu-modules/pom.xml @@ -15,6 +15,7 @@ muyu-file muyu-product muyu-shop-cart + muyu-marketing muyu-modules