Browse Source

screenProjectData

dev
wangchao 5 years ago
parent
commit
0997c542be
  1. 24
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectExceedParamsResultDTO.java
  2. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java
  3. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  4. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java
  5. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java
  6. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java
  7. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  8. 63
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  9. 27
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenProjectSettleService.java
  10. 91
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java
  11. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java
  12. 28
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java
  13. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java
  14. 39
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java
  15. 29
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  16. 16
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml
  17. 16
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml
  18. 20
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml

24
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectExceedParamsResultDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.project.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 客户项目超期相关参数
* @ClassName ProjectExceedParamsResultDTO
* @Auth wangc
* @Date 2021-03-05 17:02
*/
@Data
public class ProjectExceedParamsResultDTO implements Serializable {
private static final long serialVersionUID = 7621539816482416776L;
private Integer defaultExceedLimit;
private Integer defaultAbout2ExceedLimit;
private Integer exceedLimit;
private Integer about2ExceedLimit;
}

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java

@ -169,4 +169,6 @@ public class ScreenProjectDataDTO implements Serializable {
*/
private String allParentIds;
private String topicId;
}

16
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java

@ -24,6 +24,7 @@ import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.TransferRightRatioResultDTO;
import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO;
import com.epmet.dto.pingyin.result.*;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
@ -273,4 +274,19 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* @date 2021/2/1 上午9:25
*/
List<ClosedIncrResultDTO> selectClosedIncr(@Param("customerId")String customerId, @Param("monthId")String monthId);
/**
* @Description 初始化screen_project_data数据
* 如果是dateId不为空则查询前一天的数据
* 否则全查适用于首次初始化的场景
*
* 这是只查询指定天新增的项目对于需要更新状态的项目对历史数据流转中的项目进行遍历查询
* @param customerId
* @param dateId
* @return java.util.List<com.epmet.dto.screen.ScreenProjectDataDTO>
* @author wangc
* @date 2021.03.04 22:56
*/
List<ScreenProjectDataDTO> initNewScreenProjectData(@Param("customerId")String customerId,@Param("dateId") String dateId);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java

@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.form.CostDayFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -83,4 +84,13 @@ public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao<FactOriginPr
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectDeptHandle(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @Description
* @param list
* @return java.util.List<com.epmet.dto.form.CostDayFormDTO>
* @author wangc
* @date 2021.03.05 15:12
*/
List<CostDayFormDTO> selectProjectNodeStartStopTime(@Param("list")List<String> list);
}

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java

@ -18,7 +18,8 @@
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO;
import com.epmet.dto.project.result.ProjectExceedParamsResultDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -36,4 +37,7 @@ public interface ScreenProjectDataDao extends BaseDao<ScreenProjectDataEntity> {
int deleteByDateIdAndCustomerId(@Param("customerId") String customerId,@Param("dateId") String dateId);
int checkIfExisted(@Param("customerId") String customerId);
List<ScreenProjectDataDTO> selectPending(ScreenProjectDataDTO param);
}

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.project.ProjectAgencyDTO;
import com.epmet.dto.project.ProjectGridDTO;
import com.epmet.dto.project.result.ProjectExceedParamsResultDTO;
import com.epmet.entity.project.ProjectEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -103,5 +104,22 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
*/
String selectParameterValueByKey(@Param("customerId") String customerId);
/**
* @Description 查找客户项目超期参数
*
* @param customerId
* @return java.util.List<com.epmet.dto.project.result.ProjectExceedParamsResultDTO>
* @author wangc
* @date 2021.03.05 17:52
*/
List<ProjectExceedParamsResultDTO> selectProjectExceedParams(@Param("customerId") String customerId);
/**
* @Description 批量查询项目信息
* @param ids
* @return java.util.List<com.epmet.entity.project.ProjectEntity>
* @author wangc
* @date 2021.03.08 10:32
*/
List<ProjectEntity> batchSelectProjectInfo(@Param("ids")List<String> ids);
}

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java

