Browse Source

议题管理、项目跟踪-业务调整带来的部分代码变动

master
sunyuchao 5 years ago
parent
commit
214ee92025
  1. 7
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/DepartmentStaffListFormDTO.java
  2. 4
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/TickStaffFormDTO.java
  3. 4
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java
  4. 9
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java
  5. 5
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java
  6. 247
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  7. 8
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffListResultDTO.java
  8. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  9. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java
  10. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  11. 65
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  12. 3
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  13. 7
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml
  14. 28
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/DepartmentStaffListFormDTO.java
  15. 4
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java
  16. 54
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java
  17. 7
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java
  18. 5
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java
  19. 1
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectStaffService.java
  20. 11
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  21. 22
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectStaffServiceImpl.java

7
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentStaffListFormDTO.java → epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/DepartmentStaffListFormDTO.java

@ -6,7 +6,7 @@ import javax.validation.constraints.NotBlank;
import java.io.Serializable; import java.io.Serializable;
/** /**
* @Description 项目跟踪-部门人员选择-接口入参 * @Description 议题管理-部门人员选择-接口入参
* @Author sun * @Author sun
*/ */
@Data @Data
@ -16,5 +16,10 @@ public class DepartmentStaffListFormDTO implements Serializable {
@NotBlank(message = "机关组织Id不能为空") @NotBlank(message = "机关组织Id不能为空")
private String agencyId; private String agencyId;
/**
* token中工作人员Id
*/
private String staffId;
} }

4
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/TickStaffFormDTO.java

@ -19,12 +19,12 @@ public class TickStaffFormDTO implements Serializable {
/** /**
* 部门Id(为空表示勾选的人不是部门下的可能是组织下的也可能是网格下的) * 部门Id(为空表示勾选的人不是部门下的可能是组织下的也可能是网格下的)
*/ */
private String departmentId; private String departmentId="";
/** /**
* 网格Id(为空表示勾选的人不是网格下的可能是组织下的也可能是部门下的) * 网格Id(为空表示勾选的人不是网格下的可能是组织下的也可能是部门下的)
*/ */
private String gridId; private String gridId="";
@NotBlank(message = "内部备注不能为空") @NotBlank(message = "内部备注不能为空")
private String staffId; private String staffId;

4
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java

@ -6,9 +6,6 @@ import com.epmet.commons.tools.enums.RequirePermissionEnum;
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.dto.form.CloseIssueFormDTO;
import com.epmet.dto.form.DepartmentStaffListFormDTO;
import com.epmet.dto.form.ShiftProjectListFromDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.service.IssueService; import com.epmet.service.IssueService;
@ -58,6 +55,7 @@ public class IssueManageController {
@PostMapping("departmentstafflist") @PostMapping("departmentstafflist")
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_ISSUE_SHIFT_PROJECT) @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_ISSUE_SHIFT_PROJECT)
public Result<DepartmentStaffListResultDTO> departmentStaffList(@LoginUser TokenDto tokenDTO, @RequestBody DepartmentStaffListFormDTO formDTO) { public Result<DepartmentStaffListResultDTO> departmentStaffList(@LoginUser TokenDto tokenDTO, @RequestBody DepartmentStaffListFormDTO formDTO) {
formDTO.setStaffId(tokenDTO.getUserId());
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO);
return new Result<DepartmentStaffListResultDTO>().ok(issueService.departmentStaffList(formDTO)); return new Result<DepartmentStaffListResultDTO>().ok(issueService.departmentStaffList(formDTO));
} }

9
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java

