فهرست منبع

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

Conflicts:
	patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/DoctorInfoService.java
chenweida 8 سال پیش
والد
کامیت
5e0a0742ce

+ 11 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/SignPatientLabelInfoDao.java

@ -28,6 +28,17 @@ public interface SignPatientLabelInfoDao extends
     */
    List<SignPatientLabelInfo> findByPatientAndStatus(String patient, Integer status);
    /**
     * 查询某个患者的标签
     *
     * @param patient 患者
     * @param status  状态
     * @return
     */
    @Query("select f from SignPatientLabelInfo f,SignPatientLabel l where f.patient = ?1 and f.status = ?2 and f.label = l.labelCode and f.labelType =l.labelType" +
            " and l.status = ?2 and (l.labelType <> '4' or l.teamCode = ?3 or ( l.labelType = '4' and l.labelCode in (1,2)) )")
    List<SignPatientLabelInfo> findByPatientAndStatusByTeam(String patient, Integer status, Long teamCode);
    /**
     * 查询某个患者的某个类型标签
     *

+ 11 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java

@ -105,8 +105,8 @@ public class SignPatientLabelInfoService extends BaseService {
        // 社保号
        json.put("ssc", p.getSsc());
        SignFamily ssSign = signFamilyDao.findSignByPatient(patient,1);
        SignFamily familySign = signFamilyDao.findSignByPatient(patient,2);
        SignFamily ssSign = signFamilyDao.findSignByPatient(patient, 1);
        SignFamily familySign = signFamilyDao.findSignByPatient(patient, 2);
        if (ssSign != null) {
            // 设置患者紧急联系人
@ -1146,6 +1146,7 @@ public class SignPatientLabelInfoService extends BaseService {
                        " join " : " left join ") +
                "    wlyy_sign_patient_label_info t2 " +
                " ON t1.patient = t2.patient " +
                (teamCode > 0 ? " join (select * from wlyy_sign_patient_label where label_type != '4' or team_code = " + teamCode + " or (label_type = '4' and (label_code in (1,2)))) lb on t2.label = lb.label_code and t2.label_type = lb.label_type " : "") +
                " WHERE " +
                "    t1.repdoctor = ? " +
                "    AND t1.status > 0 " +
@ -1164,7 +1165,7 @@ public class SignPatientLabelInfoService extends BaseService {
        }
        String sqlDoc = sql.replaceAll("repdoctor", "doctor");
        String sqlDocHealth = sql.replaceAll("repdoctor", "doctor_health").replaceAll("t1", "t3").replaceAll("t2", "t4");
        String sqlDocHealth = sql.replaceAll("repdoctor", "doctor_health").replaceAll("t1", "t3").replaceAll("t2", "t4").replaceAll("lb", "lb1");
        sql = "select DISTINCT t.* from (" + sqlDoc + " union all " + sqlDocHealth + ") t limit " + page + "," + pagesize;
        signList = jdbcTemplate.queryForList(sql, args);
@ -1218,7 +1219,13 @@ public class SignPatientLabelInfoService extends BaseService {
                    }
                }
                List<SignPatientLabelInfo> labels = labelInfoDao.findByPatientAndStatus(sign.get("patient").toString(), 1);
                List<SignPatientLabelInfo> labels = null;
                if (teamCode > 0) {
                    labels = labelInfoDao.findByPatientAndStatusByTeam(sign.get("patient").toString(), 1, teamCode);
                } else {
                    labels = labelInfoDao.findByPatientAndStatus(sign.get("patient").toString(), 1);
                }
                JSONObject json = new JSONObject();

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

@ -1660,6 +1660,7 @@ public class FamilyContractService extends BaseService {
                result.put("msg", "医生不存在");
                return result;
            }
            String oldDoctorHealthName = signFamily.getDoctorHealthName();
            if (StringUtils.isNotEmpty(signFamily.getDoctorHealth())) {
                //判断患者对旧的健管师是否存在健康咨询
                ConsultTeam consultTeam = consultTeamDao.findByParientCodeAndSignTypeAndDoctor(patient, signFamily.getDoctorHealth(), 2);
@ -1678,19 +1679,32 @@ public class FamilyContractService extends BaseService {
                }
                JSONObject data = new JSONObject();
                data.put("first", "因签约团队内分工调整,您的责任医生有变动," + signFamily.getDoctorHealthName() +
                data.put("toUser", patient);
                data.put("doctor", docHealth.getCode());
                data.put("doctorName", docHealth.getName());
                data.put("first", p.getName() + ",您好!因签约团队内分工调整,您的责任医生有变动," + oldDoctorHealthName +
                        "医生无法继续为您服务,具体变动如下:");
                data.put("keyword1", "家庭签约");
                data.put("keyword1", "家庭医生");
                data.put("keyword2", docHealth.getName());
                data.put("remark", signFamily.getDoctorName() + "医生与" + docHealth.getName() +
                        "医生一道,为您提供优质健康服务");
                if (StringUtils.isEmpty(signFamily.getDoctor()) || signFamily.getDoctorHealth().equals(signFamily.getDoctor())) {
                    data.put("remark", docHealth.getName() + "医生将专门为您提供优质健康服务");
                } else {
                    data.put("remark", docHealth.getName() + "医生与" + signFamily.getDoctorName() + "医生一道,为您提供优质健康服务");
                }
                wxMessages.add(data);
            } else {
                JSONObject data = new JSONObject();
                data.put("first", "您的签约团队新增一位责任医生,其将与" + signFamily.getDoctorName() +
                        "医生一道,为您提供优质健康管理服务,医生信息如下:");
                data.put("keyword1", "家庭签约");
                data.put("toUser", patient);
                data.put("doctor", docHealth.getCode());
                data.put("doctorName", docHealth.getName());
                data.put("first", p.getName() + ",您好!您的签约团队已为您新增一位责任医生,医生信息如下:");
                data.put("keyword1", "家庭医生");
                data.put("keyword2", docHealth.getName());
                if (StringUtils.isEmpty(signFamily.getDoctor()) || signFamily.getDoctorHealth().equals(signFamily.getDoctor())) {
                    data.put("remark", docHealth.getName() + "医生将专门为您提供优质的健康服务");
                } else {
                    data.put("remark", docHealth.getName() + "医生与" + signFamily.getDoctorName() + "医生一道,为您提供优质健康服务");
                }
                wxMessages.add(data);
            }
            // 新增团队信息
@ -1721,6 +1735,7 @@ public class FamilyContractService extends BaseService {
                result.put("msg", "医生不存在");
                return result;
            }
            String oldDoctorName = signFamily.getDoctorName();
            if (StringUtils.isNotEmpty(signFamily.getDoctor())) {
                DoctorTeamMember teamMember = doctorTeamDoctor.findMemberByTeamAndQkCode(signFamily.getTeamCode(), signFamily.getDoctor());
@ -1751,13 +1766,18 @@ public class FamilyContractService extends BaseService {
            signFamily.setCzrq(new Date());
            JSONObject data = new JSONObject();
            data.put("first", "因签约团队内分工调整,您的责任医生有变动," + signFamily.getDoctorName() +
            data.put("toUser", patient);
            data.put("doctor", docQk.getCode());
            data.put("doctorName", docQk.getName());
            data.put("first", p.getName() + ",您好!因签约团队内分工调整,您的责任医生有变动," + oldDoctorName +
                    "医生无法继续为您服务,具体变动如下:");
            data.put("keyword1", "家庭签约");
            data.put("keyword1", "家庭医生");
            data.put("keyword2", docQk.getName());
            data.put("remark", docQk.getName() + "医生" +
                    (StringUtils.isNotEmpty(signFamily.getDoctorHealthName()) ? ("与" + signFamily.getDoctorHealthName() + "医生一道") : "") +
                    ",为您提供优质健康服务");
            if (StringUtils.isEmpty(signFamily.getDoctorHealth()) || signFamily.getDoctor().equals(signFamily.getDoctorHealth())) {
                data.put("remark", docQk.getName() + "医生将专门为您提供优质健康服务");
            } else {
                data.put("remark", docQk.getName() + "医生与" + signFamily.getDoctorHealthName() + "医生一道,为您提供优质健康服务");
            }
            wxMessages.add(data);
        }

+ 6 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java

@ -238,7 +238,11 @@ public class PushMsgTask {
            m.put("remark", remark);
            String temp_id = "";
            if (type == 3) {
                temp.setUrl(url + "yszx/html/consulting-doctor.html?openid=" + openid + "&consult=" + json.getString("consult") + "&toUser=" + json.getString("toUser"));
                if (json.has("isPublic") && json.getInt("isPublic") == 1) {
                    temp.setUrl(url + "jbsq/html/public-consult-detail.html?openid=" + openid + "&code=" + json.getString("consult") + "&toUser=" + json.getString("toUser"));
                } else {
                    temp.setUrl(url + "yszx/html/consulting-doctor.html?openid=" + openid + "&consult=" + json.getString("consult") + "&toUser=" + json.getString("toUser"));
                }
                temp_id = SystemConf.getInstance().getSystemProperties().getProperty("template_consult_notice");
                temp.setTemplate_id(temp_id);
                WechatTemplateData keyword1 = new WechatTemplateData();
@ -407,7 +411,7 @@ public class PushMsgTask {
                keyword5.setValue(json.getString("remark"));
                m.put("remark", keyword5);
            } else if (type == 10){
                temp.setUrl("");
                temp.setUrl(url + "qygl/html/signing-doctors.html?openid=" + openid + "&state=" + openid + "&toUser=" + json.getString("toUser"));
                temp.setTemplate_id(SystemConf.getInstance().getSystemProperties()
                        .getProperty("template_healthy_article"));
                WechatTemplateData keyword1 = new WechatTemplateData();

+ 1 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/consult/DoctorConsultPublicController.java

@ -230,6 +230,7 @@ public class DoctorConsultPublicController extends BaseController {
			if (consultPublicService.addDoctorReply(reply) != null) {
				Patient p = patientService.findByCode(cp.getPatient());
				JSONObject json = new JSONObject();
				json.put("isPublic", 1);
				json.put("first", "您的公共咨询有新的回复");
				json.put("toUser", p.getCode());
				json.put("consultcontent", cp.getContent());

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

@ -155,9 +155,9 @@ public class DoctorDiscussionGroupController extends BaseController {
                talkGroupService.saveTalkGroup(talkGroup, members);
//                if (type == 1) {
//                    consultTeamService.transfer(getUID(), talkDoctor, consult);
//                }
                if (type == 1) {
                    consultTeamService.transfer(getUID(), talkDoctor, consult);
                }
                JSONObject jsonObject = new JSONObject(talkGroup);
                JSONArray membersJson = new JSONArray();
@ -301,11 +301,11 @@ public class DoctorDiscussionGroupController extends BaseController {
                        talkMembers.add(doctorTalkMember);
//                        if(type == 1 && object.getInt("doctorType") == 2){
//                            if (type == 1) {
//                                consultTeamService.transfer(getUID(), object.getString("doctor"), consult);
//                            }
//                        }
                        if(type == 1 && object.getInt("doctorType") == 2){
                            if (type == 1) {
                                consultTeamService.transfer(getUID(), object.getString("doctor"), consult);
                            }
                        }
                    }
                }

+ 33 - 12
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java

@ -426,7 +426,7 @@ public class ConsultController extends WeixinBaseController {
                    }
                    // 判断名医是否在工作
                    JSONObject isWorking = doctorWorkTimeService.isFamousDoctorWorking(doctor.getCode());
                    JSONObject isWorking = doctorWorkTimeService.isDoctorWorking(doctor.getCode());
                    if (isWorking == null || !isWorking.getString("status").equals("1")) {
                        continue;
@ -654,7 +654,7 @@ public class ConsultController extends WeixinBaseController {
                String url = SystemConf.getInstance().getSystemProperties().getProperty("im_list_get")
                        + (group != null ? "api/v1/chats/gm" : "api/v1/chats/pm");
                List<NameValuePair> params = new ArrayList<>();
                if(group == null) {
                if (group == null) {
                    params.add(new BasicNameValuePair("from", getUID()));
                    params.add(new BasicNameValuePair("to", consultModel.getDoctor()));
                    params.add(new BasicNameValuePair("content", log.getContent()));
@ -700,6 +700,9 @@ public class ConsultController extends WeixinBaseController {
                return error(-1, "咨询记录不存在!");
            }
            Patient p = patientDao.findByCode(getUID());
            Map<String, Doctor> map = new HashMap<>();
            List<JSONObject> jsonArray = new ArrayList<>();
            JSONObject group = talkGroupService.findConsultTalkGroup(consultModel.getConsult());
@ -725,13 +728,21 @@ public class ConsultController extends WeixinBaseController {
                        JSONObject json = new JSONObject();
                        json.put("id", obj.getInt("id"));
                        if (!obj.getString("from").equals(getUID())) {
                            Doctor doc = doctorService.findDoctorByCode(obj.getString("from"));
                            Doctor doc = null;
                            if (map.containsKey(obj.getString("from"))) {
                                doc = map.get(obj.getString("from"));
                            } else {
                                doc = doctorService.findDoctorByCode(obj.getString("from"));
                            }
                            // 设置回复医生姓名
                            json.put("doctorName", doc.getName());
                            json.put("photo", doc.getPhoto());
                        } else {
                            Patient p = patientDao.findByCode(obj.getString("from"));
                            // 设置回复医生姓名
                            json.put("doctorName", p.getName());
                            json.put("photo", p.getPhoto());
                        }
                        // 设置回复内容
@ -774,13 +785,21 @@ public class ConsultController extends WeixinBaseController {
                    JSONObject json = new JSONObject();
                    json.put("id", obj.getInt("id"));
                    if (!obj.getString("from").equals(getUID())) {
                        Doctor doc = doctorService.findDoctorByCode(obj.getString("from"));
                        Doctor doc = null;
                        if (map.containsKey(obj.getString("from"))) {
                            doc = map.get(obj.getString("from"));
                        } else {
                            doc = doctorService.findDoctorByCode(obj.getString("from"));
                        }
                        // 设置回复医生姓名
                        json.put("doctorName", doc.getName());
                        json.put("photo", doc.getPhoto());
                    } else {
                        Patient p = patientDao.findByCode(obj.getString("from"));
                        // 设置回复医生姓名
                        json.put("doctorName", p.getName());
                        json.put("photo", p.getPhoto());
                    }
                    // 设置回复内容
@ -802,9 +821,9 @@ public class ConsultController extends WeixinBaseController {
            jsonArray.sort(new Comparator<JSONObject>() {
                @Override
                public int compare(JSONObject o1, JSONObject o2) {
                    if(o1.getString("time").compareTo(o2.getString("time")) > 0){
                    if (o1.getString("time").compareTo(o2.getString("time")) > 0) {
                        return -1;
                    } else if(o1.getString("time").compareTo(o2.getString("time")) < 0) {
                    } else if (o1.getString("time").compareTo(o2.getString("time")) < 0) {
                        return 1;
                    } else {
                        return 0;
@ -829,7 +848,7 @@ public class ConsultController extends WeixinBaseController {
     */
    @RequestMapping(value = "oneLog")
    @ResponseBody
    public String oneLog(@RequestParam String consult, @RequestParam Long logId,@RequestParam int msgType) {
    public String oneLog(@RequestParam String consult, @RequestParam Long logId, @RequestParam int msgType) {
        try {
            ConsultTeam consultModel = consultTeamService.findByCode(consult);
            if (consultModel == null) {
@ -843,11 +862,11 @@ public class ConsultController extends WeixinBaseController {
            if (!org.springframework.util.StringUtils.isEmpty(reG)) {
                obj = new JSONObject(new String(reG.getBytes(), "utf-8"));
            } else {
                return error(-1,"查询失败");
                return error(-1, "查询失败");
            }
            if(obj == null){
                return error(-1,"查询失败");
            if (obj == null) {
                return error(-1, "查询失败");
            }
            JSONObject json = new JSONObject();
@ -857,10 +876,12 @@ public class ConsultController extends WeixinBaseController {
                Doctor doc = doctorService.findDoctorByCode(obj.getString("from"));
                // 设置回复医生姓名
                json.put("doctorName", doc.getName());
                json.put("photo", doc.getPhoto());
            } else {
                Patient p = patientDao.findByCode(obj.getString("from"));
                // 设置回复医生姓名
                json.put("doctorName", p.getName());
                json.put("photo", p.getPhoto());
            }
            // 设置回复内容