@ -25,6 +25,7 @@ import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.TransferRightRatioResultDTO;
import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO;
import com.epmet.dto.pingyin.result.*;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
@ -319,4 +320,20 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
* @date 2021/2/1 上午9:24
*/
List<ClosedIncrResultDTO> selectClosedIncr(String customerId, String monthId);
/**
* @Description 初始化screen_project_data数据
* 如果是dateId不为空则查询前一天的数据
* 否则全查适用于首次初始化的场景
*
* 这是只查询指定天新增的项目对于需要更新状态的项目对历史数据流转中的项目进行遍历查询
* @param customerId
* @param dateId
* @param exceedLimit 超期上线
* @param about2exceedLimit 即将超期参数
* @return java.util.List<com.epmet.dto.screen.ScreenProjectDataDTO>
* @author wangc
* @date 2021.03.04 22:56
*/
List<ScreenProjectDataDTO> initNewScreenProjectData(String customerId,String dateId,Integer exceedLimit,Integer about2exceedLimit);
}

63
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java

@ -25,27 +25,33 @@ import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectMainDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.extract.FactOriginProjectMainDailyDTO;
import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.TransferRightRatioResultDTO;
import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO;
import com.epmet.dto.pingyin.result.*;
import com.epmet.dto.result.CostDayResultDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collector;
import java.util.stream.Collectors;
/**
* 项目主表_日统计
@ -57,6 +63,10 @@ import java.util.Map;
@DataSource(DataSourceConstant.STATS)
public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactOriginProjectMainDailyDao, FactOriginProjectMainDailyEntity> implements FactOriginProjectMainDailyService {
@Autowired
private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient;
@Autowired
private FactOriginProjectOrgPeriodDailyDao periodDao;
@Override
public PageData<FactOriginProjectMainDailyDTO> page(Map<String, Object> params) {
IPage<FactOriginProjectMainDailyEntity> page = baseDao.selectPage(
@ -358,4 +368,49 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
}
return new ArrayList<>();
}
/**
* @Description 初始化screen_project_data数据
* 如果是dateId不为空则查询前一天的数据
* 否则全查适用于首次初始化的场景
*
* 这是只查询指定天新增的项目对于需要更新状态的项目对历史数据流转中的项目进行遍历查询
* @param customerId
* @param dateId
* @param exceedLimit 超期上线
* @param about2exceedLimit 即将超期参数
* @return java.util.List<com.epmet.dto.screen.ScreenProjectDataDTO>
* @author wangc
* @date 2021.03.04 22:56
*/
@Override
public List<ScreenProjectDataDTO> initNewScreenProjectData(String customerId, String dateId,Integer exceedLimit,Integer about2exceedLimit) {
boolean ifYesterday = true;
if(!StringUtils.equals(DateUtils.getBeforeNDay(NumConstant.ONE).substring(0,8),dateId)){
ifYesterday = false;
}
List<ScreenProjectDataDTO> projects = baseDao.initNewScreenProjectData(customerId, dateId);
//如果不是昨天立项
if(!CollectionUtils.isEmpty(projects) && !ifYesterday){
Result<List<CostDayResultDTO>> costDays = epmetCommonServiceOpenFeignClient.costWorkDays(periodDao.selectProjectNodeStartStopTime(projects.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList())));
if(null != costDays && !CollectionUtils.isEmpty(costDays.getData())){
Map<String,List<CostDayResultDTO>> projectPeriodMap
= costDays.getData().stream().collect(Collectors.groupingBy(CostDayResultDTO :: getId));
projects.stream().map(o -> {
List<CostDayResultDTO> days = projectPeriodMap.get(o.getProjectId());
if(!CollectionUtils.isEmpty(days)){
Integer max = days.stream().max(Comparator.comparing(CostDayResultDTO::getDetentionDays)).get().getDetentionDays();
//事件级别 红色1级:已超期;黄色2级:即将超期;绿色3级:未超期
if(max > exceedLimit)
o.setProjectLevel(NumConstant.ONE);
else if(max >= about2exceedLimit)
o.setProjectLevel(NumConstant.TWO);
}
return null;
});
}
}
return projects;
}
}

27
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenProjectSettleService.java

