Procházet zdrojové kódy

Merge branch 'dev' of lyr/patient-co-management into dev

lyr před 8 roky
rodič
revize
03b14d0375

+ 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
	 * @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;
    }
    /**
     * 查询患者对应医生
     *
     * @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;
    }
}

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

@ -171,18 +171,31 @@ public class TalkGroupService extends BaseService {
     * @param consult
     * @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){
            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 {
            return null;
        }
    }
    /**
     * 查询咨询对应的求组
     * 查询咨询对应的求助讨论组
     *
     * @param doctor
     * @return
@ -326,7 +339,7 @@ public class TalkGroupService extends BaseService {
     * @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) {
            JSONObject result = new JSONObject(talkGroup.get(0));

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

@ -336,7 +336,7 @@ public class DoctorDiscussionGroupController extends BaseController {
    @ResponseBody
    public String getConsultTalkGroup(@RequestParam(required = true) String cosnult) {
        try {
            WlyyTalkGroup group = talkGroupService.getConsultGroup(cosnult);
            JSONObject group = talkGroupService.getConsultGroup(cosnult);
            return write(200, "查询成功", "data", group);
        } catch (Exception e) {

+ 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 patientAddr 患者居住地址
     * @return
@ -784,11 +784,11 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            @RequestParam(required = false) String patientName,
            @RequestParam(required = false) String patientAddr) {
        try {
            JSONObject returnJo=new JSONObject();
            JSONObject returnJo = new JSONObject();
            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");
            Integer count= (Integer) returnMap.get("count");
            Integer count = (Integer) returnMap.get("count");
            if (list != null) {
                for (Patient sf : list) {
                    if (sf == null) {
@ -799,9 +799,9 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                    json.put("code", sf.getCode());//患者code
                    json.put("name", sf.getName());//患者name
                    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());
                        }
                        json.put("disease", lablesStirng);//疾病
@ -824,14 +824,15 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                    array.put(json);
                }
            }
            returnJo.put("list",array);
            returnJo.put("count",count);
            returnJo.put("list", array);
            returnJo.put("count", count);
            return write(200, "签约数据加载成功!", "data", returnJo);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    /**
     * 获取没有健康管理师的签约数据数目
     *
@ -856,6 +857,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            return error(-1, "查询失败");
        }
    }
    /**
     * 缴费消息提醒
     *
@ -920,22 +922,22 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     * @param doctor
     * @return
     */
    @RequestMapping(value = "/doctor_patient_sign_exist",method = {RequestMethod.GET,RequestMethod.POST})
    @RequestMapping(value = "/doctor_patient_sign_exist", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    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();
            return error(-1,"查询失败");
            return error(-1, "查询失败");
        }
    }
@ -945,22 +947,43 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     * @param doctor
     * @return
     */
    @RequestMapping(value = "/doctor_patient_can_sign",method = {RequestMethod.GET,RequestMethod.POST})
    @RequestMapping(value = "/doctor_patient_can_sign", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    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)){
                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();
            return error(-1,"查询失败");
            return error(-1, "查询失败");
        }
    }
}