|
@@ -405,6 +405,7 @@ public class IsvMedicCardServiceImpl implements IsvMedicCardService {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 修改就诊人
|
|
@Override
|
|
@Override
|
|
public UpdatePatientResponse updatePatient(UpdatePatientRequest request) throws Exception {
|
|
public UpdatePatientResponse updatePatient(UpdatePatientRequest request) throws Exception {
|
|
return null;
|
|
return null;
|
|
@@ -417,13 +418,22 @@ public class IsvMedicCardServiceImpl implements IsvMedicCardService {
|
|
int userId = ContextHelper.getCurrentUserIdWrapped();
|
|
int userId = ContextHelper.getCurrentUserIdWrapped();
|
|
int hospitalId = BizUtil.getCurrentHospitalId();
|
|
int hospitalId = BizUtil.getCurrentHospitalId();
|
|
// 如果不传诊疗卡 id,则查询本人诊疗卡
|
|
// 如果不传诊疗卡 id,则查询本人诊疗卡
|
|
- // 获取用户身份证
|
|
|
|
- User user = getUserInfoById(userId);
|
|
|
|
- String idNo = Checker.getStringValue(user.getIdno());
|
|
|
|
- MedicalCard c = getUserMedCardList(userId, hospitalId).stream()
|
|
|
|
- .filter(i -> StringHelper.isNullOrEmpty(idNo) ? i.getCardId() == Checker.parseInt(id) : idNo.equals(i.getIdNo()))
|
|
|
|
- .findFirst()
|
|
|
|
- .orElse(null);
|
|
|
|
|
|
+ MedicalCard c;
|
|
|
|
+ if (StringHelper.isNullOrEmpty(id)) {
|
|
|
|
+ // 获取用户身份证
|
|
|
|
+ User user = getUserInfoById(userId);
|
|
|
|
+ String idNo = Checker.getStringValue(user.getIdno());
|
|
|
|
+ c = getUserMedCardList(userId, hospitalId).stream()
|
|
|
|
+ .filter(i -> idNo.equals(i.getIdNo()))
|
|
|
|
+ .findFirst()
|
|
|
|
+ .orElse(null);
|
|
|
|
+ } else {
|
|
|
|
+ c = getUserMedCardList(userId, hospitalId).stream()
|
|
|
|
+ .filter(i -> i.getCardId() == Checker.parseInt(id))
|
|
|
|
+ .findFirst()
|
|
|
|
+ .orElse(null);
|
|
|
|
+ }
|
|
|
|
+
|
|
if (c == null) throw new AppMessageException("找不到诊疗卡信息");
|
|
if (c == null) throw new AppMessageException("找不到诊疗卡信息");
|
|
QueryPatientDetailResponse r = new QueryPatientDetailResponse();
|
|
QueryPatientDetailResponse r = new QueryPatientDetailResponse();
|
|
List<MedicCard> medicCards = new ArrayList<>();
|
|
List<MedicCard> medicCards = new ArrayList<>();
|
|
@@ -483,11 +493,11 @@ public class IsvMedicCardServiceImpl implements IsvMedicCardService {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 根据用户 id 获取用户信息
|
|
* 根据用户 id 获取用户信息
|
|
- *
|
|
|
|
*/
|
|
*/
|
|
public User getUserInfoById(int userId) throws AppMessageException {
|
|
public User getUserInfoById(int userId) throws AppMessageException {
|
|
UserResponse response = userServiceBlockingStub.findByUserId(UserRequest.newBuilder().setUserid(userId).build());
|
|
UserResponse response = userServiceBlockingStub.findByUserId(UserRequest.newBuilder().setUserid(userId).build());
|
|
- if (response.getResult().getCode() != ResultCode.SUCCEED) throw new AppMessageException("无法获取用户信息:" + response.getResult().getInfo());
|
|
|
|
|
|
+ if (response.getResult().getCode() != ResultCode.SUCCEED)
|
|
|
|
+ throw new AppMessageException("无法获取用户信息:" + response.getResult().getInfo());
|
|
return response.getUser();
|
|
return response.getUser();
|
|
}
|
|
}
|
|
}
|
|
}
|