From 5da61001a1cbd8beaa44a28eec0779793979f4a3 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期四, 29 十月 2026 17:26:58 +0800
Subject: [PATCH] 【丽水】丽水中 新增 追踪随访推送率:再次随访推送人数/首次出院人次
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java | 2 ++
smartor/src/main/java/com/smartor/domain/ServiceSubtaskStatistic.java | 8 ++++++++
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java | 43 +++++++++++++++++++++++++++++++++++++++++--
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml | 3 +++
4 files changed, 54 insertions(+), 2 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
index f857470..5227430 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
@@ -709,6 +709,8 @@
* taskSituation5Info - taskSituation = 5
* taskSituation6Info - taskSituation = 7
* manuallyCalledInfo - isManuallyCalled = 1L
+ * firstDischargeCountInfo - visitCount = 1
+ * againFollowUpPushCountInfo - visitCount = 2 && visitDeptCode = sys.smartor.center.dept
* filterCountList - taskSituation = 6 && sendstate = 4
*
*/
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskStatistic.java b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskStatistic.java
index d57277b..abd6253 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceSubtaskStatistic.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceSubtaskStatistic.java
@@ -90,6 +90,14 @@
@Excel(name = " 鍑洪櫌浜烘 ")
private Integer dischargeCount = 0;
+ @ApiModelProperty(value = "棣栨鍑洪櫌浜烘锛坴isitCount = 1锛�")
+ @Excel(name = " 棣栨鍑洪櫌浜烘 ")
+ private Long firstDischargeCount = 0L;
+
+ @ApiModelProperty(value = "鍐嶆闅忚鎺ㄩ�佷汉鏁帮紙棣栦釜鍐嶆闅忚涓旀墽琛岀瀹や负闅忚涓績锛夊啀娆¢殢璁挎帹閫佺巼锛堝啀娆¢殢璁挎帹閫佷汉鏁� / 棣栨鍑洪櫌浜烘锛�")
+ @Excel(name = " 鍐嶆闅忚鎺ㄩ�佷汉鏁� ")
+ private Long againFollowUpPushCount = 0L;
+
@ApiModelProperty(value = "鏃犻渶闅忚浜烘")
@Excel(name = " 鏃犻渶闅忚浜烘 ")
private Long nonFollowUp = 0L;
diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
index 79afd05..15940be 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -3761,6 +3761,8 @@
serviceSubtaskStatistic.setLeavehospitaldistrictcode(serviceSubtaskList.get(0).getLeavehospitaldistrictcode());
serviceSubtaskStatistic.setDrcode(serviceSubtaskList.get(0).getDrcode());
serviceSubtaskStatistic.setDrname(serviceSubtaskList.get(0).getDrname());
+ //闅忚涓績绉戝锛岀敤浜庣粺璁″啀娆¢殢璁挎帹閫佸埌闅忚涓績鐨勪汉鏁�
+ String centerDept = configService.selectConfigByKey("sys.smartor.center.dept", serviceSubtaskList.get(0).getOrgid());
//鍑洪櫌浜烘
serviceSubtaskStatistic.setDischargeCount(serviceSubtaskList.size());
for (ServiceSubtask serviceSubtask : serviceSubtaskList) {
@@ -3778,6 +3780,17 @@
//鍙婃椂闅忚浜烘锛氬凡瀹屾垚涓旀湭瓒呮椂
if (isTimelyFollowUp(serviceSubtask)) {
serviceSubtaskStatistic.setTimelyFollowUp(serviceSubtaskStatistic.getTimelyFollowUp() + 1L);
+ }
+
+ //棣栨鍑洪櫌浜烘锛歷isitCount = 1锛屼綔涓哄啀娆¢殢璁挎帹閫佺巼鐨勫垎姣�
+ if (serviceSubtask.getVisitCount() != null && serviceSubtask.getVisitCount() == 1) {
+ serviceSubtaskStatistic.setFirstDischargeCount(serviceSubtaskStatistic.getFirstDischargeCount() + 1L);
+ }
+ //鍐嶆闅忚鎺ㄩ�佷汉鏁帮細棣栦釜鍐嶆闅忚锛坴isitCount = 2锛変笖鎵ц绉戝涓洪殢璁夸腑蹇冪瀹�
+ if (serviceSubtask.getVisitCount() != null && serviceSubtask.getVisitCount() == 2
+ && StringUtils.isNotEmpty(centerDept)
+ && StringUtils.equals(StringUtils.trim(centerDept), StringUtils.trim(serviceSubtask.getVisitDeptCode()))) {
+ serviceSubtaskStatistic.setAgainFollowUpPushCount(serviceSubtaskStatistic.getAgainFollowUpPushCount() + 1L);
}
//浜哄伐宸叉嫧閫氭�婚噺
@@ -4794,6 +4807,8 @@
* 鑾峰彇闅忚缁熻瓒呴摼鎺�
* dischargeCountInfo
* followUpNeededAllInfo - sendstate != 4 (1,2,3,5,6,7)
+ * firstDischargeCountInfo - visitCount = 1
+ * againFollowUpPushCountInfo - visitCount = 2 && visitDeptCode = sys.smartor.center.dept锛堥殢璁夸腑蹇冪瀹わ級
* nonFollowUpInfo - sendstate = 4
* needFollowUpInfo - visitCount = 1 && sendstate != 4
* pendingFollowUpInfo - visitCount = 1 && sendstate = 2
@@ -4836,7 +4851,10 @@
public List<ServiceSubtask> getSfStatisticsHyperlink(ServiceSubtaskCountReq serviceSubtaskCountReq) {
String hyperLinkInfoType = serviceSubtaskCountReq.getHyperLinkInfoType();
if (StringUtils.isNotEmpty(hyperLinkInfoType)) {
- applyHyperLinkInfoType(serviceSubtaskCountReq, hyperLinkInfoType);
+ if (!applyHyperLinkInfoType(serviceSubtaskCountReq, hyperLinkInfoType)) {
+ // 涓嬮捇渚濊禆鐨勯厤缃己澶辨椂杩斿洖绌烘槑缁嗭紝閬垮厤閫�鍖栨垚鏃犺繃婊ゆ潯浠剁殑鏌ヨ
+ return new ArrayList<>();
+ }
}
String followUpCountStyle = serviceSubtaskCountReq.getFollowUpCountStyle();
@@ -4857,7 +4875,7 @@
return serviceSubtasks;
}
- private void applyHyperLinkInfoType(ServiceSubtaskCountReq serviceSubtaskCountReq, String hyperLinkInfoType) {
+ private boolean applyHyperLinkInfoType(ServiceSubtaskCountReq serviceSubtaskCountReq, String hyperLinkInfoType) {
//鍙婃椂闅忚鏄庣粏闇�瑕佹部鐢ㄨ姹傜殑棣栨/鍐嶆鍙e緞
Integer originVisitCount = serviceSubtaskCountReq.getVisitCount();
serviceSubtaskCountReq.setVisitCount(null);
@@ -4870,6 +4888,22 @@
switch (hyperLinkInfoType) {
case "dischargeCountInfo":
break;
+ case "firstDischargeCountInfo":
+ //棣栨鍑洪櫌浜烘锛歷isitCount = 1
+ serviceSubtaskCountReq.setVisitCount(1);
+ break;
+ case "againFollowUpPushCountInfo": {
+ //鍐嶆闅忚鎺ㄩ�佷汉鏁帮細visitCount = 2 涓旀墽琛岀瀹や负闅忚涓績绉戝
+ String centerDept = configService.selectConfigByKey("sys.smartor.center.dept", serviceSubtaskCountReq.getOrgid());
+ if (StringUtils.isBlank(centerDept)) {
+ log.warn("鑾峰彇鍐嶆闅忚鎺ㄩ�佹槑缁嗗け璐ワ紝鏈厤缃殢璁夸腑蹇冪瀹ゅ弬鏁� sys.smartor.center.dept, orgid={}", serviceSubtaskCountReq.getOrgid());
+ return false;
+ }
+ serviceSubtaskCountReq.setVisitCount(2);
+ serviceSubtaskCountReq.setVisitDeptCode(centerDept.trim());
+ serviceSubtaskCountReq.setVisitDeptName(null);
+ break;
+ }
case "timelyFollowUpInfo":
serviceSubtaskCountReq.setVisitCount(originVisitCount);
serviceSubtaskCountReq.setSendstates(new ArrayList<>(Collections.singletonList(6L)));
@@ -5021,6 +5055,7 @@
default:
break;
}
+ return true;
}
@@ -5362,6 +5397,8 @@
// 鍒濆鍖栨暟鍊煎瓧娈�
total.setDischargeCount(0);
+ total.setFirstDischargeCount(0L);
+ total.setAgainFollowUpPushCount(0L);
total.setNonFollowUp(0L);
total.setFilterCount(0L);
total.setFollowUpNeeded(0L);
@@ -5394,6 +5431,8 @@
if (stat.getDischargeCount() != null) {
total.setDischargeCount(total.getDischargeCount() + stat.getDischargeCount());
}
+ total.setFirstDischargeCount(total.getFirstDischargeCount() + (stat.getFirstDischargeCount() != null ? stat.getFirstDischargeCount() : 0L));
+ total.setAgainFollowUpPushCount(total.getAgainFollowUpPushCount() + (stat.getAgainFollowUpPushCount() != null ? stat.getAgainFollowUpPushCount() : 0L));
total.setNonFollowUp(total.getNonFollowUp() + (stat.getNonFollowUp() != null ? stat.getNonFollowUp() : 0L));
total.setFilterCount(total.getFilterCount() + (stat.getFilterCount() != null ? stat.getFilterCount() : 0L));
total.setFollowUpNeeded(total.getFollowUpNeeded() + (stat.getFollowUpNeeded() != null ? stat.getFollowUpNeeded() : 0L));
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
index 2de4dec..9974006 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -1671,6 +1671,7 @@
taskid,
task_name,
visit_time,
+ visit_dept_code,
finishtime,
endtime,
senddate,
@@ -1959,6 +1960,8 @@
taskid,
task_name,
visit_time,
+ visit_dept_code,
+ visit_dept_name,
finishtime,
endtime,
senddate,
--
Gitblit v1.9.3