Selaa lähdekoodia

pref: 金额平衡优化

zhengjie 1 vuosi sitten
vanhempi
commit
032952aa3d
3 muutettua tiedostoa jossa 19 lisäystä ja 10 poistoa
  1. 5 3
      Business/IrisServices.cs
  2. 1 1
      Common/Utils.cs
  3. 13 6
      Helper/JsonMapper.cs

+ 5 - 3
Business/IrisServices.cs

@@ -521,7 +521,7 @@ namespace PTMedicalInsurance.Business
                       + getFee(jo, "poor_pay") //贫困人口再补助
                       + getFee(jo, "medis_pay"); //医疗减免金额
                       
-                ybAmt = getFee(jo, "fund_pay_sumamt");  //ybfdje(医保负担金额)
+                ybAmt = getFee(jo, "insu_part_amt");  //ybfdje(医保负担金额)
                 psnAcctAmt = getFee(jo, "acct_pay");     //账户支付金额
                 psnCashAmt = getFee(jo, "psn_cash_pay"); //现金支付金额
                 psnPartAmt = getFee(jo, "psn_part_amt");
@@ -533,9 +533,11 @@ namespace PTMedicalInsurance.Business
                 joSumFee.Add("psnCashAmt", psnCashAmt);
                 //zje(medfee_sumamt) = ybfdje(fund_pay_sumamt) + brfdje(psn_part_amt) + ylbzje(maf_pay) + yyfdje(hosp_part_amt) + yljmje(medis_pay) + pkryzjzje(poor_pay) + mzbzje(hifob_pay)
 
-                if (medFee != (ybAmt + psnPartAmt + hospAmt + otherAmt))
+                decimal total = (ybAmt + psnAcctAmt  + psnCashAmt + hospAmt + otherAmt);
+                if (medFee != total)
                 {
-                    errMsg = "ybAmt + psnPartAmt + hospAmt + otherAmt != medFee";
+                    Global.writeLog("ybAmt:"+ybAmt+ ",psnAcctAmt:" + psnAcctAmt + "psnCashAmt:"+ psnCashAmt + ",hospAmt:" + hospAmt+",otherAmt:"+otherAmt);
+                    errMsg = "总费用:" + medFee + "!= 医保费用:" + total;
                     return -1;
                 }
                 return 0;

+ 1 - 1
Common/Utils.cs

@@ -328,7 +328,7 @@ namespace PTMedicalInsurance.Common
                 joOutput = mapper.MapResponse<JObject, T>(response);
             }
             // 日志
-            //Global.writeLog("ConvertResponse", response.ToString(), joOutput.ToString());
+            Global.writeLog("ConvertResponse", "", joOutput.ToString());
             return joOutput;
         }
 

+ 13 - 6
Helper/JsonMapper.cs

@@ -32,16 +32,23 @@ namespace PTMedicalInsurance.Helper
 
         public void reload()
         {
-            // 加载字段映射配置
-            if (File.Exists(configFile))
+            try
             {
-                jsonConfig = File.ReadAllText(configFile);
+                // 加载字段映射配置
+                if (File.Exists(configFile))
+                {
+                    jsonConfig = File.ReadAllText(configFile);
 
-                setting = JsonHelper.toObject<JsonMappingSetting>(JObject.Parse(jsonConfig));
+                    setting = JsonHelper.toObject<JsonMappingSetting>(JObject.Parse(jsonConfig));
+                }
+                else
+                {
+                    setting = new JsonMappingSetting();
+                }
             }
-            else
+            catch (Exception ex)
             {
-                setting = new JsonMappingSetting();
+                throw new Exception("配置文件异常:"+ex.Message);
             }
         }