LAPTOP-KB9HII50\70708 пре 2 година
родитељ
комит
29c2a0d9a5

+ 34 - 0
business/base-service/src/main/java/com/yihu/jw/common/AsynchService.java

@ -0,0 +1,34 @@
package com.yihu.jw.common;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.wlyy.service.WlyyBusinessService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
/**
 * 异步处理
 * Created by yeshijie on 2023/4/24.
 */
@Service
public class AsynchService  {
    private Logger logger = LoggerFactory.getLogger(AsynchService.class);
    @Autowired
    private WlyyBusinessService wlyyBusinessService;
    //专科团队保存关联社区
    @Async
    public JSONObject saveIjkTeam(String teamId, String adminTeamIds){
        return wlyyBusinessService.saveIjkTeam(teamId, adminTeamIds);
    }
    //删除关联社区
    @Async
    public JSONObject delIjkTeam(String teamId,Integer adminTeamdId){
        return wlyyBusinessService.delIjkTeam(teamId,adminTeamdId);
    }
}

+ 54 - 0
business/base-service/src/main/java/com/yihu/jw/config/AsyncConfig.java

@ -0,0 +1,54 @@
package com.yihu.jw.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
/**
 * Created by chenweida on 2016.10.18.
 * 启用多綫程
 */
@Configuration
@EnableAsync
public class AsyncConfig {
    /**
     * 如果池中的实际线程数小于corePoolSize,无论是否其中有空闲的线程,都会给新的任务产生新的线程
     */
    private int corePoolSize = 5;
    /**
     * 如果池中的线程数=maximumPoolSize,则有空闲线程使用空闲线程,否则新任务放入queueCapacity.
     * 设定 比 系统native thread个数要大的话,会优先抛出Java.lang.OutOfMemoryError: unable to create new native thread
     */
    private int maxPoolSize = 10;
    /**
     * 缓冲队列大小
     */
    private int queueCapacity = 100;
    /**
     * 线程池维护线程所允许的空闲时间  秒
     */
    private int keepAliveSeconds = 300;
    @Bean
    public Executor wlyyExecutor() {
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        executor.setCorePoolSize(corePoolSize);
        executor.setMaxPoolSize(maxPoolSize);
        executor.setQueueCapacity(queueCapacity);
        executor.setKeepAliveSeconds(keepAliveSeconds);
        /** Reject策略预定义有四种:
         (1)ThreadPoolExecutor.AbortPolicy策略,是默认的策略,处理程序遭到拒绝将抛出运行时 RejectedExecutionException。
         (2)ThreadPoolExecutor.CallerRunsPolicy策略 ,调用者的线程会执行该任务,如果执行器已关闭,则丢弃.
         (3)ThreadPoolExecutor.DiscardPolicy策略,不能执行的任务将被丢弃.
         (4)ThreadPoolExecutor.DiscardOldestPolicy策略,如果执行程序尚未关闭,则位于工作队列头部的任务将被删除,然后重试执行程序(如果再次失败,则重复此过程).
         */
        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
        executor.initialize();
        return executor;
    }
}

+ 11 - 0
business/base-service/src/main/java/com/yihu/jw/team/BaseTeamRelationDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.team;
import com.yihu.jw.entity.base.team.BaseTeamRelationDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
 * Created by yeshijie on 2023/4/24.
 */
public interface BaseTeamRelationDao extends JpaRepository<BaseTeamRelationDO, String>, JpaSpecificationExecutor<BaseTeamRelationDO> {
}

+ 124 - 4
business/base-service/src/main/java/com/yihu/jw/team/service/TeamService.java

