123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using Newtonsoft.Json.Linq;
- using PTMedicalInsurance.Common;
- using PTMedicalInsurance.Forms;
- using PTMedicalInsurance.Forms.SettlementWithNopwdApplys;
- using PTMedicalInsurance.Helper;
- using PTMedicalInsurance.Variables;
- namespace PTMedicalInsurance.Business
- {
- class STA
- {
- //设置业务实例
- CenterBusiness cBus = new CenterBusiness();
- HisMainBusiness hBus = new HisMainBusiness();
- HisIrisServices hIS = new HisIrisServices();
- MIIrisServices mIS = new MIIrisServices();
- InvokeHelper invoker = new InvokeHelper();
- private XmlHelper xmler = new XmlHelper();
- public delegate void callBack(string errMsg);
- [STAThread]
- public void showOutPatientIntegratedServicesForm(object o)
- {
- string outParam = "";
- OutPatientIntegratedServices opis = new OutPatientIntegratedServices();
- opis.StartPosition = FormStartPosition.CenterScreen;
- try
- {
- IntPtr hwnd = WinApi.GetWindowsHandle("prBrowser");
- //opis.Owner = ((Form)(new WindowWrapper(hwnd));
- //是跨进程还是跨线程?
- opis.ShowDialog(new WindowWrapper(hwnd));
- ((object[])o)[0] = opis.rtnFlag;
- ((object[])o)[2] = opis.rtnMsg;
- }
- catch (Exception ex)
- {
- outParam = JsonHelper.setIrisReturnValue(-1, "门诊结算异常:" + ex.Message, null).ToString();
- ((object[])o)[0] = -1;
- ((object[])o)[2] = outParam;
- }
- }
- public void CallBack(string errMsg)
- {
- MessageBox.Show(errMsg);
- }
- [STAThread]
- public void print(object o)
- {
- string outParam = "", errMsg = "";
- try
- {
- //查询结算表
- string sqlStr = "SELECT * FROM BS_MedInsuSettlement WHERE billType = 1 and Hospital_Dr=" + Global.inf.hospitalDr
- + " and Adm_Dr=" + Global.pat.adm_Dr
- + " and MdtrtID='" + Global.pat.mdtrtID + "'"
- + " and SettlementID='" + Global.pat.settlID + "'";
- JObject joSql = new JObject();
- joSql.Add("sqlStr", sqlStr);
- JObject joSettlInfo = mIS.QuerySettlementInfo(joSql);
- JArray jaSettlInfo = JArray.Parse(JsonHelper.getDestValue(joSettlInfo, "result.data"));
- if (jaSettlInfo.Count == 0)
- {
- outParam = JsonHelper.setIrisReturnValue(-1, "未查询到结算数据", null).ToString();
- }
- Global.pat.insuplc_admdvs = JsonHelper.getDestValue(joSettlInfo, "result.data[0].insuplc_admdvs");
- Global.pat.insuType = JsonHelper.getDestValue(joSettlInfo, "result.data[0].InsuranceType");
- Global.pat.medType = JsonHelper.getDestValue(joSettlInfo, "result.data[0].MedicalType");
- Global.pat.psn_type = JsonHelper.getDestValue(joSettlInfo, "result.data[0].PersonType");
- dynamic joTmp = new JObject();
- joTmp.prm_akc190 = Global.pat.mdtrtID;
- joTmp.prm_yab003 = Global.pat.insuplc_admdvs;
- joTmp.prm_aka130 = Global.pat.medType;
- joTmp.prm_akc021 = Global.pat.psn_type;
- joTmp.prm_yka103 = Global.pat.settlID;
- joTmp.prm_ykb065 = Global.pat.insuType;
- joTmp.prm_yabtch = Global.pat.insuplc_admdvs;
- if (invoker.invokeYHCom("44", joTmp, out errMsg) != 0)
- {
- outParam = JsonHelper.setIrisReturnValue(-1, errMsg, null).ToString();
- }
- else
- {
- outParam = JsonHelper.setIrisReturnValue(0, "", null).ToString();
- }
- CallBack(outParam);
- }
- catch (Exception ex)
- {
- CallBack(ex.Message);
- }
- }
- [STAThread]
- public void MutualAid( object o)
- {
- string outParam = "", errMsg = "";
- try
- {
- MutualAid frmMA;
- if (o != null)
- {
- object[] s = (object[])o;
- string settId = s[0].ToString();
-
- if (settId != "")
- frmMA = new MutualAid(settId);
- else
- frmMA = new MutualAid();
- }
- else
- frmMA = new MutualAid();
- frmMA.WindowState = FormWindowState.Maximized;
- if (frmMA.ShowDialog() == DialogResult.OK)
- {
- ((object[])o)[1] = outParam;
- }
- else
- {
- outParam = JsonHelper.setIrisReturnValue(-1, "收款员取消共济支付撤销!", null).ToString();
- ((object[])o)[1] = outParam;
- }
- }
- catch (Exception ex)
- {
- outParam = JsonHelper.setIrisReturnValue(-1, "共济支付异常:" + ex.Message, null).ToString();
- ((object[])o)[1] = outParam;
- MessageBox.Show(ex.Message);
- }
- }
- [STAThread]
- public void MutualAid_(object o)
- {
- string outParam = "", errMsg = "";
- try
- {
- MutualAid frmMA;
- if (o != null)
- {
- object[] s = (object[])o;
- string inpar = s[0].ToString();
- JObject joInpar = JObject.Parse(inpar);
- string settId = JsonHelper.getDestValue(joInpar, "setl_id");
- frmMA = new MutualAid(joInpar);
- if (frmMA.dtSumumt.Rows.Count != 0)
- {
- frmMA.WindowState = FormWindowState.Maximized;
- if (frmMA.ShowDialog() == DialogResult.OK)
- {
- JObject joRtn = new JObject();
- joRtn.Add("settlRtn",frmMA.joMainSettlInfo);
- joRtn.Add("settlInfo", JObject.Parse(frmMA.finalSettlementInfo));
- outParam = JsonHelper.setIrisReturnValue(0, "共济支付", joRtn).ToString();
- ((object[])o)[1] = outParam;
- }
- else
- {
- outParam = JsonHelper.setExceptionJson(-1, "共济支付", "开启共济支付失败,原因为收款员取消共济支付!!").ToString();
- ((object[])o)[1] = outParam;
- }
- }
- else
- {
- outParam = JsonHelper.setExceptionJson(-1, "共济支付" , "开启共济支付失败,原因为未检测到有效的被共济人的医保结算数据!").ToString();
- ((object[])o)[1] = outParam;
- }
- }
- else
- {
- outParam = JsonHelper.setExceptionJson(-1, "MutualAid_", "入参为空!").ToString();
- ((object[])o)[1] = outParam;
- }
- }
- catch (Exception ex)
- {
- outParam = JsonHelper.setIrisReturnValue(-1, "共济支付异常:" + ex.Message, null).ToString();
- ((object[])o)[1] = outParam;
- }
- }
- [STAThread]
- public void Exception(object o)
- {
- try
- {
- //显示异常处理界面
- HandleException frmEX = new HandleException();
- frmEX.WindowState = FormWindowState.Maximized;
- frmEX.ShowDialog();
- }
- catch (Exception ex)
- {
- CallBack(ex.Message);
- }
- }
- [STAThread]
- public void MaternityInsuranceRegist(object o)
- {
- try
- {
- //显示异常处理界面
- MaternityInsuranceRegist frm = new MaternityInsuranceRegist();
- frm.WindowState = FormWindowState.Maximized;
- frm.ShowDialog();
- }
- catch (Exception ex)
- {
- CallBack(ex.Message);
- }
- }
- [STAThread]
- public void CheckAndClearing(object o)
- {
- try
- {
- //显示对账界面
- Clearing frm = new Clearing();
- frm.ShowDialog();
- }
- catch (Exception ex)
- {
- CallBack(ex.Message);
- }
- }
- [STAThread]
- public void BasicData(object o)
- {
- try
- {
- //显示异常处理界面
- BasicData frm = new BasicData();
- frm.WindowState = FormWindowState.Maximized;
- frm.ShowDialog();
- }
- catch (Exception ex)
- {
- CallBack(ex.Message);
- }
- }
- [STAThread]
- public void SettlementWithNopwdApply(object o)
- {
- try
- {
- //显示异常处理界面
- SettlementWithNopwdApply frm = new SettlementWithNopwdApply();
- frm.WindowState = FormWindowState.Maximized;
- frm.ShowDialog();
- }
- catch (Exception ex)
- {
- CallBack(ex.Message);
- }
- }
- }
- public class WindowWrapper : System.Windows.Forms.IWin32Window
- {
- public WindowWrapper(IntPtr handle)
- {
- _hwnd = handle;
- }
- public IntPtr Handle
- {
- get { return _hwnd; }
- }
- private IntPtr _hwnd;
- }
- }
|