Browse Source

1.商家端组合捆绑模块商品列表获取异常修复、售价区间显示异常修复、库存显示异常修复 2.商家端组合捆绑选择商品新增所属店铺显示业务

multiwx
dy-hu 10 months ago
parent
commit
376b477284
  1. 14
      cereshop-business/src/main/java/com/shop/cereshop/business/service/compose/impl/CereShopComposeServiceImpl.java
  2. 6
      cereshop-business/src/main/resources/mybatis/mapper/compose/CereShopComposeDAO.xml

14
cereshop-business/src/main/java/com/shop/cereshop/business/service/compose/impl/CereShopComposeServiceImpl.java

@ -5,6 +5,7 @@
*/
package com.shop.cereshop.business.service.compose.impl;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.shop.cereshop.business.dao.compose.CereShopComposeDAO;
@ -22,6 +23,7 @@ import com.shop.cereshop.business.service.platformtool.CerePlatformSeckillServic
import com.shop.cereshop.business.service.product.CereProductMemberService;
import com.shop.cereshop.business.service.product.CereProductSkuService;
import com.shop.cereshop.business.service.redis.CereRedisKeyServcice;
import com.shop.cereshop.business.service.shop.CerePlatformShopService;
import com.shop.cereshop.business.service.tool.CereShopDiscountService;
import com.shop.cereshop.business.service.tool.CereShopSeckillService;
import com.shop.cereshop.commons.constant.CoReturnFormat;
@ -30,6 +32,7 @@ import com.shop.cereshop.commons.constant.StringEnum;
import com.shop.cereshop.commons.domain.business.CerePlatformBusinessUser;
import com.shop.cereshop.commons.domain.common.Page;
import com.shop.cereshop.commons.domain.product.CereProductMember;
import com.shop.cereshop.commons.domain.shop.CerePlatformShop;
import com.shop.cereshop.commons.domain.tool.CereComposeProduct;
import com.shop.cereshop.commons.domain.tool.CereShopCompose;
import com.shop.cereshop.commons.exception.CoBusinessException;
@ -83,6 +86,9 @@ public class CereShopComposeServiceImpl implements CereShopComposeService {
@Autowired
private CereProductSkuService cereProductSkuService;
@Autowired
private CerePlatformShopService platformShopService;
@Override
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class})
public void save(ComposeSaveParam param, CerePlatformBusinessUser user) throws CoBusinessException, Exception {
@ -382,6 +388,14 @@ public class CereShopComposeServiceImpl implements CereShopComposeService {
Map<Long, BigDecimal> finalMinMap = minMap;
Map<Long, BigDecimal> finalMaxMap = maxMap;
list.forEach((shopProduct -> {
try {
CerePlatformShop platformShop = platformShopService.getById(shopProduct.getShopId());
if (ObjectUtils.isNotEmpty(platformShop)) {
shopProduct.setShopName(platformShop.getShopName());
}
} catch (CoBusinessException e) {
e.printStackTrace();
}
if(!EmptyUtils.isEmpty(shopProduct.getSkuImage())){
//规格配图了,取规格图片展示
shopProduct.setProductImage(shopProduct.getSkuImage());

6
cereshop-business/src/main/resources/mybatis/mapper/compose/CereShopComposeDAO.xml

@ -197,20 +197,20 @@
</select>
<select id="selectProduct" parameterType="com.shop.cereshop.business.param.product.ProductGetAllParam" resultType="com.shop.cereshop.business.page.product.ShopProduct">
SELECT a.product_id,b.product_image,a.product_name,c.price,c.original_price,c.image sku_image,
SELECT a.product_id,b.product_image,a.product_name,a.shop_id, c.price,c.original_price,c.image sku_image,
c.stock_number,a.shelve_state,concat('¥',c.price,'~¥',g.price) section,a.create_time from cere_shop_product a
LEFT JOIN (SELECT a.product_id,a.product_image from cere_product_image a,
cere_shop_product b where a.product_id=b.product_id GROUP BY a.product_id) b ON a.product_id=b.product_id
LEFT JOIN (SELECT a.product_id,a.sku_id,MIN(a.price) price,MIN(a.original_price) original_price,
SUM(a.stock_number) stock_number,c.image
from cere_product_sku a,cere_shop_product b,cere_sku_name c where
a.product_id=b.product_id and a.sku_id=c.sku_id and b.shop_id=#{shopId} GROUP BY a.product_id) c ON a.product_id=c.product_id
a.product_id=b.product_id and a.sku_id=c.sku_id and b.shop_id in (select shop_id from cere_platform_shop where business_id = #{shopId}) GROUP BY a.product_id) c ON a.product_id=c.product_id
LEFT JOIN cere_shop_group d ON a.shop_id=d.shop_id
LEFT JOIN cere_product_classify e ON a.classify_id=e.classify_id
LEFT JOIN (SELECT a.product_id,a.sku_id,MAX(a.price) price
from cere_product_sku a,cere_shop_product b where
a.product_id=b.product_id GROUP BY a.product_id) g ON a.product_id=g.product_id
where a.shop_id=#{shopId} and a.shelve_state=1
where a.shop_id in (select shop_id from cere_platform_shop where business_id = #{shopId}) and a.shelve_state=1
<if test="search!=null and search!=''">
and a.product_name like concat('%',#{search},'%')
</if>

Loading…
Cancel
Save