浏览代码

设备修改

lyr 8 年之前
父节点
当前提交
c8afd14c84

+ 6 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorTeamDao.java

@ -33,4 +33,10 @@ JpaSpecificationExecutor<DoctorTeam> {
	 */
	@Query("select dt from DoctorTeam dt,SignFamily sf  where dt.code=sf.teamCode and sf.type='2' and sf.status>=0 and sf.patient= ?1 and dt.del= '1'")
	DoctorTeam findByPatientCode(String patientCode);
	/**
	 * 通过患者获取家庭签约团队
	 */
	@Query("select dt from DoctorTeam dt,SignFamily sf  where dt.code=sf.teamCode and sf.type='1' and sf.status>=0 and sf.patient= ?1 and dt.del= '1'")
	DoctorTeam findSsTeamByPatientCode(String patientCode);
}

+ 1 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorTeamMemberDao.java

@ -49,7 +49,7 @@ public interface DoctorTeamMemberDao extends PagingAndSortingRepository<DoctorTe
    @Query(" FROM DoctorTeamMember a WHERE a.team =?1 and  a.del='1' and  a.signType='2' and  a.memberCode=?2 ")
    DoctorTeamMember findMemberByTeamAndCode(String teamCode, String oldDoctorCode);
    @Query("select count(a) FROM DoctorTeamMember a WHERE a.team =?1 and  a.del='1' and  a.signType='2' and  a.memberCode=?2 ")
    @Query("select count(a) FROM DoctorTeamMember a WHERE a.team =?1 and  a.del='1' and  a.memberCode=?2 ")
    int countMemberByTeamAndCode(String teamCode, String oldDoctorCode);
    /**

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

@ -151,11 +151,16 @@ 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)
		{
			bo = true;
		}
		PageRequest pageRequest = new PageRequest(page-1, pagesize);