|
|
@ -35,15 +35,19 @@ import com.epmet.commons.tools.utils.ScanContentUtils; |
|
|
|
import com.epmet.constant.ProjectConstant; |
|
|
|
import com.epmet.constant.ReadFlagConstant; |
|
|
|
import com.epmet.constant.UserMessageConstant; |
|
|
|
import com.epmet.dao.ProjectDao; |
|
|
|
import com.epmet.dao.ProjectProcessDao; |
|
|
|
import com.epmet.dao.ProjectStaffDao; |
|
|
|
import com.epmet.dto.ProjectDTO; |
|
|
|
import com.epmet.dto.ProjectProcessDTO; |
|
|
|
import com.epmet.dto.ProjectStaffDTO; |
|
|
|
import com.epmet.dto.form.*; |
|
|
|
import com.epmet.dto.result.*; |
|
|
|
import com.epmet.entity.ProjectEntity; |
|
|
|
import com.epmet.entity.ProjectProcessEntity; |
|
|
|
import com.epmet.entity.ProjectStaffEntity; |
|
|
|
import com.epmet.feign.EpmetUserFeignClient; |
|
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
|
import com.epmet.feign.GovOrgFeignClient; |
|
|
|
import com.epmet.redis.ProjectProcessRedis; |
|
|
|
import com.epmet.service.ProjectProcessService; |
|
|
@ -87,6 +91,10 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao |
|
|
|
private String scanApiUrl; |
|
|
|
@Value("${openapi.scan.method.textSyncScan}") |
|
|
|
private String textSyncScanMethod; |
|
|
|
@Autowired |
|
|
|
private ProjectDao projectDao; |
|
|
|
@Autowired |
|
|
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<ProjectProcessDTO> page(Map<String, Object> params) { |
|
|
@ -340,4 +348,58 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 查询项目进展和当前处理部门 |
|
|
|
* @Param formDTO |
|
|
|
* @author zxc |
|
|
|
* @date 2020/10/26 9:41 上午 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public ProcessAndCurrentDeptResultDTO progressAndCurrentDept(ProcessListFormDTO formDTO) { |
|
|
|
ProcessAndCurrentDeptResultDTO result = new ProcessAndCurrentDeptResultDTO(); |
|
|
|
result.setProcessList(progressList(formDTO)); |
|
|
|
//获取当前跟进部门
|
|
|
|
List<String> departments = new ArrayList<>(); |
|
|
|
List<ProjectStaffDTO> departmentNameList = new ArrayList<>(); |
|
|
|
List<ProjectDetailResultDTO.DepartmentNameListBean> departmentList = new ArrayList<>(); |
|
|
|
ProjectDetailResultDTO projectDetailResultDTO = projectDao.selectProjectDetail(formDTO.getProjectId()); |
|
|
|
if (ProjectConstant.CLOSED.equals(projectDetailResultDTO.getProjectStatus())) { |
|
|
|
//项目已结案,跟进部门为空
|
|
|
|
result.setDepartmentList(departmentList); |
|
|
|
result.setDepartmentNameList(departments); |
|
|
|
} else { |
|
|
|
//项目未结案,找出所有跟进部门
|
|
|
|
ProjectDTO projectDTO = new ProjectDTO(); |
|
|
|
projectDTO.setId(formDTO.getProjectId()); |
|
|
|
departmentNameList = projectDao.selectCurrentDepartmentList(projectDTO); |
|
|
|
//提取工作人员ID
|
|
|
|
List<String> staffIdList = departmentNameList.stream().map(ProjectStaffDTO::getStaffId).collect(Collectors.toList()); |
|
|
|
staffIdList = staffIdList.stream().distinct().collect(Collectors.toList()); |
|
|
|
//根据部门分组
|
|
|
|
Map<String, List<ProjectStaffDTO>> departmentMap = |
|
|
|
departmentNameList.stream().collect(Collectors.groupingBy(ProjectStaffDTO::getDepartmentName)); |
|
|
|
//获取工作人员信息(姓名)
|
|
|
|
UserIdsFormDTO userIdsFormDTO = new UserIdsFormDTO(); |
|
|
|
userIdsFormDTO.setUserIds(staffIdList); |
|
|
|
Result<List<StaffSinGridResultDTO>> staffListResult = epmetUserOpenFeignClient.getStaffInfoList(userIdsFormDTO); |
|
|
|
if (!staffListResult.success()) { |
|
|
|
throw new RenException(staffListResult.getCode(), staffListResult.getMsg()); |
|
|
|
} |
|
|
|
List<StaffSinGridResultDTO> staffList = staffListResult.getData(); |
|
|
|
for (String departmentName : departmentMap.keySet()) { |
|
|
|
ProjectDetailResultDTO.DepartmentNameListBean bean = new ProjectDetailResultDTO.DepartmentNameListBean(); |
|
|
|
bean.setDepartmentName(departmentName); |
|
|
|
List<ProjectStaffDTO> staffDTOList = departmentMap.get(departmentName); |
|
|
|
List<String> staffNameList = |
|
|
|
staffDTOList.stream().flatMap(staffDto -> staffList.stream().filter(staffInfo -> |
|
|
|
staffDto.getStaffId().equals(staffInfo.getStaffId())).map((StaffSinGridResultDTO::getStaffName))).collect(Collectors.toList()); |
|
|
|
bean.setStaffList(staffNameList); |
|
|
|
departmentList.add(bean); |
|
|
|
departments.add(departmentName); |
|
|
|
} |
|
|
|
result.setDepartmentList(departmentList); |
|
|
|
result.setDepartmentNameList(departments); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |