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