From 3fc9aeab38d0ba6a6e30f007634f46958ebbae69 Mon Sep 17 00:00:00 2001 From: fei550 <1420031550@qq.com> Date: Thu, 25 Dec 2025 20:17:07 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=8E=AF=E5=A2=83=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=A2=9E=E5=8A=A0=E4=BA=91=E7=9C=B8=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectData/ProjectDevices.aspx.cs | 30 ++++++++-------- .../ProjectData/ProjectDevicesEdit.aspx.cs | 25 +++++++------ .../ProjectData/ProjectSysSet.aspx | 7 +--- .../ProjectData/ProjectSysSet.aspx.cs | 35 ++++++++++++++++++- 4 files changed, 64 insertions(+), 33 deletions(-) diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx.cs index f85822d3..696c9dd8 100644 --- a/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx.cs +++ b/SGGL/FineUIPro.Web/ProjectData/ProjectDevices.aspx.cs @@ -27,9 +27,8 @@ namespace FineUIPro.Web.ProjectData if (!IsPostBack) { Funs.DropDownPageSize(this.ddlPageSize); - this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); - + // 绑定表格 this.BindGrid(); ////权限按钮方法 @@ -60,7 +59,7 @@ namespace FineUIPro.Web.ProjectData tb = GetFilteredTable(Grid1.FilteredData, tb); var table = this.GetPagedDataTable(Grid1, tb); Grid1.DataSource = table; - Grid1.DataBind(); + Grid1.DataBind(); } #region 操作 Events @@ -165,7 +164,7 @@ namespace FineUIPro.Web.ProjectData return; } - var device = Funs.DB.Project_Devices.FirstOrDefault(x=>x.DeviceId== Grid1.SelectedRowID) ; + var device = Funs.DB.Project_Devices.FirstOrDefault(x => x.DeviceId == Grid1.SelectedRowID); if (device != null) { var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId); @@ -201,13 +200,14 @@ namespace FineUIPro.Web.ProjectData var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId); var token = YunMouHelper.getToken(); var res = YunMouHelper.addDevicesToGroups(project.YunMouGroupId, new string[] { device.DeviceSerial }, token);//添加到权限组 - YunMouHelper.setDefence(device.DeviceSerial,"1",token); + YunMouHelper.setDefence(device.DeviceSerial, "1", token); if (string.IsNullOrEmpty(res)) { Alert.ShowInTop("关联权限出错!", MessageBoxIcon.Warning); } - else { + else + { device.YunMouPermission = "是"; Funs.DB.SubmitChanges(); ShowNotify("关联成功", MessageBoxIcon.Success); @@ -215,7 +215,7 @@ namespace FineUIPro.Web.ProjectData } } } - + protected void btnMenuDeletePermission_Click(object sender, EventArgs e) { if (Grid1.SelectedRowIndexArray.Length == 0) @@ -255,8 +255,8 @@ namespace FineUIPro.Web.ProjectData return; } - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectDevicesEdit.aspx?DeviceId={0}", Grid1.SelectedRowID), "编辑项目单位", 800, 300)); - + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ProjectDevicesEdit.aspx?DeviceId={0}", Grid1.SelectedRowID), "编辑项目单位", 800, 300)); + } /// @@ -282,18 +282,18 @@ namespace FineUIPro.Web.ProjectData return; } string menuId = BLL.Const.ProjectDevicesMenuId; - + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, menuId); if (buttonList.Count() > 0) { if (buttonList.Contains(BLL.Const.BtnAdd)) { this.btnAdd.Hidden = false; - + } if (buttonList.Contains(BLL.Const.BtnModify)) { - this.btnMenuDeletePermission.Hidden= false; + this.btnMenuDeletePermission.Hidden = false; this.btnAdd.Hidden = false; this.btnMenuEdit.Hidden = false; this.btnMenuDeviceToYunMou.Hidden = false; @@ -304,7 +304,7 @@ namespace FineUIPro.Web.ProjectData this.btnMenuDelete.Hidden = false; } } - + } #endregion @@ -320,8 +320,8 @@ namespace FineUIPro.Web.ProjectData this.BindGrid(); this.GetButtonPower(); } - #endregion + #endregion + - } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.cs index d2471ca8..13d8a6f3 100644 --- a/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/ProjectData/ProjectDevicesEdit.aspx.cs @@ -6,7 +6,10 @@ using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using BLL; -using BLL.Common; +using BLL.Common; +using FastReport.Cloud.OAuth; +using FineUIPro.Web.DataShow; +using Org.BouncyCastle.Crypto; namespace FineUIPro.Web.ProjectData { @@ -39,11 +42,11 @@ namespace FineUIPro.Web.ProjectData { if (!IsPostBack) { - btnClose.OnClientClick = ActiveWindow.GetHideReference(); + btnClose.OnClientClick = ActiveWindow.GetHideReference(); this.DeviceId = Request.Params["DeviceId"]; if (!string.IsNullOrEmpty(this.DeviceId)) { - Model.Project_Devices device = Funs.DB.Project_Devices.FirstOrDefault(x=>x.DeviceId==this.DeviceId); + Model.Project_Devices device = Funs.DB.Project_Devices.FirstOrDefault(x => x.DeviceId == this.DeviceId); if (device != null) { this.txtDeviceName.Text = device.DeviceName; @@ -59,8 +62,8 @@ namespace FineUIPro.Web.ProjectData { this.dpCreateDate.Text = string.Format("{0:yyyy-MM-dd}", device.CreateDate); } - - } + + } } } } @@ -74,15 +77,15 @@ namespace FineUIPro.Web.ProjectData /// protected void btnSave_Click(object sender, EventArgs e) { - - + + Model.Project_Devices device = new Model.Project_Devices { ProjectId = this.CurrUser.LoginProjectId, DeviceName = this.txtDeviceName.Text.Trim(), DeviceSerial = this.txtDeviceSerial.Text.Trim(), Address = txtAddress.Text.Trim(), - ValidateCode=txtValidateCode.Text.Trim(), + ValidateCode = txtValidateCode.Text.Trim(), CreateDate = Funs.GetNewDateTime(this.dpCreateDate.Text.Trim()) }; if (this.drpInOut.SelectedValue != BLL.Const._Null) @@ -120,9 +123,9 @@ namespace FineUIPro.Web.ProjectData } #endregion - - - + + + } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx b/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx index fca5e0d5..4c77b905 100644 --- a/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx +++ b/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx @@ -30,12 +30,7 @@ - - - - - - + diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx.cs index de5019cc..85a404b2 100644 --- a/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx.cs +++ b/SGGL/FineUIPro.Web/ProjectData/ProjectSysSet.aspx.cs @@ -51,6 +51,35 @@ namespace FineUIPro.Web.common.ProjectSet ShowNotify("请选择项目!", MessageBoxIcon.Warning); return; } + #region 云眸 + ///通用 + var getProject = ProjectService.GetProjectByProjectId(projectId); + if (getProject != null) + { + getProject.IsYunMou = this.ckbIsYunMou.Checked; + if (this.ckbIsYunMou.Checked) + { + var token = YunMouHelper.getToken(); + string data; + data = Regex.Replace(getProject.ProjectCode, "[^0-9A-Fa-f]", "", RegexOptions.IgnoreCase); + YunMouHelper.addDevicesGroups(getProject.ProjectName, data, token); + var groupId = YunMouHelper.addPermissionGroups(getProject.ProjectName, token); + if (!string.IsNullOrEmpty(groupId)) + { + getProject.YunMouGroupId = groupId; + } + } + else + { + var token = YunMouHelper.getToken(); + string data; + data = Regex.Replace(getProject.ProjectCode, "[^0-9A-Fa-f]", "", RegexOptions.IgnoreCase); + YunMouHelper.deleteDevicesGroups(data, token);//删除设备分组,如果有子节点,可以不删除 + + } + Funs.DB.SubmitChanges(); + } + #endregion #region 焊接 // 焊接 Model.Project_Sys_Set dayReport = BLL.Project_SysSetService.GetSysSetBySetId("1", projectId); @@ -339,7 +368,11 @@ namespace FineUIPro.Web.common.ProjectSet SetCheckFromDict(dict, "10", this.ckPressMustCheckBItem); if (dict.ContainsKey("11")) this.rbMaterialColorAttribute.SelectedValue = dict["11"].SetValue == "1" ? "1" : "2"; } - + var getProject = ProjectService.GetProjectByProjectId(projectId); + if (getProject != null && getProject.IsYunMou == true) + { + this.ckbIsYunMou.Checked = true; + } //颜色模型设置 var m1 = BLL.Project_SysSetService.GetSysSetBySetName("管线未完成", this.CurrUser.LoginProjectId); if (m1 != null) this.txtPipelineNOComplete.Text = m1.SetValue;