Browse Source

联合丽格

huangzhiguo 2 years ago
parent
commit
c46a1c69cd
29 changed files with 1973 additions and 23 deletions
  1. 5 0
      pom.xml
  2. 95 0
      src/main/java/com/caimei365/commodity/controller/MallOrganizeApi.java
  3. 177 0
      src/main/java/com/caimei365/commodity/controller/ProcurementApi.java
  4. 13 0
      src/main/java/com/caimei365/commodity/mapper/AdditionalRepository.java
  5. 99 0
      src/main/java/com/caimei365/commodity/mapper/MallOrganizeMapper.java
  6. 14 0
      src/main/java/com/caimei365/commodity/mapper/PageMapper.java
  7. 6 0
      src/main/java/com/caimei365/commodity/mapper/PriceMapper.java
  8. 13 0
      src/main/java/com/caimei365/commodity/mapper/ProcureRepository.java
  9. 23 0
      src/main/java/com/caimei365/commodity/mapper/ProcurementMapper.java
  10. 61 0
      src/main/java/com/caimei365/commodity/model/dto/ProcurementDto.java
  11. 36 0
      src/main/java/com/caimei365/commodity/model/po/AdditionalPo.java
  12. 59 0
      src/main/java/com/caimei365/commodity/model/po/ProcurePo.java
  13. 53 0
      src/main/java/com/caimei365/commodity/model/vo/MainmenuVo.java
  14. 25 0
      src/main/java/com/caimei365/commodity/model/vo/MallActiveImageVo.java
  15. 52 0
      src/main/java/com/caimei365/commodity/model/vo/MallActiveVo.java
  16. 66 0
      src/main/java/com/caimei365/commodity/model/vo/MallImageLinkVo.java
  17. 49 0
      src/main/java/com/caimei365/commodity/model/vo/MallOrganizeProductVo.java
  18. 51 0
      src/main/java/com/caimei365/commodity/model/vo/MallThemeVo.java
  19. 39 0
      src/main/java/com/caimei365/commodity/service/MallOrganizeService.java
  20. 74 0
      src/main/java/com/caimei365/commodity/service/ProcurementService.java
  21. 93 0
      src/main/java/com/caimei365/commodity/service/impl/AdditionalService.java
  22. 105 0
      src/main/java/com/caimei365/commodity/service/impl/MallOrganizeServiceImpl.java
  23. 48 23
      src/main/java/com/caimei365/commodity/service/impl/PageServiceImpl.java
  24. 118 0
      src/main/java/com/caimei365/commodity/service/impl/ProcureService.java
  25. 370 0
      src/main/java/com/caimei365/commodity/service/impl/ProcurementServiceImpl.java
  26. 142 0
      src/main/resources/mapper/MallOrganizeMapper.xml
  27. 63 0
      src/main/resources/mapper/PageMapper.xml
  28. 6 0
      src/main/resources/mapper/PriceMapper.xml
  29. 18 0
      src/main/resources/mapper/ProcurementMapper.xml

+ 5 - 0
pom.xml

@@ -62,6 +62,11 @@
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-loadbalancer</artifactId>
         </dependency>
+        <!-- mongo -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-mongodb</artifactId>
+        </dependency>
         <!-- mysql -->
         <dependency>
             <groupId>mysql</groupId>

+ 95 - 0
src/main/java/com/caimei365/commodity/controller/MallOrganizeApi.java

@@ -0,0 +1,95 @@
+package com.caimei365.commodity.controller;
+
+import com.caimei365.commodity.model.ResponseJson;
+import com.caimei365.commodity.model.vo.MallOrganizeProductVo;
+import com.caimei365.commodity.service.MallOrganizeService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/4/28
+ */
+@Api(tags = "外部商城")
+@RestController
+@RequestMapping("/commodity/MallOrganize")
+public class MallOrganizeApi {
+
+    @Autowired private MallOrganizeService mallOrganizeService;
+
+    /**
+     * 联合丽格小程序首页
+     * @return
+     */
+    @ApiOperation("小程序首页")
+    @ApiImplicitParams({
+            @ApiImplicitParam(readOnly = true, name = "organizeId", value = "组织Id 1 联合丽格")
+    })
+    @GetMapping("/mall/init")
+    public ResponseJson<Map<String, Object>> getMallHome(Integer organizeId) {
+        if (null == organizeId) {
+            return ResponseJson.error(-1,"商城类型不能为空",null);
+        }
+        return mallOrganizeService.getMallHome(organizeId);
+    }
+
+    /**
+     * 主菜单区详情
+     * @param organizeId
+     * @param id
+     * @return
+     */
+    @ApiOperation("主菜单区详情")
+    @ApiImplicitParams({
+            @ApiImplicitParam(readOnly = true, name = "organizeId", value = "组织Id 1 联合丽格"),
+            @ApiImplicitParam(readOnly = true, name = "jumpType", value = "跳转类型 1商品详情 2活动列表"),
+            @ApiImplicitParam(readOnly = true, name = "id", value = "菜单Id")
+    })
+    @GetMapping("/mall/detail")
+    public ResponseJson<Map<String,Object>> getMenu(Integer organizeId, Integer jumpType, Integer id) {
+        if (null == organizeId) {
+            return ResponseJson.error(-1,"商城类型不能为空",null);
+        }
+        if (null == jumpType) {
+            return ResponseJson.error(-1,"菜单类型不能为空",null);
+        }
+        if (null == id) {
+            return ResponseJson.error(-1,"菜单id不能为空",null);
+        }
+
+        return mallOrganizeService.getMenu(organizeId, jumpType, id);
+    }
+
+    /**
+     * 商品楼层详情
+     * @param activeId
+     * @param organizeId
+     * @return
+     */
+    @ApiOperation("商品楼层详情")
+    @ApiImplicitParams({
+            @ApiImplicitParam(readOnly = true, name = "organizeId", value = "组织Id 1 联合丽格"),
+            @ApiImplicitParam(readOnly = true, name = "activeId", value = "活动Id")
+    })
+    @GetMapping("/mall/organizeProducts")
+    public ResponseJson<List<MallOrganizeProductVo>> getOrganizeProducts(Integer organizeId, Integer activeId) {
+        if (null == activeId) {
+            return ResponseJson.error(-1,"活动id不能为空",null);
+        }
+        if (null == organizeId) {
+            return ResponseJson.error(-1,"商城类型不能为空",null);
+        }
+        return mallOrganizeService.getOrganizeProducts(activeId, organizeId);
+    }
+}

+ 177 - 0
src/main/java/com/caimei365/commodity/controller/ProcurementApi.java

