陈昶聿
5 天以前 879bc177f31717f6d4a4998840e786a668256e97
【景宁】查询随访任务组科室关联列表、查询随访任务组疾病关联列表
已修改4个文件
已添加1个文件
138 ■■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskscheduleController.java 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/Icd10.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/Icd10Mapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskscheduleController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,108 @@
package com.ruoyi.web.controller.smartor;
import com.ruoyi.common.annotation.AddOrgId;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysDeptService;
import com.smartor.domain.Icd10;
import com.smartor.domain.ServiceTaskSchedule;
import com.smartor.domain.ServiceTaskdiag;
import com.smartor.service.IIcd10Service;
import com.smartor.service.IServiceTaskScheduleService;
import com.smartor.service.IServiceTaskdiagService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import static com.alibaba.fastjson2.JSONValidator.Type.Array;
/**
 * éšè®¿ä»»åŠ¡ç»„å…³è”Controller
 *
 * @author é™ˆæ˜¶è¿
 * @date 2026-08-06
 */
@Api("随访任务组关联")
@RestController
@RequestMapping("/smartor/taskSchedule")
public class ServiceTaskscheduleController extends BaseController {
    @Autowired
    private IServiceTaskScheduleService serviceTaskScheduleService;
    @Autowired
    private IIcd10Service icd10Service;
    @Autowired
    private ISysDeptService sysDeptService;
    /**
     * æŸ¥è¯¢éšè®¿ä»»åŠ¡ç»„ç§‘å®¤å…³è”åˆ—è¡¨
     */
    @ApiOperation("查询随访任务组科室关联列表")
    @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
    @PostMapping("getTaskScheduleDeptList")
    public Map<String, Object> getTaskScheduleDeptList(@RequestBody ServiceTaskSchedule serviceTaskSchedule) {
        List<SysDept> list = new ArrayList<>();
        //任务组信息
        if(ObjectUtils.isNotEmpty(serviceTaskSchedule.getTaskid())){
            ServiceTaskSchedule schedule = serviceTaskScheduleService.selectByTaskid(serviceTaskSchedule.getTaskid());
            if(ObjectUtils.isNotEmpty(schedule) && StringUtils.isNotEmpty(schedule.getDeptCodes())){
                String[] split = schedule.getDeptCodes().split(",");
                SysDept sysDept = new SysDept();
                sysDept.setOrgid(schedule.getOrgid());
                sysDept.setDeptType("1");
                sysDept.setDeptCodes(Arrays.asList(split));
                list = sysDeptService.selectDeptList(sysDept);
            }
            if(ObjectUtils.isNotEmpty(schedule) && StringUtils.isNotEmpty(schedule.getWardCodes())){
                String[] split = schedule.getWardCodes().split(",");
                SysDept sysDept = new SysDept();
                sysDept.setOrgid(schedule.getOrgid());
                sysDept.setDeptType("2");
                sysDept.setDeptCodes(Arrays.asList(split));
                list = sysDeptService.selectDeptList(sysDept);
            }
        }
        return getDataTable3(CollectionUtils.isEmpty(list) ? 0 : list.size(), list);
    }
    /**
     * æŸ¥è¯¢éšè®¿ä»»åŠ¡ç»„ç–¾ç—…å…³è”åˆ—è¡¨
     */
    @ApiOperation("查询随访任务组疾病关联列表")
    @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
    @PostMapping("getTaskScheduleDiagList")
    public Map<String, Object> getTaskScheduleDiagList(@RequestBody ServiceTaskSchedule serviceTaskSchedule) {
        List<Icd10> list = new ArrayList<>();
        //任务组信息
        if(ObjectUtils.isNotEmpty(serviceTaskSchedule.getTaskid())){
            ServiceTaskSchedule schedule = serviceTaskScheduleService.selectByTaskid(serviceTaskSchedule.getTaskid());
            if(ObjectUtils.isNotEmpty(schedule) && StringUtils.isNotEmpty(schedule.getIcd10Codes())){
                Icd10 icd10 = new Icd10();
                String[] split = schedule.getIcd10Codes().split(",");
                icd10.setIcdcodes(Arrays.asList(split));
                icd10.setOrgid(schedule.getOrgid());
                list = icd10Service.selectIcd10List(icd10);
            }
        }
        return getDataTable3(CollectionUtils.isEmpty(list) ? 0 : list.size(), list);
    }
}
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java
@@ -132,4 +132,9 @@
    @Excel(name = " é™¢åŒº ")
    private String campusid;
    /**
     * ç»‘定科室代码(逗号分隔),任务组自动纳入匹配用
     */
    @ApiModelProperty("绑定科室代码(逗号分隔),自动纳入用")
    private List<String> deptCodes;
}
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -85,6 +85,14 @@
        <if test="orgid != null and orgid != ''">
            AND orgid = #{orgid}
        </if>
        <if test="deptCodes != null and deptCodes.size() > 0">
            AND dept_code IN
            <foreach collection="deptCodes" item="deptCodeItem" open="("
                     separator=","
                     close=")">
                #{deptCodeItem}
            </foreach>
        </if>
        <!-- æ•°æ®èŒƒå›´è¿‡æ»¤ -->
        ${params.dataScope}
        order by d.dept_type asc, d.parent_id, d.order_num
smartor/src/main/java/com/smartor/domain/Icd10.java
@@ -8,6 +8,8 @@
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.List;
/**
 * ç–¾ç—…对象 icd10
 *
@@ -111,5 +113,10 @@
    @ApiModelProperty("chimedflag")
    private String chimedflag;
    /**
     * icd10编码
     */
    @ApiModelProperty("icd10编码集合")
    @Excel(name = "icd10编码集合")
    private List<String> icdcodes;
}
smartor/src/main/resources/mapper/smartor/Icd10Mapper.xml
@@ -57,6 +57,14 @@
            <if test="pid != null ">and pid = #{pid}</if>
            <if test="guid != null  and guid != ''">and guid = #{guid}</if>
            <if test="hisIcdid != null  and hisIcdid != ''">and his_icdid = #{hisIcdid}</if>
            <if test="icdcodes != null and icdcodes.size() > 0">
                AND icdcode IN
                <foreach collection="icdcodes" item="icdcodeItem" open="("
                         separator=","
                         close=")">
                    #{icdcodeItem}
                </foreach>
            </if>
    </select>
    <select id="selectIcd10ByIcdid" parameterType="Long" resultMap="Icd10Result">