|
|
|
@ -425,6 +425,7 @@ public class SaleServiceImpl extends ServiceImpl<SaleMapper, Sale> implements Sa |
|
|
|
// 先拿到该客户购买的所有商品信息
|
|
|
|
final Page<CustomerBuyProductLogVo> page = new Page<>(salePageQuery.getPageNum(), salePageQuery.getPageSize()); |
|
|
|
final String userId = salePageQuery.getUserId(); |
|
|
|
final String createBy = salePageQuery.getCreateBy(); |
|
|
|
final Page<CustomerBuyProductLogVo> salePage = saleMapper.getCustomerBuyProductLog(page, salePageQuery); |
|
|
|
final List<CustomerBuyProductLogVo> records = salePage.getRecords(); |
|
|
|
final List<String> productIds = new ArrayList<>(); |
|
|
|
@ -437,8 +438,8 @@ public class SaleServiceImpl extends ServiceImpl<SaleMapper, Sale> implements Sa |
|
|
|
if(StringUtils.isNotEmpty(userId)){ |
|
|
|
customerBuySaleVoList = saleMapper.getByUserId(userId); |
|
|
|
} |
|
|
|
if(StringUtils.isNotEmpty(salePageQuery.getCreateBy())){ |
|
|
|
customerBuySaleVoList = saleMapper.getByCreUserId(salePageQuery.getCreateBy()); |
|
|
|
if(StringUtils.isNotEmpty(createBy)){ |
|
|
|
customerBuySaleVoList = saleMapper.getByCreUserId(createBy); |
|
|
|
} |
|
|
|
final Map<String, CustomerBuySaleVo> customerBuySaleVoMap = new HashMap<>(); |
|
|
|
for (CustomerBuySaleVo customerBuySaleVo : customerBuySaleVoList) { |
|
|
|
@ -446,7 +447,7 @@ public class SaleServiceImpl extends ServiceImpl<SaleMapper, Sale> implements Sa |
|
|
|
} |
|
|
|
if (!productIds.isEmpty()) { |
|
|
|
// 获取商品各规格售卖的数量
|
|
|
|
final List<CustomerBuyProductDetailLogVo> customerBuyProductDetailLogVos = saleMapper.getCustomerBuyProductLogDetailLog(userId, salePageQuery.getShopId(), productIds, salePageQuery.getStartDate(), salePageQuery.getEndDate()); |
|
|
|
final List<CustomerBuyProductDetailLogVo> customerBuyProductDetailLogVos = saleMapper.getCustomerBuyProductLogDetailLog(userId,createBy, salePageQuery.getShopId(), productIds, salePageQuery.getStartDate(), salePageQuery.getEndDate()); |
|
|
|
|
|
|
|
// 进行数据封装Map<商品id,Map<销售单id,商品明细>>
|
|
|
|
final Map<String, Map<String, List<CustomerBuyProductDetailLogVo>>> allMap = new HashMap<>(); |
|
|
|
|