Browse Source

项目统计

dev_shibei_match
zhaoqifeng 5 years ago
parent
commit
ed8018a07c
  1. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProcessInfoDTO.java
  2. 70
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectExtractServiceImpl.java
  3. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProcessInfoDTO.java

@ -14,6 +14,8 @@ import java.util.Date;
public class ProcessInfoDTO implements Serializable {
private static final long serialVersionUID = 4586424046147127143L;
private String agencyId;
private String departmentId;
private String gridId;
private String projectId;
/**
* 处理结案close退回return部门流转transfer创建项目created

70
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectExtractServiceImpl.java

@ -24,6 +24,7 @@ import com.epmet.service.project.ProjectProcessService;
import com.epmet.service.project.ProjectService;
import com.epmet.service.topic.TopicService;
import com.epmet.util.DimIdGenerator;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -68,18 +69,20 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
//获取已关闭项目列表
List<ProjectProcessEntity> closedList = projectProcessService.getClosedProjectList(customerId, dateString);
List<FactOriginProjectMainDailyDTO> pendingList = factOriginProjectMainDailyService.getPendingList(customerId);
List<FactOriginProjectMainDailyEntity> closeProjects =
pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> {
FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity();
entity.setId(process.getId());
entity.setProjectStatus("close");
entity.setCreatedTime(DateUtils.stringToDate(pending.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD));
entity.setUpdatedTime(process.getUpdatedTime());
return entity;
})).collect(Collectors.toList());
//更新状态
if (null != closeProjects && !closeProjects.isEmpty()) {
factOriginProjectMainDailyService.updateBatchById(closeProjects);
if (null != closedList && !closedList.isEmpty()) {
List<FactOriginProjectMainDailyEntity> closeProjects =
pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> {
FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity();
entity.setId(process.getId());
entity.setProjectStatus("close");
entity.setCreatedTime(DateUtils.stringToDate(pending.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD));
entity.setUpdatedTime(process.getUpdatedTime());
return entity;
})).collect(Collectors.toList());
//更新状态
if (!closeProjects.isEmpty()) {
factOriginProjectMainDailyService.updateBatchById(closeProjects);
}
}
//获取项目信息
List<ProjectDTO> projectList = projectService.getProjectInfo(customerId, dateString);
@ -133,7 +136,9 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
entity.setIsParty(NumConstant.ONE_STR);
}));
//插入数据
factOriginProjectMainDailyService.insertBatch(list);
if (!list.isEmpty()) {
factOriginProjectMainDailyService.insertBatch(list);
}
}
//节点发起人
@ -157,9 +162,9 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
return entity;
}).collect(Collectors.toList());
//节点接收
List<ProcessInfoDTO> processStaffList = projectProcessService.getProcessStaffByCustomer(customerId, dateString);
logList.addAll(processStaffList.stream().map(process -> {
//项目评论
List<ProcessInfoDTO> satisfactionRecordList = projectProcessService.getSatisfactionRecord(customerId, dateString);
logList.addAll(satisfactionRecordList.stream().map(process -> {
//获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime());
FactOriginProjectLogDailyEntity entity = new FactOriginProjectLogDailyEntity();
@ -172,14 +177,19 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
entity.setProjectId(process.getProjectId());
entity.setOperationUserId(process.getStaffId());
entity.setActionCode(process.getOperation());
entity.setIsActive(NumConstant.ZERO);
entity.setIsActive(NumConstant.ONE);
entity.setOrgType("grid");
return entity;
}).collect(Collectors.toList()));
//项目评论人
List<ProcessInfoDTO> satisfactionRecordList = projectProcessService.getSatisfactionRecord(customerId, dateString);
logList.addAll(satisfactionRecordList.stream().map(process -> {
List<FactOriginProjectMainDailyDTO> projectMainList = factOriginProjectMainDailyService.getProjectByCustomer(customerId);
logList.forEach(log -> projectMainList.stream().filter(project -> log.getProjectId().equals(project.getId())).forEach(main -> {
log.setOrgId(main.getGridId());
}));
//节点接收人
List<ProcessInfoDTO> processStaffList = projectProcessService.getProcessStaffByCustomer(customerId, dateString);
logList.addAll(processStaffList.stream().map(process -> {
//获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime());
FactOriginProjectLogDailyEntity entity = new FactOriginProjectLogDailyEntity();
@ -192,17 +202,21 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
entity.setProjectId(process.getProjectId());
entity.setOperationUserId(process.getStaffId());
entity.setActionCode(process.getOperation());
entity.setIsActive(NumConstant.ONE);
entity.setOrgType("grid");
entity.setIsActive(NumConstant.ZERO);
if (StringUtils.isNotBlank(process.getDepartmentId())) {
entity.setOrgType("department");
entity.setOrgId(process.getDepartmentId());
}
if (StringUtils.isNotBlank(process.getGridId())) {
entity.setOrgType("grid");
entity.setOrgId(process.getGridId());
}
return entity;
}).collect(Collectors.toList()));
List<FactOriginProjectMainDailyDTO> projectMainList = factOriginProjectMainDailyService.getProjectByCustomer(customerId);
logList.forEach(log -> projectMainList.stream().filter(project -> log.getProjectId().equals(project.getId())).forEach(main -> {
log.setOrgId(main.getGridId());
}));
factOriginProjectLogDailyService.insertBatch(logList);
if (!logList.isEmpty()) {
factOriginProjectLogDailyService.insertBatch(logList);
}
}
}

4
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml

@ -35,7 +35,9 @@
</select>
<select id="selectProcessStaffByCustomer" resultType="com.epmet.dto.project.ProcessInfoDTO">
SELECT
p.AGENCY_ID,
ps.ORG_ID AS "agencyId",
ps.DEPARTMENT_ID,
ps.GRID_ID,
pp.PROJECT_ID,
pp.OPERATION,
ps.STAFF_ID,

Loading…
Cancel
Save