@ -0,0 +1,27 @@
package com.epmet.service.evaluationindex.extract.toscreen;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
/**
* @Description
* screen_project_data
* screen_project_process_attachment
* screen_project_img_data
* screen_project_process这四个表定时整理数据
* @author wangc
* @date 2021.03.04 13:38
*/
public interface ScreenProjectSettleService {
/**
* @Description 抽取项目数据到screen_project_*
* @param param
* @return void
* @author wangc
* @date 2021.03.04 23:09
*/
void extractScreenData(ScreenCentralZoneDataFormDTO param);
}

91
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java

@ -0,0 +1,91 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.dto.project.result.ProjectExceedParamsResultDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.entity.project.ProjectEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenProjectSettleService;
import com.epmet.service.evaluationindex.screen.ScreenProjectDataService;
import com.epmet.service.project.ProjectProcessService;
import com.epmet.service.project.ProjectService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.stream.Collector;
import java.util.stream.Collectors;
/**
* @Description
* @ClassName ScreenProjectSettleServiceImpl
* @Auth wangc
* @Date 2021-03-04 23:10
*/
public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleService {
@Autowired
private ScreenProjectDataService targetDbService;
@Autowired
private FactOriginProjectMainDailyService originMainService;
@Autowired
private ProjectService projectService;
@Autowired
private ProjectProcessService processService;
/**
* @Description 抽取项目数据到screen_project_*
* @param param
* @return void
* @author wangc
* @date 2021.03.04 23:09
*/
@Override
@Transactional
public void extractScreenData(ScreenCentralZoneDataFormDTO param) {
int rows = targetDbService.checkIfExisted(param.getCustomerId());
List<ProjectExceedParamsResultDTO> exceedParams = projectService.getProjectExceedParams(param.getCustomerId());
Integer exceedLimit = NumConstant.FIVE;
Integer about2ExceedLimit = NumConstant.FIVE;
if(!CollectionUtils.isEmpty(exceedParams)){
for(ProjectExceedParamsResultDTO ex :exceedParams){
if(null != ex.getDefaultExceedLimit()){
exceedLimit = null == ex.getExceedLimit() ? ex.getDefaultExceedLimit() : ex.getExceedLimit();
}
if(null != ex.getDefaultAbout2ExceedLimit()){
about2ExceedLimit = null == ex.getAbout2ExceedLimit() ? ex.getDefaultAbout2ExceedLimit() : ex.getDefaultAbout2ExceedLimit();
}
}
}
List<ScreenProjectDataDTO> metaData =
originMainService.initNewScreenProjectData(param.getCustomerId(), param.getDateId(),exceedLimit,about2ExceedLimit);
if(!CollectionUtils.isEmpty(metaData)) {
List<ProjectEntity> info = projectService.getProjectInfo(metaData.stream().map(ScreenProjectDataDTO::getProjectId).collect(Collectors.toList()));
if(!CollectionUtils.isEmpty(info)){
metaData.stream().flatMap(meta -> info.stream().filter(nature -> StringUtils.equals(meta.getProjectId(),
nature.getId())).map(projectInfo -> {
meta.setProjectCreateTime(projectInfo.getCreatedTime());
meta.setProjectTitle(projectInfo.getTitle());
return null;
}));
}
}
ScreenProjectDataDTO orientCase = new ScreenProjectDataDTO();
orientCase.setCustomerId(param.getCustomerId());
//待更新的数据 需要检测更新的字段为:①projectStatusCode ②closeCaseTime ③allCategoryName ④projectLevel
List<ScreenProjectDataDTO> orientData =
targetDbService.getPending(orientCase);
}
}

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java

@ -96,4 +96,22 @@ public interface ScreenProjectDataService extends BaseService<ScreenProjectDataE
void delete(String[] ids);
void collect(String customerId, ScreenCollFormDTO<ScreenProjectDataInfoFormDTO> param);
/**
* @Description 查询是否存在客户的数据
* @param customerId
* @return int
* @author wangc
* @date 2021.03.04 23:35
*/
int checkIfExisted(String customerId);
/**
* @Description 获取客户下已经入库而且未结案的数据集
* @param
* @return
* @author wangc
* @date 2021.03.08 09:32
*/
List<ScreenProjectDataDTO> getPending(ScreenProjectDataDTO param);
}

