|
|
@ -5,6 +5,7 @@ |
|
|
|
*/ |
|
|
|
package com.shop.cereshop.business.service.tool.impl; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.shop.cereshop.business.dao.tool.CereShopDiscountDAO; |
|
|
@ -17,6 +18,7 @@ import com.shop.cereshop.business.service.order.CereShopOrderService; |
|
|
|
import com.shop.cereshop.business.service.platformtool.CerePlatformDiscountService; |
|
|
|
import com.shop.cereshop.business.service.platformtool.CerePlatformSeckillService; |
|
|
|
import com.shop.cereshop.business.service.redis.CereRedisKeyServcice; |
|
|
|
import com.shop.cereshop.business.service.shop.CerePlatformShopService; |
|
|
|
import com.shop.cereshop.business.service.tool.CereShopDiscountDetailService; |
|
|
|
import com.shop.cereshop.business.service.tool.CereShopDiscountService; |
|
|
|
import com.shop.cereshop.commons.constant.CoReturnFormat; |
|
|
@ -26,6 +28,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.order.CereShopOrder; |
|
|
|
import com.shop.cereshop.commons.domain.shop.CerePlatformShop; |
|
|
|
import com.shop.cereshop.commons.domain.tool.CereShopDiscount; |
|
|
|
import com.shop.cereshop.commons.domain.tool.CereShopDiscountDetail; |
|
|
|
import com.shop.cereshop.commons.exception.CoBusinessException; |
|
|
@ -73,6 +76,9 @@ public class CereShopDiscountServiceImpl implements CereShopDiscountService{ |
|
|
|
@Autowired |
|
|
|
private ProjectInvokeUtil projectInvokeUtil; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private CerePlatformShopService platformShopService; |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(isolation= Isolation.DEFAULT,propagation= Propagation.REQUIRED,rollbackFor = {CoBusinessException.class, Exception.class}) |
|
|
|
public void save(ShopDiscountSaveParam param, CerePlatformBusinessUser user) throws CoBusinessException,Exception { |
|
|
@ -389,9 +395,19 @@ public class CereShopDiscountServiceImpl implements CereShopDiscountService{ |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Page getProducts(ToolProductParam param) throws CoBusinessException { |
|
|
|
public Page getProducts(ToolProductNewParam param) throws CoBusinessException { |
|
|
|
PageHelper.startPage(param.getPage(),param.getPageSize()); |
|
|
|
List<ToolProduct> list=cereShopDiscountDAO.getProducts(param.getShopId(), param.getActivityId()); |
|
|
|
List<ToolProduct> list=cereShopDiscountDAO.getProducts(param.getBusinessId(), param.getActivityId(), param.getSearchContent()); |
|
|
|
for (ToolProduct toolProduct : list) { |
|
|
|
try { |
|
|
|
CerePlatformShop platformShop = platformShopService.getById(toolProduct.getShopId()); |
|
|
|
if (ObjectUtils.isNotEmpty(platformShop)){ |
|
|
|
toolProduct.setShopName(platformShop.getShopName()); |
|
|
|
} |
|
|
|
} catch (CoBusinessException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
PageInfo<ToolProduct> pageInfo=new PageInfo<>(list); |
|
|
|
Page page=new Page(pageInfo.getList(),pageInfo.getTotal()); |
|
|
|
return page; |
|
|
|