|
|
@@ -33,6 +33,7 @@ using MongoDB.Bson.Serialization.Attributes;
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
using System.Diagnostics.CodeAnalysis;
|
|
|
+using System.Diagnostics;
|
|
|
|
|
|
namespace Business.ResourceExamineManagement
|
|
|
{
|
|
|
@@ -244,6 +245,14 @@ namespace Business.ResourceExamineManagement
|
|
|
private readonly BusinessBangDbContext _businessBangDbContext;
|
|
|
private readonly BusinessDbContext _businessDbContext;
|
|
|
private readonly ISqlRepository<TagMaster> _tagMasterRepository;
|
|
|
+ /// <summary>
|
|
|
+ /// 生产周期明细
|
|
|
+ /// </summary>
|
|
|
+ private ISqlRepository<PeriodSequenceDet> _periodSequenceDet;
|
|
|
+ /// <summary>
|
|
|
+ /// 生产线维护表
|
|
|
+ /// </summary>
|
|
|
+ private ISqlRepository<LineMaster> _lineMaster;
|
|
|
private readonly ProductionScheduleAppService _productionScheduleAppService;
|
|
|
#endregion
|
|
|
|
|
|
@@ -309,6 +318,8 @@ namespace Business.ResourceExamineManagement
|
|
|
IRepository<b_bom_pretreatment, long> mysql_b_bom_pretreatment,
|
|
|
IRepository<srm_supplier, long> mysql_srm_supplier,
|
|
|
ISqlRepository<TagMaster> tagMasterRepository,
|
|
|
+ ISqlRepository<PeriodSequenceDet> periodSequenceDet,
|
|
|
+ ISqlRepository<LineMaster> lineMaster,
|
|
|
PretreatmentAppService pretreatmentAppService,
|
|
|
CalcBomViewAppService calcbomviewAppService,
|
|
|
PurchaseOrderAppService purchaseOrderAppService,
|
|
|
@@ -371,6 +382,8 @@ namespace Business.ResourceExamineManagement
|
|
|
_mysql_b_bom_pretreatment = mysql_b_bom_pretreatment;
|
|
|
_mysql_srm_supplier= mysql_srm_supplier;
|
|
|
_tagMasterRepository = tagMasterRepository;
|
|
|
+ _periodSequenceDet = periodSequenceDet;
|
|
|
+ _lineMaster = lineMaster;
|
|
|
_pretreatmentAppService = pretreatmentAppService;
|
|
|
_CalcBomViewAppService = calcbomviewAppService;
|
|
|
_purchaseOrderAppService = purchaseOrderAppService;
|
|
|
@@ -2220,9 +2233,34 @@ namespace Business.ResourceExamineManagement
|
|
|
AutoCreateBomBill();
|
|
|
}
|
|
|
|
|
|
- public void AutoCreatePickBill(List<string> WorkOrds)
|
|
|
+ public void AutoCreatePickBill(List<string> workOrds)
|
|
|
{
|
|
|
+ //获取生产周期数据
|
|
|
+ List<PeriodSequenceDet> dbPeriodSequences = _periodSequenceDet.Select(p => workOrds.Contains(p.WorkOrds) && p.Domain == "1001" && p.IsActive).Result;
|
|
|
+ List<LineMaster> lineMasters= new List<LineMaster>();
|
|
|
+ List<string> lines = new List<string>();//产线列表,用于获取领料单对应产线线边仓
|
|
|
+ List<NbrDetail> nNbrDetail = new List<NbrDetail>();//需要生成领料单列表
|
|
|
+ if (dbPeriodSequences.Any())
|
|
|
+ {
|
|
|
+ lines=dbPeriodSequences.Select(a=>a.Line).Distinct().ToList();
|
|
|
+ lineMasters = _lineMaster.Select(p => lines.Contains(p.Line) && p.Domain == "1001" && p.IsActive).Result;
|
|
|
+ foreach(var item in dbPeriodSequences)
|
|
|
+ {
|
|
|
+ nNbrDetail.Add(new NbrDetail
|
|
|
+ {
|
|
|
|
|
|
+ Domain="1001",
|
|
|
+ Type= "SM",
|
|
|
+ Nbr="",
|
|
|
+ ItemNum="",
|
|
|
+ QtyFrom=0,
|
|
|
+ QtyTo=0,
|
|
|
+ WorkOrd=item.WorkOrds,
|
|
|
+ QtyOrd=0,
|
|
|
+ IsActive=true
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|