Browse Source

Merge branch 'dev_project_real_time_statistics' into dev_temp

master
zhaoqifeng 4 years ago
parent
commit
843dfe4b6f
  1. 4
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ProjectChangedMQMsg.java
  2. 7
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java
  3. 8
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java
  4. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java
  5. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
  6. 18
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml
  7. 6
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java
  8. 8
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java
  9. 14
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  10. 9
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java

4
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ProjectChangedMQMsg.java

@ -14,4 +14,8 @@ import java.io.Serializable;
public class ProjectChangedMQMsg implements Serializable {
private String customerId;
/**
* 操作类型 议题转项目issue_shift_project, 处理response, 结案close退回return部门流转transfer立项created
*/
private String operation;
}

7
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java

@ -22,6 +22,7 @@ public class ScreenProjectDistributionFormDTO implements Serializable {
/**
* 如果为空返回全部可选值1:红色事件2黄色事件3绿色事件
*/
@NotBlank(message = "level不能为空")
private String level;
/**
@ -31,9 +32,9 @@ public class ScreenProjectDistributionFormDTO implements Serializable {
private String agencyId;
/**
/* *//**
* 不必填默认查询的是处理中可选值all: 全部pending处理中 已结案closed_case 已关闭closed
* 默认查询pending
*/
private String status;
*//*
private String status;*/
}

8
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java

@ -1,8 +1,10 @@
package com.epmet.evaluationindex.screen.dto.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @description:
@ -29,4 +31,10 @@ public class ScreenProjectDistributionResultDTO implements Serializable {
*/
private String longitude;
private String latitude;
private String customerId;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date projectCreateTime;
}

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java

@ -12,8 +12,7 @@ public interface ScreenProjectDataDao {
List<ScreenProjectDistributionResultDTO> projectDistribution(@Param("agencyId") String agencyId,
@Param("ids") List<String> ids,
@Param("level") String level,
@Param("status")String status);
@Param("level") String level);
List<String> selectIdsByAreaCode(@Param("areaCode") String areaCode);

8
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java

@ -70,14 +70,14 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
@Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
public Result projectDistribution(ScreenProjectDistributionFormDTO formDTO) {
if(StringUtils.isBlank(formDTO.getStatus())){
formDTO.setStatus("pending");
}
// 1:红色:为刚提交未做任何响应处理未结案的项目;
// 2:黄色: 至少做过一次响应处理答复但未结案的项目;
// 3:绿色:已经结案的项目。
List<String> areaIds = null;
if (StringUtils.isNotBlank(formDTO.getAreaCode())){
areaIds = screenProjectDataDao.selectIdsByAreaCode(formDTO.getAreaCode());
}
List<ScreenProjectDistributionResultDTO> resultDTOS = screenProjectDataDao.projectDistribution(formDTO.getAgencyId(),areaIds,formDTO.getLevel(),formDTO.getStatus());
List<ScreenProjectDistributionResultDTO> resultDTOS = screenProjectDataDao.projectDistribution(formDTO.getAgencyId(),areaIds,formDTO.getLevel());
return new Result().ok(resultDTOS);
}

18
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml

