‘chenzhilei’ hai 1 semana
pai
achega
b9b2d57e84

+ 27 - 9
src/main/java/cn/hnthyy/thmz/entity/mzdzfp/JSMzInvoiceInfo.java

@@ -56,19 +56,37 @@ public class JSMzInvoiceInfo implements Serializable {
         jsMzInvoiceInfo.setRec_name(mzInvoiceInfo.getIssuer());
         HisInfo hisInfo = new HisInfo();
         hisInfo.setPayee(mzInvoiceInfo.getIssuer());
+//        TradeInfo tradeInfo = new TradeInfo();
+//        tradeInfo.setOtherfund_pay(mzInvoiceInfo.getSetlInfo().getOtherPayAmount() == null ? BigDecimal.valueOf(0):mzInvoiceInfo.getSetlInfo().getOtherPayAmount());
+//        if (mzInvoiceInfo.getSpecialAttrDTO().getInsureTypeCode() == null) {
+//            tradeInfo.setOwn_pay(mzInvoiceInfo.getTotalAmount());
+//        } else {
+//            tradeInfo.setOwn_pay(mzInvoiceInfo.getSetlInfo().getPerSelfPayAmount() == null ? BigDecimal.valueOf(0):mzInvoiceInfo.getSetlInfo().getPerSelfPayAmount());
+//        }
+//
+//        tradeInfo.setCash_pay(mzInvoiceInfo.getSetlInfo().getPerCashPayAmount() == null ? BigDecimal.valueOf(0):mzInvoiceInfo.getSetlInfo().getPerCashPayAmount());
+//        tradeInfo.setAccount_pay(mzInvoiceInfo.getSetlInfo().getPerAccoPayAmount() == null ? BigDecimal.valueOf(0):mzInvoiceInfo.getSetlInfo().getPerAccoPayAmount());
+////        tradeInfo.setCash_pay(BigDecimal.valueOf(0));
+////        tradeInfo.setAccount_pay(BigDecimal.valueOf(0));
+//        tradeInfo.setFund_pay(mzInvoiceInfo.getSetlInfo().getInsureFundPay() == null ? BigDecimal.valueOf(0):mzInvoiceInfo.getSetlInfo().getInsureFundPay());
+//        hisInfo.setTrade_info(tradeInfo);
+
         TradeInfo tradeInfo = new TradeInfo();
-        tradeInfo.setOtherfund_pay(mzInvoiceInfo.getSetlInfo().getOtherPayAmount() == null ? BigDecimal.valueOf(0):mzInvoiceInfo.getSetlInfo().getOtherPayAmount());
-        if (mzInvoiceInfo.getSpecialAttrDTO().getInsureTypeCode() == null) {
+
+        if (mzInvoiceInfo.getSpecialAttrDTO().getInsureTypeCode() == null || mzInvoiceInfo.getSpecialAttrDTO().getInsureTypeCode() == "05") {
             tradeInfo.setOwn_pay(mzInvoiceInfo.getTotalAmount());
+            tradeInfo.setOtherfund_pay(BigDecimal.valueOf(0));
+            tradeInfo.setCash_pay(BigDecimal.valueOf(0));
+            tradeInfo.setAccount_pay(BigDecimal.valueOf(0));
         } else {
-            tradeInfo.setOwn_pay(mzInvoiceInfo.getSetlInfo().getPerSelfPayAmount() == null ? BigDecimal.valueOf(0):mzInvoiceInfo.getSetlInfo().getPerSelfPayAmount());
-        }
 
-//        tradeInfo.setCash_pay(mzInvoiceInfo.getSetlInfo().getPerCashPayAmount() == null ? BigDecimal.valueOf(0):mzInvoiceInfo.getSetlInfo().getPerCashPayAmount());
-//        tradeInfo.setAccount_pay(mzInvoiceInfo.getSetlInfo().getPerAccoPayAmount() == null ? BigDecimal.valueOf(0):mzInvoiceInfo.getSetlInfo().getPerAccoPayAmount());
-        tradeInfo.setCash_pay(BigDecimal.valueOf(0));
-        tradeInfo.setAccount_pay(BigDecimal.valueOf(0));
-        tradeInfo.setFund_pay(mzInvoiceInfo.getSetlInfo().getInsureFundPay() == null ? BigDecimal.valueOf(0):mzInvoiceInfo.getSetlInfo().getInsureFundPay());
+            tradeInfo.setOtherfund_pay(mzInvoiceInfo.getSetlInfo().getOtherPayAmount() == null ? BigDecimal.valueOf(0):mzInvoiceInfo.getSetlInfo().getOtherPayAmount());
+
+            tradeInfo.setAccount_pay(mzInvoiceInfo.getSetlInfo().getPerAccoPayAmount() == null ? BigDecimal.valueOf(0):mzInvoiceInfo.getSetlInfo().getPerAccoPayAmount());
+            tradeInfo.setFund_pay(mzInvoiceInfo.getSetlInfo().getInsureFundPay() == null ? BigDecimal.valueOf(0):mzInvoiceInfo.getSetlInfo().getInsureFundPay());
+            BigDecimal ownPay = mzInvoiceInfo.getSetlInfo().getPerSelfPayAmount().subtract(tradeInfo.getAccount_pay()).subtract(tradeInfo.getOtherfund_pay());
+            tradeInfo.setOwn_pay(ownPay);
+        }
         hisInfo.setTrade_info(tradeInfo);
 
         List<InvoiceDetail> invoiceDetailList = mzInvoiceInfo.getInvoiceDetailList();

+ 1 - 1
src/main/java/cn/hnthyy/thmz/service/impl/his/mzdzfp/BswServerImpl.java

@@ -695,7 +695,7 @@ public class BswServerImpl implements BswServer {
             if (CollUtil.isNotEmpty(map)) {
                 setlInfo = createSetlInfo(map);
                 setlInfo.setCertSetlType("1");
-                mzInvoiceInfo.getSpecialAttrDTO().setInsureTypeCode(InsutypeEnum.getByCode(setlInfo.getInsutype()) == null ? "04" : InsutypeEnum.getByCode(setlInfo.getInsutype()).getDzfpCode());
+                mzInvoiceInfo.getSpecialAttrDTO().setInsureTypeCode(InsutypeEnum.getByCode(setlInfo.getInsutype()) == null ? "05" : InsutypeEnum.getByCode(setlInfo.getInsutype()).getDzfpCode());
             }
         } else {
             setlInfo = setlInfo1;