From 3178a9ec86e1d295254eb69ad45918004b7bef7d Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 24 Nov 2021 14:17:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A4=BE=E4=BC=9A=E7=BB=84=E7=BB=87=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E7=A8=8B=E5=BA=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/SocietyOrgListResultDTO.java | 2 ++ .../controller/IcSocietyOrgController.java | 1 + .../com/epmet/excel/IcSocietyOrgExcel.java | 27 +++++------------ .../service/impl/IcSocietyOrgServiceImpl.java | 29 +++++++++++++------ 4 files changed, 31 insertions(+), 28 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java index 277238e78d..1650882b84 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java @@ -31,6 +31,8 @@ public class SocietyOrgListResultDTO implements Serializable { //所属组织Id private String agencyId; + //所属组织名称 + private String agencyName; //社会组织Id private String societyId; //社会组织名称 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java index c514dd870e..f8e8ef5405 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java @@ -131,6 +131,7 @@ public class IcSocietyOrgController { public void export(@LoginUser TokenDto tokenDto, @RequestBody GetListSocietyOrgFormDTO formDTO, HttpServletResponse response) throws Exception { formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setIsPage(false); GetListSocietyOrgResultDTO list = societyOrgService.getList(formDTO); ExcelUtils.exportExcelToTarget(response, null, list.getList(), IcSocietyOrgExcel.class); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java index bfcebe6e8d..35fff240d9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java @@ -19,6 +19,7 @@ package com.epmet.excel; import cn.afterturn.easypoi.excel.annotation.Excel; import com.epmet.commons.tools.utils.ExcelVerifyInfo; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import org.hibernate.validator.constraints.Length; @@ -35,17 +36,9 @@ import java.util.Date; @Data public class IcSocietyOrgExcel extends ExcelVerifyInfo implements Serializable { - @Excel(name = "唯一标识") - private String id; - - @Excel(name = "客户Id") - private String customerId; - - @Excel(name = "组织Id") - private String agencyId; - - @Excel(name = "agency_id的所有上级") - private String pids; + @Excel(name = "组织名称") + @NotBlank(message = "不能为空") + private String agencyName; @Excel(name = "社会组织名称") @NotBlank(message = "不能为空") @@ -69,14 +62,14 @@ public class IcSocietyOrgExcel extends ExcelVerifyInfo implements Serializable { @Excel(name = "起始服务时间") @NotBlank(message = "不能为空") - private Date serviceStartTime; + private String serviceStartTime; @Excel(name = "终止服务时间") @NotBlank(message = "不能为空") - private Date serviceEndTime; + private String serviceEndTime; - @Excel(name = "绑定管理员[组织下录入的工作人员]") - private String adminStaffId; + @Excel(name = "管理员姓名") + private String adminStaffName; @Excel(name = "地址") private String address; @@ -87,8 +80,4 @@ public class IcSocietyOrgExcel extends ExcelVerifyInfo implements Serializable { @Excel(name = "维度") private String latitude; - @Excel(name = "备注") - private String remarks; - - } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java index ff8f95e7dd..1c6822e1c2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java @@ -26,18 +26,14 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcSocietyOrgDao; -import com.epmet.dto.form.AddSocietyOrgFormDTO; -import com.epmet.dto.form.EditSocietyOrgFormDTO; -import com.epmet.dto.form.GetListSocietyOrgFormDTO; -import com.epmet.dto.form.UserIdsFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.form.demand.ServiceQueryFormDTO; -import com.epmet.dto.result.GetListSocietyOrgResultDTO; -import com.epmet.dto.result.SocietyOrgListResultDTO; -import com.epmet.dto.result.StaffSinGridResultDTO; +import com.epmet.dto.result.*; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcSocietyOrgEntity; import com.epmet.excel.IcSocietyOrgExcel; import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.IcSocietyOrgService; import com.epmet.service.IcUserDemandRecService; import com.github.pagehelper.PageHelper; @@ -68,6 +64,8 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl result = - PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getList(formDTO)); + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getList(formDTO)); if (CollectionUtils.isEmpty(result.getList())) { return resultDTO; } resultDTO.setTotal((int) result.getTotal()); + //2.查询被绑定管理员信息 UserIdsFormDTO dto = new UserIdsFormDTO(); List staffIdList = result.getList().stream().map(SocietyOrgListResultDTO::getAdminStaffId).collect(Collectors.toList()); @@ -135,8 +134,20 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl listResult.getData().stream().filter(u -> r.getAdminStaffId().equals(u.getStaffId())).forEach(u -> r.setAdminStaffName(u.getStaffName()))); - resultDTO.setList(result.getList()); + //3.查询被绑定管理员信息 + OrgInfoFormDTO org = new OrgInfoFormDTO(); + List orgIds = result.getList().stream().map(SocietyOrgListResultDTO::getAgencyId).collect(Collectors.toList()); + orgIds = orgIds.stream().distinct().collect(Collectors.toList()); + org.setOrgIds(orgIds); + org.setOrgType("agency"); + Result> orgResult = govOrgOpenFeignClient.selectOrgInfo(org); + if (!orgResult.success()) { + throw new RenException("获取组织基础信息失败......"); + } + result.getList().forEach(r -> orgResult.getData().stream().filter(u -> r.getAgencyId().equals(u.getOrgId())).forEach(u -> r.setAgencyName(u.getOrgName()))); + + resultDTO.setList(result.getList()); return resultDTO; }