Browse Source

导入 零件和行号均不可重复

master
qian 6 months ago
parent
commit
cdd5df33ed
  1. 25
      北京北汽/SCP/Views/PlanData/SCP_PO.aspx.cs

25
北京北汽/SCP/Views/PlanData/SCP_PO.aspx.cs

@ -182,10 +182,20 @@ namespace SCP.PlanData
{ {
BindOrder(); BindOrder();
} }
/// <summary>
/// 日程单导入
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnInput_Click_Contract(object sender, EventArgs e) protected void btnInput_Click_Contract(object sender, EventArgs e)
{ {
Excel_Input(BillModType.Contract); Excel_Input(BillModType.Contract);
} }
/// <summary>
/// 离散单导入
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnInput_Click_Non_Contract(object sender, EventArgs e) protected void btnInput_Click_Non_Contract(object sender, EventArgs e)
{ {
Excel_Input(BillModType.Non_Contract); Excel_Input(BillModType.Non_Contract);
@ -230,6 +240,21 @@ namespace SCP.PlanData
FileUp.Reset(); FileUp.Reset();
return; return;
} }
if (partCodeList.Distinct().Count() != list.Count())
{
Alert.Show("零件号不允许重复!");
FileUp.Reset();
return;
}
// 行号去重
List<string> polineList = list.Select(a => a..Trim()).Distinct().ToList();
if (polineList.Count() != list.Count())
{
Alert.Show("行号不允许重复!");
FileUp.Reset();
return;
}
var checkret = SCP_PO_CONTROLLER.Check_EXCEL_PO_MOD(list, p_modtype, CurrentUser.FactoryList[0], CurrentUser.SubSiteList[0]); var checkret = SCP_PO_CONTROLLER.Check_EXCEL_PO_MOD(list, p_modtype, CurrentUser.FactoryList[0], CurrentUser.SubSiteList[0]);
if (checkret.State == ReturnStatus.Failed && checkret.Result == false) if (checkret.State == ReturnStatus.Failed && checkret.Result == false)
{ {

Loading…
Cancel
Save