|
|
@ -33,10 +33,12 @@ import com.epmet.dto.form.demand.ServiceQueryFormDTO; |
|
|
|
import com.epmet.dto.result.demand.OptionDTO; |
|
|
|
import com.epmet.excel.IcPartyUnitExcel; |
|
|
|
import com.epmet.service.IcPartyUnitService; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
import java.util.stream.Collectors; |
|
|
@ -90,8 +92,10 @@ public class IcPartyUnitController { |
|
|
|
@GetMapping("export") |
|
|
|
public void export(@RequestBody PartyUnitFormDTO formDTO, HttpServletResponse response) throws Exception { |
|
|
|
List<IcPartyUnitDTO> list = icPartyUnitService.list(formDTO); |
|
|
|
List<IcPartyUnitExcel> excelList = new ArrayList<>(); |
|
|
|
AtomicInteger i = new AtomicInteger(0); |
|
|
|
List<IcPartyUnitExcel> excelList = list.stream().map(item -> { |
|
|
|
if (CollectionUtils.isNotEmpty(list)) { |
|
|
|
excelList = list.stream().map(item -> { |
|
|
|
IcPartyUnitExcel excel = new IcPartyUnitExcel(); |
|
|
|
excel.setIndex(i.getAndIncrement()); |
|
|
|
excel.setUnitName(item.getUnitName()); |
|
|
@ -101,10 +105,10 @@ public class IcPartyUnitController { |
|
|
|
excel.setMemberCount(item.getMemberCount()); |
|
|
|
excel.setRemark(item.getRemark()); |
|
|
|
excel.setSatisfaction(item.getSatisfaction()); |
|
|
|
excel.setServiceMatter(String.join(String.valueOf((char)10), item.getServiceMatterList())); |
|
|
|
excel.setServiceMatter(String.join(String.valueOf((char) 10), item.getServiceMatterList())); |
|
|
|
return excel; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
|
|
} |
|
|
|
ExcelUtils.exportExcelToTarget(response, null, excelList, IcPartyUnitExcel.class); |
|
|
|
} |
|
|
|
|
|
|
|