|
@@ -104,6 +104,7 @@ public class InpatientServiceImpl implements InpatientService {
|
|
|
for (MedicalCard medicalCard : getMedicalCardListResponse.getMedicalCardsList()) {
|
|
|
InpatientListResponseData data = new InpatientListResponseData();
|
|
|
data.setPatientId(medicalCard.getPatientId());
|
|
|
+ data.setInpatientId(medicalCard.getPatientId());
|
|
|
data.setInpatientName(medicalCard.getPatientName());
|
|
|
data.setSex(medicalCard.getSex() == 1 ? "男" : "女");
|
|
|
Date date = DateUtil.stringToDate(medicalCard.getBirthday(), DateUtil.DADE_FROMAT_YMD);
|
|
@@ -112,7 +113,7 @@ public class InpatientServiceImpl implements InpatientService {
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
- throw new AppMessageException("该用户没有绑定诊疗卡");
|
|
|
+ return list;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -127,7 +128,7 @@ public class InpatientServiceImpl implements InpatientService {
|
|
|
int userId = ContextHelper.getCurrentUserIdWrapped();
|
|
|
String hospitalId = request.getHospitalDistrictId();
|
|
|
String date = DateUtil.formatDate(new Date(), "yyyy-MM-dd");
|
|
|
- int hospId = Integer.parseInt(hospitalId); // fixme
|
|
|
+ int hospId = BizUtil.getCurrentHospitalId(); // fixme
|
|
|
// String hisPatientId = "";
|
|
|
userMedCardList = getUserMedCardList(userId, hospId);
|
|
|
if (Checker.isNone(userMedCardList)) {
|
|
@@ -194,7 +195,6 @@ public class InpatientServiceImpl implements InpatientService {
|
|
|
GetInPatInfoResponse resp = taiheServiceBlockingStub.getInPatInfo(req);
|
|
|
if (resp.getCode() == BaseResponse.SUCCEED) {
|
|
|
String totalAmount = String.format("%.2f", resp.getTotalAmount() / 100d);
|
|
|
- String.format("%.2f", resp.getDepositAmount() / 100d);
|
|
|
String depositBalance = String.format("%.2f", resp.getDepositBalance() / 100d);
|
|
|
vo.setAdmNo(resp.getAdmNo());
|
|
|
vo.setTotalAmount(totalAmount);
|
|
@@ -297,33 +297,96 @@ public class InpatientServiceImpl implements InpatientService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<DepositTradeListResponseData> queryTradeList(DepositTradeListRequest request) {
|
|
|
- return null;
|
|
|
+ public List<DepositTradeListResponseData> queryTradeList(DepositTradeListRequest request) throws Exception {
|
|
|
+ String hisPatientId = request.getInpatientId();
|
|
|
+ List<DepositTradeListResponseData> depositList = new ArrayList<>();
|
|
|
+ if (Checker.isNone(hisPatientId)) {
|
|
|
+ throw new AppMessageException("该用户没有绑定诊疗卡");
|
|
|
+ }
|
|
|
+ GetInPatInfoRequest req = GetInPatInfoRequest.newBuilder()
|
|
|
+ .setPatientId(hisPatientId)
|
|
|
+ .setHospitalId(BizUtil.getCurrentHospitalId())
|
|
|
+ .build();
|
|
|
+ GetInPatInfoResponse resp = taiheServiceBlockingStub.getInPatInfo(req);
|
|
|
+ if (resp.getCode() == BaseResponse.SUCCEED) {
|
|
|
+ String admNo = Checker.getStringValue(resp.getAdmNo());
|
|
|
+ GetCashListRequest requ = GetCashListRequest.newBuilder()
|
|
|
+ .setPatientId(hisPatientId)
|
|
|
+ .setAdmNo(admNo)
|
|
|
+ .setHospitalId(BizUtil.getCurrentHospitalId())
|
|
|
+ .build();
|
|
|
+ GetCashListResponse res = taiheServiceBlockingStub.getCashList(requ);
|
|
|
+ if (res.getCode() == BaseResponse.SUCCEED) {
|
|
|
+ List<CashListItem> list = res.getListList();
|
|
|
+ DepositTradeListResponseData da = new DepositTradeListResponseData();
|
|
|
+ for (CashListItem i : list) {
|
|
|
+ da.setInpatientName(Checker.getStringValue(i.getPayUserName()));
|
|
|
+ da.setAmount(String.format("%.2f", i.getPayAmout() / 100d));
|
|
|
+ da.setOutTradeNo(i.getReceiptNo());
|
|
|
+ da.setPayTime(i.getPayDate() + "" + i.getPayTime());
|
|
|
+ da.setTradeNo(Checker.getStringValue(""));
|
|
|
+ da.setDepositId(Checker.getStringValue(""));
|
|
|
+ String depositBalance = String.format("%.2f", resp.getDepositBalance() / 100d);
|
|
|
+ da.setDepositBalance(depositBalance);
|
|
|
+ da.setStatus(Checker.getStringValue(""));
|
|
|
+ da.setDepositId(Checker.getStringValue(i.getReceiptNo()));
|
|
|
+ depositList.add(da);
|
|
|
+ }
|
|
|
+ return depositList;
|
|
|
+ }
|
|
|
+ return depositList;
|
|
|
+ }
|
|
|
+ return depositList;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public DepositTradeDetailsResponseData queryTradeDetails(DepositTradeDetailsRequest request) throws Exception{
|
|
|
+ public DepositTradeDetailsResponseData queryTradeDetails(DepositTradeDetailsRequest request) throws Exception {
|
|
|
String hisPatientId = request.getHisPatientId();
|
|
|
- if(Checker.isNone(hisPatientId)){
|
|
|
+ if (Checker.isNone(hisPatientId)) {
|
|
|
throw new AppMessageException("该用户没有绑定诊疗卡");
|
|
|
}
|
|
|
+ if (Checker.isNone(request.getReceiptNo())) {
|
|
|
+ throw new AppMessageException("没有押金缴纳记录");
|
|
|
+ }
|
|
|
GetInPatInfoRequest req = GetInPatInfoRequest.newBuilder()
|
|
|
.setPatientId(hisPatientId)
|
|
|
- .setHospitalId(BizUtil.getHospitalIdByTerminalId(BizUtil.getCurrentTerminalWrapped()))
|
|
|
+ .setHospitalId(BizUtil.getCurrentHospitalId())
|
|
|
.build();
|
|
|
GetInPatInfoResponse resp = taiheServiceBlockingStub.getInPatInfo(req);
|
|
|
if (resp.getCode() == BaseResponse.SUCCEED) {
|
|
|
- String admNo = resp.getAdmNo();
|
|
|
+ String admNo = Checker.getStringValue(resp.getAdmNo());
|
|
|
GetCashListRequest requ = GetCashListRequest.newBuilder()
|
|
|
.setPatientId(hisPatientId)
|
|
|
.setAdmNo(admNo)
|
|
|
- .setHospitalId(BizUtil.getHospitalIdByTerminalId(BizUtil.getCurrentTerminalWrapped()))
|
|
|
+ .setHospitalId(BizUtil.getCurrentHospitalId())
|
|
|
.build();
|
|
|
GetCashListResponse res = taiheServiceBlockingStub.getCashList(requ);
|
|
|
DepositTradeDetailsResponseData data = new DepositTradeDetailsResponseData();
|
|
|
+ if (res.getCode() == BaseResponse.SUCCEED) {
|
|
|
+ List<CashListItem> list = res.getListList();
|
|
|
+ DepositTradeDetailsResponseData da = new DepositTradeDetailsResponseData();
|
|
|
+ for (CashListItem i : list) {
|
|
|
+ if (request.getReceiptNo().equals(i.getReceiptNo())) {
|
|
|
+ {
|
|
|
+ da.setInpatientName(Checker.getStringValue(i.getPayUserName()));
|
|
|
+ da.setAmount(String.format("%.2f", i.getPayAmout() / 100d));
|
|
|
+ da.setOutTradeNo(i.getReceiptNo());
|
|
|
+ da.setPayTime(i.getPayDate() + "" + i.getPayTime());
|
|
|
+ da.setTradeNo(Checker.getStringValue(""));
|
|
|
+ da.setDepositId(Checker.getStringValue(""));
|
|
|
+ String depositBalance = String.format("%.2f", resp.getDepositBalance() / 100d);
|
|
|
+ da.setDepositBalance(depositBalance);
|
|
|
+ da.setStatus(Checker.getStringValue(i.getPayFlag()));
|
|
|
+ da.setInpatientNo(hisPatientId);
|
|
|
+ return da;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ throw new AppMessageException("没有押金缴纳记录");
|
|
|
+ }
|
|
|
+ throw new AppMessageException("没有押金缴纳记录");
|
|
|
}
|
|
|
-
|
|
|
- return null;
|
|
|
+ throw new AppMessageException("没有押金缴纳记录");
|
|
|
}
|
|
|
|
|
|
@Override
|