@@ -0,0 +1,177 @@
+package com.caimei365.commodity.controller;
+
+import com.caimei365.commodity.model.ResponseJson;
+import com.caimei365.commodity.model.dto.ProcurementDto;
+import com.caimei365.commodity.service.ProcurementService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/4/26
+ */
+@Api(tags = "集采api")
+@RestController
+@RequestMapping("/commodity/procurement")
+public class ProcurementApi {
+    @Autowired
+    private ProcurementService procurementService;
+
+    /**
+     * 所有集采
+     * @param pageNo
+     * @param pageSize
+     * @return
+     */
+    @ApiOperation("所有集采")
+    @ApiImplicitParams({
+            @ApiImplicitParam(readOnly = true, name = "pageNo", value = "页面页数"),
+            @ApiImplicitParam(readOnly = true, name = "pageSize", value = "页面数据量"),
+    })
+    @GetMapping("/findList")
+    public ResponseJson<List<ProcurementDto>> findList(int pageNo, int pageSize) {
+        return  procurementService.findList(pageNo, pageSize);
+    }
+
+    /**
+     * 查看集采详情
+     * @param id
+     * @return
+     */
+    @ApiOperation("查看集采详情")
+    @ApiImplicitParam(readOnly = true, name = "id", value = "集采Id")
+    @PostMapping("/detail/{id}")
+    public ResponseJson<Map<String,Object>> detailProcurement(@PathVariable("id") Integer id) {
+        if (null == id) {
+            return ResponseJson.error(-1,"参数id不能为空", null);
+        }
+        return procurementService.detailProcurement(id);
+    }
+
+    /**
+     * 我参与的 | 我创建的
+     * @param userId
+     * @param procurementType 0 我参与的 1 我发起的
+     * @return
+     */
+    @ApiOperation("我参与的 | 我创建的")
+    @ApiImplicitParams({
+            @ApiImplicitParam(readOnly = true, name = "userId", value = "用户Id"),
+            @ApiImplicitParam(readOnly = true, name = "procurementType", value = "接口类型 0 我参与的 1 我发起的"),
+    })
+    @GetMapping("/procurement")
+    public ResponseJson<List<ProcurementDto>> myProcurement(Integer userId,Integer procurementType) {
+        if (null == userId) {
+            return ResponseJson.error(-1,"参数userId不能为空", null);
+        }
+        if (null == procurementType) {
+            return ResponseJson.error(-1,"参数集采类型不能为空", null);
+        }
+        return procurementService.myProcurement(userId, procurementType);
+    }
+
+    /**
+     * 修改集采信息回显
+     * @param id
+     * @param userId
+     * @param procurementType 0 我参与的 1 我发起的
+     * @return
+     */
+    @ApiOperation("修改集采信息回显")
+    @ApiImplicitParams({
+            @ApiImplicitParam(readOnly = true, name = "id", value = "集采id"),
+            @ApiImplicitParam(readOnly = true, name = "userId", value = "用户Id"),
+            @ApiImplicitParam(readOnly = true, name = "procurementType", value = "接口类型 0 我参与的 1 我发起的"),
+    })
+    @GetMapping("/editData")
+    public ResponseJson<ProcurementDto> editData(Integer id, Integer userId, Integer procurementType) {
+        if (null == id) {
+            return ResponseJson.error(-1,"参数集采id不能为空", null);
+        }
+        if (null == userId) {
+            return ResponseJson.error(-1,"参数userId不能为空", null);
+        }
+        if (null == procurementType) {
+            return ResponseJson.error(-1,"参数集采类型不能为空", null);
+        }
+        return procurementService.editData(id, userId, procurementType);
+    }
+
+    /**
+     * 发布集采 | 修改集采
+     * @param procurementDto
+     * @return
+     */
+    @ApiOperation("发布集采 | 修改集采")
+    @ApiImplicitParams({
+            @ApiImplicitParam(readOnly = true, name = "userId", value = "用户Id"),
+            @ApiImplicitParam(readOnly = true, name = "productImage", value = "商品图片"),
+            @ApiImplicitParam(readOnly = true, name = "productName", value = "商品名称"),
+            @ApiImplicitParam(readOnly = true, name = "price", value = "期望单价"),
+            @ApiImplicitParam(readOnly = true, name = "number", value = "购买数量")
+    })
+    @PostMapping("/saveProcurement")
+    public ResponseJson saveProcurement(ProcurementDto procurementDto) {
+        if (null == procurementDto.getUserId()) {
+            return ResponseJson.error(-1,"参数userId不能为空", null);
+        }
+        return procurementService.saveProcurement(procurementDto);
+    }
+
+    /**
+     * 参与集采
+     * @param procurementDto
+     * @return
+     */
+    @ApiOperation("参与集采")
+    @ApiImplicitParams({
+            @ApiImplicitParam(readOnly = true, name = "userId", value = "用户Id"),
+            @ApiImplicitParam(readOnly = true, name = "productImage", value = "商品图片"),
+            @ApiImplicitParam(readOnly = true, name = "productName", value = "商品名称"),
+            @ApiImplicitParam(readOnly = true, name = "price", value = "期望单价"),
+            @ApiImplicitParam(readOnly = true, name = "number", value = "购买数量")
+    })
+    @PostMapping("/pateProcurement")
+    public ResponseJson participateProcurement(ProcurementDto procurementDto) {
+        if (null == procurementDto.getUserId()) {
+            return ResponseJson.error(-1,"参数userId不能为空", null);
+        }
+        return procurementService.participateProcurement(procurementDto);
+    }
+
+    /**
+     * 删除集采 | 退出集采
+     * @param id
+     * @param userId
+     * @param procurementType
+     * @return
+     */
+    @ApiOperation("删除集采 | 退出集采")
+    @ApiImplicitParams({
+            @ApiImplicitParam(readOnly = true, name = "id", value = "集采id"),
+            @ApiImplicitParam(readOnly = true, name = "userId", value = "用户Id"),
+            @ApiImplicitParam(readOnly = true, name = "procurementType", value = "接口类型 0 我参与的 1 我发起的")
+    })
+    @GetMapping("/updateProcurement")
+    public ResponseJson updateProcurement(Integer id, Integer userId, Integer procurementType) {
+        if (null == id) {
+            return ResponseJson.error(-1,"集采id不能为空", null);
+        }
+        if (null == userId) {
+            return ResponseJson.error(-1,"userId不能为空", null);
+        }
+        if (null == procurementType) {
+            return ResponseJson.error(-1,"类型不能为空", null);
+        }
+        return procurementService.updateProcurement(id, userId, procurementType);
+    }
+}

+ 13 - 0
src/main/java/com/caimei365/commodity/mapper/AdditionalRepository.java

@@ -0,0 +1,13 @@
+package com.caimei365.commodity.mapper;
+
+import com.caimei365.commodity.model.po.AdditionalPo;
+import org.springframework.data.mongodb.repository.MongoRepository;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/4/26
+ */
+public interface AdditionalRepository extends MongoRepository<AdditionalPo, String> {
+}

+ 99 - 0
src/main/java/com/caimei365/commodity/mapper/MallOrganizeMapper.java

@@ -0,0 +1,99 @@
+package com.caimei365.commodity.mapper;
+
+import com.caimei365.commodity.model.vo.*;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/4/28
+ */
+@Mapper
+public interface MallOrganizeMapper {
+
+
+    /**
+     * 头部菜单
+     * @param organizeId
+     * @return
+     */
+    List<MainmenuVo> getMainmenu(@Param("organizeId") Integer organizeId);
+
+    /**
+     * 外部商城 banner图
+     * @param organizeId
+     * @return
+     */
+    List<MallImageLinkVo> getMallBannerImages(@Param("organizeId") Integer organizeId);
+
+    /**
+     * 外部商城小程序专题活动
+     * @param organizeId
+     * @return
+     */
+    List<MallThemeVo> getmallTheme(@Param("organizeId") Integer organizeId);
+
+    /**
+     * 外部商城活动
+     * @param organizeId
+     * @return
+     */
+    List<MallActiveVo> getMallActive(@Param("organizeId") Integer organizeId);
+
+    /**
+     * 外部商城活动商品
+     * @return
+     */
+    List<MallOrganizeProductVo> getMallProducts(@Param("activeId") Integer activeId);
+
+    /**
+     * 活动Id
+     * @param organizeId
+     * @param id
+     * @return
+     */
+    MainmenuVo getMenuInfo(@Param("organizeId") Integer organizeId, @Param("id") Integer id);
+
+    /**
+     * 主菜单区详情 -- 单商品
+     * @param organizeId
+     * @param id
+     * @return
+     */
+    MallOrganizeProductVo getMenuProductList(@Param("organizeId") Integer organizeId, @Param("id") Integer id);
+
+    /**
+     * 活动信息
+     * @param organizeId
+     * @param activeId
+     * @return
+     */
+    MallActiveVo getActiveById(@Param("organizeId") Integer organizeId, @Param("activeId") Integer activeId);
+
+    /**
+     * 获取活动宣传图
+     * @param activeId
+     * @return
+     */
+    List<MallActiveImageVo> getActiveImageById(@Param("activeId") Integer activeId);
+    /**
+     * 主菜单区详情 -- 活动
+     * @param organizeId
+     * @param activeId
+     * @return
+     */
+    List<MallOrganizeProductVo> getMenuActiveList(@Param("organizeId") Integer organizeId, @Param("activeId") Integer activeId);
+
+    /**
+     * 商品楼层详情
+     * @param organizeId
+     * @param activeId
+     * @return
+     */
+    List<MallOrganizeProductVo> getOrganizeProducts(@Param("organizeId") Integer organizeId, @Param("activeId") Integer activeId);
+
+}

+ 14 - 0
src/main/java/com/caimei365/commodity/mapper/PageMapper.java

