Browse Source

三方比对增加状态判断

master
zhouhongjun 10 months ago
parent
commit
15c0ee1acf
  1. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/CompareService.cs
  2. 260
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
  3. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs
  4. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs
  5. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs
  6. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs
  7. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs

6
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/CompareService.cs

@ -105,7 +105,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = saSeCompareRequestDto.Version });
customConditionList.Add(new CustomCondition() { Name = "BusinessType", Value = ((int)saSeCompareRequestDto.BusinessType).ToString() });
customConditionList.Add(new CustomCondition() { Name = "SeStartDateTime", Value = DateTime.MinValue.ToString("yyyy-MM-dd 00:00:00") });
//customConditionList.Add(new CustomCondition() { Name = "SeStartDateTime", Value = DateTime.MinValue.ToString("yyyy-MM-dd 00:00:00") });
customConditionList.Add(new CustomCondition() { Name = "SeStartDateTime", Value = "2023-09-25 00:00:00" });
customConditionList.Add(new CustomCondition() { Name = "SeEndDateTime", Value = saSeCompareRequestDto.SeEndDateTime?.ToString("yyyy-MM-dd 23:59:59") });
customConditionList.Add(new CustomCondition() { Name = "LU", Value = saSeCompareRequestDto.LU });
customConditionList.Add(new CustomCondition() { Name = "PN", Value = saSeCompareRequestDto.PN });

260
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

