|
@@ -3,6 +3,7 @@ package com.diagbot.facade;
|
|
import com.diagbot.client.UserServiceClient;
|
|
import com.diagbot.client.UserServiceClient;
|
|
import com.diagbot.dto.AuthDetailDTO;
|
|
import com.diagbot.dto.AuthDetailDTO;
|
|
import com.diagbot.dto.ProductAuthProgressDTO;
|
|
import com.diagbot.dto.ProductAuthProgressDTO;
|
|
|
|
+import com.diagbot.dto.ProductOrderExportDTO;
|
|
import com.diagbot.dto.RespDTO;
|
|
import com.diagbot.dto.RespDTO;
|
|
import com.diagbot.dto.UserOrgDTO;
|
|
import com.diagbot.dto.UserOrgDTO;
|
|
import com.diagbot.dto.WaitExamOrderCouDTO;
|
|
import com.diagbot.dto.WaitExamOrderCouDTO;
|
|
@@ -19,14 +20,18 @@ import com.diagbot.idc.VisibleIdCreater;
|
|
import com.diagbot.service.impl.ProductOrderServiceImpl;
|
|
import com.diagbot.service.impl.ProductOrderServiceImpl;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.DateUtil;
|
|
import com.diagbot.util.DateUtil;
|
|
|
|
+import com.diagbot.util.ExportBeanExcelUtil;
|
|
|
|
+import com.diagbot.util.GsonUtil;
|
|
import com.diagbot.util.UserUtils;
|
|
import com.diagbot.util.UserUtils;
|
|
import com.diagbot.vo.AddOrderVO;
|
|
import com.diagbot.vo.AddOrderVO;
|
|
|
|
+import com.diagbot.vo.ProductOrderExportVO;
|
|
import com.diagbot.vo.ProductOrderVO;
|
|
import com.diagbot.vo.ProductOrderVO;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -243,6 +248,57 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
|
|
}
|
|
}
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public RespDTO export(ProductOrderExportVO productOrderExportVO){
|
|
|
|
+ ProductOrderVO productOrderVO =new ProductOrderVO();
|
|
|
|
+ productOrderVO.setSize(999999999999999999L);
|
|
|
|
+ Map<String, Object> userMap = new HashMap<String, Object>();
|
|
|
|
+ userMap.put("startTime", productOrderExportVO.getStartTime());
|
|
|
|
+ userMap.put("endTime", productOrderExportVO.getEndTime());
|
|
|
|
+ RespDTO<List<ProductOrderWrapper>> datas = this.selectAllProductOrder(productOrderVO);
|
|
|
|
+ GsonUtil.toJson(datas.data);
|
|
|
|
+ List<String> listName = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ listName.add("订单id");
|
|
|
|
+ listName.add("申请时间");
|
|
|
|
+ listName.add("订单号");
|
|
|
|
+ listName.add("申请机构");
|
|
|
|
+ listName.add("申请人");
|
|
|
|
+ listName.add("手机号");
|
|
|
|
+ listName.add("邮箱");
|
|
|
|
+ listName.add("审核状态");
|
|
|
|
+
|
|
|
|
+ List<String> listId = new ArrayList<>();
|
|
|
|
+ listId.add("id");//订单ID
|
|
|
|
+ listId.add("time");//申请时间
|
|
|
|
+ listId.add("num");// 订单号
|
|
|
|
+ listId.add("orgName");//申请机构
|
|
|
|
+ listId.add("linKman");// 申请人
|
|
|
|
+ listId.add("userName");//手机号
|
|
|
|
+ listId.add("email");//邮箱
|
|
|
|
+ listId.add("auditStatus");//审核状态
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ List<ProductOrderExportDTO> list = new ArrayList<>();
|
|
|
|
+ for (int i = 0; i < datas.data.size(); i++) {
|
|
|
|
+ ProductOrderWrapper userInfo = datas.data.get(i);
|
|
|
|
+ list.add(new ProductOrderExportDTO(String.valueOf(userInfo.getId()),
|
|
|
|
+ DateUtil.formatDate(userInfo.getTime()),
|
|
|
|
+ userInfo.getNum(),
|
|
|
|
+ userInfo.getOrgName(),
|
|
|
|
+ userInfo.getLinkman(),
|
|
|
|
+ userInfo.getUsername(),
|
|
|
|
+ userInfo.getEmail(),
|
|
|
|
+ String.valueOf(userInfo.getAuditStatus())));
|
|
|
|
+ }
|
|
|
|
+ //response.setContentType("text/html;charset=UTF-8");
|
|
|
|
+ String filePath = productOrderExportVO.getFilePath();//文件路径
|
|
|
|
+ String fileName = productOrderExportVO.getFileName();//文件名
|
|
|
|
+ ExportBeanExcelUtil ex = new ExportBeanExcelUtil();
|
|
|
|
+ RespDTO resul = ex.exportExcel("测试POI导出EXCEL文档", listName, listId, list, filePath, fileName);
|
|
|
|
+
|
|
|
|
+ return resul;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|