基本数据管理-机床客户信息修改

This commit is contained in:
xusd 2024-08-28 16:55:13 +08:00
parent 6c28600ebc
commit 2a7db2bc89

View File

@ -111,9 +111,18 @@ public class CustomerInfoController {
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<CustomerInfoDO> list = customerInfoService.getCustomerInfoPage(pageReqVO).getList();
List<CustomerInfoRespVO> bean = BeanUtils.toBean(list, CustomerInfoRespVO.class);
bean.forEach(item -> {
if (Objects.nonNull(item.getDistrict())) {
String districtName =
AreaUtils.getArea(item.getProvinceCode()).getName() + "-" +
AreaUtils.getArea(item.getCityCode()).getName() + "-" +
AreaUtils.getArea(item.getDistrict()).getName();
item.setDistrictName(districtName);
}
});
// 导出 Excel
ExcelUtils.write(response, "机床客户信息.xls", "数据", CustomerInfoRespVO.class,
BeanUtils.toBean(list, CustomerInfoRespVO.class));
ExcelUtils.write(response, "机床客户信息.xls", "数据", CustomerInfoRespVO.class, bean);
}
}