@ -10,7 +10,9 @@
project_level AS level,
project_id AS id,
longitude AS longitude,
latitude AS latitude
latitude AS latitude,
PROJECT_CREATE_TIME AS projectCreateTime,
CUSTOMER_ID AS customerId
FROM
screen_project_data
WHERE
@ -27,13 +29,23 @@
<if test="ids == null and agencyId != null">
and org_id = #{agencyId}
</if>
<choose>
<when test='"all" == status'>
<when test='level != null and "1" == level'>
and PROJECT_STATUS_CODE ='pending'
</when>
<when test='level != null and "2" == level'>
and PROJECT_STATUS_CODE ='pending'
</when>
<when test='level != null and "3" == level'>
and PROJECT_STATUS_CODE !='pending'
and DATE_SUB(CURDATE(), INTERVAL 30 DAY) &lt;= date(PROJECT_CREATE_TIME)
</when>
<otherwise>
and PROJECT_STATUS_CODE=#{status}
and PROJECT_STATUS_CODE ='pending'
</otherwise>
</choose>
order by PROJECT_CREATE_TIME desc
</select>
<select id="selectIdsByAreaCode" resultType="java.lang.String">
select agency_id as id from screen_customer_agency where del_flag = '0' and area_code like concat(#{areaCode},'%')

6
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java

@ -31,6 +31,12 @@ public interface ProjectConstant {
*/
String UNRESOLVED = "unresolved";
/**
* 处理-退回
*/
String OPERATION_ISSUE_SHIFT_PROJECT = "issue_shift_project";
/**
* 处理-结案
*/

8
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java

@ -389,7 +389,7 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao
}
//项目实时统计消息
ProjectChangedMQMsg msg = new ProjectChangedMQMsg(staffEntity.getCustomerId());
ProjectChangedMQMsg msg = new ProjectChangedMQMsg(staffEntity.getCustomerId(), ProjectConstant.OPERATION_TRANSFER);
boolean msgResult = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendProjectChangedMqMsg(msg);
if (!msgResult) {
log.error("项目实时统计消息发送失败");
@ -743,7 +743,7 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao
}
//项目实时统计消息
ProjectChangedMQMsg msg = new ProjectChangedMQMsg(staffEntity.getCustomerId());
ProjectChangedMQMsg msg = new ProjectChangedMQMsg(staffEntity.getCustomerId(), ProjectConstant.OPERATION_TRANSFER);
boolean msgResult = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendProjectChangedMqMsg(msg);
if (!msgResult) {
log.error("项目实时统计消息发送失败");
@ -759,7 +759,9 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao
@Override
public List<String> selectPlatFormIds(String projectId) {
List<String> platFormIds = baseDao.selectPlatFormIds(projectId);
if (CollectionUtils.isEmpty(platFormIds))return new ArrayList<>();
if (CollectionUtils.isEmpty(platFormIds)) {
return new ArrayList<>();
}
return platFormIds;
}

14
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -547,7 +547,7 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
}
//项目实时统计消息
ProjectChangedMQMsg msg = new ProjectChangedMQMsg(projectEntity.getCustomerId());
ProjectChangedMQMsg msg = new ProjectChangedMQMsg(projectEntity.getCustomerId(), ProjectConstant.OPERATION_CLOSE);
boolean msgResult = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendProjectChangedMqMsg(msg);
if (!msgResult) {
log.error("项目实时统计消息发送失败");
@ -707,7 +707,7 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
}
//项目实时统计消息
ProjectChangedMQMsg msg = new ProjectChangedMQMsg(projectEntity.getCustomerId());
ProjectChangedMQMsg msg = new ProjectChangedMQMsg(projectEntity.getCustomerId(), ProjectConstant.OPERATION_CLOSE);
boolean msgResult = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendProjectChangedMqMsg(msg);
if (!msgResult) {
log.error("项目实时统计消息发送失败");
@ -860,7 +860,7 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
}
//项目实时统计消息
ProjectChangedMQMsg mqMsg = new ProjectChangedMQMsg(projectStaff.getCustomerId());
ProjectChangedMQMsg mqMsg = new ProjectChangedMQMsg(projectStaff.getCustomerId(), ProjectConstant.OPERATION_RETURN);
boolean msgResult = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendProjectChangedMqMsg(mqMsg);
if (!msgResult) {
log.error("项目实时统计消息发送失败");
@ -1143,7 +1143,7 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
}
//项目实时统计消息
ProjectChangedMQMsg msg = new ProjectChangedMQMsg(issueDTO.getCustomerId());
ProjectChangedMQMsg msg = new ProjectChangedMQMsg(issueDTO.getCustomerId(), ProjectConstant.OPERATION_ISSUE_SHIFT_PROJECT);
boolean msgResult = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendProjectChangedMqMsg(msg);
if (!msgResult) {
log.error("项目实时统计消息发送失败");
@ -1222,7 +1222,7 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
}
//项目实时统计消息
ProjectChangedMQMsg msg = new ProjectChangedMQMsg(projectStaff.getCustomerId());
ProjectChangedMQMsg msg = new ProjectChangedMQMsg(projectStaff.getCustomerId(), ProjectConstant.OPERATION_RESPONSES);
boolean msgResult = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendProjectChangedMqMsg(msg);
if (!msgResult) {
log.error("项目实时统计消息发送失败");
@ -1990,7 +1990,7 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
}
//项目实时统计消息
ProjectChangedMQMsg mqMsg = new ProjectChangedMQMsg(projectEntity.getCustomerId());
ProjectChangedMQMsg mqMsg = new ProjectChangedMQMsg(projectEntity.getCustomerId(), ProjectConstant.OPERATION_RETURN);
boolean msgResult = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendProjectChangedMqMsg(mqMsg);
if (!msgResult) {
log.error("项目实时统计消息发送失败");
@ -2077,7 +2077,7 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
}
//项目实时统计消息
ProjectChangedMQMsg msg = new ProjectChangedMQMsg(projectStaff.getCustomerId());
ProjectChangedMQMsg msg = new ProjectChangedMQMsg(projectStaff.getCustomerId(), ProjectConstant.OPERATION_RESPONSES);
boolean msgResult = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendProjectChangedMqMsg(msg);
if (!msgResult) {
log.error("项目实时统计消息发送失败");

9
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java

@ -1,6 +1,7 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.messages.ProjectChangedMQMsg;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -27,6 +28,7 @@ import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.*;
import com.epmet.feign.*;
import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.logging.log4j.LogManager;
@ -503,6 +505,13 @@ public class ProjectTraceServiceImpl<ProjectTagService> implements ProjectTraceS
logger.error("项目吹哨,发送手机短信失败" + JSON.toJSONString(result));
}
//项目实时统计消息
ProjectChangedMQMsg mqMsg = new ProjectChangedMQMsg(projectEntity.getCustomerId(), ProjectConstant.OPERATION_CREATED);
boolean msgResult = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendProjectChangedMqMsg(mqMsg);
if (!msgResult) {
log.error("项目实时统计消息发送失败");
}
}
/**

Loading…
Cancel
Save