update:医保对账医疗总金额统计逻辑更新
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -690,6 +690,28 @@ public class HisUtil {
|
|||||||
Element ybtcAmountElm = item.element("YBTCAmount");
|
Element ybtcAmountElm = item.element("YBTCAmount");
|
||||||
String ybtcAmount = ybtcAmountElm != null ? ybtcAmountElm.getText() : "";
|
String ybtcAmount = ybtcAmountElm != null ? ybtcAmountElm.getText() : "";
|
||||||
|
|
||||||
|
// 退款场景下,确保医保账户金额和统筹金额为负数
|
||||||
|
try {
|
||||||
|
if (amount != null && amount.trim().length() > 0) {
|
||||||
|
java.math.BigDecimal amt = new java.math.BigDecimal(amount.trim());
|
||||||
|
if (amt.compareTo(java.math.BigDecimal.ZERO) < 0) {
|
||||||
|
if (ybzhAmount != null && ybzhAmount.trim().length() > 0) {
|
||||||
|
java.math.BigDecimal ybzh = new java.math.BigDecimal(ybzhAmount.trim());
|
||||||
|
if (ybzh.compareTo(java.math.BigDecimal.ZERO) > 0) {
|
||||||
|
ybzhAmount = ybzh.negate().toPlainString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ybtcAmount != null && ybtcAmount.trim().length() > 0) {
|
||||||
|
java.math.BigDecimal ybtc = new java.math.BigDecimal(ybtcAmount.trim());
|
||||||
|
if (ybtc.compareTo(java.math.BigDecimal.ZERO) > 0) {
|
||||||
|
ybtcAmount = ybtc.negate().toPlainString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception ignore) {
|
||||||
|
}
|
||||||
|
|
||||||
//收据号
|
//收据号
|
||||||
Element receiptNOElm = item.element("ReceiptNO");
|
Element receiptNOElm = item.element("ReceiptNO");
|
||||||
String receiptNO = receiptNOElm != null ? receiptNOElm.getText() : "";
|
String receiptNO = receiptNOElm != null ? receiptNOElm.getText() : "";
|
||||||
|
|||||||
@@ -286,11 +286,7 @@
|
|||||||
t.insutype as INSUTYPE,
|
t.insutype as INSUTYPE,
|
||||||
t.clr_type as CLR_TYPE,
|
t.clr_type as CLR_TYPE,
|
||||||
count(distinct t.HisTransId) as FIXMEDINS_SETL_CNT,
|
count(distinct t.HisTransId) as FIXMEDINS_SETL_CNT,
|
||||||
cast(
|
cast(IFNULL(sum(t.total_amt),0) as decimal(19,2)) as MEDFEE_SUMAMT,
|
||||||
IFNULL(sum(t.ybtc),0)
|
|
||||||
+ IFNULL(sum(case when t.is_inpatient = 1 then 0 else t.ybzh_non_refund end),0)
|
|
||||||
+ IFNULL(sum(t.zf),0)
|
|
||||||
as decimal(19,2)) as MEDFEE_SUMAMT,
|
|
||||||
cast(IFNULL(sum(t.ybtc),0) as decimal(19,2)) as FUND_PAY_SUMAMT,
|
cast(IFNULL(sum(t.ybtc),0) as decimal(19,2)) as FUND_PAY_SUMAMT,
|
||||||
cast(IFNULL(sum(t.ybzh),0) as decimal(19,2)) as ACCT_PAY
|
cast(IFNULL(sum(t.ybzh),0) as decimal(19,2)) as ACCT_PAY
|
||||||
from (
|
from (
|
||||||
@@ -298,6 +294,7 @@
|
|||||||
insutype,
|
insutype,
|
||||||
clr_type,
|
clr_type,
|
||||||
HisTransId,
|
HisTransId,
|
||||||
|
sum(cast(IFNULL(Amount,0) as decimal(19,2))) as total_amt,
|
||||||
max(cast(IFNULL(ybtcAmount,0) as decimal(19,2))) as ybtc,
|
max(cast(IFNULL(ybtcAmount,0) as decimal(19,2))) as ybtc,
|
||||||
max(cast(IFNULL(ybzhAmount,0) as decimal(19,2))) as ybzh,
|
max(cast(IFNULL(ybzhAmount,0) as decimal(19,2))) as ybzh,
|
||||||
max(case when TradingStatus != '2' then cast(IFNULL(ybzhAmount,0) as decimal(19,2)) else 0 end) as ybzh_non_refund,
|
max(case when TradingStatus != '2' then cast(IFNULL(ybzhAmount,0) as decimal(19,2)) else 0 end) as ybzh_non_refund,
|
||||||
|
|||||||
Reference in New Issue
Block a user