修改了入库的时候暂存问题

This commit is contained in:
2026-07-30 17:35:00 +08:00
parent 8febb925af
commit 7aa5c14458
16 changed files with 177 additions and 5 deletions

View File

@@ -2778,6 +2778,26 @@
备注
</summary>
</member>
<member name="T:WMS.Web.Domain.Entitys.uc_warehouse_position">
<summary>
老ops箱信息头
</summary>
</member>
<member name="P:WMS.Web.Domain.Entitys.uc_warehouse_position.Id">
<summary>
Id
</summary>
</member>
<member name="P:WMS.Web.Domain.Entitys.uc_warehouse_position.position_code">
<summary>
编码
</summary>
</member>
<member name="P:WMS.Web.Domain.Entitys.uc_warehouse_position.position">
<summary>
名称
</summary>
</member>
<member name="M:WMS.Web.Domain.Infrastructure.IAllFielRepositories`1.GetListField(`0,System.Int32)">
<summary>
列表字段导出接口
@@ -3044,6 +3064,9 @@
<member name="M:WMS.Web.Domain.Infrastructure.IBoxRepositories.GetEntityList(System.Collections.Generic.List{System.Int32})">
查询实体集合
</member>
<member name="M:WMS.Web.Domain.Infrastructure.IBoxRepositories.Getuc_warehouse_position">
查询实体集合
</member>
<member name="T:WMS.Web.Domain.Infrastructure.IErpOpsSyncDateRepositories">
<summary>
定时任务最新一次时间管理

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace WMS.Web.Core.Dto.Erp.Org
{
/// <summary>
/// 金蝶组织-基本信息
/// </summary>
public class uc_warehouse_position
{
/// <summary>
/// Id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 编码
/// </summary>
public string position_code { get; set; }
/// <summary>
/// 名称
/// </summary>
public string position { get; set; }
}
}

View File

@@ -76,6 +76,7 @@ namespace WMS.Web.Core.Dto.InStockTask
/// 入库数量
/// </summary>
public decimal RealityQty { get; set; }
public string shelfSpaceCode { get; set; }
/// <summary>
/// 入库仓位
/// </summary>

View File

@@ -87,7 +87,7 @@ namespace WMS.Web.Core.Dto.OutStockTask
public int OutStockBoxDetailsId { get; set; } = 0;
public int MaterialCount { get; set; } = 0;
public string position_code { get; set; }
public string position { get; set; }
}

View File

@@ -10,6 +10,10 @@
<DocumentationFile>../WMS.Web.Api/wwwroot/WMS.Web.Core.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Dto\Erp\Stock\ErpOrgDto.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using WMS.Web.Core;
using WMS.Web.Core.Help;
using WMS.Web.Core.Internal.Results;
using WMS.Web.Domain.Values;
namespace WMS.Web.Domain.Entitys
{
/// <summary>
/// 老ops箱信息头
/// </summary>
[Serializable]
[Table("uc_warehouse_position")]
public class uc_warehouse_position : EntityBase
{
/// <summary>
/// Id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 编码
/// </summary>
public string position_code { get; set; }
/// <summary>
/// 名称
/// </summary>
public string position { get; set; }
}
}

View File

@@ -155,6 +155,15 @@ namespace WMS.Web.Domain.IService.Public
/// <returns></returns>
string GetOrgName(List<ErpOrgDto> erpOrgs, string orgCode);
/// <summary>
/// 获取仓位编码
/// </summary>
/// <param name="erpOrgs"></param>
/// <param name="orgCode"></param>
/// <returns></returns>
// string GetPositionName(List<uc_warehouse_position> positons, string postionCode);
/// <summary>
/// 获取组织ID
/// </summary>

View File

