基本数据管理-机床客户信息修改
This commit is contained in:
parent
6c28600ebc
commit
2a7db2bc89
@ -76,8 +76,8 @@ public class CustomerInfoController {
|
||||
public CommonResult<CustomerInfoRespVO> getCustomerInfo(@RequestParam("id") String id) {
|
||||
CustomerInfoDO customerInfo = customerInfoService.getCustomerInfo(id);
|
||||
CustomerInfoRespVO bean = BeanUtils.toBean(customerInfo, CustomerInfoRespVO.class);
|
||||
if (Objects.nonNull(bean.getDistrict())){
|
||||
Integer[] test = {bean.getProvinceCode(),bean.getCityCode(),bean.getDistrict()};
|
||||
if (Objects.nonNull(bean.getDistrict())) {
|
||||
Integer[] test = {bean.getProvinceCode(), bean.getCityCode(), bean.getDistrict()};
|
||||
bean.setDistrictArray(test);
|
||||
}
|
||||
return success(bean);
|
||||
@ -90,12 +90,12 @@ public class CustomerInfoController {
|
||||
PageResult<CustomerInfoDO> pageResult = customerInfoService.getCustomerInfoPage(pageReqVO);
|
||||
PageResult<CustomerInfoRespVO> bean = BeanUtils.toBean(pageResult, CustomerInfoRespVO.class);
|
||||
List<CustomerInfoRespVO> list = bean.getList();
|
||||
list.forEach(item->{
|
||||
if (Objects.nonNull(item.getDistrict())){
|
||||
list.forEach(item -> {
|
||||
if (Objects.nonNull(item.getDistrict())) {
|
||||
String districtName =
|
||||
AreaUtils.getArea(item.getProvinceCode()).getName() + "-" +
|
||||
AreaUtils.getArea(item.getCityCode()).getName() + "-" +
|
||||
AreaUtils.getArea(item.getDistrict()).getName();
|
||||
AreaUtils.getArea(item.getCityCode()).getName() + "-" +
|
||||
AreaUtils.getArea(item.getDistrict()).getName();
|
||||
item.setDistrictName(districtName);
|
||||
}
|
||||
});
|
||||
@ -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);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user