Explorar o código

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

%!s(int64=8) %!d(string=hai) anos
pai
achega
378d7351ea

+ 1 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/discussion/DiscussionGroupDao.java

@ -27,7 +27,7 @@ public interface DiscussionGroupDao extends PagingAndSortingRepository<WlyyTalkG
	 * @param consultCode
	 * @param consultCode
	 * @return
	 * @return
	 */
	 */
	List<WlyyTalkGroup> findByConsultCodeAndType(String consultCode,Integer type);
	List<WlyyTalkGroup> findByCodeAndType(String consultCode,Integer type);
	
	
	/**
	/**
	 * 获取医生对应病人讨论组
	 * 获取医生对应病人讨论组

+ 73 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -1888,4 +1888,77 @@ public class FamilyContractService extends BaseService {
        return result;
        return result;
    }
    }
    /**
     * 查询患者对应医生
     *
     * @param patient
     * @return
     */
    public JSONObject getPatientDoctors(String patient, String doctor) {
        JSONObject result = new JSONObject();
        Map<String, JSONObject> docMap = new HashMap<>();
        SignFamily ssSign = signFamilyDao.findSignByPatient(patient, 1);
        SignFamily jtSign = signFamilyDao.findSignByPatient(patient, 2);
        if (ssSign != null) {
            DoctorTeamMember member = doctorTeamDoctor.findSanshiByTeamAndType(ssSign.getTeamCode(), 1);
            if (member != null) {
                Doctor doc = doctorDao.findByCode(member.getMemberCode());
                JSONObject json = new JSONObject(doc);
                if (json.has("password")) {
                    json.remove("password");
                }
                if (json.has("salt")) {
                    json.remove("salt");
                }
                result.put("dutyDoctor", json);
            } else {
                result.put("dutyDoctor", "");
            }
            List<Doctor> doctors = adminTeamService.getMembers(ssSign.getAdminTeamId());
            if (doctors != null) {
                for (Doctor doc : doctors) {
                    if (doc.getCode().equals(doctor)) {
                        continue;
                    }
                    JSONObject json = new JSONObject(doc);
                    if (json.has("password")) {
                        json.remove("password");
                    }
                    if (json.has("salt")) {
                        json.remove("salt");
                    }
                    docMap.put(doc.getCode(), json);
                }
            }
        }
        if (jtSign != null) {
            List<Doctor> doctors = adminTeamService.getMembers(jtSign.getAdminTeamId());
            if (doctors != null) {
                for (Doctor doc : doctors) {
                    if (doc.getCode().equals(doctor)) {
                        continue;
                    }
                    JSONObject json = new JSONObject(doc);
                    if (json.has("password")) {
                        json.remove("password");
                    }
                    if (json.has("salt")) {
                        json.remove("salt");
                    }
                    docMap.put(doc.getCode(), json);
                }
            }
        }
        if(docMap.size() > 0){
            result.put("teamDoctors",new JSONArray(docMap.values()));
        } else {
            result.put("teamDoctors",new JSONArray());
        }
        return result;
    }
}
}

+ 24 - 6
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/talk/TalkGroupService.java