@ -1,16 +1,24 @@
package com.yihu.jw.team.service;
package com.yihu.jw.team.service;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.common.AsynchService;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.team.BaseTeamDO;
import com.yihu.jw.entity.base.team.BaseTeamDO;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.entity.base.team.BaseTeamMemberDO;
import com.yihu.jw.entity.base.team.BaseTeamRelationDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.team.BaseDoctorTeamDao;
import com.yihu.jw.team.BaseDoctorTeamDao;
import com.yihu.jw.team.BaseDoctorTeamMemberDao;
import com.yihu.jw.team.BaseDoctorTeamMemberDao;
import com.yihu.jw.team.BaseTeamRelationDao;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.Date;
import java.util.List;
import java.util.List;
import java.util.Map;
import java.util.Map;
@ -28,7 +36,24 @@ public class TeamService {
    private BaseDoctorTeamMemberDao teamMemberDao;
    private BaseDoctorTeamMemberDao teamMemberDao;
    @Autowired
    @Autowired
    private JdbcTemplate jdbcTemplate;
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private BaseDoctorDao doctorDao;
    @Autowired
    private BasePatientDao patientDao;
    @Autowired
    private BaseTeamRelationDao teamRelationDao;
    @Autowired
    private AsynchService asynchService;
    //删除团队成员
    public void delTeamMember(String id){
        teamMemberDao.deleteById(id);
    }
    //获取医生信息
    public BaseDoctorDO doctorInfo(String id){
        return doctorDao.findByIdAndDel(id);
    }
    //保存团队
    //保存团队
    public BaseTeamDO saveTeam(String jsonData){
    public BaseTeamDO saveTeam(String jsonData){
@ -39,17 +64,28 @@ public class TeamService {
        return teamDao.save(teamDO);
        return teamDao.save(teamDO);
    }
    }
    public Envelop getTeamList(String teamName, String leadName, Integer page, Integer pageSize, String hospital) {
    //获取专科团队列表
    public Envelop getTeamList(Integer adminTeamId,String teamName, String leadName, Integer page, Integer pageSize, String hospital,String recommend, String recommendDoctorName) {
        String countSql = " select count(t.id) ";
        String countSql = " select count(t.id) ";
        String sql = "SELECT t.id,t.`name`,t.org_code orgCode,t.org_name orgName,t.leader_code leaderCode,d.`name` leaderName," +
        String sql = "SELECT t.id,t.`name`,t.org_code orgCode,t.org_name orgName,t.leader_code leaderCode,d.`name` leaderName," +
                "DATE_FORMAT(t.create_time,'%Y-%m-%d %H:%i:%S') createTime,t.intro,t.recommend ";
                "DATE_FORMAT(t.create_time,'%Y-%m-%d %H:%i:%S') createTime,t.intro,t.recommend ";
        String filter = " from base_team t LEFT JOIN base_doctor d on t.leader_code = d.id WHERE t.del ='1' ";
        String filter = " from base_team t LEFT JOIN base_doctor d on t.leader_code = d.id ";
        if(adminTeamId!=null){
            filter += " inner join base_team_relation r on r.team_id=t.id and r.admin_team_id="+adminTeamId+" ";
        }
        filter += " WHERE t.del ='1'";
        if(StringUtils.isNotEmpty(hospital)){
        if(StringUtils.isNotEmpty(hospital)){
            filter += " and t.org_code = '"+hospital+"' ";
            filter += " and t.org_code = '"+hospital+"' ";
        }
        }
        if(StringUtils.isNotEmpty(recommend)){
            filter += " and t.recommend = '"+recommend+"' ";
        }
        if(StringUtils.isNotEmpty(teamName)){
        if(StringUtils.isNotEmpty(teamName)){
            filter += " and t.name like '%"+teamName+"%' ";
            filter += " and t.name like '%"+teamName+"%' ";
        }
        }
        if(StringUtils.isNotEmpty(recommendDoctorName)){
            filter += " and t.recommend_doctor_name like '%"+recommendDoctorName+"%' ";
        }
        if(StringUtils.isNotEmpty(leadName)){
        if(StringUtils.isNotEmpty(leadName)){
            filter += " and d.`name` like '%"+leadName+"%' ";
            filter += " and d.`name` like '%"+leadName+"%' ";
        }
        }
@ -68,7 +104,7 @@ public class TeamService {
    //获取团队成员列表
    //获取团队成员列表
    public Envelop getAdminTeamMemberList(String teamId, String doctorName, Integer page, Integer pageSize, String mobile) {
    public Envelop getTeamMemberList(String teamId, String doctorName, Integer page, Integer pageSize, String mobile) {
        String countSql = " select count(t.id) ";
        String countSql = " select count(t.id) ";
        String sql = "SELECT d.code,d.`name`,d.idcard,d.job_title_name hospitalName,d.mobile,d.job_name jobName,d.level," +
        String sql = "SELECT d.code,d.`name`,d.idcard,d.job_title_name hospitalName,d.mobile,d.job_name jobName,d.level," +
                " DATE_FORMAT(t.create_time,'%Y-%m-%d %H:%i:%S') createTime ";
                " DATE_FORMAT(t.create_time,'%Y-%m-%d %H:%i:%S') createTime ";
@ -95,4 +131,88 @@ public class TeamService {
        return PageEnvelop.getSuccessListWithPage("获取成功",list,page,pageSize,count);
        return PageEnvelop.getSuccessListWithPage("获取成功",list,page,pageSize,count);
    }
    }
    //添加团队成员时的医生列表
    public Envelop doctorListByTeamId(String teamId,String name,String dept,Integer page, Integer pageSize){
        String countSql = " select count(d.id) ";
        String sql = "SELECT d.id,d.`name`,d.job_title_name jobTitleName,h.dept_code deptCode,h.dept_name deptName ,IF(m.id is null,'0','1') checked " ;
        String filter = "from base_doctor d  LEFT JOIN base_team_member m on d.id=m.doctor_code and m.del=1 ";
        if(StringUtils.isNotEmpty(teamId)){
            filter += " and m.team_code = '"+teamId+"' ";
        }
        filter += ",base_doctor_hospital h WHERE d.id = h.doctor_code";
        if(StringUtils.isNotEmpty(dept)){
            filter += " and h.dept_code = '"+dept+"'";
        }
        if(StringUtils.isNotEmpty(name)){
            filter += " and d.name like '%"+name+"%'";
        }
        String orderBy = " order by d.id limit "+(page-1)*pageSize+","+pageSize;
        Long count = jdbcTemplate.queryForObject(countSql+filter,Long.class);
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql+filter+orderBy);
        return PageEnvelop.getSuccessListWithPage("获取成功",list,page,pageSize,count);
    }
    //保存团队成员
    public void saveTeamMember(String teamId,String doctors){
        if(StringUtils.isNotEmpty(doctors)){
            BaseTeamDO teamDO = teamDao.findById(teamId).orElse(null);
            if(teamDO!=null){
                String doc[] = doctors.split(",");
                List<BaseTeamMemberDO> list = new ArrayList<>();
                for (String d:doc){
                    BaseTeamMemberDO memberDO = new BaseTeamMemberDO();
                    memberDO.setDel("1");
                    memberDO.setOrgCode(teamDO.getOrgCode());
                    memberDO.setTeamCode(teamId);
                    memberDO.setCreateTime(new Date());
                    memberDO.setUpdateTime(new Date());
                    memberDO.setDoctorCode(d);
                    list.add(memberDO);
                }
                teamMemberDao.saveAll(list);
            }
        }
    }
    //设置团队长
//    public void setTeamLeader(String teamId,String leadCode){
//        BaseTeamDO teamDO = teamDao.findById(teamId).orElse(null);
//        if(teamDO!=null){
//            teamDO.setLeaderCode(leadCode);
//        }
//    }
    //专科团队保存关联社区
    public void saveIjkTeam(String teamId,String adminTeamIds){
        if(StringUtils.isNotEmpty(adminTeamIds)){
            BaseTeamDO teamDO = teamDao.findById(teamId).orElse(null);
            if(teamDO!=null){
                String doc[] = adminTeamIds.split(",");
                List<BaseTeamRelationDO> list = new ArrayList<>();
                for (String d:doc){
                    BaseTeamRelationDO relationDO = new BaseTeamRelationDO();
                    relationDO.setAdminTeamId(Integer.parseInt(d));
                    relationDO.setTeamId(teamId);
                    relationDO.setCreateTime(new Date());
                    list.add(relationDO);
                }
                teamRelationDao.saveAll(list);
            }
        }
        //同步i健康
        asynchService.saveIjkTeam(teamId,adminTeamIds);
    }
    public void delIjkTeam(String id){
        BaseTeamRelationDO relationDO = teamRelationDao.findById(id).orElse(null);
        if(relationDO!=null){
            String teamId = relationDO.getTeamId();
            Integer adminTeamId = relationDO.getAdminTeamId();
            teamRelationDao.delete(relationDO);
            //同步i健康
            asynchService.delIjkTeam(relationDO.getTeamId(),adminTeamId);
        }
    }
}
}

+ 34 - 5
business/base-service/src/main/java/com/yihu/jw/wlyy/service/WlyyBusinessService.java

@ -745,8 +745,8 @@ public class WlyyBusinessService {
    }
    }
    //居民是否签约
    //居民是否签约
    public JSONObject isSign(String idcard){
        JSONObject re = wlyyHttpService.sendWlyyMesGet("isSign","?idcard="+idcard);
    public JSONObject isSign(String idCard){
        JSONObject re = wlyyHttpService.sendWlyyMesGet("isSign","?idCard="+idCard);
        return re;
        return re;
    }
    }
@ -763,8 +763,9 @@ public class WlyyBusinessService {
    }
    }
    //获取团队列表
    //获取团队列表
    public JSONObject getAdminTeamList(String teamName, String leadName, Integer page, Integer pageSize, String hospital) {
        String param = "?teamName="+nullToTransfor(teamName)+"&leadName="+nullToTransfor(leadName)+"&page="+page+"&pageSize="+pageSize+"&hospital="+nullToTransfor(hospital);
    public JSONObject getAdminTeamList(String teamName, String leadName, Integer page, Integer pageSize, String hospital,String doctorName,String mobile) {
        String param = "?teamName="+nullToTransfor(teamName)+"&leadName="+nullToTransfor(leadName)+"&page="+page+"&pageSize="+pageSize
                +"&hospital="+nullToTransfor(hospital)+"&doctorName="+nullToTransfor(doctorName)+"&mobile="+nullToTransfor(mobile);
        JSONObject re = wlyyHttpService.sendWlyyMesGet("getAdminTeamList",param);
        JSONObject re = wlyyHttpService.sendWlyyMesGet("getAdminTeamList",param);
        return re;
        return re;
    }
    }
@ -794,8 +795,36 @@ public class WlyyBusinessService {
        return re;
        return re;
    }
    }
    //获取关联社区列表分页
    public JSONObject getTeamRelationList(String teamId, String doctorName, Integer page, Integer pageSize, String mobile,String hospitalName,String teamName,String leaderName) {
        String param = "?teamId="+nullToTransfor(teamId)+"&doctorName="+nullToTransfor(doctorName)+"&page="+page
                +"&pageSize="+pageSize+"&mobile="+nullToTransfor(mobile)+"&hospitalName="+nullToTransfor(hospitalName)
                +"&teamName="+nullToTransfor(teamName)+"&leaderName="+nullToTransfor(leaderName);
        JSONObject re = wlyyHttpService.sendWlyyMesGet("getTeamRelationList",param);
        return re;
    }
    private String nullToTransfor(String str){
    private String nullToTransfor(String str){
        return StringUtils.isNotBlank(str)?"":str;
        return StringUtils.isBlank(str)?"":str;
    }
    //专科团队保存关联社区
    public JSONObject saveIjkTeam(String teamId,String adminTeamIds){
        Map<String,String> params = new HashMap<>();
        params.put("teamId",teamId);
        params.put("adminTeamIds",adminTeamIds);
        JSONObject rs = wlyyHttpService.sendWlyyMes("saveIjkTeam",null,params);
        return rs;
    }
    //删除关联社区
    public JSONObject delIjkTeam(String teamId,Integer adminTeamdId){
        Map<String,String> params = new HashMap<>();
        params.put("teamId",teamId);
        params.put("adminTeamdId",adminTeamdId+"");
        JSONObject rs = wlyyHttpService.sendWlyyMes("delIjkTeam",null,params);
        return rs;
    }
    }
}
}

