LAPTOP-KB9HII50\70708 преди 1 година
родител
ревизия
2cb6102e8f
променени са 1 файла, в които са добавени 30 реда и са изтрити 30 реда
  1. 30 30
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

+ 30 - 30
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -517,12 +517,12 @@ public class ImService {
        }
        String content = "进入了咨询";
        BasePatientDO p = basePatientDao.getOne(currentUid);
        BasePatientDO p = basePatientDao.findById(currentUid).orElse(null);
        String intoUserName = p.getName();
//		if (currentUid.equals(uid)) {
//			content = intoUserName + content;
//		} else {
        BasePatientDO member = basePatientDao.getOne(currentUid);
        BasePatientDO member = basePatientDao.findById(currentUid).orElse(null);
        content = intoUserName + content;
        //目前没有家人关系,所以家人名称的名字获取暂时注释
//			content = member.getName() + "(" + relations.get(familyMember.getFamilyRelation()) + ")" + content;
@ -595,7 +595,7 @@ public class ImService {
            arr = new String[]{content};
        }
//            Patient patient = patientDao.findByCode(getUID());
        BasePatientDO patient = basePatientDao.getOne(patientcode);
        BasePatientDO patient = basePatientDao.findById(patientcode).orElse(null);
        int i = 0;
        List<String> failed = new ArrayList<>();
@ -674,7 +674,7 @@ public class ImService {
            arr = new String[]{content};
        }
//            Patient patient = patientDao.findByCode(getUID());
        BasePatientDO patient = basePatientDao.getOne(patientcode);
        BasePatientDO patient = basePatientDao.findById(patientcode).orElse(null);
        int i = 0;
        List<String> failed = new ArrayList<>();