@@ -176,6 +176,7 @@ namespace WMS.Web.Domain.IService.Public
/// <returns></returns>
Task<ResultList<ErpOrgDto>> BillQueryForOrg();
//Task<ResultList<uc_warehouse_position>> BillQueryForPosi();
/// <summary>
/// 供应商
/// </summary>

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using WMS.Web.Core.Dto;
using WMS.Web.Core.Dto.Erp.Org;
using WMS.Web.Domain.Entitys;
namespace WMS.Web.Domain.Infrastructure
@@ -32,6 +33,9 @@ namespace WMS.Web.Domain.Infrastructure
/// 查询实体集合
Task<List<Box>> GetEntityList(List<int> ids);
/// 查询实体集合
Task<List<uc_warehouse_position>> Getuc_warehouse_position();
Task<List<Box>> GetEntityListByNos(List<string> billNos);
}
}

View File

@@ -990,6 +990,11 @@ namespace WMS.Web.Domain.Services
currentDet = details.Where(x => x.DetailId == det.ErpInStockDetailId.Value.ToString()).FirstOrDefault();
if (currentDet != null)
{
//加了这里yzh20260730
if(currentDet.DocumentStatus=="Z")
{
currentDet.Qty = det.Qty;
}
var res = await this.QueryFirst(currentDet, erpDto.TargetFormId, entity.BillNo, det, sc_erpService);
if (res.result.IsSuccess)
entity.SyncSuccess(det.ErpDetailId, loginInfo?.UserInfo?.StaffId ?? 0, res.erpBillNo);
@@ -1328,8 +1333,10 @@ namespace WMS.Web.Domain.Services
ErpOperateDto o_dto = new ErpOperateDto(formId, currentDet.OrderBillNo);//res_s.Data
if (currentDet.DocumentStatus == ErpOrderStatus.Z.ToString())
{
//保存
_logger.LogInformation($"入库单->查询到已有暂存的入库单 开始保存 单号:{billNo} erp明细Id:{erpDetail.ErpDetailId} 数据: {JsonConvert.SerializeObject(purchaseInstock)}");
var res_s = await sc_erpService.Save<ErpPurchaseInStockSaveDto>(purchaseInstock, formId);
if (!res_s.IsSuccess)
{

View File

@@ -612,6 +612,15 @@ namespace WMS.Web.Domain.Services
if (org_result.IsSuccess)
orgs = org_result.Data.ToList();
//取仓位
var postionList = await _boxRepositories.Getuc_warehouse_position();
//List<uc_warehouse_position> posi = new List<uc_warehouse_position>();
//if (postionList.Count>0)
// posi = postionList.ToList();
//取客户
var customer_result = await _erpService.BillQueryForCustomer();
List<ErpCustomerDto> customers = new List<ErpCustomerDto>();
@@ -640,11 +649,15 @@ namespace WMS.Web.Domain.Services
var details = outStockList.SelectMany(s => s.Details).ToList();
var boxDetails = outStockList.SelectMany(s => s.Details).SelectMany(s => s.BoxsDetails).ToList();
var boxList = await _boxRepositories.GetEntityList(boxDetails.Select(s => s.BoxId).ToList());
foreach (var b in boxDetails)
{
var detail = details.FirstOrDefault(f => f.Id == b.DetailId);
var outStock = outStockList.FirstOrDefault(f => f.Id == detail.Fid);
var m = materials.FirstOrDefault(f => f.MaterialNumber.Equals(detail.MaterialNumber));
//var postionList = await _boxRepositories.Getuc_warehouse_position(boxDetails.Select(s => s.SubStockCode).ToList());
OutStockTaskInfoDetailsResponse infoDetail = new OutStockTaskInfoDetailsResponse()
{
BoxBillNo = boxList.FirstOrDefault(f => f.Id == b.BoxId)?.BoxBillNo ?? "",
@@ -655,7 +668,8 @@ namespace WMS.Web.Domain.Services
BoxHigh = b.BoxHigh,
BoxWeight = b.BoxWeight,
Qty = b.Qty,
position=b.SubStockCode,
position_code = b.SubStockCode,
position = postionList.FirstOrDefault(f=>f.position_code==b.SubStockCode)?.position??"",
SerialNumbers = string.Join(",", b.SerialNumbers),
SerialNumberList = b.SerialNumbers,
Method = outStock.Method.GetRemark(),

View File

@@ -407,6 +407,20 @@ namespace WMS.Web.Domain.Services.Public
return org == null ? "" : org.Name;
}
///// <summary>
///// 获取仓位名称
///// </summary>
///// <param name="erpOrgs"></param>
///// <param name="orgCode"></param>
///// <returns></returns>
//public string GetPositionName(List<uc_warehouse_position> positons, string postionCode)
//{
// if (positons == null || positons.Count == 0)
// return "";
// var posi = positons.Where(x => x.position_code == postionCode).FirstOrDefault();
// return posi == null ? "" : posi.position;
//}
/// <summary>
/// 获取组织id
/// </summary>

View File

@@ -8,6 +8,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WMS.Web.Core.Dto;
using WMS.Web.Core.Dto.Erp.Org;
using WMS.Web.Core.Help;
using WMS.Web.Domain.Entitys;
using WMS.Web.Domain.Infrastructure;
@@ -208,6 +209,23 @@ namespace WMS.Web.Repositories
return res.Clone();
}
/// <summary>
/// 获取对应仓位
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
public async Task<List<uc_warehouse_position>> Getuc_warehouse_position()
{
var res = await _context.uc_warehouse_position
//.Where(f => postion_codes.Contains(f.position_code))
.ToListAsync();
return res.Clone();
}
}
}

View File

@@ -8,6 +8,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json;
using WMS.Web.Core.Dto.Erp.Org;
using WMS.Web.Domain.Entitys;
using WMS.Web.Repositories.Configuration.Log;
@@ -470,6 +471,7 @@ namespace WMS.Web.Repositories.Configuration
public DbSet<InventoryInOutDetails> InventoryInOutDetails { get; set; }
public DbSet<Box> Box { get; set; }
public DbSet<uc_warehouse_position> uc_warehouse_position { get; set; }
public DbSet<BoxDetails> BoxDetails { get; set; }
public DbSet<SubscribeNotification> SubscribeNotification { get; set; }
}

