提交 7d38f4c1 作者: zhenjie

商品信息查询相关接口

上级 97194407
......@@ -56,42 +56,36 @@ public class BackstageGoodsManageController {
return goodsInfoService.getSkuUnit();
}
@ApiOperation(value = "根据购物车信息填充未知信息")
@ApiIgnore
@ApiOperation(value = "feign根据购物车信息填充未知信息", hidden = true)
@PostMapping("fillGoodsInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallGoodsShopCarDTO.class)})
public List<MallGoodsShopCarDTO> fillGoodsInfo(@RequestBody List<MallGoodsShopCarDTO> param) {
return goodsInfoService.fillGoodsInfo(param);
}
@ApiOperation(value = "根据渠道等级和产品规格id获取对应价格")
@ApiIgnore
@ApiOperation(value = "feign根据渠道等级和产品规格id获取对应价格", hidden = true)
@PostMapping("feignListProductSpecPrice")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public List<MallProductSpecPriceDTO> feignListProductSpecPrice(@RequestBody ProductSpecPriceQO productSpecPriceQO) {
return goodsInfoService.feignListProductSpecPrice(productSpecPriceQO);
}
@ApiOperation(value = "feign根据渠道等级获取单价信息")
@ApiOperation(value = "feign根据渠道等级获取单价信息", hidden = true)
@GetMapping("feignGetUnitPriceByTag")
@ApiIgnore
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ProductSpecPriceDTO.class)})
public ProductSpecPriceDTO feignGetUnitPriceByTag(@RequestParam(value = "specId") Integer specId,
@RequestParam(value = "tagId") Integer tagId) {
return goodsInfoService.feignGetUnitPriceByTag(specId, tagId);
}
@ApiOperation(value = "根据商品的产品规格id查询商品信息")
@ApiIgnore
@ApiOperation(value = "feign根据商品的产品规格id查询商品信息", hidden = true)
@PostMapping("feignListProdGoodsSkuInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = OrderGoodsProdDTO.class)})
public List<OrderGoodsProdDTO> feignListProdGoodsSkuInfo(@RequestBody MallOrderGoodsInfoQO mallOrderGoodsInfoQO) {
return goodsInfoService.feignListProdGoodsSkuInfo(mallOrderGoodsInfoQO);
}
@ApiOperation(value = "根据商品的行业规格id查询商品清单信息")
@ApiIgnore
@ApiOperation(value = "feign根据商品的行业规格id查询商品清单信息", hidden = true)
@PostMapping("feignListIndstGoodsSkuInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = OrderGoodsProdDTO.class)})
public List<OrderGoodsIndstDTO> feignListIndstGoodsSkuInfo(@RequestBody MallOrderGoodsInfoQO mallOrderGoodsInfoQO) {
......
......@@ -96,5 +96,5 @@ public interface IndustrySpecDao {
List<MallIndustrySkuInfoSpecDO> getIndustrySkuInfoSpec(Integer goodsInfoId);
List<IndustrySpecPriceDO> listIndustrySpecPrice(Integer channelClass, List<Integer> industrySpecIds);
List<IndustrySpecPriceDO> listIndustrySpecPrice(Integer tagInfoId, List<Integer> industrySpecIds);
}
......@@ -23,7 +23,7 @@ public class MallGoodsInfoSimpleDO implements Serializable {
@ApiModelProperty(value = "商品id")
private Integer id;
@ApiModelProperty(value = "商品所属类型")
private Integer sortTypeId;
private Integer directoryId;
@ApiModelProperty(value = "商品编号")
private String goodsNo;
@ApiModelProperty(value = "商品名称")
......@@ -38,7 +38,7 @@ public class MallGoodsInfoSimpleDO implements Serializable {
private List<MallGoodsSpecSimpleDO> mallGoodsSpecSimpleDOS;
public OrderGoodsIndstDTO buildOrderGoodsIndstDTO() {
return OrderGoodsIndstDTO.builder().goodsInfoId(this.id).goodsName(this.goodsName).sortTypeId(this.sortTypeId).goodsNo(this.goodsNo).mainImg(this.mainImg).valid(this.deleted.equals(0) && this.shelfStatus.equals(1) ? true : false)
return OrderGoodsIndstDTO.builder().goodsInfoId(this.id).goodsName(this.goodsName).directoryId(this.directoryId).goodsNo(this.goodsNo).mainImg(this.mainImg).valid(this.deleted.equals(0) && this.shelfStatus.equals(1) ? true : false)
.orderGoodsIndstDetailDTOS(mallGoodsSpecSimpleDOS == null ? null : this.mallGoodsSpecSimpleDOS.stream().map(d -> d.buildOrderGoodsIndstDetailDTO()).collect(Collectors.toList())).build();
}
}
......@@ -18,6 +18,6 @@ import java.util.List;
public class MallGoodsSpecInfoDO implements Serializable {
private static final long serialVersionUID = -7264365143820916901L;
private Integer id;
private Integer sortTypeId;
private Integer directoryId;
private List<SkuSpecDO> skuSpecDOList;
}
......@@ -21,7 +21,7 @@ import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.csf.mall.dto.MallGoodsShopCarDTO", description = "小程序购物车列表DTO")
//@ApiModel(value = "com.mmc.csf.mall.dto.MallGoodsShopCarDTO", description = "小程序购物车列表DTO")
public class MallGoodsShopCarDTO implements Serializable {
private static final long serialVersionUID = 766856809957374985L;
@ApiModelProperty("id")
......
......@@ -19,7 +19,7 @@ import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.csf.mall.dto.MallSkuInfoSpecDTO", description = "商品规格DTO")
//@ApiModel(value = "com.mmc.csf.mall.dto.MallSkuInfoSpecDTO", description = "商品规格DTO")
public class MallSkuInfoSpecDTO implements Serializable {
private static final long serialVersionUID = 4214771967767248990L;
@ApiModelProperty("id")
......
......@@ -33,7 +33,7 @@ public class OrderGoodsIndstDTO implements Serializable {
@ApiModelProperty(value = "商品id")
private Integer goodsInfoId;
@ApiModelProperty(value = "商品所属类型id")
private Integer sortTypeId;
private Integer directoryId;
@ApiModelProperty(value = "商品所有规格金额")
private BigDecimal goodsAmount;
@ApiModelProperty(value = "商品编号")
......
......@@ -33,7 +33,7 @@ public class OrderGoodsProdDTO implements Serializable {
@ApiModelProperty(value = "商品id")
private Integer goodsInfoId;
@ApiModelProperty(value = "商品所属类型")
private Integer sortTypeId;
private Integer directoryId;
@ApiModelProperty(value = "全部sku金额")
private BigDecimal goodsAmount;
@ApiModelProperty(value = "商品编号")
......
......@@ -18,11 +18,11 @@ import java.util.Set;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.csf.mall.qo.MallOrderGoodsInfoQO", description = "订单查询商品信息QO")
//@ApiModel(value = "com.mmc.csf.mall.qo.MallOrderGoodsInfoQO", description = "订单查询商品信息QO")
public class MallOrderGoodsInfoQO implements Serializable {
private static final long serialVersionUID = -3807569067697485137L;
private Integer mallUserId;
private Integer channelClass;
private Integer cooperationTagId;
private Set<Integer> mallProdSkuSpecIds;
private Set<Integer> mallIndstSkuSpecIds;
}
......@@ -17,7 +17,7 @@ import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "com.mmc.csf.model.qo.ProductSpecPriceQO", description = "无人机城产品规格价格QO")
//@ApiModel(value = "com.mmc.csf.model.qo.ProductSpecPriceQO", description = "无人机城产品规格价格QO")
public class ProductSpecPriceQO implements Serializable {
private static final long serialVersionUID = 8086345532713123505L;
@ApiModelProperty("用户id")
......
......@@ -590,6 +590,11 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
return ResultBody.success(list);
}
/**
* 根据商品id,商品规格id查询并填充相关信息
* @param param
* @return
*/
@Override
public List<MallGoodsShopCarDTO> fillGoodsInfo(List<MallGoodsShopCarDTO> param) {
Set<Integer> goodsIds = new HashSet<>();
......@@ -640,7 +645,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
for (MallGoodsSpecInfoDO mallGoodsSpecInfoDO : goodsSpecInfoDOList) {
//找到对应商品
if (mallGoodsShopCarDTO.getGoodsInfoId().toString().equals(mallGoodsSpecInfoDO.getId().toString())
&& mallGoodsShopCarDTO.getDirectoryId().toString().equals(mallGoodsSpecInfoDO.getSortTypeId().toString())) {
&& mallGoodsShopCarDTO.getDirectoryId().toString().equals(mallGoodsSpecInfoDO.getDirectoryId().toString())) {
for (SkuSpecDO skuSpecDO : mallGoodsSpecInfoDO.getSkuSpecDOList()) {
for (MallSkuInfoSpecDTO mallSkuInfoSpecDTO : mallGoodsShopCarDTO.getSkuList()) {
//根据对应规格进行填充
......@@ -702,7 +707,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
public List<OrderGoodsProdDTO> feignListProdGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO) {
//查询渠道等级对应的商品价格
Set<Integer> prodSkuSpecIds = productDao.listProductSpecIds(mallOrderGoodsInfoQO.getMallProdSkuSpecIds());
List<ProductSpecPriceDO> productSpecPriceDOS = productDao.listProductSpecPrice(mallOrderGoodsInfoQO.getChannelClass(), prodSkuSpecIds);
List<ProductSpecPriceDO> productSpecPriceDOS = productDao.listProductSpecPrice(mallOrderGoodsInfoQO.getCooperationTagId(), prodSkuSpecIds);
//查询商品信息
List<OrderGoodsProdDTO> orderGoodsProdDTOList = productDao.listProdGoodsSkuInfo(mallOrderGoodsInfoQO);
if (!CollectionUtils.isEmpty(productSpecPriceDOS)) {
......@@ -763,7 +768,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
List<MallGoodsInfoSimpleDO> mallGoodsInfoSimpleDOS = goodsInfoDao.listMallGoodsIndstSimpleInfo(mallOrderGoodsInfoQO.getMallIndstSkuSpecIds());
List<Integer> industrySpecIds = goodsInfoDao.listIndustrySpecIds(mallOrderGoodsInfoQO.getMallIndstSkuSpecIds());
//查询商品价格
List<IndustrySpecPriceDO> industrySpecPriceDOS = industrySpecDao.listIndustrySpecPrice(mallOrderGoodsInfoQO.getChannelClass(), industrySpecIds);
List<IndustrySpecPriceDO> industrySpecPriceDOS = industrySpecDao.listIndustrySpecPrice(mallOrderGoodsInfoQO.getCooperationTagId(), industrySpecIds);
//查询商品行业规格对应的产品清单
List<MallGoodsProductDO> mallGoodsProductDOS = goodsInfoDao.listIndustryProductList(industrySpecIds);
//配置商品行业规格价格
......
......@@ -283,7 +283,19 @@
</foreach>
and is_deleted = 0
</select>
<select id="listProdSpecInfo" resultType="com.mmc.pms.entity.MallGoodsSpecInfoDO">
<resultMap id="specInfoResultMap" type="com.mmc.pms.entity.MallGoodsSpecInfoDO">
<id property="id" column="id"/>
<result property="directoryId" column="directory_id"/>
<collection property="skuSpecDOList" ofType="com.mmc.pms.entity.SkuSpecDO">
<result property="id" column="mallSkuInfoSpecId"/>
<result property="specName" column="spec_name"/>
<result property="skuSpecDeleted" column="sku_spec_deleted"/>
<result property="specDeleted" column="spec_deleted"/>
</collection>
</resultMap>
<select id="listProdSpecInfo" resultMap="specInfoResultMap" parameterType="java.util.Set">
SELECT
gi.id, gi.directory_id, mpsip.id as mallSkuInfoSpecId, mpsip.is_deleted as sku_spec_deleted, ps.spec_name,
ps.is_deleted as spec_deleted
......@@ -302,7 +314,7 @@
)
</where>
</select>
<select id="listIndstSpecInfo" resultType="com.mmc.pms.entity.MallGoodsSpecInfoDO">
<select id="listIndstSpecInfo" resultMap="specInfoResultMap" parameterType="java.util.Set">
SELECT
gi.id, gi.directory_id, misis.id as mallSkuInfoSpecId, misis.is_deleted as sku_spec_deleted, ins.spec_name,
ins.is_deleted as spec_deleted
......@@ -333,7 +345,28 @@
</foreach>
</where>
</select>
<select id="listMallGoodsIndstSimpleInfo" resultType="com.mmc.pms.entity.MallGoodsInfoSimpleDO">
<resultMap id="mallGoodsInfoSimpleResultMap" type="com.mmc.pms.entity.MallGoodsInfoSimpleDO">
<id property="id" column="id"/>
<result property="goodsName" column="goods_name"/>
<result property="goodsNo" column="goods_no"/>
<result property="directoryId" column="directory_id"/>
<result property="mainImg" column="img_url"/>
<result property="shelfStatus" column="shelf_status"/>
<result property="deleted" column="is_deleted"/>
<collection property="mallGoodsSpecSimpleDOS" ofType="com.mmc.pms.entity.MallGoodsSpecSimpleDO">
<result property="mallIndustrySkuInfoSpecId" column="mall_industry_sku_info_spec_id"/>
<result property="unitName" column="unit_name"/>
<result property="industrySpecId" column="industry_spec_id"/>
<result property="specName" column="spec_name"/>
<result property="specImage" column="spec_image"/>
<result property="skuInfoDeleted" column="sku_info_deleted"/>
<result property="skuSpecDeleted" column="sku_spec_deleted"/>
<result property="specDeleted" column="spec_deleted"/>
</collection>
</resultMap>
<select id="listMallGoodsIndstSimpleInfo" resultMap="mallGoodsInfoSimpleResultMap" parameterType="java.util.Set">
SELECT
gi.id,
gi.goods_name,
......
......@@ -399,7 +399,36 @@
</foreach>
)
</select>
<select id="listProdGoodsSkuInfo" resultType="com.mmc.pms.model.dto.OrderGoodsProdDTO">
<resultMap id="listProdGoodsSkuInfoResultMap" type="com.mmc.pms.model.dto.OrderGoodsProdDTO">
<result property="goodsInfoId" column="goods_info_id"/>
<result property="directoryId" column="directory_id"/>
<result property="mainImg" column="mainImg"/>
<result property="goodsNo" column="goods_no"/>
<result property="goodsName" column="goods_name"/>
<result property="shelfStatus" column="shelf_status"/>
<result property="deleted" column="is_deleted"/>
<collection property="orderGoodsProdDetailDTOS" ofType="com.mmc.pms.model.dto.OrderGoodsProdDetailDTO">
<result property="mallProdSkuInfoId" column="mall_prod_sku_info_id"/>
<result property="unitName" column="unit_name"/>
<result property="mallProdSkuInfoSpecId" column="mall_prod_sku_info_spec_id"/>
<result property="productSpecId" column="product_spec_id"/>
<result property="specName" column="spec_name"/>
<result property="prodSkuSpecImage" column="prod_sku_spec_image"/>
<result property="partNo" column="part_no"/>
<result property="versionDesc" column="version_desc"/>
<result property="goodsTypeName" column="goods_type_name"/>
<result property="productName" column="product_name"/>
<result property="model" column="model"/>
<result property="productBrand" column="product_brand"/>
<result property="brandInfoId" column="brand_info_id"/>
<result property="skuInfoDeleted" column="sku_info_deleted"/>
<result property="skuSpecDeleted" column="sku_spec_deleted"/>
<result property="specDeleted" column="spec_deleted"/>
</collection>
</resultMap>
<select id="listProdGoodsSkuInfo" resultMap="listProdGoodsSkuInfoResultMap" parameterType="com.mmc.pms.model.qo.MallOrderGoodsInfoQO">
SELECT
gi.id as goods_info_id,gi.goods_name,gi.goods_no,gi.directory_id,
gimg.img_url as mainImg,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论