This commit is contained in:
tongfei
2023-12-06 14:48:42 +08:00
5 changed files with 57 additions and 39 deletions

View File

@@ -1,4 +1,5 @@
using System;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
@@ -110,13 +111,13 @@ namespace WMS.Web.Domain.Entitys
/// <summary>
/// 出库
/// </summary>
/// <param name="outStockBillNo">出库单号</param>
public void OutStock(string outStockBillNo, OutStockType type,int customerId)
/// <param name="salBillNos">出库单号</param>
public void OutStock(List<string> salBillNos, OutStockType type,int customerId)
{
this.BoxId = 0;
if (type == OutStockType.Sal)
{
this.SalBillNo = outStockBillNo;
this.SalBillNo = JsonConvert.SerializeObject(salBillNos);
this.CustomerId = customerId;
this.OutStockTime = DateTime.Now;
}

View File

@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore.Storage;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -64,7 +65,7 @@ namespace WMS.Web.Domain.Services
//修改序列号和箱绑定关系
entity.Bind(destBox.DestBoxId, box.CompleteCartonTime);
//记录序列号操作日志
SerialNumberOperate op = new SerialNumberOperate()
{
@@ -194,7 +195,7 @@ namespace WMS.Web.Domain.Services
var outstockDetail = outStock.Details.FirstOrDefault(f => f.MaterialId == entity.MaterialId);
if (outstockDetail == null) continue;
//修改序列号和箱绑定关系
entity.OutStock(outStock.BillNo, outStock.Type, outStock.ReceiptCustomerId);
entity.OutStock(outstockDetail.ErpDetails.Select(s => s.SaleBillNo).ToList(), outStock.Type, outStock.ReceiptCustomerId);
//记录序列号操作日志
SerialNumberOperate op = new SerialNumberOperate()
@@ -206,7 +207,7 @@ namespace WMS.Web.Domain.Services
OperateTime = DateTime.Now,
OperateType = OutStockTypeConvert(outStock.Type),
OperateUser = userName,
Remark = "来源单号:" + string.Join(",", outstockDetail.ErpDetails.Select(s=>s.SourceBillNo)) + "\r\n" + "出库单号:" + outStock.BillNo
Remark = "来源单号:" + string.Join(",", outstockDetail.ErpDetails.Select(s => s.SourceBillNo)) + "\r\n" + "出库单号:" + outStock.BillNo
};
if (outStock.Type == OutStockType.Sal)
{
@@ -387,7 +388,7 @@ namespace WMS.Web.Domain.Services
//if (backRecord.Type == BackRecordType.InstockOff)
// entity.UnBind();
if (backRecord.Type == BackRecordType.OutstockOn)
entity.Bind(detail.BoxId,box.CompleteCartonTime);
entity.Bind(detail.BoxId, box.CompleteCartonTime);
//记录序列号操作日志