SettlementForm.cs 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using Newtonsoft.Json.Linq;
  11. using PTMedicalInsurance.Variables;
  12. using PTMedicalInsurance.Business;
  13. using PTMedicalInsurance.Common;
  14. using PTMedicalInsurance.Helper;
  15. using PTMedicalInsurance.FormSetter;
  16. namespace PTMedicalInsurance.Forms
  17. {
  18. public partial class SettlementForm : Form
  19. {
  20. //1.声明自适应类实例
  21. AutoResizeForm asc = new AutoResizeForm();
  22. private InvokeHelper invoker = new InvokeHelper();
  23. public DataTable dtSettlmentDetail;
  24. //险种
  25. public string insuType { get; set; }
  26. public SettlementForm()
  27. {
  28. InitializeComponent();
  29. //this.StartPosition = FormStartPosition.CenterParent;
  30. asc.controllInitializeSize(this);
  31. asc.controlAutoSize(this);
  32. }
  33. public SettlementForm(JObject jo)
  34. {
  35. InitializeComponent();
  36. JObject joSettlmentInfo = JObject.FromObject(jo["setlinfo"]);
  37. dtSettlmentDetail = (DataTable)jo["setldetail"].ToObject(typeof(DataTable));
  38. this.tbAdmCertType.Text = joSettlmentInfo["mdtrt_cert_type"].Text();
  39. this.tbPsnCertType.Text = joSettlmentInfo["psn_cert_type"].Text();
  40. this.tbPsnCertNO.Text = joSettlmentInfo["certno"].Text();
  41. this.tbInsuType.Text = joSettlmentInfo["insutype"].Text();
  42. this.tbPersonType.Text = joSettlmentInfo["psn_type"].Text();
  43. this.tbMedType.Text = joSettlmentInfo["med_type"].Text();
  44. this.tbSumamt.Text = joSettlmentInfo["medfee_sumamt"].Text();
  45. this.tbFullOwnPay.Text = joSettlmentInfo["fulamt_ownpay_amt"].Text();
  46. this.tbOverLimitOwnPay.Text = joSettlmentInfo["overlmt_selfpay"].Text();
  47. this.tbPreSelfPay.Text = joSettlmentInfo["preselfpay_amt"].Text();
  48. this.tbInScopyAmount.Text = joSettlmentInfo["inscp_scp_amt"].Text();
  49. this.tbActualPayDeduLine.Text = joSettlmentInfo["act_pay_dedc"].Text();
  50. this.tbInsuFundPay.Text = joSettlmentInfo["hifp_pay"].Text();
  51. this.tbInsuFundPayRito.Text = joSettlmentInfo["pool_prop_selfpay"].Text();
  52. this.tbCvlserv_pay.Text = joSettlmentInfo["cvlserv_pay"].Text();
  53. this.tbHifes_pay.Text = joSettlmentInfo["hifes_pay"].Text();
  54. this.tbHifmi_pay.Text = joSettlmentInfo["hifmi_pay"].Text();
  55. this.tbWorkerLargeMedical.Text = joSettlmentInfo["hifob_pay"].Text();
  56. this.tbAssian.Text = joSettlmentInfo["maf_pay"].Text();
  57. this.tbOtherPay.Text = joSettlmentInfo["oth_pay"].Text();
  58. this.tbFundPaySummat.Text = joSettlmentInfo["fund_pay_sumamt"].Text();
  59. this.tbPsnSummat.Text = joSettlmentInfo["psn_part_amt"].Text();
  60. this.tbPsnAccountPaySummat.Text = joSettlmentInfo["acct_pay"].Text();
  61. this.tbPsnCashPay.Text = joSettlmentInfo["psn_cash_pay"].Text();
  62. this.tbHospitalPartAmount.Text = joSettlmentInfo["hosp_part_amt"].Text();
  63. this.tbBalc.Text = joSettlmentInfo["balc"].Text();
  64. this.tbAccountMutualAidAmount.Text = joSettlmentInfo["acct_mulaid_pay"].Text();
  65. this.tbClearingWay.Text = joSettlmentInfo["clr_way"].Text();
  66. this.tbClearingType.Text = joSettlmentInfo["clr_type"].Text();
  67. Global.Set.acctPay = joSettlmentInfo["acct_pay"].Text();
  68. this.tbMinpacuntDrugTracCnt.Text = Global.Set.minpacunt_drug_trac_cnt;
  69. this.tbMcsTracCnt.Text = Global.Set.mcs_trac_cnt;
  70. setDgvSettlDetailHeader();
  71. dgvSetlDetail.DataSource = dtSettlmentDetail;
  72. tcMain.SelectedIndex = 0;
  73. }
  74. private void AddDGVColumn(DataGridView dgv, string headerText, string dataPropertyName, int width = 120)
  75. {
  76. DataGridViewColumn newColumn = new DataGridViewTextBoxColumn();
  77. newColumn.HeaderText = headerText;
  78. newColumn.Width = width;
  79. newColumn.DataPropertyName = dataPropertyName;
  80. newColumn.Name = dataPropertyName;
  81. dgv.Columns.Add(newColumn);
  82. }
  83. private void setDgvSettlDetailHeader()
  84. {
  85. AddDGVColumn(dgvSetlDetail, "基金支付类型", "fund_pay_type", 80);
  86. AddDGVColumn(dgvSetlDetail, "符合政策范围金额", "inscp_scp_amt");
  87. AddDGVColumn(dgvSetlDetail, "本次可支付限额金额", "crt_payb_lmt_amt");
  88. AddDGVColumn(dgvSetlDetail, "基金支付金额", "fund_payamt");
  89. AddDGVColumn(dgvSetlDetail, "基金支付类型名称", "fund_pay_type_name", 300);
  90. AddDGVColumn(dgvSetlDetail, "结算过程信息", "setl_proc_info", 200);
  91. dgvSetlDetail.ColumnHeadersDefaultCellStyle.Font = new Font("宋体", 9, FontStyle.Bold);
  92. dgvSetlDetail.ColumnHeadersHeight = 40;
  93. }
  94. private void btnInsuFeel_Click(object sender, EventArgs e)
  95. {
  96. if (tcMain.SelectedIndex == 0)
  97. {
  98. GridViewSetter grdSetter = new GridViewSetter();
  99. grdSetter.SetHeaderTextOfSettltMentFeelDetailInfo(dgvInsuFeeUpload);
  100. string sqlStr;
  101. sqlStr = " SELECT distinct b.SerialNO, b.AdmID AS Adm_Dr,a.InsuName AS HISName,'' as Name,b.HISCode,b.MedInsuNO,b.Price,b.Sumamt,";
  102. sqlStr = sqlStr + " b.ChargeItemLevel,'' ChargeItemLevelName,b.SelfPayProp,b.UpLimitAmount,b.OverLimitAmount,";
  103. sqlStr = sqlStr + " b.InScopeAmount,b.FullOwnPayAmount,b.PreSelfPayAmount,b.LimitUsedFlag,b.MedicalChargeItemType,\"Count\" ";
  104. sqlStr = sqlStr + " FROM BS_MedInsuFeeUploadRecord b LEFT JOIN HB_MedInsuMapRelation a ";
  105. sqlStr = sqlStr + " ON a.Hospital_Dr=b.Hospital_Dr AND b.MedInsuNO=a.InsuCode ";
  106. sqlStr = sqlStr + " where b.MedInsuNO<>'' AND b.Hospital_Dr= " + Global.inf.hospitalDr;
  107. sqlStr = sqlStr + " and b.MdtrtID='" + Global.pat.mdtrtID + "'";
  108. JObject joSqlstr = new JObject();
  109. joSqlstr.Add("sqlStr", sqlStr);
  110. JArray jaParam = new JArray();
  111. jaParam.Add(joSqlstr);
  112. JObject joSettlQuery = new JObject();
  113. joSettlQuery.Add("params", jaParam);
  114. joSettlQuery.Add("code", "09010118");
  115. JObject joRtn = invoker.invokeInsuService(joSettlQuery.ToString(), "查询医保结算费用信息");
  116. DataTable dt = (DataTable)joRtn["result"]["data"].ToObject(typeof(DataTable));
  117. dgvInsuFeeUpload.DataSource = dt;
  118. tcMain.SelectedIndex = 1;
  119. }
  120. else
  121. tcMain.SelectedIndex = 0;
  122. }
  123. private void tcMain_SelectedIndexChanged(object sender, EventArgs e)
  124. {
  125. if (tcMain.SelectedIndex == 0)
  126. btnInsuFeel.Text = "结算费用信息查询";
  127. else
  128. btnInsuFeel.Text = "返 回";
  129. }
  130. private void btn_OK_Click(object sender, EventArgs e)
  131. {
  132. DialogResult = DialogResult.OK;
  133. }
  134. private void btn_Cancel_Click(object sender, EventArgs e)
  135. {
  136. DialogResult = DialogResult.Cancel;
  137. }
  138. }
  139. }