数据概览导出+优化

This commit is contained in:
ywh 2024-08-18 17:36:57 +08:00
parent 4b136acc80
commit 322bdab810
3 changed files with 36 additions and 20 deletions

View File

@ -64,29 +64,17 @@ public class BusStoreDayHistoryInfoController extends BaseController
public TableDataInfo list1(String account, String expStartTime, String expEndTime) public TableDataInfo list1(String account, String expStartTime, String expEndTime)
{ {
// startPage(); // startPage();
TableDataInfo list = busStoreDayHistoryInfoService.selectBusStoreDayHistoryInfoList1(true,account, expStartTime,expEndTime); // TableDataInfo list = busStoreDayHistoryInfoService.selectBusStoreDayHistoryInfoList1(true,account, expStartTime,expEndTime);
TableDataInfo list = busStoreDayHistoryInfoService.selectBusStoreDayHistoryInfoListNew(true,account, expStartTime,expEndTime);
return list; return list;
} }
@Resource
private BusAgentInfoMapper agentInfoMapper;
@PostMapping("/exportDataOverview") @PostMapping("/exportDataOverview")
public void exportDataOverview(HttpServletResponse response,String account, String expStartTime, String expEndTime) throws Exception{ public void exportDataOverview(HttpServletResponse response,String account, String expStartTime, String expEndTime) throws Exception{
Map<String,Object> sql = new HashMap<>();
if(StringUtils.isNotBlank(account)){ TableDataInfo tdi = busStoreDayHistoryInfoService.selectBusStoreDayHistoryInfoListNew(false,account, expStartTime,expEndTime);
sql.put("account",account); List<BusOverviewInfo> datas = (List<BusOverviewInfo>) tdi.getRows();
}
if(StringUtils.isNotBlank(expStartTime)){
sql.put("expStartTime",expStartTime);
}
if(StringUtils.isNotBlank(expEndTime)){
sql.put("expEndTime",expEndTime);
}
// TableDataInfo tdi = busStoreDayHistoryInfoService.selectBusStoreDayHistoryInfoList1(false,account, expStartTime,expEndTime);
// List<BusOverviewInfo> datas = (List<BusOverviewInfo>) tdi.getRows();
List<BusOverviewInfo> datas = agentInfoMapper.selectDaataOverview(sql);
ExcelUtil<BusOverviewInfo> util = new ExcelUtil<>(BusOverviewInfo.class); ExcelUtil<BusOverviewInfo> util = new ExcelUtil<>(BusOverviewInfo.class);
util.exportExcel(response, datas, "数据概览统计数据"); util.exportExcel(response, datas, "数据概览统计数据");
} }

View File

@ -31,6 +31,7 @@ public interface IBusStoreDayHistoryInfoService
*/ */
public List<BusStoreExcelInfo> selectBusStoreDayHistoryInfoList(BusStoreExcelInfo busStoreExcelInfo); public List<BusStoreExcelInfo> selectBusStoreDayHistoryInfoList(BusStoreExcelInfo busStoreExcelInfo);
public TableDataInfo selectBusStoreDayHistoryInfoList1(boolean isPage,String account, String expStartTime, String expEndTime); public TableDataInfo selectBusStoreDayHistoryInfoList1(boolean isPage,String account, String expStartTime, String expEndTime);
public TableDataInfo selectBusStoreDayHistoryInfoListNew(boolean isPage,String account, String expStartTime, String expEndTime);
/** /**
* 新增店铺单日信息 * 新增店铺单日信息

View File

@ -20,9 +20,7 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -76,6 +74,33 @@ public class BusStoreDayHistoryInfoServiceImpl implements IBusStoreDayHistoryInf
return busStoreDayHistoryInfoMapper.selectBusStoreDayHistoryInfoList(busStoreExcelInfo); return busStoreDayHistoryInfoMapper.selectBusStoreDayHistoryInfoList(busStoreExcelInfo);
} }
@Override
public TableDataInfo selectBusStoreDayHistoryInfoListNew(boolean isPage,String account, String expStartTime, String expEndTime) {
Map<String,Object> sql = new HashMap<>();
if(org.apache.commons.lang3.StringUtils.isNotBlank(account)){
sql.put("account",account);
}
if(org.apache.commons.lang3.StringUtils.isNotBlank(expStartTime)){
sql.put("expStartTime",expStartTime);
}
if(org.apache.commons.lang3.StringUtils.isNotBlank(expEndTime)){
sql.put("expEndTime",expEndTime);
}
if(isPage){
PageUtils.startPage();
}
List<BusOverviewInfo> datas = agentInfoMapper.selectDaataOverview(sql);
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(HttpStatus.SUCCESS);
rspData.setMsg("查询成功");
rspData.setRows(datas);
rspData.setTotal(new PageInfo(datas).getTotal());
return rspData;
}
@Override @Override
public TableDataInfo selectBusStoreDayHistoryInfoList1(boolean isPage,String account, String expStartTime, String expEndTime) { public TableDataInfo selectBusStoreDayHistoryInfoList1(boolean isPage,String account, String expStartTime, String expEndTime) {
if(isPage){ if(isPage){
@ -161,6 +186,8 @@ public class BusStoreDayHistoryInfoServiceImpl implements IBusStoreDayHistoryInf
return rspData; return rspData;
} }
/** /**
* 新增店铺单日信息 * 新增店铺单日信息
* *