Browse Source

Merge branch 'lingshan_master' into dev

master
wxz 2 years ago
parent
commit
a33ecc2968
  1. 25
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java
  2. 35
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventAnalysisResultDTO.java
  3. 49
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventRateResultDTO.java
  4. 20
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java
  5. 17
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventDao.java
  6. 29
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java
  7. 45
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
  8. 88
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml

25
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java

@ -569,8 +569,7 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ
List<LingShanScreenServiceRstDTO.ProcessNode> processNodes = rd.getProcessNodes();
// 创建起始节点
LingShanScreenServiceRstDTO.ProcessNode nc = createProcessNode(LingShanAgentServiceProcessStatusEnum.WAIT_ACCEPT, serviceRecord.getApplicantName(), null, serviceRecord.getCreatedTime(), new ArrayList<>());
processNodes.add(nc);
LingShanScreenServiceRstDTO.ProcessNode waitAcceptNode = createProcessNode(LingShanAgentServiceProcessStatusEnum.WAIT_ACCEPT, serviceRecord.getApplicantName(), null, serviceRecord.getCreatedTime(), new ArrayList<>());
// 根据最新状态拼接后续处理节点
int processStatus = serviceRecord.getProcessStatus().intValue();
@ -578,28 +577,30 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ
if (LingShanAgentServiceProcessStatusEnum.WITHDRAW.getStatusCode() == processStatus) {
// 已撤回
LingShanScreenServiceRstDTO.ProcessNode nd = createProcessNode(processStatusEnum, serviceRecord.getApplicantName(), null, serviceRecord.getProcessTime(), new ArrayList<>());
processNodes.add(nd);
LingShanScreenServiceRstDTO.ProcessNode withdrawNode = createProcessNode(processStatusEnum, serviceRecord.getApplicantName(), null, serviceRecord.getProcessTime(), new ArrayList<>());
processNodes.add(withdrawNode);
} else {
// 正常处理流程
if (processStatus == LingShanAgentServiceProcessStatusEnum.ACCEPTED.getStatusCode()) {
// 受理 0 1
LingShanScreenServiceRstDTO.ProcessNode np = createProcessNode(processStatusEnum, serviceRecord.getAgentName(), serviceRecord.getProcessDesc(), serviceRecord.getProcessTime(), new ArrayList<>());
processNodes.add(np);
LingShanScreenServiceRstDTO.ProcessNode acceptedNode = createProcessNode(processStatusEnum, serviceRecord.getAgentName(), serviceRecord.getProcessDesc(), serviceRecord.getProcessTime(), new ArrayList<>());
processNodes.add(acceptedNode);
} else if (processStatus == LingShanAgentServiceProcessStatusEnum.REJECTED.getStatusCode()) {
// 驳回 0 2
LingShanScreenServiceRstDTO.ProcessNode np = createProcessNode(processStatusEnum, serviceRecord.getAgentName(), serviceRecord.getProcessDesc(), serviceRecord.getProcessTime(), new ArrayList<>());
processNodes.add(np);
LingShanScreenServiceRstDTO.ProcessNode rejectedNode = createProcessNode(processStatusEnum, serviceRecord.getAgentName(), serviceRecord.getProcessDesc(), serviceRecord.getProcessTime(), new ArrayList<>());
processNodes.add(rejectedNode);
} else {
// 办结 0 1 3
LingShanScreenServiceRstDTO.ProcessNode na = createProcessNode(LingShanAgentServiceProcessStatusEnum.ACCEPTED, serviceRecord.getAgentName(), serviceRecord.getProcessDesc(), serviceRecord.getProcessTime(), new ArrayList<>());
LingShanScreenServiceRstDTO.ProcessNode ncc = createProcessNode(LingShanAgentServiceProcessStatusEnum.CLOSED, serviceRecord.getAgentName(), serviceRecord.getCloseDesc(), serviceRecord.getCloseTime(), JSON.parseArray(serviceRecord.getProcessAttachments(), String.class));
processNodes.add(na);
processNodes.add(ncc);
LingShanScreenServiceRstDTO.ProcessNode acceptedNode = createProcessNode(LingShanAgentServiceProcessStatusEnum.ACCEPTED, serviceRecord.getAgentName(), serviceRecord.getProcessDesc(), serviceRecord.getProcessTime(), new ArrayList<>());
LingShanScreenServiceRstDTO.ProcessNode closedNode = createProcessNode(LingShanAgentServiceProcessStatusEnum.CLOSED, serviceRecord.getAgentName(), serviceRecord.getCloseDesc(), serviceRecord.getCloseTime(), JSON.parseArray(serviceRecord.getProcessAttachments(), String.class));
processNodes.add(closedNode);
processNodes.add(acceptedNode);
}
}
processNodes.add(waitAcceptNode);
return rd;
}

