/****************************** * 说明:单据审批流操作类 * 创建人:龚宇超 * 创建日期:2019-06-19 * 修改人: * 修改日期: * 修改备注: * 版本:1.0.0.0 ******************************/ using System; using System.Collections.Generic; using System.Linq; using System.Text; using Lskj.Business.Impl; using System.Data; using Lskj.Model; using System.Data.SqlClient; using System.Reflection; using System.Data.Common; namespace Lskj.Business { public class WorkFlowBillImpl : BaseImpl { /// /// 说明:获取可用功能清单 /// 创建人:龚宇超 /// 创建日期:2019-06-20 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// DataTable. public static DataTable GetMenuTreeViewData() { string condWhere = string.Empty; string sqlValue = @" SELECT '' MenuID,RIGHT('00'+CAST(SubSysId as varchar),2) MenuStruct,SubSysName Caption,'' DllFileName,'' PurviewId,'' UrlParams,SubSysId FROM P_SubSystemTab WHERE UseEd=1 UNION SELECT a.* FROM ( SELECT a.MenuId,RIGHT('00'+CAST(a.SubSysId as varchar),2)+a.MenuStruct MenuStruct,a.MenuCaption,a.DllFileName,a.PurviewId,a.UrlParams,a.SubSysId FROM P_FormMenuConfigTab a INNER JOIN ( SELECT DISTINCT LEFT(MenuStruct,2) MenuStruct,a.SubSysId FROM P_FormMenuConfigTab a LEFT JOIN P_SubSystemTab b ON a.SubSysId=b.SubSysId WHERE a.useFlag=1 and ISNULL(PurviewId,'')<>'' and a.DllFileName like '%Accraditation%' ) b ON a.MenuStruct=b.MenuStruct and a.SubSysId=b.SubSysId WHERE a.useFlag=1 UNION SELECT a.MenuId,RIGHT('00'+CAST(SubSysId as varchar),2)+a.MenuStruct MenuStruct,a.MenuCaption,a.DllFileName,a.PurviewId,a.UrlParams,a.SubSysId FROM P_FormMenuConfigTab a WHERE a.useFlag=1 and ISNULL(PurviewId,'')<>'' AND a.DllFileName like '%Accraditation%' ) a LEFT JOIN P_SubSystemTab b ON a.SubSysId=b.SubSysId WHERE b.UseEd=1 ORDER BY SubSysId,MenuStruct"; return GetDataTableResult(sqlValue); } /// /// 说明: /// 创建人:龚宇超 /// 创建日期:2019-06-21 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// DataTable. public static DataTable GetBillFlowData(string menuCode) { string sqlValue = string.Format("select * from p_systembillflow where typeCode='{0}' ORDER BY stepCode", menuCode); return GetDataTableResult(sqlValue); } /// /// 说明:获取角色 /// 创建人:王一帆 /// 创建日期:2019-11-03 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// DataTable. public static DataTable GetWorkFlowRole(string mf) { string where = string.Empty; if (!string.IsNullOrEmpty(mf)) where = string.Format("where roleName like '%{0}%' or dbo.P_getpy(roleName) like '%{0}%'", mf); string sqlValue = "select * from p_systemRoleSetTab " + where; return GetDataTableResult(sqlValue); } /// /// 说明:获取小类设置操作员 /// 创建人:龚宇超 /// 创建日期:2019-06-24 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// DataTable. public static DataTable GetWorkFlowUsers(string depid, string mf) { string where = string.Empty; if (!string.IsNullOrEmpty(depid)) where = " and departmentid=" + depid; if (!string.IsNullOrEmpty(mf)) where = string.Format(" and (loginaccount like '%{0}%' or employeename like '%{0}%' or dbo.P_getpy(employeename) like '%{0}%')", mf); string sqlValue = "select loginaccount,employeename,departmentid from p_employeeTab where sign=0 and UseFlag=1 " + where; return GetDataTableResult(sqlValue); } /// /// 说明:获取单表设置操作权限表 /// 创建人:王一帆 /// 创建日期:2019-10-17 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// DataTable. public static DataTable GetPowerTable() { string sqlValue = string.Format("select BillFlowPurview,DllFlowPurview from p_systemtab"); return GetDataTableResult(sqlValue); } /// /// 说明:获取部门数据 /// 创建人:龚宇超 /// 创建日期:2019-06-24 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// DataTable. public static DataTable GetDeps() { string sqlValue = string.Format(@"select '' departmentid,'' departmentname union select CAST(departmentid as varchar),departmentname from P_DepartmentTab"); return GetDataTableResult(sqlValue); } /// /// 说明:获取小类设置数据 /// 创建人:龚宇超 /// 创建日期:2019-06-24 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// DataTable. public static DataTable GetBillFlowType(string typeCode) { string sqlValue = string.Format("select * from p_systembillflowtype where typeCode='{0}'", typeCode); return GetDataTableResult(sqlValue); } /// /// 说明:获取单据审批流转 /// 创建人:龚宇超 /// 创建日期:2019-06-24 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// DataTable. public static DataTable GetBillFlowTypeStep(string typeCode, string billtype) { string sqlValue = string.Format("select * from p_systembillflowtypestep where typecode='{0}' and billtype='{1}' order by stepCode asc;", typeCode, billtype); return GetDataTableResult(sqlValue); } /// /// 说明:获取小类billtype /// 创建人:龚宇超 /// 创建日期:2019-06-26 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// System.String. public static string GetBillFlowBillType() { string sqlValue = "select ISNULL( right('0000' + CAST( MAX(cast(billType as int))+1 as varchar(5)),4),'0001') aaa from p_systembillflowtype"; return GetResult(sqlValue) + ""; } /// /// 说明:新增流转步骤 /// 创建人:龚宇超 /// 创建日期:2019-06-24 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// System.Int32. public static bool SaveBillFlow(BillflowModel model) { string sqlValue = string.Format(@"INSERT INTO p_systembillflow(typeCode,stepCode,stepName,stepAction,backAction,stepGroup,stepSql,billModifyFields,detailModifyFields,beforeEvent, afterEvent,stepApplyText,stepBackText,stepApplyContent,stepBackContent,tm_Test,pStepCode,stepCloseText,stepCloseContent,stepCloseTip,stepDivide) VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}','{19}','{20}'); SELECT @@IDENTITY", model.typeCode, model.stepCode, model.stepName, model.stepAction, model.backAction, model.stepGroup, model.stepSql, model.billModifyFields, model.detailModifyFields, model.beforeEvent, model.afterEvent, model.stepApplyText, model.stepBackText, model.stepApplyContent, model.stepBackContent, model.tm_Test, model.pStepCode, model.stepCloseText, model.stepCloseContent, model.stepCloseTip, model.stepDivide); model.id = Convert.ToInt32(GetResult(sqlValue)); // 生成流转步骤sql语句 string stepSql = string.Format("exec p_systemCreateFlowSQL '{0}',{1},'{2}',''", model.typeCode, model.stepCode, ERPInfo.Instance.UserId); ExecSqlValue(stepSql); return model.id > 0; } /// /// 说明:新增流转步骤,带事务 /// 创建人:龚宇超 /// 创建日期:2019-06-24 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// System.Int32. public static bool SaveBillFlow(BillflowModel model, DbTransaction Trans) { string sqlValue = string.Format(@"INSERT INTO p_systembillflow(typeCode,stepCode,stepName,stepAction,backAction,stepGroup,stepSql,billModifyFields,detailModifyFields,beforeEvent, afterEvent,stepApplyText,stepBackText,stepApplyContent,stepBackContent,tm_Test,pStepCode,stepCloseText,stepCloseContent,stepCloseTip,stepDivide) VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}','{19}','{20}'); SELECT @@IDENTITY", model.typeCode, model.stepCode, model.stepName, model.stepAction, model.backAction, model.stepGroup, model.stepSql, model.billModifyFields, model.detailModifyFields, model.beforeEvent, model.afterEvent, model.stepApplyText, model.stepBackText, model.stepApplyContent, model.stepBackContent, model.tm_Test, model.pStepCode, model.stepCloseText, model.stepCloseContent, model.stepCloseTip, model.stepDivide); model.id = Convert.ToInt32(GetResult(sqlValue, Trans)); // 生成流转步骤sql语句 string stepSql = string.Format("exec p_systemCreateFlowSQL '{0}',{1},'{2}',''", model.typeCode, model.stepCode, ERPInfo.Instance.UserId); ExecSqlValue(stepSql, Trans); return model.id > 0; } /// /// 说明:修改流转步骤 /// 创建人:龚宇超 /// 创建日期:2019-06-25 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The model. /// true if XXXX, false otherwise. public static bool UpdateBillFlow(BillflowModel model) { string sqlValue = string.Format(@"update p_systembillflow set stepName='{0}',stepAction='{1}',backAction='{2}',stepGroup='{3}',billModifyFields='{4}',detailModifyFields='{5}', beforeEvent='{6}',afterEvent='{7}',stepApplyText='{8}',stepBackText='{9}',stepApplyContent='{10}',stepBackContent='{11}',pStepCode='{12}', stepCloseText='{17}',stepCloseContent='{13}',stepCloseTip='{14}',stepDivide='{15}' where id='{16}'", model.stepName.Replace("'", "''"), model.stepAction.Replace("'", "''"), model.backAction.Replace("'", "''"), model.stepGroup.Replace("'", "''"), model.billModifyFields.Replace("'", "''"), model.detailModifyFields.Replace("'", "''"), model.beforeEvent.Replace("'", "''"), model.afterEvent.Replace("'", "''"), model.stepApplyText.Replace("'", "''"), model.stepBackText.Replace("'", "''"), model.stepApplyContent.Replace("'", "''"), model.stepBackContent.Replace("'", "''"), model.pStepCode.Replace("'", "''"), model.stepCloseContent.Replace("'", "''"), model.stepCloseTip.Replace("'", "''"), model.stepDivide.Replace("'", "''"), model.id, model.stepCloseText.Replace("'", "''")); // 生成流转步骤sql语句 string stepSql = string.Format("exec p_systemCreateFlowSQL '{0}',{1},'{2}',''", model.typeCode, model.stepCode, ERPInfo.Instance.UserId); ExecSqlValue(stepSql); return ExecSqlValue(sqlValue) > 0; } public static bool newUpdateBillFlow(BillflowModel model) { string sqlValue = string.Format(@"update p_systembillflow set stepName='{0}',stepAction='{1}',backAction='{2}',stepGroup='{3}',billModifyFields='{4}',detailModifyFields='{5}', beforeEvent='{6}',afterEvent='{7}',stepApplyText='{8}',stepBackText='{9}',stepApplyContent='{10}',stepBackContent='{11}',pStepCode='{12}', stepCloseText='{17}',stepCloseContent='{13}',stepCloseTip='{14}',stepDivide='{15}' ,requiredFields='{18}' ,requiredDetailFields='{19}' where id='{16}'", model.stepName.Replace("'", "''"), model.stepAction.Replace("'", "''"), model.backAction.Replace("'", "''"), model.stepGroup.Replace("'", "''"), model.billModifyFields.Replace("'", "''"), model.detailModifyFields.Replace("'", "''"), model.beforeEvent.Replace("'", "''"), model.afterEvent.Replace("'", "''"), model.stepApplyText.Replace("'", "''"), model.stepBackText.Replace("'", "''"), model.stepApplyContent.Replace("'", "''"), model.stepBackContent.Replace("'", "''"), model.pStepCode.Replace("'", "''"), model.stepCloseContent.Replace("'", "''"), model.stepCloseTip.Replace("'", "''"), model.stepDivide.Replace("'", "''"), model.id, model.stepCloseText.Replace("'", "''"), model.requiredFields.Replace("'", "''"), model.requiredDetailFields.Replace("'", "''")); // 生成流转步骤sql语句 string stepSql = string.Format("exec p_systemCreateFlowSQL '{0}',{1},'{2}',''", model.typeCode, model.stepCode, ERPInfo.Instance.UserId); ExecSqlValue(stepSql); return ExecSqlValue(sqlValue) > 0; } /// /// 说明:流转步骤删除 /// 创建人:龚宇超 /// 创建日期:2019-06-26 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The model. /// true if XXXX, false otherwise. public static bool DeleteBillFlow(BillflowModel model) { // 1. 删除流转步骤;2. 删除流转步骤表格数据;3.删除表格颜色;删除小类流转步骤 string sqlValue = string.Format(@"delete p_systembillflowtypestep where typecode='{0}' and stepcode='{1}'; delete p_systembillstepgrid where typecode='{0}' and stepcode='{1}'; delete p_systemwordbookcolor where tab='FLOWSTEP_{0}_{1}_{2}'; delete p_systembillflow where id='{2}'", model.typeCode, model.stepCode, model.id); return ExecSqlValue(sqlValue) > 0; } /// /// 说明:保存小类 /// 创建人:龚宇超 /// 创建日期:2019-06-26 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The model. /// true if XXXX, false otherwise. public static bool SaveBillFlowType(BillflowTypeModel model) { string sqlValue = string.Format(@"INSERT INTO p_systembillflowtype(typeCode,billtype,billtypename,operuser,typekey,billflowban) VALUES('{0}','{1}','{2}','{3}','{4}','{5}'); SELECT @@IDENTITY", model.typeCode, model.billType, model.billTypeName, model.operUser, model.typekey, model.billflowban); model.id = Convert.ToInt32(GetResult(sqlValue)); return model.id > 0; } /// /// 说明:更新小类 /// 创建人:龚宇超 /// 创建日期:2019-06-26 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The model. /// true if XXXX, false otherwise. public static bool UpdateBillFlowType(BillflowTypeModel model) { string sqlValue = string.Format(@"update p_systembillflowtype set billtypename='{0}',operuser='{1}',billflowban='{3}' where id='{2}'", model.billTypeName.Replace("'", "''"), model.operUser.Replace("'", "''"), model.id, model.billflowban); return ExecSqlValue(sqlValue) > 0; } /// /// 说明:删除小类 /// 创建人:龚宇超 /// 创建日期:2019-06-26 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The model. /// true if XXXX, false otherwise. public static bool DeleteBillFlowType(BillflowTypeModel model) { // 1. 删除流转步骤;2. 删除流转步骤表格数据;3.删除表格颜色;删除小类流转步骤 string sqlValue = string.Format(@"delete p_systembillflowtype where id='{0}'; delete p_systembillflowtypestep where billtype='{0}' and typecode='{1}';", model.id, model.typeCode); return ExecSqlValue(sqlValue) > 0; } /// /// 说明:生成小类流转步骤 /// 创建人:龚宇超 /// 创建日期:2019-06-26 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The model. /// true if XXXX, false otherwise. public static bool SaveBillFlowTypeStep(string typeCode, string billtype) { string sqlValue = string.Format(@"insert into p_systembillflowtypestep(typeCode,billType,stepCode,stepName,stepGroup,stepBackCode,typekey,pStepCode,SameAudited,stepClosed,remindSelect) select a.typeCode,b.id,stepCode,stepName,stepGroup,cast(stepCode as int)-100,b.typekey,0,0,0,0 from p_systembillflow a inner join p_systembillflowtype b on a.typeCode=b.typeCode where a.typeCode='{0}' and b.id='{1}' and stepCode not in (select stepCode from p_systembillflowtypestep where typeCode='{0}' and billType='{1}')", typeCode, billtype); return ExecSqlValue(sqlValue) > 0; } /// /// 说明:修改小类流转步骤 /// 创建人:龚宇超 /// 创建日期:2019-06-26 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The model. /// true if XXXX, false otherwise. public static bool UpdateBillFlowTypeStep(BillflowTypeStepModel model) { string sqlValue = string.Format(@"update p_systembillflowtypestep set stepTime={0},autoStep='{1}',viewUser='{2}',operUser='{3}',stepBackCode='{4}', StepOverCondBak='{6}',pStepCode='{8}',SameAudited='{9}',stepClosed='{10}',comfirmOper='{11}', remindOper='{12}',remindSelect='{13}',signOper='{14}',flowcharTagId='{15}',flowcharWidth='{16}',flowcharHeght='{17}', FlowCharfillcolor='{18}', LeftFlowCharfillcolor='{19}', LeftFlowCharWidth='{20}', fontSize='{21}', fontWeight='{22}',fontFamily='{23}',flowcharLineHeght='{24}',LeftFontColor='{25}',fontColor='{26}',affirmbak='{27}' where id='{28}'", string.IsNullOrEmpty(model.stepTime) ? "NULL" : model.stepTime.Replace("'", "''"), model.autoStep.Replace("'", "''"), model.viewUser.Replace("'", "''"), model.operUser.Replace("'", "''"), model.stepBackCode.Replace("'", "''"), model.StepOverCond.Replace("'", "''"), model.StepOverCondBak.Replace("'", "''"), model.autoStepCond.Replace("'", "''"), model.pStepCode.Replace("'", "''"), model.SameAudited.Replace("'", "''"), model.stepClosed.Replace("'", "''"), model.comfirmOper.Replace("'", "''"), model.remindOper.Replace("'", "''"), model.remindSelect.Replace("'", "''"), model.signOper.Replace("'", "''"), model.flowcharTagId.Replace("'", "''"), model.flowcharWidth.Replace("'", "''"), model.flowcharHeght.Replace("'", "''"), model.FlowCharfillcolor.Replace("'", "''"), model.LeftFlowCharfillcolor.Replace("'", "''"), model.LeftFlowCharWidth.Replace("'", "''"), model.fontSize.Replace("'", "''"), model.fontWeight.Replace("'", "''"), model.fontFamily.Replace("'", "''"), model.flowcharLineHeght.Replace("'", "''"), model.LeftFontColor.Replace("'", "''"), model.fontColor.Replace("'", "''"), model.affirmbak.Replace("'", "''"), model.id); return ExecSqlValue(sqlValue) > 0; } public static bool newUpdateBillFlowTypeStep(BillflowTypeStepModel model) { string sqlValue = string.Format(@"update p_systembillflowtypestep set stepTime={0},autoStep='{1}',viewUser='{2}',operUser='{3}',stepBackCode='{4}', StepOverCondBak='{6}',autoStepCond='{7}',pStepCode='{8}',SameAudited='{9}',stepClosed='{10}',comfirmOper='{11}', remindOper='{12}',remindSelect='{13}',signOper='{14}',flowcharTagId='{15}',flowcharWidth='{16}',flowcharHeght='{17}', FlowCharfillcolor='{18}', LeftFlowCharfillcolor='{19}', LeftFlowCharWidth='{20}', fontSize='{21}', fontWeight='{22}',fontFamily='{23}',flowcharLineHeght='{24}',LeftFontColor='{25}',fontColor='{26}',affirmbak='{27}' where id='{28}'", string.IsNullOrEmpty(model.stepTime) ? "NULL" : model.stepTime.Replace("'", "''"), model.autoStep.Replace("'", "''"), model.viewUser.Replace("'", "''"), model.operUser.Replace("'", "''"), model.stepBackCode.Replace("'", "''"), model.StepOverCond.Replace("'", "''"), model.StepOverCondBak.Replace("'", "''"), model.autoStepCond.Replace("'", "''"), model.pStepCode.Replace("'", "''"), model.SameAudited.Replace("'", "''"), model.stepClosed.Replace("'", "''"), model.comfirmOper.Replace("'", "''"), model.remindOper.Replace("'", "''"), model.remindSelect.Replace("'", "''"), model.signOper.Replace("'", "''"), model.flowcharTagId.Replace("'", "''"), model.flowcharWidth.Replace("'", "''"), model.flowcharHeght.Replace("'", "''"), model.FlowCharfillcolor.Replace("'", "''"), model.LeftFlowCharfillcolor.Replace("'", "''"), model.LeftFlowCharWidth.Replace("'", "''"), model.fontSize.Replace("'", "''"), model.fontWeight.Replace("'", "''"), model.fontFamily.Replace("'", "''"), model.flowcharLineHeght.Replace("'", "''"), model.LeftFontColor.Replace("'", "''"), model.fontColor.Replace("'", "''"), model.affirmbak.Replace("'", "''"), model.id); return ExecSqlValue(sqlValue) > 0; } /// /// 说明:循环修改流程图步骤 /// 创建人:龚宇超 /// 创建日期:2019-10-12 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The model. /// true if XXXX, false otherwise. public static bool UpdateAllBillFlow(BaseflowTypeStepModel model) { string sqlValue = string.Format(@"update p_systembillflowtypestep set flowcharTagId='{0}',flowcharWidth='{1}',flowcharHeght='{2}', FlowCharfillcolor='{3}', LeftFlowCharfillcolor='{4}', LeftFlowCharWidth='{5}', fontSize='{6}', fontWeight='{7}',fontFamily='{8}',flowcharLineHeght='{9}',LeftFontColor='{10}',fontColor='{11}',affirmbak='{12}' where id='{13}'", model.flowcharTagId, model.flowcharWidth, model.flowcharHeght, model.FlowCharfillcolor, model.LeftFlowCharfillcolor, model.LeftFlowCharWidth, model.fontSize, model.fontWeight, model.fontFamily, model.flowcharLineHeght, model.LeftFontColor, model.fontColor, model.affirmbak, model.id); return ExecSqlValue(sqlValue) > 0; } /// /// 说明:重置权限 /// 创建人:龚宇超 /// 创建日期:2019-06-28 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// true if XXXX, false otherwise. public static string ResetPurview(string menuCode, int billtype) { string sqlValue = string.Format(@"declare @p6 varchar(2000) set @p6='1' exec p_system_init_purview 1,'{0}',{1},{2},'{3}',@p6 output select @p6", menuCode, billtype, ERPInfo.Instance.UserId, ERPInfo.Instance.UserName); return GetResult(sqlValue) + ""; } /// /// 说明:初始化权限 /// 创建人:龚宇超 /// 创建日期:2019-06-28 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// System.String. public static string InitPurview(string menuCode) { string sqlValue = string.Format(@"declare @p6 varchar(2000) set @p6='1' exec p_system_init_purview 1,'{0}',{1},{2},'{3}',@p6 output select @p6", menuCode, 0, ERPInfo.Instance.UserId, ERPInfo.Instance.UserName); return GetResult(sqlValue) + ""; } /// /// 说明:获得终审回退信息 /// 创建人:曹屹峰 /// 创建日期:2022-06-7 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// System.String. public static DataTable getFinalBack(string mMenuCode) { string sqlValue = string.Format("select OverBackSql,OverBackOper,OverBackKey from p_systembilltype where typecode='{0}'", mMenuCode); return GetDataTableResult(sqlValue); } /// /// 说明:保存终审回退信息 /// 创建人:曹屹峰 /// 创建日期:2022-06-7 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// System.String. public static bool UpdateFinalReturnSettings(string sql, string name, string mMenuCode) { string sqlValue = string.Format("update p_systembilltype set OverBackSql='{0}' , OverBackOper='{1}' where typecode='{2}'", sql.Replace("'", "''"), name, mMenuCode); return ExecSqlValue(sqlValue) > 0; } /// /// 说明:获取终审条件信息 /// 创建人:曹屹峰 /// 创建日期:2022-06-7 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// System.String. public static DataTable getFallbackCondition(string key) { string sql = string.Format(@"select id,sourceId,controlName,controlLabel,controlType,defaultValue,sourceSql,keyField,resultField,controlLeft,controlTop,controlHeight,controlWidth,checkCond,formKey,orderId,isnull(ShowMobile,0) ShowMobile,isFix,Column_ID,BSRowId,BSColPercent,TitleColor,InputHintText,edited from p_systembillsourcecond where formKey = '{0}'", key); return GetDataTableResult(sql); } /// /// 说明:保存终审条件信息 /// 创建人:曹屹峰 /// 创建日期:2022-06-7 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// System.String. public static bool SaveFinalConditions(DataRow dr, string key) { string sqlValue = string.Empty; string id = dr["id"] + ""; if (string.IsNullOrWhiteSpace(id)) { //新增 sqlValue = string.Format(@"INSERT INTO p_systembillsourcecond (sourceId,controlName,controlLabel,controlType,defaultValue,sourceSql,keyField,resultField,controlLeft, controlTop,controlHeight,controlWidth,checkCond,ShowMobile,formKey) VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}')", 0, (dr["controlName"] + "").Replace("'", "''"), (dr["controlLabel"] + "").Replace("'", "''"), (dr["controlType"] + "").Replace("'", "''"), (dr["defaultValue"] + "").Replace("'", "''"), (dr["sourceSql"] + "").Replace("'", "''"), (dr["keyField"] + "").Replace("'", "''"), (dr["resultField"] + "").Replace("'", "''"), (dr["controlLeft"] + "").Replace("'", "''"), (dr["controlTop"] + "").Replace("'", "''"), (dr["controlHeight"] + "").Replace("'", "''"), (dr["controlWidth"] + "").Replace("'", "''"), (dr["checkCond"] + "").Replace("'", "''"), (dr["ShowMobile"] + "").Replace("'", "''"), key); } else { //修改 sqlValue = string.Format(@"UPDATE p_systembillsourcecond set controlName='{0}',controlLabel='{1}',controlType='{2}',defaultValue='{3}',sourceSql='{4}',keyField='{5}',resultField='{6}', controlLeft='{7}',controlTop='{8}',controlHeight='{9}',controlWidth='{10}',checkCond='{11}',ShowMobile='{12}' where id='{13}' ;", (dr["controlName"] + "").Replace("'", "''"), (dr["controlLabel"] + "").Replace("'", "''"), (dr["controlType"] + "").Replace("'", "''"), (dr["defaultValue"] + "").Replace("'", "''"), (dr["sourceSql"] + "").Replace("'", "''"), (dr["keyField"] + "").Replace("'", "''"), (dr["resultField"] + "").Replace("'", "''"), (dr["controlLeft"] + "").Replace("'", "''"), (dr["controlTop"] + "").Replace("'", "''"), (dr["controlHeight"] + "").Replace("'", "''"), (dr["controlWidth"] + "").Replace("'", "''"), (dr["checkCond"] + "").Replace("'", "''"), (dr["ShowMobile"] + "").Replace("'", "''"), (dr["id"] + "").Replace("'", "''") ); sqlValue = sqlValue + string.Format(@"update p_systemControlLocation set fieldname='{0}',username='{1}',fieldtypeid='{2}', defaultvalue='{3}' where formkey='{4}' and fieldid='{5}'", (dr["controlName"] + "").Replace("'", "''"), (dr["controlLabel"] + "").Replace("'", "''"), (dr["controlType"] + "").Replace("'", "''"), (dr["defaultValue"] + "").Replace("'", "''"), (dr["formkey"] + "").Replace("'", "''"), (dr["id"] + "").Replace("'", "''")); } return ExecSqlValue(sqlValue) > 0; } /// /// 说明:保存终审条件信息 /// 创建人:曹屹峰 /// 创建日期:2022-06-7 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// System.String. public static bool deleteFinalConditions(string id, string key) { string sqlValue = string.Empty; sqlValue = string.Format("delete from p_systemControlLocation where formkey='{0}' and fieldid='{1}'", key, id); sqlValue += string.Format("delete from p_systembillsourcecond where id='{0}'", id); return ExecSqlValue(sqlValue) > 0; } /// /// 删除方案步骤 /// /// /// public static bool DeleteSchemeSteps(BillflowTypeStepModel model) { string sqlValue = string.Format(@"delete p_systembillflowtypestep where id='{0}'", model.id); return ExecSqlValue(sqlValue) > 0; } } }