@ -1006,7 +1006,7 @@ public class ImService {
        JSONObject re = new JSONObject();
        boolean boo = StringUtils.isEmpty(getUnfinishedConsult(patient, doctor));
        logger.info("boo" + boo);
        WlyyHospitalSysDictDO sysDictDO = hospitalSysDictDao.getOne("consultClose");
        WlyyHospitalSysDictDO sysDictDO = hospitalSysDictDao.findById("consultClose").orElse(null);
        boolean flag = false;
        if (sysDictDO != null) {
            if (sysDictDO.getDictCode().equalsIgnoreCase("1")) {
@ -1046,7 +1046,7 @@ public class ImService {
        // 设置患者信息
        ct.setPatient(patient);
        // 查询患者信息
        BasePatientDO tempPatient = basePatientDao.getOne(patient);
        BasePatientDO tempPatient = basePatientDao.findById(patient).orElse(null);
        // 设置患者姓名
        ct.setName(tempPatient.getName());
        // 设置患者生日
@ -1238,7 +1238,7 @@ public class ImService {
        synchronized (outpatientCode.intern()) {
            //1、获取his就诊记录详情(保存续方表、药品续方信息表、续方疾病类型表)
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(outpatientCode);
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientCode).orElse(null);
            if (wxId.equalsIgnoreCase("xm_ykyy_wx")) {
                //眼科接诊时更新眼科通状态
@ -1257,12 +1257,12 @@ public class ImService {
            BaseDoctorDO doctor = baseDoctorDao.findByIdAndDel(doctorCode);
//			doctorCode = doctor.getCode();
            // 查询患者信息
            BasePatientDO p = basePatientDao.getOne(patient);
            BasePatientDO p = basePatientDao.findById(patient).orElse(null);
            if (!"0".equals(wlyyOutpatientDO.getStatus())) {
                throw new RuntimeException("该就诊记录已被取消,无法接单!");
            }
            BasePatientDO patientDO = basePatientDao.getOne(wlyyOutpatientDO.getPatient());
            BasePatientDO patientDO = basePatientDao.findById(wlyyOutpatientDO.getPatient()).orElse(null);
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("title", patientDO.getName() + "申请复诊");
            jsonObject.put("content", wlyyOutpatientDO.getDescription());
@ -1496,11 +1496,11 @@ public class ImService {
     */
    public JSONObject addConsult(String outpatientCode, String patient, String doctorCode, ConsultTeamDo ct, String reason, Integer type, String wxId, String source) throws Exception {
        //1、获取his就诊记录详情(保存续方表、药品续方信息表、续方疾病类型表)
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(outpatientCode);
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientCode).orElse(null);
        BaseDoctorDO doctor = baseDoctorDao.findByIdAndDel(doctorCode);
//			doctorCode = doctor.getCode();
        // 查询患者信息
        BasePatientDO p = basePatientDao.getOne(patient);
        BasePatientDO p = basePatientDao.findById(patient).orElse(null);
        JSONObject jsonObject = new JSONObject();
        if ("3".equals(wlyyOutpatientDO.getOutpatientType())) {
            jsonObject.put("title", p.getName() + "申请咨询");
@ -1514,7 +1514,7 @@ public class ImService {
        jsonObject.put("sex", p.getSex());
        jsonObject.put("name", p.getName());
        if (null != wlyyOutpatientDO) {
            BasePatientDO outPatient = basePatientDao.getOne(wlyyOutpatientDO.getPatient());
            BasePatientDO outPatient = basePatientDao.findById(wlyyOutpatientDO.getPatient()).orElse(null);
            if (null != outPatient) {
                jsonObject.put("age", DateUtil.getAgeForIdcard(outPatient.getIdcard()));
                jsonObject.put("sex", outPatient.getSex());
@ -1743,7 +1743,7 @@ public class ImService {
        ConsultTeamDo consultTeam = consultTeamDao.findByConsult(consult);
        ConsultDo cons = consultDao.getOne(consult);
        ConsultDo cons = consultDao.findById(consult).orElse(null);
        if (consultTeam.getStatus() == 1) {
            return -1;
@ -1757,7 +1757,7 @@ public class ImService {
         * 发送评价消息
         */
        BaseDoctorDO doctor = baseDoctorDao.findByIdAndDel(consultTeam.getDoctor());
        BasePatientDO patient = basePatientDao.getOne(consultTeam.getPatient());
        BasePatientDO patient = basePatientDao.findById(consultTeam.getPatient()).orElse(null);
        JSONObject evalueContent = new JSONObject();
        evalueContent.put("patientCode", consultTeam.getPatient());
        evalueContent.put("patientName", patient.getName());
@ -1774,7 +1774,7 @@ public class ImService {
        JSONObject obj = new JSONObject();
        //结束咨询才发送推送给IM文字消息
        if (endType == 1) {
            BasePatientDO p = basePatientDao.getOne(endOperator);
            BasePatientDO p = basePatientDao.findById(endOperator).orElse(null);
            endName = p.getName();
            endId = p.getId();
            obj = imUtil.endTopics(consultTeam.getPatient(), endId, endName, consultTeam.getConsult());
@ -1897,7 +1897,7 @@ public class ImService {
        ConsultTeamDo consultTeam = consultTeamDao.findByConsult(consult);
        ConsultDo cons = consultDao.getOne(consult);
        ConsultDo cons = consultDao.findById(consult).orElse(null);
        if (consultTeam.getStatus() == 1) {
            return -1;
@ -1911,7 +1911,7 @@ public class ImService {
         * 发送评价消息
         */
        BaseDoctorDO doctor = baseDoctorDao.findByIdAndDel(consultTeam.getDoctor());
        BasePatientDO patient = basePatientDao.getOne(consultTeam.getPatient());
        BasePatientDO patient = basePatientDao.findById(consultTeam.getPatient()).orElse(null);
		/*JSONObject evalueContent = new JSONObject();
		evalueContent.put("patientCode",consultTeam.getPatient());
		evalueContent.put("patientName",patient.getName());
@ -1931,7 +1931,7 @@ public class ImService {
        JSONObject obj = new JSONObject();
        //结束咨询才发送推送给IM文字消息
        if (endType == 1) {
            BasePatientDO p = basePatientDao.getOne(endOperator);
            BasePatientDO p = basePatientDao.findById(endOperator).orElse(null);
            endName = p.getName();
            endId = p.getId();
            obj = imUtil.endTopics(consultTeam.getPatient(), endId, endName, consultTeam.getConsult());
@ -2026,7 +2026,7 @@ public class ImService {
        net.sf.json.JSONObject data = new net.sf.json.JSONObject();
        data.put("name", patient.getName());
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(consultTeam.getRelationCode());
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(consultTeam.getRelationCode()).orElse(null);
        if (wlyyOutpatientDO!=null){
            data.put("consumerName",wlyyOutpatientDO.getConsumerName());
        }
@ -2087,7 +2087,7 @@ public class ImService {
        ConsultTeamDo consultTeamDo = consultTeamDao.findByConsult(consult);
        ConsultDo consultDo = consultDao.getOne(consult);
        ConsultDo consultDo = consultDao.findById(consult).orElse(null);
        object.put("doctorCode", consultTeamDo.getDoctor());
        //支付状态
@ -2117,7 +2117,7 @@ public class ImService {
            result.put("consultDo", null);
        }
        BasePatientDO basePatientDO = null;
        basePatientDO = basePatientDao.getOne(patientCode);
        basePatientDO = basePatientDao.findById(patientCode).orElse(null);
        JSONObject patientinfoObj = new JSONObject();
        patientinfoObj.put("name", basePatientDO.getName());
@ -2278,11 +2278,11 @@ public class ImService {
            consultTeamDo.setEvaluateTime(new Date());
            consultTeamDao.save(consultTeamDo);
            ConsultDo consultDo = consultDao.getOne(consult);
            ConsultDo consultDo = consultDao.findById(consult).orElse(null);
            //如果是复诊咨询,或者协同门诊,则修改成已评价
            if (9 == consultDo.getType() || 12 == consultDo.getType() || 16 == consultDo.getType()) {
                WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(consultTeamDo.getRelationCode());
                WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(consultTeamDo.getRelationCode()).orElse(null);
                wlyyOutpatientDO.setEvaluateStatus("1");
                outpatientDao.save(wlyyOutpatientDO);
            }
@ -2382,7 +2382,7 @@ public class ImService {
        //获取诊断
        List<WlyyPrescriptionDiagnosisVO> wlyyPrescriptionDiagnosisVOS = wlyyPrescriptionVO.getDiagnosisVOs();
        if (wlyyPrescriptionDiagnosisVOS != null && wlyyPrescriptionDiagnosisVOS.size() != 0) {
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(wlyyPrescriptionVO.getOutpatientId());
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(wlyyPrescriptionVO.getOutpatientId()).orElse(null);
            if (wlyyOutpatientDO.getOutpatientType() != null) {
                if (wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("1") && wlyyOutpatientDO.getType().equalsIgnoreCase("1")) {
                    String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyOutpatientDO.getConsumer() + "_" + wlyyPrescriptionVO.getOutpatientId() + "_9", "24", JSON.toJSONString(wlyyPrescriptionDiagnosisVOS), "1", null);
@ -2400,7 +2400,7 @@ public class ImService {
        object.put("prescriptionid", wlyyPrescriptionVO.getId());
        object.put("ispay", wlyyPrescriptionVO.getPayStatus());
        if (infoVOs != null && infoVOs.size() != 0) {
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(wlyyPrescriptionVO.getOutpatientId());
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(wlyyPrescriptionVO.getOutpatientId()).orElse(null);
            if (wlyyOutpatientDO.getOutpatientType() != null) {
                if (wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("1") && wlyyOutpatientDO.getType().equalsIgnoreCase("1")) {
                    String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyOutpatientDO.getConsumer() + "_" + wlyyPrescriptionVO.getOutpatientId() + "_9", "27", JSON.toJSONString(object), "1", null);
@ -3253,7 +3253,7 @@ public class ImService {
        } else {
            JSONObject participants = new JSONObject();
            participants.put(patientCode, 0);
            BasePatientDO basePatientDO = basePatientDao.getOne(patientCode);
            BasePatientDO basePatientDO = basePatientDao.findById(patientCode).orElse(null);
            String patientSex = "";
            if (basePatientDO.getSex() != null && 1 == basePatientDO.getSex()) {
                patientSex = "男";
@ -3334,7 +3334,7 @@ public class ImService {
        BaseDoctorDO specialDoctor = baseDoctorDao.findByIdAndDel(special_doctor);
//			doctorCode = doctor.getCode();
        // 查询患者信息
        BasePatientDO p = basePatientDao.getOne(patient_code);
        BasePatientDO p = basePatientDao.findById(patient_code).orElse(null);
        String consultTitle = "居民:" + p.getName() + "(医生:)-" + specialDoctor.getName() + "发起咨询!";
@ -3733,7 +3733,7 @@ public class ImService {
            BaseDoctorDO doctor = baseDoctorDao.findByIdAndDel(outpatient.getDoctor());
//			doctorCode = doctor.getCode();
            // 查询患者信息
            BasePatientDO p = basePatientDao.getOne(outpatient.getPatient());
            BasePatientDO p = basePatientDao.findById(outpatient.getPatient()).orElse(null);
            String title = "";
            //协同门诊
@ -4332,7 +4332,7 @@ public class ImService {
                }
            }
            if (map.get("outpatientId") != null) {
                WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(map.get("outpatientId").toString());
                WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(map.get("outpatientId").toString()).orElse(null);
                map.put("deptName", wlyyOutpatientDO.getDeptName());
            }
            if (map.get("outpatientType") != null) {
@ -4605,7 +4605,7 @@ public class ImService {
                }
            }
            if (map.get("outpatientId") != null) {
                WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(map.get("outpatientId").toString());
                WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(map.get("outpatientId").toString()).orElse(null);
                map.put("deptName", wlyyOutpatientDO.getDeptName());
            }
            if (map.get("outpatientType") != null) {