35
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventAnalysisResultDTO.java

@ -0,0 +1,35 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Map;
/**
* @author yan Lu
* @description 事件分析数量和分类统计数量
* @create 2023/5/17 15:15
*/
@Data
public class EventAnalysisResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 即诉即办数量
*/
private Integer jiSuJiBan;
/**
* 直通联办数量
*/
private Integer zhiTongLianBan;
/**
* 网格化平台数量
*/
private Integer wangGeHua;
/**
* 分类统计数量
*/
private Map<String, Integer> categoryCount;
}

49
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventRateResultDTO.java

@ -0,0 +1,49 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @author yan Lu
* @description 事件量和占比率
* @create 2023/5/17 14:50
*/
@Data
public class EventRateResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 总量
*/
private Integer total;
/**
* 红灯数量
*/
private Integer hongDeng;
/**
* 红灯占比
*/
private Double hongDengRate;
/**
* 黄灯数量
*/
private Integer huangDeng;
/**
* 黄灯占比
*/
private Double huangDengRate;
/**
* 蓝灯数量
*/
private Integer lanDeng;
/**
* 蓝灯占比
*/
private Double lanDengRate;
}

20
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java

@ -559,4 +559,24 @@ public class IcEventController {
return new Result<List<IcEventDTO>>().ok(icEventService.batchSelectById(icEventIds));
}
/**
* @description 获取事件数量和占比率
* @param * @param null
* @return Result
* @throws
* @author yan Lu
* @date 2023/5/17 14:49
*/
@GetMapping("getEventRate")
public Result<EventRateResultDTO> getEventRate(@RequestParam("orgId") String orgId,
@RequestParam("orgType") String orgType){
return new Result<EventRateResultDTO>().ok(icEventService.getEventRate(orgId,orgType));
}
@GetMapping("getEventAnalysis")
public Result<EventAnalysisResultDTO> getEventAnalysis(@RequestParam("orgId") String orgId,
@RequestParam("orgType") String orgType){
return new Result<EventAnalysisResultDTO>().ok(icEventService.getEventAnalysis(orgId,orgType));
}
}

17
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventDao.java

