| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- 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 PTMedInsuInterface.Helper;
- using PTMedInsuInterface;
- using PTMedInsuInterface.Common;
- using PTMedInsuInterface.Variables;
- using System.Reflection;
- using System.IO;
- using PTMedInsuInterface.Forms;
- namespace PTMedInsuInterface.Business
- {
- class ShellBusiness
- {
- MIIrisServices mis = new MIIrisServices();
- public bool isExistConfig()
- {
- return File.Exists(Global.curEvt.path + @"\INSUConfigure.ini");
- }
- /// <summary>
- /// 获取HIS的IRIS配置信息
- /// </summary>
- /// <param name="con"></param>
- public void getHisConfingue(out IrisConfigue con)
- {
- IniFile ini = new IniFile(Global.curEvt.path + @"\INSUConfigure.ini");
- con.ip = ini.ReadValue("HIS", "ip");
- con.url = ini.ReadValue("HIS", "url");
-
- con.authorization = ini.ReadValue("HIS", "authorization");
- }
- /// <summary>
- /// 获取医保平台的iris配置信息
- /// </summary>
- /// <param name="con"></param>
- public void getInsuConfingue(out IrisConfigue con)
- {
- IniFile ini = new IniFile(Global.curEvt.path + @"\INSUConfigure.ini");
- con.ip = ini.ReadValue("INSU", "ip");
- con.url = ini.ReadValue("INSU", "url");
- con.authorization = ini.ReadValue("INSU", "authorization");
- Global.curEvt.MIVer = ini.ReadValue("Ver", "MIVer");
- }
- public void getDLLInfo(out DllInfo dll)
- {
- dll = new DllInfo();
- dll.nameSpace = "PTMedicalInsurance";
- dll.className = "InsuBusiness";
- }
- public void getDLLInfo(JObject joIn)
- {
- Global.dll.name = joIn["DLLName"].ToString();
- }
- /// <summary>
- //获取当前环境信息
- /// </summary>
- /// <param name="con"></param>
- public void getCurrentEnvironmentInfo()
- {
- //Global.curEvt.path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
- Global.curEvt.path = tools.GetPath();
- ComputerInfo comp = new ComputerInfo();
- Global.curEvt.mac = comp.GetMAC();
- Global.curEvt.ip = comp.GetIP();
-
- }
-
- public JObject showInterfaceChooseForm()
- {
- dynamic joInterface = new JObject();
- dynamic joRtn = new JObject();
- try
- {
- joInterface = mis.getInterface();
- JArray jaInterface = JArray.Parse(JsonHelper.getDestValue(joInterface, "result.data"));
- //有且仅有一条则不显示弹窗,并直接返回该条接口
- if (jaInterface.Count == 1)
- {
- joInterface.errorCode = 0;
- joInterface.errorMessage = "";
- dynamic joTmp = new JObject();
- joTmp.HospitalNO = jaInterface[0]["HospitalNO"];
- joTmp.DLLName = jaInterface[0]["DLLName"];
- joTmp.CenterURL = jaInterface[0]["CenterURL"];
- joTmp.CenterURL2 = jaInterface[0]["CenterURL2"];
- joTmp.AreaCode = jaInterface[0]["AreaCode"];
- joTmp.HospitalDr = jaInterface[0]["HospitalDr"];
- joTmp.HospitalName = jaInterface[0]["HospitalName"];
- joTmp.InterfaceID = jaInterface[0]["InterfaceID"];
- joTmp.HospitalLevel = jaInterface[0]["HospitalLevel"];
- joTmp.ID = jaInterface[0]["ID"];
- joTmp.operatorNO = Global.user.ID;
- joTmp.operatorName = Global.user.name;
- if (Global.curEvt.MIVer == "2")
- joTmp.insuRegionInterfaceDr = jaInterface[0]["InsuRegionDr"];
- joTmp.InsuCurrencyCataLogue = jaInterface[0]["InsuCurrencyCataLogue"];
- joRtn = JsonHelper.setIrisReturnValue(0, "", joTmp);
- }
- else
- {
- InterfaceChooser frmInterface = new InterfaceChooser(jaInterface);
- if (tools.ShowAppDiaglog(frmInterface) == DialogResult.OK)
- {
- if (frmInterface.drSelectedInterface["ID"] != "")
- {
- joInterface.errorCode = 0;
- joInterface.errorMessage = "";
- dynamic joTmp = new JObject();
- joTmp.HospitalNO = frmInterface.drSelectedInterface["HospitalNO"];
- joTmp.DLLName = frmInterface.drSelectedInterface["DLLName"];
- joTmp.CenterURL = frmInterface.drSelectedInterface["CenterURL"];
- joTmp.CenterURL2 = frmInterface.drSelectedInterface["CenterURL2"];
- joTmp.AreaCode = frmInterface.drSelectedInterface["AreaCode"];
- joTmp.HospitalDr = frmInterface.drSelectedInterface["HospitalDr"];
- joTmp.HospitalName = frmInterface.drSelectedInterface["HospitalName"];
- joTmp.InterfaceID = frmInterface.drSelectedInterface["InterfaceID"];
- joTmp.HospitalLevel = jaInterface[0]["HospitalLevel"];
- joTmp.ID = frmInterface.drSelectedInterface["ID"];
- joTmp.operatorNO = Global.user.ID;
- joTmp.operatorName = Global.user.name;
- if (Global.curEvt.MIVer == "2")
- joTmp.insuRegionInterfaceDr = frmInterface.drSelectedInterface["InsuRegionDr"];
- joTmp.InsuCurrencyCataLogue = jaInterface[0]["InsuCurrencyCataLogue"];
- joRtn = JsonHelper.setIrisReturnValue(0, "", joTmp);
- }
- else
- {
- joRtn = JsonHelper.setExceptionJson(-100, "接口选择界面", "返回的接口为空,请联系管理员!");
- }
- }
- else
- {
- joRtn = JsonHelper.setExceptionJson(-100, "接口选择界面", "收款员取消选择!");
- }
- }
-
- return joRtn;
- }
- catch (Exception ex)
- {
- joRtn = JsonHelper.setExceptionJson(-100, "接口选择界面", ex.Message);
- return joRtn;
- }
- finally
- {
- Global.writeLog("showInterfaceChooseForm", Global.inf.hospitalDr.ToString(),joRtn.ToString());
- }
- }
- }
- }
|