Browse Source

难点堵点查询

dev
jiangyy 5 years ago
parent
commit
d6b18348d6
  1. 5
      epmet-module/data-report/data-report-server/pom.xml
  2. 36
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java
  3. 19
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/project/ProjectDao.java
  4. 22
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java
  5. 109
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java
  6. 35
      epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml
  7. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/SubAgencyFormDTO.java
  8. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubListResultDTO.java
  9. 9
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  10. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  11. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java
  12. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  13. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  14. 5
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

5
epmet-module/data-report/data-report-server/pom.xml

@ -14,6 +14,11 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<dependencies> <dependencies>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>gov-org-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency> <dependency>
<groupId>com.epmet</groupId> <groupId>com.epmet</groupId>
<artifactId>data-report-client</artifactId> <artifactId>data-report-client</artifactId>

36
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java

@ -1,12 +1,13 @@
package com.epmet.module.project.controller; package com.epmet.datareport.controller.project;
import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.module.project.service.ProjectService; import com.epmet.datareport.service.project.ProjectService;
import com.epmet.project.constant.ProjectConstant; import com.epmet.project.constant.ProjectConstant;
import com.epmet.project.dto.form.DifficultyRankFormDTO;
import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; import com.epmet.project.dto.form.ProjectIncrTrendFormDTO;
import com.epmet.project.dto.result.*; import com.epmet.project.dto.result.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -40,7 +41,7 @@ public class ProjectController {
/** /**
* @Author sun * @Author sun
* @Description 数据-项目-获取组织下饼图数据 * @Description t
**/ **/
@PostMapping("summaryinfo") @PostMapping("summaryinfo")
public Result<List<ProjectSummaryInfoResultDTO>> summaryInfo(@LoginUser TokenDto tokenDto) { public Result<List<ProjectSummaryInfoResultDTO>> summaryInfo(@LoginUser TokenDto tokenDto) {
@ -78,4 +79,33 @@ public class ProjectController {
return new Result<List<ProjectIncrTrendResultDTO>>().ok(projectService.getProjectIncrTrend(tokenDto, formDTO)); return new Result<List<ProjectIncrTrendResultDTO>>().ok(projectService.getProjectIncrTrend(tokenDto, formDTO));
} }
/**
* @Description 难点赌点-耗时最长|涉及部门最多|处理次数
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614
* @param param
* @return
* @author jiangyy
* @date 2020.10.19 16:38
**/
@PostMapping("difficultyrank")
public Result<List<ProjectDifficultRankResultDTO>> difficultyRank(@RequestBody DifficultyRankFormDTO param){
ValidatorUtils.validateEntity(param, DifficultyRankFormDTO.DifficultyRankInternalGroup.class);
return new Result<List<ProjectDifficultRankResultDTO>>().ok(projectService.getDifficultyRank(param));
}
/**
* @Description 难点赌点-耗时最长|涉及部门最多|处理次数
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614
* @param tokenDto
* @return
* @author jiangyy
* @date 2020.10.19 16:38
**/
@PostMapping("mynextagency")
public Result<List<ProjectNextAgencyResultDTO>> myNextAgency(@LoginUser TokenDto tokenDto){
return new Result<List<ProjectNextAgencyResultDTO>>().ok(projectService.getMyNextAgency(tokenDto));
}
} }

19
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/project/ProjectDao.java