28
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java

@ -21,7 +21,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
@ -32,10 +31,8 @@ import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.evaluationindex.screen.*;
import com.epmet.service.evaluationindex.screen.*;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -222,4 +219,29 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectD
});
}
/**
* @Description 查询是否存在客户的数据
* @param customerId
* @return int
* @author wangc
* @date 2021.03.04 23:35
*/
@Override
public int checkIfExisted(String customerId) {
return baseDao.checkIfExisted(customerId);
}
/**
* @Description 获取客户下已经入库而且未结案的数据集
* @param
* @return j
* @author wangc
* @date 2021.03.08 09:32
*/
@Override
public List<ScreenProjectDataDTO> getPending(ScreenProjectDataDTO param) {
return baseDao.selectPending(param);
}
}

31
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java

@ -22,9 +22,12 @@ import com.epmet.dto.ProjectDTO;
import com.epmet.dto.project.ProjectAgencyDTO;
import com.epmet.dto.project.ProjectGridDTO;
import com.epmet.dto.project.ProjectInfoDTO;
import com.epmet.dto.project.result.ProjectExceedParamsResultDTO;
import com.epmet.entity.project.ProjectEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 项目表
@ -109,4 +112,32 @@ public interface ProjectService extends BaseService<ProjectEntity> {
* @date 2020.11.06 14:14
*/
Integer getOvertimeProjectByParameter(String customerId);
/**
* @Description 查找客户项目超期参数
*
* @param customerId
* @return java.util.List<com.epmet.dto.project.result.ProjectExceedParamsResultDTO>
* @author wangc
* @date 2021.03.05 17:52
*/
List<ProjectExceedParamsResultDTO> getProjectExceedParams(@Param("customerId") String customerId);
/**
* @Description 获取项目相关信息
* @param projectIds
* @return java.util.List<com.epmet.entity.project.ProjectEntity>
* @author wangc
* @date 2021.03.08 10:28
*/
List<ProjectEntity> getProjectInfo(List<String> projectIds);
/**
* @Description 获取项目的所有标签名称 -连接
* @param projectIds
* @return java.util.Map<java.lang.String,java.lang.String>
* @author wangc
* @date 2021.03.08 10:28
*/
Map<String,String> getProjectCategory(List<String> projectIds);
}

39
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java

@ -25,12 +25,14 @@ import com.epmet.dao.project.ProjectDao;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.project.ProjectAgencyDTO;
import com.epmet.dto.project.ProjectGridDTO;
import com.epmet.dto.project.result.ProjectExceedParamsResultDTO;
import com.epmet.entity.project.ProjectEntity;
import com.epmet.service.project.ProjectService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* 项目表
@ -97,4 +99,41 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
return StringUtils.isBlank(parameter) ? NumConstant.FIVE : Integer.parseInt(parameter);
}
/**
* @Description 查找客户项目超期参数
*
* @param customerId
* @return java.util.List<com.epmet.dto.project.result.ProjectExceedParamsResultDTO>
* @author wangc
* @date 2021.03.05 17:52
*/
@Override
public List<ProjectExceedParamsResultDTO> getProjectExceedParams(String customerId) {
return baseDao.selectProjectExceedParams(customerId);
}
/**
* @Description 获取项目相关信息
* @param projectIds
* @return java.util.List<com.epmet.entity.project.ProjectEntity>
* @author wangc
* @date 2021.03.08 10:28
*/
@Override
public List<ProjectEntity> getProjectInfo(List<String> projectIds) {
return baseDao.batchSelectProjectInfo(projectIds);
}
/**
* @Description 获取项目的所有标签名称 -连接
* @param projectIds
* @return java.util.Map<java.lang.String,java.lang.String>
* @author wangc
* @date 2021.03.08 10:28
*/
@Override
public Map<String, String> getProjectCategory(List<String> projectIds) {
return null;
}
}

