yeshijie 7 rokov pred
rodič
commit
d4a35a618e

+ 13 - 8
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/guahao/GuahaoXMService.java

@ -51,7 +51,8 @@ public class GuahaoXMService implements IGuahaoService {
    @Autowired
    private PatientReservationDao patientReservationDao;
    @Autowired
    JwSmjkService jwSmjkService;
    @Autowired
    SignFamilyDao signFamilyDao;
@ -80,7 +81,13 @@ public class GuahaoXMService implements IGuahaoService {
        }
        // 查询医生职称和头像
        GuahaoDoctor doctor = GetDoctorInfo(doctorId, hospitalId, hosDeptId);
        GuahaoDoctor doctor = null;
        try{
            doctor = jwSmjkService.getGuahaoDoctor(doctorId, hospitalId, hosDeptId);
        }catch (Exception e){
            e.printStackTrace();
            System.out.println("获取医生信息失败");
        }
        // 保存预约记录
        PatientReservation reservation = new PatientReservation();
        reservation.setCode(code);
@ -92,8 +99,10 @@ public class GuahaoXMService implements IGuahaoService {
        reservation.setDeptName(hosDeptName);
        reservation.setDoctorCode(doctorId);
        reservation.setDoctorName(doctorName);
        reservation.setDoctorJob(doctor.getTitle());
        reservation.setDoctorPhoto(doctor.getPhoto());
        if(doctor!=null){
            reservation.setDoctorJob(doctor.getTitle());
            reservation.setDoctorPhoto(doctor.getPhoto());
        }
        reservation.setIdcard(cardNo);
        reservation.setName(patientName);
        reservation.setPatient(patient);
@ -1138,10 +1147,6 @@ public class GuahaoXMService implements IGuahaoService {
        }
    }
    @Autowired
    JwSmjkService jwSmjkService;
    /******************************** 基卫内网服务 ************************************************/
    public List<Map<String, Object>> GetDoctorArrangeTenDay(String hospitalId, String hosDeptId, String doctorId) throws Exception {

+ 42 - 43
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwSmjkService.java

@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.service.system.SystemDictService;
import com.yihu.wlyy.service.third.ehr.EhrService;
import com.yihu.wlyy.service.third.guahao.GuahaoDoctor;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.util.SystemConf;
@ -345,49 +346,6 @@ public class JwSmjkService {
        return re;
    }
    public String responseStr(String response) throws Exception{
        String re = "";
        if (!StringUtils.isEmpty(response)) {
            JSONObject jsonObject = new JSONObject(response);
            int status = jsonObject.getInt("status");
            if (status == 200) {
                JSONArray jsonArray = jsonObject.getJSONArray("data");
                re = jsonArray.toString();
//                re = jsonObject.getString("data");
            } else {
                String msg = "处理失败,请联系管理员";
                if(!jsonObject.isNull("msg")){
                    msg = jsonObject.getString("msg");
                }
                throw new Exception(msg);
            }
        } else {
            throw new Exception("null response.");
        }
        return re;
    }
    public Boolean responseBool(String response) throws Exception{
        boolean re = false;
        if (!StringUtils.isEmpty(response)) {
            JSONObject jsonObject = new JSONObject(response);
            int status = jsonObject.getInt("status");
            if (status == 200) {
                re = jsonObject.getBoolean("data");
            } else {
                String msg = "处理失败,请联系管理员";
                if(!jsonObject.isNull("msg")){
                    msg = jsonObject.getString("msg");
                }
                throw new Exception(msg);
            }
        } else {
            throw new Exception("null response.");
        }
        return re;
    }
    /**
     * 获取医院列表
     * @param type
@ -565,6 +523,47 @@ public class JwSmjkService {
        return response;
    }
    /**
     * 获取医生信息
     * @param hospitalId
     * @param hosDeptId
     * @param doctorId
     * @return
     * @throws Exception
     */
    public GuahaoDoctor getGuahaoDoctor(String hospitalId,String hosDeptId,String doctorId) throws Exception{
        String response = GetDoctorInfo(hospitalId,hosDeptId,doctorId);
        if (!StringUtils.isEmpty(response)) {
            JSONObject jsonObject = new JSONObject(response);
            int status = jsonObject.getInt("status");
            if (status == 200) {
                GuahaoDoctor doctor = new GuahaoDoctor();
                JSONObject json = jsonObject.getJSONObject("data");
                doctor.setId(json.isNull("id")?"":json.getString("id"));//医生编码
                doctor.setName(json.isNull("name")?"":json.getString("name"));//医生姓名
                doctor.setSex(json.isNull("sex")?"":json.getString("sex"));//医生性别
                doctor.setTitle(json.isNull("title")?"":json.getString("title"));//医生职称
                doctor.setEdu(json.isNull("edu")?"":json.getString("edu"));//医生学历
                doctor.setIntroduce(json.isNull("introduce")?"":json.getString("introduce"));//医生简介
                doctor.setPhoto(json.isNull("photo")?"":json.getString("photo"));//医生头像
                doctor.setFee(json.isNull("fee")?"":json.getString("fee"));//医生挂号费
                doctor.setHosDeptId(json.isNull("hosDeptId")?"":json.getString("hosDeptId"));//医生科室编码
                doctor.setHosDeptName(json.isNull("hosDeptName")?"":json.getString("hosDeptName"));//医生科室名称
                doctor.setHospitalId(json.isNull("hospitalId")?"":json.getString("hospitalId"));//医生医院编码
                doctor.setHospitalName(json.isNull("hospitalName")?"":json.getString("hospitalName"));//医生医院名称
                return doctor;
            } else {
                String msg = "处理失败,请联系管理员";
                if(!jsonObject.isNull("msg")){
                    msg = jsonObject.getString("msg");
                }
                throw new Exception(msg);
            }
        } else {
            throw new Exception("null response.");
        }
    }
    /**
     * 获取预约状态(0 撤销 1 确认 2 已诊  3停诊)
     * @param hospitalId