@ -2,9 +2,8 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.BelongGridNameFormDTO; import com.epmet.dto.form.BelongGridNameFormDTO;
import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.CanTickStaffListFormDTO;
import com.epmet.dto.result.AgencyGridResultDTO; import com.epmet.dto.result.AgencyGridResultDTO;
import com.epmet.dto.result.BelongGridNameResultDTO; import com.epmet.dto.result.BelongGridNameResultDTO;
import com.epmet.dto.result.DepartmentStaffListResultDTO; import com.epmet.dto.result.DepartmentStaffListResultDTO;
@ -32,13 +31,13 @@ public interface GovOrgFeignClient {
Result<AgencyGridResultDTO> getAgencyAndGrid(AgencyGridResultDTO agencyGridResultDTO); Result<AgencyGridResultDTO> getAgencyAndGrid(AgencyGridResultDTO agencyGridResultDTO);
/** /**
* @param agencyId * @param canTick
* @return * @return
* @Author sun * @Author sun
* @Description 查询组织下人员,组织下部门人员,组织下网格人员列表信息 * @Description 查询组织下人员,组织下部门人员,组织下网格人员列表信息
**/ **/
@PostMapping(value = "/gov/org/customeragency/departmentstafflist/{agencyId}") @PostMapping(value = "/gov/org/customeragency/departmentstafflist")
Result<DepartmentStaffListResultDTO> departmentStaffList(@PathVariable("agencyId") String agencyId); Result<DepartmentStaffListResultDTO> departmentStaffList(CanTickStaffListFormDTO canTick);
/** /**
* @param agencyId * @param agencyId

5
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java

@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.BelongGridNameFormDTO; import com.epmet.dto.form.BelongGridNameFormDTO;
import com.epmet.dto.form.CanTickStaffListFormDTO;
import com.epmet.dto.result.AgencyGridResultDTO; import com.epmet.dto.result.AgencyGridResultDTO;
import com.epmet.dto.result.BelongGridNameResultDTO; import com.epmet.dto.result.BelongGridNameResultDTO;
import com.epmet.dto.result.DepartmentStaffListResultDTO; import com.epmet.dto.result.DepartmentStaffListResultDTO;
@ -24,8 +25,8 @@ public class GovOrgFeignClientFallBack implements GovOrgFeignClient {
} }
@Override @Override
public Result<DepartmentStaffListResultDTO> departmentStaffList(String agencyId) { public Result<DepartmentStaffListResultDTO> departmentStaffList(CanTickStaffListFormDTO canTick) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "departmentStaffList", agencyId); return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "departmentStaffList", canTick);
} }
@Override @Override

247
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java

@ -15,19 +15,13 @@ import com.epmet.constant.IssueConstant;
import com.epmet.constant.ReadFlagConstant; import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserMessageConstant; import com.epmet.constant.UserMessageConstant;
import com.epmet.dao.IssueDao; import com.epmet.dao.IssueDao;
import com.epmet.dao.IssueProcessDao;
import com.epmet.dao.IssueProjectRelationDao; import com.epmet.dao.IssueProjectRelationDao;
import com.epmet.dto.IssueDTO; import com.epmet.dto.IssueDTO;
import com.epmet.dto.IssueProcessDTO; import com.epmet.dto.IssueProcessDTO;
import com.epmet.dto.IssueVoteStatisticalDTO; import com.epmet.dto.IssueVoteStatisticalDTO;
import com.epmet.dto.form.CommonIssueListFormDTO;
import com.epmet.dao.IssueProcessDao;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.dto.form.CloseIssueFormDTO;
import com.epmet.dto.form.DepartmentStaffListFormDTO;
import com.epmet.dto.form.IssueDetailFormDTO;
import com.epmet.dto.form.IssueShiftedFromTopicFormDTO;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.entity.IssueEntity; import com.epmet.entity.IssueEntity;
import com.epmet.entity.IssueProcessEntity; import com.epmet.entity.IssueProcessEntity;
import com.epmet.entity.IssueProjectRelationEntity; import com.epmet.entity.IssueProjectRelationEntity;
@ -51,9 +45,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.*; import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -153,71 +144,6 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
return issueResult; return issueResult;
} }
/**
* @param formDTO
* @return
* @Author sun
* @Description 议题管理-关闭议题
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void closeIssue(CloseIssueFormDTO formDTO) {
Date date = new Date();
//1:更新议题详情表数据
IssueEntity entity = baseDao.selectById(formDTO.getIssueId());
if (null == entity) {
throw new RenException(IssueConstant.SELECT_EXCEPTION);
}
entity.setIssueStatus(IssueConstant.ISSUE_CLOSED);
entity.setCloseReason(formDTO.getCloseReason());
entity.setResolveType(formDTO.getResolveType());
entity.setVotingDeadline(date);
entity.setClosedTime(date);
if (baseDao.updateById(entity) < NumConstant.ONE) {
throw new RenException(IssueConstant.UPPDATE_EXCEPTION);
}
//2:调用gov-org服务,查询组织网格名称
AgencyGridResultDTO agencyGridResultDTO = new AgencyGridResultDTO();
agencyGridResultDTO.setAgencyId(entity.getOrgId());
agencyGridResultDTO.setGridId(entity.getGridId());
Result<AgencyGridResultDTO> resultDTO = govOrgFeignClient.getAgencyAndGrid(agencyGridResultDTO);
agencyGridResultDTO = resultDTO.getData();
//3:议题进展记录表新增数据
IssueProcessEntity processEntity = new IssueProcessEntity();
processEntity.setIssueId(formDTO.getIssueId());
processEntity.setIssueStatus(IssueConstant.ISSUE_CLOSED);
processEntity.setOrgType(IssueConstant.ISSUE_GRID);
processEntity.setOrgId(entity.getOrgId());
processEntity.setOperationExplain(formDTO.getCloseReason());
processEntity.setOrgName(agencyGridResultDTO.getAgencyName() + "-" + agencyGridResultDTO.getGridName());
issueProcessDao.insert(processEntity);
//4:调用epmet-message服务,给居民端话题创建人和议题发起人发送消息
//4.1:调用resi-group查询话题创建人数据(目前议题来源只有来自话题)
Result<ResiTopicDTO> resultTopicDTO = resiGroupFeignClient.getTopicById(entity.getSourceId());
if (!resultTopicDTO.success() || null == resultTopicDTO.getData()) {
throw new RenException(IssueConstant.SELECT_TOPIC_EXCEPTION);
}
ResiTopicDTO topicDTO = resultTopicDTO.getData();
//4.2:创建消息模板
String messageContent = "";
if (IssueConstant.ISSUE_RESLOVED.equals(formDTO.getResolveType())) {
messageContent = String.format(UserMessageConstant.ISSUE_RESLOVED_MSG, topicDTO.getTopicContent(), formDTO.getCloseReason());
} else if (IssueConstant.ISSUE_UNRESLOVED.equals(formDTO.getResolveType())) {
messageContent = String.format(UserMessageConstant.ISSUE_UNRESLOVED_MSG, topicDTO.getTopicContent(), formDTO.getCloseReason());
}
//4.3:调用服务,发送消息
if (!saveUserMessageList(topicDTO, messageContent, entity).success()) {
throw new RenException(IssueConstant.SAVE_MSG_EXCEPTION);
}
//5:缓存中网格下表决中的议题总数减1
govIssueRedis.subtractWorkGrassrootsIssueRedDotValue(entity.getGridId());
}
/** /**
* @Description 根据issueId查询gridId * @Description 根据issueId查询gridId
* @param issueId * @param issueId
@ -231,27 +157,6 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
return gridIdResult; return gridIdResult;
} }
/**
* @Description 关闭议题议题转项目时给话题创建人和议题发起人发送消息
* @author sun
*/
private Result saveUserMessageList(ResiTopicDTO topicDTO, String messageContent, IssueEntity entity) {
//2:分别给话题创建人、议题发起人发送消息
List<UserMessageFormDTO> msgList = new ArrayList<>();
UserMessageFormDTO msgDTO = new UserMessageFormDTO();
msgDTO.setCustomerId(entity.getCustomerId());
msgDTO.setGridId(entity.getGridId());
msgDTO.setApp(AppClientConstant.APP_RESI);
msgDTO.setTitle(UserMessageConstant.ISSUE_TITLE);
msgDTO.setMessageContent(messageContent);
msgDTO.setReadFlag(ReadFlagConstant.UN_READ);
msgDTO.setUserId(topicDTO.getCreatedBy());
msgList.add(msgDTO);
msgDTO.setUserId(entity.getCreatedBy());
msgList.add(msgDTO);
return messageFeignClient.saveUserMessageList(msgList);
}
@Override @Override
public List<GridVotingIssueCountResultDTO> queryVotingIssueCount(List<String> gridIdList) { public List<GridVotingIssueCountResultDTO> queryVotingIssueCount(List<String> gridIdList) {
List<GridVotingIssueCountResultDTO> list = new ArrayList<>(); List<GridVotingIssueCountResultDTO> list = new ArrayList<>();
@ -269,19 +174,6 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
return list; return list;
} }
/**
* @param formDTO
* @return
* @Author sun
* @Description 议题管理-部门人员选择
**/
@Override
public DepartmentStaffListResultDTO departmentStaffList(DepartmentStaffListFormDTO formDTO) {
//1:调用gov-org服务,分别查询组织下人员,组织下部门人员,组织下网格人员列表信息
Result<DepartmentStaffListResultDTO> resultDTOResult = govOrgFeignClient.departmentStaffList(formDTO.getAgencyId());
return resultDTOResult.getData();
}
@Override @Override
public List<ShiftProjectListResultDTO> getShiftProjectList(ShiftProjectListFromDTO fromDTO) { public List<ShiftProjectListResultDTO> getShiftProjectList(ShiftProjectListFromDTO fromDTO) {
List<ShiftProjectListResultDTO> resultList = new ArrayList<>(); List<ShiftProjectListResultDTO> resultList = new ArrayList<>();
@ -310,24 +202,6 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
return resultList; return resultList;
} }
/**
* @param formDTO
* @return
* @Author sun
* @Description 议题管理-议题人员选择
**/
@Override
public ProcessorListResultDTO processorList(ProcessorListFormDTO formDTO) {
//1:查询当前议题工作人员所属组织Id
IssueEntity entity = baseDao.selectById(formDTO.getIssueId());
if (null == entity) {
throw new RenException(IssueConstant.SELECT_EXCEPTION);
}
//2:调用gov-org服务,查询组织树
Result<ProcessorListResultDTO> resultDTOResult = govOrgFeignClient.getProcessorList(entity.getOrgId());
return resultDTOResult.getData();
}
/** /**
* @Description 话题转为议题入口 返回生成的议题Id * @Description 话题转为议题入口 返回生成的议题Id
* @param issueShiftedFromTopicFormDTO IssueShiftedFromTopicFormDTO.class * @param issueShiftedFromTopicFormDTO IssueShiftedFromTopicFormDTO.class
@ -457,6 +331,125 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
return null; return null;
} }
/**
* @param formDTO
* @return
* @Author sun
* @Description 议题管理-关闭议题
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void closeIssue(CloseIssueFormDTO formDTO) {
Date date = new Date();
//1:更新议题详情表数据
IssueEntity entity = baseDao.selectById(formDTO.getIssueId());
if (null == entity) {
throw new RenException(IssueConstant.SELECT_EXCEPTION);
}
entity.setIssueStatus(IssueConstant.ISSUE_CLOSED);
entity.setCloseReason(formDTO.getCloseReason());
entity.setResolveType(formDTO.getResolveType());
entity.setVotingDeadline(date);
entity.setClosedTime(date);
if (baseDao.updateById(entity) < NumConstant.ONE) {
throw new RenException(IssueConstant.UPPDATE_EXCEPTION);
}
//2:调用gov-org服务,查询组织网格名称
AgencyGridResultDTO agencyGridResultDTO = new AgencyGridResultDTO();
agencyGridResultDTO.setAgencyId(entity.getOrgId());
agencyGridResultDTO.setGridId(entity.getGridId());
Result<AgencyGridResultDTO> resultDTO = govOrgFeignClient.getAgencyAndGrid(agencyGridResultDTO);
agencyGridResultDTO = resultDTO.getData();
//3:议题进展记录表新增数据
IssueProcessEntity processEntity = new IssueProcessEntity();
processEntity.setIssueId(formDTO.getIssueId());
processEntity.setIssueStatus(IssueConstant.ISSUE_CLOSED);
processEntity.setOrgType(IssueConstant.ISSUE_GRID);
processEntity.setOrgId(entity.getOrgId());
processEntity.setOperationExplain(formDTO.getCloseReason());
processEntity.setOrgName(agencyGridResultDTO.getAgencyName() + "-" + agencyGridResultDTO.getGridName());
issueProcessDao.insert(processEntity);
//4:调用epmet-message服务,给居民端话题创建人和议题发起人发送消息
//4.1:调用resi-group查询话题创建人数据(目前议题来源只有来自话题)
Result<ResiTopicDTO> resultTopicDTO = resiGroupFeignClient.getTopicById(entity.getSourceId());
if (!resultTopicDTO.success() || null == resultTopicDTO.getData()) {
throw new RenException(IssueConstant.SELECT_TOPIC_EXCEPTION);
}
ResiTopicDTO topicDTO = resultTopicDTO.getData();
//4.2:创建消息模板
String messageContent = "";
if (IssueConstant.ISSUE_RESLOVED.equals(formDTO.getResolveType())) {
messageContent = String.format(UserMessageConstant.ISSUE_RESLOVED_MSG, topicDTO.getTopicContent(), formDTO.getCloseReason());
} else if (IssueConstant.ISSUE_UNRESLOVED.equals(formDTO.getResolveType())) {
messageContent = String.format(UserMessageConstant.ISSUE_UNRESLOVED_MSG, topicDTO.getTopicContent(), formDTO.getCloseReason());
}
//4.3:调用服务,发送消息
if (!saveUserMessageList(topicDTO, messageContent, entity).success()) {
throw new RenException(IssueConstant.SAVE_MSG_EXCEPTION);
}
//5:缓存中网格下表决中的议题总数减1
govIssueRedis.subtractWorkGrassrootsIssueRedDotValue(entity.getGridId());
}
/**
* @Description 关闭议题议题转项目时给话题创建人和议题发起人发送消息
* @author sun
*/
private Result saveUserMessageList(ResiTopicDTO topicDTO, String messageContent, IssueEntity entity) {
//2:分别给话题创建人、议题发起人发送消息
List<UserMessageFormDTO> msgList = new ArrayList<>();
UserMessageFormDTO msgDTO = new UserMessageFormDTO();
msgDTO.setCustomerId(entity.getCustomerId());
msgDTO.setGridId(entity.getGridId());
msgDTO.setApp(AppClientConstant.APP_RESI);
msgDTO.setTitle(UserMessageConstant.ISSUE_TITLE);
msgDTO.setMessageContent(messageContent);
msgDTO.setReadFlag(ReadFlagConstant.UN_READ);
msgDTO.setUserId(topicDTO.getCreatedBy());
msgList.add(msgDTO);
msgDTO.setUserId(entity.getCreatedBy());
msgList.add(msgDTO);
return messageFeignClient.saveUserMessageList(msgList);
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 议题管理-部门人员选择
**/
@Override
public DepartmentStaffListResultDTO departmentStaffList(DepartmentStaffListFormDTO formDTO) {
//1:调用gov-org服务,分别查询组织下人员,组织下部门人员,组织下网格人员列表信息
CanTickStaffListFormDTO canTick = new CanTickStaffListFormDTO();
canTick.setAgencyId(formDTO.getAgencyId());
canTick.setType("issue");
Result<DepartmentStaffListResultDTO> resultDTOResult = govOrgFeignClient.departmentStaffList(canTick);
return resultDTOResult.getData();
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 议题管理-议题人员选择
**/
@Override
public ProcessorListResultDTO processorList(ProcessorListFormDTO formDTO) {
//1:查询当前议题工作人员所属组织Id
IssueEntity entity = baseDao.selectById(formDTO.getIssueId());
if (null == entity) {
throw new RenException(IssueConstant.SELECT_EXCEPTION);
}
//2:调用gov-org服务,查询组织树
Result<ProcessorListResultDTO> resultDTOResult = govOrgFeignClient.getProcessorList(entity.getOrgId());
return resultDTOResult.getData();
}
/** /**
* @param formDTO * @param formDTO
* @return * @return

8
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffListResultDTO.java

@ -15,15 +15,15 @@ public class StaffListResultDTO implements Serializable {
/** /**
* 人员Id * 人员Id
*/ */
private String staffId; private String staffId="";
/** /**
* 人员名称 * 人员名称
*/ */
private String staffName; private String staffName="";
/** /**
* 人员头像 * 人员头像
*/ */
private String staffHeadPhoto; private String staffHeadPhoto="";
/** /**
* 性别 * 性别
*/ */
@ -31,6 +31,6 @@ public class StaffListResultDTO implements Serializable {
/** /**
* 角色名称(机关领导部门领导网格长) * 角色名称(机关领导部门领导网格长)
*/ */
private String roleName; private String roleName="";
} }

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java

@ -17,9 +17,7 @@
package com.epmet.controller; package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.AssertUtils;
@ -29,6 +27,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.AgencyDeptGridFormDTO; import com.epmet.dto.form.AgencyDeptGridFormDTO;
import com.epmet.dto.form.CanTickStaffListFormDTO;
import com.epmet.dto.form.StaffOrgFormDTO; import com.epmet.dto.form.StaffOrgFormDTO;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.excel.CustomerAgencyExcel; import com.epmet.excel.CustomerAgencyExcel;
@ -120,14 +119,14 @@ public class CustomerAgencyController {
} }
/** /**
* @param agencyId * @param canTick
* @return * @return
* @Author sun * @Author sun
* @Description 查询组织下人员,组织下部门人员,组织下网格人员列表信息 * @Description 查询组织下人员,组织下部门人员,组织下网格人员列表信息
**/ **/
@PostMapping("departmentstafflist/{agencyId}") @PostMapping("departmentstafflist")
public Result<DepartmentStaffListResultDTO> departmentStaffList(@PathVariable("agencyId") String agencyId) { public Result<DepartmentStaffListResultDTO> departmentStaffList(CanTickStaffListFormDTO canTick) {
return new Result<DepartmentStaffListResultDTO>().ok(customerAgencyService.departmentStaffList(agencyId)); return new Result<DepartmentStaffListResultDTO>().ok(customerAgencyService.departmentStaffList(canTick));
} }
/** /**

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

@ -74,5 +74,5 @@ public interface CustomerStaffAgencyDao extends BaseDao<CustomerStaffAgencyEntit
* 查询组织下人员列表 * 查询组织下人员列表
* @Author sun * @Author sun
*/ */
List<StaffListResultDTO> selectAgencyStaffList(@Param("agencyId") String agencyId); List<StaffListResultDTO> selectAgencyStaffList(@Param("agencyId") String agencyId, @Param("staffId") String staffId);
} }

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java

