Browse Source

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

wujunjie 7 years ago
parent
commit
9d0a598ef0

+ 25 - 16
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -2236,11 +2236,34 @@ public class ConsultTeamService extends ConsultService {
        String endName = "";
        String endId = "";
        //推送给IM文字消息
        //结束咨询才发送推送给IM文字消息
        if (endType == 1) {
            Patient p = patientDao.findByCode(endOperator);
            endName = p.getName();
            endId = p.getCode();
        } else {
            if (endOperator.equals("admin")) {
                endId = "system";
                endName = "咨询超时未回复,系统自动";
            } else {
                Doctor d = doctorDao.findByCode(endOperator);
                endId = d.getCode();
                endName = d.getName();
            }
        }
        JSONObject obj = ImUtill.endTopics(consultTeam.getPatient(), endId, endName, consultTeam.getConsult());
        if (obj == null) {
            throw new RuntimeException("IM消息结束异常!");
        }
        if (obj.getInt("status") == -1) {
            throw new RuntimeException(String.valueOf(obj.get("message")));
        }
        //结束咨询才发送推送给IM文字消息
        if (endType == 1) {
            Patient p = patientDao.findByCode(endOperator);
            endName = p.getName();
            if (consultTeam.getType() == 2||consultTeam.getType()==8) {
                String openId = p.getOpenid();
                JSONObject json = new JSONObject();
@ -2277,14 +2300,6 @@ public class ConsultTeamService extends ConsultService {
                }
            }
        } else {
            if (endOperator.equals("admin")) {
                endId = "system";
                endName = "咨询超时未回复,系统自动";
            } else {
                Doctor d = doctorDao.findByCode(endOperator);
                endId = d.getCode();
                endName = d.getName();
            }
            if (consultTeam.getType() == 2||consultTeam.getType()==8) {
                Patient p = patientDao.findByCode(consultTeam.getPatient());
                String name = p.getName();
@ -2328,13 +2343,7 @@ public class ConsultTeamService extends ConsultService {
            }
        }
        JSONObject obj = ImUtill.endTopics(consultTeam.getPatient(), endId, endName, consultTeam.getConsult());
        if (obj == null) {
            throw new RuntimeException("IM消息结束异常!");
        }
        if (obj.getInt("status") == -1) {
            throw new RuntimeException(String.valueOf(obj.get("message")));
        }
        consultTeam.setEndMsgId(obj.getString("id"));
        cons.setEndTime(new Date());
        consultTeam.setEndTime(new Date());

+ 5 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -1185,7 +1185,7 @@ public class PrescriptionInfoService extends BaseService {
                " e.expressage_name AS expressageName, " +
                " e.expressage_hospital_address AS expressageHospitalAddress, " +
                " e.expressage_hospital_name AS expressageHospitalName, " +
                " e.expressage_hospital_code AS expressageHospitalCode," +
                " e.expressage_hospital_code AS expressageHospitalCode, " +
                " e.patient_hospital_address AS patientHospitalAddress, " +
                " e.patient_hospital_name AS patientHospitalName, " +
                " e.patient_hospital_code AS patientHospitalCode " +
@ -1425,6 +1425,10 @@ public class PrescriptionInfoService extends BaseService {
    public JSONObject drugToRate(String code) {
        String val = redisTemplate.opsForValue().get("wlyy:dict:recipeFrequency:" + code);
        if(StringUtils.isBlank(val)){
            initDrugData();
            val = redisTemplate.opsForValue().get("wlyy:dict:recipeFrequency:" + code);
        }
        return new JSONObject(val);
    }