/// <summary>
        /// 根据身份证件号获取信用卡信息
        /// </summary>
        /// <param name="context">身份证件号</param>
        /// <returns></returns>
        public DataTable GetCreditInfo(string strCertno)
        {
            string rtn = "";
            //根据证件号码得到信用卡信息
            //string strSql = string.Format(@"select  a.*,b.loancard_id 贷记卡信息ID,d.latest24state 还款状态,c.ShareCreditLimitAmount 信用卡共享额度,
            //                                substr(d.latest24state,-1,1) last1,substr(d.latest24state,-3,1) last2,substr(d.latest24state,-5,1) last3,
            //                                substr(d.latest24state,-7,1) last4,substr(d.latest24state,-9,1) last5,substr(d.latest24state,-11,1) last6
            //                                from
            //                                (select distinct(certno),report_id from R_NR_QueryReq  where certno='{0}') a
            //                                inner join R_NR_Loancard b on a.report_id=b.report_id
            //                                inner join r_nr_awardcreditinfo c on a.report_id=c.report_id and b.loancard_id=c.super_id
            //                                inner join R_NR_Latest24MonthPaymentState d on a.report_id=d.report_id and b.loancard_id=d.super_id
            //                                where ShareCreditLimitAmount>0", strCertno);

            string    strSql = string.Format(@"select  a.*,b.loancard_id 贷记卡信息id,d.latest24state 还款状态,c.sharecreditlimitamount 信用卡共享额度,
                                    substr(d.latest24state,-1,1) last1,substr(d.latest24state,-3,1) last2,substr(d.latest24state,-5,1) last3,
                                    substr(d.latest24state,-7,1) last4,substr(d.latest24state,-9,1) last5,substr(d.latest24state,-11,1) last6
                                    from
                                    (select distinct(certno),report_id from r_nr_queryreq  where certno='{0}') a
                                    join r_nr_loancard b on a.report_id=b.report_id
                                    join r_nr_awardcreditinfo c on  b.loancard_id=c.super_id and a.report_id=c.report_id 
                                    join (select d.* from  r_nr_latest24monthpaymentstate d where d.report_id in (select distinct report_id from r_nr_queryreq  where certno='{0}') ) d
                                    on b.loancard_id=d.super_id
                                    where c.sharecreditlimitamount>0", strCertno);
            DataTable dt     = new WorkFlowFunction().ExecuteDataTableSql("rsmysql", strSql.ToLower());

            return(dt);
        }
        private string getRSResult(HttpContextBase context)
        {
            string           rtn   = "";
            string           url   = context.Request["address"];
            string           param = context.Request["param"];
            WorkFlowFunction wf    = new WorkFlowFunction();

            rtn = wf.PostMoths(url, param);
            return(rtn);
        }
Exemplo n.º 3
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));
        }
        /// <summary>
        /// 根据身份证件号获取主键ID
        /// </summary>
        /// <param name="context">身份证件号</param>
        /// <returns></returns>
        public string GetReoprtID(string strCertno)
        {
            string rtn        = "";
            string strSqlBase = string.Format(@"select distinct(report_id) from R_NR_QueryReq  where certno='{0}'", strCertno);
            object obj        = new WorkFlowFunction().ExecuteScalar("rsmysql", strSqlBase.ToLower());

            if (obj != null)
            {
                rtn = obj.ToString();
            }
            return(rtn);
        }
Exemplo n.º 5
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));
        }
