diff --git a/.gitignore b/.gitignore index a2da55d..d2a04e5 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ Test/obj SqlSugarTest/bin SqlSugarTest/obj DeviceManager_20240529.zip +TsSFCDeivceClient/bin +Intend/bin diff --git a/DeviceRepair.Api/Controllers/MaintenanceController.cs b/DeviceRepair.Api/Controllers/MaintenanceController.cs index d2095d9..49cf0db 100644 --- a/DeviceRepair.Api/Controllers/MaintenanceController.cs +++ b/DeviceRepair.Api/Controllers/MaintenanceController.cs @@ -4,12 +4,15 @@ using DeviceRepair.DataAccess; using DeviceRepair.Models; using DeviceRepair.Models.Common; using DeviceRepair.Utils; +using Newtonsoft.Json.Linq; using System; using System.Data; using System.Net.Http; using System.Text; using System.Web.Http; using System.Xml; +using System.Linq; +using System.Collections.Generic; namespace DeviceRepair.Api.Controllers { @@ -233,7 +236,7 @@ namespace DeviceRepair.Api.Controllers isSuccess = ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0; if (isSuccess) - return new APIResponseData { Code = 1, Data = ds }; + return new APIResponseData { Code = 1, Data = ds.Tables[0] }; } else { @@ -251,6 +254,99 @@ namespace DeviceRepair.Api.Controllers return apiResponseData; } + ///// + ///// 获取PE QE 信息 + ///// + ///// + ///// + //[HttpPost, HttpAuthorize, Route("ProductResourceAllocationsGet")] + //public APIResponseData ProductResourceAllocationsGet(SfcParams Params) + //{ + // APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "获取失败!" }; + // try + // { + // string SFCWebServiceUrl = Utils.Config.Configurations.Properties.SFCWebServiceUrl; + // bool isSuccess = false; + // byte[] password = Encoding.Unicode.GetBytes(Params.LoginCode); + // Array.Reverse(password); + // string pass64 = Convert.ToBase64String(password); + // if (pass64.Length < 10) + // pass64 += "YeT+=fue"; + + // StringBuilder builder = new StringBuilder(); + // builder.AppendLine($""); + // builder.AppendLine($""); + // builder.AppendLine($" "); + // builder.AppendLine($" "); + // builder.AppendLine($" {pass64}"); + // builder.AppendLine($" {Params.LoginCode}"); + // builder.AppendLine($" "); + // builder.AppendLine($" "); + // builder.AppendLine($" "); + // builder.AppendLine($" "); + // builder.AppendLine($" {Params.inParams}"); + // builder.AppendLine($" "); + // builder.AppendLine($" "); + // builder.AppendLine($""); + + // using (var client = new HttpClient()) + // { + // var content = new StringContent(builder.ToString(), Encoding.UTF8, "text/xml"); + // var request = new HttpRequestMessage(HttpMethod.Post, $"{SFCWebServiceUrl}/SfcAddon.asmx"); + // request.Content = content; + + // var response = client.SendAsync(request).Result; + // if (response.IsSuccessStatusCode) + // { + // string stringRtn = response.Content.ReadAsStringAsync().Result; + + // XmlDocument doc = new XmlDocument(); + // doc.LoadXml(stringRtn); + // XmlNode Node = doc.DocumentElement["soap:Body"]["ProductResourceAllocationsGetResponse"]["ProductResourceAllocationsGetResult"]["Code"].LastChild; + + // if (Node.Value == "0") + // { + // Node = doc.DocumentElement["soap:Body"]["ProductResourceAllocationsGetResponse"]["btResults"].LastChild; + // byte[] bytes = Convert.FromBase64String(Node.Value); + // DataSet ds = bytes.ExactDataSet(); + // isSuccess = ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0; + + // if (isSuccess) + // { + // APIResponseData s = StaffsDatasGet(Params); + // if (s.IsSuccess) + // { + // DataTable t2 = s.Data as DataTable; + // Guid[] staffs = ds.Tables[0].AsEnumerable().Select(x => x.Field("Staff")).ToArray(); + // var query = from row in t2.AsEnumerable() + // where staffs.Contains(row.Field("GUID")) + // select row.Field("EMail"); + + // //t2.AsEnumerable().Where(x=>x.Field<"">) + + // return new APIResponseData { Code = 1, Data = ds }; + // } + // else + // { + // return new APIResponseData { Code = -1, Message = s.Message }; + // } + // } + // } + // else + // { + // Node = doc.DocumentElement["soap:Body"]["ProductResourceAllocationsGetResponse"]["ProductResourceAllocationsGetResult"]["Msg"].LastChild; + // return new APIResponseData { Code = -1, Message = Node.Value }; + // } + // } + // } + // } + // catch (Exception ex) + // { + // apiResponseData.Message = ex.Message; + // } + // return apiResponseData; + //} + /// /// 获取PE QE 信息 /// @@ -262,6 +358,11 @@ namespace DeviceRepair.Api.Controllers APIResponseData apiResponseData = new APIResponseData { Code = -1, Message = "获取失败!" }; try { + JObject js = JObject.Parse(Params.inParams); + js.Add("UserCode", ""); + js.Add("UserName", ""); + js.Add("Post", ""); + string SFCWebServiceUrl = Utils.Config.Configurations.Properties.SFCWebServiceUrl; bool isSuccess = false; byte[] password = Encoding.Unicode.GetBytes(Params.LoginCode); @@ -280,9 +381,9 @@ namespace DeviceRepair.Api.Controllers builder.AppendLine($" "); builder.AppendLine($" "); builder.AppendLine($" "); - builder.AppendLine($" "); - builder.AppendLine($" {Params.inParams}"); - builder.AppendLine($" "); + builder.AppendLine($" "); + builder.AppendLine($" {js.ToString()}"); + builder.AppendLine($" "); builder.AppendLine($" "); builder.AppendLine($""); @@ -299,21 +400,21 @@ namespace DeviceRepair.Api.Controllers XmlDocument doc = new XmlDocument(); doc.LoadXml(stringRtn); - XmlNode Node = doc.DocumentElement["soap:Body"]["ProductResourceAllocationsGetResponse"]["ProductResourceAllocationsGetResult"]["Code"].LastChild; + XmlNode Node = doc.DocumentElement["soap:Body"]["StaffsDatasGetResponse"]["StaffsDatasGetResult"]["Code"].LastChild; if (Node.Value == "0") { - Node = doc.DocumentElement["soap:Body"]["ProductResourceAllocationsGetResponse"]["btResults"].LastChild; + Node = doc.DocumentElement["soap:Body"]["StaffsDatasGetResponse"]["btResults"].LastChild; byte[] bytes = Convert.FromBase64String(Node.Value); DataSet ds = bytes.ExactDataSet(); isSuccess = ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0; if (isSuccess) - return new APIResponseData { Code = 1, Data = ds }; + return new APIResponseData { Code = 1, Data = ds.Tables[0] }; } else { - Node = doc.DocumentElement["soap:Body"]["ProductResourceAllocationsGetResponse"]["ProductResourceAllocationsGetResult"]["Msg"].LastChild; + Node = doc.DocumentElement["soap:Body"]["StaffsDatasGetResponse"]["StaffsDatasGetResult"]["Msg"].LastChild; return new APIResponseData { Code = -1, Message = Node.Value }; } } diff --git a/DeviceRepair.Api/DeviceRepair.Api.csproj.user b/DeviceRepair.Api/DeviceRepair.Api.csproj.user index f442f63..cd58591 100644 --- a/DeviceRepair.Api/DeviceRepair.Api.csproj.user +++ b/DeviceRepair.Api/DeviceRepair.Api.csproj.user @@ -15,7 +15,7 @@ True False - D:\WorkStation\设备维护管理软件2\DeviceRepair.Api\Properties\PublishProfiles\1.pubxml + D:\UGit\DeviceManager\DeviceRepair.Api\Properties\PublishProfiles\FolderProfile.pubxml ApiControllerEmptyScaffolder root/Common/Web API diff --git a/DeviceRepair.Api/Properties/PublishProfiles/FolderProfile.pubxml b/DeviceRepair.Api/Properties/PublishProfiles/FolderProfile.pubxml new file mode 100644 index 0000000..afb8a6f --- /dev/null +++ b/DeviceRepair.Api/Properties/PublishProfiles/FolderProfile.pubxml @@ -0,0 +1,16 @@ + + + + + False + False + True + Release + Any CPU + FileSystem + C:\Users\Clove\Desktop\WebSite + FileSystem + + \ No newline at end of file diff --git a/DeviceRepair.Api/Properties/PublishProfiles/FolderProfile.pubxml.user b/DeviceRepair.Api/Properties/PublishProfiles/FolderProfile.pubxml.user new file mode 100644 index 0000000..dd8f56b --- /dev/null +++ b/DeviceRepair.Api/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -0,0 +1,408 @@ + + + + + <_PublishTargetUrl>C:\Users\Clove\Desktop\WebSite + True|2024-05-29T05:43:17.4797209Z; + + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:38 + + + 05/28/2024 22:39:54 + + + 05/28/2024 22:39:54 + + + 05/29/2024 13:43:16 + + + 05/29/2024 13:43:16 + + + 05/29/2024 13:43:15 + + + 05/21/2024 00:58:04 + + + 05/29/2024 13:43:15 + + + 05/29/2024 10:07:57 + + + 04/16/2024 11:52:33 + + + 05/29/2024 10:07:57 + + + 05/29/2024 13:43:15 + + + 05/21/2024 00:58:03 + + + 05/29/2024 13:43:15 + + + 05/28/2024 22:39:54 + + + 05/28/2024 22:39:54 + + + 05/28/2024 22:39:54 + + + 05/28/2024 22:39:54 + + + 05/28/2024 22:39:54 + + + 05/28/2024 22:39:55 + + + 05/28/2024 22:39:55 + + + 05/28/2024 22:39:55 + + + 05/28/2024 22:39:56 + + + 05/28/2024 22:39:56 + + + 05/28/2024 22:39:56 + + + 05/28/2024 22:39:57 + + + 05/28/2024 22:39:57 + + + 05/28/2024 22:39:57 + + + 05/28/2024 22:39:57 + + + 05/28/2024 22:39:57 + + + 05/28/2024 22:39:57 + + + 05/28/2024 22:39:57 + + + 05/28/2024 22:39:57 + + + 05/28/2024 22:39:54 + + + 05/28/2024 22:39:58 + + + 05/28/2024 22:39:57 + + + 05/28/2024 22:39:57 + + + 05/28/2024 22:39:57 + + + 05/28/2024 22:39:57 + + + 05/28/2024 22:39:57 + + + 05/28/2024 22:39:57 + + + 05/28/2024 22:39:57 + + + 05/28/2024 22:39:57 + + + 05/28/2024 22:39:57 + + + 05/28/2024 22:39:57 + + + 05/28/2024 22:39:57 + + + 05/28/2024 22:39:57 + + + 05/28/2024 22:39:54 + + + 05/28/2024 22:39:56 + + + 05/28/2024 22:39:56 + + + 05/28/2024 22:39:56 + + + 05/28/2024 22:39:56 + + + 05/28/2024 22:39:56 + + + 05/28/2024 22:39:55 + + + 05/28/2024 22:39:55 + + + 05/28/2024 22:39:55 + + + 05/28/2024 22:39:56 + + + 05/28/2024 22:39:56 + + + 05/28/2024 22:39:56 + + + 05/28/2024 22:39:58 + + + 03/02/2015 17:32:38 + + + 03/02/2015 17:32:38 + + + 04/04/2015 01:09:32 + + + 04/04/2015 01:09:34 + + + 04/04/2015 01:09:34 + + + 02/13/2015 21:23:48 + + + 02/13/2015 21:23:48 + + + 02/13/2015 21:23:48 + + + 02/13/2015 21:23:50 + + + 02/13/2015 21:23:50 + + + 02/13/2015 21:23:50 + + + 02/13/2015 21:23:50 + + + 01/28/2015 12:02:44 + + + 01/28/2015 12:04:32 + + + 01/28/2015 12:03:18 + + + 01/28/2015 12:02:56 + + + 01/28/2015 12:03:48 + + + 01/28/2015 12:02:22 + + + 02/11/2014 23:28:40 + + + 01/28/2015 12:02:34 + + + 01/28/2015 12:04:32 + + + 01/28/2015 12:04:32 + + + 01/28/2015 12:04:32 + + + 04/16/2024 09:58:39 + + + 04/16/2024 09:58:39 + + + 04/16/2024 09:58:38 + + + 04/16/2024 09:58:38 + + + 04/16/2024 09:58:39 + + + 04/16/2024 09:58:39 + + + 04/16/2024 09:58:39 + + + 04/16/2024 09:58:39 + + + 04/16/2024 09:58:38 + + + 04/16/2024 10:35:55 + + + 04/16/2024 09:58:39 + + + 04/16/2024 09:58:39 + + + 04/16/2024 09:58:40 + + + 04/16/2024 09:58:40 + + + 04/16/2024 09:58:40 + + + 04/16/2024 09:58:44 + + + 04/16/2024 09:58:44 + + + 04/16/2024 09:58:44 + + + 04/16/2024 09:58:44 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:41 + + + 04/16/2024 09:58:38 + + + 04/16/2024 09:58:38 + + + 04/16/2024 09:58:38 + + + 04/16/2024 09:58:38 + + + 04/16/2024 09:58:38 + + + 05/29/2024 13:43:16 + + + \ No newline at end of file diff --git a/DeviceRepair.DataAccess/MaintenanceAccess.cs b/DeviceRepair.DataAccess/MaintenanceAccess.cs index 456f89b..2ab8527 100644 --- a/DeviceRepair.DataAccess/MaintenanceAccess.cs +++ b/DeviceRepair.DataAccess/MaintenanceAccess.cs @@ -234,11 +234,13 @@ namespace DeviceRepair.DataAccess Form.CreatorName = Operation.OperatorName; Form.CreatOn = CurrentTime; - if (db.Saveable(Form).ExecuteCommand() > 0) + int AutoID = db.Saveable(Form).ExecuteReturnEntity()?.AutoID ?? 0; + if (AutoID > 0) { db.CommitTran(); apiResponseData.Code = 1; apiResponseData.Message = string.Empty; + apiResponseData.Data = AutoID; } else { diff --git a/DeviceRepairAndOptimization/Pages/CustomField/pageFieldCode.cs b/DeviceRepairAndOptimization/Pages/CustomField/pageFieldCode.cs index 51e0810..fb6b4ea 100644 --- a/DeviceRepairAndOptimization/Pages/CustomField/pageFieldCode.cs +++ b/DeviceRepairAndOptimization/Pages/CustomField/pageFieldCode.cs @@ -87,6 +87,9 @@ namespace DeviceRepairAndOptimization.Pages.CustomField GridViewInitialize(gridView1); InitializeGridDatas(); + + gridView1.OptionsMenu.EnableColumnMenu = false; + gridView1.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect; gridView1.OptionsSelection.ShowCheckBoxSelectorInColumnHeader = DevExpress.Utils.DefaultBoolean.False; gridView1.CustomDrawColumnHeader += GridView1_CustomDrawColumnHeader; @@ -362,6 +365,13 @@ namespace DeviceRepairAndOptimization.Pages.CustomField return; } + if (result.Length > 200) + { + if (XtraMessageBoxHelper.AskYesNo("原因描述超出长度,最大长度为200!") == DialogResult.Yes) + goto getRemark; + return; + } + bool BeStatus = !CurrentFieldInfo.Status; string Description = result; diff --git a/DeviceRepairAndOptimization/Pages/DriveMaintenance/page_AssignDriveTree.cs b/DeviceRepairAndOptimization/Pages/DriveMaintenance/page_AssignDriveTree.cs index 64e5234..4ce092b 100644 --- a/DeviceRepairAndOptimization/Pages/DriveMaintenance/page_AssignDriveTree.cs +++ b/DeviceRepairAndOptimization/Pages/DriveMaintenance/page_AssignDriveTree.cs @@ -247,7 +247,16 @@ namespace DeviceRepairAndOptimization.Pages.DriveMaintenance { foreach (TreeListNode root in tvDevices.Nodes) { - GetCheckedAuthorizatioId(root); + if (root.Nodes.Count == 0 && root.CheckState == CheckState.Checked) + { + var drv = tvDevices.GetDataRecordByNode(root) as DeviceInformationInfoTree; + if (drv != null && drv.AutoID != 0) + deviceLst.Add(drv); + } + else + { + GetCheckedAuthorizatioId(root); + } } } diff --git a/DeviceRepairAndOptimization/Pages/Maintain/dlgAccessoriesEdit.cs b/DeviceRepairAndOptimization/Pages/Maintain/dlgAccessoriesEdit.cs index d98ed4e..b7a56f0 100644 --- a/DeviceRepairAndOptimization/Pages/Maintain/dlgAccessoriesEdit.cs +++ b/DeviceRepairAndOptimization/Pages/Maintain/dlgAccessoriesEdit.cs @@ -179,6 +179,9 @@ namespace DeviceRepairAndOptimization.Pages.Maintain CurrentAccessories.Remove(CurrentAccessoriesInfoModel); gridControl1.DataSource = CurrentAccessories; gridView1.BestFitColumns(); + + if ((CurrentAccessories?.Count ?? 0) > 0) + CurrentAccessoriesInfoModel = gridView1.GetRow(0) as DeviceWarrantyRequestAccessoriesInfo; } catch (Exception ex) { diff --git a/DeviceRepairAndOptimization/Pages/Maintain/dlgAccessoriesLst.cs b/DeviceRepairAndOptimization/Pages/Maintain/dlgAccessoriesLst.cs index 3d577c7..e6b69a9 100644 --- a/DeviceRepairAndOptimization/Pages/Maintain/dlgAccessoriesLst.cs +++ b/DeviceRepairAndOptimization/Pages/Maintain/dlgAccessoriesLst.cs @@ -199,8 +199,22 @@ namespace DeviceRepairAndOptimization.Pages.Maintain try { CurrentAccessories = null; - int result = XtraInputBox.Show("请输入配件的数量:", "配件添加", 0); - if (result > 0) + + XtraInputBoxArgs args = new XtraInputBoxArgs { Prompt = "请输入配件的数量:", Caption = "配件添加", DefaultResponse = 0 }; + args.Buttons = new DialogResult[] { DialogResult.OK, DialogResult.Cancel }; + args.DefaultButtonIndex = (int)DialogResult.Cancel; + DialogResult DiaResult = DialogResult.None; + args.Showing += (a, b) => + { + b.Buttons[DialogResult.OK].Click += (c, d) => { DiaResult = DialogResult.OK; }; + }; + + int result = XtraInputBox.Show(args); + if (DiaResult == DialogResult.None) + return; + else + //int result = XtraInputBox.Show("请输入配件的数量:", "配件添加", 0); + //if (result > 0) { CurrentAccessories = new DeviceWarrantyRequestAccessoriesInfo { diff --git a/DeviceRepairAndOptimization/Pages/Maintain/pageMaintainEdit.Designer.cs b/DeviceRepairAndOptimization/Pages/Maintain/pageMaintainEdit.Designer.cs index 3906231..b126fa8 100644 --- a/DeviceRepairAndOptimization/Pages/Maintain/pageMaintainEdit.Designer.cs +++ b/DeviceRepairAndOptimization/Pages/Maintain/pageMaintainEdit.Designer.cs @@ -265,12 +265,14 @@ namespace DeviceRepairAndOptimization.Pages.Maintain // // txtNo // + this.txtNo.EditValue = "N/A"; this.txtNo.Location = new System.Drawing.Point(144, 584); this.txtNo.Margin = new System.Windows.Forms.Padding(4); this.txtNo.MenuManager = this.toolbarFormManager1; this.txtNo.Name = "txtNo"; this.txtNo.Properties.Appearance.Font = new System.Drawing.Font("Microsoft YaHei UI", 11.25F); this.txtNo.Properties.Appearance.Options.UseFont = true; + this.txtNo.Properties.MaxLength = 50; this.txtNo.Size = new System.Drawing.Size(710, 26); this.txtNo.StyleController = this.layoutControl1; this.txtNo.TabIndex = 12; @@ -283,6 +285,7 @@ namespace DeviceRepairAndOptimization.Pages.Maintain this.txtReason.Name = "txtReason"; this.txtReason.Properties.Appearance.Font = new System.Drawing.Font("Microsoft YaHei UI", 11.25F); this.txtReason.Properties.Appearance.Options.UseFont = true; + this.txtReason.Properties.MaxLength = 3800; this.txtReason.Size = new System.Drawing.Size(710, 26); this.txtReason.StyleController = this.layoutControl1; this.txtReason.TabIndex = 11; @@ -313,6 +316,7 @@ namespace DeviceRepairAndOptimization.Pages.Maintain this.txtContent.Name = "txtContent"; this.txtContent.Properties.Appearance.Font = new System.Drawing.Font("Microsoft YaHei UI", 11.25F); this.txtContent.Properties.Appearance.Options.UseFont = true; + this.txtContent.Properties.MaxLength = 3800; this.txtContent.Size = new System.Drawing.Size(842, 98); this.txtContent.StyleController = this.layoutControl1; this.txtContent.TabIndex = 8; diff --git a/DeviceRepairAndOptimization/Pages/Maintain/pageMaintainView.cs b/DeviceRepairAndOptimization/Pages/Maintain/pageMaintainView.cs index bd0969b..8a57f65 100644 --- a/DeviceRepairAndOptimization/Pages/Maintain/pageMaintainView.cs +++ b/DeviceRepairAndOptimization/Pages/Maintain/pageMaintainView.cs @@ -213,8 +213,7 @@ namespace DeviceRepairAndOptimization.Pages.Maintain /// void GridViewInitialize(DevExpress.XtraGrid.Views.Grid.GridView view) { - view.OptionsBehavior.Editable = false; - view.OptionsBehavior.ReadOnly = true; + gridView1.OptionsMenu.EnableColumnMenu = false; view.OptionsSelection.EnableAppearanceFocusedCell = false; view.OptionsScrollAnnotations.ShowSelectedRows = DevExpress.Utils.DefaultBoolean.False; @@ -327,7 +326,7 @@ namespace DeviceRepairAndOptimization.Pages.Maintain btn_Validate.Enabled = true; btn_Validate.Tag = "1"; }//&& CurrentObjectInfo.MaintaionItems.ValidateBy != GlobalInfo.CurrentUser.AutoID - else if (CurrentObjectInfo.MaintaionItems.ValidateBy > 0 && (GlobalInfo.HasRole("BIZ_FIELD_MAINTENANCE_COMFIRM2") || GlobalInfo.HasRole("BIZ_FIELD_MAINTENANCE_COMFIRM3"))) + else if (CurrentObjectInfo.MaintaionItems.ValidateBy > 0 && CurrentObjectInfo.MaintaionItems.ValidateBy != GlobalInfo.CurrentUser.AutoID && (GlobalInfo.HasRole("BIZ_FIELD_MAINTENANCE_COMFIRM2") || GlobalInfo.HasRole("BIZ_FIELD_MAINTENANCE_COMFIRM3"))) { if (CurrentObjectInfo.MaintaionItems.Validate2By == 0) { @@ -387,6 +386,12 @@ namespace DeviceRepairAndOptimization.Pages.Maintain /// private void btn_Query_Click(object sender, EventArgs e) { + if (!GlobalInfo.HasRole("BIZ_REPAIRRECORD_VIEW")) + { + XtraMessageBoxHelper.Error($"当前账号缺少此操作的权限"); + return; + } + LoadingGridviewDatas(); } @@ -410,6 +415,12 @@ namespace DeviceRepairAndOptimization.Pages.Maintain { try { + if (!GlobalInfo.HasRole("BIZ_REPAIRRECORD_EDIT")) + { + XtraMessageBoxHelper.Error($"当前账号缺少此操作的权限"); + return; + } + if (CurrentObjectInfo == null) { throw new Exception($"请选择要维修的停机单!"); @@ -440,6 +451,13 @@ namespace DeviceRepairAndOptimization.Pages.Maintain { try { + if (!GlobalInfo.HasRole("BIZ_FIELD_MAINTENANCE_COMFIRM1") && !GlobalInfo.HasRole("BIZ_FIELD_MAINTENANCE_COMFIRM2") && !GlobalInfo.HasRole("BIZ_FIELD_MAINTENANCE_COMFIRM3")) + { + XtraMessageBoxHelper.Error($"当前账号缺少此操作的权限"); + return; + } + + if (CurrentObjectInfo == null) { throw new Exception($"请选择要操作的停机单!"); @@ -475,6 +493,12 @@ namespace DeviceRepairAndOptimization.Pages.Maintain { try { + if (!GlobalInfo.HasRole("BIZ_REPAIRRECORD_EDIT")) + { + XtraMessageBoxHelper.Error($"当前账号缺少此操作的权限"); + return; + } + if (CurrentObjectInfo == null) { throw new Exception($"请选择要维修的停机单!"); @@ -504,6 +528,12 @@ namespace DeviceRepairAndOptimization.Pages.Maintain { try { + if (!GlobalInfo.HasRole("BIZ_REPAIRRECORD_PRINT")) + { + XtraMessageBoxHelper.Error($"当前账号缺少此操作的权限"); + return; + } + if (CurrentObjectInfo == null) { throw new Exception("获取对象失败,请重试!"); @@ -679,6 +709,12 @@ namespace DeviceRepairAndOptimization.Pages.Maintain { try { + if (!GlobalInfo.HasRole("BIZ_REPAIRRECORD_EXPORT")) + { + XtraMessageBoxHelper.Error($"当前账号缺少此操作的权限"); + return; + } + using (FolderBrowserDialog folderDialog = new FolderBrowserDialog()) { folderDialog.Description = "请选择保存文件的路径:"; diff --git a/DeviceRepairAndOptimization/Properties/AssemblyInfo.cs b/DeviceRepairAndOptimization/Properties/AssemblyInfo.cs index bd3ff78..6c02aa2 100644 --- a/DeviceRepairAndOptimization/Properties/AssemblyInfo.cs +++ b/DeviceRepairAndOptimization/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.1.7")] -[assembly: AssemblyFileVersion("2.0.1.7")] +[assembly: AssemblyVersion("2.0.1.8")] +[assembly: AssemblyFileVersion("2.0.1.8")] diff --git a/DeviceRepairAndOptimization/frm_Launch.cs b/DeviceRepairAndOptimization/frm_Launch.cs index b62d212..3fee4ab 100644 --- a/DeviceRepairAndOptimization/frm_Launch.cs +++ b/DeviceRepairAndOptimization/frm_Launch.cs @@ -492,11 +492,11 @@ namespace DeviceRepairAndOptimization { try { - //if (!GlobalInfo.HasRole("BASE_ROLE_VIEW")) - //{ - // XtraMessageBoxHelper.Error($"当前账号缺少此操作的权限"); - // return; - //} + if (!GlobalInfo.HasRole("BIZ_REPAIRRECORD_VIEW")) + { + XtraMessageBoxHelper.Error($"当前账号缺少此操作的权限"); + return; + } Pages.Maintain.pageMaintainView view = new Pages.Maintain.pageMaintainView(); view.ShowDialog(); diff --git a/TsSFCDeivceClient/DowntimeFormAdd.cs b/TsSFCDeivceClient/DowntimeFormAdd.cs index b206a22..4f5e989 100644 --- a/TsSFCDeivceClient/DowntimeFormAdd.cs +++ b/TsSFCDeivceClient/DowntimeFormAdd.cs @@ -220,7 +220,7 @@ namespace TsSFCDeivceClient if (!apiResponseData2.IsSuccess) throw new Exception(apiResponseData2.Message); - dtRtn = (DataTable)apiResponseData2.Data; + dtRtn = apiResponseData2.ToDeserializeObject(); } DeviceWarrantyRequestForm deviceWarrantyRequestForm = new DeviceWarrantyRequestForm @@ -241,51 +241,61 @@ namespace TsSFCDeivceClient if (!apiResponseData.IsSuccess) throw new Exception(apiResponseData.Message); - List EmailList = new List(); - if (dtRtn != null && dtRtn.Rows.Count > 0 && dtRtn.Columns.Contains("Product") && dtRtn.Columns.Contains("Technology")) + int MaintenanceAutoID = Convert.ToInt32(apiResponseData.Data); + try { - string Product = dtRtn.Rows[0]["Product"] + ""; - string Technology = dtRtn.Rows[0]["Technology"] + ""; - - apiResponseData = Biz.HttpHelper.Instance.Post($"{ServiceUrl}{DeviceApiUrlConstValue.ProductResourceAllocationsGet}", deviceWarrantyRequestForm.toJson()); - if (!apiResponseData.IsSuccess) - throw new Exception(apiResponseData.Message); - - List staffResourceAllocations = apiResponseData.ToDeserializeObject>(); - //IList staffResourceAllocations = p_InspRespos.ProductResourceAllocationsGet(Product, Technology); - if (staffResourceAllocations != null && staffResourceAllocations.Count > 0) + List EmailList = new List(); + if (dtRtn != null && dtRtn.Rows.Count > 0 && dtRtn.Columns.Contains("Product") && dtRtn.Columns.Contains("Technology")) { - foreach (var item in staffResourceAllocations) - { - if ((int)item.StaffPost == 0 || (int)item.StaffPost == 1) - { - if (!string.IsNullOrWhiteSpace(item.StaffEMail) && Regex.IsMatch(item.StaffEMail, emailPattern)) - { - EmailList.Add(item.StaffEMail); - } + string Product = dtRtn.Rows[0]["Product"] + ""; + string Technology = dtRtn.Rows[0]["Technology"] + ""; - if (!string.IsNullOrWhiteSpace(item.StaffResource?.EMail ?? "")) + JObject js = JObject.Parse(Runtime.inParams); + js.Add("Product", Product); + js.Add("Technology", Technology); + + apiResponseData = Biz.HttpHelper.Instance.Post($"{ServiceUrl}{DeviceApiUrlConstValue.ProductResourceAllocationsGet}", JsonConvert.SerializeObject(new { LoginCode = Runtime.CurrentUser.UserCode, Password = Runtime.CurrentUser.Password, inParams = js.ToString() })); + if (!apiResponseData.IsSuccess) + throw new Exception(apiResponseData.Message); + + DataTable staffResourceAllocations = apiResponseData.ToDeserializeObject(); + //IList staffResourceAllocations = p_InspRespos.ProductResourceAllocationsGet(Product, Technology); + if (staffResourceAllocations != null && (staffResourceAllocations.Rows?.Count ?? 0) > 0) + { + foreach (DataRow item in staffResourceAllocations.Rows) + { + if ((item["Post"]?.ToString() ?? "-1") == "0" || (item["Post"]?.ToString() ?? "-1") == "1") { - EmailList.Add(item.StaffResource.EMail); + string eml = item["EMail"]?.ToString() ?? ""; + if (!string.IsNullOrWhiteSpace(eml) && Regex.IsMatch(eml, emailPattern)) + { + EmailList.Add(eml); + } } } } } + + if (EmailList.Count > 0 && InitializeMail()) + { + mail.Title = $"有在生产的设备出现故障,请您尽快评估故障状态!"; + mail.IsBodyHtml = true; + System.Text.StringBuilder builder = new System.Text.StringBuilder(); + builder.AppendLine($"

