已修改7个文件
155 ■■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtaskCountReq.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/VO/HeLibraryCountVO.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IServiceSubtaskService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
@@ -886,6 +886,13 @@
        return serviceSubtaskService.getHeLibraryCount(heLibraryCountVO);
    }
    @ApiOperation("获取宣教统计超链接")
    @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
    @PostMapping("/gethelibraryCountHyperlink")
    public AjaxResult gethelibraryCountHyperlink(@RequestBody HeLibraryCountVO heLibraryCountVO) {
        return success(serviceSubtaskService.gethelibraryCountHyperlink(heLibraryCountVO));
    }
    /**
     * 手动发送问卷模板的短信功能
     *
smartor/src/main/java/com/smartor/domain/ServiceSubtaskCountReq.java
@@ -207,6 +207,17 @@
    @ApiModelProperty(value = "diagType集合")
    private List<String> diagTypes;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "发送时间")
    private Date visittime;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "完成时间")
    private Date finishtime;
    @ApiModelProperty(value = "就诊类型(1门诊  2出院 3.专病 4.外部导入 5急诊、6住院、7体检)")
    private String hospType;
    /**
     * pageNum
     */
smartor/src/main/java/com/smartor/domain/VO/HeLibraryCountVO.java
@@ -1,6 +1,7 @@
package com.smartor.domain.VO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -37,4 +38,25 @@
    @ApiModelProperty(value = "就诊类型(1门诊  2出院 3.专病 4.外部导入 5急诊、6住院、7体检)")
    private String hospType;
    @ApiModelProperty(value = "机构ID")
    private String orgid;
    @ApiModelProperty("发送状态")
    private String sendstate;
    @ApiModelProperty("完成状态(0未完成 1已完成 对应finishtime是否有值)")
    private String isFinished;
    /**
     * pageNum
     */
    @ApiModelProperty("pageNum")
    private Integer pageNum;
    /**
     * pageSize
     */
    @ApiModelProperty("pageSize")
    private Integer pageSize;
}
smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java
@@ -242,6 +242,11 @@
    List<Map<String, Object>> getHeLibraryCount(HeLibraryCountVO heLibraryCountVO);
    /**
     * 宣教统计超链接
     */
    List<ServiceSubtask> gethelibraryCountHyperlink(HeLibraryCountVO heLibraryCountVO);
    /**
     * 统计问题的选项的百分比
     * @param taskIds
     * @return
smartor/src/main/java/com/smartor/service/IServiceSubtaskService.java
@@ -187,6 +187,8 @@
    public Map<String, Object> getHeLibraryCount(@RequestBody HeLibraryCountVO heLibraryCountVO);
    public List<ServiceSubtask> gethelibraryCountHyperlink(@RequestBody HeLibraryCountVO heLibraryCountVO);
    Map<String, Object> smsSubTask(Long subid);
    /**
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -3176,6 +3176,18 @@
                serviceSubtaskStatistic.setFollowUpNeeded(serviceSubtaskStatistic.getFollowUpNeeded() + 1L);
            }
            //首次出院随访-统计再次推送数量
            if (serviceSubtask.getVisitCount() != null && serviceSubtask.getVisitCount() > 1) {
                //再次应随访
                if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() != 4) {
                    serviceSubtaskStatistic.setNeedFollowUpAgain(serviceSubtaskStatistic.getNeedFollowUpAgain() + 1L);
                }
                //再次随访完成
                if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() == 6) {
                    serviceSubtaskStatistic.setFollowUpSuccessAgain(serviceSubtaskStatistic.getFollowUpSuccessAgain() + 1L);
                }
            }
            //首次出院随访
            if (serviceSubtask.getVisitCount() != null && serviceSubtask.getVisitCount() == 1) {
                //首次应随访
@@ -4586,6 +4598,12 @@
    }
    @Override
    public List<ServiceSubtask> gethelibraryCountHyperlink(HeLibraryCountVO heLibraryCountVO){
        List<ServiceSubtask> serviceSubtasks = serviceSubtaskMapper.gethelibraryCountHyperlink(heLibraryCountVO);
        return serviceSubtasks;
    }
    @Override
    public Map<String, Object> smsSubTask(Long subid) {
        log.info("smsSubTask的入参为:{}", subid);
        Map<String, Object> resultMap = new HashMap<>();
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -2701,6 +2701,9 @@
        <if test="visitCount != null and visitCount > 1">
            AND visit_count > 1
        </if>
        <if test="drname != null  and drname != ''">
            AND drname like concat('%', #{drname}, '%')
        </if>
    </select>
@@ -2889,6 +2892,15 @@
        FROM service_subtask
        WHERE del_flag = 0
        AND service_type = 4
        <if test="orgid != null and orgid != ''">
            and orgid = #{orgid}
        </if>
        <if test="sendstate != null">
            AND sendstate = #{sendstate}
        </if>
        <if test="isFinished != null and isFinished != '0'">
            AND finishtime is not null
        </if>
        <if test="starttime != null">AND starttime &gt;= #{starttime}</if>
        <if test="endtime != null">AND endtime &lt;= #{endtime}</if>
        <if test="visittime != null">AND DATE(visit_time) = DATE(#{visittime})</if>
@@ -2935,6 +2947,84 @@
        order by schedule_seq asc, id asc
    </select>
    <select id="gethelibraryCountHyperlink" parameterType="com.smartor.domain.ServiceSubtaskCountReq"
            resultMap="ServiceSubtaskResult">
        select id,
        visit_count,
        is_visit_again,
        type,
        orgid,
        drcode,
        drname,
        leavehospitaldistrictcode,
        leavehospitaldistrictname,
        deptcode,
        deptname,
        sendstate,
        preachform,
        current_preachform,
        excep,
        nurse_id,
        nurse_name,
        taskid,
        task_name,
        visit_time,
        finishtime,
        endtime,
        senddate,
        suggest,
        result,
        templateid,
        templatename,
        patid,
        sendname,
        send_type,
        recordid,
        exrecallcount,
        continue_flag,
        continue_time_now,
        continue_content,
        continue_count,
        continue_time_next,
        task_situation
        from service_subtask
        where 1=1
        and del_flag = 0
        AND service_type = 4
        <if test="orgid != null and orgid != ''">
            and orgid = #{orgid}
        </if>
        <if test="sendstate != null and isFinished != '0'">
            AND sendstate = #{sendstate}
        </if>
        <if test="isFinished != null">
            AND finishtime is not null
        </if>
        <if test="hospitaldistrictcodes != null and hospitaldistrictcodes.size() > 0">
            AND leavehospitaldistrictcode IN
            <foreach collection="hospitaldistrictcodes" item="hospitaldistrictcode" open="(" separator=","
                     close=")">
                #{hospitaldistrictcode}
            </foreach>
        </if>
        <if test="deptcodes != null and deptcodes.size() > 0">
            AND deptcode IN
            <foreach collection="deptcodes" item="deptcode" open="(" separator=","
                     close=")">
                #{deptcode}
            </foreach>
        </if>
        <if test="starttime != null">AND starttime &gt;= #{starttime}</if>
        <if test="endtime != null">AND endtime &lt;= #{endtime}</if>
        <if test="visittime != null">AND DATE(visit_time) = DATE(#{visittime})</if>
        <if test="finishtime != null">AND DATE(finishtime) = DATE(#{finishtime})</if>
        <if test="hospType != null and hospType != ''">AND hosp_type = #{hospType}</if>
        order by endtime desc
        <if test="pageSize != null  and pageNum != null">
            limit ${pageSize} OFFSET ${pageNum}
        </if>
    </select>
    <select id="statQuestionOption" resultType="com.smartor.domain.ServiceSubtaskDetailRatioExport">
        SELECT
        d.questiontext AS questiontext,