瀏覽代碼

甲类费用和乙类费用计算,还有自费的计算

xiaochan 3 年之前
父節點
當前提交
420bb3cf7a

+ 11 - 5
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/UpIdCollectionDao.java

@@ -10,7 +10,6 @@ import thyyxxk.webserver.entity.medicalinsurance.inpatient.BatjBa4;
 import thyyxxk.webserver.entity.medicalinsurance.inpatient.YbZyDisDiag;
 import thyyxxk.webserver.entity.medicalinsurance.inpatient.ZyDisDiagYb;
 import thyyxxk.webserver.entity.medicalinsurance.inpatient.ZyInactpatient;
-import thyyxxk.webserver.entity.medicalinsurance.query.SiPatInfo;
 import thyyxxk.webserver.entity.medicalinsurance.setllistupld.*;
 import thyyxxk.webserver.entity.querydata.SiSetlinfoTemp;
 
@@ -295,14 +294,21 @@ public interface UpIdCollectionDao {
     List<IteminfoUpld> totalCost(@Param("setlId") String setlId);
 
     @Select("select  med_chrgitm_type    as med_chrgitm,\n" +
-            "        sum(det_item_fee_sumamt)  as ${feeName} " +
+            "        sum(det_item_fee_sumamt - fulamt_ownpay_amt)  as ${feeName} " +
             "from t_si_setl_fee_detl " +
             "where setl_id = #{setlId} " +
             "  and chrgitm_lv = #{chrgitmLv} " +
             "group by med_chrgitm_type")
-    List<IteminfoUpld> aAndBAndCFees(@Param("setlId") String setlId,
-                                     @Param("chrgitmLv") String chrgitmLv,
-                                     @Param("feeName") String feeName);
+    List<IteminfoUpld> aAndBFees(@Param("setlId") String setlId,
+                                 @Param("chrgitmLv") String chrgitmLv,
+                                 @Param("feeName") String feeName);
+
+    @Select("SELECT med_chrgitm_type       as med_chrgitm,\n" +
+            "       sum(fulamt_ownpay_amt) as fulamtOwnpayAmt\n" +
+            "FROM t_si_setl_fee_detl " +
+            "where setl_id = #{setlId}  " +
+            "group by med_chrgitm_type")
+    List<IteminfoUpld> patientPays(@Param("setlId") String setlId);
 
     @Select("SELECT sum(DATEDIFF(second, start_time, end_time))\n" +
             "from yz_inact_order\n" +

+ 3 - 3
src/main/java/thyyxxk/webserver/service/medicalinsurance/SetlListUpldService.java

@@ -241,11 +241,11 @@ public class SetlListUpldService {
         setlinfoUpld.setBillCode("143001913350");
         setlinfoUpld.setBizSn(SnowFlakeId.instance().nextId());
         // 甲类费用
-        Map<String, IteminfoUpld> jiaLeiFeiYong = dao.aAndBAndCFees(setlId, "01", "claaSumfee").stream().collect(Collectors.toMap(IteminfoUpld::getMedChrgitm, a -> a, (k1, k2) -> k1));
+        Map<String, IteminfoUpld> jiaLeiFeiYong = dao.aAndBFees(setlId, "01", "claaSumfee").stream().collect(Collectors.toMap(IteminfoUpld::getMedChrgitm, a -> a, (k1, k2) -> k1));
         // 乙类费用
-        Map<String, IteminfoUpld> yiLeiFeiYong = dao.aAndBAndCFees(setlId, "02", "clabAmt").stream().collect(Collectors.toMap(IteminfoUpld::getMedChrgitm, a -> a, (k1, k2) -> k1));
+        Map<String, IteminfoUpld> yiLeiFeiYong = dao.aAndBFees(setlId, "02", "clabAmt").stream().collect(Collectors.toMap(IteminfoUpld::getMedChrgitm, a -> a, (k1, k2) -> k1));
         // 自费
-        Map<String, IteminfoUpld> fulamtOwnpayAmt = dao.aAndBAndCFees(setlId, "03", "fulamtOwnpayAmt").stream().collect(Collectors.toMap(IteminfoUpld::getMedChrgitm, a -> a, (k1, k2) -> k1));
+        Map<String, IteminfoUpld> fulamtOwnpayAmt = dao.patientPays(setlId).stream().collect(Collectors.toMap(IteminfoUpld::getMedChrgitm, a -> a, (k1, k2) -> k1));
         if (ListUtil.notBlank(amtAndOthAmt)) {
             for (IteminfoUpld item : amtAndOthAmt) {
                 String key = item.getMedChrgitm();