在 {ddlWhereFailureOccurred.Text} 发起的编号为:{MaintenanceAutoID} 的保修单,设备 {CurrentDeviceInfo.EquipmentName}({CurrentDeviceInfo.EquipmentID}) 发生故障,{(deviceWarrantyRequestForm.InProduction ? "存有产品在加工中,产品批次号:" + deviceWarrantyRequestForm.Batch : "")} ,请您尽快评估故障情况。

"); + builder.AppendLine($"

发起人:生产部 - {Runtime.CurrentUser.UserName}

"); + mail.Body = builder.ToString(); + string msgResult = ""; + //收件人 + mail.ToMailAddress = EmailList.ToArray(); + MailKitHelp.SendStatus ss = mail.Send(out msgResult); + } + } + catch (Exception ex) + { + XtraMessageBoxHelper.Warn($"新增数据成功,邮件发送失败,失败原因:{ex.Message}"); } - if (EmailList.Count > 0 && InitializeMail()) - { - mail.Title = $"有在生产的设备出现故障,请您尽快评估故障状态!"; - mail.IsBodyHtml = true; - System.Text.StringBuilder builder = new System.Text.StringBuilder(); - builder.AppendLine($"

在 {ddlWhereFailureOccurred.Text} 的 {CurrentDeviceInfo.EquipmentName}({CurrentDeviceInfo.EquipmentID}) 发生故障,{(deviceWarrantyRequestForm.InProduction ? "存有产品在加工中,产品批次号:" + deviceWarrantyRequestForm.Batch : "")} ,请您尽快评估故障情况。

