Browse Source

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

chenweida 7 năm trước cách đây
mục cha
commit
aca1e3b2da

+ 32 - 4
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/common/account/CustomerController.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.entity.Patient;
import com.yihu.wlyy.entity.User;
import com.yihu.wlyy.entity.WlyyCustomerLog;
import com.yihu.wlyy.repository.ManageDictDao;
import com.yihu.wlyy.repository.PatientDao;
import com.yihu.wlyy.service.manager.account.CustomerService;
import com.yihu.wlyy.service.manager.family.FamilyMemberService;
import com.yihu.wlyy.service.manager.patient.AdminPatientService;
@ -19,6 +20,8 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -47,6 +50,10 @@ public class CustomerController extends BaseController {
    @Autowired
    private WlyyCustomerLogService wlyyCustomerLogService;
    @Autowired
    private PatientDao patientDao;
    @RequestMapping(value = "/login",method = RequestMethod.POST,produces="application/json;charset=UTF-8")
    @ResponseBody
    public String login(@ApiParam(name = "userName", value = "账号", required = true)@RequestParam(required = true, name = "userName") String userName,
@ -126,6 +133,7 @@ public class CustomerController extends BaseController {
        }
        Map<String, Object> resp = customerService.findServerInfo(patient);
        resp.put("patient",patient);
        return write(200,"查询成功","data",resp);
    }
@ -137,13 +145,33 @@ public class CustomerController extends BaseController {
    @ResponseBody
    public String findByMobile(@ApiParam(name = "mobile", value = "手机号", required = false)@RequestParam(required = true, name = "mobile") String mobile) throws Exception {
        Map<String, Object> resp = new HashMap<>();
        //根据条件查询病人信息
        Patient patient = patientService.findByMobile(mobile);
        if(patient ==null){
        List<Patient> patients = patientService.findByMobile(mobile);
        if(patients ==null || patients.size()==0){
            return write(-1,"未查询到");
        }else if(patients.size()==1){
            Patient patient = patients.get(0);
            resp = customerService.findServerInfo(patients.get(0));
            resp.put("patient",patient);
            return write(200,"查询成功","data",resp);
        }
        Map<String, Object> resp = customerService.findServerInfo(patient);
        resp.put("patient",patient);
        resp.put("patients",patients);
        return write(200,"查询成功","data",resp);
    }
    /**
     *通过居民code,查找家庭关系,签约信息,医生等
     * @return
     */
    @RequestMapping(value = "/findByPatient",produces="application/json;charset=UTF-8")
    @ResponseBody
    public String findByPatient(@ApiParam(name = "patientCode", value = "居民code", required = false)@RequestParam(required = true, name = "patientCode") String patientCode) throws Exception {
        Patient patient = patientDao.findByCode(patientCode);
        Map<String, Object> respon = customerService.findServerInfo(patientCode);
        respon.put("patient",patient);
        return write(200,"查询成功","data",respon);
    }
}

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/PatientDao.java

@ -40,7 +40,7 @@ public interface PatientDao extends PagingAndSortingRepository<Patient, Long>,Jp
	// 根據手机号查詢患者信息
	@Query("select p from Patient p where p.mobile=?1")
	Patient findByMobile(String mobile);
	List<Patient> findByMobile(String mobile);
	// 根據病情等级获取患者信息
	@Query("select p from Patient p where p.diseaseCondition=?1")

+ 35 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/account/CustomerService.java

@ -58,4 +58,39 @@ public class CustomerService{
		return resp;
	}
	public Map<String,Object> findServerInfo(String patientCode) throws Exception {
		Map<String, Object> resp = new HashMap<>();
		//查找家庭成员关系
		List<Map<String, Object>> familyMembers = familyMemberService.getAllFamilyMembers(patientCode);
		resp.put("family",familyMembers);
		//查询签约信息
		SignFamily signInfo = contractService.findSignInfo(patientCode);
		//查询家庭成员的每个签约信息    以及签约医生
		List doctors = new ArrayList<Doctor>();
		if(signInfo!=null){
			signInfo.setStatusName("已签约");
			//查找全科医生
			String doctorCode = signInfo.getDoctor();
			if(StringUtils.isNotBlank(doctorCode)){
				Doctor doctor = hosDoctorService.getDoctorByCode(doctorCode);
				doctors.add(doctor);
			}
			//查找健康管理师
			String doctorHealthCode = signInfo.getDoctorHealth();
			if(StringUtils.isNotBlank(doctorHealthCode)){
				Doctor doctor = hosDoctorService.getDoctorByCode(doctorHealthCode);
				doctors.add(doctor);
			}
		}
		resp.put("signInfo",signInfo);
		resp.put("doctors",doctors);
		return resp;
	}
}

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/patient/AdminPatientService.java

@ -214,7 +214,7 @@ public class AdminPatientService extends BaseJpaService<Patient,Long> {
    }
    //根据手机号查找
    public Patient findByMobile(String mobile){
    public List<Patient> findByMobile(String mobile){
        return  patientDao.findByMobile(mobile);
    }
    //根据身份证号查找