SVN r1148

SVN-Revision: r1148
This commit is contained in:
cyf
2026-03-23 01:47:22 +00:00
parent eb0522e144
commit d8ac361255
14 changed files with 188 additions and 116 deletions
+1 -1
View File
@@ -269,7 +269,7 @@ namespace Lskj.AutoUpdate
System.IO.FileInfo f = new FileInfo(newPath);
if (!file.Size.ToString().Equals(f.Length.ToString()) && !file.FileName.ToString().EndsWith(".xml"))
{
MessageBox.Show($"文件大小与服务器不匹配");
MessageBox.Show($"文件大小与服务器不匹配 "+ file.FileName);
ShowErrorAndRestartApplication();
}
@@ -774,6 +774,13 @@ namespace Lskj.Control
gridColumn.AppearanceCell.Options.UseTextOptions = true;
gridColumn.AppearanceCell.TextOptions.HAlignment = model.DataAlignment == 1 ? DevExpress.Utils.HorzAlignment.Center : DevExpress.Utils.HorzAlignment.Far;
}
if (!string.IsNullOrWhiteSpace(model.TitleColor))
{
gridColumn.AppearanceHeader.Options.UseForeColor = true;
gridColumn.AppearanceHeader.ForeColor = ColorTranslator.FromHtml(model.TitleColor);
}
if (EnabledChangeColor)
{
if (!model.Edit)
@@ -34,6 +34,7 @@ using System.Net;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Web;
using System.Windows.Forms;
namespace Lskj.Main.Control
@@ -457,6 +458,22 @@ namespace Lskj.Main.Control
{
this.lbUserName.Text = ERPInfo.Instance.UserName;
if (this.lbUserName.Width+ this.lbUserName.Left-2> button6.Left)
{
//右上角用户名特殊处理
this.lbUserName.Text = this.lbUserName.Text.Substring(0, 2) + "...";
ToolTip toolTip = new ToolTip
{
InitialDelay = 100, // 鼠标悬浮后延迟显示时间(毫秒)
ReshowDelay = 500, // 连续悬浮不同控件时的延迟
ShowAlways = true, // 始终显示提示
UseAnimation = true, // 显示动画效果
UseFading = true, // 淡入淡出效果
AutoPopDelay = 1000000 // 提示框自动消失时间(毫秒)
};
toolTip.SetToolTip(this.lbUserName, ERPInfo.Instance.UserName);
}
this.tsmi_userName.Text = LanguageTranslation.Translatable ? LanguageTranslation.GetTranslatedText("用户名") + "" + ERPInfo.Instance.UserName : "用户名:" + ERPInfo.Instance.UserName;
this.tsmi_account_book.Text = LanguageTranslation.Translatable ? LanguageTranslation.GetTranslatedText("账套") + "" + ERPInfo.Instance.AccountBook : "账套:" + ERPInfo.Instance.AccountBook;
this.tsmi_version.Text = string.Format("Version{0}", Assembly.GetExecutingAssembly().GetName().Version + "");
+2 -2
View File
@@ -746,8 +746,8 @@ namespace Lskj.Main
break;
case -1: // 登录失败
default:
ErrorLogText = string.Format("登录用户Id{0}\r\n登录用户名称:{1}\r\n输入密码:{2}", userId, userName, password);
LogUtil.WriteDebug("", "登录失败", ErrorLogText, "");
//ErrorLogText = string.Format("登录用户Id{0}\r\n登录用户名称:{1}\r\n输入密码:{2}", userId, userName, password);
//LogUtil.WriteDebug("", "登录失败", ErrorLogText, "");
MessageUtil.Show(ResourceKeys.LoginFault);
break;
}
+12 -1
View File
@@ -17,6 +17,8 @@ using System.Reflection;
using System.IO;
using Lskj.Control.BrowserSetting;
using Microsoft.Win32;
using System.Resources;
using System.Runtime.InteropServices;
namespace Lskj.Main
{
@@ -26,12 +28,15 @@ namespace Lskj.Main
//private static extern bool SetProcessDpiAwarenessContext(IntPtr dpiContext);
//private static readonly IntPtr DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = new IntPtr(-4);
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
//SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
CefRuntime.Load();//cef浏览器模块设置加载
var mainArgs = new CefMainArgs(args);
@@ -81,6 +86,7 @@ namespace Lskj.Main
catch (Exception ex)
{
MessageUtil.Show(ex);
LogHelper.Instance.WriteError(ex);
}
}
@@ -113,6 +119,9 @@ namespace Lskj.Main
commandLine.AppendSwitch("resources-dir-path", path);
commandLine.AppendSwitch("locales-dir-path", Path.Combine(path, "locales"));
commandLine.AppendSwitch("ignore-certificate-errors", "1");
commandLine.AppendSwitch("allow-running-insecure-content", "1");
//如果注册表中CefMultithreading不为1,并且根目录中不存在BrowserMultithreading.txt"文件,就是单线程模式
//只要有一个条件满足就是多线程模式
if (!BrowserMultithreading() && !File.Exists(PubUtil.AbsolutelyPath + "BrowserMultithreading.txt"))
@@ -146,7 +155,9 @@ namespace Lskj.Main
/// <param name="e">The <see cref="ThreadExceptionEventArgs"/> instance containing the event data.</param>
static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
{
MessageUtil.Show(e.Exception);
// 获取异常对象
Exception ex = e.Exception;
MessageUtil.Show(ex);
LogHelper.Instance.WriteError(e.Exception);
}
+7 -3
View File
@@ -431,7 +431,10 @@ namespace Lskj.Model
///打印按钮交互条件
/// </summary>
public string PrintingConditions;
/// <summary>
///新增保存时检查单据号
/// </summary>
public bool SaveVerifyBillNo;
/// <summary>
@@ -439,7 +442,7 @@ namespace Lskj.Model
/// </summary>
/// <param name="rowItem">The row item.</param>
///
//p_systembilltype
public BillModel(DataRow rowItem)
{
if (rowItem == null) return;
@@ -521,4 +524,5 @@ namespace Lskj.Model
this.RefreshSelectedDetail = rowItem.Table.Columns.Contains("RefreshSelectedDetail") ? "1".Equals(rowItem["RefreshSelectedDetail"] + "") : false;
this.InitialRefreshId = rowItem.Table.Columns.Contains("InitialRefreshId") ? rowItem["InitialRefreshId"] + "" : "";
this.IgnoreAllocated = rowItem.Table.Columns.Contains("IgnoreAllocated") ? "1".Equals(rowItem["IgnoreAllocated"] + "") : false;
this.BillSourceControlName = rowItem.Table.Col
this.BillSourceControlName = rowItem.Table.Columns.Contains("BillSourceControlName") ? rowItem["BillSourceControlName"] + "" : "";
if (!string.IsNullOrWhiteSpace(this.BillSource
+1 -2
View File
@@ -4979,7 +4979,7 @@ namespace Lskj.PubBill
/// <returns>System.String.</returns>
private string GetAddRecord(ref string parmaryValue)
{
if (BillModel.NewVer == 0)
if (BillModel.NewVer == 0|| BillModel.SaveVerifyBillNo)
{
// 检查当前的单据号是否已被占用.
string newBillNo = BillImpl.GetBillNo(this.BillModel.BillSeq);
@@ -5421,7 +5421,6 @@ namespace Lskj.PubBill
string masterSql = BillModel.SaveState ? GetUpdateRecord(billNo) : GetAddRecord(ref billNo);
string detailSql = GetDetailRecord(detailGuid, billNo, addRowList).ToString();
// 检查单据头数据合法性
if (string.IsNullOrEmpty(masterSql)) return false;
+20 -1
View File
@@ -54,6 +54,7 @@ namespace Lskj.PubBrower
{
urlEnd = string.IsNullOrEmpty(PubBrowerModel.UrlParame) ? ReplaceHelper.ReplaceUserInfo(PubBrowerModel.ModuleCode) : string.IsNullOrWhiteSpace(PubBrowerModel.UrlParame) ? "" : HttpUtility.UrlEncode(PubBrowerModel.UrlParame);
}
this.Tag= urlEnd;
string OAUrlAndEnd = string.Empty;
if (!(PubBrowerModel.BetweenDLLCoid != null && PubBrowerModel.BetweenDLLCoid.StartsWith("http")) && !urlEnd.StartsWith("http"))
{
@@ -150,4 +151,22 @@ namespace Lskj.PubBrower
FrmSelectDownload frmSelectDownload = new FrmSelectDownload();
frmSelectDownload.URL = URL;
frmSelectDownload.FileName = FileName;
frmSelectDownload.isBatchDownLoad = isBa
frmSelectDownload.isBatchDownLoad = isBatchBrower;
// frmSelectDownload.TopMost = true;
frmSelectDownload.ShowDialog();
//SaveFileDialog saveFileDialog = new SaveFileDialog();
//saveFileDialog.FileName = FileName;
//saveFileDialog.Title = "下载模板文件到";
//saveFileDialog.RestoreDirectory = true;
////点了保存按钮进入
//if (saveFileDialog.ShowDialog() == DialogResult.OK)
//{
// string localFilePath = System.IO.Path.GetFullPath(saveFileDialog.FileName);//获得文件路径,含文件名
// string fileNameExt = localFilePath.Substring(localFilePath.LastIndexOf("\\") + 1);//获取文件名,不带路径
// string FilePath = localFilePath.Substring(0, localFilePath.LastIndexOf("\\"));//获取文件路径,不带文件名
// FrmDownload frm = new FrmDownload(URL, FileName, localFilePath);
// frm.Show();
//}
}
}
}
+15 -3
View File
@@ -12,7 +12,7 @@ using Lskj.Control.Model;
using Lskj.Business.Impl;
using Lskj.Util;
using Lskj.Data;
using DevExpress.XtraEditors;
namespace Lskj.PubChart
{
@@ -40,6 +40,8 @@ namespace Lskj.PubChart
/// 数据源
/// </summary>
private DataTable dtData;
//是否初始化完成
public bool _isInitFinish = false;
public FrmMain()
{
InitializeComponent();
@@ -67,10 +69,14 @@ namespace Lskj.PubChart
this.SearchObj.OnSearchAfterCallBack += new EventHandler(OnSearchAfter);
DataTable gridColumn = BaseModuleImpl.GetBaseGridColumns(this.PubchartModel.ModuleCode);
this.chartControlEx.PanelControlObj.Visible = true;
this.chartControlEx.SplitMain.PanelVisibility = SplitPanelVisibility.Both;//初始化时默认隐藏
this.chartControlEx.GridControlObj.GridView.OptionsView.ColumnAutoWidth = true;
this.chartControlEx.GridControlObj.SetEditColumns(gridColumn);
this.chartControlEx.GridControlObj.gridControl.DataSource = dtData;
this.chartControlEx.SetCharts(BaseModuleImpl.GetChartParams(SysModel.FormKey));
this.chartControlEx.SplitMain.SplitterMoved += new System.EventHandler(this.OnTopSplitterMoved);
}
catch (Exception ex)
{
@@ -81,6 +87,7 @@ namespace Lskj.PubChart
}
finally
{
this.InitializeSplitterPosition();
Lskj.Control.Model.AutoSizeChange.ControllInitializeSize(this);
this.chartControlEx.Visible = true;
}
@@ -111,5 +118,10 @@ namespace Lskj.PubChart
MessageUtil.Show(Message,ex.Message);
}
}
}
}
//分割条改变时
private void OnTopSplitterMoved(object sender, EventArgs e)
{
if (this._isInitFinish)// 是否为初始化创建
+14 -3
View File
@@ -26,6 +26,18 @@ namespace Lskj.PubPrint
{
public Form1()
{
string DataServerText = ini.IniReadValue("刷新时间", "Server");
string DataNameText = ini.IniReadValue("刷新时间", "Database");
if (!string.IsNullOrWhiteSpace(DataServerText) && !string.IsNullOrWhiteSpace(DataNameText))
{
DBConfig.Instance.ServerName = DataServerText;
DBConfig.Instance.DataBase = DataNameText;
}
if (DBConfig.Instance.CreateConnection())
{
InitializeComponent();
@@ -133,7 +145,7 @@ namespace Lskj.PubPrint
{
this.Invoke(new EventHandler(delegate
{
DataTable DT = SqlHelper.ExecuteDataTable(string.Format("{0} {1} printFlag = 0 {2} {3}", Sql, condition, PrintScreen, SortField));
DataTable DT = SqlHelper.ExecuteDataTable(string.Format("{0} {1} printFlag = 0 {2} {3}", Sql, condition, PrintScreen, SortField));
copydt = DT.Copy();
flog = false;
this.timer1.Enabled = false;
@@ -276,7 +288,6 @@ namespace Lskj.PubPrint
System.Environment.Exit(0);
}
if (DBConfig.Instance.CreateConnection())
{
string ip = string.Empty;
@@ -286,7 +297,7 @@ namespace Lskj.PubPrint
//解析主机名称或IP地址的system.net.iphostentry实例。
//IPHostEntry localhost = Dns.GetHostEntry(hostname);
ip = ERPInfo.Instance.LoginIP;
//hostname = "PC-20210908GGIV";
//hostname = "shuanghe-kailian";
DataTable dt = SqlHelper.ExecuteDataTable(string.Format("select * from p_systemComputerTab where ComputerName='{0}'", hostname));
//foreach (string ss in PrinterSettings.InstalledPrinters)
+8 -49
View File
@@ -8,6 +8,7 @@ using System.Windows.Forms;
using Lskj.Model;
using Lskj.Business.Impl;
using Lskj.Control;
using System.Collections;
namespace Lskj.Report
{
@@ -25,54 +26,12 @@ namespace Lskj.Report
{
try
{
DynamicReportModel reportModel = new DynamicReportModel(obj);
//int formType = ReportImpl.GetBaseType(reportModel.ModuleCode);
GridEnum gridEnum = GridEnum.GridView;
//if (formType == 1) gridEnum = GridEnum.BandedGridView;
//if (formType == 2) gridEnum = GridEnum.TreeListGridView;
FrmMain mainForm = new FrmMain();
//mainForm.Model = reportModel;
//mainForm.Model.GridEnumObj = gridEnum;
//this.SubForm = mainForm;
DynamicReportModel reportModel = new DynamicReportModel(obj);
mainForm.Model = reportModel;
reportModel.DataCaches = new Dictionary<object, Hashtable>();
if (SystemInfo.Instance.OptimizationSpeed) mainForm.GetDataCaches(reportModel.DataCaches);
GridEnum gridEnum = GridEnum.GridView;
//判断是否存在存储过程
string results = BaseImpl.GetResult("IF EXISTS(SELECT *FROM SYSOBJECTS WHERE NAME ='p_Get_NewDesignPlatform_BasicFile' AND TYPE = 'P') begin select 1 end else Begin select 2 end").ToString();
if (results.Equals("1") && SystemInfo.Instance.isExecload) {
int formType;
int _errCode;
System.Data.DataSet dsConfig = ReportImpl.GetNewDesignPlatform(reportModel.ModuleId, reportModel.ModuleCode, Lskj.Data.ResourceKeys.SettingTableName, out formType, out _errCode);
Lskj.Data.Caches.CacheSYSConfig.Instance().BaseType = formType;
Lskj.Data.Caches.CacheSYSConfig.Instance().ErrCode = _errCode;
Lskj.Data.Caches.CacheSYSConfig.Instance().SetData(dsConfig);
if (formType == 1) gridEnum = GridEnum.BandedGridView;
if (formType == 2) gridEnum = GridEnum.TreeListGridView; // 基础档案暂时注释GridEnum.TreeListGridView此类型,TrcReport和手机端显示卡片冲突.
mainForm.Model = reportModel;
mainForm.Model.GridEnumObj = gridEnum;
this.SubForm = mainForm;
}
else
{
int formType = ReportImpl.GetBaseType(reportModel.ModuleCode);
if (formType == 1) gridEnum = GridEnum.BandedGridView;
if (formType == 2) gridEnum = GridEnum.TreeListGridView;
mainForm.Model = reportModel;
mainForm.Model.GridEnumObj = gridEnum;
this.SubForm = mainForm;
}
}
catch (Exception ex)
{
MessageUtil.Show(ex);
LogHelper.Instance.WriteError(ex);
LogUtil.WriteError("Lskj.Report.dll--参数错误-->" + obj.ToString(), ex);
}
}
/// <summary>
/// 窗口
/// </summary>
public Form SubForm { get; set; }
}
}
if (!reportModel.DataCaches.GetValu
+61 -22
View File
@@ -22,6 +22,8 @@ using Lskj.Util;
using Lskj.Data;
using Lskj.Business.Impl;
using Lskj.Business;
using System.Threading.Tasks;
using System.Collections;
namespace Lskj.Report
{
@@ -52,18 +54,26 @@ namespace Lskj.Report
WaitForm.ShowForm();
try
{
Dictionary<object, Hashtable> dataCaches = Model != null ? Model.DataCaches : null;
this.Model.Privilege = this.Model.Privilege.Equals("3") ? "1" : Model.ModuleId > 0 ? BaseImpl.GetUserPurviewsByMenuId(Model.ModuleId + "") + "" : BaseImpl.GetUserPurviewsByMenuCode(Model.ModuleCode) + "";
this.mControl.ModuleGridDetailObj.ModuleGridObj.VisibleOperPanel = false;
this.mControl.Details = GetReportDetails();
if (!dataCaches.GetValue(this, "Details", out List<GridDetailModel> details))
{
details = GetReportDetails();
}
this.mControl.Details = details;
this.mControl.InitControls(Model);
this.FormClosing += new FormClosingEventHandler(OnClose);
}
catch (Exception ex)
{
LogHelper.Instance.WriteError(ex, ResourceKeys.BaseReport);
//MessageUtil.Show(ex.Message + "\r\n" + ex.StackTrace);
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message,ex.Message);
MessageUtil.Show(Message, ex.Message);
}
finally
{
@@ -74,6 +84,11 @@ namespace Lskj.Report
WaitForm.HideForm();
}
private void OnClose(object sender, FormClosingEventArgs e)
{
this.mControl.CloseModule();
}
/// <summary>
/// <para>说明:获取报表明细</para>
/// <para>创建人:龚宇超</para>
@@ -87,29 +102,53 @@ namespace Lskj.Report
private List<GridDetailModel> GetReportDetails()
{
List<GridDetailModel> details = new List<GridDetailModel>();
bool ProcessExists = (Lskj.Data.Caches.CacheSYSConfig.Instance().JudgeProcessExists()&&SystemInfo.Instance.isExecload);
if (ProcessExists)
DataTable table = ReportImpl.GetReportDetailPages(Model.ModuleCode);
foreach (DataRow item in table.Rows)
{
DataTable table = Lskj.Data.Caches.CacheSYSConfig.Instance().GetBaseDetailPages();
foreach (DataRow item in table.Rows)
{
DataTable gridColumns = Lskj.Data.Caches.CacheSYSConfig.Instance().GetReportDetailColumns(item["id"] + "");
details.Add(new GridDetailModel(item, gridColumns, GridCustomColumnStruct.BaseDetailGridView));
}
DataTable gridColumns = ReportImpl.GetReportDetailColumns(Model.ModuleCode, item["id"] + "");
details.Add(new GridDetailModel(item, gridColumns, GridCustomColumnStruct.BaseDetailGridView));
}
else {
DataTable table = ReportImpl.GetReportDetailPages(Model.ModuleCode);
foreach (DataRow item in table.Rows)
{
DataTable gridColumns = ReportImpl.GetReportDetailColumns(Model.ModuleCode, item["id"] + "");
details.Add(new GridDetailModel(item, gridColumns, GridCustomColumnStruct.BaseDetailGridView));
}
}
return details;
}
}
}
/// <summary>
/// 获取数据源缓存
/// </summary>
/// <param name="cachesDic"></param>
public void GetDataCaches(Dictionary<object, Hashtable> cachesDic)
{
//全局数据
Task<DynamicModel> dynamicModelTask = cachesDic.AddTask(this, "DynamicModel", new Task<DynamicModel>(() =>
{
return Model;//动态链接库对象
}));
Task<DataRow> systemDllRowTask = cachesDic.AddTask(this, "SystemDllRow", new Task<DataRow>(() =>
{
return MainImpl.GetSystemdllTab(Model.ModuleCode);//获取单个模块信息
}));
Task<ModuleModel> sysModelTask = cachesDic.AddTask(this, "SysModel", new Task<ModuleModel>(() =>
{
ModuleModel sysModel = new ModuleModel(systemDllRowTask.Result);
return sysModel;//系统模块实体对象
}));
Task<List<GridDetailModel>> detailTask = cachesDic.AddTask(this, "Details", new Task<List<GridDetailModel>>(() =>
{
DataTable detailPages = ReportImpl.GetReportDetailPages(Model.ModuleCode);//
List<GridDetailModel> details = new List<GridDetailModel>();//表格明细对象的集合
foreach (DataRow item in detailPages.Rows)
{
GridDetailModel gridDetailModel = new GridDetailModel(item, null, GridCustomColumnStruct.BaseDetailGridView);
details.Add(gridDetailModel);
Task<DataTable> addGridColumnsTask = cachesDic.AddTask(gridDetailModel, "GridColumns", new Task<DataTable>(() =>
{
DataTable gridColumns = ReportImpl.GetReportDetailColumns(Model.ModuleCode, item["id"] + "");//获取报表明细列
gridDetailModel.GridColumns = gridColumns;
return gridColumns;
}));
}
return details;
}));
Task<int> formTypeTask
+7 -29
View File
@@ -2038,6 +2038,12 @@ namespace Lskj.SweepCode
}
//页签中设置主表行(页签里可以设置主表行中的值为默认值)
if (_rowItem != null)
{
this.detailTab.SetMainRow(_rowItem);
}
IniAllControl(_rowItem, isFocus);
}
catch (Exception ex)
@@ -2381,32 +2387,4 @@ namespace Lskj.SweepCode
}
}
}
}
#endregion
#endregion
/// <summary>
/// <para>说明:明细分割条移动保存位置</para>
/// <para>创建人:龚宇超</para>
/// <para>创建日期:2018-03-06 </para>
/// <para>修改人:</para>
/// <para>修改日期:</para>
/// <para>修改备注:</para>
/// <para>版本:1.0</para>
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
private void OnDetailsSplitterMoved(object sender, EventArgs e)
{
if (this._isInitFinish)
{
SplitContainerControl splitContainerControl = sender as SplitContainerControl;
IniHelper.Write(string.Format("Step_splitLeftSide_{0}", this.SysModel.ModuleCode), splitContainerControl.SplitterPosition + "");
}
}
}
}
+16
View File
@@ -106,6 +106,22 @@ namespace Lskj.Util
}
}
/// <summary>
/// 导出文件的文件路径
/// </summary>
public static string ExportFilePath
{
get
{
string path = AbsolutelyPath + "TempFiles\\ExportFile/";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
return path;
}
}
public static void ClearFilesInDirectory(string targetDir)
{