@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.AgencyDeptGridFormDTO; import com.epmet.dto.form.AgencyDeptGridFormDTO;
import com.epmet.dto.form.CanTickStaffListFormDTO;
import com.epmet.dto.form.StaffOrgFormDTO; import com.epmet.dto.form.StaffOrgFormDTO;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerAgencyEntity;
@ -115,12 +116,12 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
AgencyGridResultDTO getAgencyAndGrid(AgencyGridResultDTO agencyGridResultDTO); AgencyGridResultDTO getAgencyAndGrid(AgencyGridResultDTO agencyGridResultDTO);
/** /**
* @param agencyId * @param canTick
* @return * @return
* @Author sun * @Author sun
* @Description 查询组织下人员,组织下部门人员,组织下网格人员列表信息 * @Description 查询组织下人员,组织下部门人员,组织下网格人员列表信息
**/ **/
DepartmentStaffListResultDTO departmentStaffList(String agencyId); DepartmentStaffListResultDTO departmentStaffList(CanTickStaffListFormDTO canTick);
/** /**
* @param formDTO * @param formDTO

65
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -31,6 +31,7 @@ import com.epmet.constant.CustomerGridConstant;
import com.epmet.dao.*; import com.epmet.dao.*;
import com.epmet.dto.*; import com.epmet.dto.*;
import com.epmet.dto.form.AgencyDeptGridFormDTO; import com.epmet.dto.form.AgencyDeptGridFormDTO;
import com.epmet.dto.form.CanTickStaffListFormDTO;
import com.epmet.dto.form.CustomerFormDTO; import com.epmet.dto.form.CustomerFormDTO;
import com.epmet.dto.form.StaffOrgFormDTO; import com.epmet.dto.form.StaffOrgFormDTO;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
@ -178,20 +179,24 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
} }
/** /**
* @param agencyId * @param canTick
* @return * @return
* @Author sun * @Author sun
* @Description 查询组织下人员,组织下部门人员,组织下网格人员列表信息 * @Description 查询组织下人员,组织下部门人员,组织下网格人员列表信息
**/ **/
@Override @Override
public DepartmentStaffListResultDTO departmentStaffList(String agencyId) { public DepartmentStaffListResultDTO departmentStaffList(CanTickStaffListFormDTO canTick) {
//根据组织Id查询该组织的工作人员列表;该组织的部门列表、部门下人员(带部门领导角色)列表;该组织的网格列表、网格下人员(带网格长角色)列表。人员都不做去重处理。 //根据组织Id查询该组织的工作人员列表;该组织的部门列表、部门下人员(带部门领导角色)列表;该组织的网格列表、网格下人员(带网格长角色)列表。人员都不做去重处理。
DepartmentStaffListResultDTO resultDTO = new DepartmentStaffListResultDTO(); DepartmentStaffListResultDTO resultDTO = new DepartmentStaffListResultDTO();
//1:根据组织Id查询该组织下工作人员列表 //1:根据组织Id查询该组织下工作人员列表(如果当前操作人是组织下的则不查询)
List<StaffListResultDTO> agencyStaffList = customerStaffAgencyDao.selectAgencyStaffList(agencyId); String staffId = "";
if("project".equals(canTick.getType())&&"".equals(canTick.getDeptOrGridId())){
staffId = canTick.getStaffId();
}
List<StaffListResultDTO> agencyStaffList = customerStaffAgencyDao.selectAgencyStaffList(canTick.getAgencyId(),staffId);
//2:根据组织Id查询该组织下部门、人员列表 //2:根据组织Id查询该组织下部门、人员列表
//2.1:查询组织下部门列表 //2.1:查询组织下部门列表
List<DepartmentListResultDTO> listDept = customerDepartmentDao.selectDepartmentList(agencyId); List<DepartmentListResultDTO> listDept = customerDepartmentDao.selectDepartmentList(canTick.getAgencyId());
List<DeptListResultDTO> departmentList = ConvertUtils.sourceToTarget(listDept, DeptListResultDTO.class); List<DeptListResultDTO> departmentList = ConvertUtils.sourceToTarget(listDept, DeptListResultDTO.class);
//2.2:查询每一个部门下人员列表 //2.2:查询每一个部门下人员列表
List<String> deptIdList = departmentList.stream().map(DeptListResultDTO::getDepartmentId).collect(Collectors.toList()); List<String> deptIdList = departmentList.stream().map(DeptListResultDTO::getDepartmentId).collect(Collectors.toList());
@ -199,17 +204,19 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
departmentList.forEach(dept->{ departmentList.forEach(dept->{
List<StaffListResultDTO> departmentStaffList = new ArrayList<>(); List<StaffListResultDTO> departmentStaffList = new ArrayList<>();
deptStaffs.forEach(ds->{ deptStaffs.forEach(ds->{
if(dept.getDepartmentId().equals(ds.getDepartmentId())){ if (dept.getDepartmentId().equals(ds.getDepartmentId())) {
StaffListResultDTO sf = new StaffListResultDTO(); if (!"project".equals(canTick.getType()) || "".equals(canTick.getDeptOrGridId()) || !dept.getDepartmentId().equals(canTick.getDeptOrGridId())) {
sf.setStaffId(ds.getUserId()); StaffListResultDTO sf = new StaffListResultDTO();
departmentStaffList.add(sf); sf.setStaffId(ds.getUserId());
departmentStaffList.add(sf);
}
} }
}); });
dept.setDepartmentStaffList(departmentStaffList); dept.setDepartmentStaffList(departmentStaffList);
}); });
//3:根据组织Id查询该组织下网格、人员列表 //3:根据组织Id查询该组织下网格、人员列表
//3.1:查询组织下网格列表 //3.1:查询组织下网格列表
List<GridListResultDTO> gridList = customerGridDao.selectGridList(agencyId); List<GridListResultDTO> gridList = customerGridDao.selectGridList(canTick.getAgencyId());
//3.2:查询每一个网格下人员列表 //3.2:查询每一个网格下人员列表
List<String> gridIdList = gridList.stream().map(GridListResultDTO::getGridId).collect(Collectors.toList()); List<String> gridIdList = gridList.stream().map(GridListResultDTO::getGridId).collect(Collectors.toList());
List<CustomerStaffGridDTO> gridStaffs = customerStaffGridDao.selectGridStaffs(gridIdList); List<CustomerStaffGridDTO> gridStaffs = customerStaffGridDao.selectGridStaffs(gridIdList);
@ -217,9 +224,11 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
List<StaffListResultDTO> gridStaffList = new ArrayList<>(); List<StaffListResultDTO> gridStaffList = new ArrayList<>();
gridStaffs.forEach(gs->{ gridStaffs.forEach(gs->{
if(grid.getGridId().equals(gs.getGridId())){ if(grid.getGridId().equals(gs.getGridId())){
StaffListResultDTO sf = new StaffListResultDTO(); if (!"project".equals(canTick.getType()) || "".equals(canTick.getDeptOrGridId()) || !grid.getGridId().equals(canTick.getDeptOrGridId())) {
sf.setStaffId(gs.getUserId()); StaffListResultDTO sf = new StaffListResultDTO();
gridStaffList.add(sf); sf.setStaffId(gs.getUserId());
gridStaffList.add(sf);
}
} }
}); });
grid.setGridStaffList(gridStaffList); grid.setGridStaffList(gridStaffList);
@ -242,7 +251,10 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
//人员信息 //人员信息
for(StaffListResultDTO stf : staffList){ for(StaffListResultDTO stf : staffList){
if(sf.getStaffId().equals(stf.getStaffId())){ if(sf.getStaffId().equals(stf.getStaffId())){
sf = ConvertUtils.sourceToTarget(stf, StaffListResultDTO.class); //sf = ConvertUtils.sourceToTarget(stf, StaffListResultDTO.class);
sf.setStaffName(stf.getStaffName());
sf.setStaffHeadPhoto(stf.getStaffHeadPhoto());
sf.setGender(stf.getGender());
break; break;
} }
} }
@ -261,7 +273,10 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
//人员信息 //人员信息
for(StaffListResultDTO stf : staffList){ for(StaffListResultDTO stf : staffList){
if(ds.getStaffId().equals(stf.getStaffId())){ if(ds.getStaffId().equals(stf.getStaffId())){
ds = ConvertUtils.sourceToTarget(stf, StaffListResultDTO.class); //ds = ConvertUtils.sourceToTarget(stf, StaffListResultDTO.class);
ds.setStaffName(stf.getStaffName());
ds.setStaffHeadPhoto(stf.getStaffHeadPhoto());
ds.setGender(stf.getGender());
break; break;
} }
} }
@ -281,7 +296,10 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
//人员信息 //人员信息
for(StaffListResultDTO stf : staffList){ for(StaffListResultDTO stf : staffList){
if(gs.getStaffId().equals(stf.getStaffId())){ if(gs.getStaffId().equals(stf.getStaffId())){
gs = ConvertUtils.sourceToTarget(stf, StaffListResultDTO.class); //gs = ConvertUtils.sourceToTarget(stf, StaffListResultDTO.class);
gs.setStaffName(stf.getStaffName());
gs.setStaffHeadPhoto(stf.getStaffHeadPhoto());
gs.setGender(stf.getGender());
break; break;
} }
} }
@ -310,11 +328,20 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
public AgencyDeptGridResultDTO getAgencyDeptGridList(AgencyDeptGridFormDTO formDTO) { public AgencyDeptGridResultDTO getAgencyDeptGridList(AgencyDeptGridFormDTO formDTO) {
AgencyDeptGridResultDTO agencyDeptGrid = new AgencyDeptGridResultDTO(); AgencyDeptGridResultDTO agencyDeptGrid = new AgencyDeptGridResultDTO();
//1:跟踪组织Id批量查询组织信息 //1:跟踪组织Id批量查询组织信息
List<CustomerAgencyDTO> agencyList = baseDao.selectAgencyListByIds(formDTO.getAgencyIdList()); List<CustomerAgencyDTO> agencyList = new ArrayList<>();
if (null != formDTO.getAgencyIdList()) {
agencyList = baseDao.selectAgencyListByIds(formDTO.getAgencyIdList());
}
//2:根据部门Id批量查询部门信息 //2:根据部门Id批量查询部门信息
List<CustomerDepartmentDTO> deptList = customerDepartmentDao.selectDeptListByIds(formDTO.getDeptIdList()); List<CustomerDepartmentDTO> deptList = new ArrayList<>();
if (null != formDTO.getDeptIdList()) {
deptList = customerDepartmentDao.selectDeptListByIds(formDTO.getDeptIdList());
}
//3:根据网格Id批量查询网格信息 //3:根据网格Id批量查询网格信息
List<CustomerGridDTO> gridList = customerGridDao.selectGridListByIds(formDTO.getGridIdList()); List<CustomerGridDTO> gridList = new ArrayList<>();
if (null != formDTO.getGridIdList()) {
gridList = customerGridDao.selectGridListByIds(formDTO.getGridIdList());
}
agencyDeptGrid.setAgencyList(agencyList); agencyDeptGrid.setAgencyList(agencyList);
agencyDeptGrid.setDeptList(deptList); agencyDeptGrid.setDeptList(deptList);
agencyDeptGrid.setGridList(gridList); agencyDeptGrid.setGridList(gridList);

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

@ -119,10 +119,11 @@
ca.id = #{agencyId} ca.id = #{agencyId}
</foreach> </foreach>
ORDER BY field( ORDER BY field(
ca.id, ca.id,
<foreach item="agencyId" collection="agencyIdList" separator=","> <foreach item="agencyId" collection="agencyIdList" separator=",">
#{agencyId} #{agencyId}
</foreach> </foreach>
)
</select> </select>
<select id="selectSubAgencyList" resultType="com.epmet.dto.result.AgencySubResultDTO"> <select id="selectSubAgencyList" resultType="com.epmet.dto.result.AgencySubResultDTO">

7
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml

@ -96,13 +96,16 @@
</select> </select>
<select id="selectAgencyStaffList" resultType="com.epmet.dto.result.StaffListResultDTO"> <select id="selectAgencyStaffList" resultType="com.epmet.dto.result.StaffListResultDTO">
SELECT SELECT
user_id AS "staffId" user_id AS "staffId"
FROM FROM
customer_staff_agency customer_staff_agency
WHERE WHERE
del_flag = '0' del_flag = '0'
AND agency_id =#{agencyId} AND agency_id =#{agencyId}
<if test="staffId != null and staffId.trim() != ''">
AND user_id != #{staffId}
</if>
</select> </select>
</mapper> </mapper>

28
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/DepartmentStaffListFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 项目跟踪-部门人员选择-接口入参
* @Author sun
*/
@Data
public class DepartmentStaffListFormDTO implements Serializable {
private static final long serialVersionUID = 4859779755214502427L;
@NotBlank(message = "机关组织Id不能为空")
private String agencyId;
@NotBlank(message = "项目人员关联Id不能为空")
private String projectStaffId;
/**
* token中工作人员Id
*/
private String staffId;
}

4
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java

@ -85,4 +85,8 @@ public interface ProjectConstant {
* 更新项目人员关联表数据失败 * 更新项目人员关联表数据失败
*/ */
String DATE_EXCEPTION = "未勾选流转人员"; String DATE_EXCEPTION = "未勾选流转人员";
/**
* 调用gov-org服务查询数据失败
*/
String SELECT_GOV_ORG_EXCEPTION = "获取组织、部门、网格信息失败";
} }

54
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java

@ -12,7 +12,6 @@ import com.epmet.service.ProjectProcessService;
import com.epmet.service.ProjectSatisfactionDetailService; import com.epmet.service.ProjectSatisfactionDetailService;
import com.epmet.service.ProjectStaffService; import com.epmet.service.ProjectStaffService;
import com.epmet.service.ProjectTraceService; import com.epmet.service.ProjectTraceService;
import oracle.jdbc.proxy.annotation.Post;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -153,18 +152,32 @@ public class ProjectTraceController {
return new Result(); return new Result();
} }
/** /**
* @param formDTO * 我的处理部门
* @return * @author zhaoqifeng
* @Author sun * @date 2020/5/14 14:22
* @Description 项目跟踪-项目处理进展列表 * @param tokenDto
**/ * @param fromDTO
@PostMapping("processlist") * @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.DepartmentResultDTO>>
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_TRACE_DETAIL) */
public Result<List<ProcesslistResultDTO>> processList(@LoginUser TokenDto tokenDTO, @RequestBody ProcessListFormDTO formDTO) { @PostMapping("mydepartmentlist")
ValidatorUtils.validateEntity(formDTO); @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_TRACE_DETAIL)
return new Result<List<ProcesslistResultDTO>>().ok(projectProcessService.progressList(formDTO)); public Result<List<DepartmentResultDTO>> myDepartmentList(@LoginUser TokenDto tokenDto, @RequestBody ProjectDetailFromDTO fromDTO) {
} return new Result<List<DepartmentResultDTO>>().ok(projectTraceService.myDepartmentList(tokenDto, fromDTO));
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 项目跟踪-项目处理进展列表
**/
@PostMapping("processlist")
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_TRACE_DETAIL)
public Result<List<ProcesslistResultDTO>> processList(@LoginUser TokenDto tokenDTO, @RequestBody ProcessListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return new Result<List<ProcesslistResultDTO>>().ok(projectProcessService.progressList(formDTO));
}
/** /**
* @param formDTO * @param formDTO
@ -188,6 +201,7 @@ public class ProjectTraceController {
@PostMapping("departmentstafflist") @PostMapping("departmentstafflist")
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_TRACE_TRANSFER) @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_TRACE_TRANSFER)
public Result<DepartmentStaffListResultDTO> departmentStaffList(@LoginUser TokenDto tokenDTO, @RequestBody DepartmentStaffListFormDTO formDTO) { public Result<DepartmentStaffListResultDTO> departmentStaffList(@LoginUser TokenDto tokenDTO, @RequestBody DepartmentStaffListFormDTO formDTO) {
formDTO.setStaffId(tokenDTO.getUserId());
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO);
return new Result<DepartmentStaffListResultDTO>().ok(projectStaffService.departmentStaffList(formDTO)); return new Result<DepartmentStaffListResultDTO>().ok(projectStaffService.departmentStaffList(formDTO));
} }
@ -206,20 +220,6 @@ public class ProjectTraceController {
return new Result(); return new Result();
} }
/**
* 我的处理部门
* @author zhaoqifeng
* @date 2020/5/14 14:22
* @param tokenDto
* @param fromDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.DepartmentResultDTO>>
*/
@PostMapping("mydepartmentlist")
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_TRACE_DETAIL)
public Result<List<DepartmentResultDTO>> myDepartmentList(@LoginUser TokenDto tokenDto, @RequestBody ProjectDetailFromDTO fromDTO) {
return new Result<List<DepartmentResultDTO>>().ok(projectTraceService.myDepartmentList(tokenDto, fromDTO));
}
/** /**
* @param formDTO * @param formDTO
* @return * @return

7
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java

@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.AgencyDeptGridFormDTO; import com.epmet.dto.form.AgencyDeptGridFormDTO;
import com.epmet.dto.form.CanTickStaffListFormDTO;
import com.epmet.dto.result.AgencyDeptGridResultDTO; import com.epmet.dto.result.AgencyDeptGridResultDTO;
import com.epmet.dto.result.DepartmentStaffListResultDTO; import com.epmet.dto.result.DepartmentStaffListResultDTO;
import com.epmet.dto.result.ProcessorListResultDTO; import com.epmet.dto.result.ProcessorListResultDTO;
@ -30,13 +31,13 @@ public interface GovOrgFeignClient {
@PostMapping("/gov/org/agency/agencybyid/{agencyId}") @PostMapping("/gov/org/agency/agencybyid/{agencyId}")
Result<CustomerAgencyDTO> getAgencyById(@PathVariable("agencyId") String agencyId); Result<CustomerAgencyDTO> getAgencyById(@PathVariable("agencyId") String agencyId);
/** /**
* @param agencyId * @param canTick
* @return * @return
* @Author sun * @Author sun
* @Description 查询组织下人员,组织下部门人员,组织下网格人员列表信息 * @Description 查询组织下人员,组织下部门人员,组织下网格人员列表信息
**/ **/
@PostMapping(value = "/gov/org/customeragency/departmentstafflist/{agencyId}") @PostMapping(value = "/gov/org/customeragency/departmentstafflist")
Result<DepartmentStaffListResultDTO> departmentStaffList(@PathVariable("agencyId") String agencyId); Result<DepartmentStaffListResultDTO> departmentStaffList(CanTickStaffListFormDTO canTick);
/** /**
* @param formDTO * @param formDTO

5
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java

@ -8,6 +8,7 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.AgencyDeptGridFormDTO; import com.epmet.dto.form.AgencyDeptGridFormDTO;
import com.epmet.dto.form.CanTickStaffListFormDTO;
import com.epmet.dto.result.AgencyDeptGridResultDTO; import com.epmet.dto.result.AgencyDeptGridResultDTO;
import com.epmet.dto.result.DepartmentStaffListResultDTO; import com.epmet.dto.result.DepartmentStaffListResultDTO;
import com.epmet.dto.result.ProcessorListResultDTO; import com.epmet.dto.result.ProcessorListResultDTO;
@ -26,8 +27,8 @@ public class GovOrgFeignClientFallBack implements GovOrgFeignClient {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyById", agencyId); return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyById", agencyId);
} }
@Override @Override
public Result<DepartmentStaffListResultDTO> departmentStaffList(String agencyId) { public Result<DepartmentStaffListResultDTO> departmentStaffList(CanTickStaffListFormDTO canTick) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "departmentStaffList", agencyId); return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "departmentStaffList", canTick);
} }
@Override @Override

1
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectStaffService.java

@ -22,7 +22,6 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.ProjectStaffDTO; import com.epmet.dto.ProjectStaffDTO;
import com.epmet.dto.form.DepartmentStaffListFormDTO; import com.epmet.dto.form.DepartmentStaffListFormDTO;
import com.epmet.dto.result.DepartmentResultDTO; import com.epmet.dto.result.DepartmentResultDTO;
import com.epmet.entity.ProjectProcessEntity;
import com.epmet.dto.result.DepartmentStaffListResultDTO; import com.epmet.dto.result.DepartmentStaffListResultDTO;
import com.epmet.entity.ProjectStaffEntity; import com.epmet.entity.ProjectStaffEntity;

11
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -20,21 +20,17 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.ParameterKeyConstant; import com.epmet.constant.ParameterKeyConstant;
import com.epmet.constant.ProjectConstant; import com.epmet.constant.ProjectConstant;
import com.epmet.dao.ProjectDao; import com.epmet.dao.ProjectDao;
import com.epmet.dto.CustomerProjectParameterDTO; import com.epmet.dto.*;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.IssueDTO;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.ProjectStaffDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.entity.ProjectEntity; import com.epmet.entity.ProjectEntity;
@ -437,6 +433,9 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
agencyDeptGridFormDTO.setDeptIdList(deptIdList); agencyDeptGridFormDTO.setDeptIdList(deptIdList);
agencyDeptGridFormDTO.setGridIdList(gridIdList); agencyDeptGridFormDTO.setGridIdList(gridIdList);
Result<AgencyDeptGridResultDTO> resultDTO = govOrgFeignClient.getAgencyDeptGridList(agencyDeptGridFormDTO); Result<AgencyDeptGridResultDTO> resultDTO = govOrgFeignClient.getAgencyDeptGridList(agencyDeptGridFormDTO);
if (!resultDTO.success() || null == resultDTO.getData()) {
throw new RenException(ProjectConstant.SELECT_GOV_ORG_EXCEPTION);
}
AgencyDeptGridResultDTO agencyDeptGrid = resultDTO.getData(); AgencyDeptGridResultDTO agencyDeptGrid = resultDTO.getData();
//2:项目表新增数据 //2:项目表新增数据

22
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectStaffServiceImpl.java

@ -21,11 +21,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; 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.ProjectConstant;
import com.epmet.dao.ProjectStaffDao; import com.epmet.dao.ProjectStaffDao;
import com.epmet.dto.ProjectStaffDTO; import com.epmet.dto.ProjectStaffDTO;
import com.epmet.dto.form.CanTickStaffListFormDTO;
import com.epmet.dto.form.DepartmentStaffListFormDTO; import com.epmet.dto.form.DepartmentStaffListFormDTO;
import com.epmet.dto.result.DepartmentResultDTO; import com.epmet.dto.result.DepartmentResultDTO;
import com.epmet.dto.result.DepartmentStaffListResultDTO; import com.epmet.dto.result.DepartmentStaffListResultDTO;
@ -120,8 +123,23 @@ public class ProjectStaffServiceImpl extends BaseServiceImpl<ProjectStaffDao, Pr
@Override @Override
public DepartmentStaffListResultDTO departmentStaffList(DepartmentStaffListFormDTO formDTO) { public DepartmentStaffListResultDTO departmentStaffList(DepartmentStaffListFormDTO formDTO) {
//1:调用gov-org服务,分别查询组织下人员,组织下部门人员,组织下网格人员列表信息 //1:查询当前工作人员代表的是哪个部门(组织下的、组织部门下的、组织网格下的),用于在人员选择时去掉自己选自己的情况(自己选自己只的是当前工作的部门下的自己)
Result<DepartmentStaffListResultDTO> resultDTOResult = govOrgFeignClient.departmentStaffList(formDTO.getAgencyId()); ProjectStaffEntity entity = baseDao.selectById(formDTO.getProjectStaffId());
if (null == entity) {
throw new RenException(ProjectConstant.SELECT_PROJECTSTAFF_EXCEPTION);
}
//2:调用gov-org服务,分别查询组织下人员,组织下部门人员,组织下网格人员列表信息
CanTickStaffListFormDTO canTick = new CanTickStaffListFormDTO();
canTick.setAgencyId(formDTO.getAgencyId());
canTick.setType("project");
if(null!=entity.getDepartmentId()||!"".equals(entity.getDepartmentId())){
canTick.setDeptOrGridId(entity.getDepartmentId());
}
if(null!=entity.getGridId()||!"".equals(entity.getGridId())){
canTick.setDeptOrGridId(entity.getGridId());
}
canTick.setStaffId(formDTO.getStaffId());
Result<DepartmentStaffListResultDTO> resultDTOResult = govOrgFeignClient.departmentStaffList(canTick);
return resultDTOResult.getData(); return resultDTOResult.getData();
} }

Loading…
Cancel
Save