diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/sync.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/sync.js index 807a1b75..d08be8ed 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/sync.js +++ b/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", diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/log.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/log.js index 15b9f7bd..f09dbd84 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/log.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/log.js @@ -54,21 +54,21 @@ export default function () { default: [ { logic: "and", - column: "changedTime", + column: "billTime", action: "biggerThanOrEqual", value: null, readOnly: true, - title: "变动开始", + title: "发运开始", default: dayjs().subtract(1, "month").startOf("day").format("YYYY-MM-DD HH:mm:ss"), clearable: false, }, { logic: "and", - column: "changedTime", + column: "billTime", action: "smallThan", value: null, readOnly: true, - title: "变动结束", + title: "发运结束", default: dayjs().startOf("day").format("YYYY-MM-DD HH:mm:ss"), clearable: false, }, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs index 4f272903..2529d035 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs @@ -280,6 +280,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [ExporterHeader(DisplayName = "发货人")] public string Oper { get; set; } + /// + /// 数量 + /// + [Display(Name = "数量")] + [ExporterHeader(DisplayName = "数量")] + public decimal Qty { get; set; } + /// /// 排序单号 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs index 507d2769..bf89d3ef 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs @@ -280,6 +280,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [ExporterHeader(DisplayName = "发货人")] public string Oper { get; set; } + /// + /// 数量 + /// + [Display(Name = "数量")] + [ExporterHeader(DisplayName = "数量")] + public decimal Qty { get; set; } + /// /// 排序单号 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs index 2ff046cf..02c75ed1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs @@ -287,13 +287,28 @@ namespace Win.Sfs.SettleAccount.Bases //[Route("mainquery")] public virtual async Task> MainQueryAsync(TRequestMainInput input) { + var invs= await _invRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false); + var invbills = invs.Select(p => p.InvbillNum).ToList(); + var entitys = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false); + + entitys=entitys.Where(p => invbills.Contains(p.BillNum)).ToList(); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entitys); + + + dtos = dtos.Where(p => invbills.Contains(p.BillNum)).ToList(); + + + + var entity= entitys.FirstOrDefault(); var invoices =entitys.Select(p => p.BillNum); var entities=_invRepository.Where(p => invoices.Contains(p.InvbillNum)).ToList(); + + foreach (var itm in dtos) { var pd = entities.FirstOrDefault(p => p.InvbillNum == itm.BillNum); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs index 8a82159f..c20759b5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs @@ -94,17 +94,27 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { await transaction.RollbackAsync().ConfigureAwait(false); } - - } - //var ediReturnQuery = db.Set().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().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 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(ediReturnEntities).ConfigureAwait(false); + + //var ediReturnQuery = db.Set().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().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(ediReturnEntities).ConfigureAwait(false); + } + + var seReturnQuery = db.Set().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(seReturnEntities).ConfigureAwait(false); + } + } - + + } /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs index 49fc92ef..c7cd7b74 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Volo.Abp.Uow; +using Volo.Abp.Validation; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.EntityFrameworkCore; @@ -39,6 +40,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs /// /// 执行JisHBPO发运同步 /// + [DisableValidation] [UnitOfWork(IsDisabled = true)] public virtual async Task Invoke(IServiceProvider serviceProvider) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs index 147a3e6c..7fdc2d2a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs @@ -350,7 +350,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs } foreach (var item in bbacinvList) { - if (item.State == SettleBillState.已提交QAD) { item.State = SettleBillState.红冲发票;