Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -56,5 +56,10 @@ namespace Tnb.ProductionMgr.Entities.Entity.ErpEntity
|
||||
/// 修改时间
|
||||
/// </summary>
|
||||
public string MODIFIEDTIME { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// mes物料类型
|
||||
/// </summary>
|
||||
public string DEFNAME { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2559,7 +2559,7 @@ namespace Tnb.ProductionMgr
|
||||
// thirdWebapiRecord.url = WmsWareHouseConst.BIP_DOMAIN+"uapws/rest/pwrnew/save";
|
||||
thirdWebapiRecord.request_data = JsonConvert.SerializeObject(erpRequestData);
|
||||
thirdWebapiRecord.create_time = DateTime.Now;
|
||||
|
||||
thirdWebapiRecord.remark = $"载具编号:{report?.material_box_code ?? ""}";
|
||||
await _db.Insertable(thirdWebapiRecord).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ using Tnb.ProductionMgr.Entities.Dto.PrdManage;
|
||||
using Tnb.ProductionMgr.Entities.Entity;
|
||||
using Tnb.ProductionMgr.Entities.Entity.ErpEntity;
|
||||
using Tnb.BasicData.Entities.Dto;
|
||||
using Tnb.BasicData;
|
||||
|
||||
namespace Tnb.ProductionMgr
|
||||
{
|
||||
@@ -913,7 +914,7 @@ namespace Tnb.ProductionMgr
|
||||
|
||||
try
|
||||
{
|
||||
string response2 = HttpUtils.RequestGet($"{config.value}/api/production/time-work/sync-material");
|
||||
string response2 = HttpUtils.RequestGet($"{config.value}/api/production/time-work/sync-material",null,10*60*1000);
|
||||
AuthResponse authResponse2 = JsonConvert.DeserializeObject<AuthResponse>(response2);
|
||||
result += ","+authResponse2.data.ToString();
|
||||
}
|
||||
@@ -994,6 +995,9 @@ namespace Tnb.ProductionMgr
|
||||
Dictionary<string, object> unitDic2 = await _db.Queryable<DictionaryDataEntity>()
|
||||
.Where(x => x.DictionaryTypeId == WmsWareHouseConst.UNITTYPEID)
|
||||
.ToDictionaryAsync(x => x.FullName, y => y.EnCode);
|
||||
Dictionary<string, object> materialcategoryDic = await _db.Queryable<DictionaryDataEntity>()
|
||||
.Where(x => x.DictionaryTypeId == DictConst.MaterialCatagoryID)
|
||||
.ToDictionaryAsync(x => x.FullName, y => y.EnCode);
|
||||
List<BasMaterial> materials = await _db.Queryable<BasMaterial>().ToListAsync();
|
||||
List<BasEbomH> basEbomHs = await _db.Queryable<BasEbomH>().ToListAsync();
|
||||
List<BasMaterial> insertMaterial = new List<BasMaterial>();
|
||||
@@ -1010,10 +1014,10 @@ namespace Tnb.ProductionMgr
|
||||
if (erpBdMaterial.CODE.StartsWith("0401"))
|
||||
{
|
||||
string str = "";
|
||||
if (erpBdMaterial.MATERIALSPEC.Contains("*"))
|
||||
if (erpBdMaterial.MATERIALSPEC!=null && erpBdMaterial.MATERIALSPEC.Contains("*"))
|
||||
{
|
||||
str = erpBdMaterial.MATERIALSPEC;
|
||||
}else if (erpBdMaterial.NAME.Contains("*"))
|
||||
}else if (erpBdMaterial.NAME!=null && erpBdMaterial.NAME.Contains("*"))
|
||||
{
|
||||
str = erpBdMaterial.NAME;
|
||||
}
|
||||
@@ -1026,7 +1030,7 @@ namespace Tnb.ProductionMgr
|
||||
if (strArr.Length <= 2)
|
||||
{
|
||||
categoryId = "[\"CGJCJ\"]";
|
||||
}else if (decimal.Parse(strArr[2]) > 600)
|
||||
}else if (decimal.Parse(strArr[2]) > 500)
|
||||
{
|
||||
categoryId = "[\"CGJCJ\"]";
|
||||
}
|
||||
@@ -1038,7 +1042,7 @@ namespace Tnb.ProductionMgr
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
categoryId = !string.IsNullOrEmpty(erpBdMaterial.DEFNAME) && materialcategoryDic.ContainsKey(erpBdMaterial.DEFNAME) ? $"[\"{materialcategoryDic[erpBdMaterial.DEFNAME]}\"]" : "";
|
||||
}
|
||||
|
||||
if (erpExtendFields.All(x => x.cmaterialoid != erpBdMaterial.ID))
|
||||
@@ -1099,6 +1103,7 @@ namespace Tnb.ProductionMgr
|
||||
ErpExtendField extendField = erpExtendFields.Find(x => x.cmaterialoid == erpBdMaterial.ID);
|
||||
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)
|
||||
{
|
||||
string unitId = erpExtendFields.Find(x => x.cunitid == erpBdMaterial.PK_MEASDOC)?.table_id ?? "";
|
||||
@@ -1110,7 +1115,7 @@ namespace Tnb.ProductionMgr
|
||||
int updateRow = await _db.Updateable<BasMaterial>()
|
||||
.SetColumns(x => x.name == erpBdMaterial.NAME)
|
||||
.SetColumns(x => x.code == erpBdMaterial.CODE)
|
||||
.SetColumns(x=>x.category_id == categoryId)
|
||||
.SetColumnsIF(!string.IsNullOrEmpty(categoryId),x=>x.category_id == categoryId)
|
||||
.SetColumns(x => x.material_specification == erpBdMaterial.MATERIALSPEC)
|
||||
.SetColumns(x => x.material_standard == erpBdMaterial.MATERIALTYPE)
|
||||
.SetColumns(x => x.unit_id == unitId)
|
||||
@@ -1179,7 +1184,7 @@ namespace Tnb.ProductionMgr
|
||||
BasMaterial material = materials.Find(x => x.code==firstItemInList.MPRODID);
|
||||
if (material == null) continue;
|
||||
string unitId = unitDic2.ContainsKey(firstItemInList.UNIT) ? unitDic2[firstItemInList.UNIT].ToString() : "";
|
||||
if (basEbomHs.All(x => x.material_id != material.id && x.version != firstItemInList.HVERSION))
|
||||
if (basEbomHs.FindIndex(x => x.material_id == material.id && x.version == firstItemInList.HVERSION)==-1)
|
||||
{
|
||||
BasEbomH basEbomH = new BasEbomH()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user