| ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/main/java/com/smartor/domain/ServiceSubtask.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/main/java/com/smartor/domain/ServiceSubtaskRes.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/main/java/com/smartor/domain/ServiceTask.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/main/java/com/smartor/domain/VO/HeLibraryCountVO.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -923,6 +923,13 @@ serviceSubtaskList.addAll(compensateServiceSubtaskList); } for (ServiceSubtask serviceSubtask : serviceSubtaskList) { //currentPreachform为空,说明该子任务还没有执行过任何一种发送方式(sendstate=1,属于首次补偿), //这里直接交给sfHandlle处理,它会按sort=1的第一种发送方式发送,与getSendPreachform中的处理保持一致 if (StringUtils.isEmpty(serviceSubtask.getCurrentPreachform())) { log.warn("【compensateTask】subid:{},currentPreachform为空,按第一种发送方式补偿处理", serviceSubtask.getId()); sfHandlle(serviceSubtask); continue; } //根据当前的执行方式,获取下一种执行方式 ServiceSubtaskPreachform serviceSubtaskPreachform = new ServiceSubtaskPreachform(); serviceSubtaskPreachform.setTaskid(serviceSubtask.getTaskid()); @@ -1131,7 +1138,7 @@ } else { sysConfig = sysConfigMapper.checkConfigKeyUnique("wj.sms.template"); } if (!Objects.isNull(sysConfig)) { if (!Objects.isNull(sysConfig) && StringUtils.isNotEmpty(sysConfig.getConfigValue())) { String smsContemt = sysConfig.getConfigValue(); // sendMagParam.setContent("您好,邀请您填写出院调查表,请点击" + sendMagParam.getUrl() + "填写。感谢您配合!"); sendMagParam.setContent(smsContemt.replace("${wjurl}", sendMagParam.getUrl())); @@ -1145,7 +1152,7 @@ sendMagParam.setUrl(url); SysConfig sysConfig = sysConfigMapper.checkConfigKeyUnique("xj.sms.template"); if (!Objects.isNull(sysConfig)) { if (!Objects.isNull(sysConfig) && StringUtils.isNotEmpty(sysConfig.getConfigValue())) { String smsContemt = sysConfig.getConfigValue(); // sendMagParam.setContent("您好,邀请您填写出院宣教调查表,请点击" + sendMagParam.getUrl() + "查看。感谢您配合!"); sendMagParam.setContent(smsContemt.replace("${xjurl}", sendMagParam.getUrl())); @@ -1159,6 +1166,13 @@ sendMagParam.setContent(content); } } //内容为空说明短信模板未配置或宣教/通知内容为空,直接按发送失败处理,避免后续发送时出现空指针 if (StringUtils.isEmpty(sendMagParam.getContent())) { log.error("【sfHandlle】长期任务短信内容为空,无法发送,subid:{},taskid:{},type:{},机构ID:{}", serviceSubtask.getId(), serviceSubtask.getTaskid(), serviceSubtask.getType(), serviceSubtask.getOrgid()); setSuccessPreachForm(serviceSubtask, sendPreachform, "长期任务短信发送失败:短信内容为空(短信模板未配置或内容为空), 时间: " + now, "5"); return; } serviceOutPath.setRadix(format); @@ -1748,14 +1762,15 @@ * @return */ private String getObject(ServiceSubtask serviceSubtask, String scriptContent) { //内容为空时直接返回,避免下面的replace出现空指针 if (StringUtils.isEmpty(scriptContent)) { return scriptContent; } Map<String, Map<String, String>> param = getParam(serviceSubtask.getTaskid()); for (Map<String, String> map : param.values()) { for (String key : map.keySet()) { scriptContent = scriptContent.replace(key, StringUtils.isNotEmpty(map.get(key)) ? map.get(key) : ""); } } if (StringUtils.isEmpty(scriptContent)) { return scriptContent; } scriptContent = scriptContent.replace("${name}", StringUtils.isNotEmpty(serviceSubtask.getSendname()) ? serviceSubtask.getSendname() : ""); scriptContent = scriptContent.replace("${dzz}", StringUtils.isNotEmpty(serviceSubtask.getAddr()) ? serviceSubtask.getAddr() : ""); smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
@@ -277,6 +277,12 @@ private Date finishtime; /** * 完成时状态:1-正常完成 2-延期完成 3-超时完成 */ @ApiModelProperty(value = "完成时状态:1-正常完成 2-延期完成 3-超时完成") private Long finishState; /** * 就诊记录编号 */ @Excel(name = " 就诊记录编号 ") smartor/src/main/java/com/smartor/domain/ServiceSubtaskRes.java
@@ -291,6 +291,12 @@ private Date finishtime; /** * 完成时状态:1-正常完成 2-延期完成 3-超时完成 */ @ApiModelProperty(value = "完成时状态:1-正常完成 2-延期完成 3-超时完成") private Long finishState; /** * 就诊记录编号 */ @Excel(name = " 就诊记录编号 ") smartor/src/main/java/com/smartor/domain/ServiceTask.java
@@ -117,6 +117,13 @@ private Long sendDay; /** * 延期完成天数(随访任务完成时用于判断是否超时,缺省0) */ @Excel(name = "延期完成天数") @ApiModelProperty(value = "延期完成天数") private Long delayFinishDays; /** * 患者姓名 */ @Excel(name = "患者姓名") smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java
@@ -47,6 +47,13 @@ private Long sendDay; /** * 延期完成天数(随访任务完成时用于判断是否超时,缺省0) */ @Excel(name = "延期完成天数") @ApiModelProperty(value = "延期完成天数") private Long delayFinishDays; /** * */ @Excel(name = " ") smartor/src/main/java/com/smartor/domain/VO/HeLibraryCountVO.java
@@ -41,6 +41,9 @@ @ApiModelProperty(value = "机构ID") private String orgid; @ApiModelProperty(value = "院区编码") private String campusid; /** * 发送状态 */ smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -23,6 +23,7 @@ <result property="senduuid" column="senduuid"/> <result property="result" column="result"/> <result property="finishtime" column="finishtime"/> <result property="finishState" column="finish_state"/> <result property="recordid" column="recordid"/> <result property="exrecallcount" column="exrecallcount"/> <result property="pulltime" column="pulltime"/> @@ -202,6 +203,7 @@ senduuid, result, finishtime, finish_state, recordid, exrecallcount, pulltime, @@ -249,6 +251,53 @@ task_situation, is_manually_called from service_subtask </sql> <!-- 完成时状态(finish_state)计算:仅当本次更新把 sendstate 置为 6(随访完成)时使用。 基准截止时间 base = endtime + send_day(缺省1) + (Σ service_subtask_preachform.compensate_time + 1) 天, 与 RyTask/RedisMqReceiver 的 isSubtaskDeadline 口径保持一致; delay = COALESCE(service_task.delay_finish_days, 0); finish_time = COALESCE(入参 finishtime, 库中 finishtime, NOW()): finish_time <= base -> 1 正常完成 delay > 0 且 finish_time <= base + delay -> 2 延期完成 其余(含 delay 为 0 或 NULL、或已超出延期窗口) -> 3 超时完成 finishtime 为空时用 NOW() 兜底,保证完成时一定写入状态; 仅当 endtime 为空导致无法计算时才保持原值不覆盖。 --> <sql id="finishStateExpr"> CASE WHEN service_subtask.endtime IS NULL THEN finish_state WHEN COALESCE(#{finishtime,jdbcType=TIMESTAMP}, service_subtask.finishtime, NOW()) <= DATE_ADD( DATE_ADD( service_subtask.endtime, INTERVAL COALESCE((SELECT st.send_day FROM service_task st WHERE st.taskid = service_subtask.taskid AND st.del_flag = '0' LIMIT 1), 1) DAY ), INTERVAL (COALESCE((SELECT SUM(CAST(COALESCE(NULLIF(TRIM(pf.compensate_time), ''), '0') AS SIGNED)) FROM service_subtask_preachform pf WHERE pf.subid = service_subtask.id AND pf.del_flag = 0), 0) + 1) DAY ) THEN 1 WHEN COALESCE((SELECT st.delay_finish_days FROM service_task st WHERE st.taskid = service_subtask.taskid AND st.del_flag = '0' LIMIT 1), 0) > 0 AND COALESCE(#{finishtime,jdbcType=TIMESTAMP}, service_subtask.finishtime, NOW()) <= DATE_ADD( DATE_ADD( DATE_ADD( service_subtask.endtime, INTERVAL COALESCE((SELECT st.send_day FROM service_task st WHERE st.taskid = service_subtask.taskid AND st.del_flag = '0' LIMIT 1), 1) DAY ), INTERVAL (COALESCE((SELECT SUM(CAST(COALESCE(NULLIF(TRIM(pf.compensate_time), ''), '0') AS SIGNED)) FROM service_subtask_preachform pf WHERE pf.subid = service_subtask.id AND pf.del_flag = 0), 0) + 1) DAY ), INTERVAL COALESCE((SELECT st.delay_finish_days FROM service_task st WHERE st.taskid = service_subtask.taskid AND st.del_flag = '0' LIMIT 1), 0) DAY ) THEN 2 ELSE 3 END </sql> <select id="selectServiceSubtaskBySendstate" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity" @@ -950,6 +999,7 @@ <if test="senduuid != null">senduuid,</if> <if test="result != null">result,</if> <if test="finishtime != null">finishtime,</if> <if test="finishState != null">finish_state,</if> <if test="recordid != null">recordid,</if> <if test="exrecallcount != null">exrecallcount,</if> <if test="pulltime != null">pulltime,</if> @@ -1048,6 +1098,7 @@ <if test="senduuid != null">#{senduuid},</if> <if test="result != null">#{result},</if> <if test="finishtime != null">#{finishtime},</if> <if test="finishState != null">#{finishState},</if> <if test="recordid != null">#{recordid},</if> <if test="exrecallcount != null">#{exrecallcount},</if> <if test="pulltime != null">#{pulltime},</if> @@ -1188,6 +1239,7 @@ <if test="openid != null ">openid = #{openid},</if> <if test="longSendTime != null ">long_send_time = #{longSendTime},</if> <if test="sendstate != null ">sendstate = #{sendstate},</if> <if test="sendstate != null and sendstate == 6">finish_state = <include refid="finishStateExpr"/>,</if> <if test="serviceType != null ">service_type = #{serviceType},</if> <if test="score != null ">score = #{score},</if> <if test="submit != null ">submit = #{submit},</if> @@ -1292,6 +1344,7 @@ <if test="openid != null ">openid = #{openid},</if> <if test="longSendTime != null ">long_send_time = #{longSendTime},</if> <if test="sendstate != null ">sendstate = #{sendstate},</if> <if test="sendstate != null and sendstate == 6">finish_state = <include refid="finishStateExpr"/>,</if> <if test="serviceType != null ">service_type = #{serviceType},</if> <if test="score != null ">score = #{score},</if> <if test="visitCount != null ">visit_count = #{visitCount},</if> @@ -1347,6 +1400,7 @@ <if test="sex != null">sex = #{sex},</if> <if test="delFlag != null">del_flag = #{delFlag},</if> <if test="sendstate != null ">sendstate = #{sendstate},</if> <if test="sendstate != null and sendstate == 6">finish_state = <include refid="finishStateExpr"/>,</if> <if test="age != null">age = #{age},</if> <if test="sfzh != null">sfzh = #{sfzh},</if> <if test="addr != null">addr = #{addr},</if> @@ -1458,6 +1512,7 @@ <if test="phone != null">phone = #{phone},</if> <if test="sex != null">sex = #{sex},</if> <if test="sendstate != null ">sendstate = #{sendstate},</if> <if test="sendstate != null and sendstate == 6">finish_state = <include refid="finishStateExpr"/>,</if> <if test="age != null">age = #{age},</if> <if test="sfzh != null">sfzh = #{sfzh},</if> <if test="addr != null">addr = #{addr},</if> @@ -1931,6 +1986,10 @@ AND visit_time >= DATE(#{startTime}) AND visit_time < DATE_ADD(DATE(#{endTime}), INTERVAL 1 DAY) </if> <if test="hospitalStartTime != null and hospitalEndTime!=null"> AND endtime >= DATE(#{hospitalStartTime}) AND endtime < DATE_ADD(DATE(#{hospitalEndTime}), INTERVAL 1 DAY) </if> <if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if> <if test="visitDeptName != null">and visit_dept_name = #{visitDeptName}</if> <if test="isabnormal != null">and isabnormal = #{isabnormal}</if> smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml
@@ -15,6 +15,7 @@ <result property="unexecuted" column="unexecuted"/> <result property="fail" column="fail"/> <result property="sendDay" column="send_day"/> <result property="delayFinishDays" column="delay_finish_days"/> <result property="checkuserid" column="checkuserid"/> <result property="checkusername" column="checkusername"/> <result property="checktime" column="checktime"/> @@ -70,6 +71,7 @@ pat_cycle, appltype, send_day, delay_finish_days, long_task, show_date, compensate_date, @@ -206,6 +208,7 @@ service_task.task_name, service_task.appltype, service_task.send_day, service_task.delay_finish_days, service_task.long_task, service_task.show_date, service_task.compensate_date, @@ -490,6 +493,7 @@ <if test="leavehospitaldistrictcode != null ">leavehospitaldistrictcode,</if> <if test="compensateDate != null and compensateDate != ''">compensate_date,</if> <if test="sendDay != null ">send_day,</if> <if test="delayFinishDays != null ">delay_finish_days,</if> <if test="appltype != null ">appltype,</if> <if test="patCycle != null ">pat_cycle,</if> <if test="diagType != null and diagType != ''">diag_type,</if> @@ -547,6 +551,7 @@ <if test="leavehospitaldistrictcode != null ">#{leavehospitaldistrictcode},</if> <if test="compensateDate != null and compensateDate != ''">#{compensateDate},</if> <if test="sendDay != null ">#{sendDay},</if> <if test="delayFinishDays != null ">#{delayFinishDays},</if> <if test="appltype != null ">#{appltype},</if> <if test="patCycle != null ">#{patCycle},</if> <if test="diagType != null and diagType != ''">#{diagType},</if> @@ -610,6 +615,7 @@ </if> <if test="compensateDate != null and compensateDate != ''">compensate_date = #{compensateDate},</if> <if test="sendDay != null ">send_day = #{sendDay},</if> <if test="delayFinishDays != null ">delay_finish_days = #{delayFinishDays},</if> <if test="appltype != null ">appltype = #{appltype},</if> <if test="patCycle != null ">pat_cycle = #{patCycle},</if> <if test="diagType != null and diagType != ''">diag_type = #{diagType},</if>