@ -1,6 +1,7 @@
package com.epmet.datareport.dao.project; package com.epmet.datareport.dao.project;
import com.epmet.project.dto.FactAgencyProjectDailyDTO; import com.epmet.project.dto.FactAgencyProjectDailyDTO;
import com.epmet.project.dto.form.DifficultyRankFormDTO;
import com.epmet.project.dto.result.*; import com.epmet.project.dto.result.*;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -55,4 +56,22 @@ public interface ProjectDao {
* @Description 查询机关月统计近十二个月数据 * @Description 查询机关月统计近十二个月数据
**/ **/
List<ProjectIncrTrendResultDTO> selectIncrTrendMonthly(@Param("agencyId") String agencyId); List<ProjectIncrTrendResultDTO> selectIncrTrendMonthly(@Param("agencyId") String agencyId);
/**
* @Description 查询难点赌点-耗时最长|涉及部门最多|处理次数
* @param
* @return
* @author jiangyy
* @date 2020.10.19 16:38
**/
List<ProjectDifficultRankResultDTO> difficultyRank(DifficultyRankFormDTO difficultyRankFormDTO);
/**
* @Description 查询难点堵点的图片list
* @param
* @return
* @author jiangyy
* @date 2020.10.20 10:13
**/
List<String> getDifficultyImgList(String eventId);
} }

22
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java

@ -1,6 +1,7 @@
package com.epmet.module.project.service; package com.epmet.datareport.service.project;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.project.dto.form.DifficultyRankFormDTO;
import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; import com.epmet.project.dto.form.ProjectIncrTrendFormDTO;
import com.epmet.project.dto.result.*; import com.epmet.project.dto.result.*;
@ -41,4 +42,23 @@ public interface ProjectService {
* @Description 数据-项目-/月数据查询 * @Description 数据-项目-/月数据查询
**/ **/
List<ProjectIncrTrendResultDTO> getProjectIncrTrend(TokenDto tokenDto, ProjectIncrTrendFormDTO formDTO); List<ProjectIncrTrendResultDTO> getProjectIncrTrend(TokenDto tokenDto, ProjectIncrTrendFormDTO formDTO);
/**
* @Description 难点赌点-耗时最长|涉及部门最多|处理次数
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614
* @param param
* @return
* @author jiangyy
* @date 2020.10.19 16:38
**/
List<ProjectDifficultRankResultDTO> getDifficultyRank(DifficultyRankFormDTO param);
/**
* @Description 难点赌点-获取组织下拉框
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614
* @return
* @author jiangyy
* @date 2020.10.19 16:38
**/
List<ProjectNextAgencyResultDTO> getMyNextAgency(TokenDto tokenDto);
} }

109
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java

