Browse Source

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

chenweida 8 years ago
parent
commit
8f6f28a338

+ 4 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/SignFamilyDao.java

@ -45,18 +45,18 @@ public interface SignFamilyDao extends PagingAndSortingRepository<SignFamily, Lo
	@Query("select a from SignFamily a where a.doctor = ?1 and a.patient = ?2 and a.type = 2 and a.status >= 0")
	SignFamily findByDoctorPatient(String doctor, String patient);
	@Query("select a from SignFamily a where a.doctorHealth = ?1 and a.patient = ?2 and a.type = 2 and a.status >= 0")
	@Query("select a from SignFamily a where a.doctorHealth = ?1 and a.patient = ?2 and a.type = 2 and a.status >= 0 and a.adminTeamId=?2 ")
	SignFamily findByDoctorHealthPatient(String doctor, String patient);
	@Query("select p from Patient p,SignFamily a where a.doctorHealth = ?1 and a.patient =p.code and a.type = 2 and a.status >= 0")
	List<Patient> findByDoctorHealthPatient(String doctor);
	List<Patient> findByDoctorHealthPatient(String doctor,Long team);
	@Query("select p from Patient p,SignFamily a where (a.doctorHealth = ?1 or a.doctor=?2 ) and a.patient =p.code and a.type = 2 and a.status >= 0")
	List<Patient> findByDoctorOrDoctorHealthPatient(String doctorHealth,String doctor);
	@Query("select p from Patient p,SignFamily a where a.doctor = ?1 and a.patient =p.code and a.type = 2 and a.status >= 0")
	List<Patient> findByDoctorPatient(String doctor);
	@Query("select p from Patient p,SignFamily a where a.doctor = ?1 and a.adminTeamId=?2 and a.patient =p.code and a.type = 2 and a.status >= 0")
	List<Patient> findByDoctorPatient(String doctor,Long team);
	@Query("select a from SignFamily a where a.doctor = ?1 and a.patient = ?2 and a.type = 1 and a.status > 0")
	SignFamily findSsSignByDoctorPatient(String doctor, String patient);

+ 11 - 9
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -2093,26 +2093,26 @@ public class FamilyContractService extends BaseService {
        return result;
    }
    public Map<String, List<Patient>> getPatientByLevel(String doctorCode) {
    public Map<String, List<Patient>> getPatientByLevel(String doctorCode,Long team) {
        Map<String, List<Patient>> returnMap = new HashMap<>();
        Doctor doctor = doctorDao.findByCode(doctorCode);
        //判断当前用户是健康管理师还是全科
        if (doctor.getLevel() == 3) {
            //健康管理师
            List<Patient> jkgl = signFamilyDao.findByDoctorHealthPatient(doctorCode);
            List<Patient> jkgl = signFamilyDao.findByDoctorHealthPatient(doctorCode,team);
            returnMap.put("jk", jkgl);
        } else if (doctor.getLevel() == 2) {
            //全科医生
            List<Patient> qkys = signFamilyDao.findByDoctorPatient(doctorCode);
            List<Patient> qkys = signFamilyDao.findByDoctorPatient(doctorCode,team);
            returnMap.put("qk", qkys);
            //健康管理师
            List<Patient> jkgl = signFamilyDao.findByDoctorHealthPatient(doctorCode);
            List<Patient> jkgl = signFamilyDao.findByDoctorHealthPatient(doctorCode,team);
            returnMap.put("jk", jkgl);
        }
        return returnMap;
    }
    public JSONObject getPatientByLable(String doctorCode, String labelType, String level) throws Exception {
    public JSONObject getPatientByLable(String doctorCode, String labelType, String level,Long team) throws Exception {
        JSONObject returnMap = new JSONObject();
        Doctor doctor = doctorDao.findByCode(doctorCode);
        //判断当前用户是健康管理师还是全科
@ -2136,10 +2136,11 @@ public class FamilyContractService extends BaseService {
                    " WHERE " +
                    " sf.type = 2 " +
                    " AND sf. STATUS >= 0 " +
                    " and sf.doctor_health = ? ";
                    " and sf.doctor_health = ? "+
                    " and sf.admin_team_code = ? ";
            //查找居民
            datas = jdbcTemplate.queryForList(sql, labelType, doctorCode);
            datas = jdbcTemplate.queryForList(sql, labelType, doctorCode,team);
        } else if (level.equals("2")) {
            //全科
            String sql = "SELECT " +
@ -2159,10 +2160,11 @@ public class FamilyContractService extends BaseService {
                    " WHERE " +
                    " sf.type = 2 " +
                    " AND sf. STATUS >= 0 " +
                    " and  sf.doctor = ?  ";
                    " and  sf.doctor = ?  "+
                    " and sf.admin_team_code = ? ";
            //查找居民
            datas = jdbcTemplate.queryForList(sql, labelType, doctorCode, doctorCode);
            datas = jdbcTemplate.queryForList(sql, labelType, doctorCode, doctorCode,team);
        } else {
            throw new Exception("参数错误!");

+ 4 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java

@ -70,10 +70,10 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     */
    @RequestMapping(value = "getPatientByLevel")
    @ResponseBody
    public String getPatientByLevel(String doctorCode) {
    public String getPatientByLevel(String doctorCode,Long team) {
        try {
            JSONObject returnJO = new JSONObject();
            Map<String, List<Patient>> list = familyContractService.getPatientByLevel(doctorCode);
            Map<String, List<Patient>> list = familyContractService.getPatientByLevel(doctorCode,team);
            if (list != null && list.size() > 0) {
                for (Map.Entry<String, List<Patient>> entyr : list.entrySet()) {
                    JSONArray array = new JSONArray();
@ -116,9 +116,9 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     */
    @RequestMapping(value = "/getPatientByLable")
    @ResponseBody
    public String getPatientByLable(String labelType, String level, String doctorcode) {
    public String getPatientByLable(String labelType, String level, String doctorcode,Long team) {
        try {
            JSONObject list = familyContractService.getPatientByLable(doctorcode, labelType, level);
            JSONObject list = familyContractService.getPatientByLable(doctorcode, labelType, level,team);
            return write(200, "查询成功", "data", list);
        } catch (Exception e) {
            e.printStackTrace();