You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
147 lines
4.3 KiB
147 lines
4.3 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Win_in.Sfs.Shared.Domain;
|
|
using Win_in.Sfs.Shared.Domain.Entities;
|
|
using Win_in.Sfs.Shared.Domain.Shared;
|
|
|
|
namespace Win_in.Sfs.Wms.Job.Domain;
|
|
|
|
/// <summary>
|
|
/// 检验任务
|
|
/// </summary>
|
|
[Display(Name = "检验任务")]
|
|
public class InspectJob : SfsJobAggregateRootBase<InspectJobDetail>
|
|
, IHasSummaryDetails<InspectJobSummaryDetail>
|
|
{
|
|
|
|
/// <summary>
|
|
/// 检验单号
|
|
/// </summary>
|
|
[IgnoreUpdate]
|
|
public string InspectNumber { get; set; }
|
|
|
|
/// <summary>
|
|
/// 任务明细
|
|
/// </summary>
|
|
[IgnoreUpdate]
|
|
public override List<InspectJobDetail> Details { get; set; } = new List<InspectJobDetail>();
|
|
|
|
/// <summary>
|
|
/// 汇总任务明细
|
|
/// </summary>
|
|
[IgnoreUpdate]
|
|
public List<InspectJobSummaryDetail> SummaryDetails { get; set; } = new List<InspectJobSummaryDetail>();
|
|
|
|
/// <summary>
|
|
/// 收货单号
|
|
/// </summary>
|
|
[IgnoreUpdate]
|
|
public string ReceiptNumber { get; set; }
|
|
|
|
/// <summary>
|
|
/// 到货单号
|
|
/// </summary>
|
|
[IgnoreUpdate]
|
|
public string PurchaseReceiptRequestNumber { get; set; }
|
|
|
|
/// <summary>
|
|
/// 发货单号
|
|
/// </summary>
|
|
[IgnoreUpdate]
|
|
public string AsnNumber { get; set; }
|
|
|
|
/// <summary>
|
|
/// 要货计划单号
|
|
/// </summary>
|
|
[IgnoreUpdate]
|
|
public string RpNumber { get; set; }
|
|
|
|
/// <summary>
|
|
/// 订单号
|
|
/// </summary>
|
|
[IgnoreUpdate]
|
|
public string PoNumber { get; set; }
|
|
|
|
/// <summary>
|
|
/// 供应商代码
|
|
/// </summary>
|
|
[IgnoreUpdate]
|
|
public string SupplierCode { get; set; }
|
|
|
|
/// <summary>
|
|
/// 检验下一步动作
|
|
/// </summary>
|
|
[IgnoreUpdate]
|
|
public EnumInspectNextAction NextAction { get; set; }
|
|
|
|
/// <summary>
|
|
/// 设置任务明细的检验结果
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <param name="goodQty"></param>
|
|
/// <param name="failedReason"></param>
|
|
/// <param name="failedQty"></param>
|
|
/// <param name="crackQty"></param>
|
|
/// <param name="notPassedQty"></param>
|
|
/// <param name="username"></param>
|
|
/// <param name="batch"></param>
|
|
/// <param name="containerCode"></param>
|
|
/// <param name="locationCode"></param>
|
|
/// <param name="lot"></param>
|
|
/// <param name="packingCode"></param>
|
|
/// <param name="qty"></param>
|
|
/// <returns></returns>
|
|
public virtual async Task SetDetail(Guid id, decimal goodQty, string failedReason, decimal failedQty,
|
|
decimal crackQty, decimal notPassedQty, string username,
|
|
string supplierBatch, DateTime arriveDate, DateTime produceDate, DateTime expireDate, string containerCode, string locationCode, string lot,
|
|
string packingCode, decimal qty)
|
|
{
|
|
var detail = GetDetail(id);
|
|
detail.GoodQty = goodQty;
|
|
detail.FailedReason = failedReason;
|
|
detail.FailedQty = failedQty;
|
|
detail.CrackQty = crackQty;
|
|
detail.NotPassedQty = notPassedQty;
|
|
detail.InspectUser = username;
|
|
detail.SupplierBatch = supplierBatch;
|
|
detail.ArriveDate = arriveDate;
|
|
detail.ProduceDate = produceDate;
|
|
detail.ExpireDate = expireDate;
|
|
detail.ContainerCode = containerCode;
|
|
detail.LocationCode = locationCode;
|
|
detail.Lot = lot;
|
|
detail.PackingCode = packingCode;
|
|
detail.ReceiveQty = qty;
|
|
await Task.CompletedTask.ConfigureAwait(false);
|
|
}
|
|
|
|
public virtual async Task SetSummaryDetail(Guid id, decimal goodQty, string failedReason, decimal failedQty,
|
|
decimal crackQty, decimal notPassedQty, string username)
|
|
{
|
|
var summarydetail = SummaryDetails.First(p => p.Id == id);
|
|
summarydetail.GoodQty = goodQty;
|
|
summarydetail.FailedReason = failedReason;
|
|
summarydetail.FailedQty = failedQty;
|
|
summarydetail.CrackQty = crackQty;
|
|
summarydetail.NotPassedQty = notPassedQty;
|
|
summarydetail.InspectUser = username;
|
|
await Task.CompletedTask.ConfigureAwait(false);
|
|
}
|
|
|
|
public void SetWorkGroup(string workGroupCode)
|
|
{
|
|
WorkGroupCode = workGroupCode;
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="number"></param>
|
|
public virtual void SetNumber(string number)
|
|
{
|
|
Number = number;
|
|
}
|
|
}
|
|
|