@ -118,7 +118,7 @@ public class TalkGroupService extends BaseService {
     * @param patient
     * @param patient
     * @param patientName
     * @param patientName
     */
     */
    public void createConsultTalkGroup(String doctor, String doctorName, String hospitalCode, String hospitalName,
    public JSONObject createConsultTalkGroup(String doctor, String doctorName, String hospitalCode, String hospitalName,
                                       String patient, String patientName, String consult) {
                                       String patient, String patientName, String consult) {
        //讨论组建立
        //讨论组建立
        WlyyTalkGroup talkGroup = new WlyyTalkGroup();
        WlyyTalkGroup talkGroup = new WlyyTalkGroup();
@ -163,6 +163,11 @@ public class TalkGroupService extends BaseService {
        members.add(doctorMember);
        members.add(doctorMember);
        saveTalkGroup(talkGroup, members);
        saveTalkGroup(talkGroup, members);
        JSONObject result = new JSONObject(talkGroup);
        result.put("members",result);
        return result;
    }
    }
    /**
    /**
@ -171,18 +176,31 @@ public class TalkGroupService extends BaseService {
     * @param consult
     * @param consult
     * @return
     * @return
     */
     */
    public WlyyTalkGroup getConsultGroup(String consult) {
        List<WlyyTalkGroup> groups = discussionGroupDao.findByConsultCodeAndType(consult, 2);
    public JSONObject getConsultGroup(String consult) {
        JSONObject json = new JSONObject();
        List<WlyyTalkGroup> groups = discussionGroupDao.findByCodeAndType(consult, 2);
        if(groups != null && groups.size() > 0){
        if(groups != null && groups.size() > 0){
            return groups.get(0);
            json = new JSONObject(groups.get(0));
            List<WlyyTalkGroupMember> members = discussionGroupMemberDao.findByGroupCode(groups.get(0).getCode());
            if(members != null){
                JSONArray mArray = new JSONArray();
                for(WlyyTalkGroupMember member : members){
                    mArray.put(new JSONObject(member));
                }
                json.put("members",mArray);
            } else {
                json.put("members",new JSONArray());
            }
            return json;
        } else {
        } else {
            return null;
            return null;
        }
        }
    }
    }
    /**
    /**
     * 查询咨询对应的求组
     * 查询咨询对应的求助讨论组
     *
     *
     * @param doctor
     * @param doctor
     * @return
     * @return
@ -326,7 +344,7 @@ public class TalkGroupService extends BaseService {
     * @throws Exception
     * @throws Exception
     */
     */
    public JSONObject findConsultTalkGroup(String consult) throws Exception {
    public JSONObject findConsultTalkGroup(String consult) throws Exception {
        List<WlyyTalkGroup> talkGroup = discussionGroupDao.findByConsultCodeAndType(consult, 1);
        List<WlyyTalkGroup> talkGroup = discussionGroupDao.findByCodeAndType(consult, 1);
        if (talkGroup != null && talkGroup.size() > 0) {
        if (talkGroup != null && talkGroup.size() > 0) {
            JSONObject result = new JSONObject(talkGroup.get(0));
            JSONObject result = new JSONObject(talkGroup.get(0));

+ 3 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java

@ -262,7 +262,7 @@ public class DoctorController extends BaseController {
                return error(-1, "医院类型错误");
                return error(-1, "医院类型错误");
            }
            }
            page = page > 1 ? page - 1 : 0;
            page = page >= 1 ? page - 1 : 0;
            List<Hospital> hos = hospitalService.getHospitals(type, province, city, town, key, page, pagesize);
            List<Hospital> hos = hospitalService.getHospitals(type, province, city, town, key, page, pagesize);
@ -292,7 +292,7 @@ public class DoctorController extends BaseController {
            if (StringUtils.isEmpty(hospital)) {
            if (StringUtils.isEmpty(hospital)) {
                return error(-1, "医院不能为空");
                return error(-1, "医院不能为空");
            }
            }
            page = page > 1 ? page - 1 : 0;
            page = page >= 1 ? page - 1 : 0;
            List<HospitalDept> dept = deptService.getHospitalDept(hospital, key, page, pagesize);
            List<HospitalDept> dept = deptService.getHospitalDept(hospital, key, page, pagesize);
            return write(200, "查询成功", "data", dept);
            return write(200, "查询成功", "data", dept);
@ -323,7 +323,7 @@ public class DoctorController extends BaseController {
                                          @RequestParam(required = false, defaultValue = "-1") int page,
                                          @RequestParam(required = false, defaultValue = "-1") int page,
                                          @RequestParam(required = false, defaultValue = "15") int pagesize) {
                                          @RequestParam(required = false, defaultValue = "15") int pagesize) {
        try {
        try {
            if (page > 1) {
            if (page >= 1) {
                page = page - 1;
                page = page - 1;
            }
            }
            JSONArray doctors = doctorInfoService.findWorkingDoctorListByDept(dept, hospital, level, key, page, pagesize);
            JSONArray doctors = doctorInfoService.findWorkingDoctorListByDept(dept, hospital, level, key, page, pagesize);

+ 20 - 9
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/discussion/DoctorDiscussionGroupController.java

@ -6,6 +6,7 @@ import com.yihu.wlyy.entity.discussion.WlyyTalkGroup;
import com.yihu.wlyy.entity.discussion.WlyyTalkGroupMember;
import com.yihu.wlyy.entity.discussion.WlyyTalkGroupMember;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.service.common.account.PatientService;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
@ -187,6 +188,7 @@ public class DoctorDiscussionGroupController extends BaseController {
     * @param name           讨论组名称
     * @param name           讨论组名称
     * @param type           讨论组类型
     * @param type           讨论组类型
     * @param members        讨论组成员 [{"doctor":"xxx","doctorName":"xxx","doctorType":1}]
     * @param members        讨论组成员 [{"doctor":"xxx","doctorName":"xxx","doctorType":1}]
     * @param consult        咨询code
     * @param patient        患者
     * @param patient        患者
     * @param patientName    患者姓名
     * @param patientName    患者姓名
     * @param patientInclude 患者是否加入
     * @param patientInclude 患者是否加入
@ -336,7 +338,7 @@ public class DoctorDiscussionGroupController extends BaseController {
    @ResponseBody
    @ResponseBody
    public String getConsultTalkGroup(@RequestParam(required = true) String cosnult) {
    public String getConsultTalkGroup(@RequestParam(required = true) String cosnult) {
        try {
        try {
            WlyyTalkGroup group = talkGroupService.getConsultGroup(cosnult);
            JSONObject group = talkGroupService.getConsultGroup(cosnult);
            return write(200, "查询成功", "data", group);
            return write(200, "查询成功", "data", group);
        } catch (Exception e) {
        } catch (Exception e) {
@ -376,24 +378,31 @@ public class DoctorDiscussionGroupController extends BaseController {
    @ResponseBody
    @ResponseBody
    public String addTalkMember(
    public String addTalkMember(
            @RequestParam(required = true) String groupCode,
            @RequestParam(required = true) String groupCode,
            @RequestParam(required = true) String groupName,
            @RequestParam(required = false) String groupName,
            @RequestParam(required = true) String doctor,
            @RequestParam(required = true) String doctor,
            @RequestParam(required = true) String doctorName, int doctorType) {
            @RequestParam(required = false) String doctorName,
            @RequestParam(required = false, defaultValue = "0") int doctorType) {
        try {
        try {
            WlyyTalkGroup group = talkGroupService.findTalkGroup(groupCode);
            if(group == null){
                return error(-1,"讨论组不存在");
            }
            if (talkGroupService.isMemberExists(groupCode, groupName)) {
            if (talkGroupService.isMemberExists(groupCode, groupName)) {
                return error(-2, "成员已在该讨论组");
                return error(-2, "成员已在该讨论组");
            }
            }
            WlyyTalkGroupMember member = new WlyyTalkGroupMember();
            WlyyTalkGroupMember member = new WlyyTalkGroupMember();
            Doctor doc = doctorService.findDoctorByCode(doctor);
            if(doc == null){
                return error(-1,"添加的医生的信息查询失败");
            }
            member.setGroupCode(groupCode);
            member.setGroupCode(groupCode);
            member.setGroupName(groupName);
            member.setGroupName(group.getName());
            member.setMemberCode(doctor);
            member.setMemberCode(doctor);
            member.setMemberName(doctorName);
            member.setMemberName(doc.getName());
            member.setStatus(1);
            member.setStatus(1);
            member.setCzrq(new Date());
            member.setCzrq(new Date());
            member.setType(doctorType);
            member.setType(doc.getLevel());
            talkGroupService.saveTalkMember(member);
            talkGroupService.saveTalkMember(member);
@ -431,7 +440,9 @@ public class DoctorDiscussionGroupController extends BaseController {
     */
     */
    @RequestMapping(value = "/addmembers", method = {RequestMethod.GET, RequestMethod.POST})
    @RequestMapping(value = "/addmembers", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    @ResponseBody
    public String addMembers(String groupCode, String groupName, String members) {
    public String addMembers(@RequestParam(required = true)String groupCode,
                             @RequestParam(required = false)String groupName,
                             @RequestParam(required = true)String members) {
        try {
        try {
            List<WlyyTalkGroupMember> talkMembers = new ArrayList<>();
            List<WlyyTalkGroupMember> talkMembers = new ArrayList<>();
            JSONArray membersJArray = new JSONArray(members);
            JSONArray membersJArray = new JSONArray(members);

+ 54 - 31
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java

@ -768,9 +768,9 @@ public class DoctorFamilyContractController extends WeixinBaseController {
    /**
    /**
     * 获取没有健康管理师的患者列表
     * 获取没有健康管理师的患者列表
     *
     *
     * @param doctor   医生code
     * @param page     当前页
     * @param pageSize 每页显示条数
     * @param doctor      医生code
     * @param page        当前页
     * @param pageSize    每页显示条数
     * @param patientName 患者名称
     * @param patientName 患者名称
     * @param patientAddr 患者居住地址
     * @param patientAddr 患者居住地址
     * @return
     * @return
@ -784,11 +784,11 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            @RequestParam(required = false) String patientName,
            @RequestParam(required = false) String patientName,
            @RequestParam(required = false) String patientAddr) {
            @RequestParam(required = false) String patientAddr) {
        try {
        try {
            JSONObject returnJo=new JSONObject();
            JSONObject returnJo = new JSONObject();
            JSONArray array = new JSONArray();
            JSONArray array = new JSONArray();
            Map<String,Object> returnMap=familyContractService.findNoHealthSignFamilyHealth(doctor, page, pageSize,patientName,patientAddr);
            Map<String, Object> returnMap = familyContractService.findNoHealthSignFamilyHealth(doctor, page, pageSize, patientName, patientAddr);
            List<Patient> list = (List<Patient>) returnMap.get("returnList");
            List<Patient> list = (List<Patient>) returnMap.get("returnList");
            Integer count= (Integer) returnMap.get("count");
            Integer count = (Integer) returnMap.get("count");
            if (list != null) {
            if (list != null) {
                for (Patient sf : list) {
                for (Patient sf : list) {
                    if (sf == null) {
                    if (sf == null) {
@ -799,9 +799,9 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                    json.put("code", sf.getCode());//患者code
                    json.put("code", sf.getCode());//患者code
                    json.put("name", sf.getName());//患者name
                    json.put("name", sf.getName());//患者name
                    json.put("address", sf.getAddress());//患者地址
                    json.put("address", sf.getAddress());//患者地址
                    if(sf.getLabelInfos()!=null&&sf.getLabelInfos().size()>0){
                        List<String> lablesStirng=new ArrayList<>();
                        for(SignPatientLabelInfo signPatientLabelInfo:sf.getLabelInfos()){
                    if (sf.getLabelInfos() != null && sf.getLabelInfos().size() > 0) {
                        List<String> lablesStirng = new ArrayList<>();
                        for (SignPatientLabelInfo signPatientLabelInfo : sf.getLabelInfos()) {
                            lablesStirng.add(signPatientLabelInfo.getLabelName());
                            lablesStirng.add(signPatientLabelInfo.getLabelName());
                        }
                        }
                        json.put("disease", lablesStirng);//疾病
                        json.put("disease", lablesStirng);//疾病
@ -824,14 +824,15 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                    array.put(json);
                    array.put(json);
                }
                }
            }
            }
            returnJo.put("list",array);
            returnJo.put("count",count);
            returnJo.put("list", array);
            returnJo.put("count", count);
            return write(200, "签约数据加载成功!", "data", returnJo);
            return write(200, "签约数据加载成功!", "data", returnJo);
        } catch (Exception e) {
        } catch (Exception e) {
            e.printStackTrace();
            e.printStackTrace();
            return error(-1, "查询失败");
            return error(-1, "查询失败");
        }
        }
    }
    }
    /**
    /**
     * 获取没有健康管理师的签约数据数目
     * 获取没有健康管理师的签约数据数目
     *
     *
@ -856,6 +857,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            return error(-1, "查询失败");
            return error(-1, "查询失败");
        }
        }
    }
    }
    /**
    /**
     * 缴费消息提醒
     * 缴费消息提醒
     *
     *
@ -920,22 +922,22 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     * @param doctor
     * @param doctor
     * @return
     * @return
     */
     */
    @RequestMapping(value = "/doctor_patient_sign_exist",method = {RequestMethod.GET,RequestMethod.POST})
    @RequestMapping(value = "/doctor_patient_sign_exist", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    @ResponseBody
    public String isPatientAndDoctorExistSign(@RequestParam(required = true) String doctor,
    public String isPatientAndDoctorExistSign(@RequestParam(required = true) String doctor,
                                              @RequestParam(required = true) String patient){
        try{
            if(StringUtils.isEmpty(doctor)){
                return error(-1,"医生不能为空");
                                              @RequestParam(required = true) String patient) {
        try {
            if (StringUtils.isEmpty(doctor)) {
                return error(-1, "医生不能为空");
            }
            }
            if(StringUtils.isEmpty(patient)){
                return error(-1,"居民不能为空");
            if (StringUtils.isEmpty(patient)) {
                return error(-1, "居民不能为空");
            }
            }
            JSONObject result = familyContractService.isPatientAndDoctorExistSign(patient,doctor);
            return write(200,"查询成功","data",result);
        }catch (Exception e){
            JSONObject result = familyContractService.isPatientAndDoctorExistSign(patient, doctor);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            e.printStackTrace();
            return error(-1,"查询失败");
            return error(-1, "查询失败");
        }
        }
    }
    }
@ -945,22 +947,43 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     * @param doctor
     * @param doctor
     * @return
     * @return
     */
     */
    @RequestMapping(value = "/doctor_patient_can_sign",method = {RequestMethod.GET,RequestMethod.POST})
    @RequestMapping(value = "/doctor_patient_can_sign", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    @ResponseBody
    public String isPatientAndDoctorCanSign(@RequestParam(required = true) String doctor,
    public String isPatientAndDoctorCanSign(@RequestParam(required = true) String doctor,
                                            @RequestParam(required = true) String patient){
        try{
            if(StringUtils.isEmpty(doctor)){
                return error(-1,"医生不能为空");
                                            @RequestParam(required = true) String patient) {
        try {
            if (StringUtils.isEmpty(doctor)) {
                return error(-1, "医生不能为空");
            }
            }
            if (StringUtils.isEmpty(patient)) {
                return error(-1, "居民不能为空");
            }
            JSONObject result = familyContractService.isPatientAndDoctorCanSign(patient, doctor);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    /**
     * 查询患者责任医生、团队医生
     *
     * @param patient 患者
     * @return
     */
    @RequestMapping(value = "/patient_doctors", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    public String getPatientDoctor(@RequestParam String patient) {
        try {
            if(StringUtils.isEmpty(patient)){
            if(StringUtils.isEmpty(patient)){
                return error(-1,"居民不能为空");
                return error(-1,"居民不能为空");
            }
            }
            JSONObject result = familyContractService.isPatientAndDoctorCanSign(patient,doctor);
            return write(200,"查询成功","data",result);
        }catch (Exception e){
            JSONObject result = familyContractService.getPatientDoctors(patient, getUID());
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            e.printStackTrace();
            return error(-1,"查询失败");
            return error(-1, "查询失败");
        }
        }
    }
    }
}
}