Jelajahi Sumber

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

chenweida 8 tahun lalu
induk
melakukan
bbc7c6f58b

+ 8 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorAdminTeamMemberDao.java

@ -51,4 +51,12 @@ public interface DoctorAdminTeamMemberDao extends
    @Query("SELECT d FROM AdminTeamMember m, AdminTeam t, Doctor d WHERE t.id = ?1 AND t.id = m.teamId AND " +
            "m.doctorCode = d.code and  d.code != ?2 AND t.available = true and d.level != 1 ")
    List<Doctor> findAllHeathExcludeThis(long teamId, String doctorCode);
    /**
     * 判断该医生是否属于患者的签约行政团队
     */
    @Query("select m from AdminTeamMember m,SignFamily s where m.teamId = s.adminTeamId and s.status >0 and s.patient=?1 and m.doctorCode =?2")
    List<AdminTeamMember> findByAdminTeam(String patient,String doctorCode);
}

+ 7 - 12
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceService.java

@ -4,10 +4,13 @@ import java.util.*;
import com.yihu.wlyy.entity.device.Device;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeamMember;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeam;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeamMember;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.repository.deviece.DeviceDao;
import com.yihu.wlyy.repository.doctor.DoctorAdminTeamMemberDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.doctor.DoctorTeamDao;
import com.yihu.wlyy.repository.doctor.DoctorTeamMemberDao;
@ -49,10 +52,8 @@ public class PatientDeviceService extends BaseService {
	private PatientDao patientDao;
	@Autowired
	private DoctorTeamDao doctorTeamDao;
	private DoctorAdminTeamMemberDao doctorAdminTeamMemberDao;
	@Autowired
	private DoctorTeamMemberDao doctorTeamMemberDao;
	/**
	 * 保存患者设备
@ -149,15 +150,9 @@ public class PatientDeviceService extends BaseService {
		}
		boolean bo = false;
		//签约团队
		DoctorTeam dt =doctorTeamDao.findByPatientCode(patientCode);
		DoctorTeam dtSS = doctorTeamDao.findSsTeamByPatientCode(patientCode);
		//医生是否属于团队成员
		if(dt!=null && doctorTeamMemberDao.countMemberByTeamAndCode(dt.getCode(),doctorCode) > 0)
		{
			bo = true;
		}
		if(dtSS!=null && doctorTeamMemberDao.countMemberByTeamAndCode(dtSS.getCode(),doctorCode) > 0)
		//判断该医生是否属于患者的签约行政团队
		List<AdminTeamMember> adminTeamMembers = doctorAdminTeamMemberDao.findByAdminTeam(patientCode,doctorCode);
		if(adminTeamMembers!=null && adminTeamMembers.size()>0)
		{
			bo = true;
		}