测试
This commit is contained in:
@@ -456,6 +456,21 @@
|
||||
物料Id 32进制字符串
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:BarCode.Web.Domain.Entitys.Materials.FCreateDate">
|
||||
<summary>
|
||||
物料创建时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:BarCode.Web.Domain.Entitys.Materials.FModifyDate">
|
||||
<summary>
|
||||
物料修改时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:BarCode.Web.Domain.Entitys.Materials.isDis">
|
||||
<summary>
|
||||
物料修改时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:BarCode.Web.Domain.Entitys.SecurityNumberGenerateRecord">
|
||||
<summary>
|
||||
防伪码生成记录
|
||||
@@ -1220,6 +1235,12 @@
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:BarCode.Web.Domain.Infrastructure.IMaterialsRepositories.GetEntityListByGuiGe(System.Collections.Generic.List{System.String},System.DateTime)">
|
||||
<summary>
|
||||
跟据规格获取物料
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:BarCode.Web.Domain.Infrastructure.IMaterialsRepositories.UpdateRange(System.Collections.Generic.List{BarCode.Web.Domain.Entitys.Materials},System.Boolean)">
|
||||
<summary>
|
||||
修改物料
|
||||
|
||||
@@ -68,12 +68,12 @@ namespace BarCode.Web.Core.Dto.Erp
|
||||
/// <summary>
|
||||
/// 修改日期
|
||||
/// </summary>
|
||||
public DateTime? FModifyDate { get; set; }
|
||||
public DateTime FModifyDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建日期
|
||||
/// </summary>
|
||||
public DateTime? FCreateDate { get; set; }
|
||||
public DateTime FCreateDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产品线(1级)
|
||||
|
||||
@@ -74,6 +74,21 @@ namespace BarCode.Web.Domain.Entitys
|
||||
/// </summary>
|
||||
public string IdConvertBar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料创建时间
|
||||
/// </summary>
|
||||
public DateTime FCreateDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料修改时间
|
||||
/// </summary>
|
||||
public DateTime FModifyDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料修改时间
|
||||
/// </summary>
|
||||
public string isDis { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// 产品线(1级)
|
||||
///// </summary>
|
||||
|
||||
@@ -67,6 +67,13 @@ namespace BarCode.Web.Domain.Infrastructure
|
||||
/// <returns></returns>
|
||||
Task<List<Materials>> GetEntityListByNoBar();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 跟据规格获取物料
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<Materials>> GetEntityListByGuiGe(List<string> materGuiGes, DateTime dt);
|
||||
|
||||
/// <summary>
|
||||
/// 修改物料
|
||||
/// </summary>
|
||||
|
||||
@@ -434,6 +434,7 @@ namespace BarCode.Web.Domain.Services.Public
|
||||
_logger.LogInformation($"物料拉取-结束时间:{endTime}");
|
||||
//5.物料集合进行缓存-当前缓存时间到当天晚上的0点,后面定时任务执行重新放入缓存
|
||||
_memoryCache.Set(_erpOptions.cache_materail_key, erp_materials_list, new MemoryCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromMinutes(DateTimeUtil.GetTotalMinutesTimeSpan())));
|
||||
|
||||
_logger.LogInformation($"物料拉取-总条数:{erp_materials_list.Count}");
|
||||
return ResultList<ErpMaterialDto>.ReSuccess(erp_materials_list);
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace BarCode.Web.Domain.Services
|
||||
//修改有更新的数据
|
||||
if (mats.Count != 0)
|
||||
{
|
||||
var isFModifyDateMatNumbs = mats.Where(x => x.FModifyDate >= DateTime.Now.AddDays(-5)).Select(x => new { MaterialNumber = x.MaterialNumber, Specifications = x.Specifications, MaterialName = x.MaterialName, BarCode = x.BarCode, OrgId = x.OrgId, FProductLines1 = x.FProductLines1, FProductCATs1 = x.FProductCATs1, FMaterialGroup = x.FMaterialGroup, F_Product = x.F_Product, FProductLines1FName = x.FProductLines1FName, FProductCATs1FName = x.FProductCATs1FName, FMaterialGroupFName = x.FMaterialGroupFName, MaterialId = x.MaterialId, FProductIDS = x.FProductIDS }).ToList();
|
||||
var isFModifyDateMatNumbs = mats.Where(x => x.FModifyDate >= DateTime.Now.AddDays(-5)).Select(x => new { MaterialNumber = x.MaterialNumber, Specifications = x.Specifications, MaterialName = x.MaterialName, BarCode = x.BarCode, OrgId = x.OrgId, FCreateDate=x.FCreateDate, FModifyDate=x.FModifyDate, FProductLines1 = x.FProductLines1, FProductCATs1 = x.FProductCATs1, FMaterialGroup = x.FMaterialGroup, F_Product = x.F_Product, FProductLines1FName = x.FProductLines1FName, FProductCATs1FName = x.FProductCATs1FName, FMaterialGroupFName = x.FMaterialGroupFName, MaterialId = x.MaterialId, FProductIDS = x.FProductIDS }).ToList();
|
||||
//
|
||||
|
||||
_logger.LogInformation("取到需要同步的金蝶修改物料规格yzh(20260209):" + isFModifyDateMatNumbs.Count + "个");
|
||||
@@ -149,6 +149,9 @@ namespace BarCode.Web.Domain.Services
|
||||
entity.Specifications = mat.Specifications;
|
||||
entity.MaterialName = mat.MaterialName;
|
||||
entity.BarCode = mat.BarCode;
|
||||
entity.FCreateDate = DateTime.Now;
|
||||
entity.FModifyDate = mat.FModifyDate;
|
||||
entity.isDis = "1";
|
||||
//entity.OrgId = mat.OrgId;
|
||||
//entity.FProductLines1 = mat.FProductLines1;
|
||||
//entity.FProductCATs1 = mat.FProductCATs1;
|
||||
@@ -162,6 +165,7 @@ namespace BarCode.Web.Domain.Services
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var isSuccess = await _materialsRepositories.UpdateRange(updateList);
|
||||
@@ -169,28 +173,48 @@ namespace BarCode.Web.Domain.Services
|
||||
_logger.LogInformation("同步金蝶修改物料-修改物料规格yzh:失败");
|
||||
else
|
||||
_logger.LogInformation("同步金蝶修改物料-修改物料规格yzh:成功->" + updateList.Count + "条");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// List<string> s = new List<string>();
|
||||
//foreach (var ismat in isFModifyDateMatNumbs)
|
||||
// {
|
||||
// s.Add(ismat.MaterialNumber);
|
||||
// }
|
||||
|
||||
// var updateList = await _materialsRepositories.GetEntityListAddMaterial(s);
|
||||
// if (updateList.Count != 0)
|
||||
// {
|
||||
// updateList.ForEach(x => { x.Specifications = ; });
|
||||
// var isSuccess = await _materialsRepositories.UpdateRange(updateList);
|
||||
// if (!isSuccess)
|
||||
// _logger.LogInformation("同步金蝶新物料-修改物料:失败");
|
||||
// else
|
||||
// _logger.LogInformation("同步金蝶新物料-修改物料:成功->" + updateList.Count + "条");
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
//修改后把如果有两个或以上的,之前的进行禁用
|
||||
if (mats.Count != 0)
|
||||
{
|
||||
var isFModifyDateMatNumbs = mats.Where(x => x.FModifyDate >= DateTime.Now.AddDays(-5)).Select(x => new { MaterialNumber = x.MaterialNumber, Specifications = x.Specifications, MaterialName = x.MaterialName, BarCode = x.BarCode, OrgId = x.OrgId, FCreateDate = x.FCreateDate, FModifyDate = x.FModifyDate, FProductLines1 = x.FProductLines1, FProductCATs1 = x.FProductCATs1, FMaterialGroup = x.FMaterialGroup, F_Product = x.F_Product, FProductLines1FName = x.FProductLines1FName, FProductCATs1FName = x.FProductCATs1FName, FMaterialGroupFName = x.FMaterialGroupFName, MaterialId = x.MaterialId, FProductIDS = x.FProductIDS }).ToList();
|
||||
//
|
||||
|
||||
_logger.LogInformation("取到需要同步的金蝶修改物料规格yzh(第二次)(20260209):" + isFModifyDateMatNumbs.Count + "个");
|
||||
List<string> s = new List<string>();
|
||||
foreach (var ismat in isFModifyDateMatNumbs)
|
||||
{
|
||||
s.Add(ismat.Specifications);
|
||||
}
|
||||
|
||||
var updateList = await _materialsRepositories.GetEntityListByGuiGe(s,DateTime.Now);
|
||||
if (isFModifyDateMatNumbs.Count != 0)
|
||||
{
|
||||
//updateList.ForEach(x => { x.Specifications = ; });
|
||||
|
||||
foreach (var entity in updateList)
|
||||
{
|
||||
|
||||
entity.isDis = "0";
|
||||
|
||||
}
|
||||
|
||||
|
||||
var isSuccess = await _materialsRepositories.UpdateRange(updateList);
|
||||
if (!isSuccess)
|
||||
_logger.LogInformation("同步金蝶修改物料-修改物料规格yzh:失败");
|
||||
else
|
||||
_logger.LogInformation("同步金蝶修改物料-修改物料规格yzh:成功->" + updateList.Count + "条");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//5.修改物料数据
|
||||
if (mats.Count != 0)
|
||||
{
|
||||
|
||||
@@ -178,6 +178,16 @@ namespace BarCode.Web.Repositories
|
||||
return entitys;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取物料按规格
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<Materials>> GetEntityListByGuiGe(List<string> materGuiGes,DateTime dt)
|
||||
{
|
||||
var entitys = await _context.Materials.Where(x => materGuiGes.Contains(x.Specifications) && x.FCreateDate <dt.AddMinutes(-3)).ToListAsync();
|
||||
return entitys;
|
||||
}
|
||||
|
||||
public async Task<List<Materials>> GetEntityList(List<string> materNumbers)
|
||||
{
|
||||
var entitys = await _context.Materials.Where(x => materNumbers.Contains(x.MaterialNumber)).ToListAsync();
|
||||
|
||||
Reference in New Issue
Block a user