View File

@@ -38,7 +38,7 @@ namespace WMS.Web.Repositories
private readonly ILoginRepositories _loginRepositories;
private readonly IErpService _erpService;
private readonly IErpBasicDataExtendService _erpBasicDataExtendService;
private IBoxRepositories _boxRepositories;
public InStockTaskRepositories(RepositoryDbContext context,
IMapper mapper,
@@ -47,6 +47,7 @@ namespace WMS.Web.Repositories
IServiceProvider serviceProvider,
ISingleDataService singleDataService,
ILoginRepositories loginRepositories,
IBoxRepositories boxRepositories,
IErpBasicDataExtendService erpBasicDataExtendService)
{
_context = context;
@@ -56,7 +57,9 @@ namespace WMS.Web.Repositories
_serviceProvider = serviceProvider;
_singleDataService = singleDataService;
_loginRepositories = loginRepositories;
_boxRepositories = boxRepositories;
_erpBasicDataExtendService = erpBasicDataExtendService;
}
/// <summary>
@@ -137,6 +140,10 @@ namespace WMS.Web.Repositories
public async Task<InStockTaskInfoDto> GetInfo(int id, int companyId)
{
//取仓位
var postionList = await _boxRepositories.Getuc_warehouse_position();
//1.获取物料集合和组织集合和供应商的集合
var materials = new List<ErpMaterialDto>();
var materials_result = await _erpService.BillQueryForMaterial();
@@ -197,7 +204,8 @@ namespace WMS.Web.Repositories
RealityQty = x.detail.Qty,
ReceiveQty = x.detail.Qty,
ShelfTime = x.order.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"),
shelfSpace=x.order.SubStockCode,
shelfSpaceCode=x.order.SubStockCode,
shelfSpace = x.order.SubStockCode,
Shelfer = _singleDataService.GetSingleData(SingleAction.Staffs, companyId, x.order.CreatorId),
Receiver = "",
ReceiveTime = "",