@ -1,16 +1,26 @@
package com.epmet.datareport.service.project.impl; package com.epmet.datareport.service.project.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.project.ProjectDao; import com.epmet.datareport.dao.project.ProjectDao;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.form.LoginUserDetailsFormDTO;
import com.epmet.dto.form.SubAgencyFormDTO;
import com.epmet.dto.result.GridByStaffResultDTO;
import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.dto.result.SubAgencyResultDTO;
import com.epmet.dto.result.SubListResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.module.project.service.ProjectService; import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.datareport.service.project.ProjectService;
import com.epmet.project.constant.ProjectConstant; import com.epmet.project.constant.ProjectConstant;
import com.epmet.project.dto.FactAgencyProjectDailyDTO; import com.epmet.project.dto.FactAgencyProjectDailyDTO;
import com.epmet.project.dto.form.DifficultyRankFormDTO;
import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; import com.epmet.project.dto.form.ProjectIncrTrendFormDTO;
import com.epmet.project.dto.result.*; import com.epmet.project.dto.result.*;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
@ -36,6 +46,9 @@ public class ProjectServiceImpl implements ProjectService {
@Autowired @Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
/** /**
* @Author sun * @Author sun
* @Description 数据-项目-获取汇总数据 * @Description 数据-项目-获取汇总数据
@ -183,4 +196,98 @@ public class ProjectServiceImpl implements ProjectService {
return agencyId; return agencyId;
} }
/**
* @author jiangyy
* @Description 获取userId
*/
private String getLoginUserUserId(TokenDto tokenDto) {
LoginUserDetailsFormDTO dto = new LoginUserDetailsFormDTO();
BeanUtils.copyProperties(tokenDto, dto);
LoginUserDetailsResultDTO data = epmetUserOpenFeignClient.getLoginUserDetails(dto).getData();
String userId = data.getUserId();
if (null == userId || "".equals(userId)) {
throw new RenException(ProjectConstant.GET_AGENCYID);
}
return userId;
}
/**
* @Description 难点赌点-获取组织下拉框
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614
* @return
* @author jiangyy
* @date 2020.10.19 16:38
**/
@Override
public List<ProjectNextAgencyResultDTO> getMyNextAgency(TokenDto tokenDto) {
List<ProjectNextAgencyResultDTO> resultList = new ArrayList<>();
//1、根据token获取本级agencyId、获取userId
String agencyId = getLoginUserDetails(tokenDto);
String userId=getLoginUserUserId(tokenDto);
//2、获取本级组织机构
Result<CustomerAgencyDTO> customerAgencyDTO = govOrgOpenFeignClient.getAgencyById(agencyId);
ProjectNextAgencyResultDTO angencyDto = new ProjectNextAgencyResultDTO();
angencyDto.setOrgId(agencyId);
angencyDto.setOrgName(customerAgencyDTO.getData().getOrganizationName());
angencyDto.setOrgType(customerAgencyDTO.getData().getLevel());
resultList.add(angencyDto);
//3、获取下一级组织机构\网格
if( customerAgencyDTO.getData().getLevel() == "community" ){
//取下级网格
Result<List<GridByStaffResultDTO>> gridListResult = govOrgOpenFeignClient.listGridsbystaffid(userId);
List<GridByStaffResultDTO> gridList = gridListResult.getData();
for(int i=0;i<gridList.size();i++){
ProjectNextAgencyResultDTO subAgencyDto = new ProjectNextAgencyResultDTO();
subAgencyDto.setOrgId(agencyId);
subAgencyDto.setOrgName(customerAgencyDTO.getData().getOrganizationName());
subAgencyDto.setOrgType(customerAgencyDTO.getData().getLevel());
resultList.add(subAgencyDto);
}
} else {
//取下级组织机构
SubAgencyFormDTO form = new SubAgencyFormDTO();
form.setAgencyId(agencyId);
form.setAgencyNum(100);
Result<SubAgencyResultDTO> SubAgencyResultDTO = govOrgOpenFeignClient.subAgencyList(form);
List<SubListResultDTO> subAgencyList = SubAgencyResultDTO.getData().getAgencyList();
for(int i=0;i<subAgencyList.size();i++){
ProjectNextAgencyResultDTO subAgencyDto = new ProjectNextAgencyResultDTO();
subAgencyDto.setOrgId(subAgencyList.get(i).getAgencyId());
subAgencyDto.setOrgName(subAgencyList.get(i).getAgencyName());
subAgencyDto.setOrgType(subAgencyList.get(i).getAgencyLevel());
resultList.add(subAgencyDto);
}
}
if(null == resultList) return new ArrayList<>();
return resultList;
}
/**
* @Description 难点赌点-耗时最长|涉及部门最多|处理次数
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614
* @param param
* @return
* @author jiangyy
* @date 2020.10.19 16:38
**/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public List<ProjectDifficultRankResultDTO> getDifficultyRank(DifficultyRankFormDTO param) {
List<ProjectDifficultRankResultDTO> result = projectDao.difficultyRank(param);
for (int i = 0; i < result.size (); i ++){
List<String> imgUrlList ;
imgUrlList = projectDao.getDifficultyImgList(result.get(i).getProjectId()) ;
result.get(i).setImgUrlList(imgUrlList);
}
if(null == result) return new ArrayList<>();
return result;
}
} }

35
epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml

