|
|
|
@@ -7,11 +7,13 @@ import com.iformall.domain.po.*; |
|
|
|
import com.iformall.enums.*; |
|
|
|
import com.iformall.mapper.*; |
|
|
|
import com.iformall.service.*; |
|
|
|
import org.apache.commons.collections.CollectionUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class WxCouponOrderReservationServiceImpl implements WxCouponOrderReservationService { |
|
|
|
@@ -39,15 +41,22 @@ public class WxCouponOrderReservationServiceImpl implements WxCouponOrderReserva |
|
|
|
@Autowired |
|
|
|
WxMerchantMapper wxMerchantMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxMerchantRelationService wxMerchantRelationService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageInfo<WxCouponOrderReservation> listAsPage(WxCouponOrderReservation record, Integer pageIndex, Integer pageSize) { |
|
|
|
if(record.getMerchantId() != null){ |
|
|
|
if(record.getReservationMerchantId() != null){ |
|
|
|
//区域商户查询下面所有子商户的信息 |
|
|
|
WxMerchant merchant = wxMerchantMapper.selectById(record.getMerchantId()); |
|
|
|
if(EnumMerchantAdmin.REGIONAL.getCode().equals(merchant.getIsAdmin())){ |
|
|
|
|
|
|
|
//通过区域商户id查询所有子商户 |
|
|
|
List<Long> collect = wxMerchantRelationService.getRelationByRegionId(merchant.getId()); |
|
|
|
if (!CollectionUtils.isEmpty(collect)){ |
|
|
|
record.setReservationMerchantIdList(collect); |
|
|
|
} |
|
|
|
record.setReservationMerchantId(null); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponOrderReservationMapper.findList(record)); |
|
|
|
} |
|
|
|
|