|
|
@@ -410,6 +410,16 @@ public class LocalAssistantUserBindService extends BaseService<AssistantUserBind
|
|
|
if(userBind==null){
|
|
|
return true;
|
|
|
}
|
|
|
+ if(!StrUtil.equals(userBind.getPatientId(),param.getPatientId())){
|
|
|
+ //病号未发生改变,判断该病人是否已被他人监护
|
|
|
+ AssistantUserBindEntity exist = this.getOne(new LambdaQueryWrapper<AssistantUserBindEntity>().
|
|
|
+ eq(AssistantUserBindEntity::getPatientId, param.getPatientId())
|
|
|
+ .eq(AssistantUserBindEntity::getStatus, BindEnum.SUCCESS)
|
|
|
+ .last("limit 1"));
|
|
|
+ if(exist!=null){
|
|
|
+ throw new CustomException("该病人已被他人看护,请重新选择");
|
|
|
+ }
|
|
|
+ }
|
|
|
boolean result = this.update(new UpdateWrapper<AssistantUserBindEntity>()
|
|
|
.lambda()
|
|
|
.eq(AssistantUserBindEntity::getId, param.getBindId())
|