|
|
@ -5,6 +5,7 @@ import com.alibaba.excel.EasyExcel; |
|
|
|
import com.alibaba.excel.ExcelWriter; |
|
|
|
import com.alibaba.excel.support.ExcelTypeEnum; |
|
|
|
import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder; |
|
|
|
import com.alibaba.excel.write.metadata.WriteSheet; |
|
|
|
import com.epmet.commons.tools.constant.ServiceConstant; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
@ -12,6 +13,7 @@ import com.epmet.commons.tools.feign.ResultDataResolver; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.EpmetRequestHolder; |
|
|
|
import com.epmet.commons.tools.utils.ExcelUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; |
|
|
|
import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; |
|
|
@ -215,7 +217,7 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void exportResisByPolicy(String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, |
|
|
|
String houseId, String idCard, String name, Integer pageNo, Integer pageSize, |
|
|
|
String houseId, String idCard, String name, |
|
|
|
String ruleId, List<ResisByPolicyRulesFormDTO.ResiRule> resiRule, |
|
|
|
List<ResisByPolicyRulesFormDTO.HouseRule> houseRule, |
|
|
|
List<ResisByPolicyRulesFormDTO.StatRule> statRule, |
|
|
@ -234,10 +236,19 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { |
|
|
|
statRule = ConvertUtils.sourceToTarget(ruleList.getStatRuleList(), ResisByPolicyRulesFormDTO.StatRule.class); |
|
|
|
} |
|
|
|
|
|
|
|
ServletOutputStream ostream = response.getOutputStream(); |
|
|
|
ExcelWriterSheetBuilder sheetBuilder = EasyExcel.write(ostream, ResisByPolicyExcel.class).sheet("居民列表"); |
|
|
|
// 模板导出
|
|
|
|
ExcelWriter writer = EasyExcel.write(ExcelUtils.getOutputStreamForExcel("政策人员预览信息导出.xlsx", response)) |
|
|
|
//.withTemplate(inputStream)
|
|
|
|
.build(); |
|
|
|
|
|
|
|
WriteSheet writeSheet = EasyExcel.writerSheet("政策人员列表") |
|
|
|
.head(ResiByPolicyInfoResultDTO.class) |
|
|
|
.build(); |
|
|
|
|
|
|
|
Integer pageSize = 500; |
|
|
|
Integer pageNo = 1; |
|
|
|
|
|
|
|
// 循环填充数据
|
|
|
|
try { |
|
|
|
do { |
|
|
|
PageData<ResiByPolicyInfoResultDTO> resis = this.listByPolicyRules(orgId, orgType, neighborHoodId, buildingId, unitId, |
|
|
|
houseId, idCard, name, pageNo, pageSize, resiRule, houseRule, statRule); |
|
|
@ -246,12 +257,13 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver { |
|
|
|
if (CollectionUtils.isEmpty(excelDatas)) { |
|
|
|
break; |
|
|
|
} |
|
|
|
//sheetBuilder.write(excelDatas);
|
|
|
|
} while (true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println(666); |
|
|
|
writer.write(resis.getList(), writeSheet); |
|
|
|
pageNo++; |
|
|
|
} while (true); |
|
|
|
} finally { |
|
|
|
writer.finish(); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|