|
|
|
@ -3,14 +3,18 @@ package com.biutag.supervision.controller.mobileSupervision; |
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.alibaba.excel.EasyExcel; |
|
|
|
import com.alibaba.excel.EasyExcel; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
|
|
|
import com.biutag.supervision.mapper.SamplingMapper; |
|
|
|
import com.biutag.supervision.pojo.Result; |
|
|
|
import com.biutag.supervision.pojo.Result; |
|
|
|
import com.biutag.supervision.pojo.dto.SamplingPoliceDto; |
|
|
|
import com.biutag.supervision.pojo.dto.SamplingPoliceDto; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.entity.SupPolice; |
|
|
|
import com.biutag.supervision.pojo.param.SamplingQueryParam; |
|
|
|
import com.biutag.supervision.pojo.param.SamplingQueryParam; |
|
|
|
import com.biutag.supervision.pojo.vo.DataPetitionComplaintExportGabxfVo; |
|
|
|
import com.biutag.supervision.pojo.vo.DataPetitionComplaintExportGabxfVo; |
|
|
|
import com.biutag.supervision.pojo.vo.PoliceVo; |
|
|
|
import com.biutag.supervision.pojo.vo.PoliceVo; |
|
|
|
import com.biutag.supervision.pojo.vo.SamplingVo; |
|
|
|
import com.biutag.supervision.pojo.vo.SamplingVo; |
|
|
|
import com.biutag.supervision.service.SamplingService; |
|
|
|
import com.biutag.supervision.service.SamplingService; |
|
|
|
|
|
|
|
import com.biutag.supervision.service.SupPoliceService; |
|
|
|
import jakarta.servlet.http.HttpServletResponse; |
|
|
|
import jakarta.servlet.http.HttpServletResponse; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
@ -27,6 +31,9 @@ public class SamplingController { |
|
|
|
|
|
|
|
|
|
|
|
private final SamplingService samplingService; |
|
|
|
private final SamplingService samplingService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final SupPoliceService policeService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final SamplingMapper samplingMapper; |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 分页查询 |
|
|
|
* 分页查询 |
|
|
|
* */ |
|
|
|
* */ |
|
|
|
@ -85,13 +92,8 @@ public class SamplingController { |
|
|
|
if(StrUtil.isNotBlank(vo.getOrgStr())){ |
|
|
|
if(StrUtil.isNotBlank(vo.getOrgStr())){ |
|
|
|
vo.setOrgIds(List.of(vo.getOrgStr().split(","))); |
|
|
|
vo.setOrgIds(List.of(vo.getOrgStr().split(","))); |
|
|
|
} |
|
|
|
} |
|
|
|
List<PoliceVo> data = samplingService.getSamplingPolice(vo); |
|
|
|
List<SamplingPoliceDto> list = samplingMapper.selectPoliceByIdCode(vo); |
|
|
|
List<SamplingPoliceDto> list = data.stream().map(item -> { |
|
|
|
String excelName ="人员抽检名单"; |
|
|
|
SamplingPoliceDto exportGabVo = new SamplingPoliceDto(); |
|
|
|
|
|
|
|
BeanUtil.copyProperties(item, exportGabVo); |
|
|
|
|
|
|
|
return exportGabVo; |
|
|
|
|
|
|
|
}).toList(); |
|
|
|
|
|
|
|
String excelName = StrUtil.isNotBlank( vo.getSamplingName())?vo.getSamplingName():"人员抽检规则"; |
|
|
|
|
|
|
|
String headerValue = "attachment; filename=\"" + URLEncoder.encode(excelName+".xlsx", "UTF-8") + "\""; |
|
|
|
String headerValue = "attachment; filename=\"" + URLEncoder.encode(excelName+".xlsx", "UTF-8") + "\""; |
|
|
|
response.setHeader("Content-Disposition", headerValue); |
|
|
|
response.setHeader("Content-Disposition", headerValue); |
|
|
|
response.setContentType("application/octet-stream"); |
|
|
|
response.setContentType("application/octet-stream"); |
|
|
|
|