wbc
9 天以前 66e37d850e416d55f147aca37b1365f821f71f1f
DevApp/Gs.DevApp/DevFrm/WOM/Frm_Womdaa.cs
@@ -1,3 +1,6 @@
using DevExpress.RichEdit.Export;
using DevExpress.XtraPivotGrid.Data;
using DevExpress.XtraRichEdit.Model;
using Gs.DevApp.DevFrm.Rpt;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
@@ -6,7 +9,11 @@
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -33,7 +40,7 @@
            this.splitMx98.PanelVisibility = DevExpress.XtraEditors.SplitPanelVisibility.Panel2;
            this.splitMx100.PanelVisibility = DevExpress.XtraEditors.SplitPanelVisibility.Panel2;
            this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick;
            //  this.toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick;
            this.toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick;
            this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
            this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
            this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
@@ -44,16 +51,24 @@
            toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
            this.toolBarMenu1.btnShouJianClick += ToolBarMenu1_btnShouJianClick;
            this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick;
            this.toolBarMenu1.btnChbgClick += ToolBarMenu1_btnChbgClick;
            //this.toolBarMenu1.btnChbgClick += ToolBarMenu1_btnChbgClick;
            toolBarMenu1.btnPrintClick += ToolBarMenu1_btnPrintClick;
            this.toolBarMenu1.btnOutClick += ToolBarMenu1_btnOutClick;
            //this.toolBarMenu1.btnDcClick += ToolBarMenu1_btnDcClick;
            this.toolBarMenu1.btnBDLingLiaoClick += ToolBarMenu1_btnBDLingLiaoClick;
            this.toolBarMenu1.getXmlConfig();
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx3);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx4);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMxL1);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMxL2);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, null, "", (value) =>
           {
               Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
           }, tips);
           }, tips, true, (strGuid) => {
               getModelList(strGuid);
           });
            Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
            {
                getModel(value);
@@ -71,10 +86,15 @@
            {
                Gs.DevApp.ToolBox.UtilityHelper.PrintAuto(txt_psnQty_1, txt_iCount_1, radOut, txt_yuliang_1);
            };
            //这是托板码
            this.ucBtnPrint1.btnZhiJieClick += (s, e) =>
            {
                _print(1);
            };
            this.ucBtnPrint1.btnPrintClick += (s, e) =>
            {
                _print();
                _print(0);
            };
            this.ucBtnPrint1.btnAllClick += (s, e) =>
            {
@@ -83,32 +103,37 @@
                    lbGuid, txt_daa001, gridView1);
                SelectDeleteBar frm = new SelectDeleteBar(rowGuid, "托板码");
                string strCodeList = "";
                string strAction = "";
                frm.UpdateParent += (ss, ee) =>
                {
                    strCodeList = ee.StringSingle;
                    strAction = ee.Data;
                };
                frm.ShowDialog();
                if (string.IsNullOrEmpty(strCodeList))
                    return;
                try
                if (strAction == "print")
                {
                    string rptParameter = "rpt_daa{"
                    + "100"
                    + "," + ""
                    + "," + ""
                    + "," + ""
                    + "," + ""
                    + "," + strCodeList
                    + "}";
                    using (Form rpt = new RptPreview(rowGuid, rptParameter))
                    try
                    {
                        rpt.ShowDialog();
                        string rptParameter = "rpt_daa{"
                        + "100"
                        + "," + ""
                        + "," + ""
                        + "," + ""
                        + "," + ""
                        + "," + strCodeList
                        + "}";
                        using (Form rpt = new RptPreview(rowGuid, rptParameter))
                        {
                            rpt.ShowDialog();
                        }
                        frm.Close();
                    }
                    frm.Close();
                }
                catch (Exception ex)
                {
                    MsgHelper.ShowError(ex.Message);
                    catch (Exception ex)
                    {
                        MsgHelper.ShowError(ex.Message);
                    }
                }
            };
            //这是追溯码
