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