@@ -121,11 +121,25 @@ public interface PageMapper {
      */
     List<ShopImageVo> getSupplierImage(Integer source);
 
+    /**
+     * 获取用户组织
+     * @param userId
+     * @return
+     */
+    Integer getOrganizeId(@Param("userId") Integer userId);
+
     /**
      * 商品详情页
      */
     ProductDetailVo getProductDetails(Integer productId);
 
+    /**
+     * 外部商城 商品详情
+     * @param organizeId
+     * @param productId
+     * @return
+     */
+    ProductDetailVo getOrganizeProductDetails(@Param("organizeId") Integer organizeId, @Param("productId") Integer productId);
     /**
      * 再次购买
      *

+ 6 - 0
src/main/java/com/caimei365/commodity/mapper/PriceMapper.java

@@ -24,6 +24,12 @@ public interface PriceMapper {
      * 根据商品id查找价格
      */
     PriceVo getDetailPrice(Integer productId);
+    /**
+     * 根据商品Id查找组织商品价格
+     * @param productId
+     * @return
+     */
+    List<Sku> getDetailOrganizePrice(Integer productId);
     /**
      * 根据商品id集合查找 价格列表
      */

+ 13 - 0
src/main/java/com/caimei365/commodity/mapper/ProcureRepository.java

@@ -0,0 +1,13 @@
+package com.caimei365.commodity.mapper;
+
+import com.caimei365.commodity.model.po.ProcurePo;
+import org.springframework.data.mongodb.repository.MongoRepository;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/4/25
+ */
+public interface ProcureRepository extends MongoRepository<ProcurePo,String> {
+}

+ 23 - 0
src/main/java/com/caimei365/commodity/mapper/ProcurementMapper.java

@@ -0,0 +1,23 @@
+package com.caimei365.commodity.mapper;
+
+import com.caimei365.commodity.model.vo.UserVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/4/26
+ */
+@Mapper
+public interface ProcurementMapper {
+    /**
+     * 用户机构名称
+     * @param userIds
+     * @return
+     */
+    List<UserVo> selUserInfo(@Param("userIds") List<String> userIds);
+}

+ 61 - 0
src/main/java/com/caimei365/commodity/model/dto/ProcurementDto.java

@@ -0,0 +1,61 @@
+package com.caimei365.commodity.model.dto;
+
+import lombok.Data;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/4/26
+ */
+@Data
+public class ProcurementDto {
+    /**
+     * id
+     */
+    private String id;
+    /**
+     * 发布人Id
+     */
+    private String userId;
+    /**
+     * 用户名
+     */
+    private String userName;
+    /**
+     * 商品图片
+     */
+    private String productImage;
+    /**
+     * 商品名称
+     */
+    private String productName;
+    /**
+     * 期望单价
+     */
+    private String price;
+    /**
+     * 购买数量
+     */
+    private String number;
+    /**
+     * 创建时间
+     */
+    private String saveTime;
+    /**
+     * 创建人Id
+     */
+    private String createUserId;
+    /**
+     * 参与机构数
+     */
+    private String partNumber;
+    /**
+     * 是否实现 0 以实现 1 未实现
+     */
+    private String isAchieve;
+    /**
+     * 是否删除 0 未删除 其他删除
+     */
+    private String delFlag;
+}

+ 36 - 0
src/main/java/com/caimei365/commodity/model/po/AdditionalPo.java

@@ -0,0 +1,36 @@
+package com.caimei365.commodity.model.po;
+
+import lombok.Data;
+import lombok.ToString;
+import nonapi.io.github.classgraph.json.Id;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/4/26
+ */
+@Document(collection = "additionalCollection")
+@ToString
+@Data
+public class AdditionalPo {
+    /**
+     * 参与集采id
+     */
+    @Id
+    private String id;
+    /**
+     * 集采Id
+     */
+    private String procureId;
+    /**
+     * 参与Id
+     */
+    private String additionalId;
+    /**
+     * 是否删除 0 未删除 其他删除
+     */
+    private String delFlag;
+
+}

+ 59 - 0
src/main/java/com/caimei365/commodity/model/po/ProcurePo.java

@@ -0,0 +1,59 @@
+package com.caimei365.commodity.model.po;
+
+import lombok.Data;
+import lombok.ToString;
+import nonapi.io.github.classgraph.json.Id;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/4/25
+ */
+@Document(collection = "procureCollection")
+@Data
+@ToString
+public class ProcurePo {
+    /**
+     * id
+     */
+    @Id
+    private String id;
+    /**
+     * 发布人Id
+     */
+    private String userId;
+    /**
+     * 商品图片
+     */
+    private String productImage;
+    /**
+     * 商品名称
+     */
+    private String productName;
+    /**
+     * 期望单价
+     */
+    private String price;
+    /**
+     * 购买数量
+     */
+    private String number;
+    /**
+     * 创建时间
+     */
+    private String saveTime;
+    /**
+     * 创建人Id
+     */
+    private String createUserId;
+    /**
+     * 是否实现 0 以实现 1 未实现
+     */
+    private String isAchieve;
+    /**
+     * 是否删除 0 未删除 其他删除
+     */
+    private String delFlag;
+}

+ 53 - 0
src/main/java/com/caimei365/commodity/model/vo/MainmenuVo.java

@@ -0,0 +1,53 @@
+package com.caimei365.commodity.model.vo;
+
+import lombok.Data;
+
+/**
+ * Description
+ * 外部商城小程序主菜单表
+ * @author : Charles
+ * @date : 2023/4/27
+ */
+@Data
+public class MainmenuVo {
+    /**
+     * id
+     */
+    private Integer id;
+    /**
+     * 组织ID,具体对应cm_mall_organize表ID
+     */
+    private Integer organizeId;
+    /**
+     * 菜单主题
+     */
+    private String topicvar;
+    /**
+     * 菜单banner图
+     */
+    private String imagevar;
+    /**
+     * 排序值
+     */
+    private Integer sort;
+    /**
+     * 状态0停用 1启用
+     */
+    private String enabledStatus;
+    /**
+     * 跳转类型 1商品详情 2活动列表
+     */
+    private Integer jumpType;
+    /**
+     * 跳转商品Id
+     */
+    private Integer jumpProductId;
+    /**
+     * 跳转活动Id
+     */
+    private Integer jumpActiveId;
+    /**
+     * 创建时间
+     */
+    private String addTime;
+}

+ 25 - 0
src/main/java/com/caimei365/commodity/model/vo/MallActiveImageVo.java

@@ -0,0 +1,25 @@
+package com.caimei365.commodity.model.vo;
+
+import lombok.Data;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/5/4
+ */
+@Data
+public class MallActiveImageVo {
+    /**
+     * 活动宣传图Id
+     */
+    private Integer id;
+    /**
+     * 活动Id
+     */
+    private Integer activeId;
+    /**
+     * 宣传图
+     */
+    private String image;
+}

+ 52 - 0
src/main/java/com/caimei365/commodity/model/vo/MallActiveVo.java

@@ -0,0 +1,52 @@
+package com.caimei365.commodity.model.vo;
+
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/4/28
+ */
+@Data
+public class MallActiveVo {
+    /**
+     * id
+     */
+    private Integer id;
+    /**
+     * 组织ID,具体对应cm_mall_organize表ID
+     */
+    private Integer organizeId;
+    /**
+     * 活动主题
+     */
+    private String topic;
+    /**
+     * 活动宣传图
+     */
+    private String image;
+    /**
+     * 状态 0停用 1启用
+     */
+    private String enabledStatus;
+    /**
+     * 活动类型 1商品列表 2宣传图(一张) 3宣传图(多张)
+     */
+    private String activeType;
+    /**
+     * 创建时间
+     */
+    private Date addTime;
+    /**
+     * 活动宣传图集合
+     */
+    private List<MallActiveImageVo> activeImageVos;
+    /**
+     * 活动商品集合
+     */
+    private List<MallOrganizeProductVo> products;
+}

+ 66 - 0
src/main/java/com/caimei365/commodity/model/vo/MallImageLinkVo.java

@@ -0,0 +1,66 @@
+package com.caimei365.commodity.model.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Description
+ * 外部商城小程序首页轮播图表
+ * @author : Charles
+ * @date : 2023/4/27
+ */
+@Data
+public class MallImageLinkVo implements Serializable {
+
+    /**
+     * id
+     */
+    private Integer id;
+    /**
+     * 组织ID,具体对应cm_mall_organize表ID
+     */
+    private Integer organizeId;
+    /**
+     * banner名称
+     * @return
+     */
+    private String bannerName;
+    /**
+     * banner图
+     */
+    private String bannerImage;
+    /**
+     * 排序
+     */
+    private Integer sort;
+
+    /**
+     * 跳转类型 1商品详情 2活动列表
+     * @return
+     */
+    private String jumpType;
+    /**
+     * 跳转商品Id
+     */
+    private Integer jumpProductId;
+    /**
+     * 跳转活动Id
+     */
+    private String jumpActiveId;
+
+    /**
+     * 状态 0停用 1启用
+     * @return
+     */
+    private String enabledStatus;
+    /**
+     * 创建时间
+     */
+    private Date addTime;
+    /**
+     * 最后更新时间
+     */
+    private Date updateTime;
+}

+ 49 - 0
src/main/java/com/caimei365/commodity/model/vo/MallOrganizeProductVo.java

@@ -0,0 +1,49 @@
+package com.caimei365.commodity.model.vo;
+
+import lombok.Data;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/4/28
+ */
+@Data
+public class MallOrganizeProductVo {
+    /**
+     * 商品Id
+     */
+    private String productId;
+    /**
+     * 商品名称
+     */
+    private String name;
+    /**
+     * 商品主图
+     */
+    private String mainImage;
+    /**
+     * 市场价
+     */
+    private String normalPrice;
+    /**
+     * 成本价
+     */
+    private String costPrice;
+    /**
+     * 启用阶梯价格标识 0否 1是
+     */
+    private String ladderPriceFlag;
+    /**
+     * 售价(此起售价适用于非阶梯价格)
+     */
+    private String retailPrice;
+    /**
+     * 最小起订量(此起订量适用于非阶梯价格)
+     */
+    private String minBuyNumber;
+    /**
+     * 商品状态,1已上架,2已下架
+     */
+    private String validFlag;
+}

+ 51 - 0
src/main/java/com/caimei365/commodity/model/vo/MallThemeVo.java

@@ -0,0 +1,51 @@
+package com.caimei365.commodity.model.vo;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * Description
+ * 外部商城小程序专题活动表
+ * @author : Charles
+ * @date : 2023/4/27
+ */
+@Data
+public class MallThemeVo {
+    /**
+     * id
+     */
+    private Integer id;
+    /**
+     * 组织ID,具体对应cm_mall_organize表ID
+     */
+    private Integer organizeId;
+    /**
+     * 专题活动主题
+     */
+    private String topic;
+    /**
+     * 专题活动banner图
+     */
+    private String image;
+    /**
+     * 状态0停用 1启用
+     */
+    private String enabledStatus;
+    /**
+     * 跳转类型 1商品详情 2活动列表
+     */
+    private String jumpType;
+    /**
+     * 跳转商品Id
+     */
+    private Integer jumpProductId;
+    /**
+     * 跳转活动Id
+     */
+    private Integer jumpActiveId;
+    /**
+     * 创建时间
+     */
+    private Date addTime;
+}

+ 39 - 0
src/main/java/com/caimei365/commodity/service/MallOrganizeService.java

@@ -0,0 +1,39 @@
+package com.caimei365.commodity.service;
+
+import com.caimei365.commodity.model.ResponseJson;
+import com.caimei365.commodity.model.vo.MallOrganizeProductVo;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/4/28
+ */
+public interface MallOrganizeService {
+
+    /**
+     * 联合丽格小程序首页
+     * @return
+     */
+    ResponseJson<Map<String, Object>> getMallHome(Integer organizeId);
+
+    /**
+     * 主菜单区详情
+     * @param organizeId
+     * @param id
+     * @return
+     */
+    ResponseJson<Map<String,Object>> getMenu(Integer organizeId, Integer jumpType, Integer id);
+
+    /**
+     * 商品楼层详情
+     * @param activeId
+     * @param organizeId
+     * @return
+     */
+    ResponseJson<List<MallOrganizeProductVo>> getOrganizeProducts(Integer activeId, Integer organizeId);
+
+}

+ 74 - 0
src/main/java/com/caimei365/commodity/service/ProcurementService.java

@@ -0,0 +1,74 @@
+package com.caimei365.commodity.service;
+
+import com.caimei365.commodity.model.ResponseJson;
+import com.caimei365.commodity.model.dto.ProcurementDto;
+import com.caimei365.commodity.model.po.ProcurePo;
+import com.caimei365.commodity.model.vo.PaginationVo;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/4/26
+ */
+public interface ProcurementService {
+
+    /**
+     * 所有集采
+     * @param pageNo
+     * @param pageSize
+     * @return
+     */
+    ResponseJson<List<ProcurementDto>> findList(int pageNo, int pageSize);
+
+    /**
+     * 查看详情
+     * @param id
+     * @return
+     */
+    ResponseJson<Map<String,Object>> detailProcurement(Integer id);
+
+    /**
+     * 我参与的 | 我创建的
+     * @param userId
+     * @return
+     */
+    ResponseJson<List<ProcurementDto>> myProcurement(Integer userId,Integer procurementType);
+
+    /**
+     * 修改集采信息回显
+     * @param id
+     * @param userId
+     * @param procurementType 0 我参与的 1 我发起的
+     * @return
+     */
+    ResponseJson<ProcurementDto> editData(Integer id, Integer userId, Integer procurementType);
+
+    /**
+     * 发布集采
+     * @param procurementDto
+     * @return
+     */
+    ResponseJson saveProcurement(ProcurementDto procurementDto);
+
+    /**
+     * 参与集采
+     * @param procurementDto
+     * @return
+     */
+    ResponseJson participateProcurement(ProcurementDto procurementDto);
+
+    /**
+     * 删除集采 | 退出集采
+     * @param id
+     * @param userId
+     * @param procurementType
+     * @return
+     */
+    ResponseJson updateProcurement(Integer id, Integer userId, Integer procurementType);
+
+
+}

+ 93 - 0
src/main/java/com/caimei365/commodity/service/impl/AdditionalService.java

@@ -0,0 +1,93 @@
+package com.caimei365.commodity.service.impl;
+
+import com.caimei365.commodity.mapper.AdditionalRepository;
+import com.caimei365.commodity.model.po.AdditionalPo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.mongodb.core.MongoTemplate;
+import org.springframework.data.mongodb.core.query.Criteria;
+import org.springframework.data.mongodb.core.query.Query;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/4/26
+ */
+@Service
+public class AdditionalService {
+
+    @Autowired private AdditionalRepository additionalRepository;
+    @Autowired private MongoTemplate mongoTemplate;
+    /**
+     * 保存
+     * @param additional
+     */
+    public void save(AdditionalPo additional){
+        //如果需要自定义主键,可以在这里指定主键;如果不指定主键,MongoDB会自动生成主键
+        //设置一些默认初始值。。。
+        //调用dao
+        additionalRepository.save(additional);
+    }
+
+    /**
+     * 修改
+     * @param additional
+     */
+    public void update(AdditionalPo additional){
+        //调用dao
+        additionalRepository.save(additional);
+    }
+
+    /**
+     * 根据id删除
+     * @param id
+     */
+    public void deleteById(String id){
+        //调用dao
+        additionalRepository.deleteById(id);
+    }
+
+    /**
+     * 根据条件删除
+     * @param additional
+     */
+    public void deleteByParams(AdditionalPo additional){
+        //调用dao
+        additionalRepository.delete(additional);
+    }
+
+    /**
+     * 查询所有
+     * @return
+     */
+    public List<AdditionalPo> findList(){
+        //调用dao
+        return additionalRepository.findAll();
+    }
+    /**
+     * 根据id查询
+     * @param id
+     * @return
+     */
+    public AdditionalPo findById(String id){
+        //调用dao
+        return additionalRepository.findById(id).get();
+    }
+
+    /**
+     * 根据主集采Id查询
+     * @param procureId
+     * @return
+     */
+    public List<AdditionalPo> findProcureById(String procureId){
+        //调用dao
+        Query query = new Query();
+        query.addCriteria(Criteria.where("procureId").is(procureId));
+        query.addCriteria(Criteria.where("delFlag").is("0"));
+        return mongoTemplate.find(query,AdditionalPo.class);
+    }
+
+}

+ 105 - 0
src/main/java/com/caimei365/commodity/service/impl/MallOrganizeServiceImpl.java

@@ -0,0 +1,105 @@
+package com.caimei365.commodity.service.impl;
+
+import com.caimei365.commodity.mapper.MallOrganizeMapper;
+import com.caimei365.commodity.model.ResponseJson;
+import com.caimei365.commodity.model.vo.*;
+import com.caimei365.commodity.service.MallOrganizeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/4/28
+ */
+@Service
+public class MallOrganizeServiceImpl implements MallOrganizeService {
+
+    @Autowired private MallOrganizeMapper mallOrganizeMapper;
+    /**
+     * 联合丽格小程序首页
+     *
+     * @param organizeId
+     * @return
+     */
+    @Override
+    public ResponseJson<Map<String, Object>> getMallHome(Integer organizeId) {
+        Map<String, Object> map = new HashMap<>();
+        // 头部菜单
+        List<MainmenuVo> mainmenu = mallOrganizeMapper.getMainmenu(organizeId);
+        map.put("mainmenu", mainmenu);
+        // banner图
+        List<MallImageLinkVo> bannerImageList = mallOrganizeMapper.getMallBannerImages(organizeId);
+        map.put("bannerList", bannerImageList);
+        // 专题活动
+        List<MallThemeVo> mallThemeVos = mallOrganizeMapper.getmallTheme(organizeId);
+        map.put("mallTheme", mallThemeVos);
+        // 商品楼层
+        List<MallActiveVo> mallActive = mallOrganizeMapper.getMallActive(organizeId);
+        // 楼层商品
+        for (MallActiveVo active : mallActive) {
+            List<MallOrganizeProductVo> mallProducts = mallOrganizeMapper.getMallProducts(active.getId());
+            if (null != mallProducts) {
+                active.setProducts(mallProducts);
+            }
+        }
+        map.put("mallActive", mallActive);
+        return ResponseJson.success(map);
+    }
+
+    /**
+     * 主菜单区详情
+     *
+     * @param organizeId
+     * @param id
+     * @return
+     */
+    @Override
+    public ResponseJson<Map<String,Object>> getMenu(Integer organizeId,Integer jumpType, Integer id) {
+        Map<String, Object> map = new HashMap<>();
+        // 获取菜单信息
+        MainmenuVo menuInfo = mallOrganizeMapper.getMenuInfo(organizeId, id);
+        if (menuInfo == null) {
+            return ResponseJson.error(-1,"该菜单不存在,请刷新菜单",null);
+        }
+        if (1 == menuInfo.getJumpType()) {
+            // 菜单跳转单商品
+            MallOrganizeProductVo menuProductList = mallOrganizeMapper.getMenuProductList(organizeId, id);
+            map.put("menuProductList", menuProductList);
+        } else {
+            // 菜单跳转活动
+            if (null != menuInfo.getJumpActiveId()) {
+                MallActiveVo active = mallOrganizeMapper.getActiveById(organizeId, menuInfo.getJumpActiveId());
+                // 活动宣传图
+                List<MallActiveImageVo> imageList = mallOrganizeMapper.getActiveImageById(menuInfo.getJumpActiveId());
+                // 活动商品信息
+                List<MallOrganizeProductVo> menuList = mallOrganizeMapper.getMenuActiveList(organizeId, id);
+                active.setProducts(menuList);
+                active.setActiveImageVos(imageList);
+                map.put("active", active);
+            } else {
+                return ResponseJson.error(-1,"该活动不存在,请联系维护人员",null);
+            }
+        }
+        return ResponseJson.success(map);
+    }
+
+    /**
+     * 商品楼层详情
+     *
+     * @param activeId
+     * @param organizeId
+     * @return
+     */
+    @Override
+    public ResponseJson<List<MallOrganizeProductVo>> getOrganizeProducts(Integer activeId, Integer organizeId) {
+        List<MallOrganizeProductVo> organizeProducts = mallOrganizeMapper.getOrganizeProducts(activeId, organizeId);
+        return ResponseJson.success(organizeProducts);
+    }
+}

+ 48 - 23
src/main/java/com/caimei365/commodity/service/impl/PageServiceImpl.java

@@ -551,7 +551,17 @@ public class PageServiceImpl implements PageService {
      */
     @Override
     public ResponseJson<ProductDetailVo> getProductDetails(Integer productId, Integer userId) {
-        ProductDetailVo product = pageMapper.getProductDetails(productId);
+        // 获取用户组织 0 采美
+        Integer organizeId = pageMapper.getOrganizeId(userId);
+        // 商品详情页
+        ProductDetailVo product = null;
+        // 采美商品详情页
+        if (0 == organizeId) {
+            product = pageMapper.getProductDetails(productId);
+        } else{
+        // 外部商城 商品详情页  -- 联合丽格
+            product = pageMapper.getOrganizeProductDetails(organizeId,productId);
+        }
         //当该商品的“能否退货”字段的值是“不能”时,新增特殊商品退货须知提示
         if (product == null) {
             //商品不存在
@@ -603,11 +613,13 @@ public class PageServiceImpl implements PageService {
         product.setBigTypeName(list.size() > 0 ? list.get(0) : null);
         product.setSmallTypeName(list.size() > 1 ? list.get(1) : null);
         product.setTinyTypeName(list.size() > 2 ? list.get(2) : null);
-        // 商品云上美博会活动状态
-        Integer pcBeautyStatus = shopMapper.getPcBeautyStatusById(product.getProductId());
-        Integer appletsBeautyStatus = shopMapper.getAppletsBeautyStatusById(product.getProductId());
-        product.setPcActType(null != pcBeautyStatus ? 1 : 0);
-        product.setAppletsActType(null != appletsBeautyStatus ? 1 : 0);
+        if (0 == organizeId) {
+            // 商品云上美博会活动状态
+            Integer pcBeautyStatus = shopMapper.getPcBeautyStatusById(product.getProductId());
+            Integer appletsBeautyStatus = shopMapper.getAppletsBeautyStatusById(product.getProductId());
+            product.setPcActType(null != pcBeautyStatus ? 1 : 0);
+            product.setAppletsActType(null != appletsBeautyStatus ? 1 : 0);
+        }
         // 商品资料id
         Integer archiveId = pageMapper.getArchiveIdById(product.getProductId());
         product.setArchiveId(null != archiveId ? archiveId : 0);
@@ -626,23 +638,36 @@ public class PageServiceImpl implements PageService {
         }
         // 商品不处于已删除/待审核/审核未通过的状态
         if (0 != product.getValidFlag()) {
-            // 数据库获取基本价格信息
-            PriceVo price = priceMapper.getDetailPrice(productId);
-            // 根据用户id设置详细价格
-            priceUtilService.setPriceByUserId(price, userId, 0);
-            // 设置价格
-            product.setPrice(price.getPrice());
-            product.setOriginalPrice(price.getOriginalPrice());
-            product.setMinBuyNumber(price.getMinBuyNumber());
-            product.setUnit(price.getUnit());
-            product.setStock(price.getStock());
-            product.setSkus(price.getSkus());
-            product.setSkuId(price.getSkuId());
-            product.setActStatus(price.getActStatus());
-            product.setPromotions(price.getPromotions());
-            product.setUserIdentity(price.getUserIdentity());
-            product.setSvipProductFlag(price.getSvipProductFlag());
-            product.setSvipPriceTag(price.getSvipPriceTag());
+            // 采美价格设置
+            if (0 == organizeId) {
+                // 数据库获取基本价格信息
+                PriceVo price = priceMapper.getDetailPrice(productId);
+                // 根据用户id设置详细价格
+                priceUtilService.setPriceByUserId(price, userId, 0);
+                // 设置价格
+                product.setPrice(price.getPrice());
+                product.setOriginalPrice(price.getOriginalPrice());
+                product.setMinBuyNumber(price.getMinBuyNumber());
+                product.setUnit(price.getUnit());
+                product.setStock(price.getStock());
+                product.setSkus(price.getSkus());
+                product.setSkuId(price.getSkuId());
+                product.setActStatus(price.getActStatus());
+                product.setPromotions(price.getPromotions());
+                product.setUserIdentity(price.getUserIdentity());
+                product.setSvipProductFlag(price.getSvipProductFlag());
+                product.setSvipPriceTag(price.getSvipPriceTag());
+            }
+            // 组织设置价格 -- 联合丽格
+            if (1 == organizeId) {
+                // 数据库获取基本价格信息
+                List<Sku> skus = priceMapper.getDetailOrganizePrice(productId);
+                // 设置价格
+                product.setPrice(skus.get(0).getPrice());
+                product.setMinBuyNumber(skus.get(0).getMinBuyNumber());
+                product.setSkuId(skus.get(0).getSkuId());
+                product.setSkus(skus);
+            }
             //设置展示的价格等级
             product.setPriceGrade(priceUtilService.getPriceGrade(product.getPrice()));
             //查询商品收藏情况,1未收藏,0未收藏,未收藏过该商品用户是null

+ 118 - 0
src/main/java/com/caimei365/commodity/service/impl/ProcureService.java

@@ -0,0 +1,118 @@
+package com.caimei365.commodity.service.impl;
+
+import com.caimei365.commodity.mapper.ProcureRepository;
+import com.caimei365.commodity.model.po.ProcurePo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Sort;
+import org.springframework.data.mongodb.core.MongoTemplate;
+import org.springframework.data.mongodb.core.aggregation.Aggregation;
+import org.springframework.data.mongodb.core.aggregation.LookupOperation;
+import org.springframework.data.mongodb.core.query.Criteria;
+import org.springframework.data.mongodb.core.query.Query;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/4/25
+ */
+@Service
+public class ProcureService {
+
+    @Autowired private ProcureRepository procureRepository;
+    @Autowired private MongoTemplate mongoTemplate;
+
+
+    /**
+     * 保存
+     * @param procure
+     */
+    public void save(ProcurePo procure){
+        //如果需要自定义主键,可以在这里指定主键;如果不指定主键,MongoDB会自动生成主键
+        //设置一些默认初始值。。。
+        //调用dao
+        procureRepository.save(procure);
+    }
+
+    /**
+     * 修改
+     * @param procure
+     */
+    public void update(ProcurePo procure){
+        //调用dao
+        procureRepository.save(procure);
+    }
+
+    /**
+     * 根据id删除
+     * @param id
+     */
+    public void deleteById(String id){
+        //调用dao
+        procureRepository.deleteById(id);
+    }
+
+    /**
+     * 查询所有集采
+     * @return
+     */
+    public List<ProcurePo> findList(int pageNo, int pageSize){
+        //调用dao
+        Query query = new Query();
+        query.addCriteria(Criteria.where("delFlag").is("0"));
+        query.with(Sort.by(Sort.Direction.DESC, "saveTime"));
+        query.limit(pageSize);
+        query.skip(pageSize * (pageNo - 1));
+        return mongoTemplate.find(query, ProcurePo.class);
+    }
+    /**
+     * 根据id查询
+     * @param id
+     * @return
+     */
+    public ProcurePo findById(String id){
+        //调用dao
+        return procureRepository.findById(id).get();
+    }
+
+    /**
+     * 我参与的集采
+     * @param userId
+     * @return
+     */
+    public List<ProcurePo> findInvolvedList(Integer userId) {
+        Query query = new Query();
+        query.addCriteria(Criteria.where("userId").is(userId));
+        query.addCriteria(Criteria.where("createUserId").not().is(userId));
+        query.with(Sort.by(Sort.Direction.DESC, "saveTime"));
+        query.with(Sort.by(Sort.Direction.DESC, "isAchieve"));
+        List<ProcurePo> procureList = mongoTemplate.find(query, ProcurePo.class);
+        procureList.forEach(p -> {
+
+        });
+        return mongoTemplate.find(query, ProcurePo.class);
+    }
+
+    /**
+     * 我发起的集采
+     * @param userId
+     * @return
+     */
+    public List<ProcurePo> findUserList(Integer userId) {
+        Query query = new Query();
+        query.addCriteria(Criteria.where("createUserId").is(userId));
+        query.with(Sort.by(Sort.Direction.DESC, "saveTime"));
+        query.with(Sort.by(Sort.Direction.DESC, "isAchieve"));
+        return mongoTemplate.find(query, ProcurePo.class);
+    }
+
+    public ProcurePo editData(Integer id, Integer userId) {
+        Query query = new Query();
+        query.addCriteria(Criteria.where("id").is(id));
+        query.addCriteria(Criteria.where("userId").is(userId));
+        return mongoTemplate.find(query, ProcurePo.class).get(0);
+    }
+}

+ 370 - 0
src/main/java/com/caimei365/commodity/service/impl/ProcurementServiceImpl.java

@@ -0,0 +1,370 @@
+package com.caimei365.commodity.service.impl;
+
+import com.caimei365.commodity.mapper.ProcurementMapper;
+import com.caimei365.commodity.model.ResponseJson;
+import com.caimei365.commodity.model.dto.ProcurementDto;
+import com.caimei365.commodity.model.po.AdditionalPo;
+import com.caimei365.commodity.model.po.ProcurePo;
+import com.caimei365.commodity.model.vo.PaginationVo;
+import com.caimei365.commodity.model.vo.UserVo;
+import com.caimei365.commodity.service.ProcurementService;
+import com.caimei365.commodity.utils.ImageUtils;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2023/4/26
+ */
+@Service
+public class ProcurementServiceImpl implements ProcurementService {
+    @Value("${caimei.wwwDomain}")
+    private String domain;
+
+    @Autowired ProcurementMapper procurementMapper;
+    // 集采 | 接龙参与信息
+    @Resource  ProcureService procureService;
+    // 发起与参与关联
+    @Resource AdditionalService additionalService;
+
+    private static SimpleDateFormat saveFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+    private static SimpleDateFormat returnFormat = new SimpleDateFormat("yyyy-MM-dd");
+
+    /**
+     * 所有集采
+     * @param pageNo
+     * @param pageSize
+     * @return
+     */
+    @Override
+    public ResponseJson<List<ProcurementDto>> findList(int pageNo, int pageSize) {
+        List<ProcurementDto> procurementList = new ArrayList<>();
+        ProcurementDto procurementDto = new ProcurementDto();
+        // 参与者记录
+        List<AdditionalPo> additionalPos = additionalService.findList();
+        // 所有集采信息
+        List<ProcurePo> list = procureService.findList(pageNo, pageSize);
+        // 用户信息获取
+        List<String> userIds = list.stream().map(ProcurePo::getUserId).collect(Collectors.toList());
+        List<UserVo> userInfo = procurementMapper.selUserInfo(userIds);
+        if (null != list && list.size() > 0) {
+            list.forEach(p -> {
+                procurementDto.setId(p.getId());
+                procurementDto.setUserId(p.getUserId());
+                if (null != userInfo) {
+                    procurementDto.setUserName(userInfo.get(userInfo.indexOf(p.getUserId())).getUserName());
+                }
+                String imageURL = ImageUtils.getImageURL("product", p.getProductImage(), 0, domain);
+                if (StringUtils.isNotBlank(imageURL)) {
+                    procurementDto.setProductImage(imageURL);
+                }
+                procurementDto.setProductName(p.getProductName());
+                procurementDto.setPrice(p.getPrice());
+                procurementDto.setSaveTime(returnFormat.format(p.getSaveTime()));
+                if (StringUtils.isNotBlank(p.getCreateUserId())) {
+                    procurementDto.setCreateUserId(p.getCreateUserId());
+                }
+                procurementDto.setNumber(p.getNumber());
+                procurementDto.setIsAchieve(p.getIsAchieve());
+                procurementDto.setDelFlag(p.getDelFlag());
+                Integer count = Collections.frequency(additionalPos, p.getId());
+                procurementDto.setPartNumber(count.toString());
+                procurementList.add(procurementDto);
+            });
+        }
+        return ResponseJson.success(procurementList);
+    }
+
+    /**
+     * 查看详情
+     *
+     * @param id
+     * @return
+     */
+    @Override
+    public ResponseJson<Map<String,Object>> detailProcurement(Integer id) {
+        Map<String, Object> map = new HashMap<>();
+
+        // 参与者集合
+        List<ProcurementDto> procurementList = new ArrayList<>();
+        ProcurementDto procurementDto = new ProcurementDto();
+        // 参与者
+        ProcurementDto procurement = new ProcurementDto();
+        // 发起者信息
+        ProcurePo procurePo = procureService.findById(id.toString());
+        List<String> userProcurIds = new ArrayList<>();
+        userProcurIds.add(procurePo.getUserId());
+        List<UserVo> userProcurInfo = procurementMapper.selUserInfo(userProcurIds);
+        // 发起者信息设置
+        procurementDto.setId(procurePo.getId());
+        procurementDto.setUserId(procurePo.getUserId());
+        if (null != userProcurInfo && userProcurInfo.size() > 0) {
+            procurementDto.setUserName(userProcurInfo.get(0).getUserName());
+        }
+        procurementDto.setProductImage(procurePo.getProductImage());
+        procurementDto.setProductName(procurePo.getProductName());
+        procurementDto.setPrice(procurePo.getPrice());
+        procurementDto.setSaveTime(returnFormat.format(procurePo.getSaveTime()));
+        if (StringUtils.isNotBlank(procurePo.getCreateUserId())) {
+            procurementDto.setCreateUserId(procurePo.getCreateUserId());
+        }
+        procurementDto.setNumber(procurePo.getNumber());
+        procurementDto.setIsAchieve(procurePo.getIsAchieve());
+        procurementDto.setDelFlag(procurePo.getDelFlag());
+        map.put("procurement", procurementDto);
+        // 设置参与者信息
+        List<AdditionalPo> additionalList = additionalService.findProcureById(procurePo.getId());
+        for (AdditionalPo add : additionalList) {
+            // 参与者信息
+            ProcurePo procure = procureService.findById(add.getProcureId());
+            procurement.setId(procure.getId());
+            procurement.setUserId(procure.getUserId());
+            String imageURL = ImageUtils.getImageURL("product", procure.getProductImage(), 0, domain);
+            if (StringUtils.isNotBlank(imageURL)) {
+                procurement.setProductImage(imageURL);
+            }
+            procurement.setProductName(procure.getProductName());
+            procurement.setPrice(procure.getPrice());
+            procurement.setSaveTime(returnFormat.format(procure.getSaveTime()));
+            if (StringUtils.isNotBlank(procure.getCreateUserId())) {
+                procurement.setCreateUserId(procure.getCreateUserId());
+            }
+            procurement.setNumber(procure.getNumber());
+            procurement.setIsAchieve(procure.getIsAchieve());
+            procurement.setDelFlag(procure.getDelFlag());
+            procurementList.add(procurement);
+        }
+        // 用户信息获取
+        List<String> userIds = procurementList.stream().map(ProcurementDto::getUserId).collect(Collectors.toList());
+        List<UserVo> userInfo = procurementMapper.selUserInfo(userIds);
+        // 用户信息赋予
+        if (null != userInfo) {
+            procurementList.forEach(p -> {
+                p.setUserName(userInfo.get(userInfo.indexOf(p.getUserId())).getUserName());
+            });
+        }
+        map.put("procurementList",procurementList);
+        return ResponseJson.success(map);
+    }
+
+    /**
+     * 我参与的 | 我创建的
+     *
+     * @param userId
+     * @param procurementType 0 我参与的 1 我发起的
+     * @return
+     */
+    @Override
+    public ResponseJson<List<ProcurementDto>> myProcurement(Integer userId, Integer procurementType) {
+        List<ProcurementDto> procurementList = new ArrayList<>();
+        ProcurementDto procurementDto = new ProcurementDto();
+        // 参与者记录
+        List<AdditionalPo> additionalPos = additionalService.findList();
+        List<ProcurePo> list = new ArrayList<>();
+        if (0 == procurementType) {
+            // 我参与的
+            list = procureService.findInvolvedList(userId);
+        } else {
+            // 我发起的
+            list = procureService.findUserList(userId);
+        }
+        // 设置返回信息
+        if (null != list && list.size() > 0) {
+            list.forEach(p -> {
+                procurementDto.setId(p.getId());
+                procurementDto.setUserId(p.getUserId());
+                String imageURL = ImageUtils.getImageURL("product", p.getProductImage(), 0, domain);
+                if (StringUtils.isNotBlank(imageURL)) {
+                    procurementDto.setProductImage(imageURL);
+                }
+                procurementDto.setProductName(p.getProductName());
+                procurementDto.setPrice(p.getPrice());
+                procurementDto.setSaveTime(returnFormat.format(p.getSaveTime()));
+                if (StringUtils.isNotBlank(p.getCreateUserId())) {
+                    procurementDto.setCreateUserId(p.getCreateUserId());
+                }
+                procurementDto.setNumber(p.getNumber());
+                procurementDto.setIsAchieve(p.getIsAchieve());
+                procurementDto.setDelFlag(p.getDelFlag());
+                Integer count = Collections.frequency(additionalPos, p.getId());
+                procurementDto.setPartNumber(count.toString());
+                procurementList.add(procurementDto);
+            });
+        }
+        // 用户信息获取
+        List<String> userIds = procurementList.stream().map(ProcurementDto::getUserId).collect(Collectors.toList());
+        List<UserVo> userInfo = procurementMapper.selUserInfo(userIds);
+        // 用户信息赋予
+        if (null != userInfo) {
+            procurementList.forEach(p -> {
+                p.setUserName(userInfo.get(userInfo.indexOf(p.getUserId())).getUserName());
+            });
+        }
+        return ResponseJson.success(procurementList);
+    }
+
+    /**
+     * 修改集采信息回显
+     *
+     * @param id
+     * @param userId
+     * @param procurementType 0 我参与的 1 我发起的
+     * @return
+     */
+    @Override
+    public ResponseJson<ProcurementDto> editData(Integer id, Integer userId,Integer procurementType) {
+        ProcurementDto procurementDto = new ProcurementDto();
+        List<ProcurePo> involvedList = new ArrayList<>();
+        if (0 == procurementType) {
+            // 我参与的集采修改回显
+            involvedList = procureService.findInvolvedList(userId);
+        } else {
+            // 我发起的集采修改回显
+            involvedList = procureService.findUserList(userId);
+        }
+        // 检索匹配
+        ProcurePo procurePo = involvedList.get(involvedList.indexOf(id));
+        List<String> userIds = new ArrayList<>();
+        userIds.add(procurePo.getUserId());
+        List<UserVo> userInfo = procurementMapper.selUserInfo(userIds);
+        // 返回赋值
+        procurementDto.setId(procurePo.getId());
+        procurementDto.setUserId(procurePo.getUserId());
+        if (null != userInfo && userInfo.size() > 0) {
+            procurementDto.setUserName(userInfo.get(0).getUserName());
+        }
+        String imageURL = ImageUtils.getImageURL("product", procurePo.getProductImage(), 0, domain);
+        if (StringUtils.isNotBlank(imageURL)) {
+            procurementDto.setProductImage(imageURL);
+        }
+        procurementDto.setProductName(procurePo.getProductName());
+        procurementDto.setPrice(procurePo.getPrice());
+        procurementDto.setSaveTime(saveFormat.format(new Date()));
+        if (StringUtils.isNotBlank(procurePo.getCreateUserId())) {
+            procurementDto.setCreateUserId(procurePo.getCreateUserId());
+        }
+        procurementDto.setNumber(procurePo.getNumber());
+        procurementDto.setIsAchieve(procurePo.getIsAchieve());
+        procurementDto.setDelFlag(procurePo.getDelFlag());
+        return ResponseJson.success(procurementDto);
+    }
+
+    /**
+     * 发布集采 | 修改集采
+     *
+     * @param procurementDto
+     * @return
+     */
+    @Override
+    public ResponseJson saveProcurement(ProcurementDto procurementDto) {
+        ProcurePo procurePo = new ProcurePo();
+        // 初始化数据
+        procurePo.setUserId(procurementDto.getUserId());
+        procurePo.setProductImage(procurementDto.getProductImage());
+        procurePo.setProductName(procurementDto.getProductName());
+        procurePo.setPrice(procurementDto.getPrice());
+        procurePo.setSaveTime(saveFormat.format(new Date()));
+        procurePo.setNumber(procurementDto.getNumber());
+        if (StringUtils.isNotBlank(procurementDto.getId())) {
+            // 修改集采信息
+            procurePo.setId(procurementDto.getId());
+            procurePo.setCreateUserId(procurementDto.getCreateUserId());
+            procurePo.setIsAchieve(procurementDto.getIsAchieve());
+            procurePo.setDelFlag(procurementDto.getDelFlag());
+            procureService.update(procurePo);
+        } else {
+            // 发布集采需求
+            procurePo.setCreateUserId(procurementDto.getUserId());
+            procurePo.setIsAchieve("0");
+            procurePo.setDelFlag("0");
+            procureService.save(procurePo);
+        }
+        return ResponseJson.success();
+    }
+
+    /**
+     * 参与集采
+     *
+     * @param procurementDto
+     * @return
+     */
+    @Override
+    public ResponseJson participateProcurement(ProcurementDto procurementDto) {
+        ProcurePo procurePo = new ProcurePo();
+
+        // 参与集采需求
+        procurePo.setUserId(procurementDto.getUserId());
+        procurePo.setProductImage(procurementDto.getProductImage());
+        procurePo.setProductName(procurementDto.getProductName());
+        procurePo.setPrice(procurementDto.getPrice());
+        procurePo.setSaveTime(saveFormat.format(new Date()));
+        procurePo.setNumber(procurementDto.getNumber());
+        procurePo.setCreateUserId(procurementDto.getUserId());
+        procurePo.setIsAchieve("0");
+        procurePo.setDelFlag("0");
+        procureService.save(procurePo);
+        // 设置集采 发布与参与对应关系
+        AdditionalPo additionalPo = new AdditionalPo();
+        additionalPo.setProcureId(procurementDto.getId());
+        additionalPo.setAdditionalId(procurePo.getId());
+        additionalPo.setDelFlag("0");
+        additionalService.save(additionalPo);
+        return ResponseJson.success();
+    }
+
+    /**
+     * 删除集采 | 退出集采
+     *
+     * @param id
+     * @param userId
+     * @param procurementType 0 删除集采 1 退出集采
+     * @return
+     */
+    @Override
+    public ResponseJson updateProcurement(Integer id, Integer userId, Integer procurementType) {
+        // 更新集采信息
+        if (1 == procurementType) {
+            // 退出集采
+            AdditionalPo additionalPo = new AdditionalPo();
+            ProcurePo procurePo = new ProcurePo();
+            // 主集采下所有参与者 参与id
+            List<AdditionalPo> poList = additionalService.findProcureById(id.toString());
+            for (AdditionalPo add : poList) {
+                ProcurePo byId = procureService.findById(add.getAdditionalId());
+                if (byId.getUserId().equals(userId)) {
+                    // 修改集采参与记录关系
+                    additionalPo.setAdditionalId(byId.getId());
+                    additionalPo.setDelFlag("1");
+                    additionalService.update(additionalPo);
+                    // 修改集采参与记录
+                    procurePo.setId(byId.getId());
+                    procurePo.setDelFlag("1");
+                    procureService.update(procurePo);
+                }
+            }
+        } else {
+            // 删除集采
+            ProcurePo procurePo = new ProcurePo();
+            procurePo.setId(id.toString());
+            procurePo.setDelFlag("1");
+            procureService.update(procurePo);
+            // 删除集采关系
+            AdditionalPo additionalPo = new AdditionalPo();
+            additionalPo.setProcureId(id.toString());
+            additionalPo.setDelFlag("1");
+            additionalService.update(additionalPo);
+        }
+        return ResponseJson.success();
+    }
+
+
+}

+ 142 - 0
src/main/resources/mapper/MallOrganizeMapper.xml

@@ -0,0 +1,142 @@
+<?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.caimei365.commodity.mapper.MallOrganizeMapper">
+
+    <select id="getMainmenu" resultType="com.caimei365.commodity.model.vo.MainmenuVo">
+        SELECT id, organizeId, topic, image, sort, enabledStatus, jumpType, jumpProductId, jumpActiveId
+        FROM cm_mall_mainmenu
+        <where>
+            enabledStatus = 1
+            <if test="organizeId != null and organizeId != ''">
+                AND organizeId = #{organizeId}
+            </if>
+        </where>
+    </select>
+    <select id="getMallBannerImages" resultType="com.caimei365.commodity.model.vo.MallImageLinkVo">
+        SELECT id, organizeID as oranizeId, bannerName, bannerImage, sort, jumpType, jumpProductId, jumpActiveId
+        FROM cm_mall_banner_image
+        <where>
+            enabledStatus = 1
+            <if test="organizeId != null and organizeId != ''">
+                AND organizeID = #{organizeId}
+            </if>
+        </where>
+    </select>
+    <select id="getmallTheme" resultType="com.caimei365.commodity.model.vo.MallThemeVo">
+        SELECT id, organizeId, topic, image, enabledStatus, jumpType, jumpProductId, jumpActiveId
+        FROM cm_mall_theme
+        <where>
+            enabledStatus = 1
+            <if test="organizeId != null and organizeId != ''">
+                AND organizeId = #{organizeId}
+            </if>
+        </where>
+    </select>
+    <select id="getMallActive" resultType="com.caimei365.commodity.model.vo.MallActiveVo">
+        SELECT cma.id, cma.organizeId, cma.topic, cma.enabledStatus, cma.activeType
+        FROM cm_mall_active cma
+        <where>
+            cma.enabledStatus = 1
+            <if test="organizeId != null and organizeId != ''">
+                AND cma.organizeId = #{organizeId}
+            </if>
+        </where>
+    </select>
+    <select id="getMallProducts" resultType="com.caimei365.commodity.model.vo.MallOrganizeProductVo">
+        SELECT
+        cmop.productID as productId,
+        cmop.normalPrice,
+        cmop.costPrice,
+        cmop.ladderPriceFlag,
+        cmop.retailPrice,
+        cmop.minBuyNumber,
+        cmop.validFlag,
+        p.name,
+        p.mainImage
+        FROM cm_mall_active_product cmap
+        LEFT JOIN cm_mall_organize_products cmop ON cmap.id = cmop.productID
+        LEFT JOIN product p ON p.productID = cmap.productId
+        <where>
+            cmop.delFlag = 0 AND cmop.validFlag = 1
+            <if test="activeId != null and activeId != ''">
+                AND cmap.activeId = #{activeId}
+            </if>
+        </where>
+        limit 6
+    </select>
+    <select id="getMenuInfo" resultType="com.caimei365.commodity.model.vo.MainmenuVo">
+        SELECT id, organizeId, topic, image, sort, enabledStatus, jumpType, jumpProductId, jumpActiveId
+        FROM cm_mall_mainmenu WHERE enabledStatus = 1 AND organizeId = #{organizeId} AND id = #{id}
+    </select>
+    <select id="getMenuProductList" resultType="com.caimei365.commodity.model.vo.MallOrganizeProductVo">
+        SELECT
+            cmop.productID as productId,
+            cmop.normalPrice,
+            cmop.costPrice,
+            cmop.ladderPriceFlag,
+            cmop.retailPrice,
+            cmop.minBuyNumber,
+            cmop.validFlag,
+            p.name,
+            p.mainImage
+        FROM cm_mall_mainmenu cmm
+                 LEFT JOIN cm_mall_organize_products cmop ON cmop.productID = cmm.jumpProductId
+                 LEFT JOIN product p ON p.productId = cmop.productID
+        WHERE cmm.organizeId = #{organizeId} and cmm.id = #{id}
+          and cmm.enabledStatus = 1 and cmop.delFlag = 0
+    </select>
+    <select id="getActiveById" resultType="com.caimei365.commodity.model.vo.MallActiveVo">
+        SELECT id, organizeId, topic, enabledStatus, activeType
+        FROM cm_mall_active
+        <where>
+            enabledStatus = 1
+            <if test="organizeId != null and organizeId != ''">
+                AND organizeId = #{organizeId}
+            </if>
+            <if test="activeId != null and activeId != ''">
+                AND id = #{activeId}
+            </if>
+        </where>
+    </select>
+    <select id="getActiveImageById" resultType="com.caimei365.commodity.model.vo.MallActiveImageVo">
+        select id, activeId, image
+        from cm_mall_active_image
+        where activeId = #{activeId}
+    </select>
+    <select id="getMenuActiveList" resultType="com.caimei365.commodity.model.vo.MallOrganizeProductVo">
+        SELECT
+            cmop.productID as productId,
+            cmop.normalPrice,
+            cmop.costPrice,
+            cmop.ladderPriceFlag,
+            cmop.retailPrice,
+            cmop.minBuyNumber,
+            cmop.validFlag,
+            p.name,
+            p.mainImage
+        FROM cm_mall_active cma
+         LEFT JOIN cm_mall_active_product cmap ON cmap.activeId = cma.id
+         LEFT JOIN cm_mall_organize_products cmop ON cmop.id = cmap.productId
+         LEFT JOIN product p ON p.productId = cmop.productId
+        where cma.organizeId = #{organizeId} and cma.id = #{activeId}
+          and cma.enabledStatus = 1 and cmop.delFlag = 0
+    </select>
+    <select id="getOrganizeProducts" resultType="com.caimei365.commodity.model.vo.MallOrganizeProductVo">
+        SELECT
+            cmop.productID as productId,
+            cmop.normalPrice,
+            cmop.costPrice,
+            cmop.ladderPriceFlag,
+            cmop.retailPrice,
+            cmop.minBuyNumber,
+            cmop.validFlag,
+            p.name,
+            p.mainImage
+        FROM cm_mall_organize_products cmop
+         LEFT JOIN cm_mall_active_product cmap ON cmap.productId = cmop.id
+         LEFT JOIN product p ON p.productId = cmap.productId
+         LEFT JOIN cm_mall_active cma ON cma.id = cmap.activeId
+        WHERE cma.id = #{activeId} AND cma.organizeId = #{organizeId}
+        limit 20
+    </select>
+</mapper>

+ 63 - 0
src/main/resources/mapper/PageMapper.xml

@@ -229,6 +229,9 @@
         </if>
         order by - sort desc,createDate desc
     </select>
+    <select id="getOrganizeId" resultType="java.lang.Integer">
+        SELECT userOrganizeID FROM USER WHERE userId = #{userId}
+    </select>
     <select id="getProductDetails" resultType="com.caimei365.commodity.model.vo.ProductDetailVo">
         select p.productID                                                                                     as productId,
                p.shopID                                                                                        as shopId,
@@ -296,6 +299,66 @@
                  left join shop s on s.shopId = p.shopId
         where p.productID = #{productId}
     </select>
+    <select id="getOrganizeProductDetails" resultType="com.caimei365.commodity.model.vo.ProductDetailVo">
+        SELECT p.productID                                                                                     AS productId,
+               p.shopID                                                                                        AS shopId,
+               cmop.normalPrice AS normalPrice,
+               IFNULL((SELECT stock FROM cm_sku WHERE productId = 4857 ORDER BY price ASC LIMIT 1), 0) AS stock,
+               cmop.minBuyNumber AS minBuyNumber,
+               (SELECT unit FROM cm_sku WHERE productId = 4857 ORDER BY price ASC LIMIT 1)             AS unit,
+               p.name,
+               p.aliasName,
+               p.commodityType,
+               p.mainImage,
+               p.invoiceType,
+               p.bigTypeID                                                                                     AS bigTypeId,
+               p.smallTypeID                                                                                   AS smallTypeId,
+               p.tinyTypeID                                                                                    AS tinyTypeId,
+               p.searchKey,
+               p.visibility,
+               p.commodityDetailsFlag,
+               p.brandID                                                                                       AS brandId,
+               p.productType,
+               p.tags,
+               p.includedTax,
+               p.productCategory,
+               p.serviceNumber,
+               p.taxPoint,
+               p.supplierTaxPoint,
+               p.priceFlag,
+               p.actFlag,
+               p.addTime,
+               p.hasSkuFlag,
+               p.sellNumber,
+               p.sortIndex,
+               p.featuredFlag,
+               p.recommendType,
+               p.machineType,
+               p.productCode,
+               p.updateTime,
+               cmop.validFlag,
+               p.searchKey,
+               p.allAreaFlag,
+               p.step,
+               p.provinceIds,
+               p.qualificationImg,
+               p.trainingMethod,
+               p.trainingType,
+               p.trainingFee,
+               p.productRemarks,
+               p.productDetail                                                                                 AS productDetailChose,
+               s.shopType                                                                                      AS shopType,
+               p.qualificationNo                                                                               AS qualificationNo,
+               p.productName                                                                                   AS productName,
+               p.qualificationTime                                                                             AS qualificationTime,
+               p.qualificationLink                                                                             AS qualificationLink,
+               p.returnGoodsStutas,
+               P.relatedLabels
+        FROM cm_mall_organize_products cmop
+                 LEFT JOIN product p ON p.productId = cmop.productId
+                 LEFT JOIN shop s ON s.shopId = p.shopId
+        WHERE p.productID = #{productId} and cmop.organizeID = #{organizeId}
+    </select>
     <select id="getBuyAgainProducts" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
         select p.productID                 as productId,
                p.actStatus,

+ 6 - 0
src/main/resources/mapper/PriceMapper.xml

@@ -34,6 +34,12 @@
                 order by cs.price asc limit 1) ccs on ccs.productId=p.productId
         where p.productID = #{productId}
     </select>
+    <select id="getDetailOrganizePrice" resultType="com.caimei365.commodity.model.dto.Sku">
+        SELECT skuId, minBuyNumber, price
+        FROM cm_mall_product_sku
+        WHERE productId = #{productId}
+        ORDER BY price ASC
+    </select>
     <select id="getListPriceByProductIds" resultType="com.caimei365.commodity.model.vo.PriceVo">
         select
         p.productID as productId,

+ 18 - 0
src/main/resources/mapper/ProcurementMapper.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.caimei365.commodity.mapper.ProcurementMapper">
+    <select id="selUserInfo" resultType="com.caimei365.commodity.model.vo.UserVo">
+        select u.userID as userId, c.name as userName
+        from user u
+        left join club c on c.userID = u.userID
+        <where>
+            c.name is not null
+            <if test="userIds.size() > 0 and userIds != null">
+                and u.userID in
+                <foreach collection="userIds" item="userId" open="(" separator="," close=")">
+                    #{userId}
+                </foreach>
+            </if>
+        </where>
+    </select>
+</mapper>