提交 79840611 作者: xiaowang

商品排序、分类排序、规格回显

上级 7db47e88
...@@ -112,4 +112,6 @@ public interface GoodsInfoDao { ...@@ -112,4 +112,6 @@ public interface GoodsInfoDao {
int countGoodsInfoByCategoryId(Integer id); int countGoodsInfoByCategoryId(Integer id);
void updateMallProdSkuInfo(MallProdInfoDO mallProdInfoDO); void updateMallProdSkuInfo(MallProdInfoDO mallProdInfoDO);
List<MallProdInfoDO> getAllMallProSkuInfo(Integer goodsInfoId);
} }
...@@ -718,7 +718,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService { ...@@ -718,7 +718,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
private List<GoodsSpecDTO> getProductSpecInfo( private List<GoodsSpecDTO> getProductSpecInfo(
Integer goodsInfoId, Integer type, Integer leaseTerm) { Integer goodsInfoId, Integer type, Integer leaseTerm) {
// 获取商品对应绑定sku的信息 // 获取商品对应绑定sku的信息
List<MallProdInfoDO> mallProdSkuInfoList = goodsInfoDao.getMallProSkuInfo(goodsInfoId); List<MallProdInfoDO> mallProdSkuInfoList = goodsInfoDao.getAllMallProSkuInfo(goodsInfoId);
List<GoodsSpecDTO> list = List<GoodsSpecDTO> list =
mallProdSkuInfoList.stream() mallProdSkuInfoList.stream()
.map(MallProdInfoDO::buildGoodsSpecDTO) .map(MallProdInfoDO::buildGoodsSpecDTO)
......
...@@ -186,10 +186,10 @@ public class WebDeviceServiceImpl implements WebDeviceService { ...@@ -186,10 +186,10 @@ public class WebDeviceServiceImpl implements WebDeviceService {
} }
int pageNo = param.getPageNo(); int pageNo = param.getPageNo();
param.buildCurrentPage(); param.buildCurrentPage();
if (StringUtils.isBlank(request.getHeader(TokenConstant.TOKEN))) {
List<GoodsInfo> list = webDeviceDao.listWareInfoPage(param, userIds, param.getType()); List<GoodsInfo> list = webDeviceDao.listWareInfoPage(param, userIds, param.getType());
List<LeaseGoodsInfoDTO> pageList = List<LeaseGoodsInfoDTO> pageList =
list.stream().map(GoodsInfo::buildLeaseGoodsInfoDTO).collect(Collectors.toList()); list.stream().map(GoodsInfo::buildLeaseGoodsInfoDTO).collect(Collectors.toList());
if (StringUtils.isBlank(request.getHeader(TokenConstant.TOKEN))) {
return ResultBody.success(PageResult.buildPage(pageNo, param.getPageSize(), count, pageList)); return ResultBody.success(PageResult.buildPage(pageNo, param.getPageSize(), count, pageList));
} }
...@@ -198,9 +198,6 @@ public class WebDeviceServiceImpl implements WebDeviceService { ...@@ -198,9 +198,6 @@ public class WebDeviceServiceImpl implements WebDeviceService {
if (userAccountSimpleDTO == null) { if (userAccountSimpleDTO == null) {
return ResultBody.error(ResultEnum.INTERNAL_SERVER_ERROR); return ResultBody.error(ResultEnum.INTERNAL_SERVER_ERROR);
} }
List<GoodsInfo> list = webDeviceDao.listWareInfoPage(param, userIds, param.getType());
List<LeaseGoodsInfoDTO> pageList =
list.stream().map(GoodsInfo::buildLeaseGoodsInfoDTO).collect(Collectors.toList());
if (userAccountSimpleDTO.getCooperationTagId() == null) { if (userAccountSimpleDTO.getCooperationTagId() == null) {
return ResultBody.success(PageResult.buildPage(pageNo, param.getPageSize(), count, pageList)); return ResultBody.success(PageResult.buildPage(pageNo, param.getPageSize(), count, pageList));
} }
......
...@@ -226,7 +226,6 @@ ...@@ -226,7 +226,6 @@
INNER JOIN product ps ON ps.id = mi.product_id INNER JOIN product ps ON ps.id = mi.product_id
WHERE mi.goods_info_id = #{id} WHERE mi.goods_info_id = #{id}
AND mi.is_deleted = 0 AND mi.is_deleted = 0
and flag = 0
</select> </select>
<select id="getMallIndustrySkuInfo" resultType="com.mmc.pms.entity.MallIndustrySkuInfoDO"> <select id="getMallIndustrySkuInfo" resultType="com.mmc.pms.entity.MallIndustrySkuInfoDO">
SELECT mi.id, SELECT mi.id,
...@@ -597,4 +596,26 @@ ...@@ -597,4 +596,26 @@
OR gi.category_by_two = #{id}) OR gi.category_by_two = #{id})
AND gi.is_deleted = 0 AND gi.is_deleted = 0
</select> </select>
<select id="getAllMallProSkuInfo" resultType="com.mmc.pms.entity.MallProdInfoDO">
SELECT mi.id,
mi.goods_info_id,
mi.product_id prodSkuId,
mi.prod_spec_name prodSkuSpecName,
mi.categories_id categoriesId,
mi.choose_type chooseType,
mi.sku_unit_id skuUnitId,
mi.is_must must,
mi.flag flag,
mi.create_time createTime,
c.name typeName,
su.id skuUnitId,
su.unit_name unitName,
ps.product_name productSkuName
FROM mall_prod_info mi
INNER JOIN categories c ON c.id = mi.categories_id
INNER JOIN sku_unit su ON mi.sku_unit_id = su.id
INNER JOIN product ps ON ps.id = mi.product_id
WHERE mi.goods_info_id = #{id}
AND mi.is_deleted = 0
</select>
</mapper> </mapper>
...@@ -194,7 +194,7 @@ ...@@ -194,7 +194,7 @@
</foreach> </foreach>
</if> </if>
</where> </where>
order by gi.create_time DESC order by gi.create_time asc
limit #{param.pageNo},#{param.pageSize} limit #{param.pageNo},#{param.pageSize}
</select> </select>
<select id="getWareInfoById" resultMap="wareInfoResultMap" parameterType="java.lang.Integer"> <select id="getWareInfoById" resultMap="wareInfoResultMap" parameterType="java.lang.Integer">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论