|
|
|
@@ -28,6 +28,7 @@ using MaiMuControl.SysStatusMgr.MqttMgr; |
|
|
|
using MaiMuControl.SysStatusMgr.StatusMgr;
|
|
|
|
using MaiMuControl.SysStatusMgr.UserMgr;
|
|
|
|
using MaiMuControl.Utils;
|
|
|
|
using Microsoft.Office.Interop.Excel;
|
|
|
|
using Models;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
@@ -2347,15 +2348,16 @@ namespace MaiMuAOI.SysCtrl |
|
|
|
CurrDefectOrders = OrderService.GetListNav(detectOrder);
|
|
|
|
if (CurrDefectOrders == null || CurrDefectOrders.Count == 0)
|
|
|
|
{
|
|
|
|
Log("运行", "当前工单未测试,清空所有工单数据!");
|
|
|
|
Log("运行", $"当前工单:{detectOrder} 未测试,清空所有工单数据!");
|
|
|
|
CurrOrderPrintInfos.Clear();
|
|
|
|
CurrOrderPrintInfos = new List<PrintInfo>();
|
|
|
|
CurrDefectIndex = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CurrDefectIndex = CurrDefectOrders.Count;
|
|
|
|
}
|
|
|
|
Log("运行", $"当前工单第{CurrDefectIndex + 1}块,开始测试!");
|
|
|
|
Log("运行", $"当前工单:{detectOrder},第{CurrDefectIndex + 1}块,开始测试!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -6752,7 +6754,8 @@ namespace MaiMuAOI.SysCtrl |
|
|
|
if (ret)
|
|
|
|
Log("工单打印", $"打印成功!");
|
|
|
|
else
|
|
|
|
Log("工单打印", $"打印失败:打印机={confMgr.SysConfigParams.ExcelPrinterName}, 模板路径={model.OrderTempPath}, 打印数据={CurrOrderPrintInfos}", WarningEnum.Low);
|
|
|
|
Log("工单打印", $"打印失败:打印机={confMgr.SysConfigParams.ExcelPrinterName}, 模板路径={model.OrderTempPath}, 打印数据={Newtonsoft.Json.JsonConvert.SerializeObject(CurrOrderPrintInfos)}", WarningEnum.Low);
|
|
|
|
CurrOrderPrintInfos.Clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
@@ -8946,7 +8949,7 @@ namespace MaiMuAOI.SysCtrl |
|
|
|
#region 界面显示
|
|
|
|
public static void showRowNum_onDataGrid_RowPostPaint(DataGridView dgv, object sender, DataGridViewRowPostPaintEventArgs e)
|
|
|
|
{
|
|
|
|
Rectangle rectangle = new Rectangle(e.RowBounds.Location.X, e.RowBounds.Location.Y, dgv.RowHeadersWidth - 4, e.RowBounds.Height);
|
|
|
|
System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(e.RowBounds.Location.X, e.RowBounds.Location.Y, dgv.RowHeadersWidth - 4, e.RowBounds.Height);
|
|
|
|
TextRenderer.DrawText(e.Graphics, (e.RowIndex + 1).ToString(), dgv.RowHeadersDefaultCellStyle.Font, rectangle, dgv.RowHeadersDefaultCellStyle.ForeColor, TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
|
|
@@ -9785,7 +9788,10 @@ namespace MaiMuAOI.SysCtrl |
|
|
|
try
|
|
|
|
{
|
|
|
|
if (!printControl.ExcelOpenFile(printerTemp))
|
|
|
|
{
|
|
|
|
Log("打印", $"打印失败: 模板打开失败", WarningEnum.Low);
|
|
|
|
ret = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
Dictionary<string, string> printData = new Dictionary<string, string>();
|
|
|
|
if (ret)
|
|
|
|
@@ -9800,6 +9806,11 @@ namespace MaiMuAOI.SysCtrl |
|
|
|
{
|
|
|
|
if(!printData.ContainsKey(item.PrintKey))
|
|
|
|
printData.Add(item.PrintKey, item.PrintCode);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
printData.Remove(item.PrintKey);
|
|
|
|
printData.Add(item.PrintKey, item.PrintCode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( item.Type == 3 && !item.IsValue) //excel Code
|
|
|
|
{
|
|
|
|
@@ -9933,9 +9944,19 @@ namespace MaiMuAOI.SysCtrl |
|
|
|
}
|
|
|
|
//只是要sheet1
|
|
|
|
printControl.ExcelSelectSheet(1);
|
|
|
|
if (data != null)
|
|
|
|
if ((data != null) && (printData.Count > 0))
|
|
|
|
{
|
|
|
|
if (!printControl.ExcelSetDataValue(printData))
|
|
|
|
{
|
|
|
|
Log("打印", $"打印失败: 参数设置错误", WarningEnum.Low);
|
|
|
|
ret = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Log("打印", $"打印失败: 打印数据为空或错误", WarningEnum.Low);
|
|
|
|
ret = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!printControl.ExcelPrintData(printerName))
|
|
|
|
ret = false;
|
|
|
|
|