public void Index()
        {
            var    context = HttpContext;
            string data    = "";

            using (StreamReader sr = new StreamReader(context.Request.InputStream))
            {
                data = sr.ReadToEnd();
                JObject jtoken = JObject.Parse(data);
                data = jtoken["data"].ToString();
            }
            AppUtility.Engine.LogWriter.Write("CRM_To_H3接口风险点干预流程数据:" + data);
            JavaScriptSerializer json = new JavaScriptSerializer();

            WorkFlowMethod.Return result = new WorkFlowMethod.Return();
            try
            {
                //data = "D7756CA4CAD69B232FCBDD7F9DBE3AE965C8D1AC54FB50518BCDC1725CCA1CD88A5FD5BC64BACA0C393440E2940EE851E96781BF17513B4C265C3F2822F905DDD35C10E28677CEBA042CBB142ED38015B630FF9A787E5395E8C0EEDF61175D634644B3B9998378480001C2F6691A47F8351CD6F68D4E217995FE481F77494D004F52C83F29747F70B8E66148858F850A0A6BEEFF0706424E1C500CD3DA0BEAD5C66275A6796B5E3C36221262678A70A00E7986BAE12506D81A73A67089861153802A6A743C0224990584045AD1B7381F9DE91BE2A503E92E94A1E552AE9E0E405CDA65C9FB3984C07D3EB2D0FE29A948E94146B6E5BFF61EE895A9B2FAE7A8D1E40C25C0DCE11BBCF46BCC1A3C6B5709C19B238F5ABC124D83332E3B2A434EFE063579C371DA886DA58702315F9356C2850B91BFBE508973EE7A582BEC10AFBEBE0107A687F4A5C45ABCB7CDFDB461C685A23AE70E22CCF21E0024A7B9E0024657140D80566B172422D3E02DA2BE4B9C3D9A82759DF0729268E792246AC9ABAD1AE8CAF2685C6C981BD059D752B5AE7474A3EF64FAC6CBA09ABF2D084507F5925B29ED591C208DB79261A47DA7EDC48A3A8460C884CFC8A48B24C7566F67868669D0ADBDF7733F60F1ED356E7DFAC66005D4EA260FF3B882C6A475AB8A733286C56CD4C53668516B5A0B0FDBA04F2F1C82AFA1EB4C06EFE5D9A1665A4359CF487B996E42BD9D74579E3CC8661A0F30FCFA7AC56DF8AD5A13416F2C4472AD90A098C50FD07C3FF5EFB9E6CABD5383C801E61B68F767CEFD60F84136EA91280723930FB23D7192E11F8683F3DE2508E4B3558B572BD80A329834AC2380BC1483A80F72DD397B1242628BAAD174E7F46F61B2E690E1BD4C4908A1AE7D9EF66DED5469085E166DDBE4F49A7B2C735FEADECB";
                List <DataItemParam> dataList = new List <DataItemParam>();
                data = DESDecrypt(data, "B^@s(d)+");
                AppUtility.Engine.LogWriter.Write("CRM_To_H3接口风险点干预解密数据:" + data);
                JObject   jsonData = JObject.Parse(data);
                RiskPoint rp       = new RiskPoint();
                rp.DealerID   = jsonData["third_system_no"].ToString();
                rp.Originator = jsonData["originator"].ToString();
                List <RiskPointForm> rpfList = new List <RiskPointForm>();
                foreach (var item in jsonData["distributorlist"])
                {
                    RiskPointForm rpf = new RiskPointForm();
                    rpf.Dealer   = item["distributor"].ToString();
                    rpf.Reason   = item["message"].ToString();
                    rpf.DealerID = item["third_system_no"].ToString();
                    rpfList.Add(rpf);
                }
                rp.riskpointform = rpfList;

                string           str       = JSSerializer.Serialize(rp);
                BPMServiceResult bpmresult = startWorkflowByEntityTrinsJson("RiskPoint", jsonData["originator"].ToString(), false, str);  //;jsonData["originator"].ToString()    "*****@*****.**"   "18f923a7-5a5e-426d-94ae-a55ad1a4b239"
                                                                                                                                          //BPMServiceResult bpmresult = StartWorkflow("RiskPoint", jsonData["originator"].ToString(), false, dataList);  //"*****@*****.**"    "18f923a7-5a5e-426d-94ae-a55ad1a4b239"

                if (bpmresult.Success)
                {
                    result.Result  = "0";
                    result.Message = result.Message;
                }
                else
                {
                    result.Result  = "-1";
                    result.Message = result.Message;
                }
            }
            catch (Exception e)
            {
                result.Result  = "-1";
                result.Message = e.Message;
            }

            context.Response.Write(json.Serialize(result));
        }
Example #2
0
 public static string JsonSerialize(object o)
 {
     if (o == null)
     {
         return(null);
     }
     return(JSSerializer.Serialize(o));
 }
Example #3
0
        /// <summary>
        /// 获取用户的待办任务总数
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string getAllWorkItemCount(HttpContextBase context)
        {
            string workitem = "{\"result\":[";//{"":"","":""}

            workitem += "{\"UnfinishedWorkItemCount\":" + getUnfinishedWorkItemCount(context) + "," + "\"WorkItem\":" + getUnfinishedWorkItem(context) + "},";
            workitem += "{\"FinishedWorkItemCount\":" + getFinishedWorkItemCount(context) + "," + "\"WorkItem\":" + getFinishedWorkItem(context) + "},";
            workitem += "{\"UserUnReadedWorkItemCount\":" + GetUserUnReadedWorkItemCount(context) + "," + "\"WorkItem\":" + GetUserUnReadedWorkItem(context) + "},";
            workitem += "{\"UserReadedWorkItemCount\":" + GetUserReadedWorkItemCount(context) + "," + "\"WorkItem\":" + GetUserReadedWorkItem(context) + "}]}";
            return(JSSerializer.Serialize(workitem));
        }
Example #4
0
        /// <summary>
        /// 查询用户的待办
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string getUnfinishedWorkItem(HttpContextBase context)
        {
            string           rtn = "";
            string           UserCode = context.Request["UserCode"];
            WorkFlowFunction wf = new WorkFlowFunction();
            int startIndex = 0, endIndex = 10;
            List <OThinker.H3.Controllers.ViewModels.WorkItemViewModel> lstModel = wf.GetUnFinishWorkItems(UserCode, null, null, startIndex, endIndex, "", "");

            rtn = CommonFunction.Obj2Json(lstModel);
            return(JSSerializer.Serialize(rtn));
        }
Example #5
0
        private string Is_Mortgaged(HttpContextBase context)
        {
            string           application_number = context.Request["applicationNo"];
            WorkFlowFunction wf = new WorkFlowFunction();
            int    i            = wf.Is_Mortgaged(application_number);
            object obj          = new
            {
                value = i
            };

            return(JSSerializer.Serialize(obj));
        }
Example #6
0
        /// <summary>
        /// 获取用户的待办任务总数
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string getUnfinishedWorkItemCount(HttpContextBase context)
        {
            int    count    = 0;
            string UserCode = context.Request["UserCode"];

            count = new WorkFlowFunction().GetUserUnfinishedWorkItemCount(UserCode);
            object obj = new
            {
                Result = count
            };

            return(JSSerializer.Serialize(obj));
        }
Example #7
0
        /// <summary>
        /// 获取用户的已阅任务总数
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string GetUserReadedWorkItemCount(HttpContextBase context)
        {
            string count    = "0";
            string UserCode = context.Request["UserCode"];

            count = new WorkFlowFunction().GetUserReadWorkItemCountBySql(UserCode);
            object obj = new
            {
                Result = count
            };

            return(JSSerializer.Serialize(obj));
        }
Example #8
0
        private string getCinstenceid(HttpContextBase context)
        {
            string           rtn           = "";
            string           applicationno = context.Request["applicationno"];
            WorkFlowFunction wf            = new WorkFlowFunction();

            rtn = wf.getCinstenceid(applicationno);
            object obj = new
            {
                Result = rtn
            };

            return(JSSerializer.Serialize(obj));
        }
        private string RSRiskManagement(HttpContextBase context)
        {
            bool             rtn        = false;
            string           instanceid = context.Request["instanceid"];
            WorkFlowFunction wf         = new WorkFlowFunction();

            rtn = wf.SubmitWorkItemByInstanceID(instanceid, "");
            object obj = new
            {
                Result = rtn
            };

            return(JSSerializer.Serialize(obj));
        }
