重构包装管理服务,优化数据结构与接口

移除 APIPackagingManageService,功能迁移至 HJGLPackagingmanageService 并进行重构,新增方法支持包装与组件关联管理、分页查询、状态描述等功能。
更新 PackagingManageController,替换旧服务调用,新增接口方法。
调整数据库结构,新增子表 HJGL_PackagingManageDetail,优化包装与组件的关联存储。
更新前端页面逻辑,适配新数据结构,新增 StackingPosition 字段显示。
优化 Model 层字段定义,调整长度限制,提升性能与一致性。
更新报表模板与项目文件,移除冗余代码,提升代码可维护性。
This commit is contained in:
2025-10-29 17:00:27 +08:00
parent 98663b00f7
commit d35ff80f3e
19 changed files with 912 additions and 582 deletions
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="03/13/2022 11:00:20" ReportInfo.Modified="10/20/2025 10:51:41" ReportInfo.CreatorVersion="2017.1.16.0">
<Report ScriptLanguage="CSharp" ReportInfo.Created="03/13/2022 11:00:20" ReportInfo.Modified="10/29/2025 15:37:48" ReportInfo.CreatorVersion="2017.1.16.0">
<ScriptText>using System;
using System.Collections;
using System.Collections.Generic;
@@ -42,7 +42,7 @@ namespace FastReport
}
</ScriptText>
<Dictionary>
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqvJIqZbrmqGn7L0P56UFhaUHihKXxbhpqie4wmZgM2ymDKry7UxzO5md9ybQlkfKpN2rHYbp9GtH1LDQPa7z2vVu/kEnNnTKeHt9obmaC7TQDh0IvsUBSuzhGZdfAIK7YyBqykCgeZm5rvA6K5b7zHGdA+7pUpJ/9ZLpp1NuxWRFlf1WEwspad7DkFpDk3K8w"/>
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqvJIqZbrmqGn7L0P56UFhaUHihKXxbhpqie4wmZgM2ymDKry7UxzO5md9ybQlkfKpN2rHYbp9GtH1LDQPa7z2vVu/kEnNnTKeHt9obmaC7TQDh0IvsUBSuzhGZdfAIK7YyBqykCgeZm5rvA6K5b7zHGdA+7pUpJ/9ZLpp1NuxWREx77N82LqiqfoELU3fqwIZ"/>
<TableDataSource Name="Data" ReferenceName="Data" DataType="System.Int32" Enabled="true">
<Column Name="PipelineComponentId" DataType="System.String"/>
<Column Name="PipelineComponentCode" DataType="System.String"/>
@@ -114,6 +114,10 @@
FieldType="String" HeaderText="流水段" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="StackingPosition" DataField="StackingPosition"
FieldType="String" HeaderText="预制工作包" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
</Columns>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
@@ -229,8 +229,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
private List<View_HJGL_InstallData> BindData(int pageIndex, int pageSize, out int totalCount)
{
var baseQuery=from x in Funs.DB.View_HJGL_InstallData
where x.ProjectId == this.CurrUser.LoginProjectId
var baseQuery=from x in Funs.DB.View_HJGL_InstallData
select x;
if (tvControlItem.SelectedNode.CommandName.Split('|').Length == 2)
{
@@ -1,7 +1,9 @@
using BLL;
using Model;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
namespace FineUIPro.Web.HJGL.PreDesign
{
@@ -38,9 +40,15 @@ namespace FineUIPro.Web.HJGL.PreDesign
if (!string.IsNullOrEmpty(PackagingManageId))
{
var model = HJGLPackagingmanageService.GetHJGL_PackagingManageById(PackagingManageId);
HJGL_PackagingManageDetail filter = new HJGL_PackagingManageDetail
{
PackagingManageId = PackagingManageId
};
var packagingDetails = HJGLPackagingmanagedetailService.GetByQueryModle(filter);
drpTypeInt.Enabled = false;
txtPackagingCode.Text = model.PackagingCode;
dropPipelineComponentCode.Values = model.PipelineComponentId?.Split(',');
dropPipelineComponentCode.Values = packagingDetails.Select(x=>x.PipelineComponentId).ToArray();
txtStackingPosition.Text = model.StackingPosition;
drpTrainNumber.SelectedValue = model.TrainNumberId;
drpTypeInt.SelectedValue = model.TypeInt.ToString();
@@ -86,8 +94,8 @@ namespace FineUIPro.Web.HJGL.PreDesign
if (string.IsNullOrEmpty(PackagingManageId))
{
Model.HJGL_PackagingManage table = new Model.HJGL_PackagingManage();
table.PackagingManageId = SQLHelper.GetNewID();
PackagingManageId = SQLHelper.GetNewID();
table.PackagingManageId = PackagingManageId;
table.PackagingCode = txtPackagingCode.Text;
table.ProjectId = this.CurrUser.LoginProjectId;
table.StackingPosition = txtStackingPosition.Text;
@@ -102,10 +110,32 @@ namespace FineUIPro.Web.HJGL.PreDesign
if (drpTypeInt.SelectedValue == ((int)HJGLPackagingmanageService.TypeInt.).ToString())
{
table.PipelineComponentId = string.Join(",", dropPipelineComponentCode.Values);
var newDetailList = new List<Model.HJGL_PackagingManageDetail>();
foreach (var item in dropPipelineComponentCode.Values)
{
var ComponentModel = BLL.HJGL_PipelineComponentService.GetPipelineComponentById(item);
if (ComponentModel != null)
{
var model = new Model.HJGL_PackagingManageDetail()
{
Id = SQLHelper.GetNewID(),
PackagingManageId = this.PackagingManageId,
PipelineId = ComponentModel.PipelineId,
PipelineComponentId = item,
CreateTime = DateTime.Now,
CreateUser = this.CurrUser.PersonId,
};
newDetailList.Add(model);
}
}
HJGLPackagingmanagedetailService.DeleteByPackagingManageId(this.PackagingManageId);
HJGLPackagingmanagedetailService.AddBulk(newDetailList);
}
BLL.HJGLPackagingmanageService.AddHJGL_PackagingManage(table);
PackagingManageId = table.PackagingManageId;
}
else
{
@@ -43,37 +43,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
var detailList = HJGLPackagingmanageService.GetPackagingDetailById(PackagingManageId);
Grid1.RecordCount = detailList.Count();
Grid1.DataSource = detailList;
Grid1.DataBind();
/* if (pack.TypeInt == (int)HJGL_PackagingmanageService.TypeInt.预制组件)
{
DataTable tb = BLL.HJGL_PackagingmanageService.GetPackagingDetailById(PackagingManageId);
Grid1.RecordCount = tb.Rows.Count;
tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
else
{
var result = HJGLPackagingmanagedetailService.GetPackagingData(PackagingManageId).ToList();
var detailList = from x in result
select new
{
PipelineComponentId = x.Id,
PipelineComponentCode = x.MaterialCode,
num = x.Number,
CU = x.MaterialUnit,
UnitWorkName = x.UnitWorkId == null ? "" : UnitWorkService.GetNameById(x.UnitWorkId),
x.FlowingSection,
};
Grid1.RecordCount = detailList.Count();
Grid1.DataSource = detailList;
Grid1.DataBind();
}*/
Grid1.DataBind();
}
#endregion