Browse Source

难点堵点-组织下拉框"mynextagency-multic"

dev_shibei_match
yinzuomei 4 years ago
parent
commit
c2837745c3
  1. 118
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerGridDTO.java
  2. 14
      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/evaluationindex/screen/ScreenCustomerAgencyDao.java
  4. 19
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java
  5. 25
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  6. 10
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java
  7. 58
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java
  8. 32
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml

118
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerGridDTO.java

@ -0,0 +1,118 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 网格(党支部)信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-26
*/
@Data
public class ScreenCustomerGridDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID 主键ID
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 网格id
*/
private String gridId;
/**
* 组织名称
*/
private String gridName;
/**
* 网格所属组织id
*/
private String parentAgencyId;
/**
* 坐标区域
*/
private String areaMarks;
/**
* 中心点位
*/
private String centerMark;
/**
* 党支部=网格的位置
*/
private String partyMark;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)
*/
private String dataEndTime;
/**
* 所有上级ID用英文逗号分开
*/
private String allParentIds;
private String pid;
private String pids;
}

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

@ -127,6 +127,20 @@ public class ProjectController {
return new Result<List<ProjectNextAgencyResultDTO>>().ok(projectService.getMyNextAgency(tokenDto));
}
/**
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.project.dto.result.ProjectNextAgencyResultDTO>>
* @param tokenDto
* @author yinzuomei
* @description 001难点堵点-组织下拉框
* 需求描述下拉框显示当前用户所属组织和下级组织 1如果当前用户是街道工作人员 显示所属街道和该街道下的社区+直属网格2如果当前用户是社区人员 显示所属社区和该社区下的网格+直属网格
* 210622: 新增此API 后端改为从指标库取值 保证平阴县的工作人员看到的下拉框是平阴县以及8个街道
* @Date 2021/6/22 14:20
**/
@PostMapping("mynextagency-multic")
public Result<List<ProjectNextAgencyResultDTO>> myNextAgencyMultic(@LoginUser TokenDto tokenDto){
return new Result<List<ProjectNextAgencyResultDTO>>().ok(projectService.myNextAgencyMultic(tokenDto.getUserId()));
}
/**
* 002项目分类字典查询
* 查询当前客户的父客户下项目分类字典

19
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java

@ -17,6 +17,7 @@
package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.result.ScreenCustomerAgencyDTO;
import com.epmet.dto.result.plugins.AgencyNodeDTO;
import com.epmet.dto.result.plugins.DeptNodeDTO;
@ -170,4 +171,22 @@ public interface ScreenCustomerAgencyDao {
* @date 2021/6/8 1:27 下午
*/
List<GridManagerListResultDTO> selectGrid(@Param("agencyId")String agencyId,@Param("areaCode")String areaCode);
/**
* 查询当前组织的下一级组织可根据areaCode查询也可根据pid查询
*
* @param areaCode
* @param pid
* @return java.util.List<com.epmet.dto.result.ScreenCustomerAgencyDTO>
*/
List<ScreenCustomerAgencyDTO> selectNextAgencyList(@Param("areaCode") String areaCode, @Param("pid") String pid);
/**
* 查询当前组织的下面的网格可根据areaCode查询也可根据parentAgencyId查询
*
* @param areaCode
* @param parentAgencyId
* @return java.util.List<com.epmet.dto.result.ScreenCustomerAgencyDTO>
*/
List<ScreenCustomerGridDTO> selectGridDTOList(@Param("areaCode") String areaCode, @Param("parentAgencyId") String parentAgencyId);
}

19
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java