Example #10
0
        //private string getRejectWorkItem(HttpContextBase context)
        //{
        //    string rtn = "";
        //    string objectids = context.Request["objectids"];
        //    WorkFlowFunction wf = new WorkFlowFunction();
        //    rtn = wf.getRejectWorkItem(objectids);
        //    return rtn;
        //}

        //[Xss]
        //public string getRejectWorkItem()
        //{
        //    return getRejectWorkItem(HttpContext);
        //}

        private string insertLYInfo(HttpContextBase context)
        {
            int    rtn        = 0;
            string instanceid = context.Request["instanceid"];
            string userid     = context.Request["userid"];
            string ly         = context.Request["ly"];

            ly  = System.Web.HttpUtility.HtmlEncode(ly);// 19.7.3 wangxg
            rtn = WorkFlowFunction.insertLYInfo(instanceid, userid, ly);
            object obj = new
            {
                Result = rtn
            };

            return(JSSerializer.Serialize(obj));
        }
Example #11
0
        private string indvidualHistoryFinancedAmount(HttpContextBase context)
        {
            string           rtn           = "";
            string           IdCardNo      = context.Request["IdCardNo"];
            string           applicationno = context.Request["applicationno"];
            string           currentV      = context.Request["currentV"];
            WorkFlowFunction wf            = new WorkFlowFunction();

            rtn = wf.indvidualHistoryFinancedAmount(IdCardNo, applicationno, currentV);
            object obj = new
            {
                Result = rtn
            };

            return(JSSerializer.Serialize(obj));
        }
