bug
This commit is contained in:
@@ -807,7 +807,15 @@ namespace Tnb.ProductionMgr
|
|||||||
string[] unitArr = erpBdMaterial.MEASRATE.Split("/");
|
string[] unitArr = erpBdMaterial.MEASRATE.Split("/");
|
||||||
if (erpExtendFields.All(x => x.cmaterialoid != erpBdMaterial.ID))
|
if (erpExtendFields.All(x => x.cmaterialoid != erpBdMaterial.ID))
|
||||||
{
|
{
|
||||||
BasMaterial basMaterial = new BasMaterial()
|
BasMaterial basMaterial = null;
|
||||||
|
ErpExtendField tempExtendField = insertExtendFields.Find(x => x.cmaterialoid == erpBdMaterial.ID);
|
||||||
|
if (tempExtendField!=null)
|
||||||
|
{
|
||||||
|
basMaterial = insertMaterial.Find(x => x.id == tempExtendField.table_id);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
basMaterial = new BasMaterial()
|
||||||
{
|
{
|
||||||
id = SnowflakeIdHelper.NextId(),
|
id = SnowflakeIdHelper.NextId(),
|
||||||
name = erpBdMaterial.NAME,
|
name = erpBdMaterial.NAME,
|
||||||
@@ -821,6 +829,17 @@ namespace Tnb.ProductionMgr
|
|||||||
};
|
};
|
||||||
insertMaterial.Add(basMaterial);
|
insertMaterial.Add(basMaterial);
|
||||||
|
|
||||||
|
ErpExtendField erpExtendField = new ErpExtendField()
|
||||||
|
{
|
||||||
|
table_name = "bas_material",
|
||||||
|
table_id = basMaterial.id,
|
||||||
|
cmaterialoid = erpBdMaterial.ID,
|
||||||
|
cmaterialvid = erpBdMaterial.VID,
|
||||||
|
|
||||||
|
};
|
||||||
|
insertExtendFields.Add(erpExtendField);
|
||||||
|
}
|
||||||
|
|
||||||
if (unitId != auxiliaryUnitId)
|
if (unitId != auxiliaryUnitId)
|
||||||
{
|
{
|
||||||
insertMaterialUnits.Add(new BasMaterialUnit()
|
insertMaterialUnits.Add(new BasMaterialUnit()
|
||||||
@@ -892,6 +911,7 @@ namespace Tnb.ProductionMgr
|
|||||||
|
|
||||||
await _db.Insertable(insertMaterial).ExecuteCommandAsync();
|
await _db.Insertable(insertMaterial).ExecuteCommandAsync();
|
||||||
await _db.Insertable(insertMaterialUnits).ExecuteCommandAsync();
|
await _db.Insertable(insertMaterialUnits).ExecuteCommandAsync();
|
||||||
|
await _db.Insertable(insertExtendFields).ExecuteCommandAsync();
|
||||||
|
|
||||||
//物料清单开始同步
|
//物料清单开始同步
|
||||||
materials = await _db.Queryable<BasMaterial>().ToListAsync();
|
materials = await _db.Queryable<BasMaterial>().ToListAsync();
|
||||||
|
|||||||
Reference in New Issue
Block a user