|
@@ -89,10 +89,12 @@ public class InpatientServiceImpl implements InpatientService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<InpatientListResponseData> inpatientList(InpatientListRequest request) throws Exception {
|
|
|
- int userId = ContextHelper.getCurrentUserIdWrapped();
|
|
|
- int hospId = BizUtil.getCurrentHospitalId();
|
|
|
+ public List<InpatientListResponseData> inpatientList(InpatientListRequest request) {
|
|
|
+ int userId = Checker.parseInt(request.getUserId());
|
|
|
List<InpatientListResponseData> list = new ArrayList<>();
|
|
|
+ if (userId <= 0) return list; // 这个接口进入小程序首页就会调用;如果用户没有授权,返回空数据,而不是弹出获取用户信息授权(会违反小程序审核规则);
|
|
|
+
|
|
|
+ int hospId = BizUtil.getCurrentHospitalId();
|
|
|
GetMedicalCardListRequest getMedicalCardListRequest = GetMedicalCardListRequest.newBuilder()
|
|
|
.setHospitalId(hospId)
|
|
|
.setUserId(userId)
|
|
@@ -123,26 +125,23 @@ public class InpatientServiceImpl implements InpatientService {
|
|
|
|
|
|
@Override
|
|
|
public List<DailyBillResponseData> dailyBillList(DailyBillRequest request) throws Exception {
|
|
|
+ int userId = Checker.parseInt(request.getUserId());
|
|
|
List<DailyBillResponseData> dailyBillList = new ArrayList<>();
|
|
|
- List<MedicalCard> userMedCardList = new ArrayList<>();
|
|
|
- int userId = ContextHelper.getCurrentUserIdWrapped();
|
|
|
- String hospitalId = request.getHospitalDistrictId();
|
|
|
+ if (userId <= 0) return dailyBillList; // 这个接口进入小程序首页就会调用;如果用户没有授权,返回空数据,而不是弹出获取用户信息授权(会违反小程序审核规则);
|
|
|
+
|
|
|
String date = DateUtil.formatDate(new Date(), "yyyy-MM-dd");
|
|
|
- int hospId = BizUtil.getCurrentHospitalId(); // fixme
|
|
|
-// String hisPatientId = "";
|
|
|
- userMedCardList = getUserMedCardList(userId, hospId);
|
|
|
+ int hospId = BizUtil.getCurrentHospitalId();
|
|
|
+ List<MedicalCard> userMedCardList = getUserMedCardList(userId, hospId);
|
|
|
if (Checker.isNone(userMedCardList)) {
|
|
|
return dailyBillList;
|
|
|
}
|
|
|
for (MedicalCard m : userMedCardList) {
|
|
|
DailyBillResponseData data = new DailyBillResponseData();
|
|
|
- InpatientVo vo = null;
|
|
|
- String admNo = "";
|
|
|
String hisPatientId = m.getHisPatientId();
|
|
|
- vo = getInpatientVo(userId, hisPatientId);
|
|
|
+ InpatientVo vo = getInpatientVo(userId, hisPatientId);
|
|
|
String totalAmount = Checker.getStringValue(vo.getTotalAmount());
|
|
|
String depositBalance = Checker.getStringValue(vo.getDepositBalance());
|
|
|
- admNo = Checker.getStringValue(vo.getAdmNo());
|
|
|
+ String admNo = Checker.getStringValue(vo.getAdmNo());
|
|
|
GetDayFeeListRequest req = GetDayFeeListRequest.newBuilder()
|
|
|
.setPatientId(hisPatientId)
|
|
|
.setBillDate(date)
|