Example #12
0
        //private string getssx(HttpContextBase context)
        //{
        //    string rtn = "";
        //    string pcode = context.Request["pcode"];
        //    string UserCode = context.Request["UserCode"];
        //    WorkFlowFunction wf = new WorkFlowFunction();
        //    rtn = wf.getssx(UserCode, pcode);
        //    return rtn;
        //}

        //[Xss]
        //public string getssx()
        //{
        //    return getssx(HttpContext);
        //}

        //private string getdycs(HttpContextBase context)
        //{
        //    string rtn = "";
        //    string UserCode = context.Request["UserCode"];
        //    WorkFlowFunction wf = new WorkFlowFunction();
        //    rtn = wf.getdycs(UserCode);
        //    return rtn;
        //}

        //[Xss]
        //public string getdycs()
        //{
        //    return getdycs(HttpContext);
        //}

        //private string searchdycs(HttpContextBase context)
        //{
        //    string rtn = "";
        //    string UserCode = context.Request["UserCode"];
        //    string ids = context.Request["ids"];
        //    WorkFlowFunction wf = new WorkFlowFunction();
        //    rtn = wf.searchdycs(ids, UserCode);
        //    return rtn;
        //}

        //[Xss]
        //public string searchdycs()
        //{
        //    return searchdycs(HttpContext);
        //}

        //private string updatedycs(HttpContextBase context)
        //{
        //    string rtn = "";
        //    string UserCode = context.Request["UserCode"];
        //    string shen = context.Request["shen"];
        //    string shi = context.Request["shi"];
        //    string xian = context.Request["xian"];
        //    WorkFlowFunction wf = new WorkFlowFunction();
        //    rtn = wf.updatedycs(UserCode, shen, shi, xian);
        //    return rtn;
        //}

        //[Xss]
        //public string updatedycs()
        //{
        //    return updatedycs(HttpContext);
        //}

        //private string downloaddycs(HttpContextBase context)
        //{
        //    string rtn = "";
        //    WorkFlowFunction wf = new WorkFlowFunction();
        //    rtn = wf.downloaddycs();
        //    return rtn;
        //}

        //[Xss]
        //public string downloaddycs()
        //{
        //    return downloaddycs(HttpContext);
        //}

        //private string deldycs(HttpContextBase context)
        //{
        //    string rtn = "";
        //    string UserCode = context.Request["UserCode"];
        //    string ids = context.Request["ids"];
        //    WorkFlowFunction wf = new WorkFlowFunction();
        //    rtn = wf.deldycs(ids, UserCode);
        //    return rtn;
        //}

        //[Xss]
        //public string deldycs()
        //{
        //    return deldycs(HttpContext);
        //}

        private string ldaplogin(HttpContextBase context)
        {
            string UserCode    = context.Request["UserCode"];
            string ls_userid   = "";
            string ls_username = "";
            string ls_password = "";
            string cn          = "";

            try
            {
                string    ldap_url = System.Configuration.ConfigurationManager.AppSettings["ldap_url"] + string.Empty;
                string    sql      = "select sn,dn,cn,userpassword from ldapuser where email='" + UserCode + "'";
                DataTable dt       = OThinker.H3.Controllers.AppUtility.Engine.EngineConfig.CommandFactory.CreateCommand().ExecuteDataTable(sql);
                if (dt != null && dt.Rows.Count > 0)
                {
                    ls_userid   = dt.Rows[0]["dn"].ToString();
                    ls_username = dt.Rows[0]["sn"].ToString();
                    ls_password = dt.Rows[0]["userpassword"].ToString();
                    cn          = dt.Rows[0]["cn"].ToString();
                    jtLDAP a = new jtLDAP();
                    //a.LDAP_URL = "LDAP://oms2.zhengtongauto.net:3402/dc=zhengtongauto,dc=com";
                    //a.LDAP_USERID = "cn=" + ls_userid + ",dc=zhengtongauto,dc=com";
                    a.LDAP_URL      = ldap_url;
                    a.LDAP_USERID   = ls_userid;
                    a.LDAP_PASSWORD = ls_password;
                    a.GetEntry();
                    string r = a.f_getPersonMes(cn, "description");
                    //记录日志信息
                    LogManager.logPath = AppDomain.CurrentDomain.BaseDirectory + @"bin\ldap-log\";
                    LogManager.WriteLog(LogFile.Trace, "账号验证成功:" + ls_username + ",返回信息:" + r);
                }
            }
            catch (Exception ex)
            {
                //记录日志信息
                LogManager.logPath = AppDomain.CurrentDomain.BaseDirectory + @"bin\ldap-log\";
                LogManager.WriteLog(LogFile.Trace, "账号验证失败:" + ls_username + ",返回信息:" + ex.Message);
            }
            object obj = new
            {
                Result = "true"
            };

            return(JSSerializer.Serialize(obj));
        }