@ -801,6 +801,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var logList = tupleList.Select(o => o.Item1).ToList();
logList.AsParallel().ForEach(Update);
List<BBAC_SE_DETAIL> seDetails = new List<BBAC_SE_DETAIL>();
List<HBPO_SE_DETAIL> hbpo_seDetails=new List<HBPO_SE_DETAIL>();
List<PUB_SE_DETAIL> pub_seDetails=new List<PUB_SE_DETAIL>();
foreach (var item in logList)
{
if(item.DeliverBillType== EnumDeliverBjBmpBillType.JIS件&&item.DeliverSubBillType== EnumDeliverSubBillType.BBAC)
@ -838,7 +841,259 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
seDetails.Add(seDetail);
}
if (item.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && item.DeliverSubBillType == EnumDeliverSubBillType.BBAC)
{
BBAC_SE_DETAIL seDetail = new BBAC_SE_DETAIL();
seDetail.SetId(item.Id);
seDetail.BeginDate = DateTime.Now;
seDetail.CreationTime = DateTime.Now;
seDetail.IsDeleted = false;
seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM"));
seDetail.ShippingDate = (DateTime)item.BillTime;
seDetail.Qty = item.Qty;
seDetail.IsHaveEdiData = false;
seDetail.BusinessType = EnumBusinessType.MaiDanJianBBAC;
seDetail.AssembleData = (DateTime)item.AssembleData;
seDetail.BillType = 0;
seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType;
seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType;
seDetail.ProType = 0;
seDetail.State = 0;
seDetail.SubBillType = 0;
seDetail.TransType = EnumDelTransType.;
seDetail.UID = 000;
seDetail.FactoryPartCode = item.RealPartCode;
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", "");
seDetail.ErpToLoc = item.ErpToLoc;
seDetail.Qty = item.Qty;
seDetail.VinCode = item.VinCode;
seDetail.PN = item.VinCode;
seDetail.LU = item.CustPartCode;
seDetail.CustPartCode = item.CustPartCode;
seDetail.BillTime = item.BillTime;
seDetail.Remark = "期初初始化";
seDetails.Add(seDetail);
}
if (item.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && item.DeliverSubBillType == EnumDeliverSubBillType.HBPO)
{
HBPO_SE_DETAIL seDetail = new HBPO_SE_DETAIL();
seDetail.SetId(item.Id);
seDetail.BeginDate = DateTime.Now;
seDetail.CreationTime = DateTime.Now;
seDetail.IsDeleted = false;
seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM"));
seDetail.ShippingDate = (DateTime)item.BillTime;
seDetail.Qty = item.Qty;
seDetail.IsHaveEdiData = false;
seDetail.BusinessType = EnumBusinessType.JisHBPO;
seDetail.AssembleData = (DateTime)item.AssembleData;
seDetail.BillType = 0;
seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType;
seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType;
seDetail.ProType = 0;
seDetail.State = 0;
seDetail.SubBillType = 0;
seDetail.TransType = EnumDelTransType.;
seDetail.UID = 000;
seDetail.FactoryPartCode = item.RealPartCode;
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", "");
seDetail.ErpToLoc = item.ErpToLoc;
seDetail.Qty = item.Qty;
seDetail.VinCode = item.VinCode;
seDetail.PN = item.VinCode;
seDetail.LU = item.CustPartCode;
seDetail.CustPartCode = item.CustPartCode;
seDetail.BillTime = item.BillTime;
seDetail.Remark = "期初初始化";
hbpo_seDetails.Add(seDetail);
}
if (item.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && item.DeliverSubBillType == EnumDeliverSubBillType.HBPO)
{
HBPO_SE_DETAIL seDetail = new HBPO_SE_DETAIL();
seDetail.SetId(item.Id);
seDetail.BeginDate = DateTime.Now;
seDetail.CreationTime = DateTime.Now;
seDetail.IsDeleted = false;
seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM"));
seDetail.ShippingDate = (DateTime)item.BillTime;
seDetail.Qty = item.Qty;
seDetail.IsHaveEdiData = false;
seDetail.BusinessType = EnumBusinessType.MaiDanJianHBPO;
seDetail.AssembleData = (DateTime)item.AssembleData;
seDetail.BillType = 0;
seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType;
seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType;
seDetail.ProType = 0;
seDetail.State = 0;
seDetail.SubBillType = 0;
seDetail.TransType = EnumDelTransType.;
seDetail.UID = 000;
seDetail.FactoryPartCode = item.RealPartCode;
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", "");
seDetail.ErpToLoc = item.ErpToLoc;
seDetail.Qty = item.Qty;
seDetail.VinCode = item.VinCode;
seDetail.PN = item.VinCode;
seDetail.LU = item.CustPartCode;
seDetail.CustPartCode = item.CustPartCode;
seDetail.BillTime = item.BillTime;
seDetail.Remark = "期初初始化";
hbpo_seDetails.Add(seDetail);
}
if (item.DeliverBillType == EnumDeliverBjBmpBillType.JIT直供件 && item.DeliverSubBillType == EnumDeliverSubBillType.JIT直供件BBAC)
{
PUB_SE_DETAIL seDetail = new PUB_SE_DETAIL();
seDetail.SetId(item.Id);
seDetail.BeginDate = DateTime.Now;
seDetail.CreationTime = DateTime.Now;
seDetail.IsDeleted = false;
seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM"));
seDetail.ShippingDate = (DateTime)item.BillTime;
seDetail.Qty = item.Qty;
//seDetail.IsHaveEdiData = false;
seDetail.BusinessType = EnumBusinessType.ZhiGongJianBBAC;
seDetail.AssembleData = (DateTime)item.AssembleData;
seDetail.BillType = 0;
seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType;
seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType;
seDetail.ProType = 0;
seDetail.State = 0;
seDetail.SubBillType = 0;
seDetail.TransType = EnumDelTransType.;
seDetail.UID = 000;
seDetail.FactoryPartCode = item.RealPartCode;
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", "");
seDetail.ToErpLocCode = item.ErpToLoc;
seDetail.Qty = item.Qty;
//seDetail.VinCode = item.VinCode;
seDetail.PN = item.VinCode;
seDetail.LU = item.CustPartCode;
seDetail.CustPartCode = item.CustPartCode;
seDetail.BillTime = item.BillTime;
seDetail.Remark = "期初初始化";
pub_seDetails.Add(seDetail);
}
if (item.DeliverBillType == EnumDeliverBjBmpBillType.JIT直供件 && item.DeliverSubBillType == EnumDeliverSubBillType.JIT直供件HBPO)
{
PUB_SE_DETAIL seDetail = new PUB_SE_DETAIL();
seDetail.SetId(item.Id);
seDetail.BeginDate = DateTime.Now;
seDetail.CreationTime = DateTime.Now;
seDetail.IsDeleted = false;
seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM"));
seDetail.ShippingDate = (DateTime)item.BillTime;
seDetail.Qty = item.Qty;
//seDetail.IsHaveEdiData = false;
seDetail.BusinessType = EnumBusinessType.ZhiGongJianHBPO;
seDetail.AssembleData = (DateTime)item.AssembleData;
seDetail.BillType = 0;
seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType;
seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType;
seDetail.ProType = 0;
seDetail.State = 0;
seDetail.SubBillType = 0;
seDetail.TransType = EnumDelTransType.;
seDetail.UID = 000;
seDetail.FactoryPartCode = item.RealPartCode;
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", "");
seDetail.ToErpLocCode = item.ErpToLoc;
seDetail.Qty = item.Qty;
//seDetail.VinCode = item.VinCode;
seDetail.PN = item.VinCode;
seDetail.LU = item.CustPartCode;
seDetail.CustPartCode = item.CustPartCode;
seDetail.BillTime = item.BillTime;
seDetail.Remark = "期初初始化";
pub_seDetails.Add(seDetail);
}
if (item.DeliverBillType == EnumDeliverBjBmpBillType.4S备件 && item.DeliverSubBillType == EnumDeliverSubBillType.4S备件BBAC)
{
PUB_SE_DETAIL seDetail = new PUB_SE_DETAIL();
seDetail.SetId(item.Id);
seDetail.BeginDate = DateTime.Now;
seDetail.CreationTime = DateTime.Now;
seDetail.IsDeleted = false;
seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM"));
seDetail.ShippingDate = (DateTime)item.BillTime;
seDetail.Qty = item.Qty;
//seDetail.IsHaveEdiData = false;
seDetail.BusinessType = EnumBusinessType.BeiJian;
seDetail.AssembleData = (DateTime)item.AssembleData;
seDetail.BillType = 0;
seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType;
seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType;
seDetail.ProType = 0;
seDetail.State = 0;
seDetail.SubBillType = 0;
seDetail.TransType = EnumDelTransType.;
seDetail.UID = 000;
seDetail.FactoryPartCode = item.RealPartCode;
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", "");
seDetail.ToErpLocCode = item.ErpToLoc;
seDetail.Qty = item.Qty;
//seDetail.VinCode = item.VinCode;
seDetail.PN = item.VinCode;
seDetail.LU = item.CustPartCode;
seDetail.CustPartCode = item.CustPartCode;
seDetail.BillTime = item.BillTime;
seDetail.Remark = "期初初始化";
pub_seDetails.Add(seDetail);
}
if (item.DeliverBillType == EnumDeliverBjBmpBillType. && item.DeliverSubBillType == EnumDeliverSubBillType.BBAC)
{
PUB_SE_DETAIL seDetail = new PUB_SE_DETAIL();
seDetail.SetId(item.Id);
seDetail.BeginDate = DateTime.Now;
seDetail.CreationTime = DateTime.Now;
seDetail.IsDeleted = false;
seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM"));
seDetail.ShippingDate = (DateTime)item.BillTime;
seDetail.Qty = item.Qty;
//seDetail.IsHaveEdiData = false;
seDetail.BusinessType = EnumBusinessType.YinDuJian;
seDetail.AssembleData = (DateTime)item.AssembleData;
seDetail.BillType = 0;
seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType;
seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType;
seDetail.ProType = 0;
seDetail.State = 0;
seDetail.SubBillType = 0;
seDetail.TransType = EnumDelTransType.;
seDetail.UID = 000;
seDetail.FactoryPartCode = item.RealPartCode;
seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", "");
seDetail.ToErpLocCode = item.ErpToLoc;
seDetail.Qty = item.Qty;
//seDetail.VinCode = item.VinCode;
seDetail.PN = item.VinCode;
seDetail.LU = item.CustPartCode;
seDetail.CustPartCode = item.CustPartCode;
seDetail.BillTime = item.BillTime;
seDetail.Remark = "期初初始化";
pub_seDetails.Add(seDetail);
}
}
@ -864,6 +1119,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
await context.BulkInsertAsync(logList).ConfigureAwait(false);
//await context.BulkInsertAsync(messageList).ConfigureAwait(false);
await context.BulkInsertAsync(seDetails).ConfigureAwait(false);
await context.BulkInsertAsync(hbpo_seDetails).ConfigureAwait(false);
await context.BulkInsertAsync(pub_seDetails).ConfigureAwait(false);
transaction.Commit();
}
catch (Exception ex)

