物料保质期
This commit is contained in:
@@ -63,5 +63,9 @@ namespace Tnb.ProductionMgr.Entities.Entity.ErpEntity
|
||||
public string DEFNAME { get; set; }
|
||||
|
||||
public string UDI { get; set; }
|
||||
/// <summary>
|
||||
/// 保质期 年
|
||||
/// </summary>
|
||||
public string QUALITYNUM { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -867,6 +867,18 @@ namespace Tnb.ProductionMgr
|
||||
foreach (ErpBdMaterial erpBdMaterial in list)
|
||||
{
|
||||
string categoryId = "[\"CGJCJ\"]";
|
||||
int qualitynum = 0;
|
||||
int quality_guarantee_period = 0;
|
||||
bool qualityFlag = true;
|
||||
try
|
||||
{
|
||||
qualitynum = int.Parse(erpBdMaterial.QUALITYNUM);
|
||||
quality_guarantee_period = qualitynum * 12;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
qualityFlag = false;
|
||||
}
|
||||
if (erpBdMaterial.CODE.StartsWith("0401"))
|
||||
{
|
||||
string str = "";
|
||||
@@ -930,6 +942,7 @@ namespace Tnb.ProductionMgr
|
||||
di = erpBdMaterial.UDI,
|
||||
create_time = DateTime.Now
|
||||
};
|
||||
if (qualityFlag) basMaterial.quality_guarantee_period = quality_guarantee_period;
|
||||
insertMaterial.Add(basMaterial);
|
||||
|
||||
ErpExtendField erpExtendField = new ErpExtendField()
|
||||
@@ -978,6 +991,7 @@ namespace Tnb.ProductionMgr
|
||||
.SetColumns(x => x.unit_id == unitId)
|
||||
.SetColumns(x => x.name == erpBdMaterial.NAME)
|
||||
.SetColumns(x => x.di == erpBdMaterial.UDI)
|
||||
.SetColumnsIF(qualityFlag,x => x.quality_guarantee_period == quality_guarantee_period)
|
||||
.Where(x => x.id == materialId)
|
||||
.ExecuteCommandAsync();
|
||||
|
||||
@@ -1516,7 +1530,7 @@ namespace Tnb.ProductionMgr
|
||||
{
|
||||
if ((person.TYPE=="1" && erpExtendFields.All(x => x.person_id != person.PERSON_ID)) || (person.TYPE=="2" && erpExtendFields.All(x => x.user_id != person.USER_ID)))
|
||||
{
|
||||
if (person.TYPE == "2" && insertErpExtendFields.FindIndex(x=>x.person_id==person.PERSON_ID)!=-1)
|
||||
if (person.TYPE == "2" && insertErpExtendFields.FindIndex(x=>x.person_id==person.PERSON_ID)!=-1 && person.PERSON_ID!="~")
|
||||
{
|
||||
ErpExtendField eef = insertErpExtendFields.Find(x => x.person_id == person.PERSON_ID);
|
||||
eef.user_id = person.USER_ID;
|
||||
|
||||
Reference in New Issue
Block a user