@ -1,6 +1,7 @@
package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.dto.AgencyInfoDTO;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.form.AddAreaCodeDictFormDTO;
import com.epmet.dto.form.AreaCodeDictFormDTO;
import com.epmet.dto.result.AreaCodeDictResultDTO;
@ -73,4 +74,22 @@ public interface AgencyService {
List<String> getNextAgencyIds(String areaCode,String agencyId);
AgencyInfoDTO getAgencyInfoDTO(String areaCode, String agencyId);
/**
* 查询当前组织的下一级组织可根据areaCode查询也可根据pid查询
*
* @param areaCode
* @param pid
* @return java.util.List<com.epmet.dto.result.ScreenCustomerAgencyDTO>
*/
List<ScreenCustomerAgencyDTO> queryNextAgencyList(String areaCode, String pid);
/**
* 查询当前组织的下面的网格可根据areaCode查询也可根据parentAgencyId查询
*
* @param areaCode
* @param parentAgencyId
* @return java.util.List<com.epmet.dto.result.ScreenCustomerAgencyDTO>
*/
List<ScreenCustomerGridDTO> queryGridList(String areaCode, String parentAgencyId);
}

25
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java

@ -11,6 +11,7 @@ import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.dto.AgencyInfoDTO;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.form.AddAreaCodeDictFormDTO;
import com.epmet.dto.form.AreaCodeDictFormDTO;
import com.epmet.dto.result.AreaCodeDictResultDTO;
@ -322,4 +323,28 @@ public class AgencyServiceImpl implements AgencyService {
agencyInfoDTO.setSubGridIds(screenCustomerGridDao.selectSubGridIds(areaCode,agencyId));
return agencyInfoDTO;
}
/**
* 查询当前组织的下一级组织可根据areaCode查询也可根据pid查询
*
* @param areaCode
* @param pid
* @return java.util.List<com.epmet.dto.result.ScreenCustomerAgencyDTO>
*/
@Override
public List<ScreenCustomerAgencyDTO> queryNextAgencyList(String areaCode, String pid) {
return screenCustomerAgencyDao.selectNextAgencyList(areaCode,pid);
}
/**
* 查询当前组织的下面的网格可根据areaCode查询也可根据parentAgencyId查询
*
* @param areaCode
* @param parentAgencyId
* @return java.util.List<com.epmet.dto.result.ScreenCustomerAgencyDTO>
*/
@Override
public List<ScreenCustomerGridDTO> queryGridList(String areaCode, String parentAgencyId) {
return screenCustomerAgencyDao.selectGridDTOList(areaCode,parentAgencyId);
}
}

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

