|
@ -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; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|