|
|
@ -31,10 +31,12 @@ import com.epmet.modules.partymember.excel.IcPartymemberStyleExcel; |
|
|
|
import com.epmet.modules.partymember.service.IcPartymemberStyleService; |
|
|
|
import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleDTO; |
|
|
|
import com.epmet.resi.partymember.dto.partymember.form.PartyMemberStyleFormDTO; |
|
|
|
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.Map; |
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
@ -84,9 +86,11 @@ public class IcPartymemberStyleController { |
|
|
|
|
|
|
|
@PostMapping("export") |
|
|
|
public void export(@RequestBody PartyMemberStyleFormDTO formDTO, HttpServletResponse response) throws Exception { |
|
|
|
List<IcPartymemberStyleDTO> list = icPartymemberStyleService.search(formDTO).getList(); |
|
|
|
List<IcPartymemberStyleDTO> list = icPartymemberStyleService.list(formDTO); |
|
|
|
List<IcPartymemberStyleExcel> result = new ArrayList<>(); |
|
|
|
AtomicInteger i = new AtomicInteger(NumConstant.ONE); |
|
|
|
List<IcPartymemberStyleExcel> result = list.stream().map(item -> { |
|
|
|
if (CollectionUtils.isNotEmpty(list)) { |
|
|
|
result = list.stream().map(item -> { |
|
|
|
IcPartymemberStyleExcel excel = new IcPartymemberStyleExcel(); |
|
|
|
excel.setIndex(i.getAndIncrement()); |
|
|
|
excel.setGridName(item.getGridName()); |
|
|
@ -94,7 +98,8 @@ public class IcPartymemberStyleController { |
|
|
|
excel.setMainDeed(item.getMainDeed()); |
|
|
|
return excel; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
ExcelUtils.exportExcelToTarget(response, null, list, IcPartymemberStyleExcel.class); |
|
|
|
} |
|
|
|
ExcelUtils.exportExcelToTarget(response, null, result, IcPartymemberStyleExcel.class); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("list") |
|
|
|