29
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -534,4 +534,33 @@
AND PROJECT_STATUS = 'closed'
GROUP BY GRID_ID
</select>
<!-- 查询指定日期立项的项目 -->
<select id="initNewScreenProjectData" resultType="com.epmet.dto.screen.ScreenProjectDataDTO">
SELECT
data.CUSTOMER_ID,
'grid' as orgType,
data.GRID_ID as orgId,
data.AGENCY_ID as parentId,
agency.AGENCY_NAME as orgName,
data.ID as projectId,
data.TOPIC_CREATOR_ID as linkMan,
IF(data.PROJECT_STATUS = 'closed','closed_case',data.PROJECT_STATUS) as projectStatusCode,
3 as projectLevel,
IF(data.PIDS IS NULL || TRIM(data.PIDS) = '',data.AGENCY_ID,CONCAT(REPLACE(data.PIDS,':',','),',',data.AGENCY_ID)) as allParentIds,
data.TOPIC_ID
FROM `fact_origin_project_main_daily` data
LEFT JOIN DIM_AGENCY agency on data.agency_id = agency.id
WHERE
data.DEL_FLAG = '0'
AND
data.CUSTOMER_ID = #{customerId}
<if test='null != dateId and "" != dateId'>
AND data.DATE_ID = #{dateId}
</if>
</select>
</mapper>

16
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml

@ -140,4 +140,20 @@
GROUP BY
fp.ORG_ID
</select>
<select id="selectProjectNodeStartStopTime" resultType="com.epmet.dto.form.CostDayFormDTO">
SELECT
PROJECT_ID AS id,
INFORMED_DATE AS startDate,
IFNULL( HANDLED_DATE, NOW( ) ) AS endDate
FROM
`fact_origin_project_org_period_daily`
WHERE
DEL_FLAG = '0'
<foreach collection="list" item="projectId" open="AND (" separator=" or " close=" )">
PROJECT_ID = #{projectId}
</foreach>
</select>
</mapper>

16
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml

@ -40,4 +40,20 @@
limit 1000
</delete>
<select id="checkIfExisted" resultType="int">
select count(id) from screen_project_data
where del_flag = '0' and customer_id = #{customerId}
</select>
<select id="selectPending" parameterType="com.epmet.dto.screen.ScreenProjectDataDTO"
resultType="com.epmet.dto.screen.ScreenProjectDataDTO" >
select *
from screen_project_data
where del_flag = '0'
and customerId = #{customerId}
and project_status_code = 'pending'
<if test='null != projectLevel and "" != projectLevel'>
and project_level = #{projectLevel}
</if>
</select>
</mapper>

20
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml

@ -105,5 +105,25 @@
and CUSTOMER_ID = #{customerId}
and PARAMETER_KEY ='detention_days'
</select>
<select id="selectProjectExceedParams" resultType="com.epmet.dto.project.result.ProjectExceedParamsResultDTO">
select
IF(customer_id = 'default' <![CDATA[&&]]> PARAMETER_KEY = 'detention_days',PARAMETER_VALUE,null) as defaultExceedLimit,
IF(customer_id = 'default' <![CDATA[&&]]> PARAMETER_KEY = 'remind_time',PARAMETER_VALUE,null) as defaultAbout2ExceedLimit,
IF(customer_id = #{customerId} <![CDATA[&&]]> PARAMETER_KEY = 'detention_days',PARAMETER_VALUE,null) as exceedLimit,
IF(customer_id = #{customerId} <![CDATA[&&]]> PARAMETER_KEY = 'remind_time',PARAMETER_VALUE,null) as about2ExceedLimit
from `customer_project_parameter` where del_flag = '0' and (customer_id = 'default' or customer_id = #{customerId}
)and (PARAMETER_KEY = 'detention_days' OR PARAMETER_KEY = 'remind_time')
</select>
<select id="batchSelectProjectInfo" resultType="com.epmet.entity.project.ProjectEntity">
select * from project
where del_flag = '0'
<if test="null != ids and ids.size() > 0">
<foreach collection="ids" item="id" open=" AND (" separator=" OR " close=" )">
id = #{id}
</foreach>
</if>
</select>
</mapper>
Loading…
Cancel
Save