+ 15 - 0
common/common-entity/src/db/2023.sql

@ -1,10 +1,25 @@
-- 2023-04-24
CREATE TABLE `base_team_relation` (
   `id` varchar(50) NOT NULL,
   `team_id` varchar(50) DEFAULT NULL COMMENT '专科团队id',
   `admin_team_id` int DEFAULT NULL COMMENT '社区团队id',
   `create_time` datetime DEFAULT NULL,
   PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='专科团队关联社区团队表';
-- 2023-04-20
-- 2023-04-20
ALTER table base_team add COLUMN `intro` varchar(2000) DEFAULT NULL COMMENT '团队简介';
ALTER table base_team add COLUMN `intro` varchar(2000) DEFAULT NULL COMMENT '团队简介';
ALTER table base_team add COLUMN `recommend` varchar(1) DEFAULT NULL COMMENT '推荐 1是0否';
ALTER table base_team add COLUMN `recommend` varchar(1) DEFAULT NULL COMMENT '推荐 1是0否';
ALTER table base_team add COLUMN `recommend_doctor` varchar(50) DEFAULT NULL COMMENT '推荐医生code';
ALTER table base_team add COLUMN `recommend_doctor_name` varchar(50) DEFAULT NULL COMMENT '推荐医生姓名';
ALTER table base_team add COLUMN `dept` varchar(50) DEFAULT NULL COMMENT '科室code';
ALTER table base_team add COLUMN `dept_name` varchar(50) DEFAULT NULL COMMENT '科室名称';
ALTER table base_team add COLUMN `img` varchar(255) DEFAULT NULL COMMENT '图片';
-- 2023-02-27
-- 2023-02-27
base_patient_doctor 暂时用来代替 wlyy_sign_family
base_patient_doctor 暂时用来代替 wlyy_sign_family

+ 50 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/team/BaseTeamDO.java

@ -53,6 +53,11 @@ public class BaseTeamDO extends UuidIdentityEntityWithOperator {
    private String intro;//团队简介
    private String intro;//团队简介
    private String recommend;//推荐 1是0否
    private String recommend;//推荐 1是0否
    private String recommendDoctor;//推荐医生code
    private String recommendDoctorName;//推荐医生姓名
    private String dept;//科室code
    private String deptName;//科室名称
    private String img;//图片
    @Column(name = "org_code")
    @Column(name = "org_code")
    public String getOrgCode() {
    public String getOrgCode() {
@ -133,4 +138,49 @@ public class BaseTeamDO extends UuidIdentityEntityWithOperator {
    public void setRecommend(String recommend) {
    public void setRecommend(String recommend) {
        this.recommend = recommend;
        this.recommend = recommend;
    }
    }
    @Column(name = "recommend_doctor")
    public String getRecommendDoctor() {
        return recommendDoctor;
    }
    public void setRecommendDoctor(String recommendDoctor) {
        this.recommendDoctor = recommendDoctor;
    }
    @Column(name = "recommend_doctor_name")
    public String getRecommendDoctorName() {
        return recommendDoctorName;
    }
    public void setRecommendDoctorName(String recommendDoctorName) {
        this.recommendDoctorName = recommendDoctorName;
    }
    @Column(name = "dept")
    public String getDept() {
        return dept;
    }
    public void setDept(String dept) {
        this.dept = dept;
    }
    @Column(name = "dept_name")
    public String getDeptName() {
        return deptName;
    }
    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }
    @Column(name = "img")
    public String getImg() {
        return img;
    }
    public void setImg(String img) {
        this.img = img;
    }
}
}

+ 35 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/team/BaseTeamRelationDO.java

@ -0,0 +1,35 @@
package com.yihu.jw.entity.base.team;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
/**
 * Created by yeshijie on 2023/4/24.
 */
@Entity
@Table(name = "base_team_relation")
@SequenceGenerator(name="id_generated", sequenceName="base_team_relation")
public class BaseTeamRelationDO extends UuidIdentityEntityWithCreateTime {
    private String teamId;//专科团队id
    private Integer adminTeamId;//社区团队id
    public String getTeamId() {
        return teamId;
    }
    public void setTeamId(String teamId) {
        this.teamId = teamId;
    }
    public Integer getAdminTeamId() {
        return adminTeamId;
    }
    public void setAdminTeamId(Integer adminTeamId) {
        this.adminTeamId = adminTeamId;
    }
}

+ 138 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/team/DoctorTeamEndpoint.java

@ -0,0 +1,138 @@
package com.yihu.jw.hospital.endpoint.team;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.team.service.TeamService;
import com.yihu.jw.wlyy.service.WlyyBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by yeshijie on 2023/4/24.
 */
@RestController
@RequestMapping(value = "doctorTeam")
@Api(value = "医生团队",  tags = {"医生团队"})
public class DoctorTeamEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private TeamService teamService;
    @Autowired
    private WlyyBusinessService wlyyBusinessService;
    @Autowired
    private BasePatientDao patientDao;
    private static final String TONGAN_TOWN = "350212";
    @GetMapping(value = "isSign")
    @ApiOperation(value = "居民是否签约")
    public String isSign(@RequestParam(required = true) String id) {
        try {
            BasePatientDO patientDO = patientDao.findById(id).orElse(null);
            if(patientDO==null){
                return error(-1,"居民不存在");
            }
            return wlyyBusinessService.isSign(patientDO.getIdcard()).toJSONString();
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"查询失败");
        }
    }
    @GetMapping(value = "doctorInfo")
    @ApiOperation(value = "获取社区医生信息")
    public String doctorInfo(@RequestParam(required = true) String code) {
        try {
            return wlyyBusinessService.doctorInfo(code).toJSONString();
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"查询失败");
        }
    }
    @GetMapping(value = "patientInfo")
    @ApiOperation(value = "获取i健康签约居民信息")
    public String patientInfo(@RequestParam(required = true) String code) {
        try {
            return wlyyBusinessService.patientInfo(code).toJSONString();
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"查询失败");
        }
    }
    @GetMapping(value = "getAdminTeamList")
    @ApiOperation(value = "获取社区团队列表")
    public String getAdminTeamList(@RequestParam(required = false) String teamName,
                                    @RequestParam(required = false) String leadName,
                                   @RequestParam(required = false) String doctorName,
                                   @RequestParam(required = false) String mobile,
                                    @RequestParam(required = false) Integer page,
                                    @RequestParam(required = false) Integer pageSize,
                                    @RequestParam(required = false) String hospital) {
        try {
            return wlyyBusinessService.getAdminTeamList(teamName,leadName,page,pageSize,hospital,doctorName,mobile).toJSONString();
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"查询失败");
        }
    }
    @GetMapping(value = "getAdminTeamMemberList")
    @ApiOperation(value = "获取社区团队成员列表")
    public String getAdminTeamMemberList(@RequestParam(required = false) String teamId,
                                          @RequestParam(required = false) String doctorName,
                                          @RequestParam(required = false) Integer page,
                                          @RequestParam(required = false) Integer pageSize,
                                          @RequestParam(required = false) String mobile) {
        try {
            return wlyyBusinessService.getAdminTeamMemberList(teamId,doctorName,page,pageSize,mobile).toJSONString();
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"查询失败");
        }
    }
    @GetMapping(value = "getHospitalList")
    @ApiOperation(value = "获取社区机构列表分页")
    public String getHospitalList(@RequestParam(required = false) String name,
                                   @RequestParam(required = false) Integer page,
                                   @RequestParam(required = false) Integer pageSize) {
        try {
            return wlyyBusinessService.getHospitalList(name,page,pageSize,TONGAN_TOWN).toJSONString();
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"查询失败");
        }
    }
    @GetMapping(value = "getSignList")
    @ApiOperation(value = "获取签约社区列表分页")
    public String getSignList(@RequestParam(required = false) String name,
                               @RequestParam(required = false) Integer page,
                               @RequestParam(required = false) Integer pageSize,
//                               @RequestParam(required = false) String town,
                               @RequestParam(required = false) String hospital,
                               @RequestParam(required = false) String adminTeamCode,
                               @RequestParam(required = false) String doctor,
                               @RequestParam(required = false) String doctorName,
                               @RequestParam(required = false) String doctorHealthName,
                               @RequestParam(required = false) String hospitalName,
                               @RequestParam(required = false) String idcard,
                               @RequestParam(required = false) String address,
                               @RequestParam(required = false) String teamName,
                               @RequestParam(required = false) String leaderName) {
        try {
            return wlyyBusinessService.getSignList(name,page,pageSize,TONGAN_TOWN,hospital,adminTeamCode,doctor,doctorName,
                    doctorHealthName,hospitalName, idcard, address,teamName,leaderName).toJSONString();
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"查询失败");
        }
    }
}