@ -234,4 +234,39 @@
)a ORDER BY a.month_id DESC,a.type ASC )a ORDER BY a.month_id DESC,a.type ASC
</select> </select>
<!-- 查询难点赌点-耗时最长|涉及部门最多|处理次数 -->
<select id="difficultyRank" resultType="com.epmet.project.dto.result.ProjectDifficultRankResultDTO">
SELECT
diff.EVENT_ID AS projectId,
diff.EVENT_CONTENT AS title,
diff.EVENT_STATUS_CODE AS statusCode,
diff.EVENT_SOURCE AS gridName,
diff.EVENT_IMG_URL AS imgUrl,
ROUND(diff.EVENT_COST_TIME/60,0) AS totalHours,
diff.EVENT_RE_ORG AS reOrg,
diff.EVENT_HANDLED_COUNT AS handledCount
FROM
screen_difficulty_data diff
WHERE
diff.DEL_FLAG = '0'
AND diff.ORG_ID = #{agencyId}
<if test="status!= null">
AND diff.EVENT_STATUS_CODE = #{status}
</if>
AND diff.ORG_TYPE = #{orgType}
ORDER BY
CASE #{type} WHEN 'timelongest' THEN diff.EVENT_COST_TIME
WHEN 'mosthandled' THEN diff.EVENT_HANDLED_COUNT
ELSE diff.EVENT_RE_ORG END
DESC LIMIT #{topNum}
</select>
<!-- 查询难点赌点-耗时最长|涉及部门最多|处理次数 -->
<select id="getDifficultyImgList" resultType="string">
select EVENT_IMG_URL
FROM
screen_difficulty_img_data
WHERE EVENT_ID = #{eventId}
ORDER BY SORT
</select>
</mapper> </mapper>

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/SubAgencyFormDTO.java

@ -39,5 +39,10 @@ public class SubAgencyFormDTO implements Serializable {
@NotBlank(message = "机关组织ID不能为空") @NotBlank(message = "机关组织ID不能为空")
private String agencyId; private String agencyId;
/**
* 机关组织数量
*/
private Integer agencyNum = 10;
} }

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubListResultDTO.java

@ -41,5 +41,9 @@ public class SubListResultDTO implements Serializable {
*/ */
private String agencyName = ""; private String agencyName = "";
/**
* 机关组织级别
*/
private String agencyLevel = "";
} }

9
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -250,4 +250,13 @@ public interface GovOrgOpenFeignClient {
**/ **/
@PostMapping("/gov/org/customeragency/userinfoext") @PostMapping("/gov/org/customeragency/userinfoext")
Result<ExtUserInfoResultDTO> userInfoExt(@RequestBody ExtUserInfoResultDTO result); Result<ExtUserInfoResultDTO> userInfoExt(@RequestBody ExtUserInfoResultDTO result);
/**
* @param formDTO
* @return
* @Author sun
* @Description 组织首页-下级机关列表
*/
@PostMapping("/gov/org/agency/subagencylist")
Result<SubAgencyResultDTO> subAgencyList(@RequestBody SubAgencyFormDTO formDTO);
} }

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -146,4 +146,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result<ExtUserInfoResultDTO> userInfoExt(ExtUserInfoResultDTO result) { public Result<ExtUserInfoResultDTO> userInfoExt(ExtUserInfoResultDTO result) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "userInfoExt", result); return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "userInfoExt", result);
} }
@Override
public Result<SubAgencyResultDTO> subAgencyList(SubAgencyFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "subAgencyList", formDTO);
}
} }

1
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java

