修复bug
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using WMS.Web.Core;
|
||||
using WMS.Web.Domain.Values;
|
||||
@@ -16,7 +17,7 @@ namespace WMS.Web.Domain.Entitys
|
||||
public class SerialNumbers : EntityBase
|
||||
{
|
||||
public SerialNumbers() { }
|
||||
public SerialNumbers(string serialNumber, int materialId, int boxId, int opsBoxId, string creator, DateTime? createTime,DateTime? completeCartonTime)
|
||||
public SerialNumbers(string serialNumber, int materialId, int boxId, int opsBoxId, string creator, DateTime? createTime, DateTime? completeCartonTime)
|
||||
{
|
||||
this.SerialNumber = serialNumber;
|
||||
this.MaterialId = materialId;
|
||||
@@ -96,7 +97,7 @@ namespace WMS.Web.Domain.Entitys
|
||||
/// 操作(绑定箱信息)
|
||||
/// </summary>
|
||||
/// <param name="destBoxId">目标箱号</param>
|
||||
public void Bind(int destBoxId,DateTime completeCartonTime)
|
||||
public void Bind(int destBoxId, DateTime completeCartonTime)
|
||||
{
|
||||
this.BoxId = destBoxId;
|
||||
this.CompleteCartonTime = completeCartonTime;
|
||||
@@ -111,14 +112,18 @@ namespace WMS.Web.Domain.Entitys
|
||||
/// <summary>
|
||||
/// 出库
|
||||
/// </summary>
|
||||
/// <param name="salBillNos">出库单号</param>
|
||||
public void OutStock(List<string> salBillNos, OutStockType type,int customerId)
|
||||
/// <param name="outStock">出库单</param>
|
||||
public void OutStock(OutStock outStock, int materialId)
|
||||
{
|
||||
this.BoxId = 0;
|
||||
if (type == OutStockType.Sal)
|
||||
var outstockDetail = outStock.Details.FirstOrDefault(f => f.MaterialId == materialId);
|
||||
if (outstockDetail == null) return;
|
||||
//按产品出才解绑 按箱子出不解绑
|
||||
if (outStock.Method == InventoryInOutMethod.Product)
|
||||
UnBind();
|
||||
if (outStock.Type == OutStockType.Sal)
|
||||
{
|
||||
this.SalBillNo = JsonConvert.SerializeObject(salBillNos);
|
||||
this.CustomerId = customerId;
|
||||
this.SalBillNo = JsonConvert.SerializeObject(outstockDetail.ErpDetails.Select(s => s.SaleBillNo).ToList());
|
||||
this.CustomerId = outStock.ReceiptCustomerId;
|
||||
this.OutStockTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ namespace WMS.Web.Domain.Services
|
||||
var outstockDetail = outStock.Details.FirstOrDefault(f => f.MaterialId == entity.MaterialId);
|
||||
if (outstockDetail == null) continue;
|
||||
//修改序列号和箱绑定关系
|
||||
entity.OutStock(outstockDetail.ErpDetails.Select(s => s.SaleBillNo).ToList(), outStock.Type, outStock.ReceiptCustomerId);
|
||||
entity.OutStock(outStock, entity.MaterialId);
|
||||
|
||||
//记录序列号操作日志
|
||||
SerialNumberOperate op = new SerialNumberOperate()
|
||||
|
||||
Reference in New Issue
Block a user