/// <summary> /// 验证是不是能启动流程 /// </summary> /// <param name="sys_ids"></param> /// <param name="str_facterid"></param> /// <param name="ds_facter"></param> /// <param name="str_resultmessage"></param> /// <param name="clientInf"></param> /// <param name="userInfoJsonString"></param> /// <returns></returns> public string get_startworkflow(string sys_ids, string str_facterid, DataSet ds_facter, ref string str_resultmessage, string clientInf, string userInfoJsonString) { string result = ""; try { Eva.Library.ServiceAdapter.IAdapter.IWorkFlow w = Eva.Library.ServiceAdapter.AdapterFactory.WorkFlowFactory.CreateService(Eva.Library.Configuration.ConfigurationManager.AppSettings["AppCode"]); string lcdyid = _cc.GetWorkFlowLCDYID(str_facterid, ds_facter, clientInf, userInfoJsonString); DataSet ds; if (sara.dd.ldsw.commonclass.commonclass.GetPlatformServiceModel() == "dll") { ds = sara.platform.service.workflow.Service.GetUserOperationStartByDylcid(lcdyid); } else { ds = w.GetUserOperationStartByDylcid(lcdyid); } #region businesscode //businesscode //在此处添加针对projclassid = 3的业务代码 #endregion str_resultmessage = Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(ds.Tables[0]); } catch (Exception ex) { result = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); } return(result); }
/// <summary> /// 验证是不是能启动流程 /// </summary> /// <param name="sys_ids"></param> /// <param name="str_facterid"></param> /// <param name="ds_facter"></param> /// <param name="str_resultmessage"></param> /// <param name="clientInf"></param> /// <param name="userInfoJsonString"></param> /// <returns></returns> public string get_startworkflow(string sys_ids, string str_facterid, DataSet ds_facter, ref string str_resultmessage, string clientInf, string userInfoJsonString) { string result = ""; try { Eva.Library.ServiceAdapter.IAdapter.IWorkFlow w = Eva.Library.ServiceAdapter.AdapterFactory.WorkFlowFactory.CreateService(Eva.Library.Configuration.ConfigurationManager.AppSettings["AppCode"]); string lcdyid = _cc.GetWorkFlowLCDYID(str_facterid, ds_facter, clientInf, userInfoJsonString); DataSet ds; if (sara.dd.ldsw.commonclass.commonclass.GetPlatformServiceModel() == "dll") { ds = sara.platform.service.workflow.Service.GetUserOperationStartByDylcid(lcdyid); } else { ds = w.GetUserOperationStartByDylcid(lcdyid); } #region businesscode //businesscode //在此处添加针对projclassid = 3的业务代码 _iAccessData = sara.dd.ldsw.commonclass.commonclass.CreateIAccessData(); string sql = "select count(*) from tbl_ld_xhhbtzb where fk_tbl_ld_xhhbt_sys_id = (select sys_id from tbl_ld_xhhbt where fk_tbl_maintable_sys_id='" + sys_ids + "') and f_khbh is null"; string count = "0"; object o = _iAccessData.GetSingle(sql); if (o != null) { count = o.ToString(); } string total = "0"; sql = "select count(*) from tbl_ld_xhhbtzb where fk_tbl_ld_xhhbt_sys_id = (select sys_id from tbl_ld_xhhbt where fk_tbl_maintable_sys_id='" + sys_ids + "')"; object res = _iAccessData.GetSingle(sql); if (res != null) { total = res.ToString(); } if (count != "0" || total == "0") { result = "请先选定客户在进行操作"; } #endregion str_resultmessage = Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(ds.Tables[0]); } catch (Exception ex) { result = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); } return(result); }
/// <summary> /// 验证是不是能启动流程 /// </summary> /// <param name="sys_ids"></param> /// <param name="str_facterid"></param> /// <param name="ds_facter"></param> /// <param name="str_resultmessage"></param> /// <param name="clientInf"></param> /// <param name="userInfoJsonString"></param> /// <returns></returns> public string get_startworkflow(string sys_ids, string str_facterid, DataSet ds_facter, ref string str_resultmessage, string clientInf, string userInfoJsonString) { string result = ""; try { Eva.Library.ServiceAdapter.IAdapter.IWorkFlow w = Eva.Library.ServiceAdapter.AdapterFactory.WorkFlowFactory.CreateService(Eva.Library.Configuration.ConfigurationManager.AppSettings["AppCode"]); string lcdyid = _cc.GetWorkFlowLCDYID(str_facterid, ds_facter, clientInf, userInfoJsonString); DataSet ds; if (sara.dd.ldsw.commonclass.commonclass.GetPlatformServiceModel() == "dll") { ds = sara.platform.service.workflow.Service.GetUserOperationStartByDylcid(lcdyid); } else { ds = w.GetUserOperationStartByDylcid(lcdyid); } #region businesscode //businesscode //验证所选客户是否可以进流程 string sql = "select f_value1 from tbl_ld_xgsbds where fk_tbl_maintable_sys_id='" + sys_ids + "'"; string value1 = ""; object o = _iAccessData.GetSingle(sql); if (o != null) { value1 = o.ToString(); } if (value1 == "") { result = "数据未分析"; } else { result = ""; } #endregion str_resultmessage = Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(ds.Tables[0]); } catch (Exception ex) { result = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); } return(result); }
/// <summary> /// 验证是不是能转件 /// </summary> /// <param name="workitemid"></param> /// <param name="str_resultmessage"></param> /// <param name="clientInf"></param> /// <returns>//[sys_id]$[fk_workflow_sys_id]$[selectusernames]$[ds_facter]$[str_shyj]$[processinsid]$[businessparm]$[processdefid]$[facterid]$[trans]</returns> public string get_sendworkflow(string workitemid, ref string str_resultmessage, string clientInf) { string result = ""; try { IDictionary <string, string> clientInfoDic = Eva.Library.Format.FormatEntityTool.FormatJsonToDic(clientInf); string userid = clientInfoDic["userid"]; string username = clientInfoDic["username"]; Eva.Library.ServiceAdapter.IAdapter.IWorkFlow w = Eva.Library.ServiceAdapter.AdapterFactory.WorkFlowFactory.CreateService(Eva.Library.Configuration.ConfigurationManager.AppSettings["AppCode"]); DataSet useroperation = null; string shyj = ""; if (sara.dd.ldsw.commonclass.commonclass.GetPlatformServiceModel() == "dll") { shyj = sara.platform.service.workflow.Service.GetUserOperationSHYJ(workitemid); } else { shyj = w.GetUserOperationSHYJ(workitemid); } if (shyj == "-1") { if (sara.dd.ldsw.commonclass.commonclass.GetPlatformServiceModel() == "dll") { useroperation = sara.platform.service.workflow.Service.GetUserOperation(workitemid, userid, username, DateTime.Now); } else { useroperation = w.GetUserOperation(workitemid, userid, username, DateTime.Now); } } else { DataSet ds_old; if (sara.dd.ldsw.commonclass.commonclass.GetPlatformServiceModel() == "dll") { ds_old = sara.platform.service.workflow.Service.GetUserOperationCZNR(workitemid); } else { ds_old = w.GetUserOperationCZNR(workitemid); } if (ds_old == null || ds_old.Tables.Count == 0) { if (sara.dd.ldsw.commonclass.commonclass.GetPlatformServiceModel() == "dll") { useroperation = sara.platform.service.workflow.Service.GetUserOperation(workitemid, userid, username, DateTime.Now); } else { useroperation = w.GetUserOperation(workitemid, userid, username, DateTime.Now); } } else { useroperation = ds_old; } } #region businesscode //在此处添加业务代码,可以控制默认选中哪个tab页,那条连接线,哪个用户 //具体规则如下: //1、在datarow["Iselected"]中,设置0表示连接线被选中,设置-1表示连接线没有被选中 //2、在datarow["userids"]\datarow["usernames"]中存放着备选用户的id和name,以小写逗号分割,例如: //datarow["userids"] = "1,2";datarow["usernames"] = "张三,李四" //此时程序会自动选中这2个用户,在id和names前边加“-”,则不会被选中,例如: //datarow["userids"] = "-1,2";datarow["usernames"] = "-张三,李四" //则李四默认会被选中,张三默认不会被选中 //3、可以调整1,2的顺序,实现对审核顺序的调整,(如果当前节点的jdnyh!=1,并且节点类型是串行的话) //4、在1个useroperation中会存在多个连接线(多个datarow),当某个datarow的iselected=+0时,该连接线所在的页会默认被打开 //如果不设置+号的话,则默认打开第一个0的连接线所在的页。 //一个useroperation中只能有一个+0,否则按照最先一个+0计算。 //传过来的数据里边,默认用户都是被选中的,连接线也是被选中的。 //for (int i = 0; i < useroperation.Tables[0].Rows.Count; i++) //{ // //新增水表_居民//业务代码,转给经办人时,默认转给发起的经办人 // if (useroperation.Tables[0].Rows[i]["fk_dy_jd_sys_id_to"].ToString() == "540008020") // { // string lcslid = useroperation.Tables[0].Rows[i]["fk_sl_lc_sys_id"].ToString(); // string sql = "select czrid,czrname from t_workitem where fk_sl_lc_sys_id = '" + lcslid + "' and fk_dy_jd_sys_id = '540008000'"; // DataSet dsczr = _iAccessData.Query(sql); // if (dsczr.Tables[0].Rows.Count > 0) // { // string czrid = dsczr.Tables[0].Rows[0]["czrid"].ToString(); // string czrname = dsczr.Tables[0].Rows[0]["czrname"].ToString(); // string[] oldUserIdArray = useroperation.Tables[0].Rows[i]["userids"].ToString().Split(','); // string[] oldUserNameArray = useroperation.Tables[0].Rows[i]["usernames"].ToString().Split(','); // string newUserIds = ""; // string newUserNames = ""; // for (int ii = 0; ii < oldUserIdArray.Length; ii++) // { // if (oldUserIdArray[ii] == czrid) // { // newUserIds += oldUserIdArray[ii] + ","; // newUserNames += oldUserNameArray[ii] + ","; // } // else // { // newUserIds += "-" + oldUserIdArray[ii] + ","; // newUserNames += "-" + oldUserNameArray[ii] + ","; // } // } // useroperation.Tables[0].Rows[i]["userids"] = newUserIds.TrimEnd(','); // useroperation.Tables[0].Rows[i]["usernames"] = newUserNames.TrimEnd(','); // } // } //} #endregion str_resultmessage = Eva.Library.Format.FormatEntityTool.FormatDataTableToJson(useroperation.Tables[0]); } catch (Exception ex) { result = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace); } return(result); }