Example #13
0
        public void Index()
        {
            var    context  = HttpContext;
            string Shop     = context.Request["Shop"];
            string Province = context.Request["Province"];
            string City     = context.Request["City"];
            string SpName   = context.Request["SpName"];
            string DyName   = context.Request["DyName"];
            string Page     = context.Request["Page"];
            string Size     = context.Request["Size"];
            string method   = context.Request["method"];
            string pid      = context.Request["id"];

            string ObjectID = context.Request["ObjectID"] + string.Empty;

            Newtonsoft.Json.Linq.JObject ret = new Newtonsoft.Json.Linq.JObject();

            int total = 0;

            ret.Add("Data", new ReturnData()
            {
                Shop = Shop, Province = Province, City = City, SpName = SpName, DyName = DyName, ObjectID = ObjectID
            }.GetJson(Page, Size, out total));
            ret.Add("Total", total);
            if (method == "GetProvince")
            {
                var result = GetArea(string.IsNullOrEmpty(pid) ? "" : pid);
                context.Response.Write(JSSerializer.Serialize(result));
            }
            if (method == "GetCity" && !string.IsNullOrEmpty(pid))
            {
                var result = GetArea(pid);
                context.Response.Write(JSSerializer.Serialize(result));
            }
            if (method == "GetPeople")
            {
                var result = GetPeople();
                context.Response.Write(JSSerializer.Serialize(result));
            }
            if (method == "Data")
            {
                context.Response.Write(ret);
            }
        }
        public static void CreateTables()
        {
            var serializer = new JSSerializer();
            OrmLiteRepository<LocalRestriction> table = new OrmLiteRepository<LocalRestriction>();
            LocalRestriction ent = new LocalRestriction();
            ent.LookupItemId = new Guid("c6eb436e-1021-45a5-b937-30b6b7be1970");
            ent.Name = "LocalRestriction от бога";
            ent.RuleId = new Guid("B999488A-9D27-4318-BE06-99DB84B25139");
            ent.Production = true;
            ent.Sandbox = true;

            var settings = new Dictionary<string, object>();
            settings.Add("Date", DateTime.Now);
            ent.Settings = serializer.Serialize(settings);

            ent.CreatedOn = DateTime.Now;

            table.SafeAdd(ent);
        }
        public static void CreateRule()
        {
            var serializer = new JSSerializer();
            OrmLiteRepository<Rule> table = new OrmLiteRepository<Rule>();

            Rule rule = new Rule();
            rule.ActivateBonusInDays = 1;
            rule.ChargeAmount = 100;
            rule.BonusLifeTime = 30;
            rule.Production = true;
            rule.Sandbox = true;
            rule.ActivateInDate = DateTime.Now;
            rule.ActivateOnCharge = true;
            rule.ChargePercent = 50;
            rule.LifeTimeFrom = DateTime.Now;
            rule.LifeTimeTo = DateTime.Now.AddDays(40);
            rule.Priority = 2;
            rule.Name = "Rule 2";

            ConditionGroup mainGroup = new ConditionGroup();
            mainGroup.ExpressionType = ExpressionType.AND;

            Condition cond1 = new Condition(new BaseCondition());
            Dictionary<string, object> cond1Settings = new Dictionary<string, object>();
            cond1Settings.Add("Date", DateTime.Now.AddDays(-40));
            cond1.ConditionItem.Settings = cond1Settings;
            cond1.ConditionItem.ConditionId = new Guid("2be12ef8-00b9-47c5-a0cb-d6f15fb02aa5");
            mainGroup.Add(cond1);

            ConditionGroup subGroup1 = new ConditionGroup();
            subGroup1.ExpressionType = ExpressionType.AND;

            Condition cond2 = new Condition(new BaseCondition());
            Dictionary<string, object> cond2Settings = new Dictionary<string, object>();
            cond2Settings.Add("Date", DateTime.Now.AddDays(-40));
            cond2.ConditionItem.Settings = cond2Settings;
            cond2.ConditionItem.ConditionId = new Guid("2be12ef8-00b9-47c5-a0cb-d6f15fb02aa5");
            subGroup1.Add(cond2);
            mainGroup.Add(subGroup1);
            var conditionJson = serializer.Serialize(mainGroup);

            rule.Conditions = conditionJson;

            LocalRestrictionBase localRestriction = new LocalRestrictionBase();
            localRestriction.RestrictionId = new Guid("C6EB436E-1021-45A5-B937-30B6B7BE1970");
            localRestriction.Name = "LocalRestriction от бога";

            var restrictionSettings = new Dictionary<string, object>();
            restrictionSettings.Add("Date", DateTime.Now);
            localRestriction.Settings = restrictionSettings;

            LocalActionBase localAction = new LocalActionBase();
            localAction.ActionId = new Guid("EB54BD15-D953-4986-AC89-47A9F5E527C0");
            localAction.Name = "LocalAction от бога";

            var actionSettings = new Dictionary<string, object>();
            actionSettings.Add("Date", DateTime.Now);
            localAction.Settings = actionSettings;

            List<LocalRestrictionBase> restrictionList = new List<LocalRestrictionBase>();
            restrictionList.Add(localRestriction);

            List<LocalActionBase> actionList = new List<LocalActionBase>();
            actionList.Add(localAction);

            rule.LocalActions = serializer.Serialize(actionList);
            rule.LocalRestrictions = serializer.Serialize(restrictionList);

            table.SafeAdd(rule);

            //Console.WriteLine(json);
            //Console.ReadKey();
        }