Browse Source

导出暂存

master
lichao 2 years ago
parent
commit
21b5a171fa
  1. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerMicroGridController.java
  2. 62
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerMicroGridExcel.java
  3. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerMicroGridService.java
  4. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerMicroGridServiceImpl.java

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerMicroGridController.java

@ -74,9 +74,9 @@ public class CustomerMicroGridController {
return new Result(); return new Result();
} }
@GetMapping("export") @PostMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { public void export(@RequestBody CustomerMicroGridPageFormDTO dto, HttpServletResponse response) throws Exception {
List<CustomerMicroGridDTO> list = customerMicroGridService.list(params); List<CustomerMicroGridPageResultDTO> list = customerMicroGridService.exportList(dto);
ExcelUtils.exportExcelToTarget(response, null, list, CustomerMicroGridExcel.class); ExcelUtils.exportExcelToTarget(response, null, list, CustomerMicroGridExcel.class);
} }

62
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerMicroGridExcel.java

@ -14,11 +14,11 @@ import java.util.Date;
@Data @Data
public class CustomerMicroGridExcel { public class CustomerMicroGridExcel {
@Excel(name = "ID 唯一标识") @Excel(name = "所属社区")
private String id; private String communityName;
@Excel(name = "客户ID") @Excel(name = "所属网格")
private String customerId; private String gridName;
@Excel(name = "微网格名称") @Excel(name = "微网格名称")
private String microgridName; private String microgridName;
@ -26,59 +26,5 @@ public class CustomerMicroGridExcel {
@Excel(name = "微网格长") @Excel(name = "微网格长")
private String contacts; private String contacts;
@Excel(name = "性别(女性-0,男性-1)")
private String sex;
@Excel(name = "联系电话")
private String mobile;
@Excel(name = "地址")
private String address;
@Excel(name = "网格id")
private Integer gridId;
@Excel(name = "所属组织机构ID")
private String agencyId;
@Excel(name = "所有上级组织ID")
private String agencyPids;
@Excel(name = "当前网格总人数")
private Integer totalUser;
@Excel(name = "网格排序")
private Integer sort;
@Excel(name = "中心位置纬度")
private String latitude;
@Excel(name = "中心点位地址")
private String centerAddress;
@Excel(name = "坐标区域")
private String coordinates;
@Excel(name = "编码")
private String code;
@Excel(name = "删除标识:0.未删除 1.已删除")
private Integer delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新时间")
private Date updatedTime;
} }

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerMicroGridService.java

@ -78,4 +78,6 @@ public interface CustomerMicroGridService extends BaseService<CustomerMicroGridE
* @date 2023-11-07 * @date 2023-11-07
*/ */
void delete(String[] ids); void delete(String[] ids);
List<CustomerMicroGridPageResultDTO> exportList(CustomerMicroGridPageFormDTO dto);
} }

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerMicroGridServiceImpl.java

@ -102,4 +102,16 @@ public class CustomerMicroGridServiceImpl extends BaseServiceImpl<CustomerMicroG
baseDao.deleteBatchIds(Arrays.asList(ids)); baseDao.deleteBatchIds(Arrays.asList(ids));
} }
@Override
public List<CustomerMicroGridPageResultDTO> exportList(CustomerMicroGridPageFormDTO dto) {
// 获取所有的pids
if (StringUtils.isNotBlank(dto.getAgencyId())){
CustomerAgencyEntity customerAgencyEntity = customerAgencyDao.selectById(dto.getAgencyId());
dto.setAgencyPids(customerAgencyEntity.getPids().concat(":").concat(dto.getAgencyId()));
}
List<CustomerMicroGridPageResultDTO> entityList = baseDao.selectPageList(dto);
return entityList;
}
} }
Loading…
Cancel
Save