@ -80,4 +80,14 @@ public interface ProjectService {
* @Date 14:26 2021-03-22
**/
List<ProjectCategoryDictResultDTO> getCategoryDict(String customerId);
/**
* 001难点堵点-组织下拉框
* 需求描述下拉框显示当前用户所属组织和下级组织 1如果当前用户是街道工作人员 显示所属街道和该街道下的社区+直属网格2如果当前用户是社区人员 显示所属社区和该社区下的网格+直属网格
* 210622: 新增此API 后端改为从指标库取值 保证平阴县的工作人员看到的下拉框是平阴县以及8个街道
*
* @param staffId 当前登录用户id
* @return com.epmet.project.dto.result.ProjectNextAgencyResultDTO
*/
List<ProjectNextAgencyResultDTO> myNextAgencyMultic(String staffId);
}

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

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
@ -11,9 +12,10 @@ 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.service.evaluationindex.screen.ScreenDifficultyDataService;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.datareport.service.project.ProjectService;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.form.LoginUserDetailsFormDTO;
import com.epmet.dto.form.ProcessListFormDTO;
import com.epmet.dto.form.SubAgencyFormDTO;
@ -25,12 +27,13 @@ import com.epmet.project.dto.CustomerCategoryDTO;
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.result.*;
import com.epmet.project.dto.result.ProjectDetailResultDTO;
import com.epmet.project.dto.result.*;
import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -59,9 +62,6 @@ public class ProjectServiceImpl implements ProjectService {
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private GovProjectOpenFeignClient govProjectOpenFeignClient;
@Autowired
private ScreenDifficultyDataService screenDifficultyDataService;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
@ -70,6 +70,8 @@ public class ProjectServiceImpl implements ProjectService {
private GovIssueOpenFeignClient govIssueOpenFeignClient;
@Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient;
@Autowired
private AgencyService screenAgencyService;
/**
* @Author sun
@ -394,4 +396,50 @@ public class ProjectServiceImpl implements ProjectService {
}
return result;
}
/**
* 001难点堵点-组织下拉框
* 需求描述下拉框显示当前用户所属组织和下级组织 1如果当前用户是街道工作人员 显示所属街道和该街道下的社区+直属网格2如果当前用户是社区人员 显示所属社区和该社区下的网格+直属网格
* 210622: 新增此API 后端改为从指标库取值 保证平阴县的工作人员看到的下拉框是平阴县以及8个街道
*
* @param staffId 当前登录用户id
* @return com.epmet.project.dto.result.ProjectNextAgencyResultDTO
*/
@Override
public List<ProjectNextAgencyResultDTO> myNextAgencyMultic(String staffId) {
//1、当前工作人员所属组织信息
Result<CustomerAgencyDTO> staffResult = govOrgOpenFeignClient.getAgencyByStaff(staffId);
if (!staffResult.success() || null == staffResult.getData()) {
throw new RenException(String.format("查询当前工作人员所属组织信息异常,staffId:%s", staffId));
}
List<ProjectNextAgencyResultDTO> resultList = new ArrayList<>();
ProjectNextAgencyResultDTO staffAgency = new ProjectNextAgencyResultDTO();
staffAgency.setOrgId(staffResult.getData().getId());
staffAgency.setOrgName(staffResult.getData().getOrganizationName());
staffAgency.setOrgType("agency");
resultList.add(staffAgency);
//2、查询指标库当前组织的下级组织
List<ScreenCustomerAgencyDTO> agencyDTOList = screenAgencyService.queryNextAgencyList(staffResult.getData().getAreaCode(), StrConstant.EPMETY_STR);
if (CollectionUtils.isNotEmpty(agencyDTOList)) {
agencyDTOList.forEach(agencyDTO -> {
ProjectNextAgencyResultDTO nextAgency = new ProjectNextAgencyResultDTO();
nextAgency.setOrgId(agencyDTO.getAgencyId());
nextAgency.setOrgName(agencyDTO.getAgencyName());
nextAgency.setOrgType("agency");
resultList.add(nextAgency);
});
}
//3、查询指标库当前组织的下级网格
List<ScreenCustomerGridDTO> gridList = screenAgencyService.queryGridList(staffResult.getData().getAreaCode(), StrConstant.EPMETY_STR);
if (CollectionUtils.isNotEmpty(gridList)) {
gridList.forEach(gridDTO -> {
ProjectNextAgencyResultDTO grid = new ProjectNextAgencyResultDTO();
grid.setOrgId(gridDTO.getGridId());
grid.setOrgName(gridDTO.getGridName());
grid.setOrgType("grid");
resultList.add(grid);
});
}
return resultList;
}
}

32
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml

@ -340,4 +340,36 @@
AND cg.PARENT_AGENCY_ID = #{agencyId}
</if>
</select>
<!-- 查询当前组织的下一级组织,可根据areaCode查询,也可根据pid查询 -->
<select id="selectNextAgencyList" parameterType="map" resultType="com.epmet.dto.result.ScreenCustomerAgencyDTO">
SELECT
*
FROM
screen_customer_agency sca
WHERE
sca.DEL_FLAG = '0'
<if test="pid != null and pid != ''">
AND sca.PID = #{pid}
</if>
<if test="areaCode != null and areaCode != ''">
AND sca.PARENT_AREA_CODE =#{areaCode}
</if>
</select>
<!-- 查询当前组织的下面的网格,可根据areaCode查询,也可根据parentAgencyId查询 -->
<select id="selectGridDTOList" parameterType="map" resultType="com.epmet.dto.ScreenCustomerGridDTO">
SELECT
*
FROM
screen_customer_grid scg
WHERE
scg.DEL_FLAG = '0'
<if test="areaCode != null and areaCode != ''">
AND scg.AREA_CODE = #{areaCode}
</if>
<if test="parentAgencyId != null and parentAgencyId != ''">
AND scg.PARENT_AGENCY_ID = #{parentAgencyId}
</if>
</select>
</mapper>

Loading…
Cancel
Save