|
@@ -20,6 +20,9 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.Set;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -45,7 +48,7 @@ public class DownloadOrderServiceImpl extends ServiceImpl<IDownloadOrderMapper,
|
|
@Override
|
|
@Override
|
|
public PageInfo pageList(OrderParam param) {
|
|
public PageInfo pageList(OrderParam param) {
|
|
CacheUtil.orderParam = param;
|
|
CacheUtil.orderParam = param;
|
|
- Page<DownOrderVo> page = this.getBaseMapper().pageList(new Page<>(param.getPageNum(),param.getPageSize()),param);
|
|
|
|
|
|
+ Page<DownOrderVo> page = this.pageListByParam(param);
|
|
for (DownOrderVo record : page.getRecords()) {
|
|
for (DownOrderVo record : page.getRecords()) {
|
|
record.setCreateTime(record.getTradeTime());
|
|
record.setCreateTime(record.getTradeTime());
|
|
if(StringUtils.isNotBlank(record.getSceneNum())){
|
|
if(StringUtils.isNotBlank(record.getSceneNum())){
|
|
@@ -72,11 +75,25 @@ public class DownloadOrderServiceImpl extends ServiceImpl<IDownloadOrderMapper,
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ public Page<DownOrderVo> pageListByParam(OrderParam orderParam) {
|
|
|
|
+ Page<DownOrderVo> page = this.getBaseMapper().pageList(new Page<>(orderParam.getPageNum(), orderParam.getPageSize()), orderParam);
|
|
|
|
+ Set<String> numList = page.getRecords().stream().map(DownOrderVo::getSceneNum).collect(Collectors.toSet());
|
|
|
|
+ HashMap<String,String> snCodeMap = sceneProService.getSnCodeByNumList(numList);
|
|
|
|
+
|
|
|
|
+ for (DownOrderVo record : page.getRecords()) {
|
|
|
|
+ if(StringUtils.isNotBlank(record.getSceneNum())){
|
|
|
|
+ record.setSnCode(snCodeMap.get(record.getSceneNum()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return page;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
public void export(HttpServletRequest req, HttpServletResponse resp) {
|
|
public void export(HttpServletRequest req, HttpServletResponse resp) {
|
|
OrderParam orderParam = CacheUtil.orderParam;
|
|
OrderParam orderParam = CacheUtil.orderParam;
|
|
orderParam.setPageNum(1);
|
|
orderParam.setPageNum(1);
|
|
orderParam.setPageSize(5000);
|
|
orderParam.setPageSize(5000);
|
|
- Page<DownOrderVo> page = this.getBaseMapper().pageList(new Page<>(orderParam.getPageNum(),orderParam.getPageSize()),orderParam);
|
|
|
|
|
|
+ Page<DownOrderVo> page = this.pageListByParam(orderParam);
|
|
|
|
|
|
ExcelWriter excelWriter = null;
|
|
ExcelWriter excelWriter = null;
|
|
try {
|
|
try {
|
|
@@ -84,7 +101,7 @@ public class DownloadOrderServiceImpl extends ServiceImpl<IDownloadOrderMapper,
|
|
excelService.commonExport(req,resp,"下载订单",page.getRecords(),excelWriter);
|
|
excelService.commonExport(req,resp,"下载订单",page.getRecords(),excelWriter);
|
|
while (page.hasNext()){
|
|
while (page.hasNext()){
|
|
orderParam.setPageNum(orderParam.getPageNum()+1);
|
|
orderParam.setPageNum(orderParam.getPageNum()+1);
|
|
- page = this.getBaseMapper().pageList(new Page<>(orderParam.getPageNum(),orderParam.getPageSize()),orderParam);
|
|
|
|
|
|
+ page = this.pageListByParam(orderParam);
|
|
if(page.getRecords().size() >0){
|
|
if(page.getRecords().size() >0){
|
|
excelService.commonExport(req,resp,"下载订单",page.getRecords(),excelWriter);
|
|
excelService.commonExport(req,resp,"下载订单",page.getRecords(),excelWriter);
|
|
}
|
|
}
|