diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzLeftPieChartResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzLeftPieChartResultDTO.java index 22ae365945..ad9a746ca6 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzLeftPieChartResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzLeftPieChartResultDTO.java @@ -37,10 +37,17 @@ public class ResiBuzzLeftPieChartResultDTO implements Serializable { */ private String color; + @JsonIgnore + private String issueId; + + @JsonIgnore + private Boolean status; + public ResiBuzzLeftPieChartResultDTO() { this.count = NumConstant.ZERO; this.categoryCode = ""; this.categoryName = ""; this.color = ""; + this.status = false; } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java index 4fb4664534..b3b6430af1 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java @@ -254,6 +254,26 @@ public interface IssueDao extends BaseDao { */ List resiBuzzLeftPieChart(@Param("orgId")String orgId,@Param("orgType")String orgType,@Param("length")Integer length,@Param("customerId")String customerId); + /** + * @Description + * @param length + * @author zxc + * @date 2021/12/30 9:18 上午 + */ + List resiBuzzLeftPieChartByIssueIds(@Param("length")Integer length,@Param("issueIds")List issueIds); + + List resiBuzzIssueCategoryByIssueIds(@Param("length")Integer length,@Param("issueIds")List issueIds); + List resiBuzzIssueCategoryNameByIssueIds(List categories,@Param("customerId")String customerId); + + /** + * @Description 查询前50名的议题ID + * @param orgId + * @param orgType + * @author zxc + * @date 2021/12/30 9:16 上午 + */ + List resiBuzzLeftPieChartIssueIds(@Param("orgId")String orgId,@Param("orgType")String orgType); + /** * @Description 查询组织下每个网格的项目数 * @param orgId @@ -270,4 +290,6 @@ public interface IssueDao extends BaseDao { */ List selectCategoryNameByIssueIds(@Param("issueIds")List issueIds); + List selectCategoryNameByIssueList(List issueIds,@Param("customerId")String customerId); + } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 3ff149d81d..5a1eaaeb1c 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -1605,7 +1605,22 @@ public class IssueServiceImpl extends BaseServiceImpl imp } List list = allList.stream().skip(formDTO.getPageSize() * (formDTO.getPageNo() - NumConstant.ONE)) .limit(formDTO.getPageSize()).collect(Collectors.toList()); - List names = baseDao.selectCategoryNameByIssueIds(allList.stream().map(m -> m.getIssueId()).collect(Collectors.toList())); + List categories = baseDao.resiBuzzIssueCategoryByIssueIds(length, list.stream().map(m -> m.getIssueId()).collect(Collectors.toList())); + List pieChat = getPieChat(list.stream().map(m -> m.getIssueId()).collect(Collectors.toList())); + Iterator listIterator = pieChat.iterator(); + while (listIterator.hasNext()){ + ResiBuzzLeftPieChartResultDTO next = listIterator.next(); + for (int i = 0; i < categories.size(); i++) { + if (next.getIssueId().equals(categories.get(i).getIssueId()) && !next.getStatus()){ + next.setStatus(true); + listIterator.remove(); + continue; + } + } + } + categories.addAll(pieChat); +// List names = baseDao.selectCategoryNameByIssueIds(allList.stream().map(m -> m.getIssueId()).collect(Collectors.toList())); + List names = baseDao.selectCategoryNameByIssueList(categories,tokenDto.getCustomerId()); if (CollectionUtils.isNotEmpty(names)){ list.forEach(l -> names.stream().filter(n -> l.getIssueId().equals(n.getIssueId())).forEach(n -> l.setCategoryName(n.getCn()))); } @@ -1651,13 +1666,43 @@ public class IssueServiceImpl extends BaseServiceImpl imp } // 分类编码长度 Integer length = baseDao.selectOneLevelCategoryLength(tokenDto.getCustomerId()); - List result = baseDao.resiBuzzLeftPieChart(formDTO.getOrgId(), formDTO.getOrgType(), length, tokenDto.getCustomerId()); - if(CollectionUtils.isEmpty(result)){ +// List result = baseDao.resiBuzzLeftPieChart(formDTO.getOrgId(), formDTO.getOrgType(), length, tokenDto.getCustomerId()); + List issueIds = baseDao.resiBuzzLeftPieChartIssueIds(formDTO.getOrgId(), formDTO.getOrgType()); + if(CollectionUtils.isEmpty(issueIds)){ + return new ArrayList<>(); + } + List categories = baseDao.resiBuzzIssueCategoryByIssueIds(length, issueIds); + List pieChat = getPieChat(issueIds); + Iterator list = pieChat.iterator(); + while (list.hasNext()){ + ResiBuzzLeftPieChartResultDTO next = list.next(); + for (int i = 0; i < categories.size(); i++) { + if (next.getIssueId().equals(categories.get(i).getIssueId()) && !next.getStatus()){ + next.setStatus(true); + list.remove(); + continue; + } + } + } + categories.addAll(pieChat); +// List result = baseDao.resiBuzzLeftPieChartByIssueIds(length, issueIds); + List result = baseDao.resiBuzzIssueCategoryNameByIssueIds(categories, tokenDto.getCustomerId()); + if (CollectionUtils.isEmpty(result)){ return new ArrayList<>(); } return result; } + public List getPieChat(List issueIds){ + List resultDTOS = new ArrayList<>(); + issueIds.forEach(i -> { + ResiBuzzLeftPieChartResultDTO dto = new ResiBuzzLeftPieChartResultDTO(); + dto.setIssueId(i); + resultDTOS.add(dto); + }); + return resultDTOS; + } + /** * @Description 查询组织下每个网格的项目数 * @param formDTO diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml index ecc7dd39f0..a65070fd4a 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml @@ -621,25 +621,25 @@ @@ -676,4 +676,79 @@ ) + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 64660eec85..2125390944 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -365,8 +365,8 @@ public class CustomerAgencyController { * @Date 2021/9/8 15:20 */ @PostMapping("agencygridtree") - public Result getOrgTreeData(@LoginUser TokenDto tokenDTO) { - //tokenDTO.setUserId("dffe71e021a61b900f9025f4f07f6955"); + public Result getOrgTreeData(/*@LoginUser*/ TokenDto tokenDTO) { + tokenDTO.setUserId("dffe71e021a61b900f9025f4f07f6955"); return new Result().ok(customerAgencyService.getOrgTreeData(tokenDTO.getUserId())); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index d1a49f7ba3..f379824aae 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -58,6 +58,7 @@ public interface CustomerAgencyDao extends BaseDao { * @Description 组织首页-下级机关列表 **/ List selectSubAgencyById(@Param("pId") String pId, @Param("agencyNum") Integer agencyNum); + List selectSubAgencyByAgencyId(@Param("pId") String pId); /** @@ -79,8 +80,8 @@ public interface CustomerAgencyDao extends BaseDao { CustomerAgencyEntity getAgencyByStaffId(@Param("staffId") String staffId); /** - * @Description 根据agencyId查询地区编码 * @param agencyId 所属机关id + * @Description 根据agencyId查询地区编码 * @author zxc * @date 2020/4/28 15:50 */ @@ -104,6 +105,7 @@ public interface CustomerAgencyDao extends BaseDao { /** * 查询客户根级组织 + * * @param customerId * @return */ @@ -111,10 +113,11 @@ public interface CustomerAgencyDao extends BaseDao { /** * 获取所属机关单位名称(上级-所属) - * @author zhaoqifeng - * @date 2020/5/22 17:53 + * * @param agencyId * @return java.lang.String + * @author zhaoqifeng + * @date 2020/5/22 17:53 */ String selectAgencyName(@Param("agencyId") String agencyId); @@ -127,46 +130,48 @@ public interface CustomerAgencyDao extends BaseDao { List selectAllSubAgency(@Param("subAgencyPids") String subAgencyPids); /** - * @Description 查询一个工作人员最近登录的网格以及机关信息 * @param gridId * @return + * @Description 查询一个工作人员最近登录的网格以及机关信息 * @author wangc * @date 2020.08.17 09:50 - **/ + **/ ExtStaffInfoResultDTO selectAgencyAndGridInfoExt(@Param("gridId") String gridId); + /** - * @Description 当没有工作人员最近访问的gridId时查询该用户所属的组织机关信息 * @param staffId * @return + * @Description 当没有工作人员最近访问的gridId时查询该用户所属的组织机关信息 * @author wangc * @date 2020.08.17 09:50 **/ - ExtStaffInfoResultDTO selectAgencyInfoWhenGridIdIsNull(@Param("staffId")String staffId); + ExtStaffInfoResultDTO selectAgencyInfoWhenGridIdIsNull(@Param("staffId") String staffId); + /** - * @Description 根据agencyId查找指定机构的信息,直属网格、部门 * @param agencyId * @return + * @Description 根据agencyId查找指定机构的信息,直属网格、部门 * @author wangc * @date 2020.08.18 13:41 - **/ - ExtStaffPermissionResultDTO selectAgencyById(@Param("agencyId")String agencyId); + **/ + ExtStaffPermissionResultDTO selectAgencyById(@Param("agencyId") String agencyId); /** - * @Description 根绝agencyId查找其下属机构的信息 * @param pid * @return + * @Description 根绝agencyId查找其下属机构的信息 * @author wangc * @date 2020.08.18 13:42 - **/ + **/ List selectSubAgencyByPid(@Param("pid") String pid); /** - * @Description 根据agencyId查找指定机构直属的部门,将grid与dept分开是因为grid与dept的数量可能不等,造成重复数据无法去重 * @param agencyId * @return + * @Description 根据agencyId查找指定机构直属的部门,将grid与dept分开是因为grid与dept的数量可能不等,造成重复数据无法去重 * @author wangc * @date 2020.08.18 13:42 - **/ + **/ List selectDeptList(@Param("agencyId") String agencyId); /** @@ -186,30 +191,33 @@ public interface CustomerAgencyDao extends BaseDao { AgencyResultDTO selectAgencyByStaffId(@Param("staffId") String staffId); /** - * @Description 返回elementTree结构的agency树 * @param customerId * @param pid * @return java.util.List + * @Description 返回elementTree结构的agency树 * @Author liushaowen * @Date 2020/11/6 14:57 */ - List getAgencyElementTree(@Param("customerId") String customerId,@Param("pid") String pid); + List getAgencyElementTree(@Param("customerId") String customerId, @Param("pid") String pid); /** * @Description 外挂-获取当前组织及部门、网格数据,递归查询所有下级数据 * @author sun **/ OrganizeTreeResultDTO selectorganizeTree(@Param("agencyId") String agencyId); + /** * @Description 外挂-获取当前组织及部门、网格数据,递归查询所有下级数据 * @author sun **/ List selectAgencyGridList(@Param("agencyId") String agencyId); + /** * @Description 外挂-获取当前组织及部门、网格数据,递归查询所有下级数据 * @author sun **/ List selectAgencyDeptList(@Param("agencyId") String agencyId); + /** * @Description 外挂-获取当前组织及部门、网格数据,递归查询所有下级数据 * @author sun @@ -236,6 +244,7 @@ public interface CustomerAgencyDao extends BaseDao { /** * 根据新增人员类型判断查询机关信息 + * * @author sun */ OrgResultDTO selectAgencyDetail(@Param("orgId") String orgId, @Param("orgType") String orgType); @@ -247,40 +256,46 @@ public interface CustomerAgencyDao extends BaseDao { List getStaffOrgListByStaffId(@Param("staffId") String staffId); /** - * @Description 【地图配置】删除 * @param orgId * @param level + * @Description 【地图配置】删除 * @author zxc * @date 2021/10/25 9:39 上午 */ void delMapArea(@Param("orgId") String orgId, @Param("level") String level); /** - * @Description 【地图配置】新增 * @param orgId * @param level * @param coordinates + * @Description 【地图配置】新增 * @author zxc * @date 2021/10/25 9:59 上午 */ - void addMapArea(@Param("orgId") String orgId, @Param("level") String level,@Param("coordinates")String coordinates); + void addMapArea(@Param("orgId") String orgId, @Param("level") String level, @Param("coordinates") String coordinates); /** - * @Description 地图查询下级组织 * @param pid * @param type + * @Description 地图查询下级组织 * @author zxc * @date 2021/10/25 2:30 下午 */ - List selectSonOrg(@Param("pid")String pid,@Param("type")String type); + List selectSonOrg(@Param("pid") String pid, @Param("type") String type); /** - * @Description 查询下级agencyId * @param orgId + * @Description 查询下级agencyId * @author zxc * @date 2021/12/9 4:42 下午 */ List getSonAgencyId(@Param("orgId") String orgId); + /** + * desc:获取组织和网格的数据 树形sql + * @param agencyId + * @return + */ + ExtStaffPermissionResultDTO selectAgencyAndGridById(@Param("agencyId") String agencyId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 5e0dc73b52..a1024cead5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -1131,9 +1131,9 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java index e383f91664..2d5e776c8f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java @@ -16,6 +16,8 @@ import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.service.VolunteerService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -96,7 +98,7 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve // 1.分页查询出所有志愿者列表 int pageNo = 1; - int pageSize = 100; + int pageSize = 200; // 志愿者epmet user id List volunteerEpmetUserIds = new ArrayList<>(); @@ -142,11 +144,17 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve for (VolunteerDistributionResultDTO.Distribution icResiInfo : icResiInfos) { // 将志愿者类型列表字符串,切割放到set中 Set volunteerTypes = new HashSet(); - String[] vTypes = icResiInfo.getVolunteerCategoriesStr().split(","); - if (vTypes != null && vTypes.length > 0) { - volunteerTypes.addAll(Arrays.asList(vTypes)); + String volunteerCategoriesStr = icResiInfo.getVolunteerCategoriesStr(); + + if (StringUtils.isNotEmpty(volunteerCategoriesStr)) { + String[] vTypes = volunteerCategoriesStr.split(","); + if (vTypes != null && vTypes.length > 0) { + volunteerTypes.addAll(Arrays.asList(vTypes)); + } + icResiInfo.setVolunteerCategories(volunteerTypes); + } else { + icResiInfo.setVolunteerCategories(new HashSet<>()); } - icResiInfo.setVolunteerCategories(volunteerTypes); // 填充建筑坐标 String msg = "【志愿者分布】查询楼栋信息失败"; diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 6b07136f1c..784a2b1427 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -498,7 +498,7 @@ icvol.VOLUNTEER_CATEGORY as volunteerCategoriesStr from user_base_info userbaseinfo inner join ic_resi_user icuser on (userbaseinfo.ID_NUM = icuser.ID_CARD and icuser.DEL_FLAG = '0') - inner join ic_volunteer icvol on (icuser.ID = icvol.IC_RESI_USER and icvol.DEL_FLAG = '0') + left join ic_volunteer icvol on (icuser.ID = icvol.IC_RESI_USER and icvol.DEL_FLAG = '0') where userbaseinfo.DEL_FLAG = '0' and userbaseinfo.ID_NUM is not null and userbaseinfo.USER_ID in