using Newtonsoft.Json.Linq; using PTMedicalInsurance.Helper; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PTMedicalInsurance.Business { abstract class AbstractProcess { protected CenterBusiness cBus = new CenterBusiness(); protected HisMainBusiness hBus = new HisMainBusiness(); protected HisIrisServices hIS = new HisIrisServices(); protected MIIrisServices mIS = new MIIrisServices(); protected InvokeHelper invoker = new InvokeHelper(); protected string outParam = ""; public JObject OrginalInput { set; get; } /// /// 使用原始参数 /// public bool UseOrginal { get;set; } /// /// 返回成功信息 /// /// protected CallResult Success() { return Success("成功"); } protected CallResult Success(string msg) { return new CallResult(0, msg, outParam); } /// /// 返回失败信息 /// /// /// /// protected CallResult Error(int code, string errMsg) { return Exception(code, errMsg, outParam); } protected CallResult Exception(int code, string errMsg,string param) { outParam = JsonHelper.setExceptionJson(code, errMsg, param).ToString(); return new CallResult(code, errMsg, outParam); } protected CallResult Exception(string errMsg, string param) { return Exception(-1, errMsg, param); } protected CallResult IrisReturn(string msg,JObject obj) { outParam = JsonHelper.setIrisReturnValue(0, msg, obj).ToString(); return new CallResult(0, msg, outParam); } /// /// 返回失败信息 /// /// /// protected CallResult Error(string errMsg) { return new CallResult(-1, errMsg, outParam); } /// /// 业务过程 /// /// /// public abstract CallResult Process(JObject input); } }