修改超声工具新增患者方法 增加验证 重复的不允许添加
This commit is contained in:
parent
1f4e35e8c1
commit
8586d9fea8
@ -290,6 +290,11 @@ public class PatientexamlistServiceImpl extends ServiceImpl<PatientexamlistMappe
|
|||||||
if (createReqVOs != null && createReqVOs.size() > 0) {
|
if (createReqVOs != null && createReqVOs.size() > 0) {
|
||||||
for (PatientExamInfoAddReqVO createReqVO : createReqVOs) {
|
for (PatientExamInfoAddReqVO createReqVO : createReqVOs) {
|
||||||
if (createReqVO != null) {
|
if (createReqVO != null) {
|
||||||
|
// 检查是否已存在重复数据
|
||||||
|
if (isDuplicateData(createReqVO.getExamId(), createReqVO.getOrgId())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
patientexamlist = BeanUtils.toBean(createReqVO, PatientexamlistDO.class);
|
patientexamlist = BeanUtils.toBean(createReqVO, PatientexamlistDO.class);
|
||||||
|
|
||||||
dateTime = LocalDateTime.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
dateTime = LocalDateTime.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||||
@ -310,6 +315,12 @@ public class PatientexamlistServiceImpl extends ServiceImpl<PatientexamlistMappe
|
|||||||
return ids;
|
return ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isDuplicateData(String examId, String orgId) {
|
||||||
|
QueryWrapper<PatientexamlistDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("examId", examId)
|
||||||
|
.eq("orgId", orgId);
|
||||||
|
return patientexamlistMapper.selectCount(queryWrapper) > 0;
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public void updateExamItemNameById(String id, String examItemName) {
|
public void updateExamItemNameById(String id, String examItemName) {
|
||||||
validatePatientexamlistExists(id);
|
validatePatientexamlistExists(id);
|
||||||
@ -684,4 +695,6 @@ public class PatientexamlistServiceImpl extends ServiceImpl<PatientexamlistMappe
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user