Bladeren bron

优化医保费用上传

lighter 3 jaren geleden
bovenliggende
commit
accd40b929

+ 4 - 4
src/main/java/thyyxxk/sizyfeeoprnsystm/dao/SiZyDao.java

@@ -90,7 +90,7 @@ public interface SiZyDao {
             "medType=(select med_type from t_si_pat_info b where b.pat_no=inpatient_no and b.times=admiss_times and b.ledger_sn=a.ledger_sn), " +
             "medListCodg=isnull((select max(national_code) from yp_zd_dict where code=charge_code_mx),(select max(national_code) from zd_charge_item where code=charge_code_mx)), " +
             "bilgDeptName=(select name from zd_unit_code where code=ward_code), " +
-            "bilgDrCodg=(select rtrim(isnull(yb_code,code)) from a_employee_mi where code=isnull(isnull(doctor_code,refer_physician), op_id_code)) , " +
+            "bilgDrCodg=(select rtrim(isnull(yb_code,code)) from a_employee_mi where code=isnull(isnull(nullif(doctor_code,''),refer_physician),op_id_code)) , " +
             "bilgDrName=isnull(isnull((select rtrim(name) from a_employee_mi where code=doctor_code), " +
             "(select rtrim(name) from a_employee_mi where code=refer_physician)),(select rtrim(name) from a_employee_mi where code=op_id_code)) " +
             "from zy_detail_charge a where inpatient_no=#{patNo} and admiss_times=#{times} and " +
@@ -126,7 +126,7 @@ public interface SiZyDao {
             "medType=(select med_type from t_si_pat_info b where b.pat_no=inpatient_no and b.times=admiss_times and b.ledger_sn=a.ledger_sn), " +
             "medListCodg=isnull((select max(national_code) from yp_zd_dict where code=charge_code_mx),(select max(national_code) from zd_charge_item where code=charge_code_mx)), " +
             "bilgDeptName=(select name from zd_unit_code where code=ward_code), " +
-            "bilgDrCodg=(select rtrim(isnull(yb_code,code)) from a_employee_mi where code=isnull(isnull(doctor_code,refer_physician), op_id_code)) , " +
+            "bilgDrCodg=(select rtrim(isnull(yb_code,code)) from a_employee_mi where code=isnull(isnull(nullif(doctor_code,''),refer_physician), op_id_code)) , " +
             "bilgDrName=isnull(isnull((select rtrim(name) from a_employee_mi where code=doctor_code), " +
             "(select rtrim(name) from a_employee_mi where code=refer_physician)),(select rtrim(name) from a_employee_mi where code=op_id_code)) " +
             "from zy_detail_charge a where inpatient_no=#{patNo} and admiss_times=#{times} and " +
@@ -274,7 +274,7 @@ public interface SiZyDao {
             "medType=(select med_type from t_si_pat_info b where b.pat_no=inpatient_no and b.times=admiss_times and b.ledger_sn=a.ledger_sn), " +
             "medListCodg=isnull((select max(national_code) from yp_zd_dict where code=charge_code_mx),(select max(national_code) from zd_charge_item where code=charge_code_mx)), " +
             "bilgDeptName=(select name from zd_unit_code where code=ward_code), " +
-            "bilgDrCodg=(select rtrim(isnull(yb_code,code)) from a_employee_mi where code=isnull(isnull(doctor_code,refer_physician), op_id_code)) , " +
+            "bilgDrCodg=(select rtrim(isnull(yb_code,code)) from a_employee_mi where code=isnull(isnull(nullif(doctor_code,''),refer_physician), op_id_code)) , " +
             "bilgDrName=isnull(isnull((select rtrim(name) from a_employee_mi where code=doctor_code), " +
             "(select rtrim(name) from a_employee_mi where code=refer_physician)),(select rtrim(name) from a_employee_mi where code=op_id_code)) " +
             "from zy_detail_charge a where inpatient_no=#{patNo} and admiss_times=#{times} and " +
@@ -310,7 +310,7 @@ public interface SiZyDao {
             "medType=(select med_type from t_si_pat_info b where b.pat_no=inpatient_no and b.times=admiss_times and b.ledger_sn=a.ledger_sn), " +
             "medListCodg=isnull((select max(national_code) from yp_zd_dict where code=charge_code_mx),(select max(national_code) from zd_charge_item where code=charge_code_mx)), " +
             "bilgDeptName=(select name from zd_unit_code where code=ward_code), " +
-            "bilgDrCodg=(select rtrim(isnull(yb_code,code)) from a_employee_mi where code=isnull(isnull(doctor_code,refer_physician), op_id_code)) , " +
+            "bilgDrCodg=(select rtrim(isnull(yb_code,code)) from a_employee_mi where code=isnull(isnull(nullif(doctor_code,''),refer_physician), op_id_code)) , " +
             "bilgDrName=isnull(isnull((select rtrim(name) from a_employee_mi where code=doctor_code), " +
             "(select rtrim(name) from a_employee_mi where code=refer_physician)),(select rtrim(name) from a_employee_mi where code=op_id_code)) " +
             "from zy_detail_charge a where inpatient_no=#{patNo} and admiss_times=#{times} and " +

+ 1 - 1
src/main/java/thyyxxk/sizyfeeoprnsystm/service/SiZyFeeService.java

@@ -223,7 +223,7 @@ public class SiZyFeeService {
         String ref = JSONArray.toJSONString(fees);
         input.getJSONObject("input").put("feedetail", JSONArray.parse(ref));
         JSONObject result = exec.executeTrade(input, SiFunction.UPLOAD_HOSPITALIZATION_FEE_DETAILS);
-        log.info("【操作员:{}】,医保费用上传结果:{}", p.getStaffId(), result);
+        log.info("【操作员:{}】,医保费用上传:\n参数:{},\n结果:{}", p.getStaffId(), input, result);
         if (null != result) {
             if (result.getIntValue(RESULT_CODE) == 0) {
                 JSONArray array = result.getJSONObject(OUTPUT).getJSONArray("result");