From 2aff5798398322131164cee0ea0ab53e38494110 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期六, 07 十一月 2026 14:08:02 +0800
Subject: [PATCH] fix: 任务组及时率不再叠加 send_day
---
smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java | 93 +++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 90 insertions(+), 3 deletions(-)
diff --git a/smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java b/smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java
index a743d1d..0226f1c 100644
--- a/smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java
+++ b/smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java
@@ -2,9 +2,12 @@
import com.smartor.domain.*;
import com.smartor.domain.DTO.MydTrendReqDTO;
+import com.smartor.domain.DTO.MzMydScoreRankDTO;
import com.smartor.domain.DTO.QuestionCountKsOrBqDTO;
+import com.smartor.domain.DTO.ServiceSubtaskOptionStatDTO;
import com.smartor.domain.VO.PatSatisfactionReqVO;
import com.smartor.domain.VO.HeLibraryCountVO;
+import com.smartor.domain.VO.MzMydScoreRankVO;
import com.smartor.domain.VO.QuestionCountKsOrBqVO;
import com.smartor.domain.VO.ServiceSubtaskCotinueCountVO;
import com.smartor.domain.entity.ServiceSubtaskEntity;
@@ -35,6 +38,9 @@
/**
* 鏌ヨ鍗曚竴浠诲姟锛堥殢璁匡級鍒楄〃
+ * <p>
+ * 鍏ュ弬 soonTimeout=1 涓� soonTimeoutHours=N 鏃讹紝浠呰繑鍥炩�滃皻鏈秴鏃躲�佷笖灏嗗湪 N 灏忔椂鍐呰秴鏃垛�濈殑鏁版嵁锛�
+ * 鎴鏃堕棿鍙e緞涓� getCurrentUserServiceSubtaskCount 鐨� soonTimeoutCount 涓�鑷淬��
*
* @param serviceSubtaskVO 鍗曚竴浠诲姟锛堥殢璁匡級
* @return 鍗曚竴浠诲姟锛堥殢璁匡級闆嗗悎
@@ -105,10 +111,14 @@
/**
* 闅忚鍙婃椂鐜囷紙鎸� groupKey 鍒嗙粍鎵归噺缁熻锛�
* <p>
- * rate锛氬嚭闄㈡椂闂�(endtime)璧� rateDay + 琛ュ伩澶╂暟 鍐呭畬鎴愰殢璁跨殑鍗犳瘮銆�
+ * rate锛氬畬鎴愭椂闂�(finishtime) 涓嶆櫄浜庡強鏃剁巼鍩哄噯鐨勫崰姣旓紝鍒嗘瘝涓哄簲闅忚鏁般��
+ * 闈炰换鍔$粍(appltype != 5)锛歟ndtime + send_day(缂虹渷1) + 危琛ュ伩澶╂暟 + 1 澶╋紱
+ * 浠诲姟缁�(appltype = 5)锛氭寜 schedule_benchmark 瑙f瀽鍩哄噯鏃堕棿
+ * (1-鍏ラ櫌 2-鍑洪櫌 3-灏辫瘖 4-鍏ョ粍 0/鍏跺畠-鑷畾涔夋椂闂�) + day_offset
+ * + 危琛ュ伩澶╂暟 + 1 澶╋紙涓嶅彔鍔� send_day锛夈��
* 琛ュ伩澶╂暟鍙栬嚜 service_subtask_preachform.compensate_time 鎸夊瓙浠诲姟姹傚拰锛�
* 鐢ㄥ瓙浠诲姟蹇収鑰岄潪 service_task.preachform_desc锛屼繚璇佸巻鍙叉暟鎹笉闅忎换鍔℃敼閰嶇疆鑰屽彉鍔ㄣ��
- * rateDay 涓虹┖鏃� rate 杩斿洖 NULL銆�
+ * rateDay 鍙傛暟涓嶅啀鍙備笌璇ュ彛寰勩��
* <p>
* finishRate锛氬簲闅忚鏃堕棿(visit_time) <= 瀹為檯瀹屾垚鏃堕棿(finishtime) 鐨勫崰姣旓紝褰撳墠鏈闅忚缁熻浣跨敤銆�
*
@@ -137,6 +147,14 @@
public Boolean updateServiceSubtaskByCondition(ServiceSubtask ServiceSubtask);
+ /**
+ * 寰俊鍏紬鍙峰凡棰嗗彇鏈~鍐欐寜榛樿閫夐」瀹屾垚锛氬彧鏇存柊褰撳墠瀛愪换鍔★紝涓斿彧鍏佽 sendstate=1銆佹湭鎻愪氦鐨勬暟鎹��
+ *
+ * @param serviceSubtask 蹇呭~ id銆乫inishtime銆乺esult銆乺emark
+ * @return 褰卞搷琛屾暟
+ */
+ public int updateWechatDefaultComplete(ServiceSubtask serviceSubtask);
+
public Boolean updateServiceSubtaskByTaskGuid(ServiceSubtask ServiceSubtask);
/**
@@ -148,6 +166,30 @@
public int deleteServiceSubtaskById(Long id);
public int deleteServiceSubtaskByCondition(@Param("taskid") Long id, @Param("patid") Long patid);
+
+ /**
+ * 鍒犻櫎鎮h�呭嚭闄㈣褰曞搴旂殑鏈畬鎴愰殢璁夸换鍔�
+ *
+ * @param patid 鎮h�匢D
+ * @param inhospids 鍑洪櫌璁板綍ID闆嗗悎
+ * @param sendstates 鏈畬鎴愮姸鎬侀泦鍚�
+ * @return 鍒犻櫎鏉℃暟
+ */
+ public int deleteUnfinishedServiceSubtaskByInhospids(@Param("patid") Long patid,
+ @Param("inhospids") List<Long> inhospids,
+ @Param("sendstates") List<Long> sendstates);
+
+ /**
+ * 缁熻鎮h�呮寚瀹氫换鍔′笅鏈畬鎴愮殑闅忚浠诲姟鏁伴噺锛堢敤浜庝汉宸ラ殢璁块噸澶嶆牎楠岋級
+ *
+ * @param patid 鎮h�匢D
+ * @param taskid 浠诲姟ID
+ * @param sendstates 鏈畬鎴愮姸鎬侀泦鍚�
+ * @return 鏈畬鎴愪换鍔℃暟閲�
+ */
+ int countUnfinishedServiceSubtaskByPatidAndTaskid(@Param("patid") Long patid,
+ @Param("taskid") Long taskid,
+ @Param("sendstates") List<Long> sendstates);
/**
* 鍒犻櫎鍗曚竴浠诲姟锛堥殢璁匡級
@@ -191,6 +233,14 @@
*/
public List<ServiceSubtaskScriptCount> getSfStatisticsScriptItemDetails(ServiceSubtaskCountReq serviceSubtaskCountReq);
+ /**
+ * 闂閫夐」鏁板瓧涓嬮捇锛氭煡璇㈤�夋嫨浜嗘寚瀹氶�夐」鐨� service_subtask 鍒楄〃
+ *
+ * @param serviceSubtaskCountReq 缁熻缁村害銆佺瀹�/鐥呭尯銆佷换鍔°�侀鐩強閫夐」鏉′欢
+ * @return service_subtask 鍒楄〃
+ */
+ public List<ServiceSubtask> getSfStatisticsScriptDetailsHyperlink(ServiceSubtaskCountReq serviceSubtaskCountReq);
+
public List<PatMedRes> getDeptRanking(PatMedReq patMedReq);
@@ -207,6 +257,9 @@
* xsf: 闇�闅忚鏁伴噺 sendstate = 4
* dsf: 寰呴殢璁挎暟閲� sendstate = 1L, 2L, 3L, 5L, 7L
* ywc: 宸插畬鎴愭暟閲� sendstate = 6L
+ * dfs: 寰呭彂閫佹暟閲� sendstate = 1L, 3L, 4L, 5L, 6L, 7L
+ * yfs: 宸插彂閫佹暟閲� sendstate = 2L
+ * cs: 瓒呮椂鏁伴噺 sendstate = 7L
* yc: 寮傚父鏁伴噺 excep = '1'
* yc: 璀﹀憡鏁伴噺 excep = '2'
*/
@@ -221,6 +274,7 @@
* failedVisitCount: 褰撳墠鐧诲綍浜洪殢璁夸换鍔″け璐ユ�婚噺
* abnormalVisitVount: 褰撳墠鐧诲綍浜洪殢璁夸换鍔″紓甯告�婚噺
* allVisitCount: 褰撳墠鐧诲綍浜洪殢璁夸换鍔℃�婚噺
+ * soonTimeoutCount: 褰撳墠鐧诲綍浜哄嵆灏嗚秴鏃舵暟閲忥紙瓒呮椂鎴鏃堕棿鍦� soonTimeoutHours 灏忔椂鍐咃紝浠呯粺璁″皻鏈秴鏃剁殑鏁版嵁锛�
*/
public Map<String, Object> getCurrentUserServiceSubtaskCount(ServiceSubtaskEntity serviceSubtaskVO);
@@ -267,11 +321,23 @@
* 缁熻闂鐨勯�夐」鐨勭櫨鍒嗘瘮
*
* @param taskIds 浠诲姟 ID 鍒楄〃 (鐢ㄤ簬鏈嶅姟绫诲瀷 2)
+ * @param subtaskIds 瀛愪换鍔� ID 鍒楄〃锛堝彲閫夛級銆備紶浜嗗氨鍙粺璁¤繖鎵瑰瓙浠诲姟锛堝嵆鏈瀵煎嚭鐨勬偅鑰咃級锛�
+ * 涓嶄紶鍒欑粺璁¤繖浜涗换鍔′笅鐨勫叏閮ㄧ瓟鍗凤紝淇濇寔鍘熻涓�
* @param startOutHospTime
* @param endOutHospTime
* @return
*/
- List<ServiceSubtaskDetailRatioExport> statQuestionOption(@Param("taskIds") List<Long> taskIds, @Param("startOutHospTime") Date startOutHospTime, @Param("endOutHospTime") Date endOutHospTime, @Param("startFinishTime") Date startFinishTime, @Param("endFinishTime") Date endFinishTime, @Param("scoreStart") Double scoreStart, @Param("scoreEnd") Double scoreEnd, @Param("questiontext") String questiontext, @Param("valueType") String valueType);
+ List<ServiceSubtaskDetailRatioExport> statQuestionOption(@Param("taskIds") List<Long> taskIds, @Param("startOutHospTime") Date startOutHospTime, @Param("endOutHospTime") Date endOutHospTime, @Param("startFinishTime") Date startFinishTime, @Param("endFinishTime") Date endFinishTime, @Param("scoreStart") Double scoreStart, @Param("scoreEnd") Double scoreEnd, @Param("questiontext") String questiontext, @Param("valueType") String valueType, @Param("subtaskIds") List<Long> subtaskIds);
+
+ /**
+ * 瀵煎嚭銆岄棶棰樿鎯呭崰姣斻�嶄笓鐢ㄧ粺璁★紙鎸夋湰娆″鍑虹殑瀛愪换鍔$粺璁★級
+ * <p>
+ * 鏁伴噺 = 閫夋嫨璇ラ�夐」鐨勬偅鑰呮暟锛堝悓涓�鎮h�呭悓涓�棰樺彧鍙栨渶鏂颁竴鏉℃槑缁嗭級锛屽垎鏁� = 璇ラ�夐」鏄庣粏鐨� score 涔嬪拰銆�
+ *
+ * @param subtaskIds 鏈瀵煎嚭鐨勫瓙浠诲姟 ID锛堝繀浼狅紝涓虹┖鍒欐煡涓嶅埌鏁版嵁锛�
+ * @param questiontext 闂鍐呭锛堝彲閫夛紝妯$硦鍖归厤锛�
+ */
+ List<ServiceSubtaskOptionStatDTO> statMydQuestionOptionForExport(@Param("subtaskIds") List<Long> subtaskIds, @Param("questiontext") String questiontext);
/**
* 鏍规嵁瀛愪换鍔� ID 缁熻闂鐨勯�夐」鐨勭櫨鍒嗘瘮锛堢敤浜庢弧鎰忓害缁熻 serviceType=6锛�
@@ -290,4 +356,25 @@
*/
List<QuestionCountKsOrBqDTO> statQuestionOptionByKsOrBq(QuestionCountKsOrBqVO questionCountKsOrBqVO);
+ /**
+ * 闂ㄨ瘖婊℃剰搴︾患鍚堝緱鍒嗘帓鍚嶏紙鎸夌瀹ゆ垨鐥呭尯锛�
+ * <p>
+ * 缁煎悎婊℃剰搴� = 危(璇勫垎鏄庣粏鏉冮噸) / 璇勫垎鏄庣粏鏉℃暟 脳 100%锛�
+ * 鏉冮噸鍙彇 1銆�0.8銆�0.6銆�0.4銆�0.2 浜旀。銆�
+ *
+ * @param mzMydScoreRankVO 鏌ヨ鏉′欢锛坉imensionType銆乻erviceType銆佹椂闂村尯闂淬�佺瀹�/鐥呭尯缂栧彿銆乷rgid/campusid锛�
+ * @return 姣忎釜绉戝/鐥呭尯鐨勭患鍚堝緱鍒嗕笌椤规暟锛屽凡鎸夌患鍚堝緱鍒嗛檷搴�
+ */
+ List<MzMydScoreRankDTO> selectMzMydScoreRank(MzMydScoreRankVO mzMydScoreRankVO);
+
+ /**
+ * 鏉′欢鏇存柊鍘熶换鍔$殑鈥滄槸鍚﹀啀娆¢殢璁库�濇爣璇嗭紝鐢ㄤ簬浜屾闅忚骞傜瓑鎺у埗銆�
+ * 浠呭綋褰撳墠鍊间笉鏄洰鏍囧�兼椂鎵嶆洿鏂帮紝杩斿洖鍙楀奖鍝嶈鏁般��
+ *
+ * @param id 瀛愪换鍔� ID
+ * @param isVisitAgain 鐩爣鍊硷紙2-宸插啀娆¢殢璁匡級
+ * @return 鍙楀奖鍝嶈鏁帮紝1 琛ㄧず鎶㈠埌鐢熸垚鏉冿紝0 琛ㄧず宸茶鍏朵粬璇锋眰澶勭悊
+ */
+ int updateIsVisitAgainById(@Param("id") Long id, @Param("isVisitAgain") Integer isVisitAgain);
+
}
--
Gitblit v1.9.3