|
|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.biutag.supervision.controller.data; |
|
|
|
package com.biutag.supervision.controller.data; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.io.FileUtil; |
|
|
|
import cn.hutool.core.io.FileUtil; |
|
|
|
import cn.hutool.core.util.IdUtil; |
|
|
|
import cn.hutool.core.util.IdUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
@ -23,11 +24,16 @@ import com.biutag.supervision.pojo.entity.NegativeTask; |
|
|
|
import com.biutag.supervision.pojo.entity.SupDepart; |
|
|
|
import com.biutag.supervision.pojo.entity.SupDepart; |
|
|
|
import com.biutag.supervision.pojo.model.UserAuth; |
|
|
|
import com.biutag.supervision.pojo.model.UserAuth; |
|
|
|
import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam; |
|
|
|
import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.param.NegativeQueryParam; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.vo.DataPetitionComplaintExportGabxfVo; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.vo.DataPetitionComplaintNegativeVo; |
|
|
|
import com.biutag.supervision.pojo.vo.DataPetitionComplaintVo; |
|
|
|
import com.biutag.supervision.pojo.vo.DataPetitionComplaintVo; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.vo.ExportGabxfVo; |
|
|
|
import com.biutag.supervision.service.DataPetitionComplaintService; |
|
|
|
import com.biutag.supervision.service.DataPetitionComplaintService; |
|
|
|
import com.biutag.supervision.service.NegativeTaskService; |
|
|
|
import com.biutag.supervision.service.NegativeTaskService; |
|
|
|
import com.biutag.supervision.service.SupDepartService; |
|
|
|
import com.biutag.supervision.service.SupDepartService; |
|
|
|
import dm.jdbc.util.StringUtil; |
|
|
|
import dm.jdbc.util.StringUtil; |
|
|
|
|
|
|
|
import jakarta.servlet.http.HttpServletResponse; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
@ -36,11 +42,13 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
|
|
|
|
import java.net.URLEncoder; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @author wxc |
|
|
|
* @author wxc |
|
|
|
@ -113,7 +121,7 @@ public class DataPetitionComplaintController { |
|
|
|
excelReader.close(); |
|
|
|
excelReader.close(); |
|
|
|
return Result.success(list); |
|
|
|
return Result.success(list); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//集访、领导名字数据补充
|
|
|
|
@PostMapping("gab/replenish") |
|
|
|
@PostMapping("gab/replenish") |
|
|
|
public Result replenishExcel(@RequestPart("file") MultipartFile file) throws IOException { |
|
|
|
public Result replenishExcel(@RequestPart("file") MultipartFile file) throws IOException { |
|
|
|
log.info("文件导入中------------------------------"); |
|
|
|
log.info("文件导入中------------------------------"); |
|
|
|
@ -148,7 +156,46 @@ public class DataPetitionComplaintController { |
|
|
|
}).sheet(0).headRowNumber(2).doRead(); |
|
|
|
}).sheet(0).headRowNumber(2).doRead(); |
|
|
|
return Result.success(); |
|
|
|
return Result.success(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//台帐导出
|
|
|
|
|
|
|
|
@GetMapping("export/xf/{petitionComplaintType}") |
|
|
|
|
|
|
|
public void exportByGabXf(@PathVariable String petitionComplaintType, DataPetitionComplaintQueryParam queryParam, HttpServletResponse response) throws IOException { |
|
|
|
|
|
|
|
log.info("数据导出==================>"); |
|
|
|
|
|
|
|
queryParam.setCurrent(1); |
|
|
|
|
|
|
|
queryParam.setSize(100000); |
|
|
|
|
|
|
|
Page<DataPetitionComplaintVo> page = dataPetitionComplaintService.page(queryParam); |
|
|
|
|
|
|
|
List<DataPetitionComplaintVo> records = page.getRecords(); |
|
|
|
|
|
|
|
AtomicInteger i = new AtomicInteger(1); |
|
|
|
|
|
|
|
List<ExportGabxfVo> list = records.stream().map(item -> { |
|
|
|
|
|
|
|
ExportGabxfVo exportGabxfVo = new ExportGabxfVo(); |
|
|
|
|
|
|
|
BeanUtil.copyProperties(item, exportGabxfVo); |
|
|
|
|
|
|
|
exportGabxfVo.setIndex(i.getAndIncrement()); |
|
|
|
|
|
|
|
if(StringUtil.isNotEmpty(item.getInitialPetition())){ |
|
|
|
|
|
|
|
exportGabxfVo.setInitialPetition((item.getInitialPetition().contains("1")||item.getInitialPetition().contains("初"))?"初访":"重访"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(item.getMassVisits()!=null){ |
|
|
|
|
|
|
|
exportGabxfVo.setMassVisits((item.getMassVisits())?"是":"否"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return exportGabxfVo; |
|
|
|
|
|
|
|
}).toList(); |
|
|
|
|
|
|
|
String name = null; |
|
|
|
|
|
|
|
switch (petitionComplaintType){ |
|
|
|
|
|
|
|
case "gabxf": |
|
|
|
|
|
|
|
name="公安部信访线索"; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "gjxf": |
|
|
|
|
|
|
|
name="国家信访投诉线索"; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case "xfts": |
|
|
|
|
|
|
|
name="信访投诉"; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String headerValue = "attachment; filename=\"" + URLEncoder.encode(name+".xlsx", "UTF-8") + "\""; |
|
|
|
|
|
|
|
response.setHeader("Content-Disposition", headerValue); |
|
|
|
|
|
|
|
response.setContentType("application/octet-stream"); |
|
|
|
|
|
|
|
EasyExcel.write(response.getOutputStream(), ExportGabxfVo.class).inMemory(Boolean.TRUE).sheet(name).doWrite(list); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|