@ -38,7 +38,6 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.xml.validation.Validator;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -57,7 +57,7 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
* @Author sun * @Author sun
* @Description 组织首页-下级机关列表 * @Description 组织首页-下级机关列表
**/ **/
List<SubListResultDTO> selectSubAgencyById(@Param("pId") String pId); List<SubListResultDTO> selectSubAgencyById(@Param("pId") String pId, @Param("agencyNum") Integer agencyNum);
/** /**
* @param pId * @param pId

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -25,14 +25,12 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.CustomerAgencyConstant; import com.epmet.constant.CustomerAgencyConstant;
import com.epmet.constant.RoleKeyConstants; import com.epmet.constant.RoleKeyConstants;
import com.epmet.constant.UserWorkType;
import com.epmet.dao.CustomerAgencyDao; import com.epmet.dao.CustomerAgencyDao;
import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.GovStaffRoleDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.redis.CustomerAgencyRedis; import com.epmet.redis.CustomerAgencyRedis;
import com.epmet.service.AgencyService; import com.epmet.service.AgencyService;
@ -177,7 +175,7 @@ public class AgencyServiceImpl implements AgencyService {
public Result removeAgency(RemoveAgencyFormDTO formDTO) { public Result removeAgency(RemoveAgencyFormDTO formDTO) {
Result result = new Result(); Result result = new Result();
//1:查询当前机关是否存在所属下级机关,存在下级的不能删除 //1:查询当前机关是否存在所属下级机关,存在下级的不能删除
List<SubListResultDTO> agencyList = customerAgencyDao.selectSubAgencyById(formDTO.getAgencyId()); List<SubListResultDTO> agencyList = customerAgencyDao.selectSubAgencyById(formDTO.getAgencyId(), 10);
if (null != agencyList && agencyList.size() > NumConstant.ZERO) { if (null != agencyList && agencyList.size() > NumConstant.ZERO) {
result.setCode(EpmetErrorCode.NOT_DEL_AGENCY.getCode()); result.setCode(EpmetErrorCode.NOT_DEL_AGENCY.getCode());
result.setMsg(EpmetErrorCode.NOT_DEL_AGENCY.getMsg()); result.setMsg(EpmetErrorCode.NOT_DEL_AGENCY.getMsg());
@ -238,7 +236,7 @@ public class AgencyServiceImpl implements AgencyService {
public Result<SubAgencyResultDTO> subAgencyList(SubAgencyFormDTO formDTO) { public Result<SubAgencyResultDTO> subAgencyList(SubAgencyFormDTO formDTO) {
SubAgencyResultDTO subAgencyResultDTO = new SubAgencyResultDTO(); SubAgencyResultDTO subAgencyResultDTO = new SubAgencyResultDTO();
//1:根据当前机关Id查询直属下一级机关列表 //1:根据当前机关Id查询直属下一级机关列表
List<SubListResultDTO> agencyList = customerAgencyDao.selectSubAgencyById(formDTO.getAgencyId()); List<SubListResultDTO> agencyList = customerAgencyDao.selectSubAgencyById(formDTO.getAgencyId(),formDTO.getAgencyNum());
subAgencyResultDTO.setAgencyList(null == agencyList ? new ArrayList<SubListResultDTO>() : agencyList); subAgencyResultDTO.setAgencyList(null == agencyList ? new ArrayList<SubListResultDTO>() : agencyList);
//2:统计下一级机关数 //2:统计下一级机关数
subAgencyResultDTO.setSubAgencyCount(agencyList.size()); subAgencyResultDTO.setSubAgencyCount(agencyList.size());

5
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -62,12 +62,13 @@
<select id="selectSubAgencyById" resultType="com.epmet.dto.result.SubListResultDTO"> <select id="selectSubAgencyById" resultType="com.epmet.dto.result.SubListResultDTO">
SELECT SELECT
id AS 'agencyId', id AS 'agencyId',
organization_name AS 'agencyName' organization_name AS 'agencyName',
`level` AS 'agencyLevel'
FROM customer_agency FROM customer_agency
WHERE del_flag = '0' WHERE del_flag = '0'
AND pid = #{pId} AND pid = #{pId}
ORDER BY created_time DESC ORDER BY created_time DESC
LIMIT 10 LIMIT #{agencyNum}
</select> </select>
<select id="selectAgencyList" resultType="com.epmet.dto.result.AgencyListResultDTO"> <select id="selectAgencyList" resultType="com.epmet.dto.result.AgencyListResultDTO">

Loading…
Cancel
Save