增加状态

This commit is contained in:
18942506660
2023-12-20 16:48:29 +08:00
parent 0870962bc4
commit e1883dd993
6 changed files with 27 additions and 6 deletions

View File

@@ -121,6 +121,12 @@ namespace WMS.Web.Api.Controllers
{
response.OutStockStatus.Add((int)enumv, enumv.GetRemark());
}
foreach (SyncStatus enumv in Enum.GetValues(typeof(SyncStatus)))
{
if ((int)enumv == 0 || (int)enumv == 1 || (int)enumv == 4)
response.SyncStatus.Add((int)enumv, enumv.GetRemark());
}
//2
//1
return Task.FromResult(Result<EnumStatusResponse>.ReSuccess(response));

View File

@@ -575,6 +575,11 @@
出库状态
</summary>
</member>
<member name="P:WMS.Web.Core.Dto.EnumStatusResponse.SyncStatus">
<summary>
同步金蝶状态
</summary>
</member>
<member name="T:WMS.Web.Core.Dto.Erp.Customer.ErpCustomerDto">
<summary>
客户

View File

@@ -62,6 +62,10 @@ namespace WMS.Web.Core.Dto
/// 出库状态
/// </summary>
public Dictionary<int, string> OutStockStatus { get; set; } = new Dictionary<int, string>();
/// <summary>
/// 同步金蝶状态
/// </summary>
public Dictionary<int, string> SyncStatus { get; set; } = new Dictionary<int, string>();
}
}

View File

@@ -28,7 +28,7 @@ namespace WMS.Web.Core.Dto.OutStock
/// <summary>
/// 同步成功或者失败 null 就是未同步
/// </summary>
public bool? SuccessSync { get; set; }
public int? SuccessSync { get; set; }
/// <summary>
/// 来源单号
///</summary>

View File

@@ -68,6 +68,7 @@ namespace WMS.Web.Domain.Services
public async Task<Result> Save(List<SaveTakeStockRequest> dto, LoginInDto loginInfo)
{
_logger.LogInformation($"盘点保存:{JsonConvert.SerializeObject(dto)} 盘点人:{loginInfo.UserInfo.StaffId}");
dto = dto.Where(w => w.AfterQty != w.BeforeQty).ToList();
if (dto.GroupBy(g => g.BoxId).Count() > 1)
return Result.ReFailure(ResultCodes.TakeStockBoxError);
@@ -155,7 +156,7 @@ namespace WMS.Web.Domain.Services
public async Task<Result> Sync(OperateRequest dto)
{
var list = await _takeStockRepositories.GetEntityList(dto.Ids);
list = list.Where(w => w.SuccessSync == SyncStatus.Fail|| w.SuccessSync == SyncStatus.SyncIng).ToList();
list = list.Where(w => w.SuccessSync == SyncStatus.Fail || w.SuccessSync == SyncStatus.SyncIng).ToList();
foreach (var entity in list)
{
Task.Run(async () =>

View File

@@ -139,11 +139,16 @@ namespace WMS.Web.Repositories
query = query.Where(w => w.order.Type == (OutStockType)dto.Type);
if (dto.SuccessSync != null)
{
if (dto.SuccessSync == true)
if ((SyncStatus)dto.SuccessSync == SyncStatus.Success)
query = query.Where(w => w.order.SuccessSync == SyncStatus.Success);
else
query = query.Where(w => w.order.SuccessSync != SyncStatus.Success);
else if ((SyncStatus)dto.SuccessSync == SyncStatus.SyncIng)
query = query.Where(w => w.order.SuccessSync == SyncStatus.SyncIng);
else if ((SyncStatus)dto.SuccessSync == SyncStatus.Fail)
query = query.Where(w => w.order.SuccessSync == SyncStatus.Fail
|| w.order.SuccessSync == SyncStatus.SubmitFail
|| w.order.SuccessSync == SyncStatus.CheckFail);
}
if (dto.DeliveryOrgId != null)
query = query.Where(w => w.order.DeliveryOrgId == dto.DeliveryOrgId);
if (!string.IsNullOrEmpty(dto.StockCode))