111
This commit is contained in:
@@ -69,7 +69,7 @@ namespace FineUIPro.Web.WeldMat.UsingSentMat
|
||||
LEFT JOIN dbo.Weld_Supplier supplier ON supplier.SupplierId=StockIn.SupplierId
|
||||
LEFT JOIN dbo.Weld_UnitStore store ON store.UnitStoreId = StockIn.UnitStoreId
|
||||
WHERE (StockIn.Amount-ISNULL(StockIn.UsingAmount,0)+ISNULL(StockIn.RecycleAmount,0))>0
|
||||
AND store.IsUse=1
|
||||
AND store.IsUse=1 AND StockIn.IsSure=1
|
||||
AND StockIn.WeldId=@WeldId AND store.UnitId=@UnitId";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
if (plan != null)
|
||||
|
||||
@@ -539,14 +539,60 @@ namespace FineUIPro.Web.WeldMat.UsingSentMat
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 在同一单位跨项目如有未完结的领料也不能领用
|
||||
|
||||
if (isUsing)
|
||||
{
|
||||
string window = String.Format("ShowStockIn.aspx?UsingPlanId={0}", this.Grid2.SelectedRowID, "编辑 - ");
|
||||
PageContext.RegisterStartupScript(Window1.GetSaveStateReference(hdItemsString.ClientID) + Window1.GetShowReference(window));
|
||||
bool otherIsUsed = true;
|
||||
string strSql = @"SELECT m.UsingMatId, m.ProjectId, m.WeldId, welder.WED_Code
|
||||
FROM dbo.Weld_UsingMat m
|
||||
LEFT JOIN dbo.Weld_UsingPlan usingPlan ON usingPlan.UsingPlanId = m.UsingPlanId
|
||||
LEFT JOIN dbo.HJGL_BS_Welder welder ON welder.WED_ID=m.UsingMan
|
||||
WHERE m.IsWelderConfirm=1 AND m.IsStoreManConfirm=1
|
||||
AND (m.IsClose IS NULL OR m.IsClose=0)
|
||||
AND usingPlan.UsingManOne=@WelderId
|
||||
AND usingPlan.UsingUnit=@UsingUnit
|
||||
AND m.ProjectId IN (SELECT DISTINCT ProjectId FROM dbo.Project_User WHERE UserId=@CurrUserId) ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@WelderId", this.WelderId));
|
||||
if (CurrUser.UnitId != null)
|
||||
{
|
||||
listStr.Add(new SqlParameter("@UsingUnit", CurrUser.UnitId));
|
||||
}
|
||||
else
|
||||
{
|
||||
listStr.Add(new SqlParameter("@UsingUnit", null));
|
||||
}
|
||||
listStr.Add(new SqlParameter("@CurrUserId", this.CurrUser.UserId));
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
|
||||
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
for (int i = 0; i < dt.Rows.Count; i++)
|
||||
{
|
||||
string usingMatId = dt.Rows[i]["UsingMatId"].ToString();
|
||||
var usingMat = BLL.UsingMatService.GetUsingMatById(usingMatId);
|
||||
var uWeld = BLL.WeldInfoService.GetWeldInfoById(usingMat.WeldId);
|
||||
if (uWeld != null && uWeld.WeldTypeId == weldTypeId)
|
||||
{
|
||||
otherIsUsed = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (otherIsUsed)
|
||||
{
|
||||
string window = String.Format("ShowStockIn.aspx?UsingPlanId={0}", this.Grid2.SelectedRowID, "编辑 - ");
|
||||
PageContext.RegisterStartupScript(Window1.GetSaveStateReference(hdItemsString.ClientID) + Window1.GetShowReference(window));
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("其它项目有未完结的领料计划,处理后才能领用!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("有未完结的领料计划,处理后才能领用!");
|
||||
ShowNotify("本项目有未完结的领料计划,处理后才能领用!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user