@ -29,6 +29,7 @@ public interface IcEventDao extends BaseDao<IcEventEntity> {
/**
* 查询事件处理状态比例
*
* @param gridPids
* @param queryStartTime
* @param queryEndTime
@ -44,6 +45,7 @@ public interface IcEventDao extends BaseDao<IcEventEntity> {
/**
* 事件处理分析-时间列表
*
* @param customerId
* @param gridPids
* @param categoryCode
@ -64,6 +66,7 @@ public interface IcEventDao extends BaseDao<IcEventEntity> {
/**
* 月度事件数统计查询
*
* @param orgType
* @param orgId
* @param gridPids
@ -80,6 +83,7 @@ public interface IcEventDao extends BaseDao<IcEventEntity> {
/**
* 按父级分类查询组织下的事件列表
*
* @param orgId
* @param orgType
* @param categoryPids
@ -91,7 +95,6 @@ public interface IcEventDao extends BaseDao<IcEventEntity> {
@Param("categoryPids") String categoryPids);
/**
*
* @param formDTO
* @return
*/
@ -99,6 +102,7 @@ public interface IcEventDao extends BaseDao<IcEventEntity> {
/**
* Desc: 查询客户下可以自动评价事件的ID
*
* @param customerId
* @param no
* @param size
@ -109,6 +113,7 @@ public interface IcEventDao extends BaseDao<IcEventEntity> {
/**
* Desc: 更新评价默认 perfect
*
* @param ids
* @author zxc
* @date 2022/5/18 17:26
@ -116,7 +121,6 @@ public interface IcEventDao extends BaseDao<IcEventEntity> {
void updateAutoEvaluation(@Param("ids") List<String> ids);
/**
*
* @param formDTO
* @return
*/
@ -134,6 +138,7 @@ public interface IcEventDao extends BaseDao<IcEventEntity> {
/**
* 查询居民上报的时间数量
*
* @param reportorIdCard 上报人的身份证号
* @return
*/
@ -143,4 +148,12 @@ public interface IcEventDao extends BaseDao<IcEventEntity> {
List<PageUserReportEventResDTO> selectUserReported(PageUserReportEventFormDTO formDTO);
EventRateResultDTO getEventRate(@Param("orgIdPath") String orgIdPath);
EventAnalysisResultDTO getEventAnalysis(@Param("orgIdPath") String orgPath);
@MapKey("code")
List<Map<String,Integer>> getAnalysis(@Param("orgIdPath") String orgPath);
IcEventEntity selectByEventId(String icEventId);
}

29
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java

@ -73,6 +73,7 @@ public interface IcEventService extends BaseService<IcEventEntity> {
/**
* 事件列表
*
* @param orgId
* @param orgType
* @param categoryCode
@ -88,6 +89,7 @@ public interface IcEventService extends BaseService<IcEventEntity> {
/**
* 月度增量查询
*
* @param orgType
* @param orgId
* @param queryStartTime
@ -98,6 +100,7 @@ public interface IcEventService extends BaseService<IcEventEntity> {
/**
* 研判分析查询
*
* @param eventId
* @return
*/
@ -105,6 +108,7 @@ public interface IcEventService extends BaseService<IcEventEntity> {
/**
* 同类事件列表
*
* @param categoryPids
* @param pageNo
* @param pageSize
@ -132,6 +136,7 @@ public interface IcEventService extends BaseService<IcEventEntity> {
/**
* 事件分类分析-一级分类下事件数量
*
* @param formDTO
* @return
*/
@ -145,6 +150,7 @@ public interface IcEventService extends BaseService<IcEventEntity> {
/**
* Desc: 定时任务自动评价
*
* @param formDTO
* @author zxc
* @date 2022/5/18 16:35
@ -162,8 +168,10 @@ public interface IcEventService extends BaseService<IcEventEntity> {
* @Description 事件管理-处理进展
**/
LinkedList<IcEventProcessListResultDTO> process(IcEventReplyFormDTO formDTO);
/**
* 事件分类分析- 饼图2直属下级 事件数量
*
* @param formDTO
* @return
*/
@ -178,6 +186,7 @@ public interface IcEventService extends BaseService<IcEventEntity> {
/**
* Desc: 新增随手拍
*
* @param formDTO
* @author zxc
* @date 2022/5/19 13:38
@ -206,12 +215,14 @@ public interface IcEventService extends BaseService<IcEventEntity> {
/**
* 居民端我上报的事件-回复
*
* @param formDTO
*/
void resiReply(ResiReplyIcEventFormDTO formDTO);
/**
* 居民端我上报的事件 消息列表跳转详情
*
* @param formDTO
* @return
*/
@ -228,14 +239,32 @@ public interface IcEventService extends BaseService<IcEventEntity> {
/**
* 事件转议题
*
* @param formDTO
*/
void icEventToIssue(IcEventToIssueFormDTO formDTO);
/**
* 批量查询事件信息
*
* @param icEventIds
* @return
*/
List<IcEventDTO> batchSelectById(List<String> icEventIds);
/**
* 获取事件数量和占比
*
* @return
*/
EventRateResultDTO getEventRate(String orgId, String orgType);
/**
* 事件分析数据获取
*
* @param orgId
* @param orgType
* @return
*/
EventAnalysisResultDTO getEventAnalysis(String orgId, String orgType);
}

45
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java

@ -15,6 +15,7 @@ import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.scan.param.ImgScanParamDTO;
import com.epmet.commons.tools.scan.param.ImgTaskDTO;
@ -187,6 +188,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
/**
* 事件管理-新增
*
* @param formDTO
*/
@Override
@ -456,6 +458,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
/**
* 事件管理-批量删除事件
*
* @param ids
*/
@Override
@ -463,7 +466,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
public void delete(String[] ids) {
//已立项、已转服务的事件删除时,同时删除关联的服务和项目
for (String id : ids) {
IcEventEntity entity = baseDao.selectById(id);
IcEventEntity entity = baseDao.selectByEventId(id);
if (null == entity) {
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"数据不存在","数据不存在");
continue;
@ -731,6 +734,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
/**
* 查询家属
*
* @param idCard
* @return
*/
@ -779,7 +783,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
@Transactional(rollbackFor = Exception.class)
public void reply(IcEventReplyFormDTO formDTO) {
//1.查询事件数据 判断是否允许回复
IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId());
IcEventEntity entity = baseDao.selectByEventId(formDTO.getIcEventId());
if (null == entity || "1".equals(entity.getOperationType()) || "2".equals(entity.getOperationType())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许回复");
}
@ -1214,6 +1218,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
/**
* Desc: 定时任务自动评价
*
* @param formDTO
* @author zxc
* @date 2022/5/18 16:35
@ -1238,6 +1243,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
/**
* Desc: 处理未评价的icEvent
*
* @param customerId
* @author zxc
* @date 2022/5/18 16:52
@ -1266,7 +1272,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
public LinkedList<IcEventProcessListResultDTO> process(IcEventReplyFormDTO formDTO) {
LinkedList<IcEventProcessListResultDTO> resultList = new LinkedList<IcEventProcessListResultDTO>();
//1.查询事件基础信息
IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId());
IcEventEntity entity = baseDao.selectByEventId(formDTO.getIcEventId());
if (null == entity) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件不存在", "事件不存在");
}
@ -1410,6 +1416,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
/**
* Desc: 新增随手拍
*
* @param formDTO
* @author zxc
* @date 2022/5/19 13:38
@ -1485,6 +1492,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
/**
* Desc: 给工作人员发送站内信
*
* @param agencyId
* @param customerId
* @param showName
@ -1521,6 +1529,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
/**
* Desc: 附件处理
*
* @param list
* @param attachmentEntityList
* @param id
@ -1914,4 +1923,34 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
return ConvertUtils.sourceToTarget(list, IcEventDTO.class);
}
@Override
public EventRateResultDTO getEventRate(String orgId, String orgType) {
return baseDao.getEventRate(getOrgPath(orgId, orgType));
}
@Override
public EventAnalysisResultDTO getEventAnalysis(String orgId, String orgType) {
EventAnalysisResultDTO dto = baseDao.getEventAnalysis(getOrgPath(orgId,orgType));
Result<Map<String, String>> categoryMap = govIssueOpenFeignClient.getCategoryMap(EpmetRequestHolder.getLoginUserCustomerId());
if (null != categoryMap && categoryMap.getData().size() > 0) {
List<Map<String,Integer>> dataMap = baseDao.getAnalysis(getOrgPath(orgId,orgType));
if (null != dataMap && dataMap.size() > 0) {
Map<String, Integer> merged = new HashMap<>();
dataMap.forEach(merged::putAll);
dto.setCategoryCount(merged);
}
}
return dto;
}
private String getOrgPath(String orgId, String orgType) {
if (OrgInfoConstant.AGENCY.equals(orgType)) { // 行政组织
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId);
return PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids());
} else {// 网格
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(orgId);
return PidUtils.convertPid2OrgIdPath(gridInfo.getId(), gridInfo.getPids());
}
}
}

88
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml

@ -440,5 +440,93 @@
ORDER BY re.created_time desc
</select>
<select id="getEventRate" resultType="com.epmet.dto.result.EventRateResultDTO">
SELECT
ea.countAll AS total,
eb.hong AS hongDeng,
ec.huang AS huangDeng,
ed.lan as lanDeng,
ROUND( eb.hong / ea.countAll, 2 ) AS hongDengRate,
ROUND( ec.huang / ea.countAll, 2 ) AS huangDengRate,
ROUND( ed.lan / ea.countAll, 2 ) as lanDengRate
FROM
( SELECT
SUM( CASE WHEN a.OPERATION_TYPE IS NULL OR a.OPERATION_TYPE = 0 THEN 1 ELSE 0 END ) AS countAll
FROM
ic_event a
WHERE
a.DEL_FLAG = 0
<if test="null != orgIdPath and orgIdPath != ''">
and a.GRID_PIDS like concat(#{orgIdPath},'%')
</if>
) ea,
( SELECT SUM( CASE WHEN b.OPERATION_TYPE IS NULL THEN 1 ELSE 0 END ) AS hong
FROM ic_event b WHERE b.DEL_FLAG = 0 and b.STATUS = 'processing'
<if test="null != orgIdPath and orgIdPath != ''">
and b.GRID_PIDS like concat(#{orgIdPath},'%')
</if>
) eb,
( SELECT SUM( CASE WHEN c.OPERATION_TYPE = 0 THEN 1 ELSE 0 END ) AS huang
FROM ic_event c WHERE c.DEL_FLAG = 0 and c.STATUS = 'processing'
<if test="null != orgIdPath and orgIdPath != ''">
and c.GRID_PIDS like concat(#{orgIdPath},'%')
</if>
) ec,
( SELECT SUM( CASE WHEN d.OPERATION_TYPE = 0 THEN 1 ELSE 0 END ) as lan
FROM ic_event d WHERE d.DEL_FLAG = 0 and d.STATUS = 'closed_case'
<if test="null != orgIdPath and orgIdPath != ''">
and d.GRID_PIDS like concat(#{orgIdPath},'%')
</if>
) ed
</select>
<select id="getEventAnalysis" resultType="com.epmet.dto.result.EventAnalysisResultDTO">
SELECT
ea.total AS jiSuJiBan,
eb.total AS zhiTongLianBan,
ec.total AS wangGeHua
FROM
(
SELECT COUNT( e.id ) AS total FROM ic_event e
WHERE e.DEL_FLAG = 0 AND e.SOURCE_TYPE = 0 AND ( e.OPERATION_TYPE = 0 OR e.OPERATION_TYPE IS NULL )
<if test="null != orgIdPath and orgIdPath != ''">
and e.GRID_PIDS like concat(#{orgIdPath},'%')
</if>
) ea,
(
SELECT COUNT( e.id ) AS total FROM ic_event e
WHERE e.DEL_FLAG = 0 AND e.SOURCE_TYPE = 1 AND ( e.OPERATION_TYPE = 0 OR e.OPERATION_TYPE IS NULL )
<if test="null != orgIdPath and orgIdPath != ''">
and e.GRID_PIDS like concat(#{orgIdPath},'%')
</if>
) eb,
(
SELECT COUNT( e.id ) AS total FROM ic_event e
WHERE e.DEL_FLAG = 0 AND e.SOURCE_TYPE = 2 AND ( e.OPERATION_TYPE = 0 OR e.OPERATION_TYPE IS NULL )
<if test="null != orgIdPath and orgIdPath != ''">
and e.GRID_PIDS like concat(#{orgIdPath},'%')
</if>
) ec
</select>
<select id="getAnalysis" resultType="java.util.Map">
SELECT
c.CATEGORY_ID as code,
COUNT(c.CATEGORY_ID) as total
FROM ic_event_category c
<where>
c.IC_EVENT_ID in (
SELECT ic.id as ids from ic_event ic WHERE ic.DEL_FLAG = 0
<if test="null != orgIdPath and orgIdPath != ''">
and ic.GRID_PIDS LIKE concat(#{orgIdPath},'%')
</if>
)
</where>
GROUP BY c.CATEGORY_ID
</select>
<select id="selectByEventId" resultType="com.epmet.entity.IcEventEntity">
select e.* from ic_event e where e.id = #{icEventId}
</select>
</mapper>

Loading…
Cancel
Save