@@ -281,6 +306,36 @@
        }
        /// <summary>
        /// 这是备料单打印
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToolBarMenu1_btnPrintClick(object sender, EventArgs e)
        {
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_daa001, gridView1);
            if (string.IsNullOrEmpty(rowGuid))
            {
                this.toolBarMenu1.rptParameter = "return false";
                MsgHelper.Warning("请先选择你要打印的单据!");
                return;
            }
            string rptParameter = "rpt_Womdab{"
            + rowGuid  // @inOrderGuid - 单据guid
            + "," + "100"  // @isDesign - 重打都是传100
            + "," + ""  // @in1 - 入库时间(扩展用)
            + "," + ""  // @in2 - 特采(扩展用)
            + "," + ""  // @in3 - 供应商id(扩展用)
            + "," + ""  // @in4 - 张数(扩展用)
            + "," + ""  // @in5 - 数量(扩展用)
            + "," + ""  // @in6 - 扩展用
            + "}";
            this.toolBarMenu1.rptParameter = rptParameter;
            this.toolBarMenu1.guidKey = rowGuid;
        }
        /// <summary>
        /// 删除工单
        /// </summary>
        /// <param name="sender"></param>
@@ -374,6 +429,63 @@
            }
        }
        /// <summary>
        /// 导出xls
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <exception cref="NotImplementedException"></exception>
        private void ToolBarMenu1_btnOutClick(object sender, EventArgs e)
        {
            System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
            _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList));
            using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
            {
                folderBrowserDialog.Description = "选择导出文件的保存路径";
                DialogResult dialogResult = folderBrowserDialog.ShowDialog();
                if (dialogResult == DialogResult.OK)
                {
                    string _folder = folderBrowserDialog.SelectedPath;
                    var _params = new
                    {
                        inQueryWhere = _sbSqlWhere.ToString(),//查询条件
                        inFid = "",//备用
                        inP1 = "",//备用
                        inP2 = "",//备用备用
                        inP3 = "",//备用
                        inP4 = ""
                    };
                    var _obj = new Gs.DevApp.Entity.XlsOutModel("xlsOutDaa", "", "", "", _params);
                    try
                    {
                        string strJson = UtilityHelper.HttpPost("", "XlsInOut/XlsOutView_NEW", JsonConvert.SerializeObject(_obj));
                        ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                        if (_rtn.rtnCode > 0)
                        {
                            string _file = _rtn.rtnData.fileUrl.ToString();
                            string _folderName = _folder + "\\" + _file.Replace("down/", "");
                            string _url = ConfigurationManager.AppSettings["WebApiUrl"].ToString() + _file;
                            using (WebClient client = new WebClient())
                            {
                                client.DownloadFile(_url, _folderName);
                            }
                            var frm = new Gs.DevApp.DevFrm.QC.Xls(_folderName);
                            frm.ShowDialog();
                        }
                        else
                        {
                            ToolBox.MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
                        }
                    }
                    catch (Exception ex)
                    {
                        ToolBox.MsgHelper.ShowError("提示:" + ex.Message);
                    }
                }
            }
        }
        private void ToolBarMenu1_btnTzblClick(object sender, EventArgs e)
        {
            _toolCk(7);
@@ -386,6 +498,11 @@
        {
            _toolCk(9);
        }
        private void ToolBarMenu1_btnDcClick(object sender, EventArgs e)
        {
            _toolCk(12);
        }
        /// <summary>
        /// 工单状态,根据分号把中文去了
        /// </summary>
@@ -456,6 +573,7 @@
            toolBarMenu1.currentAction = "edit";
            string rowGuid = "", rowName = "";
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_daa001, gridView1);
            if (string.IsNullOrEmpty(rowGuid))
            {
                ToolBox.MsgHelper.Warning("请先选择你要操作的行!");
@@ -465,6 +583,7 @@
            if (xtraTabControl1.SelectedTabPageIndex == 1)
            {
                getModel(rowGuid);
                txt_dptNo.ReadOnly = true;
            }
            else
            {
@@ -482,36 +601,47 @@
        /// <param name="e"></param>
        private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
        {
            //toolBarMenu1.isSetBtn = false;
            //var _obj = new
            //{
            //    guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建
            //    sjxt = txt_sjXt.GetId(), //实际线体
            //    bz = txt_daa009.Text.Trim()//备注
            //};
            //try
            //{
            //    string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj));
            //    ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
            //    ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg);
            //    if (_rtn.rtnCode > 0)
            //    {
            //        lbGuid.Text = _rtn.rtnData;
            //        toolBarMenu1.isSetBtn = true;
            //        List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
            //        gvList.Add(gvMx1);
            //        UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList);
            //        toolBarMenu1.currentAction = "";
            //        txt_printRemark.Enabled = txt_psnQty_1.Enabled = txt_iCount_1.Enabled = true;
            //        txt_printRemark.ReadOnly = txt_psnQty_1.ReadOnly = txt_iCount_1.ReadOnly = false;
            //        toolBarMenu1.currentAction = "";
            //        Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
            //    }
            //}
            //catch (Exception ex)
            //{
            //    ToolBox.MsgHelper.Warning("提示:" + ex.Message);
            //}
            if (string.IsNullOrEmpty(txt_daa015.GetId()))
            {
                ToolBox.MsgHelper.ShowError("提示:线体不能为空!");
                return;
            }
            var _obj = new
            {
                guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建
                sjxt = txt_daa015.GetId(), //线体
                bz = txt_daa009.Text.Trim(),//备注
                xgdate = txt_xgdate.Text.Trim()
            };
            try
            {
                string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj));
                ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                if (_rtn.rtnCode > 0)
                {
                    ToolBox.MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg);
                    lbGuid.Text = _rtn.rtnData;
                    toolBarMenu1.isSetBtn = true;
                    List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                    //gvList.Add(gvMx1);
                    UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false);
                    //toolBarMenu1.currentAction = "";
                    //txt_printRemark.Enabled = txt_psnQty_1.Enabled = txt_iCount_1.Enabled = true;
                    //txt_printRemark.ReadOnly = txt_psnQty_1.ReadOnly = txt_iCount_1.ReadOnly = false;
                    //toolBarMenu1.currentAction = "";
                    Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
                    toolBarMenu1.currentAction = "";
                }
                else
                    ToolBox.MsgHelper.ShowError("提示:" + _rtn.rtnMsg);
            }
            catch (Exception ex)
            {
                ToolBox.MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
        /// <summary>
@@ -585,6 +715,8 @@
                    //string cjId = dy.daa013;
                    //string xjxt = dy.sjXt;
                    // txt_sjXt.getSuppler(cjId, xjxt);
                    string lineId = dy.daa013;
                    txt_daa015.getSuppler(txt_daa013.Text.Trim(), lineId);
                    //托板码
                    txt_zQty.Text = dy.daa008;
                    txt_yQty.Text = dy.yQty;
@@ -722,9 +854,9 @@
            string strMsg = "";
            switch (_inFieldValue)
            {
                //case 1:
                //    strMsg = "待开工";
                //    break;
                case 1:
                    strMsg = "待开工";
                    break;
                case 2:
                    strMsg = "工单暂停";
                    break;
@@ -743,13 +875,17 @@
                case 7:
                    strMsg = "通知备料";
                    break;
                //case 8:
                //    strMsg = "开工";
                //    break;
                case 8:
                    strMsg = "开工";
                    break;
                case 9:
                    strMsg = "手动完工";
                    break;
            };
                case 12:
                    strMsg = "倒冲领料";
                    break;
            }
            ;
            toolBarMenu1.guidKey = "";
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
@@ -794,6 +930,75 @@
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        /// <summary>
        ///  新增方法:列表显示
        /// </summary>
        /// <param name="strGuid">主表id</param>
        private void getModelList(string strGuid)
        {
            gcMxL1.DataSource = null;
            gcMxL2.DataSource = null;
            var _obj = new
            {
                guid = strGuid,//主建
            };
            try
            {
                string strJson = UtilityHelper.HttpPost("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj));
                ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                if (_rtn.rtnCode > 0)
                {
                    dynamic dy = _rtn.rtnData;
                    JArray array1 = new JArray();
                    foreach (var a in dy["list"])
                    {
                        array1.Add(a);
                    }
                    DataTable dt1 = JsonConvert.DeserializeObject<DataTable>(array1.ToString());
                    if (dt1.Rows.Count > 0)
                    {
                        gcMxL1.BindingContext = new BindingContext();
                        gcMxL1.DataSource = dt1;
                        gcMxL1.ForceInitialize();
                        gvMxL1.BestFitColumns();
                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMxL1);
                    }
                    else
                    {
                        Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMxL1, gvMxL1);
                    }
                    JArray array2 = new JArray();
                    foreach (var a in dy["list2"])
                    {
                        array2.Add(a);
                    }
                    DataTable dt2 = JsonConvert.DeserializeObject<DataTable>(array2.ToString());
                    if (dt2.Rows.Count > 0)
                    {
                        gcMxL2.BindingContext = new BindingContext();
                        gcMxL2.DataSource = dt2;
                        gcMxL2.ForceInitialize();
                        gvMxL2.BestFitColumns();
                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMxL2);
                    }
                    else
                    {
                        Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMxL2, gvMxL2);
                    }
                }
                else
                    ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg);
            }
            catch (Exception ex)
            {
                ToolBox.MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        #region 各种打印
@@ -801,12 +1006,30 @@
        /// <summary>
        /// 这是卡板码
        /// </summary>
        private void _print()
        private void _print(int type)
        {
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_daa001, gridView1);
            ucBtnPrint1.guidKey = rowGuid;
            string gdzt = txt_daa018Txt.Text.ToString();
            if (gdzt == "W:完工" || gdzt == "J:结案")
            {
                Gs.DevApp.ToolBox.MsgHelper.ShowError("工单已经完工或结案!");
                this.ucBtnPrint1.rptParameter = "return false";
                return;
            }
            if (gdzt != "M:生产中")
            {
                Gs.DevApp.ToolBox.MsgHelper.ShowError("未开工不可打印条码!");
                this.ucBtnPrint1.rptParameter = "return false";
                return;
            }
            if (rowGuid.Length < 36)
            {
                Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择你要打印的行!");
@@ -993,6 +1216,210 @@
            }
        }
        /// <summary>
        /// 备单领料
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToolBarMenu1_btnBDLingLiaoClick(object sender, EventArgs e)
        {
            ExecuteBatchOperation(1, "备单领料");
        }
        /// <summary>
        /// 批量执行操作
        /// </summary>
        /// <param name="inFieldValue">操作类型值</param>
        /// <param name="operationName">操作名称</param>
        private void ExecuteBatchOperation(int inFieldValue, string operationName)
        {
            gridView1.PostEditor();
            gridView1.UpdateCurrentRow();
            DataTable dt = this.gcMain1.DataSource as DataTable;
            // 收集所有选中的guid和工单号
            List<string> selectedGuids = new List<string>();
            List<string> selectedDaa001s = new List<string>();
            foreach (DataRow dr in dt.Rows)
            {
                string checkBox = dr["fxk"].ToString();
                string _guid = dr["guid"].ToString();
                string _daa001 = dr["daa001"].ToString();
                if (Gs.DevApp.ToolBox.UtilityHelper.ToCheck(checkBox))
                {
                    selectedGuids.Add(_guid);
                    selectedDaa001s.Add(_daa001);
                }
            }
            // 如果没有选中的记录,直接返回
            if (selectedGuids.Count == 0)
            {
                MsgHelper.ShowError("请先选择你要操作的行!");
                return;
            }
            // 确认对话框
            if (!MsgHelper.AskQuestion($"你选择了 {selectedGuids.Count} 条记录,确定{operationName}吗?"))
                return;
            // 执行批量操作
            BatchExecuteOperation(selectedGuids, inFieldValue, operationName, selectedDaa001s);
        }
        /// <summary>
        /// 批量执行操作并统一返回结果
        /// </summary>
        private void BatchExecuteOperation(List<string> guids, int inFieldValue, string operationName, List<string> nos)
        {
            List<string> successMessages = new List<string>();
            List<string> errorMessages = new List<string>();
            string lastSuccessGuid = string.Empty;
            string _webServiceplace = "";
            switch (inFieldValue)
            {
                case 1:
                    _webServiceplace = "bdll";
                    break;
                //case 2:
                //    _webServiceplace = "强制结案";
                //    break;
                //case 3:
                //    _webServiceplace = "反结案(反执行至完工)";
                //    break;
                //case 8:
                //    _webServiceplace = "审核";
                //    break;
                //case 9:
                //    _webServiceplace = "反审核";
                //    break;
            }
            ;
            // 使用for循环来同时遍历guid和对应的工单号
            for (int i = 0; i < guids.Count; i++)
            {
                string rowGuid = guids[i];
                string workOrderNo = nos[i]; // 对应的工单号
                if (string.IsNullOrEmpty(rowGuid))
                {
                    errorMessages.Add($"工单 {workOrderNo}:遇到空GUID,跳过处理");
                    continue;
                }
                try
                {
                    var _obj = new
                    {
                        guid = rowGuid,
                        inFieldValue = inFieldValue,
                    };
                    var strJson = UtilityHelper.HttpPost("",
                        _webServiceName + _webServiceplace,
                        JsonConvert.SerializeObject(_obj));
                    var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                    if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
                    {
                        // 成功消息中使用工单号
                        successMessages.Add($"工单 {workOrderNo}:{_rtn.rtnData.outMsg}");
                        lastSuccessGuid = rowGuid;
                        // 更新界面
                        UpdateUI(rowGuid, inFieldValue);
                    }
                    else
                    {
                        // 错误消息中使用工单号
                        errorMessages.Add($"工单 {workOrderNo}:{_rtn.rtnData.outMsg}");
                    }
                }
                catch (Exception ex)
                {
                    // 异常消息中使用工单号
                    errorMessages.Add($"工单 {workOrderNo}:处理失败 - {ex.Message}");
                }
            }
            // 统一显示结果
            ShowBatchResult(successMessages, errorMessages, operationName, lastSuccessGuid);
        }
        /// <summary>
        /// 更新界面
        /// </summary>
        private void UpdateUI(string rowGuid, int inFieldValue)
        {
            if (xtraTabControl1.SelectedTabPageIndex == 1)
            {
                getModel(lbGuid.Text.Trim());
                int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
                gridView1.FocusedRowHandle = rowHandle;
            }
            else
            {
                getPageList(this.pageBar1.CurrentPage);
                int rowHandle = gridView1.LocateByValue("guid", rowGuid);
                gridView1.FocusedRowHandle = rowHandle;
            }
        }
        /// <summary>
        /// 显示批量操作结果
        /// </summary>
        private void ShowBatchResult(List<string> successMessages, List<string> errorMessages, string operationName, string lastSuccessGuid)
        {
            StringBuilder resultMessage = new StringBuilder();
            resultMessage.AppendLine($"{operationName}操作完成:");
            resultMessage.AppendLine($"成功:{successMessages.Count} 条");
            resultMessage.AppendLine($"失败:{errorMessages.Count} 条");
            if (successMessages.Count > 0)
            {
                resultMessage.AppendLine();
                resultMessage.AppendLine("成功记录:");
                foreach (var msg in successMessages.Take(5)) // 只显示前5条成功信息
                {
                    resultMessage.AppendLine($"  ✓ {msg}");
                }
                if (successMessages.Count > 5)
                {
                    resultMessage.AppendLine($"  ... 还有 {successMessages.Count - 5} 条成功记录");
                }
            }
            if (errorMessages.Count > 0)
            {
                resultMessage.AppendLine();
                resultMessage.AppendLine("失败记录:");
                foreach (var msg in errorMessages.Take(5)) // 只显示前5条错误信息
                {
                    resultMessage.AppendLine($"  ✗ {msg}");
                }
                if (errorMessages.Count > 5)
                {
                    resultMessage.AppendLine($"  ... 还有 {errorMessages.Count - 5} 条失败记录");
                }
            }
            // 根据结果类型显示不同的消息框
            if (errorMessages.Count == 0)
            {
                MsgHelper.ShowInformation(resultMessage.ToString());
            }
            else if (successMessages.Count == 0)
            {
                MsgHelper.ShowError(resultMessage.ToString());
            }
            else
            {
                MsgHelper.ShowError(resultMessage.ToString());
            }
        }
        #endregion
    }
}