|
|
@ -101,6 +101,11 @@ public class FirstAidService implements IFirstAidService{ |
|
|
|
|
|
|
|
@Override |
|
|
|
public void savePatient(PatientDto.SavePatient param, Long userId) { |
|
|
|
// 判断有无权限添加
|
|
|
|
OrganizationVo.Basic basic = organizationDao.getOrganization(param.getProjectId(), userId); |
|
|
|
if (basic == null) { |
|
|
|
throw new BaseException(DefaultCodeError.NO_DATA_MODIFY_PRIVILEGE); |
|
|
|
} |
|
|
|
//查找当前用户的职位和科室
|
|
|
|
OrganizationVo.MemberPosition memberPosition = organizationMemberDao.getMemberPosition(userId); |
|
|
|
log.info("当前用户的科室职位信息:{}",memberPosition); |
|
|
@ -128,6 +133,9 @@ public class FirstAidService implements IFirstAidService{ |
|
|
|
firstAid.setName(param.getName()); |
|
|
|
firstAid.setGender(param.getGender()); |
|
|
|
firstAid.setNation(param.getNation()); |
|
|
|
firstAid.setHospitalId(basic.getOrganizationId()); |
|
|
|
firstAid.setValueType(param.getValueType()); |
|
|
|
firstAid.setOperator(userId); |
|
|
|
if(StrUtil.isNotEmpty(param.getIdcard())){ |
|
|
|
if(!IdcardUtil.isValidCard(param.getIdcard())){ |
|
|
|
throw new BaseException(DefaultCodeError.IDCARD_ERROR); |
|
|
@ -139,6 +147,7 @@ public class FirstAidService implements IFirstAidService{ |
|
|
|
//添加急救成员
|
|
|
|
FirstAidMember firstAidMember = new FirstAidMember(); |
|
|
|
firstAidMember.setId(snowflake.nextId()); |
|
|
|
firstAidMember.setFirstAidId(firstAid.getId()); |
|
|
|
firstAidMember.setCreateUserId(userId); |
|
|
|
if(position == 1){ |
|
|
|
firstAidMember.setRecordUserId(userId); |
|
|
@ -172,6 +181,7 @@ public class FirstAidService implements IFirstAidService{ |
|
|
|
firstAidRecord.setAnswer(param.getSuspected()); |
|
|
|
firstAidRecord.setSubmitUserId(userId); |
|
|
|
firstAidRecord.setSubmitUserType((byte) 1); |
|
|
|
firstAidRecord.setOperator(userId); |
|
|
|
firstAidRecordMapper.insertSelective(firstAidRecord); |
|
|
|
//加日志
|
|
|
|
FirstAidRecordLog firstAidRecordLog = new FirstAidRecordLog(); |
|
|
@ -223,7 +233,7 @@ public class FirstAidService implements IFirstAidService{ |
|
|
|
firstAid.setNation(param.getNation()); |
|
|
|
firstAid.setGender(param.getGender()); |
|
|
|
if(StrUtil.isNotEmpty(param.getIdcard())){ |
|
|
|
if(IdcardUtil.isValidCard(param.getIdcard())){ |
|
|
|
if(!IdcardUtil.isValidCard(param.getIdcard())){ |
|
|
|
throw new BaseException(DefaultCodeError.IDCARD_ERROR); |
|
|
|
} |
|
|
|
firstAid.setIdcard(param.getIdcard()); |
|
|
|