refactor(project-set): 精简项目设置页面

将配置页范围收敛到焊接环境设置,移除不再由此页面维护的配置入口及对应读写逻辑。
This commit is contained in:
2026-10-10 09:49:54 +08:00
parent 719b343502
commit ba73be3370
3 changed files with 1 additions and 301 deletions
@@ -4,7 +4,6 @@ using System;
using System.Linq;
using System.Collections.Generic;
using FineUIPro;
using System.Text.RegularExpressions;
namespace FineUIPro.Web.common.ProjectSet
{
@@ -61,35 +60,6 @@ namespace FineUIPro.Web.common.ProjectSet
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);
@@ -194,21 +164,6 @@ namespace FineUIPro.Web.common.ProjectSet
UpsertBatchSetting("5", projectId);
ShowNotify("提交成功!", MessageBoxIcon.Success);
}
private void SaveColorModelSettings(string projectId)
{
UpsertByName("管线未完成", projectId, this.txtPipelineNOComplete.Text.Trim());
UpsertByName("管线已完成", projectId, this.txtPipelineComplete.Text.Trim());
UpsertByName("焊口未完成", projectId, this.drpJointNOCompleteColor.SelectedValue.Trim());
UpsertByName("焊口已完成", projectId, this.drpJointCompleteColor.SelectedValue.Trim());
}
private void SaveQualitySettings(string projectId)
{
UpsertByName("检试验设备到期提醒天数", projectId, this.txtRemindDay.Text.Trim());
UpsertByName("月报开始日期", projectId, this.txtStarTime.Text.Trim());
UpsertByName("月报结束日期", projectId, this.txtEndTime.Text.Trim());
}
#endregion
#region Upsert Helpers
@@ -277,28 +232,6 @@ namespace FineUIPro.Web.common.ProjectSet
}
}
private void UpsertByName(string setName, string projectId, string value)
{
if (string.IsNullOrEmpty(value)) return;
var existing = BLL.Project_SysSetService.GetSysSetBySetName(setName, projectId);
if (existing != null)
{
existing.SetValue = value;
BLL.Project_SysSetService.UpdateSet(existing);
}
else
{
var newSet = new Model.Project_Sys_Set
{
SetId = SQLHelper.GetNewID(typeof(Model.Project_Sys_Set)),
ProjectId = projectId,
SetName = setName,
SetValue = value
};
BLL.Project_SysSetService.AddSet(newSet);
}
}
private void UpsertTrustSetting(string setId, string projectId, string selectedValue)
{
var existing = BLL.Project_SysSetService.GetSysSetBySetId(setId, projectId);
@@ -405,28 +338,6 @@ 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;
var m2 = BLL.Project_SysSetService.GetSysSetBySetName("管线已完成", this.CurrUser.LoginProjectId);
if (m2 != null) this.txtPipelineComplete.Text = m2.SetValue;
var m3 = BLL.Project_SysSetService.GetSysSetBySetName("焊口未完成", this.CurrUser.LoginProjectId);
if (m3 != null) this.drpJointNOCompleteColor.SelectedValue = m3.SetValue;
var m4 = BLL.Project_SysSetService.GetSysSetBySetName("焊口已完成", this.CurrUser.LoginProjectId);
if (m4 != null) this.drpJointCompleteColor.SelectedValue = m4.SetValue;
///质量页面呈现
var c1 = BLL.Project_SysSetService.GetSysSetBySetName("检试验设备到期提醒天数", this.CurrUser.LoginProjectId);
if (c1 != null) this.txtRemindDay.Text = c1.SetValue;
var c2 = BLL.Project_SysSetService.GetSysSetBySetName("月报开始日期", this.CurrUser.LoginProjectId);
if (c2 != null) this.txtStarTime.Text = c2.SetValue; else this.txtStarTime.Text = "25";
var c3 = BLL.Project_SysSetService.GetSysSetBySetName("月报结束日期", this.CurrUser.LoginProjectId);
if (c3 != null) this.txtEndTime.Text = c3.SetValue; else this.txtEndTime.Text = "24";
}
private void SetCheckFromDict(Dictionary<string, Model.Project_Sys_Set> dict, string setId, CheckBox checkBox)