Browse Source

增加RealPN和退货处理

master
zhouhongjun 11 months ago
parent
commit
7ba3010e20
  1. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
  2. 16
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs
  3. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs
  4. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs
  5. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs
  6. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs

@ -160,6 +160,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
importBBACSaDetail.Version = Version; importBBACSaDetail.Version = Version;
importBBACSaDetail.Site = Site; importBBACSaDetail.Site = Site;
importBBACSaDetail.BusinessType = importBBACSaDetail.PN.Contains("R0") ? EnumBusinessType.MaiDanJianBBAC : EnumBusinessType.JisBBAC; importBBACSaDetail.BusinessType = importBBACSaDetail.PN.Contains("R0") ? EnumBusinessType.MaiDanJianBBAC : EnumBusinessType.JisBBAC;
importBBACSaDetail.RealPN = importBBACSaDetail.PN;
}); });
var jisSaDetails = importBBACSaDetails.FindAll(t => t.BusinessType == EnumBusinessType.JisBBAC); var jisSaDetails = importBBACSaDetails.FindAll(t => t.BusinessType == EnumBusinessType.JisBBAC);
@ -171,6 +172,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
*/ */
maiDanSaDetails.ForEach(maiDanSaDetail => maiDanSaDetails.ForEach(maiDanSaDetail =>
{ {
//maiDanSaDetail.RealPN = maiDanSaDetail.PN;
maiDanSaDetail.ProductionCodeType = maiDanSaDetail.PN[^2..]; maiDanSaDetail.ProductionCodeType = maiDanSaDetail.PN[^2..];
maiDanSaDetail.PN = maiDanSaDetail.PN[..7]; maiDanSaDetail.PN = maiDanSaDetail.PN[..7];
}); });

16
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs

@ -124,6 +124,22 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
await db.BulkUpdateAsync<BBAC_SE_EDI>(ediFlagErrEntities).ConfigureAwait(false); await db.BulkUpdateAsync<BBAC_SE_EDI>(ediFlagErrEntities).ConfigureAwait(false);
} }
} }
var seReturnUpdateQuery = db.Set<BBAC_SE_DETAIL>().FromSqlRaw("select distinct b.* from (select * FROM [BQ_SA].[dbo].[Set_BBAC_SE_DETAIL] where TransType=-1 and Remark is null and BusinessType=1) a left join [BQ_SA].[dbo].[Set_BBAC_SE_DETAIL] b on a.PN=b.PN and a.LU=b.LU where b.TransType=1 and b.BusinessType=1 and b.ProType in (3,7,0) and b.IsDeleted=0");
var seReturnUpdateEntities = seReturnUpdateQuery.ToList();
if (seReturnUpdateEntities.Count > 0)
{
seReturnUpdateEntities.ForEach(t => t.IsDeleted = true);
await db.BulkUpdateAsync<BBAC_SE_DETAIL>(seReturnUpdateEntities).ConfigureAwait(false);
}
var hbpoReturnUpdateQuery = db.Set<HBPO_SE_DETAIL>().FromSqlRaw("select distinct b.* from (select * FROM [BQ_SA].[dbo].[Set_HBPO_SE_DETAIL] where TransType=-1 and Remark is null and BusinessType=2) a left join [BQ_SA].[dbo].[Set_HBPO_SE_DETAIL] b on a.PN=b.PN and a.LU=b.LU where b.TransType=1 and b.BusinessType=2 and b.ProType in (3,7,0) and b.IsDeleted=0");
var hbpoReturnUpdateEntities = hbpoReturnUpdateQuery.ToList();
if (hbpoReturnUpdateEntities.Count > 0)
{
hbpoReturnUpdateEntities.ForEach(t => t.IsDeleted = true);
await db.BulkUpdateAsync<HBPO_SE_DETAIL>(hbpoReturnUpdateEntities).ConfigureAwait(false);
}
} }
/// <summary> /// <summary>

12
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs

@ -342,6 +342,10 @@ namespace SettleAccount.Bases
/// </summary> /// </summary>
public virtual string PN { get; set; } public virtual string PN { get; set; }
/// <summary> /// <summary>
/// 真实生產號
/// </summary>
public virtual string RealPN { get; set; }
/// <summary>
/// 組合鍵值(LU+PN) /// 組合鍵值(LU+PN)
/// </summary> /// </summary>
public virtual string KeyCode { get; set; } public virtual string KeyCode { get; set; }
@ -408,6 +412,10 @@ namespace SettleAccount.Bases
/// </summary> /// </summary>
public string PN { get; set; } public string PN { get; set; }
/// <summary> /// <summary>
/// 真实生產號
/// </summary>
public virtual string RealPN { get; set; }
/// <summary>
/// 組合鍵值(LU+PN) /// 組合鍵值(LU+PN)
/// </summary> /// </summary>
public string KeyCode { get; set; } public string KeyCode { get; set; }
@ -486,6 +494,10 @@ namespace SettleAccount.Bases
/// </summary> /// </summary>
public string PN { get; set; } public string PN { get; set; }
/// <summary> /// <summary>
/// 真实生產號
/// </summary>
public virtual string RealPN { get; set; }
/// <summary>
/// 組合鍵值(LU+PN) /// 組合鍵值(LU+PN)
/// </summary> /// </summary>
public string KeyCode { get; set; } public string KeyCode { get; set; }

2
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>() var seGroup = (from se in _settleAccountDbContext.Set<BBAC_SE_DETAIL>()
where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State==0 where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State==0 && se.IsDeleted == false
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new select new
{ {

2
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>() var seGroup = (from se in _settleAccountDbContext.Set<HBPO_SE_DETAIL>()
where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State == 0 where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State == 0 && se.IsDeleted == false
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new select new
{ {

5
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs

@ -97,10 +97,11 @@ namespace SettleAccount.Job.Services.Report
//无EDI有发运 //无EDI有发运
var notHaveEdiHaveSeList = _settleAccountDbContext.Set<TSe>() var notHaveEdiHaveSeList = _settleAccountDbContext.Set<TSe>()
.Where(t => t.BusinessType == businessType && t.BillTime >= seStartDateTime && t.BillTime <= seEndDateTime) .Where(t => t.BusinessType == businessType && t.BillTime >= seStartDateTime && t.BillTime <= seEndDateTime && t.TransType == EnumDelTransType.)
.Where(t=>t.State==0) .Where(t=>t.State==0)
.Where(t => proType.Contains(t.ProType)) .Where(t => proType.Contains(t.ProType))
.Where(t => t.IsHaveEdiData == false) .Where(t => t.IsHaveEdiData == false)
.Where(t => t.IsDeleted == false)
.GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace })
.Select(t => new TCompareReport() .Select(t => new TCompareReport()
{ {
@ -135,7 +136,7 @@ namespace SettleAccount.Job.Services.Report
LineStationCode = groupItem.Max(t => t.LineStationCode) LineStationCode = groupItem.Max(t => t.LineStationCode)
}; };
var seGroup = from se in _settleAccountDbContext.Set<TSe>() var seGroup = from se in _settleAccountDbContext.Set<TSe>()
where se.BusinessType == businessType && se.IsHaveEdiData == true && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State==0 && proType.Contains(se.ProType) where se.BusinessType == businessType && se.IsHaveEdiData == true && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State==0 && proType.Contains(se.ProType) && se.IsDeleted == false && se.TransType == EnumDelTransType.
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new select new
{ {

Loading…
Cancel
Save