提交 ecae0717 作者: xiaowang

接口放行

上级 a02ea2d9
...@@ -12,7 +12,6 @@ import io.swagger.annotations.*; ...@@ -12,7 +12,6 @@ import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -133,8 +132,7 @@ public class BackstageProductSpecController { ...@@ -133,8 +132,7 @@ public class BackstageProductSpecController {
// } // }
@ApiOperation(value = "feign根据渠道等级获取单价信息") @ApiOperation(value = "feign根据渠道等级获取单价信息")
@GetMapping("feignGetSpecLeaseUnitPrice") @PostMapping("feignGetSpecLeaseUnitPrice")
@ApiIgnore
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public BigDecimal feignGetUnitPriceByTag(@RequestBody PriceAcquisition priceAcquisition) { public BigDecimal feignGetUnitPriceByTag(@RequestBody PriceAcquisition priceAcquisition) {
return productSkuService.feignGetUnitPriceByTag(priceAcquisition); return productSkuService.feignGetUnitPriceByTag(priceAcquisition);
......
package com.mmc.pms.controller.web;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author LW
* @date 2023/6/8 15:19
* 概要:
*/
@RestController
@RequestMapping("/lease/goods")
@Api(tags = {"web端-设备租赁-相关接口"})
public class WebLeaseGoodsController {
}
...@@ -90,6 +90,8 @@ public interface GoodsInfoDao { ...@@ -90,6 +90,8 @@ public interface GoodsInfoDao {
List<MallGoodsProductDO> listIndustryProductList(List<Integer> industrySpecIds); List<MallGoodsProductDO> listIndustryProductList(List<Integer> industrySpecIds);
List<GoodsInfo> ListGoodsInfoByCategoryId(Integer id); List<GoodsInfo> ListGoodsInfoByCategoryId(Integer id);
List<MallProdSkuInfoSpecDO> getMallProSkuInfoSpec(Integer goodsInfoId);
} }
......
...@@ -551,22 +551,41 @@ public class GoodsInfoServiceImpl implements GoodsInfoService { ...@@ -551,22 +551,41 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
private List<GoodsSpecDTO> getProductSpecInfo(Integer goodsInfoId) { private List<GoodsSpecDTO> getProductSpecInfo(Integer goodsInfoId) {
// 获取商品对应绑定sku的信息 // 获取商品对应绑定sku的信息
List<MallProdInfoDO> mallProSkuInfo = goodsInfoDao.getMallProSkuInfo(goodsInfoId); List<MallProdInfoDO> mallProdSkuInfoList = goodsInfoDao.getMallProSkuInfo(goodsInfoId);
// 获取该产品下的规格id List<GoodsSpecDTO> list = mallProdSkuInfoList.stream().map(MallProdInfoDO::buildGoodsSpecDTO).collect(Collectors.toList());
Map<Integer, String> specIdsMap = mallProSkuInfo.stream().collect(Collectors.toMap(MallProdInfoDO::getId, MallProdInfoDO::getProductSpecIdList)); // 获取规格来源详细信息
List<GoodsSpecDTO> list = mallProSkuInfo.stream().map(MallProdInfoDO::buildGoodsSpecDTO).collect(Collectors.toList()); List<MallProdSkuInfoSpecDO> mallProdSkuInfoSpec = goodsInfoDao.getMallProSkuInfoSpec(goodsInfoId);
for (GoodsSpecDTO goodsSpecDTO : list) { // 根据id查询出规格的具体信息
String specIds = specIdsMap.get(goodsSpecDTO.getId()); list = list.stream().peek(d -> {
String[] ids = specIds.split(","); List<MallProductSpecDTO> specList = new ArrayList<>();
List<Integer> idList = new ArrayList<>(); for (MallProdSkuInfoSpecDO e : mallProdSkuInfoSpec) {
for (String id : ids) { if (d.getId().equals(e.getMallProdSkuInfoId())) {
idList.add(Integer.parseInt(id)); // 构建规格对象
ProductSpecDO productSpecDO = e.getProductSpecDO();
MallProductSpecDTO productSpecDTO = productSpecDO.buildMallProductSpecDTO();
productSpecDTO.setProductSkuId(d.getSkuId());
productSpecDTO.setId(e.getId());
productSpecDTO.setProductSpec(e.getProductSpecId());
if (d.getFlag().equals(1)) {
// 获取自定义sku下规格的价格配置信息
ProductSpecCPQVO productSpecCPQVO = new ProductSpecCPQVO();
productSpecCPQVO.setProductSpecId(e.getProductSpecId());
List<ProductSpecPriceDO> productSpecPrice = productDao.getProductSpecPrice(productSpecCPQVO);
List<SpecPriceVO> collect = productSpecPrice.stream().map(m -> {
SpecPriceVO specPriceVO = new SpecPriceVO();
specPriceVO.setId(m.getId());
specPriceVO.setPrice(m.getPrice());
specPriceVO.setCooperationTag(m.getCooperationTag());
return specPriceVO;
}).collect(Collectors.toList());
productSpecCPQVO.setSpecPrice(collect);
productSpecDTO.setProductSpecCPQVO(productSpecCPQVO);
}
specList.add(productSpecDTO);
}
} }
// 根据specIds集合找出spec的信息 d.setProductSpecList(specList);
List<ProductSpecDO> productSpecDOS = productDao.listProductSpecInfo(idList); }).collect(Collectors.toList());
List<MallProductSpecDTO> mallProductSpecList = productSpecDOS.stream().map(ProductSpecDO::buildMallProductSpecDTO).collect(Collectors.toList());
goodsSpecDTO.setProductSpecList(mallProductSpecList);
}
return list; return list;
} }
...@@ -595,6 +614,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService { ...@@ -595,6 +614,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
/** /**
* 根据商品id,商品规格id查询并填充相关信息 * 根据商品id,商品规格id查询并填充相关信息
*
* @param param * @param param
* @return * @return
*/ */
......
...@@ -6,7 +6,7 @@ spring: ...@@ -6,7 +6,7 @@ spring:
username: tmj username: tmj
password: MMC@2022&MYSQL password: MMC@2022&MYSQL
redis: redis:
database: 3 database: 1
host: redis.default host: redis.default
port: 6379 port: 6379
password: MMC@2022&REDIS password: MMC@2022&REDIS
......
...@@ -6,7 +6,7 @@ spring: ...@@ -6,7 +6,7 @@ spring:
username: tmj username: tmj
password: MMC@2022&MYSQL password: MMC@2022&MYSQL
redis: redis:
database: 3 database: 1
host: redis.default host: redis.default
port: 6379 port: 6379
password: MMC@2022&REDIS password: MMC@2022&REDIS
......
...@@ -440,4 +440,17 @@ ...@@ -440,4 +440,17 @@
AND im.img_type = 0 AND im.img_type = 0
WHERE gi.category_by_one = #{id} WHERE gi.category_by_one = #{id}
</select> </select>
<select id="getMallProSkuInfoSpec" resultType="com.mmc.pms.entity.MallProdSkuInfoSpecDO">
SELECT mp.id,
mp.mall_prod_info_id,
mp.product_spec_id,
ps.part_no,
ps.spec_image,
ps.spec_name,
ps.version_desc
FROM mall_prod_info_spec mp
INNER JOIN product_spec ps ON mp.product_spec_id = ps.id
WHERE mp.goods_info_id = #{id}
AND mp.is_deleted = 0
</select>
</mapper> </mapper>
...@@ -6,4 +6,4 @@ data-filter: ...@@ -6,4 +6,4 @@ data-filter:
- /pms/doc.html - /pms/doc.html
- /pms/swagger-resources/** - /pms/swagger-resources/**
- /pms/webjars/** - /pms/webjars/**
- /pms/product/spec/feignGetUnitPriceByTag - /pms/product/spec/feignGetSpecLeaseUnitPrice
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论