@ -67,6 +67,8 @@ public class FirstAidService implements IFirstAidService{
@Resource
private PatientDao patientDao ;
@Resource
private OrganizationProjectDao organizationProjectDao ;
@Resource
private RedisUtil redisUtil ;
@ -220,6 +222,36 @@ public class FirstAidService implements IFirstAidService{
return firstAid ;
}
@Override
public void delDemo ( FirstAidDto . Project param , Long userId ) {
FirstAid firstAid = firstAidDao . selectByPrimaryKey ( param . getFirstAidId ( ) ) ;
if ( ObjectUtil . isNull ( firstAid ) ) {
throw new BaseException ( DefaultCodeError . NOT_FIRST_AID_ID ) ;
}
if ( ObjectUtil . isNull ( firstAid . getValueType ( ) ) | | 1 ! = firstAid . getValueType ( ) ) {
throw new BaseException ( DefaultCodeError . NOT_FIRST_AID_ID ) ;
}
FirstAidMember byAidId = firstAidMemberDao . findByAidId ( param . getFirstAidId ( ) ) ;
if ( ! userId . equals ( byAidId . getCreateUserId ( ) ) ) {
throw new BaseException ( DefaultCodeError . NO_POWER ) ;
}
//删除急救
firstAid . setRecStatus ( ( byte ) 2 ) ;
firstAidDao . updateByPrimaryKeySelective ( firstAid ) ;
//删除first_aid_member
FirstAidMemberExample firstAidMemberExample = new FirstAidMemberExample ( ) ;
firstAidMemberExample . createCriteria ( ) . andFirstAidIdEqualTo ( param . getFirstAidId ( ) ) ;
FirstAidMember firstAidMember = new FirstAidMember ( ) ;
firstAidMember . setRecStatus ( ( byte ) 2 ) ;
firstAidMemberDao . updateByExampleSelective ( firstAidMember , firstAidMemberExample ) ;
//删除first_aid_record
FirstAidRecordExample firstAidRecordExample = new FirstAidRecordExample ( ) ;
firstAidRecordExample . createCriteria ( ) . andFirstAidIdEqualTo ( param . getFirstAidId ( ) ) ;
FirstAidRecord firstAidRecord = new FirstAidRecord ( ) ;
firstAidRecord . setRecStatus ( ( byte ) 2 ) ;
firstAidRecordMapper . updateByExampleSelective ( firstAidRecord , firstAidRecordExample ) ;
}
@Override
public PatientVo . GetPatient getPatient ( PatientDto . ProjectId param , Long userId ) {
PatientVo . GetPatient getPatient = new PatientVo . GetPatient ( ) ;
@ -328,9 +360,10 @@ public class FirstAidService implements IFirstAidService{
public PageInfo < PatientVo . PatientListByQuality > queryPatientListByQuality ( PatientDto . QueryListByQuality param , Long userId ) {
//根据项目id查找医院id
// FirstAid firstAid = firstAidDao.getIdByProjectId(param.getProjectId());
// if(ObjectUtil.isNull(firstAid) || ObjectUtil.isNull(firstAid.getHospitalId())){
// throw new BaseException(DefaultCodeError.NOT_HOSPITAL_ID);
// }
Long hid = organizationProjectDao . queryByProjectId ( param . getProjectId ( ) ) ;
if ( ObjectUtil . isNull ( hid ) ) {
throw new BaseException ( DefaultCodeError . NOT_HOSPITAL_ID ) ;
}
//查找当前用户的职位和科室
// OrganizationVo.MemberPosition memberPosition = organizationMemberDao.getMemberPosition(userId);
// //用户的科室必须是医院的科室
@ -360,7 +393,7 @@ public class FirstAidService implements IFirstAidService{
//查找病例信息
PageHelper . startPage ( param . getPageNum ( ) , param . getPageSize ( ) ) ;
// List<PatientVo.PatientListByQuality> patientList = firstAidDao.queryPatientListByQuality(template.getTemplates(),template.getOrganizationId(),param);
List < PatientVo . PatientListByQuality > patientList = firstAidDao . queryPatientListByQualityNew ( departmentIdList , departmentIdStr , param ) ;
List < PatientVo . PatientListByQuality > patientList = firstAidDao . queryPatientListByQualityNew ( departmentIdList , departmentIdStr , param , hid ) ;
return new PageInfo < > ( patientList ) ;
}