Browse Source

项目统计修改

master
zhaoqifeng 5 years ago
parent
commit
ae6a7670aa
  1. 3
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/FinishOrgDTO.java
  2. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java
  3. 12
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  4. 9
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml

3
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/FinishOrgDTO.java

@ -13,6 +13,9 @@ import java.io.Serializable;
public class FinishOrgDTO implements Serializable { public class FinishOrgDTO implements Serializable {
private static final long serialVersionUID = -5684606755705833962L; private static final long serialVersionUID = -5684606755705833962L;
private String departmentId;
private String gridId;
private String projectId; private String projectId;
private String orgIdPath; private String orgIdPath;
private String pIdPath; private String pIdPath;

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

@ -88,7 +88,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> { pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> {
FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity();
entity.setId(process.getProjectId()); entity.setId(process.getProjectId());
entity.setProjectStatus("close"); entity.setProjectStatus("closed");
entity.setCreatedTime(DateUtils.stringToDate(pending.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD)); entity.setCreatedTime(DateUtils.stringToDate(pending.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD));
entity.setUpdatedTime(process.getUpdatedTime()); entity.setUpdatedTime(process.getUpdatedTime());
entity.setIsResolved(process.getIsResolved()); entity.setIsResolved(process.getIsResolved());
@ -98,11 +98,18 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
if (!CollectionUtils.isEmpty(finishOrgList)) { if (!CollectionUtils.isEmpty(finishOrgList)) {
closeProjects.forEach(close -> finishOrgList.stream().filter(finish -> close.getId().equals(finish.getProjectId())).forEach(dto -> { closeProjects.forEach(close -> finishOrgList.stream().filter(finish -> close.getId().equals(finish.getProjectId())).forEach(dto -> {
String[] orgIds = dto.getPIdPath().split(StrConstant.COLON); String[] orgIds = dto.getPIdPath().split(StrConstant.COLON);
String org = "";
if (orgIds.length > NumConstant.ONE) { if (orgIds.length > NumConstant.ONE) {
close.setFinishOrgIds(orgIds[orgIds.length - 1]); org = orgIds[orgIds.length - 1];
} else { } else {
close.setFinishOrgIds(orgIds[0]); org = orgIds[0];
} }
if (StringUtils.isNotEmpty(dto.getGridId())) {
org = org + StrConstant.COLON + dto.getGridId();
} else if (StringUtils.isNotEmpty(dto.getDepartmentId())) {
org = org + StrConstant.COLON + dto.getDepartmentId();
}
close.setFinishOrgIds(org);
})); }));
} }
//更新状态 //更新状态
@ -180,7 +187,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
} }
} }
final List<FactOriginProjectMainDailyEntity> mainList = list; final List<FactOriginProjectMainDailyEntity> mainList = list;
//节点发起人 //节点发起人 部门流转退回结案
List<ProcessInfoDTO> processList = projectProcessService.getProcessListByCustomer(customerId, dateString); List<ProcessInfoDTO> processList = projectProcessService.getProcessListByCustomer(customerId, dateString);
if (!CollectionUtils.isEmpty(processList)) { if (!CollectionUtils.isEmpty(processList)) {
List<FactOriginProjectLogDailyEntity> logList = processList.stream().map(process -> { List<FactOriginProjectLogDailyEntity> logList = processList.stream().map(process -> {
@ -230,6 +237,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
return entity; return entity;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
//节点发起人 响应
List<ProcessInfoDTO> responseList = projectProcessService.getResponseProcessList(customerId, dateString); List<ProcessInfoDTO> responseList = projectProcessService.getResponseProcessList(customerId, dateString);
if (!CollectionUtils.isEmpty(responseList)) { if (!CollectionUtils.isEmpty(responseList)) {
logList.addAll(responseList.stream().map(process -> { logList.addAll(responseList.stream().map(process -> {

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

@ -61,7 +61,7 @@
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID
AND da.`LEVEL` = 'community' AND da.`LEVEL` = 'community'
WHERE WHERE
f.PROJECT_STATUS = 'closed' f.PROJECT_STATUS = 'close'
AND f.MONTH_ID = #{monthId} AND f.MONTH_ID = #{monthId}
AND f.CUSTOMER_ID = #{customerId} AND f.CUSTOMER_ID = #{customerId}
GROUP BY GROUP BY
@ -79,7 +79,7 @@
AND da.`LEVEL` = 'community' AND da.`LEVEL` = 'community'
WHERE WHERE
f.IS_OVERDUE = 1 f.IS_OVERDUE = 1
AND f.PROJECT_STATUS = 'closed' AND f.PROJECT_STATUS = 'close'
AND f.MONTH_ID = #{monthId} AND f.MONTH_ID = #{monthId}
AND f.CUSTOMER_ID = #{customerId} AND f.CUSTOMER_ID = #{customerId}
GROUP BY GROUP BY
@ -234,7 +234,7 @@
INNER JOIN dim_agency da ON fm.AGENCY_ID = da.ID INNER JOIN dim_agency da ON fm.AGENCY_ID = da.ID
AND da.`LEVEL` = #{level} AND da.`LEVEL` = #{level}
WHERE WHERE
fm.PROJECT_STATUS = 'closed' fm.PROJECT_STATUS = 'close'
AND fm.CUSTOMER_ID = #{customerId} AND fm.CUSTOMER_ID = #{customerId}
AND fm.MONTH_ID = #{monthId} AND fm.MONTH_ID = #{monthId}
GROUP BY GROUP BY
@ -248,7 +248,7 @@
INNER JOIN dim_agency da ON fm.AGENCY_ID = da.ID INNER JOIN dim_agency da ON fm.AGENCY_ID = da.ID
AND da.`LEVEL` = #{level} AND da.`LEVEL` = #{level}
WHERE WHERE
fm.PROJECT_STATUS = 'closed' fm.PROJECT_STATUS = 'close'
AND fm.CUSTOMER_ID = #{customerId} AND fm.CUSTOMER_ID = #{customerId}
AND fm.MONTH_ID = #{monthId} AND fm.MONTH_ID = #{monthId}
AND fm.IS_RESOLVED = 'resolved' AND fm.IS_RESOLVED = 'resolved'
@ -268,7 +268,7 @@
FROM FROM
fact_origin_project_main_daily fm fact_origin_project_main_daily fm
WHERE WHERE
fm.PROJECT_STATUS = 'closed' fm.PROJECT_STATUS = 'close'
AND fm.CUSTOMER_ID = #{customerId} AND fm.CUSTOMER_ID = #{customerId}
AND fm.MONTH_ID = #{monthId} AND fm.MONTH_ID = #{monthId}
GROUP BY GROUP BY
@ -280,7 +280,7 @@
FROM FROM
fact_origin_project_main_daily fm fact_origin_project_main_daily fm
WHERE WHERE
fm.PROJECT_STATUS = 'closed' fm.PROJECT_STATUS = 'close'
AND fm.CUSTOMER_ID = #{customerId} AND fm.CUSTOMER_ID = #{customerId}
AND fm.MONTH_ID = #{monthId} AND fm.MONTH_ID = #{monthId}
AND fm.IS_RESOLVED = 'resolved' AND fm.IS_RESOLVED = 'resolved'

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

@ -20,7 +20,7 @@
ORDER BY pro.project_id,pro.CREATED_TIME ASC ORDER BY pro.project_id,pro.CREATED_TIME ASC
</select> </select>
<select id="selectProcessListByCustomer" resultType="com.epmet.dto.project.ProcessInfoDTO"> <select id="selectProcessListByCustomer" resultType="com.epmet.dto.project.ProcessInfoDTO">
SELECT SELECT DISTINCT
staff.ORG_ID AS agencyId, staff.ORG_ID AS agencyId,
staff.GRID_ID, staff.GRID_ID,
staff.DEPARTMENT_ID, staff.DEPARTMENT_ID,
@ -30,8 +30,11 @@
pp.STAFF_ID, pp.STAFF_ID,
pp.CREATED_TIME pp.CREATED_TIME
FROM project_process pp FROM project_process pp
INNER JOIN project p ON pp.PROJECT_ID = p.ID AND p.DEL_FLAG = '0' LEFT JOIN project_staff staff ON pp.PROJECT_ID = staff.PROJECT_ID
INNER JOIN project_staff staff ON pp.ID = staff.PROCESS_ID AND staff.DEL_FLAG = '0' AND pp.DEPARTMENT_NAME = staff.DEPARTMENT_NAME
AND staff.IS_HANDLE = 'handle'
AND pp.STAFF_ID = staff.STAFF_ID
AND staff.DEL_FLAG = '0'
WHERE WHERE
pp.DEL_FLAG = '0' pp.DEL_FLAG = '0'
AND AND

Loading…
Cancel
Save