20260413 焊材领用资质匹配

This commit is contained in:
毕文静 2026-04-13 15:43:03 +08:00
parent 1cdecfae4a
commit 98eb0245e3
5 changed files with 76 additions and 28 deletions

View File

@ -352,7 +352,7 @@
list[0] = new ListItem("低碳钢(Fe)", "Fe");
list[1] = new ListItem("低合金钢(FeⅡ)", "FeⅡ");
list[2] = new ListItem("Cr≥5%铬钼钢、铁素体钢、马氏体钢(FeⅢ)", "FeⅢ");
list[3] = new ListItem("Cr≥5%铬钼钢、铁素体钢、马氏体钢(FeⅢ无保护气体)", "Cr≥5%铬钼钢、铁素体钢、马氏体钢(FeⅢ无保护气体)");
list[3] = new ListItem("Cr≥5%铬钼钢、铁素体钢、马氏体钢(FeⅢ无保护气体)", "FeⅢ无保护气体");
list[4] = new ListItem("奥氏体钢、奥氏体与铁素体双相钢(FeⅣ)", "FeⅣ");
list[5] = new ListItem("奥氏体钢,奥氏体与铁素体双相钢(FeⅣ无保护气体)", "FeⅣ无保护气体");
list[6] = new ListItem("镍合金(Ni)", "Ni");

View File

@ -19,6 +19,7 @@
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
<Items>
<f:Label ID="lblWED_ID" runat="server" Hidden="true"></f:Label>
<f:TextBox ID="txtName" runat="server" Label="焊材牌号" EmptyText="输入查询条件" AutoPostBack="true"
OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px" LabelAlign="Right">
</f:TextBox>

View File

@ -1,9 +1,12 @@
using System;
using BLL;
using FineUIPro.Web.Welder;
using Model;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using BLL;
using System.Web.DynamicData;
namespace FineUIPro.Web.WeldMat.UsingPlan
{
@ -31,6 +34,7 @@ namespace FineUIPro.Web.WeldMat.UsingPlan
if (!IsPostBack)
{
this.ProjectId = Request.Params["projectId"];
this.lblWED_ID.Text = Request.Params["wed_Id"];
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
this.drpWeldType.DataTextField = "WeldTypeName";
@ -49,14 +53,42 @@ namespace FineUIPro.Web.WeldMat.UsingPlan
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT weld.WeldId, weld.WeldCode, weld.WeldName, weld.WeldSpec,weld.WeldTypeId,weld.SteelType,
string strSql = string.Empty;
bool isQua = false;
if (!string.IsNullOrEmpty(this.lblWED_ID.Text.Trim()))
{
var qualifiedProject = BLL.HJGL_WelderQualifiedProjectService.GetWelderQualifiedProjectByWedId(this.lblWED_ID.Text.Trim());
if (qualifiedProject.Count > 0)
{
//当材质类型为FeⅢ并且资质后面三个数中间的为11时可领用FeⅢ无保护气体焊丝
qualifiedProject = qualifiedProject.Where(e => e.MaterialType.Contains("FeⅢ") && e.QualifiedProjectCode.Contains("/11/")).ToList();
if (qualifiedProject.Count > 0)
{
isQua = true;
}
}
}
if (isQua)
{
strSql = @"SELECT weld.WeldId, weld.WeldCode, weld.WeldName, weld.WeldSpec,weld.WeldTypeId,weld.SteelType,
WeldType.WeldTypeName,WeldType.WeldUnit
FROM dbo.Weld_WeldInfo weld
LEFT JOIN Weld_WeldType AS weldType ON weldType.WeldTypeId =weld.WeldTypeId
WHERE 1 = 1 and (weld.IsLock is null or weld.IsLock=0)
and (select SUM(ISNULL(stockIn.Amount,0)) from Weld_StockIn stockIn where UnitStoreId=@UnitStoreId and WeldId=weld.WeldId)>0";
//and (select (SUM(ISNULL(stockIn.Amount,0))-SUM(ISNULL(stockIn.UsingAmount,0))) from Weld_StockIn stockIn where UnitStoreId=@UnitStoreId and WeldId=weld.WeldId)>0";
List<SqlParameter> listStr = new List<SqlParameter>();
and (select SUM(ISNULL(stockIn.Amount,0)) from Weld_StockIn stockIn where UnitStoreId=@UnitStoreId and WeldId=weld.WeldId)>0";
}
else
{
strSql = @"SELECT weld.WeldId, weld.WeldCode, weld.WeldName, weld.WeldSpec,weld.WeldTypeId,weld.SteelType,
WeldType.WeldTypeName,WeldType.WeldUnit
FROM dbo.Weld_WeldInfo weld
LEFT JOIN Weld_WeldType AS weldType ON weldType.WeldTypeId =weld.WeldTypeId
WHERE 1 = 1 and (weld.IsLock is null or weld.IsLock=0)
and weld.SteelType != 'Fe'
and (select SUM(ISNULL(stockIn.Amount,0)) from Weld_StockIn stockIn where UnitStoreId=@UnitStoreId and WeldId=weld.WeldId)>0";
}
List<SqlParameter> listStr = new List<SqlParameter>();
//listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
listStr.Add(new SqlParameter("@UnitStoreId", Request.Params["unitStoreId"]));
if (drpWeldType.SelectedValue != BLL.Const._Null)
@ -74,7 +106,6 @@ and (select SUM(ISNULL(stockIn.Amount,0)) from Weld_StockIn stockIn where UnitSt
strSql += " AND weld.WeldCode LIKE @WeldCode";
listStr.Add(new SqlParameter("@WeldCode", "%" + this.txtCode.Text.Trim() + "%"));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);

View File

@ -7,10 +7,12 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldMat.UsingPlan {
namespace FineUIPro.Web.WeldMat.UsingPlan
{
public partial class ShowPlanWeld {
public partial class ShowPlanWeld
{
/// <summary>
/// Head1 控件。
@ -66,6 +68,15 @@ namespace FineUIPro.Web.WeldMat.UsingPlan {
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// lblWED_ID 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lblWED_ID;
/// <summary>
/// txtName 控件。
/// </summary>

View File

@ -579,7 +579,12 @@ namespace FineUIPro.Web.WeldMat.UsingPlan
Alert.ShowInTop("请选择焊材库!", MessageBoxIcon.Warning);
return;
}
string window = String.Format("ShowPlanWeld.aspx?projectId={0}&unitStoreId={1}", drpProjectId.SelectedValue, this.drpUnitStore.SelectedValue, "编辑 - ");
if (string.IsNullOrEmpty(this.hdUsingMan1.Text.Trim()))
{
Alert.ShowInTop("请选择领料人!", MessageBoxIcon.Warning);
return;
}
string window = String.Format("ShowPlanWeld.aspx?projectId={0}&unitStoreId={1}&wed_Id={2}", drpProjectId.SelectedValue, this.drpUnitStore.SelectedValue, hdUsingMan1.Text.Trim(), "编辑 - ");
PageContext.RegisterStartupScript(Window1.GetSaveStateReference(this.hdWeldId.ClientID) + Window1.GetShowReference(window));
}