Browse Source

北汽供应商地点及导入时判断零件号是否存在

master
qian 12 months ago
parent
commit
3c5de268d3
  1. 3
      北京北汽/Models/ScpEntity/TA_VENDER.cs
  2. 19
      北京北汽/SCP/Business/PageBase.cs
  3. 15
      北京北汽/SCP/Views/BasicData/Price.aspx.cs
  4. 14
      北京北汽/SCP/Views/BasicData/PriceUpdate.aspx.cs
  5. 4
      北京北汽/SCP/Views/BasicData/SCP_VenderUser.aspx
  6. 17
      北京北汽/SCP/Views/BasicData/SCP_VenderUser.aspx.cs
  7. 13
      北京北汽/SCP/Views/PlanData/SCP_PO.aspx.cs
  8. 2
      北京北汽/SCP/Views/PlanData/SCP_PO_CQ.aspx
  9. 13
      北京北汽/SCP/Views/PlanData/SCP_PO_CQ.aspx.cs

3
北京北汽/Models/ScpEntity/TA_VENDER.cs

@ -79,5 +79,8 @@ namespace CK.SCP.Models.ScpEntity
public string FactoryName => ScpCache.GetFactoryNameByCode(Site);
public string SubSite { get; set; }
[NotMapped]
public string FactoryNameForView { get; set; }
}
}

19
北京北汽/SCP/Business/PageBase.cs

@ -1945,5 +1945,24 @@ namespace SCP
}
#endregion
/// <summary>
/// 导入文件时判断文件是否存在
/// </summary>
/// <param name="list">导入的零件号集合</param>
/// <returns></returns>
public static List<string> CheckPartCode(List<string> list)
{
List<string> partCodeList = new List<string>();
foreach (var item in list)
{
int count = 0;
count = SCPDB.TA_PART.Count(a => a.PartCode == item);
if (count == 0)
{
partCodeList.Add(item);
}
}
return partCodeList;
}
}
}

15
北京北汽/SCP/Views/BasicData/Price.aspx.cs

@ -254,8 +254,19 @@ namespace SCP.BasicData
}
var list = ConvertHelper.ToList<SCP_PRICE_EXPORT>(ExcelHelper.RemoveEmpty(_dt)).ToList();
List<string> partCodeList = list.Select(a => a.).ToList();
if (partCodeList.Count == 0)
{
Alert.Show("未填写零件编码!");
return;
}
List<string> list1 = new List<string>();
list1 = CheckPartCode(partCodeList);
if (list1 != new List<string>() )
{
Alert.Show(string.Format( "导入文件中有不存在的零件,如{0}", list1.FirstOrDefault()));
return;
}
var ret = SCP_PO_CONTROLLER.EXCEL_PRICE_MOD(list, CurrentUser.Name,CurrentUser.RoleList);
if (ret.State == ReturnStatus.Succeed && ret.Result == true)
{

14
北京北汽/SCP/Views/BasicData/PriceUpdate.aspx.cs

@ -192,7 +192,19 @@ namespace SCP.BasicData
}
var list = ConvertHelper.ToList<SCP_PRICE_EXPORT>(ExcelHelper.RemoveEmpty(_dt)).ToList();
List<string> partCodeList = list.Select(a => a.).ToList();
if (partCodeList.Count == 0)
{
Alert.Show("未填写零件编码!");
return;
}
List<string> list1 = new List<string>();
list1 = CheckPartCode(partCodeList);
if (list1 != new List<string>())
{
Alert.Show(string.Format("导入文件中有不存在的零件,如{0}", list1.FirstOrDefault()));
return;
}
var ret = SCP_PO_CONTROLLER.EXCEL_PRICE_MOD1(list, CurrentUser.Name, CurrentUser.RoleList);
if (ret.State == ReturnStatus.Succeed && ret.Result == true)

4
北京北汽/SCP/Views/BasicData/SCP_VenderUser.aspx

