Browse Source

Qad发票增加发票时间显示

master
zhouhongjun 10 months ago
parent
commit
2420216847
  1. 4
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/sync.js
  2. 34
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs

4
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/sync.js

@ -7,6 +7,10 @@ export default function () {
type: "object",
properties: {
taskState,
creationTime: {
title: "发票时间",
type: "datetime",
},
taskId: {
title: "任务Id",
type: "string",

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

@ -94,24 +94,26 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
{
await transaction.RollbackAsync().ConfigureAwait(false);
}
}
//var ediReturnQuery = db.Set<BBAC_SE_DETAIL>().FromSqlRaw("SELECT a.* FROM Set_BBAC_SE_DETAIL a right join (SELECT PN,CustomerPartCodeNoSpace,sum(Qty) as Qty FROM Set_BBAC_SE_DETAIL group by PN,CustomerPartCodeNoSpace having sum(Qty)=0) b on a.PN=b.PN and a.CustomerPartCodeNoSpace=b.CustomerPartCodeNoSpace");
var ediReturnQuery = db.Set<BBAC_SE_EDI>().FromSqlRaw("select * from (SELECT a.* FROM [dbo].[Set_BBAC_SE_EDI] a right join (SELECT PN,CustomerPartCodeNoSpace,sum(Qty) as Qty FROM Set_BBAC_SE_DETAIL where BusinessType=1 group by PN,CustomerPartCodeNoSpace having sum(Qty)=0) b on a.PN=b.PN and a.CustomerPartCodeNoSpace=b.CustomerPartCodeNoSpace and a.IsHaveSeData=1) c where c.id is not null");
var ediReturnEntities = ediReturnQuery.ToList();
if(ediReturnEntities.Count>0)
{
ediReturnEntities.ForEach(t => t.IsHaveSeData = false);
await db.BulkUpdateAsync<BBAC_SE_EDI>(ediReturnEntities).ConfigureAwait(false);
}
var seReturnQuery = db.Set<BBAC_SE_DETAIL>().FromSqlRaw("select * from (SELECT a.* FROM [dbo].[Set_BBAC_SE_DETAIL] a right join (select PN,CustomerPartCodeNoSpace,COUNT(*) as hj,sum(Qty) as Qty,sum(CAST(IsHaveEdiData AS int)) as haveedi from Set_BBAC_SE_DETAIL where BusinessType=1 group by PN,CustomerPartCodeNoSpace having count(*)>sum(CAST(IsHaveEdiData AS int)) and count(*)>=3 and sum(CAST(IsHaveEdiData AS int))>=1) b on a.PN=b.PN and a.CustomerPartCodeNoSpace=b.CustomerPartCodeNoSpace and a.IsHaveEdiData=0) c where c.id is not null ");
var seReturnEntities = seReturnQuery.ToList();
if (seReturnEntities.Count > 0)
{
seReturnEntities.ForEach(t => t.IsHaveEdiData = true);
await db.BulkUpdateAsync<BBAC_SE_DETAIL>(seReturnEntities).ConfigureAwait(false);
//var ediReturnQuery = db.Set<BBAC_SE_DETAIL>().FromSqlRaw("SELECT a.* FROM Set_BBAC_SE_DETAIL a right join (SELECT PN,CustomerPartCodeNoSpace,sum(Qty) as Qty FROM Set_BBAC_SE_DETAIL group by PN,CustomerPartCodeNoSpace having sum(Qty)=0) b on a.PN=b.PN and a.CustomerPartCodeNoSpace=b.CustomerPartCodeNoSpace");
var ediReturnQuery = db.Set<BBAC_SE_EDI>().FromSqlRaw("select * from (SELECT a.* FROM [dbo].[Set_BBAC_SE_EDI] a right join (SELECT PN,CustomerPartCodeNoSpace,sum(Qty) as Qty FROM Set_BBAC_SE_DETAIL where BusinessType=1 group by PN,CustomerPartCodeNoSpace having sum(Qty)=0) b on a.PN=b.PN and a.CustomerPartCodeNoSpace=b.CustomerPartCodeNoSpace and a.IsHaveSeData=1) c where c.id is not null");
var ediReturnEntities = ediReturnQuery.ToList();
if (ediReturnEntities.Count > 0)
{
ediReturnEntities.ForEach(t => t.IsHaveSeData = false);
await db.BulkUpdateAsync<BBAC_SE_EDI>(ediReturnEntities).ConfigureAwait(false);
}
var seReturnQuery = db.Set<BBAC_SE_DETAIL>().FromSqlRaw("select * from (SELECT a.* FROM [dbo].[Set_BBAC_SE_DETAIL] a right join (select PN,CustomerPartCodeNoSpace,COUNT(*) as hj,sum(Qty) as Qty,sum(CAST(IsHaveEdiData AS int)) as haveedi from Set_BBAC_SE_DETAIL where BusinessType=1 group by PN,CustomerPartCodeNoSpace having count(*)>sum(CAST(IsHaveEdiData AS int)) and count(*)>=3 and sum(CAST(IsHaveEdiData AS int))>=1) b on a.PN=b.PN and a.CustomerPartCodeNoSpace=b.CustomerPartCodeNoSpace and a.IsHaveEdiData=0) c where c.id is not null ");
var seReturnEntities = seReturnQuery.ToList();
if (seReturnEntities.Count > 0)
{
seReturnEntities.ForEach(t => t.IsHaveEdiData = true);
await db.BulkUpdateAsync<BBAC_SE_DETAIL>(seReturnEntities).ConfigureAwait(false);
}
}
}

Loading…
Cancel
Save