+ 169 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/team/SpecialistTeamEndpoint.java

@ -0,0 +1,169 @@
package com.yihu.jw.hospital.endpoint.team;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.team.service.TeamService;
import com.yihu.jw.wlyy.service.WlyyBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * Created by yeshijie on 2023/4/24.
 */
@RestController
@RequestMapping(value = "specialistTeam")
@Api(value = "专科医生团队",  tags = {"专科医生团队"})
public class SpecialistTeamEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private TeamService teamService;
    @Autowired
    private WlyyBusinessService wlyyBusinessService;
    @Autowired
    private BasePatientDao patientDao;
    private static final String TONGAN_TOWN = "350212";
    @GetMapping(value = "getTeamList")
    @ApiOperation(value = "获取专科团队列表")
    public Envelop getTeamList(@RequestParam(required = false) String teamName,
                                   @RequestParam(required = false) String dept,
                                   @RequestParam(required = false) String recommend,
                                   @RequestParam(required = false) Integer adminTeamId,
                                   @RequestParam(required = false) String hospital,
                                   @RequestParam(required = false) String recommendDoctorName,
                                   @RequestParam(required = false) Integer page,
                                   @RequestParam(required = false) Integer pageSize) {
        try {
            return teamService.getTeamList(adminTeamId,teamName,dept,page,pageSize,hospital,recommend,recommendDoctorName);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError("查询失败",-1);
        }
    }
    @GetMapping(value = "getTeamMemberList")
    @ApiOperation(value = "获取团队成员列表")
    public Envelop getTeamMemberList(@RequestParam(required = false) String teamId,
                               @RequestParam(required = false) String doctorName,
                               @RequestParam(required = false) String mobile,
                               @RequestParam(required = false) Integer page,
                               @RequestParam(required = false) Integer pageSize) {
        try {
            return teamService.getTeamMemberList(teamId,doctorName,page,pageSize,mobile);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError("查询失败",-1);
        }
    }
    @GetMapping(value = "doctorListByTeamId")
    @ApiOperation(value = "添加团队成员时的医生列表")
    public Envelop doctorListByTeamId(@RequestParam(required = false) String teamId,
                                     @RequestParam(required = false) String name,
                                     @RequestParam(required = false) String dept,
                                     @RequestParam(required = false) Integer page,
                                     @RequestParam(required = false) Integer pageSize) {
        try {
            return teamService.doctorListByTeamId(teamId,name,dept,page,pageSize);
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError("查询失败",-1);
        }
    }
    @PostMapping(value = "saveTeamMember")
    @ApiOperation(value = "保存团队成员")
    public Envelop saveTeamMember(@RequestParam(required = true) String teamId,@RequestParam(required = true) String doctors) {
        try {
            teamService.saveTeamMember(teamId,doctors);
            return Envelop.getSuccess("保存成功");
        }  catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError("保存失败",-1);
        }
    }
    @PostMapping(value = "doctorInfo")
    @ApiOperation(value = "获取医生信息")
    public Envelop doctorInfo(@RequestParam(required = true) String id) {
        try {
            return ObjEnvelop.getSuccess("查询成功",teamService.doctorInfo(id));
        }  catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError("查询失败",-1);
        }
    }
    @PostMapping(value = "saveTeam")
    @ApiOperation(value = "保存团队")
    public Envelop saveTeam(@RequestParam(required = true) String jsonData) {
        try {
            return ObjEnvelop.getSuccess("保存成功",teamService.saveTeam(jsonData));
        }  catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError("保存失败",-1);
        }
    }
    @PostMapping(value = "delTeamMember")
    @ApiOperation(value = "删除团队成员")
    public Envelop delTeamMember(@RequestParam(required = true) String id) {
        try {
            teamService.delTeamMember(id);
            return Envelop.getSuccess("保存成功");
        }  catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError("保存失败",-1);
        }
    }
    @PostMapping(value = "saveIjkTeam")
    @ApiOperation(value = "专科团队保存关联社区")
    public Envelop saveIjkTeam(@RequestParam(required = true) String teamId,
                               @RequestParam(required = true) String adminTeamIds) {
        try {
            teamService.saveIjkTeam(teamId,adminTeamIds);
            return Envelop.getSuccess("保存成功");
        }  catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError("保存失败",-1);
        }
    }
    @PostMapping(value = "delIjkTeam")
    @ApiOperation(value = "删除关联社区")
    public Envelop delIjkTeam(@RequestParam(required = true) String id) {
        try {
            teamService.delIjkTeam(id);
            return Envelop.getSuccess("删除成功");
        } catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError("删除失败",-1);
        }
    }
    @GetMapping(value = "getTeamRelationList")
    @ApiOperation(value = "获取关联社区列表分页")
    public String getTeamRelationList(@RequestParam(required = false) String teamId,
                                       @RequestParam(required = false) Integer page,
                                       @RequestParam(required = false) Integer pageSize,
                                       @RequestParam(required = false) String doctorName,
                                       @RequestParam(required = false) String mobile,
                                       @RequestParam(required = false) String hospitalName,
                                       @RequestParam(required = false) String leaderName,
                                       @RequestParam(required = false) String teamName) {
        try {
            return wlyyBusinessService.getTeamRelationList(teamId,doctorName,page,pageSize,mobile,hospitalName,teamName,leaderName).toJSONString();
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"查询失败");
        }
    }
}