Exemplo n.º 6
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));
        }
        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));
        }
        /// <summary>
        /// 获取其他指标信息
        /// </summary>
        /// <param name="strReportID"></param>
        /// <returns></returns>
        public DataTable GetOtherInfo(string strReportID)
        {
            string rtn = "";
            //获取其他信息
            string    strSql = string.Format(@"select 
                                        (   
                                            select sum(b.ScheduledPaymentAmount) 房贷  from R_NR_ContractInfo a
                                            inner join R_NR_CurrAccountInfo b on a.loan_id=b.loan_id and a.report_id=b.report_id 
                                            where a.report_id='{0}'
                                            and (type='个人商用房(包括商住两用)贷款' or type='个人住房贷款' or  type='个人住房公积金贷款')
                                            AND (CLASS5STATE='正常' OR CLASS5STATE='关注')  and ScheduledPaymentAmount>0
                                        ) 房贷
                                        ,
                                        (
                                            select sum(ScheduledPaymentAmount) 信用卡月还款总和  from R_NR_RepayInfo 
                                            where report_id='{0}' and ScheduledPaymentAmount>0
                                            
                                        )信用卡月还款总和
                                        ,
                                        (
                                            select sum(b.ScheduledPaymentAmount) 贷款月应还款额  from R_NR_ContractInfo a
                                            inner join R_NR_CurrAccountInfo b on a.loan_id=b.loan_id and a.report_id=b.report_id 
                                            where a.report_id='{0}'
                                            and (type!='个人经营性贷款' and type!='个人助学贷款' and type!='农户贷款' ) 
                                            and a.PaymentRating='按月归还'
                                            and ScheduledPaymentAmount>0
                                        ) 月度应还债务总和
                                        ,
                                        (
                                            select sum(Balance/RemainPaymentCyc)剩余月均应还本金  from R_NR_ContractInfo a
                                            inner join R_NR_CurrAccountInfo b on a.loan_id=b.loan_id and a.report_id=b.report_id 
                                            where a.report_id='{0}'
                                            and (type!='个人经营性贷款' and type!='个人助学贷款' and type!='农户贷款' ) 
                                            and a.PaymentRating='按月归还'
                                            and ScheduledPaymentAmount>0
                                        ) 剩余月均应还本金
                                        ,
                                        (
                                            select  sum(CreditLimitAmount) 客户资产估值 from R_NR_Loan a
                                            inner join R_NR_ContractInfo b on a.report_id =b.report_id and a.loan_id=b.loan_id
                                            where a.report_id='{0}'
                                            and (type='个人住房贷款' or type='个人住房公积金贷款' or type='个人商用房(包括商住两用)贷款') 
                                            and a.state='结清' and CreditLimitAmount>0
                                        ) 客户资产估值", strReportID);
            DataTable dt     = new WorkFlowFunction().ExecuteDataTableSql("rsmysql", strSql.ToLower());

            return(dt);
        }
Exemplo n.º 9
0
        /// <summary>
        /// 外部系统发起的跳过上传附件节点
        /// </summary>
        /// <param name="biz_objectid"></param>
        public static void ExternalSysIgnore(string biz_objectid)
        {
            string sql    = "select wi.objectid from ot_workitem wi left join ot_instancecontext con on wi.instanceid = con.objectid where con.bizobjectid = '" + biz_objectid + "' and wi.activitycode='Activity8'";
            string taskid = AppUtility.Engine.EngineConfig.CommandFactory.CreateCommand().ExecuteScalar(sql) + string.Empty;

            if (string.IsNullOrEmpty(taskid))
            {
                AppUtility.Engine.LogWriter.Write("任务id为空,bizobjectid:" + biz_objectid);
            }
            else
            {
                AppUtility.Engine.LogWriter.Write("自动提交到下一环节,任务:" + taskid);
                WorkFlowFunction wf = new WorkFlowFunction();
                wf.SubmitWorkItem(taskid, "");
            }
        }
        private string postRongshuBymanual(HttpContextBase context)
        {
            string rtn = "", url = "";
            string SchemaCode = context.Request["SchemaCode"];
            string instanceid = context.Request["instanceid"];
            string manual     = context.Request["manual"];

            if (manual == "1")
            {
                url = ConfigurationManager.AppSettings["rsurlRenGong"] + string.Empty;
            }
            else if (manual == "2")
            {
                url = ConfigurationManager.AppSettings["rsurl"] + string.Empty;
            }
            WorkFlowFunction wf = new WorkFlowFunction();

            rtn = wf.postHttpByManual(SchemaCode, instanceid, manual, url);
            return(rtn);
        }
Exemplo n.º 11
0
        public void RSRiskControllerResult(RSResult entity)
        {
            bool result = false;

            if (entity != null && entity.reqID != "")
            {
                WorkFlowFunction wf = new WorkFlowFunction();
                //00 - 成功
                //01 - 正在处理中
                //02 - 错误
                //03 - 失败
                //04 - 超时转人工

                List <DataItemParam> keyValues = new List <DataItemParam>();
                string fkResult = "";
                if (entity.code == "00")
                {
                    //localreject: 部署在东正本地规则拒绝;
                    //cloudaccept: 部署在云端规则通过;
                    //cloudreject: 部署在云端规则拒绝;
                    //cloudmanual: 部署在云端规则返回转人工
                    fkResult = entity.data.action;
                    keyValues.Add(new DataItemParam()
                    {
                        ItemName  = "fkResult",
                        ItemValue = fkResult
                    });
                    //Automatic_approval:0人工(默认值),1自动审批,-1拒绝
                    if (fkResult == "cloudaccept")
                    {
                        //在融数通过的情况下,根据东正的业务判断是否需要走自动审批
                        #region
                        int auto = 0;
                        auto = wf.AutomaticApprovalByRongShu(entity.reqID);
                        keyValues.Add(new DataItemParam()
                        {
                            ItemName  = "Automatic_approval",
                            ItemValue = auto
                        });
                        #endregion
                    }
                    else
                    {
                        keyValues.Add(new DataItemParam()
                        {
                            ItemName  = "Automatic_approval",
                            ItemValue = 0
                        });
                    }
                    string SchemaCode = wf.getSchemaCodeByInstanceID(entity.reqID);
                    wf.SetItemValues(SchemaCode, wf.getBizobjectByInstanceid(entity.reqID), keyValues, wf.GetUserIDByCode("rsfk"));
                    result = wf.SubmitWorkItemByRongShu(entity.reqID, "", wf.GetUserIDByCode("rsfk"));
                }
                else if (entity.code == "02")
                {
                    //localreject: 部署在东正本地规则拒绝;
                    //cloudaccept: 部署在云端规则通过;
                    //cloudreject: 部署在云端规则拒绝;
                    //cloudmanual: 部署在云端规则返回转人工
                    //manual:1--》 人工查询外部数据源
                    //manual:2--》 超时重提进件
                    fkResult = entity.data.action;
                    keyValues.Add(new DataItemParam()
                    {
                        ItemName  = "fkResult",
                        ItemValue = "error"
                    });
                    keyValues.Add(new DataItemParam()
                    {
                        ItemName  = "Automatic_approval",
                        ItemValue = 0
                    });
                    string SchemaCode = wf.getSchemaCodeByInstanceID(entity.reqID);
                    wf.SetItemValues(SchemaCode, wf.getBizobjectByInstanceid(entity.reqID), keyValues, wf.GetUserIDByCode("rsfk"));
                    result = wf.SubmitWorkItemByRongShu(entity.reqID, "", wf.GetUserIDByCode("rsfk"));
                }
                else if (entity.code == "03")
                {
                    OThinker.H3.Controllers.AppUtility.Engine.LogWriter.Write("融数风控回调执行结果:处理超时,重新提交");
                    //重新提交请求
                    //string SchemaCode = wf.getSchemaCodeByInstanceID(entity.reqID);
                    //wf.postHttp(SchemaCode, entity.reqID);
                }
                else if (entity.code == "04")//超时转人工
                {
                    OThinker.H3.Controllers.AppUtility.Engine.LogWriter.Write("融数风控回调执行结果:处理超时转人工");
                    //localreject: 部署在东正本地规则拒绝;
                    //cloudaccept: 部署在云端规则通过;
                    //cloudreject: 部署在云端规则拒绝;
                    //cloudmanual: 部署在云端规则返回转人工
                    fkResult = entity.data.action;
                    keyValues.Add(new DataItemParam()
                    {
                        ItemName  = "fkResult",
                        ItemValue = "overtime"
                    });
                    keyValues.Add(new DataItemParam()
                    {
                        ItemName  = "Automatic_approval",
                        ItemValue = 0
                    });
                    string SchemaCode = wf.getSchemaCodeByInstanceID(entity.reqID);
                    wf.SetItemValues(SchemaCode, wf.getBizobjectByInstanceid(entity.reqID), keyValues, wf.GetUserIDByCode("rsfk"));
                    result = wf.SubmitWorkItemByRongShu(entity.reqID, "", wf.GetUserIDByCode("rsfk"));
                }
            }
            else
            {
                OThinker.H3.Controllers.AppUtility.Engine.LogWriter.Write("融数风控回调执行结果:回传参数为空!");
            }
        }
        public bool IsFinished(string intanceid)
        {
            WorkFlowFunction WorkFlow = new WorkFlowFunction();

            return(WorkFlow.GetIsFinished(intanceid));
        }
Exemplo n.º 13
0
 public static void DataRiskBack(string stream)
 {
     CommonFunction.WriteH3Log("大数据风控回调开始,参数:" + stream);
     try
     {
         bool rtn = false;
         JavaScriptSerializer js = new JavaScriptSerializer();
         var result = js.Deserialize <drResult>(stream);
         List <DataItemParam> keyValues = new List <DataItemParam>();
         keyValues.Add(new DataItemParam()
         {
             ItemName  = "sqrdsjmx",
             ItemValue = result.data.score
         });
         string           instanceid = result.app_id.Split('_')[0];
         WorkFlowFunction wf         = new WorkFlowFunction();
         string           SchemaCode = "APPLICATION";// wf.getSchemaCodeByInstanceID(instanceid);
         wf.SetItemValues(SchemaCode, wf.getBizobjectByInstanceid(instanceid), keyValues, wf.GetUserIDByCode("rsfk"));
         try
         {
             if (float.Parse(result.data.score) > 0.75)
             {
                 string workItemId = WorkFlowFunction.getRSWorkItemIDByInstanceid(instanceid);
                 if (!CommonFunction.hasData(workItemId))
                 {
                     CommonFunction.WriteH3Log("大数据风控回调结束,当前节点不在风控,不结束流程,参数:" + stream);
                     return;
                 }
                 string Application_Number = "";
                 string UserCode           = "";
                 string sql = @" select a.user_name,a.application_number 
                         from I_application a join OT_instancecontext b on a.objectid = b.bizobjectid 
                         where b.objectid = '{0}'";
                 sql = string.Format(sql, instanceid);
                 DataTable dt = CommonFunction.ExecuteDataTableSql(sql);
                 if (CommonFunction.hasData(dt))
                 {
                     Application_Number = dt.Rows[0]["application_number"].ToString();
                     UserCode           = dt.Rows[0]["user_name"].ToString();
                 }
                 //拒绝,回写CAp
                 Dictionary <string, object> dic = new Dictionary <string, object>();
                 dic.Add("InstanceID", instanceid + string.Empty);
                 dic.Add("Application_Number", Application_Number + string.Empty);
                 dic.Add("StatusCode", "拒绝" + string.Empty);
                 dic.Add("Approval_UserCode", UserCode + string.Empty);
                 dic.Add("Approval_Comment", "东正大数据风控模型拒绝" + string.Empty);
                 CommonFunction.ExecuteBizBus("CAPServiceNew", "ProposalApproval", dic);
                 //结束流程
                 wf.finishedInstance(instanceid);
                 CommonFunction.WriteH3Log("大数据风控回调处理结束,拒绝处理成功," + stream);
                 return;
             }
         }
         catch (Exception ex)
         {
             CommonFunction.WriteH3Log("大数据风控回调处理异常,参数:" + stream + ",错误信息:" + ex.Message);
         }
         rtn = wf.SubmitWorkItemByRongShu(instanceid, "", wf.GetUserIDByCode("rsfk"));
         CommonFunction.WriteH3Log("大数据风控回调处理结束,提交至信审完成," + stream);
         //return rtn.ToString();
     }
     catch (Exception ex)
     {
         CommonFunction.WriteH3Log("大数据风控回调处理异常,参数:" + stream + ",错误信息:" + ex.Message);
     }
 }
        public void RSRiskControllerResult(RSResult entity)
        {
            bool result = false;

            if (entity != null && entity.reqID != "")
            {
                WorkFlowFunction    wf     = new WorkFlowFunction();
                WorkFlowFunctionNew wf_New = new WorkFlowFunctionNew();
                //00 - 成功
                //01 - 正在处理中
                //02 - 错误
                //03 - 失败
                //04 - 超时转人工

                List <DataItemParam> keyValues = new List <DataItemParam>();
                string fkResult = "";
                if (entity.code == "00")
                {
                    //localreject: 部署在东正本地规则拒绝;
                    //cloudaccept: 部署在云端规则通过;
                    //cloudreject: 部署在云端规则拒绝;
                    //cloudmanual: 部署在云端规则返回转人工
                    fkResult = entity.data.action;
                    keyValues.Add(new DataItemParam()
                    {
                        ItemName  = "fkResult",
                        ItemValue = fkResult
                    });
                    //Automatic_approval:0人工(默认值),1自动审批,-1拒绝
                    int auto = 0;
                    if (fkResult == "cloudaccept")
                    {
                        //在融数通过的情况下,根据东正的业务判断是否需要走自动审批
                        #region

                        auto = wf_New.AutomaticApprovalByRongShu(entity.reqID);
                        keyValues.Add(new DataItemParam()
                        {
                            ItemName  = "Automatic_approval",
                            ItemValue = auto
                        });
                        #endregion
                    }
                    else
                    {
                        keyValues.Add(new DataItemParam()
                        {
                            ItemName  = "Automatic_approval",
                            ItemValue = 0
                        });
                    }
                    string SchemaCode = wf.getSchemaCodeByInstanceID(entity.reqID);
                    wf.SetItemValues(SchemaCode, wf.getBizobjectByInstanceid(entity.reqID), keyValues, wf.GetUserIDByCode("rsfk"));
                    //result = wf.SubmitWorkItemByRongShu(entity.reqID, "", wf.GetUserIDByCode("rsfk"));
                    //判断是否是外网经销商
                    string dep = "";
                    string sql = @"select b.name from OT_User a join OT_Organizationunit b on a.parentid = b.objectid
                                    join OT_instancecontext c on c.originator = a.objectid
                                    where c.objectid = '{0}'";
                    sql = string.Format(sql, entity.reqID);
                    dep = OThinker.H3.Controllers.AppUtility.Engine.EngineConfig.CommandFactory.CreateCommand().ExecuteScalar(sql).ToString();
                    if (auto == 1 && !dep.Contains("外网"))//自动通过的外网经销商需要走大数据风控模型
                    {
                        result = wf.SubmitWorkItemByRongShu(entity.reqID, "", wf.GetUserIDByCode("rsfk"));
                    }
                    else
                    {
                        //调用东正大数据模型
                        DataRisk.postDataRisk(entity.reqID);
                    }
                }
                else if (entity.code == "02")
                {
                    //localreject: 部署在东正本地规则拒绝;
                    //cloudaccept: 部署在云端规则通过;
                    //cloudreject: 部署在云端规则拒绝;
                    //cloudmanual: 部署在云端规则返回转人工
                    //manual:1--》 人工查询外部数据源
                    //manual:2--》 超时重提进件
                    fkResult = entity.data.action;
                    keyValues.Add(new DataItemParam()
                    {
                        ItemName  = "fkResult",
                        ItemValue = "error"
                    });
                    keyValues.Add(new DataItemParam()
                    {
                        ItemName  = "Automatic_approval",
                        ItemValue = 0
                    });
                    string SchemaCode = wf.getSchemaCodeByInstanceID(entity.reqID);
                    wf.SetItemValues(SchemaCode, wf.getBizobjectByInstanceid(entity.reqID), keyValues, wf.GetUserIDByCode("rsfk"));
                    //result = wf.SubmitWorkItemByRongShu(entity.reqID, "", wf.GetUserIDByCode("rsfk"));
                    //调用东正大数据模型
                    DataRisk.postDataRisk(entity.reqID);
                }
                else if (entity.code == "03")
                {
                    OThinker.H3.Controllers.AppUtility.Engine.LogWriter.Write("融数风控回调执行结果:处理超时,重新提交");
                    //重新提交请求
                    //string SchemaCode = wf.getSchemaCodeByInstanceID(entity.reqID);
                    //wf.postHttp(SchemaCode, entity.reqID);
                }
                else if (entity.code == "04")//超时转人工
                {
                    OThinker.H3.Controllers.AppUtility.Engine.LogWriter.Write("融数风控回调执行结果:处理超时转人工");
                    //localreject: 部署在东正本地规则拒绝;
                    //cloudaccept: 部署在云端规则通过;
                    //cloudreject: 部署在云端规则拒绝;
                    //cloudmanual: 部署在云端规则返回转人工
                    fkResult = entity.data.action;
                    keyValues.Add(new DataItemParam()
                    {
                        ItemName  = "fkResult",
                        ItemValue = "overtime"
                    });
                    keyValues.Add(new DataItemParam()
                    {
                        ItemName  = "Automatic_approval",
                        ItemValue = 0
                    });
                    string SchemaCode = wf.getSchemaCodeByInstanceID(entity.reqID);
                    wf.SetItemValues(SchemaCode, wf.getBizobjectByInstanceid(entity.reqID), keyValues, wf.GetUserIDByCode("rsfk"));
                    //result = wf.SubmitWorkItemByRongShu(entity.reqID, "", wf.GetUserIDByCode("rsfk"));
                    //调用东正大数据模型
                    DataRisk.postDataRisk(entity.reqID);
                }
            }
            else
            {
                OThinker.H3.Controllers.AppUtility.Engine.LogWriter.Write("融数风控回调执行结果:回传参数为空!");
            }
        }