Explorar el Código

费用上传页面,耗材优先显示27位编码

lighter hace 3 meses
padre
commit
807e3e124f

+ 18 - 4
src/main/java/thyyxxk/webserver/dao/his/inpatient/Routines.java

@@ -25,13 +25,27 @@ public interface Routines {
 
     @Select("select rtrim(inpatient_no) as patNo,admiss_times as times,ledger_sn,ori_detail_sn, " +
             "detail_sn,charge_code_mx,charge_amount,charge_fee,charge_date,yb_self_flag, " +
-            "yb_code=(select max(national_code) from ${zdTable} where code=charge_code_mx), " +
-            "charge_name=(select top 1 rtrim(name) from ${zdTable} where code=charge_code_mx) " +
+            "yb_code=(select max(national_code) from yp_zd_dict where code=charge_code_mx), " +
+            "charge_name=(select top 1 rtrim(name) from yp_zd_dict where code=charge_code_mx) " +
             "from zy_detail_charge where inpatient_no=#{patNo} and admiss_times=#{times} and " +
             "ledger_sn=#{ledgerSn} and isnull(trans_flag_yb,0)=0 and isnull(infant_flag,0)=0 " +
             "and charge_date<=#{today} and isnull(serial,'') in (#{serial1},#{serial2})")
-    IPage<NotUploadedFee> selectNotUploadedFees(IPage<NotUploadedFee> iPage,
-                                                @Param("zdTable") String zdTable,
+    IPage<NotUploadedFee> selectNotUploadedYpFees(IPage<NotUploadedFee> iPage,
+                                                @Param("patNo") String patNo,
+                                                @Param("times") int times,
+                                                @Param("ledgerSn") int ledgerSn,
+                                                @Param("today") String today,
+                                                @Param("serial1") String serial1,
+                                                @Param("serial2") String serial2);
+
+    @Select("select rtrim(inpatient_no) as patNo,admiss_times as times,ledger_sn,ori_detail_sn, " +
+            "detail_sn,charge_code_mx,charge_amount,charge_fee,charge_date,yb_self_flag, " +
+            "yb_code=(select isnull(national_code_27,national_code) from zd_charge_item where code=charge_code_mx), " +
+            "charge_name=(select rtrim(name) from zd_charge_item where code=charge_code_mx) " +
+            "from zy_detail_charge where inpatient_no=#{patNo} and admiss_times=#{times} and " +
+            "ledger_sn=#{ledgerSn} and isnull(trans_flag_yb,0)=0 and isnull(infant_flag,0)=0 " +
+            "and charge_date<=#{today} and isnull(serial,'') in (#{serial1},#{serial2})")
+    IPage<NotUploadedFee> selectNotUploadedXmFees(IPage<NotUploadedFee> iPage,
                                                 @Param("patNo") String patNo,
                                                 @Param("times") int times,
                                                 @Param("ledgerSn") int ledgerSn,

+ 10 - 4
src/main/java/thyyxxk/webserver/service/inpatient/PatientService.java

@@ -313,10 +313,16 @@ public class PatientService {
             serial1 = "01";
             serial2 = "99";
         }
-        iPage = param.getInjuryMode() ? routines.selectInjuryNotUploadedFees(iPage, param.getZdTable(),
-                param.getPatNo(), param.getTimes(), ledgerSn, DateUtil.getTodayEndTime(), serial1, serial2) :
-                routines.selectNotUploadedFees(iPage, param.getZdTable(), param.getPatNo(), param.getTimes(),
-                        ledgerSn, DateUtil.getTodayEndTime(), serial1, serial2);
+        if (param.getInjuryMode()) {
+            iPage = routines.selectInjuryNotUploadedFees(iPage, param.getZdTable(), param.getPatNo(),
+                    param.getTimes(), ledgerSn, DateUtil.getTodayEndTime(), serial1, serial2);
+        } else {
+            iPage = param.getZdTable().equals("yp_zd_dict") ?
+                    routines.selectNotUploadedYpFees(iPage, param.getPatNo(),
+                    param.getTimes(), ledgerSn, DateUtil.getTodayEndTime(), serial1, serial2)
+                    :routines.selectNotUploadedXmFees(iPage, param.getPatNo(),
+                    param.getTimes(), ledgerSn, DateUtil.getTodayEndTime(), serial1, serial2);
+        }
         map.put("totalSize", iPage.getTotal());
         map.put("list", iPage.getRecords());
         map.put("sum", routines.selectSumChargeFee(param.getPatNo(), param.getTimes(), ledgerSn,