diff --git a/muyu-common/pom.xml b/muyu-common/pom.xml
index ca042b2..4f20784 100644
--- a/muyu-common/pom.xml
+++ b/muyu-common/pom.xml
@@ -19,6 +19,7 @@
muyu-common-datasource
muyu-common-system
muyu-common-cache
+
muyu-common
diff --git a/muyu-modules/muyu-file/pom.xml b/muyu-modules/muyu-file/pom.xml
index feb6031..e9afb81 100644
--- a/muyu-modules/muyu-file/pom.xml
+++ b/muyu-modules/muyu-file/pom.xml
@@ -16,6 +16,11 @@
+
+ com.aliyun.oss
+ aliyun-sdk-oss
+ 3.17.4
+
diff --git a/muyu-modules/muyu-file/src/main/java/com/muyu/file/controller/SysFileController.java b/muyu-modules/muyu-file/src/main/java/com/muyu/file/controller/SysFileController.java
index 5f5ce31..105f1e8 100644
--- a/muyu-modules/muyu-file/src/main/java/com/muyu/file/controller/SysFileController.java
+++ b/muyu-modules/muyu-file/src/main/java/com/muyu/file/controller/SysFileController.java
@@ -11,6 +11,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
+import java.io.InputStream;
+
/**
* 文件请求处理
*
@@ -34,6 +36,7 @@ public class SysFileController {
SysFile sysFile = new SysFile();
sysFile.setName(FileUtils.getName(url));
sysFile.setUrl(url);
+
return Result.success(sysFile);
} catch (Exception e) {
log.error("上传文件失败", e);
diff --git a/muyu-modules/muyu-file/src/main/java/com/muyu/file/utils/FileUploadUtils.java b/muyu-modules/muyu-file/src/main/java/com/muyu/file/utils/FileUploadUtils.java
index 0a48cbf..ce7d0d1 100644
--- a/muyu-modules/muyu-file/src/main/java/com/muyu/file/utils/FileUploadUtils.java
+++ b/muyu-modules/muyu-file/src/main/java/com/muyu/file/utils/FileUploadUtils.java
@@ -50,6 +50,7 @@ public class FileUploadUtils {
throw new IOException(fe.getDefaultMessage(), fe);
} catch (Exception e) {
throw new IOException(e.getMessage(), e);
+
}
}
diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/ActivityTeamInfo.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/ActivityTeamInfo.java
new file mode 100644
index 0000000..6209af6
--- /dev/null
+++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/ActivityTeamInfo.java
@@ -0,0 +1,53 @@
+package com.muyu.product.domain;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.SuperBuilder;
+
+import java.util.Date;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@SuperBuilder
+public class ActivityTeamInfo {
+
+
+
+
+
+ private Integer id;
+ private String name;
+ private Long productId;
+ private String productImage;
+
+
+ private Date endTime;
+
+ private String status;
+
+ private String teamPrice;
+ private String teamStock;
+
+
+
+
+
+ private String productPrice;
+
+
+ private String attendNumber;
+
+ private String openTeamNumber;
+
+ private String addTeamNumber;
+
+ private String remainStock;
+
+
+ public int getaddTeamNumberCount() {
+ return Integer.parseInt(addTeamNumber);
+ }
+}
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 fa8476e..a40a318 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
@@ -109,6 +109,8 @@ public class ProjectInfo extends BaseEntity {
.build();
}
+
+
/**
* 添加构造器
*/
diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/TeamStrategyExemption.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/TeamStrategyExemption.java
new file mode 100644
index 0000000..d01b4f7
--- /dev/null
+++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/TeamStrategyExemption.java
@@ -0,0 +1,31 @@
+package com.muyu.product.domain;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class TeamStrategyExemption {
+
+
+ private Integer id;
+ private Integer duration;
+ private Integer exemption_number;
+ private Integer max_buy;
+ private Integer one_buy;
+ private Integer virtual_number;
+ private String type;
+ private String rule_info;
+ private String status;
+ private String create_by;
+ private Date create_time;
+ private String update_by;
+ private Date update_time;
+ private String remark;
+
+
+}
diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/TeamStrategyExemptionHundred.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/TeamStrategyExemptionHundred.java
new file mode 100644
index 0000000..2f19188
--- /dev/null
+++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/TeamStrategyExemptionHundred.java
@@ -0,0 +1,31 @@
+package com.muyu.product.domain;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class TeamStrategyExemptionHundred {
+
+
+private Integer id;
+private Integer duration;
+private Integer max_buy;
+private Integer one_buy;
+private Integer virtual_number;
+private String status;
+private String rule_info;
+private String create_by;
+private Date create_time;
+private String update_by;
+private Date update_time;
+private String remark;
+
+
+
+
+}
diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/TeamStrategyExemptionOrdinary.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/TeamStrategyExemptionOrdinary.java
new file mode 100644
index 0000000..80b31ed
--- /dev/null
+++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/TeamStrategyExemptionOrdinary.java
@@ -0,0 +1,28 @@
+package com.muyu.product.domain;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class TeamStrategyExemptionOrdinary {
+
+
+ private Integer id;
+ private Integer duration;
+ private Integer team_number;
+ private Integer max_buy;
+ private Integer one_buy;
+ private Integer virtual_number;
+ private String status;
+ private String create_by;
+ private Date create_time;
+ private String update_by;
+ private Date update_time;
+ private String remark;
+
+}
diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/ActivittyTeamInfoQueryReqModel.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/ActivittyTeamInfoQueryReqModel.java
new file mode 100644
index 0000000..2982464
--- /dev/null
+++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/ActivittyTeamInfoQueryReqModel.java
@@ -0,0 +1,26 @@
+package com.muyu.product.domain.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.experimental.SuperBuilder;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@SuperBuilder
+@EqualsAndHashCode(callSuper = true)
+public class ActivittyTeamInfoQueryReqModel extends QueryModel{
+
+
+
+
+ private String keyWord;
+ private String status;
+
+
+
+
+
+}
diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/ActivityTeamInfoListModel.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/ActivityTeamInfoListModel.java
new file mode 100644
index 0000000..4ebfcc4
--- /dev/null
+++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/ActivityTeamInfoListModel.java
@@ -0,0 +1,49 @@
+package com.muyu.product.domain.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.SuperBuilder;
+
+import java.util.Date;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@SuperBuilder
+public class ActivityTeamInfoListModel {
+
+
+
+
+
+ private Integer id;
+ private String name;
+ private Long productId;
+ private String productImage;
+
+
+ private Date endTime;
+
+ private String status;
+
+ private String teamPrice;
+ private String teamStock;
+
+
+
+
+
+ private String productPrice;
+
+
+ private String attendNumber;
+
+ private String openTeamNumber;
+
+ private String addTeamNumber;
+
+ private String remainStock;
+
+
+}
diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/QueryModel.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/QueryModel.java
new file mode 100644
index 0000000..7861027
--- /dev/null
+++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/model/QueryModel.java
@@ -0,0 +1,52 @@
+package com.muyu.product.domain.model;
+
+import com.baomidou.mybatisplus.core.metadata.OrderItem;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.muyu.common.core.web.page.PageDomain;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.SuperBuilder;
+
+import java.util.List;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@SuperBuilder
+public class QueryModel {
+ /*
+ 当前记录起始索引
+ */
+ private Integer pageNum;
+
+/*
+ 每页显示记录数
+ */
+
+ private Integer pageSize;
+
+
+ private String orderByColumn;
+
+
+ private boolean isAsc = true;
+
+
+ public T domainBuild(PageDomain pageDomain) {
+ this.pageNum = pageDomain.getPageNum();
+ this.pageSize = pageDomain.getPageSize();
+ this.orderByColumn = pageDomain.getOrderBy();
+ this.isAsc = "asc".equals(pageDomain.getIsAsc()) ? true : false;
+ return (T)this;
+ }
+
+
+ public Page buildPage() {
+
+ Page page = Page.of(this.pageNum, this.pageSize);
+ page.setOrders(List.of(this.isAsc()
+ ? OrderItem.asc(this.orderByColumn):OrderItem.desc(this.orderByColumn)));
+ return page;
+ }
+}
diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ActivityTeamInfoReq.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ActivityTeamInfoReq.java
new file mode 100644
index 0000000..c13c942
--- /dev/null
+++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/req/ActivityTeamInfoReq.java
@@ -0,0 +1,21 @@
+package com.muyu.product.domain.req;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.SuperBuilder;
+
+@Data
+@SuperBuilder
+@NoArgsConstructor
+@AllArgsConstructor
+
+public class ActivityTeamInfoReq {
+
+
+ private String keyWord;
+ private String status;
+
+
+
+}
diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/ProjectInfoResp.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/ProjectInfoResp.java
new file mode 100644
index 0000000..37673a8
--- /dev/null
+++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/resp/ProjectInfoResp.java
@@ -0,0 +1,65 @@
+package com.muyu.product.domain.resp;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class ProjectInfoResp {
+
+private Long id;
+private String name;
+private String introduction;
+ private Long mianType;
+ private Long parentType;
+ private Long type;
+ private String image;
+ private String carouselImages;
+ private String status;
+ private Long ruleId;
+ private Long brandId;
+
+
+
+
+
+ private String mianTypeName;
+
+ private String parentTypeName;
+
+
+
+ private String typeName;
+
+
+ private String ruleName;
+
+
+ private String brandName;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
diff --git a/muyu-modules/muyu-product/muyu-product-server/pom.xml b/muyu-modules/muyu-product/muyu-product-server/pom.xml
index 5d82eaf..39068f6 100644
--- a/muyu-modules/muyu-product/muyu-product-server/pom.xml
+++ b/muyu-modules/muyu-product/muyu-product-server/pom.xml
@@ -55,11 +55,11 @@
-
+
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/PintuanController.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/PintuanController.java
new file mode 100644
index 0000000..ec4c756
--- /dev/null
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/controller/PintuanController.java
@@ -0,0 +1,29 @@
+package com.muyu.product.controller;
+
+import com.muyu.common.core.domain.Result;
+import com.muyu.product.domain.ActivityTeamInfo;
+import com.muyu.product.service.PintuanServicce;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@CrossOrigin
+@RestController
+@RequestMapping("/pintuan")
+public class PintuanController {
+
+ @Autowired
+ private PintuanServicce pimneyuanServicce;
+
+
+ @GetMapping("/list")
+ public Result list(@RequestBody ActivityTeamInfo activityTeamInfo ) {
+ List list = pimneyuanServicce.list(activityTeamInfo);
+ return Result.success(list);
+ }
+
+
+
+
+}
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 3d30223..4c14310 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
@@ -5,6 +5,7 @@ import javax.servlet.http.HttpServletResponse;
import com.muyu.product.cache.ProjectInfoCache;
import com.muyu.product.domain.resp.ProjectDetailResp;
+import com.muyu.product.domain.resp.ProjectInfoResp;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -50,9 +51,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);
}
@@ -121,8 +122,10 @@ public class ProjectInfoController extends BaseController {
@Log(title = "商品信息", businessType = BusinessType.UPDATE)
@PutMapping("/{id}")
@ApiOperation("修改商品信息")
- public Result edit(@PathVariable Long id, @RequestBody ProjectInfoEditReq projectInfoEditReq) {
- return toAjax(projectInfoService.updateById(ProjectInfo.editBuild(id,projectInfoEditReq)));
+ public Result edit(@PathVariable Long id, @RequestBody ProjectInfoEditReq projectInfoEditReq) {
+ projectInfoService.updProjects(id,projectInfoEditReq);
+ return Result.success();
+
}
/**
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/PintuanMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/PintuanMapper.java
new file mode 100644
index 0000000..847dd23
--- /dev/null
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/PintuanMapper.java
@@ -0,0 +1,36 @@
+package com.muyu.product.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.muyu.product.domain.ActivityTeamInfo;
+import com.muyu.product.domain.req.ActivityTeamInfoReq;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+/**
+ * 拼团展示详情表
+ *
+ * @author DongZeLiang
+ * @date 2024-02-27
+ */
+@Mapper
+public interface PintuanMapper extends BaseMapper {
+
+
+@Select("SELECT\n" +
+ "\tactivity_team_info.id,\n" +
+ "\tactivity_team_info.NAME,\n" +
+ "\tactivity_team_info.product_image,\n" +
+ "\tactivity_team_product_sku_info.team_price,\n" +
+ "\tactivity_team_product_sku_info.team_stock,\n" +
+ "\tactivity_team_info.end_time,\n" +
+ "\tactivity_team_info.STATUS \n" +
+ "FROM\n" +
+ "\tactivity_team_info\n" +
+ "\tLEFT JOIN activity_team_product_sku_info ON activity_team_product_sku_info.id = activity_team_info.id\n" +
+ " ")
+ List listActivity(ActivityTeamInfoReq activityTeamInfoReq);
+
+
+
+}
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..3d4f9cf 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
@@ -3,6 +3,7 @@ package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.ProjectInfo;
+import org.apache.ibatis.annotations.Param;
/**
* 商品信息Mapper接口
@@ -12,4 +13,12 @@ import com.muyu.product.domain.ProjectInfo;
*/
public interface ProjectInfoMapper extends BaseMapper {
+
+
+ ProjectInfo getuname(@Param("name") String name);
+
+
+
+
+
}
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/PintuanServicce.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/PintuanServicce.java
new file mode 100644
index 0000000..3956953
--- /dev/null
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/PintuanServicce.java
@@ -0,0 +1,20 @@
+package com.muyu.product.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.muyu.common.core.web.page.TableDataInfo;
+import com.muyu.product.domain.ActivityTeamInfo;
+import com.muyu.product.domain.model.ActivittyTeamInfoQueryReqModel;
+import com.muyu.product.domain.model.ActivityTeamInfoListModel;
+import com.muyu.product.domain.req.ActivityTeamInfoReq;
+
+public interface PintuanServicce extends IService {
+
+
+ TableDataInfo query (ActivittyTeamInfoQueryReqModel activittyTeamInfoQueryReqModel);
+
+
+
+
+
+
+}
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 0924c9e..d01bd43 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
@@ -1,10 +1,14 @@
package com.muyu.product.service;
import java.util.List;
+
+import com.muyu.common.core.domain.Result;
import com.muyu.product.domain.ProjectInfo;
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.ProjectInfoResp;
/**
* 商品信息Service接口
@@ -34,4 +38,8 @@ public interface ProjectInfoService extends IService {
* @return 商品详情
*/
ProjectDetailResp getDetailInfo (Long id);
+
+ List pageinfo(ProjectInfo queryBuild);
+
+ Result updProjects(Long id, ProjectInfoEditReq projectInfoEditReq);
}
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/PintuanServiceimpl.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/PintuanServiceimpl.java
new file mode 100644
index 0000000..2556854
--- /dev/null
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/PintuanServiceimpl.java
@@ -0,0 +1,78 @@
+package com.muyu.product.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.muyu.common.core.utils.StringUtils;
+import com.muyu.common.core.web.page.TableDataInfo;
+import com.muyu.product.domain.ActivityTeamInfo;
+import com.muyu.product.domain.model.ActivittyTeamInfoQueryReqModel;
+import com.muyu.product.domain.model.ActivityTeamInfoListModel;
+import com.muyu.product.domain.req.ActivityTeamInfoReq;
+import com.muyu.product.mapper.PintuanMapper;
+import com.muyu.product.service.PintuanServicce;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+
+
+@Service
+public class PintuanServiceimpl extends ServiceImpl implements PintuanServicce {
+
+
+ @Override
+ public TableDataInfo query(ActivittyTeamInfoQueryReqModel activittyTeamInfoQueryReqModel) {
+ LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>();
+
+ queryWrapper.like(StringUtils.isNotEmpty(activittyTeamInfoQueryReqModel.getKeyWord()),ActivityTeamInfo::getName,activittyTeamInfoQueryReqModel.getKeyWord());
+ queryWrapper.like(StringUtils.isNotEmpty(activittyTeamInfoQueryReqModel.getStatus()),ActivityTeamInfo::getStatus,activittyTeamInfoQueryReqModel.getStatus());
+
+
+ Page activityTeamInfoPage = this.page(activittyTeamInfoQueryReqModel.buildPage(), queryWrapper);
+ List activityTeamInfoList = activityTeamInfoPage.getRecords();
+ List activityTeamInfoQueryReqList = new ArrayList<>();
+
+
+ for (ActivityTeamInfo activityTeamInfo : activityTeamInfoList) {
+ ActivityTeamInfoListModel activityTeamInfoListModel = new ActivityTeamInfoListModel();
+
+ activityTeamInfoListModel.setId(activityTeamInfo.getId());
+ activityTeamInfoListModel.setName(activityTeamInfo.getName());
+ long totalParticipants = activityTeamInfoList.stream()
+ .mapToLong(ActivityTeamInfo::getaddTeamNumberCount)
+ .sum();
+ activityTeamInfoListModel.setAddTeamNumber(String.valueOf(totalParticipants));
+ activityTeamInfoListModel.setOpenTeamNumber();
+ activityTeamInfoListModel.setAttendNumber();
+ activityTeamInfoListModel.setEndTime(activityTeamInfo.getEndTime());
+ activityTeamInfoListModel.setProductImage(activityTeamInfo.getProductImage());
+ activityTeamInfoListModel.setTeamPrice();
+ activityTeamInfoListModel.setProductPrice();
+ activityTeamInfoListModel.setTeamStock();
+ activityTeamInfoListModel.setRemainStock();
+ activityTeamInfoListModel.setStatus(activityTeamInfo.getStatus());
+
+
+ activityTeamInfoQueryReqList.add(activityTeamInfoListModel);
+
+ }
+
+ TableDataInfo tableDataInfo = new TableDataInfo<>();
+ tableDataInfo.setTotal(activityTeamInfoPage.getTotal());
+ tableDataInfo.setRows(activityTeamInfoQueryReqList);
+ return tableDataInfo;
+ }
+
+ /**
+ * 商品拼团列表
+ *
+ * @param activityTeamInfoReq 拼团信息展示
+ * @return 商品拼团信息
+ */
+
+
+
+}
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 448a3d9..b011ed8 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
@@ -2,15 +2,20 @@ package com.muyu.product.service.impl;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.LinkedList;
import java.util.List;
+import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.ObjUtils;
import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.product.domain.*;
import com.muyu.product.domain.model.*;
+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.ProjectInfoResp;
+import com.muyu.product.mapper.RuleInfoMapper;
import com.muyu.product.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -48,6 +53,15 @@ public class ProjectInfoServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>();
- if (ObjUtils.notNull(projectInfo.getName())){
+ if (ObjUtils.notNull(projectInfo.getName())) {
queryWrapper.like(ProjectInfo::getName, projectInfo.getName());
}
- if (ObjUtils.notNull(projectInfo.getIntroduction())){
+ if (ObjUtils.notNull(projectInfo.getIntroduction())) {
queryWrapper.eq(ProjectInfo::getIntroduction, projectInfo.getIntroduction());
}
- if (ObjUtils.notNull(projectInfo.getMianType())){
+ if (ObjUtils.notNull(projectInfo.getMianType())) {
queryWrapper.eq(ProjectInfo::getMianType, projectInfo.getMianType());
}
- if (ObjUtils.notNull(projectInfo.getParentType())){
+ if (ObjUtils.notNull(projectInfo.getParentType())) {
queryWrapper.eq(ProjectInfo::getParentType, projectInfo.getParentType());
}
- if (ObjUtils.notNull(projectInfo.getType())){
+ if (ObjUtils.notNull(projectInfo.getType())) {
queryWrapper.eq(ProjectInfo::getType, projectInfo.getType());
}
- if (ObjUtils.notNull(projectInfo.getImage())){
+ if (ObjUtils.notNull(projectInfo.getImage())) {
queryWrapper.eq(ProjectInfo::getImage, projectInfo.getImage());
}
- if (ObjUtils.notNull(projectInfo.getCarouselImages())){
+ if (ObjUtils.notNull(projectInfo.getCarouselImages())) {
queryWrapper.eq(ProjectInfo::getCarouselImages, projectInfo.getCarouselImages());
}
- if (ObjUtils.notNull(projectInfo.getStatus())){
+ if (ObjUtils.notNull(projectInfo.getStatus())) {
queryWrapper.eq(ProjectInfo::getStatus, projectInfo.getStatus());
}
- if (ObjUtils.notNull(projectInfo.getRuleId())){
+ if (ObjUtils.notNull(projectInfo.getRuleId())) {
queryWrapper.eq(ProjectInfo::getRuleId, projectInfo.getRuleId());
}
- if (ObjUtils.notNull(projectInfo.getBrandId())){
+ if (ObjUtils.notNull(projectInfo.getBrandId())) {
queryWrapper.eq(ProjectInfo::getBrandId, projectInfo.getBrandId());
}
-
-
-
return list(queryWrapper);
}
@@ -110,21 +121,28 @@ public class ProjectInfoServiceImpl extends ServiceImpl attrValueList = projectInfoSaveReq.getAttrValueList();
List asProductAttributeInfoList = attrValueList.stream()
.map(attrValueModel -> AsProductAttributeInfo.attrValueModelBuild(attrValueModel, projectInfo::getId))
.toList();
- if (!asProductAttributeInfoList.isEmpty()){
+ if (!asProductAttributeInfoList.isEmpty()) {
asProductAttributeInfoService.saveBatch(asProductAttributeInfoList);
}
// sku ProductSkuModel -》 ProjectSkuInfo
@@ -132,7 +150,7 @@ public class ProjectInfoServiceImpl extends ServiceImpl projectSkuInfoList = productSkuModelList.stream().map(
productSkuModel -> ProjectSkuInfo.productSkuModelBuild(productSkuModel, projectInfo::getId)
).toList();
- if (!projectSkuInfoList.isEmpty()){
+ if (!projectSkuInfoList.isEmpty()) {
projectSkuInfoService.saveBatch(projectSkuInfoList);
}
}
@@ -146,7 +164,7 @@ public class ProjectInfoServiceImpl extends ServiceImpl templateAttributeGroupList = templateAttribute.getTemplateAttributeGroupList();
- List templateAttributeList = new ArrayList<>(){{
+ List templateAttributeList = new ArrayList<>() {{
addAll(templateAttribute.getTemplateAttributeList());
}};
// 属性组和商品属性的ID
@@ -187,11 +205,11 @@ public class ProjectInfoServiceImpl extends ServiceImpl attributeIdList = templateAttributeList.stream()
.map(TemplateAttributeModel::getId)
.toList();
- if (!attributeGroupIdList.isEmpty()){
- notInAttributeIdList.addAll( attributeGroupIdList );
+ if (!attributeGroupIdList.isEmpty()) {
+ notInAttributeIdList.addAll(attributeGroupIdList);
}
- if (!attributeIdList.isEmpty()){
- notInAttributeIdList.addAll( attributeIdList );
+ if (!attributeIdList.isEmpty()) {
+ notInAttributeIdList.addAll(attributeIdList);
}
// 添加上,商品的自有属性
List productAttributeList = this.asProductAttributeInfoService.list(
@@ -202,20 +220,20 @@ public class ProjectInfoServiceImpl extends ServiceImpl projectAttributeList = new ArrayList<>();
- if (!productAttributeList.isEmpty()){
+ if (!productAttributeList.isEmpty()) {
List attrIdList = productAttributeList.stream()
.map(AsProductAttributeInfo::getAttributeId)
.toList();
projectAttributeList = attributeInfoService.list(
- new LambdaQueryWrapper<>() {{
- in(AttributeInfo::getId, attrIdList);
- }}
- ).stream()
- .map(TemplateAttributeModel::attributeInfoBuild)
- .toList();
+ new LambdaQueryWrapper<>() {{
+ in(AttributeInfo::getId, attrIdList);
+ }}
+ ).stream()
+ .map(TemplateAttributeModel::attributeInfoBuild)
+ .toList();
}
// 把自有属性添加到商品属性的集合当中,进行合并
- if (!projectAttributeList.isEmpty()){
+ if (!projectAttributeList.isEmpty()) {
templateAttributeList.addAll(projectAttributeList);
}
return ProjectDetailResp.builder()
@@ -229,4 +247,57 @@ public class ProjectInfoServiceImpl extends ServiceImpl pageinfo(ProjectInfo queryBuild) {
+
+ List list = list(queryBuild);
+
+ LinkedList projectInfoRespLinkedList = new LinkedList<>();
+
+ list.forEach(p -> {
+ CategoryInfo mianTypeName = categoryInfoService.getById(p.getMianType());
+ CategoryInfo parentTypeName = categoryInfoService.getById(p.getParentType());
+ CategoryInfo typeName = p.getType() != null ? categoryInfoService.getById(p.getType()) : null;
+
+// 获取规格信息
+ RuleInfo ruleName = reluInfoMapper.selectById(p.getRuleId());
+
+
+ BrandInfo brandName = brandInfoService.getById(p.getBrandId());
+
+ ProjectInfoResp resp = ProjectInfoResp.builder()
+ .id(p.getId())
+ .name(p.getName())
+ .introduction(p.getIntroduction())
+ .mianType(p.getMianType())
+ .parentType(p.getParentType())
+ .type(p.getType())
+ .image(p.getImage())
+ .carouselImages(p.getCarouselImages())
+ .status(p.getStatus())
+ .mianTypeName(mianTypeName != null ? mianTypeName.getName() : "")
+ .parentTypeName(parentTypeName != null ? parentTypeName.getName() : "")
+ .typeName(typeName != null ? typeName.getName() : "")
+ .ruleName(ruleName != null ? ruleName.getName() : "")
+ .brandName(brandName != null ? brandName.getNam() : "")
+ .build();
+
+ projectInfoRespLinkedList.add(resp);
+
+ });
+ return projectInfoRespLinkedList;
+ }
+
+ @Override
+ public Result updProjects(Long id, ProjectInfoEditReq projectInfoEditReq) {
+ String name = projectInfoEditReq.getName();
+ ProjectInfo getuname = projectInfoMapper.getuname(name);
+ if(getuname!=null){
+ return Result.error("商品名称重复");
+ }
+ return null;
+ }
+
+
}
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/PintuanMapper.xml b/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/PintuanMapper.xml
new file mode 100644
index 0000000..5246f8c
--- /dev/null
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/resources/mapper/product/PintuanMapper.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ select id, name, product_image, team_price, team_stock, end_time, status from activity_team_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..7e08718 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/pom.xml b/muyu-modules/muyu-product/pom.xml
index 8841021..1fc4bb9 100644
--- a/muyu-modules/muyu-product/pom.xml
+++ b/muyu-modules/muyu-product/pom.xml
@@ -16,6 +16,7 @@
muyu-product-remote
muyu-product-server
muyu-product-cache
+