"); - builder.AppendLine($"

发起人:生产部 - {Runtime.CurrentUser.UserName}

"); - mail.Body = builder.ToString(); - string msgResult = ""; - //收件人 - mail.ToMailAddress = EmailList.ToArray(); - MailKitHelp.SendStatus ss = mail.Send(out msgResult); - } + DialogResult = DialogResult.OK; } diff --git a/TsSFCDeivceClient/pageDeviceMaintenanceFormView.cs b/TsSFCDeivceClient/pageDeviceMaintenanceFormView.cs index b73a9a4..56f0fd0 100644 --- a/TsSFCDeivceClient/pageDeviceMaintenanceFormView.cs +++ b/TsSFCDeivceClient/pageDeviceMaintenanceFormView.cs @@ -211,6 +211,8 @@ namespace TsSFCDeivceClient /// void InitializeGridViewStyle() { + gridView1.OptionsMenu.EnableColumnMenu = false; + gridView1.OptionsSelection.ShowCheckBoxSelectorInColumnHeader = DevExpress.Utils.DefaultBoolean.False; /// 自增长行号 gridView1.CustomDrawRowIndicator += (s, e) => { @@ -464,13 +466,11 @@ namespace TsSFCDeivceClient } CloseWaitForm(); XtraMessageBoxHelper.Info("操作成功!"); - InitializeGridDatas(); } catch (Exception ex) { CloseWaitForm(); XtraMessageBoxHelper.Error(ex.Message); - InitializeGridDatas(); } } @@ -527,13 +527,11 @@ namespace TsSFCDeivceClient } CloseWaitForm(); XtraMessageBoxHelper.Info("操作成功!"); - InitializeGridDatas(); } catch (Exception ex) { CloseWaitForm(); XtraMessageBoxHelper.Error(ex.Message); - InitializeGridDatas(); } } @@ -579,7 +577,6 @@ namespace TsSFCDeivceClient CloseWaitForm(); XtraMessageBoxHelper.Info("操作成功!"); - InitializeGridDatas(); } } else @@ -596,7 +593,6 @@ namespace TsSFCDeivceClient { CloseWaitForm(); XtraMessageBoxHelper.Error(ex.Message); - InitializeGridDatas(); } } }