调整出库单结构
This commit is contained in:
@@ -31,11 +31,6 @@ namespace WMS.Web.Domain.Entitys
|
||||
[Column("BillNo")]
|
||||
public string BillNo { get; set; }
|
||||
/// <summary>
|
||||
/// 来源单号
|
||||
///</summary>
|
||||
[Column("SourceBillNo")]
|
||||
public string SourceBillNo { get; set; }
|
||||
/// <summary>
|
||||
/// 单据类型
|
||||
/// </summary>
|
||||
[Column("Type")]
|
||||
|
||||
@@ -30,8 +30,12 @@ namespace WMS.Web.Domain.Entitys
|
||||
/// 销售订单号
|
||||
///</summary>
|
||||
[Column("SaleBillNo")]
|
||||
public string SaleBillNo { get; set; }
|
||||
|
||||
public List<string> SaleBillNos { get; set; }
|
||||
/// <summary>
|
||||
/// 来源单号
|
||||
///</summary>
|
||||
[Column("SourceBillNo")]
|
||||
public List<string> SourceBillNos { get; set; }
|
||||
/// <summary>
|
||||
/// 物料Id
|
||||
///</summary>
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace WMS.Web.Domain.Entitys
|
||||
/// 销售订单号
|
||||
///</summary>
|
||||
[Column("SaleBillNo")]
|
||||
public string SaleBillNo { get; set; }
|
||||
public List<string> SaleBillNos { get; set; }
|
||||
/// <summary>
|
||||
/// 物料Id
|
||||
///</summary>
|
||||
|
||||
@@ -187,6 +187,7 @@ namespace WMS.Web.Domain.Services
|
||||
foreach (var entity in entityList)
|
||||
{
|
||||
var box = boxList.FirstOrDefault(f => f.Id == entity.BoxId);
|
||||
var outstockDetail = outStock.Details.FirstOrDefault(f => f.MaterialId == entity.MaterialId);
|
||||
//修改序列号和箱绑定关系
|
||||
entity.OutStock(outStock.BillNo, outStock.Type);
|
||||
|
||||
@@ -200,14 +201,14 @@ namespace WMS.Web.Domain.Services
|
||||
OperateTime = DateTime.Now,
|
||||
OperateType = OutStockTypeConvert(outStock.Type),
|
||||
OperateUser = userName,
|
||||
Remark = "来源单号:" + outStock.SourceBillNo + "\r\n" + "出库单号:" + outStock.BillNo
|
||||
Remark = "来源单号:" + string.Join(",",outstockDetail.SourceBillNos) + "\r\n" + "出库单号:" + outStock.BillNo
|
||||
};
|
||||
if (outStock.Type == OutStockType.Sal)
|
||||
{
|
||||
var detail = outStock.Details.FirstOrDefault(f => f.MaterialId == entity.MaterialId);
|
||||
var res_c = await _erpService.BillQueryForCustomer();
|
||||
var customer = res_c.Data.FirstOrDefault(f => f.Id == outStock.ReceiptCustomerId);
|
||||
op.Remark += "\r\n" + "销售订单号:" + detail.SaleBillNo;
|
||||
op.Remark += "\r\n" + "销售订单号:" + string.Join(",", detail.SaleBillNos);
|
||||
op.Remark += "\r\n" + "客户:" + customer?.Name;
|
||||
}
|
||||
sList.Add(op);
|
||||
|
||||
@@ -93,6 +93,14 @@ namespace WMS.Web.Repositories.Configuration
|
||||
|
||||
ent.Property(f => f.SerialNumbers).HasConversion(
|
||||
v => JsonConvert.SerializeObject(v),
|
||||
v => JsonConvert.DeserializeObject<List<string>>(v));
|
||||
|
||||
ent.Property(f => f.SourceBillNos).HasConversion(
|
||||
v => JsonConvert.SerializeObject(v),
|
||||
v => JsonConvert.DeserializeObject<List<string>>(v));
|
||||
|
||||
ent.Property(f => f.SaleBillNos).HasConversion(
|
||||
v => JsonConvert.SerializeObject(v),
|
||||
v => JsonConvert.DeserializeObject<List<string>>(v));
|
||||
});
|
||||
#endregion
|
||||
@@ -115,8 +123,13 @@ namespace WMS.Web.Repositories.Configuration
|
||||
|
||||
ent.Property(f => f.SourceBillNos).HasConversion(
|
||||
v => JsonConvert.SerializeObject(v),
|
||||
v => JsonConvert.DeserializeObject<List<string>>(v));
|
||||
|
||||
ent.Property(f => f.SaleBillNos).HasConversion(
|
||||
v => JsonConvert.SerializeObject(v),
|
||||
v => JsonConvert.DeserializeObject<List<string>>(v));
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
#region 盘点单
|
||||
|
||||
@@ -82,6 +82,10 @@ namespace WMS.Web.Repositories
|
||||
/// <returns></returns>
|
||||
public async Task<(List<OutStockQueryInfoResponse> list, int total)> GetListAsync(OutStockQueryRequest dto)
|
||||
{
|
||||
List<int> detailIds = new List<int>();
|
||||
if (!string.IsNullOrEmpty(dto.SourceBillNo))
|
||||
detailIds = await _context.OutStockTaskDetails.FromSqlRaw($"SELECT Id FROM t_wms_outstock_details WHERE SourceBillNo like '%{dto.SourceBillNo}%'").Select(s => s.Id).ToListAsync();
|
||||
|
||||
List<int> ids = new List<int>();
|
||||
if (!string.IsNullOrEmpty(dto.Creator))
|
||||
{
|
||||
@@ -134,8 +138,8 @@ namespace WMS.Web.Repositories
|
||||
query = query.Where(w => mIds.Contains(w.detail.MaterialId));
|
||||
if (ids.Count() > 0)
|
||||
query = query.Where(w => ids.Contains(w.order.CreatorId));
|
||||
if (!string.IsNullOrEmpty(dto.SourceBillNo))
|
||||
query = query.Where(w => EF.Functions.Like(w.order.SourceBillNo, "%" + dto.SourceBillNo + "%"));
|
||||
if (detailIds.Count()!=0)
|
||||
query = query.Where(w => detailIds.Contains(w.detail.Id));
|
||||
if (dto.Type != null)
|
||||
query = query.Where(w => w.order.Type == (OutStockType)dto.Type);
|
||||
if (dto.SuccessSync != null)
|
||||
@@ -160,8 +164,8 @@ namespace WMS.Web.Repositories
|
||||
CreateTime = s.order.CreateTime.DateToStringSeconds(),
|
||||
SuccessSync = s.order.SuccessSync,
|
||||
Stock = _singleDataService.GetSingleData(SingleAction.Stocks, _loginRepositories.CompanyId, s.detail.StockCode),
|
||||
SourceBillNo = s.order.SourceBillNo,
|
||||
SaleBillNo = s.detail.SaleBillNo,
|
||||
SourceBillNo =string.Join(",",s.detail.SourceBillNos),
|
||||
SaleBillNo = string.Join(",", s.detail.SaleBillNos),
|
||||
DeliveryOrg = _erpBasicDataExtendService.GetOrgName(orgs, s.order.DeliveryOrgId),
|
||||
ReceiptCustomer = s.order.Type == OutStockType.Sal
|
||||
? _erpBasicDataExtendService.GetCustomerName(customers, s.order.ReceiptCustomerId)
|
||||
|
||||
@@ -296,7 +296,7 @@ namespace WMS.Web.Repositories
|
||||
OutStockEndTime = s.detail.OutStockEndTime.DateToStringSeconds(),
|
||||
Stock = _singleDataService.GetSingleData(SingleAction.Stocks, _loginRepositories.CompanyId, s.detail.StockCode),
|
||||
SourceBillNo = string.Join(",", s.detail.SourceBillNos),
|
||||
SaleBillNo = s.detail.SaleBillNo,
|
||||
SaleBillNo = string.Join(",", s.detail.SaleBillNos),
|
||||
DeliveryOrg = _erpBasicDataExtendService.GetOrgName(orgs, s.order.DeliveryOrgId),
|
||||
ReceiptCustomer = s.order.Type == OutStockType.Sal
|
||||
? _erpBasicDataExtendService.GetCustomerName(customers, s.order.ReceiptCustomerId)
|
||||
|
||||
Reference in New Issue
Block a user