|
@@ -23,6 +23,7 @@ import org.apache.poi.ss.usermodel.*;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.core.io.ClassPathResource;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -613,6 +614,102 @@ public class FeedbackOpinionController {
|
|
|
return downloadUrl;
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value="导出上报报表")
|
|
|
+ @RequestMapping(value = "reportListXlsSB",method = RequestMethod.POST)
|
|
|
+ public String reportListXlsSB(Date[] reportDate, @RequestAttribute String subject){
|
|
|
+ String downloadUrl = "";
|
|
|
+
|
|
|
+ try{
|
|
|
+ String xlsPath = "static/jzs_qzp_pjsjb.xls";
|
|
|
+ ClassPathResource resource = new ClassPathResource(xlsPath);
|
|
|
+ Workbook workbook = WorkbookFactory.create(resource.getInputStream());
|
|
|
+ Sheet sheet = workbook.getSheetAt(0);
|
|
|
+
|
|
|
+ //读取数据
|
|
|
+ Map<String,Object> searchParams = new HashMap<>();
|
|
|
+ searchParams.put("lv3",true);
|
|
|
+ if (reportDate.length > 0) {
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ Calendar calendar = new GregorianCalendar();
|
|
|
+ calendar.setTime(reportDate[1]);
|
|
|
+ calendar.add(calendar.DATE,1);
|
|
|
+
|
|
|
+ searchParams.put("reportDateStart",sdf.format(reportDate[0]));
|
|
|
+ searchParams.put("reportDateEnd",sdf.format(calendar.getTime()));
|
|
|
+ }
|
|
|
+
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("create_time","asc"));
|
|
|
+
|
|
|
+ Page<FeedbackOpinion> page = feedbackOpinionService.pageSearch(searchParams,1,100000,false,sortList);
|
|
|
+
|
|
|
+ //写入数据
|
|
|
+ for(int i=0; i<page.getResult().size(); i++){
|
|
|
+ FeedbackOpinion feedbackOpinion = page.getResult().get(i);
|
|
|
+
|
|
|
+ Row row = sheet.createRow(i+2);
|
|
|
+ row.createCell(0).setCellValue(feedbackOpinion.getId());
|
|
|
+// row.createCell(1).setCellValue(1);
|
|
|
+ if(StringUtils.isNotEmpty(feedbackOpinion.getAreaId())) {
|
|
|
+ Area area = areaService.get(feedbackOpinion.getAreaId());
|
|
|
+ row.createCell(2).setCellValue(area.getName());
|
|
|
+ }
|
|
|
+ row.createCell(3).setCellValue("5");
|
|
|
+// row.createCell(4).setCellValue(4);
|
|
|
+ row.createCell(5).setCellValue(feedbackOpinion.getStationName());
|
|
|
+ row.createCell(6).setCellValue(feedbackOpinion.getConnect());
|
|
|
+ row.createCell(7).setCellValue(feedbackOpinion.getConnectPhone());
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ row.createCell(8).setCellValue(sdf.format(feedbackOpinion.getCreateTime()));
|
|
|
+ if(feedbackOpinion.getIsSatisfied()){
|
|
|
+ row.createCell(9).setCellValue("4");
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ row.createCell(9).setCellValue("2");
|
|
|
+ }
|
|
|
+// row.createCell(10).setCellValue(10);
|
|
|
+// row.createCell(11).setCellValue(11);
|
|
|
+// row.createCell(12).setCellValue(12);
|
|
|
+// row.createCell(13).setCellValue(13);
|
|
|
+ row.createCell(14).setCellValue(feedbackOpinion.getContent());
|
|
|
+ if(feedbackOpinion.getConfirmStatus() == 2){
|
|
|
+ row.createCell(15).setCellValue("0");
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ row.createCell(15).setCellValue("1");
|
|
|
+ }
|
|
|
+ if(feedbackOpinion.getOpinionStatus()){
|
|
|
+ row.createCell(16).setCellValue("1");
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ row.createCell(16).setCellValue("0");
|
|
|
+ }
|
|
|
+// row.createCell(17).setCellValue(17);
|
|
|
+ if(StringUtils.isNotEmpty(feedbackOpinion.getContentAttachment())) {
|
|
|
+ row.createCell(18).setCellValue(feedbackOpinion.getContentAttachment());
|
|
|
+ }
|
|
|
+ if(feedbackOpinion.getUpdateTime() != null) {
|
|
|
+ row.createCell(19).setCellValue(sdf.format(feedbackOpinion.getUpdateTime()));
|
|
|
+ row.createCell(20).setCellValue(sdf.format(feedbackOpinion.getUpdateTime()));
|
|
|
+ }
|
|
|
+ row.createCell(21).setCellValue("I");
|
|
|
+ }
|
|
|
+
|
|
|
+ ByteArrayOutputStream output = new ByteArrayOutputStream();
|
|
|
+ workbook.write(output);
|
|
|
+ byte[] buffer = output.toByteArray();
|
|
|
+ ByteArrayInputStream input = new ByteArrayInputStream(buffer);
|
|
|
+
|
|
|
+ String fileName = "荆州市双优督办反馈报表.xls";
|
|
|
+ downloadUrl = OSSUtil.upload(ossConfig,"InsuranceReport",fileName,input);
|
|
|
+ }
|
|
|
+ catch (Exception ex){
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
+ }
|
|
|
+
|
|
|
+ return downloadUrl;
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value="列表")
|
|
|
@RequestMapping(value = "pageListStatistics",method = RequestMethod.POST)
|
|
|
public MessageResult<List> pageListStatistics(String areaId, String workStation, String isSatisfied, Date[] reportDate){
|