erp物料同步开关
This commit is contained in:
@@ -49,5 +49,10 @@ namespace Tnb.BasicData
|
||||
/// 换批号天数
|
||||
/// </summary>
|
||||
public const string CHANGEBATCHDAY = "changeBatchDay";
|
||||
|
||||
/// <summary>
|
||||
/// erp全物料更新
|
||||
/// </summary>
|
||||
public const string MATERIALALLUPDATE = "materialAllUpDate";
|
||||
}
|
||||
}
|
||||
@@ -78,6 +78,7 @@ namespace Tnb.EquipMgr
|
||||
.WhereIF(!string.IsNullOrEmpty(code),a=>a.code.Contains(code))
|
||||
.WhereIF(!string.IsNullOrEmpty(name),a=>a.name.Contains(name))
|
||||
.WhereIF(!string.IsNullOrEmpty(contract_no),a=>a.contract_no.Contains(contract_no))
|
||||
.OrderBy(a=>a.code)
|
||||
.Select((a, b,c,d,e,f,g,h,i,j) => new EquipListOuput()
|
||||
{
|
||||
id = a.id,
|
||||
|
||||
@@ -854,6 +854,7 @@ namespace Tnb.ProductionMgr
|
||||
Dictionary<string, object> materialcategoryDic = await _db.Queryable<DictionaryDataEntity>()
|
||||
.Where(x => x.DictionaryTypeId == DictConst.MaterialCatagoryID)
|
||||
.ToDictionaryAsync(x => x.FullName, y => y.EnCode);
|
||||
BasFactoryConfig materialAllUpDate = await _db.Queryable<BasFactoryConfig>().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.MATERIALALLUPDATE);
|
||||
List<BasMaterial> materials = await _db.Queryable<BasMaterial>().ToListAsync();
|
||||
List<BasEbomH> basEbomHs = await _db.Queryable<BasEbomH>().ToListAsync();
|
||||
List<BasMaterial> insertMaterial = new List<BasMaterial>();
|
||||
@@ -975,7 +976,7 @@ namespace Tnb.ProductionMgr
|
||||
string materialId = extendField?.table_id ?? "";
|
||||
BasMaterial basMaterial = await _db.Queryable<BasMaterial>().SingleAsync(x => x.id == materialId);
|
||||
// if (extendField.erp_modify_time==null || erpBdMaterial.MODIFIEDTIME != extendField.erp_modify_time)
|
||||
if (erpBdMaterial.MODIFIEDTIME != extendField.erp_modify_time)
|
||||
if (materialAllUpDate.value=="1" || erpBdMaterial.MODIFIEDTIME != extendField.erp_modify_time)
|
||||
{
|
||||
string unitId = erpExtendFields.Find(x => x.cunitid == erpBdMaterial.PK_MEASDOC)?.table_id ?? "";
|
||||
unitId = unitDic.ContainsKey(unitId) ? unitDic[unitId].ToString() : "";
|
||||
|
||||
Reference in New Issue
Block a user