From 204c8d76b2adecab4cf5d70f57455457ef5d4233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Wed, 13 Sep 2023 09:02:23 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bases/BA_SERVICE.cs | 25 ++++----------- .../Bases/PD_SERVICE.cs | 16 ---------- .../Entities/BQ/BBAC_BA_SERVICE.cs | 14 ++------- .../Entities/BQ/BBAC_PD_SERVICE.cs | 31 +++++++++++++++++-- .../Entities/BQ/INVOICE_SERVICE.cs | 2 +- .../Entities/BQ/Managers/INV_MNG.cs | 3 +- .../Entities/BQ/Managers/INV_MNG_EXT.cs | 5 +-- .../src/SettleAccount.Domain/EnumBillState.cs | 24 ++++++++++++++ 8 files changed, 67 insertions(+), 53 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs index 3773b689..fc538ad2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs @@ -105,7 +105,6 @@ namespace Win.Sfs.SettleAccount.Bases [HttpPost] public virtual async Task GenerateInvoice(List p_invs) { - var issucess=await _invMng.SetForwardState(p_invs, SettleBillState.商务已审核); if (issucess == true) { @@ -122,11 +121,7 @@ namespace Win.Sfs.SettleAccount.Bases [HttpPost] public virtual async Task ReissueInvoice([FromBody] string input) { - - // await _invMng.SetForwardState(input.InvGroupNum, SettleBillState.商务已审核); - return new JsonResult(new { Code = 200, Message = "重开成功" }); - } /// /// 主表查询 @@ -144,7 +139,6 @@ namespace Win.Sfs.SettleAccount.Bases { itm.TaxAmtDiff = itm.TaxAmt + itm.TaxDiff; } - return new PagedResultDto(totalCount, dtos); } /// @@ -314,8 +308,6 @@ namespace Win.Sfs.SettleAccount.Bases { itm.TaxAmtDiff = itm.TaxAmt + itm.TaxDiff; } - - var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute()?.Name ?? typeof(INVOICE_GRP_DTO).Name; string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; byte[] result = null; @@ -354,12 +346,9 @@ namespace Win.Sfs.SettleAccount.Bases { return new JsonResult(new { Code = 200, Message = "退回成功" }); } - return new JsonResult(new { Code = 400, Message = "退回失败" }); } - [HttpPost] - public virtual async Task ReceivedAsync(List p_ins) { @@ -478,8 +467,7 @@ namespace Win.Sfs.SettleAccount.Bases { return true; } - throw new BusinessException("8989", "生成失败,请检查调整表和旧发票内容"); - + throw new BusinessException("8989", "生成失败,请检查调整表和旧发票内容"); } [UnitOfWork(false)] /// @@ -526,9 +514,11 @@ namespace Win.Sfs.SettleAccount.Bases - - - + /// + /// 检查是否有重复 + /// + /// 调整明细数据 + /// protected async Task> CheckRepeat(List p_list) { var errorlist = p_list.GroupBy(p => new { p.PN, p.LU }).Where(p => p.Count() > 1).Select(p => new { p.Key.PN, p.Key.LU }).ToList(); @@ -544,9 +534,6 @@ namespace Win.Sfs.SettleAccount.Bases } - - - /// /// 校验规则 /// 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 2d20047e..0dcbd774 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 @@ -138,8 +138,6 @@ namespace Win.Sfs.SettleAccount.Bases //[Route("generateinvoice")] public virtual async Task ApprovalPassed(List p_list) { - - return ApplicationConsts.SuccessStr; } /// @@ -164,21 +162,7 @@ namespace Win.Sfs.SettleAccount.Bases [HttpPost] public virtual async Task RejectAsync(TRequestMainInput input) { - - - - - - - - - - - - - return ApplicationConsts.SuccessStr; - } public virtual async Task GetMainAsync([FromBody] string billNum) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs index c32da713..00ba8d47 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs @@ -226,16 +226,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// public virtual async Task ReissueInvoiceExtend(List p_list) { - - - var errorlist = await CheckRepeat(p_list); + var errorlist = await CheckRepeat(p_list);//是否录入数据重复 if (errorlist.Count > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorlist) }); - } - var adjlist = ObjectMapper.Map, List>(p_list); if (adjlist == null && adjlist.Count == 0) { @@ -243,18 +238,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } var first = p_list.FirstOrDefault(); var invbillnum = first.InvBillNum; - var version=int.Parse(DateTime.Now.ToString("yyyymm")); - var inv= await GetInvoiceGroupByInvBillNum(invbillnum); - var settle =await _bbacMng.GetMainAsync(inv.InvGroupNum); - if(settle==null) { throw new UserFriendlyException( $"选择发票:{invbillnum}对应的可结算单不粗拿在在请检查!", "400"); } - version=settle.Version; if (inv != null) { @@ -298,7 +288,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); //var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList(); //var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算 - var priceList = _priceRepository.ToList();//价格单 + var priceList = _priceRepository.Where(p => p.ClientCode == inv.Site && p.IsCancel == false).ToList();//价格单 //var errorList =await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); //if (errorList.Count() > 0) //{ diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs index f0f6b483..9f22e696 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs @@ -1,5 +1,5 @@ using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Components; +//using Microsoft.AspNetCore.Components; using SettleAccount.Domain.BQ; using SettleAccount.Job.Services.Report; using SettleAccount.Job.Services; @@ -23,6 +23,7 @@ using Win.Sfs.SettleAccount.Entities.TaskJobs; using Volo.Abp.Uow; using Volo.Abp; using EFCore.BulkExtensions; +using Microsoft.AspNetCore.Mvc; namespace Win.Sfs.SettleAccount.Entities.BQ { @@ -70,7 +71,33 @@ namespace Win.Sfs.SettleAccount.Entities.BQ }); return _taskid; - } + //[HttpPost] + //public virtual async Task RejectAsync(List p_list) + //{ + // var detailist = _detailRepository.Where(p => p_list.Contains(p.BillNum)).ToList(); + // List customConditionList = new List(); + // customConditionList.Add(new CustomCondition() { Name = "BillNumList", Value = string.Join(",", p_list) }); + // customConditionList.Add(new CustomCondition() { Name = "Type", Value = EnumBusinessType.JisBBAC.ToString() }); + // customConditionList.Add(new CustomCondition() { Name = "IsOut", Value = "out" }); + // var ls = _repository.Where(p => p_list.Contains(p.BillNum)).ToList(); + // var lst = ls.Where(p => (p.State == SettleBillState.已提交扣减 || p.State == SettleBillState.已扣减)); + // if (lst.Count() > 0) + // { + // throw new UserFriendlyException("当前状态是已提交状态,不能重复已提交", "400"); + // } + // foreach (var item in ls) + // { + // item.State = SettleBillState.已提交扣减; + // } + // await _repository.DbContext.BulkUpdateAsync(ls); + // var _taskid = await _service.ExportEnqueueAsync("BBAC待扣减任务", ExportExtentsion.Excel, DateTime.Now.ToString("yyyyMM"), string.Empty, CurrentUser, typeof(PendingDeductionService), customConditionList, (rs) => + // { + // }); + // return _taskid; + + //} + + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs index f050dcd5..59f3b0aa 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs @@ -655,7 +655,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //inv.TaxAmt = inv.Amt+ Math.Round(inv.Amt * newinv.Tax, 2); inv.RealnvBillNum = newinv.RealnvBillNum; // inv.RealAmt = newinv.RealAmt; - inv.TaxDiff =inv.TaxAmt+ newinv.PreTaxDiff; + inv.TaxDiff =newinv.PreTaxDiff; // inv.ClientCode = newinv.ClientCode; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs index 1dc172fd..d1d9b4f9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs @@ -1376,6 +1376,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers foreach (var detail in adjdetails) { detail.InvBillNum = key; + adjlist.Add(detail); } } var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.PartCode, p.Price, p.BeginDate, p.EndDate, p.ContractDocID, p.LU }) @@ -1916,7 +1917,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers foreach (var detail in adjdetails) { detail.InvBillNum = key; - adjdetails.Add(detail); + adjlist.Add(detail); } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs index a3af7837..f0b5878d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs @@ -577,6 +577,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } return detailList; } + [UnitOfWork(false)] /// /// 第一次开票 /// @@ -675,7 +676,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers foreach (var detail in adjdetails) { detail.InvBillNum = key; - adjdetails.Add(detail); + } } var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.PartCode, p.Price, p.BeginDate, p.EndDate, p.ContractDocID,p.LU }) @@ -942,7 +943,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers foreach (var detail in adjdetails) { detail.InvBillNum = key; - adjdetails.Add(detail); + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs index 45ba3486..dadd788a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs @@ -34,6 +34,30 @@ namespace Win.Sfs.SettleAccount 已提交扣减 = 6 } + public enum PDBillState + { + + [Description("新建")] + 新建 = 4, + [Description("已扣减")] + 已扣减 = 5, + [Description("已提交扣减")] + 已提交扣减 = 6, + [Description("已提交反结")] + 已提交反结 = 7 + } + + + + + + + + + + + + public enum InvoiceBillState { [Description("在用")] From 69f8da31cdbec62a27cd21c3814db63a5ea466cd Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Wed, 13 Sep 2023 09:04:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=89=8D=E7=AB=AFbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wwwroot/components/table/index.js | 2 +- .../wwwroot/models/input/jie-suan.js | 8 ++++---- .../wwwroot/views/settle/_check.js | 14 +++++++------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js index 600f5437..6b5e29aa 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js @@ -39,7 +39,7 @@ export default {
- +
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/input/jie-suan.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/input/jie-suan.js index 9d6bd941..ed1229f6 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/input/jie-suan.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/input/jie-suan.js @@ -1,12 +1,12 @@ import businessType, { version, state } from "../_options.js"; -export default function (businessType, meta) { +export default function (type, meta) { let service = null; let detailService = null; - if (businessType === "JisBBAC" || businessType === "MaiDanJianBBAC") { + if (type === "JisBBAC" || type === "MaiDanJianBBAC") { service = "bbac_sa_service"; detailService = "bbac_sa_detail_service"; - } else if (businessType === "JisHBPO" || businessType === "MaiDanJianHBPO") { + } else if (type === "JisHBPO" || type === "MaiDanJianHBPO") { service = "hbpo_sa_service"; detailService = "hbpo_sa_detail_service"; } else { @@ -100,7 +100,7 @@ export default function (businessType, meta) { { label: 1046, value: 1046 }, ], input: "select", - hidden: true, + hideForList: true, default: meta.client === "bbac-1040" ? 1040 : 1046, }; querySchema.properties.filters.default.push({ diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js index 8b509301..c5ad76ec 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js @@ -63,8 +63,8 @@ export default { -
-
+
+
新建 @@ -80,7 +80,7 @@ export default {
-
+
@@ -94,7 +94,7 @@ export default {
-
+
@@ -117,7 +117,7 @@ export default {
-
+
@@ -488,7 +488,7 @@ export default { }, }; const defaultAdjModel = schemaToModel(adjSchema); - const adjModel = ref(Object.assign({ invBillNum: "" }, defaultAdjModel)); + const adjModel = ref(null); const addAdjFormRef = ref(null); const showAddAdjDialog = () => { adjModel.value = Object.assign({}, defaultAdjModel); @@ -498,7 +498,7 @@ export default { try { const valid = await addAdjFormRef.value.validate(); if (valid) { - adjList.value.unshift(adjModel.value); + adjList.value.unshift(Object.assign({}, adjModel.value)); addDialogVisible.value = false; nextTick(() => { scrollRef.value.update();