Browse Source

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

chenweida 7 years ago
parent
commit
6093a02f2d

+ 0 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/GcHospitalController.java

@ -40,7 +40,6 @@ public class GcHospitalController {
    ) {
        List<Hospital> hospitals = hospitalService.getHospitals(null, provinceId, cityId, townId, hospitalName, hospitalId, page, pageSize);
        ;
        List<HospitalModel> hospitalModels = new ArrayList<>();
        for (Hospital hospital : hospitals) {
            HospitalModel hospitalModel = new HospitalModel();

+ 24 - 11
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcDoctorController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.third.gateway.controller.doctor;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.service.common.account.DoctorService;
@ -41,9 +42,14 @@ public class GcDoctorController {
            @ApiParam(name = "code", value = "医生code", required = true) @RequestParam(value = "code", required = true) String code
    ) {
        Doctor doctor = doctorService.findDoctorByCode(code);
        DoctorModel doctorModel = new DoctorModel();
        BeanUtils.copyProperties(doctor, doctorModel);
        return new ResultOneModel(doctorModel);
        DoctorModel doctorModel = null;
        if (doctor != null) {
            doctorModel = new DoctorModel();
            BeanUtils.copyProperties(doctor, doctorModel);
            return new ResultOneModel(doctorModel);
        } else {
            return new ResultOneModel(new JSONObject());
        }
    }
    @RequestMapping(value = "/doctors", method = RequestMethod.GET)
@ -57,11 +63,13 @@ public class GcDoctorController {
    ) {
        List<Doctor> doctors = doctorService.findDoctors(hospitalCode, name, level, page, pageSize);
        List<DoctorModel> doctorModelList = new ArrayList<>();
        doctors.stream().forEach(one -> {
            DoctorModel doctorModel = new DoctorModel();
            BeanUtils.copyProperties(one, doctorModel);
            doctorModelList.add(doctorModel);
        });
        if (doctors != null && doctors.size() > 0) {
            doctors.stream().forEach(one -> {
                DoctorModel doctorModel = new DoctorModel();
                BeanUtils.copyProperties(one, doctorModel);
                doctorModelList.add(doctorModel);
            });
        }
        return new ResultPageListModel(page, pageSize, doctorService.findDoctorCounts(hospitalCode, name, level), doctorModelList);
    }
@ -72,9 +80,14 @@ public class GcDoctorController {
            @ApiParam(name = "code", value = "患者code", required = true) @RequestParam(value = "code", required = true) String code
    ) {
        Patient patient = patientService.findByCode(code);
        PatientModel patientModel = new PatientModel();
        BeanUtils.copyProperties(patient, patientModel);
        return new ResultOneModel(patientModel);
        PatientModel patientModel = null;
        if (patientModel != null) {
            patientModel = new PatientModel();
            BeanUtils.copyProperties(patient, patientModel);
            return new ResultOneModel(patientModel);
        } else {
            return new ResultOneModel(new JSONObject());
        }
    }
}

+ 13 - 7
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/patient/GcPatientController.java

@ -9,6 +9,7 @@ import com.yihu.wlyy.web.third.gateway.vo.base.ResultOneModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONObject;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
@ -36,15 +37,20 @@ public class GcPatientController {
            @ApiParam(name = "code", value = "患者code", required = true) @RequestParam(value = "code", required = true) String code
    ) {
        Patient patient = patientService.findByCode(code);
        PatientModel patientModel = new PatientModel();
        SignFamily signFamily = signFamilyDao.findSignByPatient(patient.getCode());
        BeanUtils.copyProperties(patient, patientModel);
        if (signFamily != null) {
            patientModel.setIsSign(1);
        PatientModel patientModel = null;
        if (patient != null) {
            patientModel = new PatientModel();
            SignFamily signFamily = signFamilyDao.findSignByPatient(patient.getCode());
            BeanUtils.copyProperties(patient, patientModel);
            if (signFamily != null) {
                patientModel.setIsSign(1);
            } else {
                patientModel.setIsSign(0);
            }
            return new ResultOneModel(patientModel);
        } else {
            patientModel.setIsSign(0);
            return new ResultOneModel(new JSONObject());
        }
        return new ResultOneModel(patientModel);
    }

+ 3 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/base/ResultOneModel.java

@ -25,6 +25,9 @@ public class ResultOneModel<T> extends BaseResultModel {
        this.result = result;
    }
    public ResultOneModel() {
    }
    public ResultOneModel(Integer code, String message) {
        super(code, message);
    }