feat:增加根据选择是否需要材料炉批号进行管控
This commit is contained in:
@@ -51,6 +51,16 @@ namespace FineUIPro.Web.common.ProjectSet
|
||||
ShowNotify("请选择项目!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
bool useMaterialBatch = BLL.Project_SysSetService.UsesMaterialBatchNumber(projectId);
|
||||
if (useMaterialBatch && !this.ckbUseMaterialBatch.Checked)
|
||||
{
|
||||
string warning = BLL.Project_SysSetService.GetDisableMaterialBatchWarning(projectId);
|
||||
if (warning != "")
|
||||
{
|
||||
ShowNotify(warning, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#region 云眸
|
||||
///通用
|
||||
var getProject = ProjectService.GetProjectByProjectId(projectId);
|
||||
@@ -172,6 +182,7 @@ namespace FineUIPro.Web.common.ProjectSet
|
||||
}
|
||||
BLL.Project_SysSetService.AddSet(newThickness);
|
||||
}
|
||||
UpsertMaterialBatchSetting(projectId);
|
||||
if (this.ckbPdms.Checked)
|
||||
{
|
||||
pdms.IsAuto = true;
|
||||
@@ -221,6 +232,28 @@ namespace FineUIPro.Web.common.ProjectSet
|
||||
}
|
||||
}
|
||||
|
||||
private void UpsertMaterialBatchSetting(string projectId)
|
||||
{
|
||||
var existing = BLL.Project_SysSetService.GetSysSetBySetId(BLL.Project_SysSetService.MaterialBatchSetId, projectId);
|
||||
if (existing != null)
|
||||
{
|
||||
existing.SetName = BLL.Project_SysSetService.MaterialBatchSetName;
|
||||
existing.IsAuto = this.ckbUseMaterialBatch.Checked;
|
||||
BLL.Project_SysSetService.UpdateSet(existing);
|
||||
}
|
||||
else
|
||||
{
|
||||
var newSet = new Model.Project_Sys_Set
|
||||
{
|
||||
SetId = BLL.Project_SysSetService.MaterialBatchSetId,
|
||||
ProjectId = projectId,
|
||||
SetName = BLL.Project_SysSetService.MaterialBatchSetName,
|
||||
IsAuto = this.ckbUseMaterialBatch.Checked
|
||||
};
|
||||
BLL.Project_SysSetService.AddSet(newSet);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpsertValueById(string setId, string projectId, string value, string setName = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(value)) return;
|
||||
@@ -353,6 +386,7 @@ namespace FineUIPro.Web.common.ProjectSet
|
||||
/// </summary>
|
||||
private void Show(string projectId)
|
||||
{
|
||||
this.ckbUseMaterialBatch.Checked = true;
|
||||
var q = from x in Funs.DB.Project_Sys_Set where x.ProjectId == projectId select x;
|
||||
if (q.Any())
|
||||
{
|
||||
@@ -365,6 +399,7 @@ namespace FineUIPro.Web.common.ProjectSet
|
||||
SetBatchFromDict(dict, "5");
|
||||
SetCheckFromDict(dict, "6", this.ckbJointB);
|
||||
SetCheckFromDict(dict, "7", this.ckbThickness);
|
||||
SetCheckFromDict(dict, BLL.Project_SysSetService.MaterialBatchSetId, this.ckbUseMaterialBatch);
|
||||
SetRadioValueFromDict(dict, "8", this.rblPressUnit, defaultValue: "2");
|
||||
if (dict.ContainsKey("9")) this.AvevaNetUrl.Text = dict["9"].SetValue;
|
||||
SetCheckFromDict(dict, "10", this.ckPressMustCheckBItem);
|
||||
@@ -446,4 +481,4 @@ namespace FineUIPro.Web.common.ProjectSet
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user