4
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs

@ -157,7 +157,7 @@ namespace SettleAccount.Job.Services.Report
};
//发运
var seGroup = (from se in _settleAccountDbContext.Set<BBAC_SE_DETAIL>()
where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime
where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State==0
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new
{
@ -173,7 +173,7 @@ namespace SettleAccount.Job.Services.Report
}).Where(t => t.Qty != 0M);
//Edi
var ediGroup = from edi in _settleAccountDbContext.Set<BBAC_SE_EDI>()
where edi.IsDeleted == false && edi.IsHaveSeData == true
where edi.IsDeleted == false && edi.IsHaveSeData == true && edi.State == 0
group edi by new { edi.PN, edi.CustomerPartCodeNoSpace } into groupItem
select new
{

4
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs

@ -152,7 +152,7 @@ namespace SettleAccount.Job.Services.Report
};
//发运
var seGroup = (from se in _settleAccountDbContext.Set<HBPO_SE_DETAIL>()
where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime
where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State == 0
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new
{
@ -168,7 +168,7 @@ namespace SettleAccount.Job.Services.Report
}).Where(t => t.Qty != 0M);
//Edi
var ediGroup = from edi in _settleAccountDbContext.Set<HBPO_SE_EDI>()
where edi.IsDeleted == false && edi.IsHaveSeData == true
where edi.IsDeleted == false && edi.IsHaveSeData == true && edi.State == 0
group edi by new { edi.PN, edi.CustomerPartCodeNoSpace } into groupItem
select new
{

2
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs

@ -203,7 +203,7 @@ namespace SettleAccount.Job.Services.Report
};
//发运
var seGroup = (from se in _settleAccountDbContext.Set<BBAC_SE_DETAIL>()
where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime
where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State == 0
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new
{

2
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs

@ -252,7 +252,7 @@ namespace SettleAccount.Job.Services.Report
};
//发运
var seGroup = (from se in _settleAccountDbContext.Set<PUB_SE_DETAIL>()
where se.BusinessType == businessType
where se.BusinessType == businessType && se.State==0
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new
{

2
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs

@ -95,7 +95,7 @@ namespace SettleAccount.Job.Services.Report
};
//发运
var seGroup = (from se in _settleAccountDbContext.Set<TSeDetail>()
where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime
where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State == 0
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new
{

Loading…
Cancel
Save