@ -80,9 +80,7 @@
<f:RowNumberField/>
<f:BoundField Width = "100px" DataField = "VendId" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "供应商编码" />
<f:BoundField Width = "300px" DataField = "VendName" DataFormatString = "{0:yyyy-MM-dd}" HeaderText = "供应商名称" />
<f:BoundField runat="server" HeaderText="地点" ColumnID="" DataField="FactoryName" SortField="FactoryName" />
<f:BoundField runat="server" HeaderText="地点" ColumnID="" DataField="FactoryNameForView" SortField="FactoryNameForView" />
</Columns>
</f:Grid>

17
北京北汽/SCP/Views/BasicData/SCP_VenderUser.aspx.cs

@ -50,7 +50,22 @@ namespace SCP.Views.BasicData
if (lsFacID != null && lsFacID.Count > 0)
{
_list = _list.Where(p => lsFacID.Contains(p.Site)).ToList();
if (_list.Count() > 0)
{
foreach (var item in _list)
{
if ((item.Site == "BJBMPT") && (!string.IsNullOrEmpty(item.SubSite)))
{
item.FactoryNameForView = DB.TA_FACTORY.FirstOrDefault(a => a.ErpDomain == item.Site && a.ErpSite == item.SubSite).FactoryName;
}
else
{
item.FactoryNameForView = DB.TA_FACTORY.FirstOrDefault(a => a.ErpDomain == item.Site).FactoryName;
}
}
}
}
lsVenders = _list;
var list = Sort<TA_VENDER>(_list.AsQueryable(), Grid_Vender);
@ -163,7 +178,7 @@ namespace SCP.Views.BasicData
}
}
}
foreach (TA_VENDER vender in lsVenders)
{
if (lsCheckVenderID.Count == 0)

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

@ -211,6 +211,19 @@ namespace SCP.PlanData
}
var list = ConvertHelper.ToList<SCP_PO_EXPORT_IMPORT_MODEL>(ExcelHelper.RemoveEmpty(_dt)).ToList();
List<string> partCodeList = list.Select(a => a.).ToList();
if (partCodeList.Count == 0)
{
Alert.Show("未填写零件编码!");
return;
}
List<string> list1 = new List<string>();
list1 = CheckPartCode(partCodeList);
if (list1 != new List<string>())
{
Alert.Show(string.Format("导入文件中有不存在的零件,如{0}", list1.FirstOrDefault()));
return;
}
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)
{

2
北京北汽/SCP/Views/PlanData/SCP_PO_CQ.aspx

@ -94,7 +94,7 @@
</f:Button>
<f:Button ID="btnInput_Non_Contract" runat="server" Text="离散单导入" Hidden="true" Icon="PageExcel" OnClick="btnInput_Click_Non_Contract" >
</f:Button>
<f:Button ID="Button1" runat="server" Text="离散单导入PO号" Icon="PageExcel" OnClick="btnInput_Click_Non_Contract_PO" >
<f:Button ID="Button1" runat="server" Text="离散单导入PO号" Icon="PageExcel" OnClick="btnInput_Click_Non_Contract_PO" Hidden="true" >
</f:Button>
<f:LinkButton ID="linkbutton" runat="server" Text="模板下载" OnClick="LinkButton_Click" Hidden="true" ></f:LinkButton>
</Items>

13
北京北汽/SCP/Views/PlanData/SCP_PO_CQ.aspx.cs

@ -210,6 +210,19 @@ namespace SCP.Views.PlanData
}
var list = ConvertHelper.ToList<SCP_PO_EXPORT_IMPORT_MODEL>(ExcelHelper.RemoveEmpty(_dt)).ToList();
List<string> partCodeList = list.Select(a => a.).ToList();
if (partCodeList.Count == 0)
{
Alert.Show("未填写零件编码!");
return;
}
List<string> list1 = new List<string>();
list1 = CheckPartCode(partCodeList);
if (list1 != new List<string>())
{
Alert.Show(string.Format("导入文件中有不存在的零件,如{0}", list1.FirstOrDefault()));
return;
}
var checkret = SCP_PO_CONTROLLER.Check_EXCEL_PO_MOD_CQ(list, p_modtype, CurrentUser.FactoryList[0], CurrentUser.SubSiteList[0]);
if (checkret.State == ReturnStatus.Failed && checkret.Result == false)
{

Loading…
Cancel
Save