|
@ -35,6 +35,8 @@ public class PendingDeductionService : ITransientDependency, IExportJob |
|
|
INormalEfCoreRepository<HBPO_PD_DETAIL, Guid> hbpoRepository, |
|
|
INormalEfCoreRepository<HBPO_PD_DETAIL, Guid> hbpoRepository, |
|
|
INormalEfCoreRepository<PUB_PD_DETAIL, Guid> pubRepository, |
|
|
INormalEfCoreRepository<PUB_PD_DETAIL, Guid> pubRepository, |
|
|
|
|
|
|
|
|
|
|
|
INormalEfCoreRepository<CodeSetting, Guid> codesetRepository, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VmiAppService vimservice |
|
|
VmiAppService vimservice |
|
@ -47,6 +49,7 @@ public class PendingDeductionService : ITransientDependency, IExportJob |
|
|
_hbpoSecRepository= hbpoSecRepository; |
|
|
_hbpoSecRepository= hbpoSecRepository; |
|
|
_pubSecRepository= pubSecRepository; |
|
|
_pubSecRepository= pubSecRepository; |
|
|
_vimservice =vimservice; |
|
|
_vimservice =vimservice; |
|
|
|
|
|
_codesetRepository = codesetRepository; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property) |
|
|
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property) |
|
@ -54,20 +57,17 @@ public class PendingDeductionService : ITransientDependency, IExportJob |
|
|
var billList = property.Where(p => p.Name == "BillNumList").FirstOrDefault().Value; |
|
|
var billList = property.Where(p => p.Name == "BillNumList").FirstOrDefault().Value; |
|
|
var type = property.Where(p => p.Name == "Type").FirstOrDefault().Value; |
|
|
var type = property.Where(p => p.Name == "Type").FirstOrDefault().Value; |
|
|
var list=billList.Split(","); |
|
|
var list=billList.Split(","); |
|
|
|
|
|
var projectList=_codesetRepository.Where(p => p.Project == "库位"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (type == "JisBBAC") |
|
|
if (type == "JisBBAC") |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var jisdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.IsMaiDan==false); |
|
|
var jisdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.IsMaiDan==false); |
|
|
var mdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.IsMaiDan ==true); |
|
|
var mdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.IsMaiDan ==true); |
|
|
var query = from itm in jisdetail |
|
|
var query = from itm in jisdetail |
|
|
join itm1 in _bbacSecRepository |
|
|
|
|
|
on new { itm.PN, itm.LU } equals new { itm1.PN, LU = itm1.PrimitiveLU } into temp1 |
|
|
|
|
|
from tm in temp1 |
|
|
|
|
|
where tm == null |
|
|
|
|
|
select |
|
|
select |
|
|
new |
|
|
new |
|
|
{ |
|
|
{ |
|
@ -80,13 +80,13 @@ public class PendingDeductionService : ITransientDependency, IExportJob |
|
|
ChangedType = VmiType.Out, |
|
|
ChangedType = VmiType.Out, |
|
|
//SubBillType = EnumDeliverSubBillType.小件BBAC,
|
|
|
//SubBillType = EnumDeliverSubBillType.小件BBAC,
|
|
|
//BillType = EnumDeliverBjBmpBillType.JIS件,
|
|
|
//BillType = EnumDeliverBjBmpBillType.JIS件,
|
|
|
PartCode = tm != null ? tm.ReplaceLU : itm.LU, |
|
|
PartCode = itm.LU, |
|
|
SettlementVinCode = itm.PN, |
|
|
SettlementVinCode = itm.PN, |
|
|
PartCode2 = tm != null ? tm.ReplaceLU : itm.LU, |
|
|
PartCode2 = itm.LU, |
|
|
CustomerPartCode = string.IsNullOrEmpty(itm.Extend4) ? string.Empty : itm.Extend4, |
|
|
CustomerPartCode = string.IsNullOrEmpty(itm.Extend4) ? string.Empty : itm.Extend4, |
|
|
VinCode = itm.PN, |
|
|
VinCode = itm.PN, |
|
|
OrderNum = itm.GroupNum, |
|
|
OrderNum = itm.GroupNum, |
|
|
ErpToLoc = "C0001" |
|
|
//ErpToLoc = string.IsNullOrEmpty()
|
|
|
}; |
|
|
}; |
|
|
var ls=query.ToList(); |
|
|
var ls=query.ToList(); |
|
|
if (ls != null && ls.Count > 0) |
|
|
if (ls != null && ls.Count > 0) |
|
@ -114,10 +114,55 @@ public class PendingDeductionService : ITransientDependency, IExportJob |
|
|
}).ConfigureAwait(false); |
|
|
}).ConfigureAwait(false); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//var query1=
|
|
|
var query1 = from itm in mdetail |
|
|
|
|
|
select new |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
BillTime = DateTime.Now, |
|
|
|
|
|
ChangedTime = DateTime.Now, |
|
|
|
|
|
Qty = itm.Qty, |
|
|
|
|
|
DeliverTime = itm.CreationTime, |
|
|
|
|
|
LogType = Entities.BQ.Vmi.VmiLogType.Type200, |
|
|
|
|
|
ChangedQty = itm.Qty, |
|
|
|
|
|
ChangedType = VmiType.Out, |
|
|
|
|
|
//SubBillType = EnumDeliverSubBillType.小件BBAC,
|
|
|
|
|
|
//BillType = EnumDeliverBjBmpBillType.JIS件,
|
|
|
|
|
|
PartCode = itm.LU, |
|
|
|
|
|
SettlementVinCode = itm.PN, |
|
|
|
|
|
PartCode2 = itm.LU, |
|
|
|
|
|
CustomerPartCode = string.IsNullOrEmpty(itm.Extend4) ? string.Empty : itm.Extend4, |
|
|
|
|
|
VinCode = itm.PN, |
|
|
|
|
|
OrderNum = itm.GroupNum, |
|
|
|
|
|
ErpToLoc = "C0001" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
var ls1 = query1.ToList(); |
|
|
|
|
|
if (ls1 != null && ls1.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
foreach (var itm in ls1) |
|
|
|
|
|
{ |
|
|
|
|
|
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog() |
|
|
|
|
|
{ |
|
|
|
|
|
BillTime = itm.BillTime, |
|
|
|
|
|
ChangedTime = DateTime.Now, |
|
|
|
|
|
Qty = itm.Qty, |
|
|
|
|
|
DeliverTime = itm.BillTime, |
|
|
|
|
|
LogType = Entities.BQ.Vmi.VmiLogType.Type200, |
|
|
|
|
|
ChangedQty = itm.Qty, |
|
|
|
|
|
ChangedType = VmiType.Out, |
|
|
|
|
|
//SubBillType = EnumDeliverSubBillType.小件BBAC,
|
|
|
|
|
|
//BillType = EnumDeliverBjBmpBillType.JIS件,
|
|
|
|
|
|
PartCode = itm.PartCode, |
|
|
|
|
|
SettlementVinCode = itm.VinCode, |
|
|
|
|
|
PartCode2 = itm.PartCode2, |
|
|
|
|
|
CustomerPartCode = itm.CustomerPartCode, |
|
|
|
|
|
VinCode = itm.VinCode, |
|
|
|
|
|
//OrderNum = itm.OrderNum,
|
|
|
|
|
|
ErpToLoc = "C0001" |
|
|
|
|
|
}).ConfigureAwait(false); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
else if (type == "JisHBPO") |
|
|
else if (type == "JisHBPO") |
|
|
{ |
|
|
{ |
|
|