陈昶聿
5 天以前 efaa2a7a5b7d9d1a36f4d6a7e275d2b76f6cd9d3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
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(new ArrayList<>(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(new ArrayList<>(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(new ArrayList<>(Arrays.asList(split)));
                icd10.setOrgid(schedule.getOrgid());
                list = icd10Service.selectIcd10List(icd10);
            }
        }
 
        return getDataTable3(CollectionUtils.isEmpty(list) ? 0 : list.size(), list);
    }
}