数据报表-销量 增加销售金额 退款金额

This commit is contained in:
2024-06-18 09:13:40 +08:00
parent 6c30aa2abd
commit d8b92aadf9
4 changed files with 93 additions and 54 deletions

View File

@@ -347,6 +347,9 @@ public class SummaryServiceImpl implements SummaryService {
@Override
public <T> Page<T> selectSummaryByDay(ShopSummaryDto summaryDto, Integer page, Integer size) {
Pageable pageable = PageRequest.of(page, size);
if(StringUtils.isBlank(summaryDto.getCateId())){
summaryDto.setCateId(null);
}
if (summaryDto.getType() != null && summaryDto.getType() == 1) {//金额
Long start = 1704038400000L;
Long end = Instant.now().toEpochMilli();
@@ -368,6 +371,9 @@ public class SummaryServiceImpl implements SummaryService {
@Override
public void download(ShopSummaryDto summaryDto, HttpServletResponse response) throws IOException {
List<Map<String, Object>> list = new ArrayList<>();
if(StringUtils.isBlank(summaryDto.getCateId())){
summaryDto.setCateId(null);
}
if (summaryDto.getType() != null && summaryDto.getType() == 1) {//金额
Long start = 1704038400000L;
Long end = Instant.now().toEpochMilli();
@@ -390,15 +396,17 @@ public class SummaryServiceImpl implements SummaryService {
summaryDto.setStartTime(DateUtil.toDate(DateUtil.fromTimeStamp(1704038400L)));
summaryDto.setEndTime(new Date());
}
List<TbOrderSalesCountByDayVo> tbOrderSalesCountByDayVos = detailRepository.queryTbOrderSalesCountByDay(Integer.valueOf(summaryDto.getShopId()), summaryDto.getStartTime(), summaryDto.getEndTime());
List<TbOrderSalesCountByDayVo> tbOrderSalesCountByDayVos = detailRepository.queryTbOrderSalesCountByDay(Integer.valueOf(summaryDto.getShopId()),summaryDto.getCateId(),summaryDto.getProName(), summaryDto.getStartTime(), summaryDto.getEndTime());
for (TbOrderSalesCountByDayVo all : tbOrderSalesCountByDayVos) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("商品名称", all.getProductName());
map.put("商品分类", all.getCateName());
map.put("商品名称", all.getProductName());
map.put("商品规格", StringUtils.isBlank(all.getProductSkuName()) ? "" : all.getProductSkuName());
map.put("销量", all.getSalesNum());
map.put(" ", all.getSalesNum());
map.put("退单量", all.getRefNum());
map.put("总量", all.getNum());
map.put("销售额", all.getSalesAmount());
map.put("退单额", all.getRefAmount());
map.put("总 量", all.getNum());
list.add(map);
}
}