diff --git a/插件库/Lskj.Business/Impl/BaseAuditImpl.cs b/插件库/Lskj.Business/Impl/BaseAuditImpl.cs index 65eb7b1..0a9ec76 100644 --- a/插件库/Lskj.Business/Impl/BaseAuditImpl.cs +++ b/插件库/Lskj.Business/Impl/BaseAuditImpl.cs @@ -318,7 +318,15 @@ namespace Lskj.Business.Impl if (retCode.Equals("-1")) { - SqlStoredProcedurepPrompt.GenerateAuditExecutionScript(sysModel, stepCode, billDocumentId, storedName, accractFlag, remindSelect, remarkText, remindOpers, confirmOpers, ret, returnd, selectConfirmFlag, IsStepOver, comfirm); + if (SqlHelper.ConnectionType == ConnectionType.SqlServer) + { + SqlStoredProcedurepPrompt.GenerateAuditExecutionScript(sysModel, stepCode, billDocumentId, storedName, accractFlag, remindSelect, remarkText, remindOpers, confirmOpers, ret, returnd, selectConfirmFlag, IsStepOver, comfirm); + } + if (SqlHelper.ConnectionType == ConnectionType.DmServer) + { + SqlStoredProcedurepPrompt.GenerateBillSaveScript_DM(SqlHelper.LastFailureSql); + } + } return retCode; @@ -963,6 +971,7 @@ namespace Lskj.Business.Impl { fields = " and flowSource=@flowSource "; } + if (SystemInfo.Instance.CancelFlowSource && tableName.Equals("wms_billflowstep", StringComparison.OrdinalIgnoreCase)) fields = ""; if (SystemInfo.Instance.AutomaticStepHidie) { fields += " and autoStep !=1 "; diff --git a/插件库/Lskj.Business/Impl/BaseImpl.cs b/插件库/Lskj.Business/Impl/BaseImpl.cs index 4333b0d..c058ad5 100644 --- a/插件库/Lskj.Business/Impl/BaseImpl.cs +++ b/插件库/Lskj.Business/Impl/BaseImpl.cs @@ -765,6 +765,44 @@ namespace Lskj.Business.Impl } return defaultValue; } + + + /// + /// 替换特殊字符 {#p_ + /// + /// + /// + /// + /// + public static string SpecialReplacement(string defaultValue, string[] otherParams = null) + { + if (string.IsNullOrEmpty(defaultValue)) return defaultValue; + + if (defaultValue.ToLower().Contains("{#p_")) + { + try + { + List paramList = ReplaceHelper.GetParamFields(defaultValue); + + foreach (var item in paramList) + { + string index = item.Replace("{#p_", "").Replace("}", ""); + int i = 0; + if (int.TryParse(index, out i)) + { + defaultValue = defaultValue.Replace(item, otherParams != null ? otherParams[i - 1] : ""); + } + } + } + catch (Exception) + { + + } + } + return defaultValue; + } + + /// /// 说明:获取记录 /// 创建人:龚宇超 @@ -1184,4 +1222,4 @@ namespace Lskj.Business.Impl } /// - \ No newline at end of file + /// \ No newline at end of file diff --git a/插件库/Lskj.Business/Impl/BaseModuleImpl.cs b/插件库/Lskj.Business/Impl/BaseModuleImpl.cs index bc03f37..9930305 100644 --- a/插件库/Lskj.Business/Impl/BaseModuleImpl.cs +++ b/插件库/Lskj.Business/Impl/BaseModuleImpl.cs @@ -428,7 +428,14 @@ namespace Lskj.Business.Impl if (result==-1) { - SqlStoredProcedurepPrompt.GenerateBaseSaveProcedureScript(model, storedProcedureValue); + if (SqlHelper.ConnectionType == ConnectionType.SqlServer) + { + SqlStoredProcedurepPrompt.GenerateBaseSaveProcedureScript(model, storedProcedureValue); + } + if (SqlHelper.ConnectionType == ConnectionType.DmServer) + { + SqlStoredProcedurepPrompt.GenerateBillSaveScript_DM(SqlHelper.LastFailureSql); + } } model.Success = result == 1; @@ -504,7 +511,14 @@ namespace Lskj.Business.Impl if (result == -1) { - SqlStoredProcedurepPrompt.GenerateSaveBasePanelScript(model); + if (SqlHelper.ConnectionType == ConnectionType.SqlServer) + { + SqlStoredProcedurepPrompt.GenerateSaveBasePanelScript(model); + } + if (SqlHelper.ConnectionType == ConnectionType.DmServer) + { + SqlStoredProcedurepPrompt.GenerateBillSaveScript_DM(SqlHelper.LastFailureSql); + } } retuenMsg = result + ""; @@ -555,7 +569,14 @@ namespace Lskj.Business.Impl if (Convert.ToInt32(returnValue.Value.ToString()) == -1) { - SqlStoredProcedurepPrompt.GenerateBaseApplyScript( menuCode, parmaryKey, comfirmType); + if (SqlHelper.ConnectionType == ConnectionType.SqlServer) + { + SqlStoredProcedurepPrompt.GenerateBaseApplyScript(menuCode, parmaryKey, comfirmType); + } + if (SqlHelper.ConnectionType == ConnectionType.DmServer) + { + SqlStoredProcedurepPrompt.GenerateBillSaveScript_DM(SqlHelper.LastFailureSql); + } } return Convert.ToInt32(returnValue.Value.ToString()); diff --git a/插件库/Lskj.Business/Impl/BillImpl.cs b/插件库/Lskj.Business/Impl/BillImpl.cs index b64565d..76588aa 100644 --- a/插件库/Lskj.Business/Impl/BillImpl.cs +++ b/插件库/Lskj.Business/Impl/BillImpl.cs @@ -87,10 +87,14 @@ namespace Lskj.Business.Impl tipMsg = pMsg.Value.ToString(); if (newVer == 1 && billWay == 1) billNo = tipMsg; - if (Convert.ToInt32(returnValue.Value + "") == -1) + if (Convert.ToInt32(returnValue.Value + "") == -1&& SqlHelper.ConnectionType == ConnectionType.SqlServer) { SqlStoredProcedurepPrompt.GenerateBillSaveScript( masterSql, detailSql, detailTable, billNo, detailGuid, billSeq, billWay, comfirm,auditFlag ,newVer); } + if (Convert.ToInt32(returnValue.Value + "") == -1 && SqlHelper.ConnectionType == ConnectionType.DmServer) + { + SqlStoredProcedurepPrompt.GenerateBillSaveScript_DM(detailSql, SqlHelper.LastFailureSql, detailTable, detailGuid); + } return Convert.ToInt32(returnValue.Value + ""); } @@ -166,7 +170,15 @@ namespace Lskj.Business.Impl tipMsg = pMsg.Value.ToString(); if (Convert.ToInt32(returnValue.Value + "") == -1) { - SqlStoredProcedurepPrompt.GenerateBillApplyExecutionScript( typeCode, billNo, hintMsg, comfirm, comfirmFlag); + + if (SqlHelper.ConnectionType == ConnectionType.SqlServer) + { + SqlStoredProcedurepPrompt.GenerateBillApplyExecutionScript(typeCode, billNo, hintMsg, comfirm, comfirmFlag); + } + if (SqlHelper.ConnectionType == ConnectionType.DmServer) + { + SqlStoredProcedurepPrompt.GenerateBillSaveScript_DM(SqlHelper.LastFailureSql); + } } return Convert.ToInt32(returnValue.Value + ""); } @@ -445,6 +457,10 @@ namespace Lskj.Business.Impl sumCond += ",a.PromptText "; if (dataTable.Columns.Contains("SplicingConditions")) sumCond += ",a.SplicingConditions "; + if (dataTable.Columns.Contains("ColumnAnnotation")) + sumCond += ",a.ColumnAnnotation "; + if (dataTable.Columns.Contains("TitleColor")) + sumCond += ",a.TitleColor "; string columsSql = string.Format(@"SELECT DISTINCT isnull(CASE WHEN ISNULL(b.userList,'')='' AND ISNULL(a.PrivilegeView,'')<>'' OR isnull(isVisible,0)=1 THEN 0 ELSE width END,0) width, @@ -539,6 +555,10 @@ namespace Lskj.Business.Impl sumCond += ",a.PromptText "; if (dataTable.Columns.Contains("SplicingConditions")) sumCond += ",a.SplicingConditions "; + if (dataTable.Columns.Contains("ColumnAnnotation")) + sumCond += ",a.ColumnAnnotation "; + if (dataTable.Columns.Contains("TitleColor")) + sumCond += ",a.TitleColor "; string columsSql = string.Format(@"SELECT DISTINCT isnull(CASE WHEN ISNULL(b.userList,'')='' AND ISNULL(a.PrivilegeView,'')<>'' OR isnull(isVisible,0)=1 THEN 0 ELSE width END,0) width, diff --git a/插件库/Lskj.Business/Impl/SqlStoredProcedurepPrompt.cs b/插件库/Lskj.Business/Impl/SqlStoredProcedurepPrompt.cs index 813e967..b6d7517 100644 --- a/插件库/Lskj.Business/Impl/SqlStoredProcedurepPrompt.cs +++ b/插件库/Lskj.Business/Impl/SqlStoredProcedurepPrompt.cs @@ -3,11 +3,13 @@ * 执行存储过程报错(return -1 时) * 把对应执行的存储过程(exec xxx )记录到剪切板中 */ +using Lskj.Core; using Lskj.Model; using Lskj.Util; using System; using System.Collections.Generic; using System.Data; +using System.Data.Common; using System.Data.SqlClient; using System.Linq; using System.Text; @@ -483,4 +485,37 @@ SELECT 'return' = @returnValue, 'msg' = @msg;"; /// private static string EscapeSqlString(string input) { - \ No newline at end of file + if (string.IsNullOrEmpty(input)) + return string.Empty; + + // 将单引号替换为两个单引号,适应SQL Server的字符串格式 + return input.Replace("'", "''"); + } + + /// + /// 检查存储过程是否包含指定参数(模拟原方法中的syscolumns查询) + /// + /// 存储过程名称 + /// 参数名称 + /// 如果存在返回true,否则返回false + private static bool CheckIfProcedureHasParameter(string procedureName, string parameterName) + { + DataTable dt = BaseImpl.GetDataTableResult(string.Format("select * from syscolumns where id =object_id('{0}') and name='{1}'", procedureName, parameterName)); + if (dt != null && dt.Rows.Count > 0) + { + return true; + } + return false; + } + + + + + + + //单据保存(达梦) + public static void GenerateBillSaveScript_DM(string detailSql, string Dmsql, string detailTable, string detailGuid) + { + try + { + string script \ No newline at end of file diff --git a/插件库/Lskj.Business/Impl/SystemInfo.cs b/插件库/Lskj.Business/Impl/SystemInfo.cs index d039ca0..4b53b2b 100644 --- a/插件库/Lskj.Business/Impl/SystemInfo.cs +++ b/插件库/Lskj.Business/Impl/SystemInfo.cs @@ -315,8 +315,9 @@ namespace Lskj.Business Instance.AllowForgetPwd = item.Table.Columns.Contains("AllowForgetPwd") && !string.IsNullOrEmpty(item["AllowForgetPwd"] + "") ? "1".Equals(item["AllowForgetPwd"] + "") : false; Instance.ResSwitchingPrompt = item.Table.Columns.Contains("ResSwitchingPrompt") && !string.IsNullOrEmpty(item["ResSwitchingPrompt"] + "") ? item["ResSwitchingPrompt"] + "" : ""; Instance.SubscriptRefreshTime = item.Table.Columns.Contains("SubscriptRefreshTime") && !string.IsNullOrEmpty(item["SubscriptRefreshTime"] + "") ? Convert.ToInt32(item["SubscriptRefreshTime"] + "") : 0; - Instance.SubscriptRefreshTime = 1; Instance.CDSBLimsPrivateKey = item.Table.Columns.Contains("CDSBLimsPrivateKey") && !string.IsNullOrEmpty(item["CDSBLimsPrivateKey"] + "") ? item["CDSBLimsPrivateKey"] + "" : ""; + Instance.CancelFlowSource = item.Table.Columns.Contains("CancelFlowSource") && !string.IsNullOrEmpty(item["CancelFlowSource"] + "") ? "1".Equals(item["CancelFlowSource"] + "") : false; + Instance.isBlankCellColor = item.Table.Columns.Contains("isBlankCellColor") && !string.IsNullOrEmpty(item["isBlankCellColor"] + "") ? "1".Equals(item["isBlankCellColor"] + "") : false; } /// /// 高拍仪AccessKey @@ -1053,4 +1054,19 @@ namespace Lskj.Business /// public bool SpecialReverseStep; /// - ///主页面禁 \ No newline at end of file + ///主页面禁止切换到当前账套 + /// + public bool MainProhibitSwitchingAccount; + /// + ///单据明细新增时固定在最后面 + /// + public bool BillAddAtTheEnd; + /// + /// 去掉登录页面的消息通知 + /// + public bool HiddenNotification; + /// + /// 去掉登录页面的 设置服务器 + /// + public bool HiddenServerSetting; + ///