From 8a7cef051d39c4ec1c139dd8cc6679ba637bdc4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Thu, 24 Aug 2023 16:40:27 +0800 Subject: [PATCH 1/6] =?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 --- .../Entities/BQ/Dtos/BBAC_PD_DTO.cs | 18 +----- .../Entities/BQ/Dtos/INVOICE_GRP_DTO.cs | 4 +- .../Entities/BQ/BBAC_CAN_SA_SERVICE.cs | 5 +- .../SettleAccount.Domain/Bases/EntityBase.cs | 9 ++- .../Entities/BQ/BBAC_CAN_SA.cs | 3 + .../Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs | 1 + .../Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs | 1 + .../Entities/BQ/Managers/INV_MNG.cs | 59 +++++++++++++------ .../Entities/BQ/Managers/PUB_NOT_SA_MNG.cs | 2 + 9 files changed, 62 insertions(+), 40 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_PD_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_PD_DTO.cs index ad056fcc..91f42ca2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_PD_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_PD_DTO.cs @@ -136,22 +136,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// 替换生产码 /// public string REPN { get; set; } - /// - /// 键值 - /// - public string KeyCode { get; set; } - /// - /// 扩展字段1 - /// - public string Extend1 { get; set; } - /// - /// 扩展字段2 - /// - public string Extend2 { get; set; } - /// - /// 扩展字段3 - /// - public string Extend3 { get; set; } + + /// /// 客户零件号 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs index e787eeb9..9de4b433 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs @@ -255,13 +255,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// ///零件号 /// - [Display(Name = "零件号")] + [Display(Name = "客户零件号")] public string LU { get; set; } /// ///零件号 /// - [Display(Name = "客户零件号")] + [Display(Name = "零件号")] public string PartCode { get; set; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs index eeb4f939..238fcaf7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs @@ -30,6 +30,7 @@ using Win.Abp.Snowflakes; using Win.Sfs.SettleAccount.CommonManagers; using Volo.Abp; using Win.Sfs.SettleAccount.Entities.BQ.Temp; +using Volo.Abp.Uow; namespace Win.Sfs.SettleAccount.Entities.BQ { @@ -81,15 +82,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// /// [HttpPost] - + [UnitOfWork(false)] public async override Task GenerateInvoice([FromBody] string invbillNum) { var main =await _bbacMng.GetMainAsync(invbillNum); if (main != null) { - - if (main.State != SettleBillState.未结状态) { return new JsonResult(new { Code = 400, Message = "已创建发票不能重复创建" }); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs index 35b9cbe3..51cede28 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs @@ -69,7 +69,14 @@ namespace SettleAccount.Bases public virtual string Site { get; set; } - + + public virtual void SetId(Guid guid) + { + Id = guid; + } + + + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs index 5b74aa7a..162af8a9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs @@ -46,6 +46,9 @@ public class BBAC_CAN_SA : SA_CAN_BASE_MAIN Site = site; BusinessType = businessType; } + + + } [Display(Name = "BBAC可结算导入明细")] diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs index fd139484..a5928c9d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs @@ -64,6 +64,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var billNumber = OrderNumberGenerator.GenerateOrderNumber("N"); var _entity = new BBAC_CAN_SA(); + _entity.SetId(Guid.NewGuid()); _entity.BillNum = billNumber; _entity.InvGroupNum = billNumber; _entity.Version = DateTime.Now.Year + DateTime.Now.Month; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs index 57207ce2..c6973618 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs @@ -76,6 +76,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers _entity.State = SettleBillState.未结状态; _entity.SettleBillNum = string.Empty; _entity.BusinessType = p_list.FirstOrDefault().BusinessType; + _entity.SetId(Guid.NewGuid()); var _entityList = new List(); foreach (var itm in p_list) { 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 9fbaca26..42653b57 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 @@ -1282,14 +1282,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } if (invoiceMap.Keys.Count > 0) { - var groupList = new List(); var notDetialList = new List(); var detailList = new List(); var invlist = new List(); var salist = new List(); var adjlist = new List(); - foreach (var itm in invoiceMap)//分组影响和 { var key = itm.Key;//发票票号 @@ -1311,21 +1309,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers 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 }) + 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 }) .Select(itm => new { PartCode = itm.Key.PartCode, InvGroupNum = itm.Key.InvGroupNum, - LU = itm.Key.PartCode, + LU = itm.Key.LU, ContactDocID = itm.Key.ContractDocID, Price = itm.Key.Price, Amt = Math.Round(itm.Sum(k => k.Qty) * itm.Key.Price, 2), Qty = itm.Sum(k => k.Qty), BeginDate = itm.Key.BeginDate, EndDate = itm.Key.EndDate - }) - .ToList(); + }).ToList(); decimal amt = detailDtos.Sum(k => k.Amt); decimal txtAmt = Math.Round(detailDtos.Sum(k => k.Amt), 2); var mapList = new List(); @@ -1373,10 +1369,29 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers detailList.AddRange(_entityDetailList); } var innotls = new List(); + var sq = dtos.Where(p => itm.Value.Contains(p.GroupNum)).GroupBy(p => new { p.LU, p.GroupNum }) + .Select(p => new { version = p_version, LU = p.Key.LU, Qty = p.Sum(itm => itm.Qty), InvBillNum = itm.Key, GroupNum = p.Key.GroupNum }); + + foreach (var sitm in sq) + { + innotls.Add(new INVOICE_NOT_SETTLE( + guid: GuidGenerator.Create(), + version: p_version, + invGroupNum: p_InvGroupNum, + settleGroupNum: sitm.GroupNum, + lU: sitm.LU, + lU1: sitm.LU, + extend1: string.Empty, + extend2: string.Empty, + qty: sitm.Qty, + p_invbillnum: itm.Key + )); + } if (p_notlist != null && p_notlist.Count > 0) { var groupnum = itm.Value; - var notls = p_notlist.Where(p=>groupnum.Contains(p.GroupNum)).GroupBy(p => new { p.GroupNum, p.LU }).Select(p => new { GroupNum = p.Key.GroupNum, LU = p.Key.LU, Qty = p.Sum(itm => itm.Qty) }); + var notls = p_notlist.Where(p => groupnum.Contains(p.GroupNum)).GroupBy(p => new { p.GroupNum, p.LU }) + .Select(p => new { GroupNum = p.Key.GroupNum, LU = p.Key.LU, Qty = p.Sum(itm => itm.Qty), InvBillNum = itm.Key }); foreach (var nitm in notls) { innotls.Add(new INVOICE_NOT_SETTLE( @@ -1384,12 +1399,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers version: p_version, invGroupNum: p_InvGroupNum, settleGroupNum: nitm.GroupNum, - lU: string.Empty, + lU: nitm.LU, lU1: nitm.LU, extend1: string.Empty, extend2: string.Empty, qty: nitm.Qty, - p_invbillnum:itm.Key + p_invbillnum: itm.Key )); } if (innotls.Count > 0) @@ -1408,9 +1423,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers invGroupNum: p_InvGroupNum, state: SettleBillState.已开票, invoiceBillState: InvoiceBillState.正常, - tax: 0, - parent: string.Empty, - preTaxDiff: 0, + tax: 0, + parent: string.Empty, + preTaxDiff: 0, taxDiff: 0, clientCode: string.Empty, realAmt: 0 @@ -1418,18 +1433,26 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers invlist.Add(invbill); } + if (salist.Count > 0) + { + foreach (var itm in invoiceMap)//分组影响和 + { + var key = itm.Key;//发票票号 + var ls = itm.Value;//结算分组号列表 + + string str = $" EXEC [p_Invoice_generation_change] @invbillnum = {"'" + key + "'"},@groupNum = {"'" + string.Join(",", ls) + "'"},@businessType = NULL"; + await _repository.DbContext.Database.ExecuteSqlRawAsync(str); + } + // await _repository.DbContext.BulkUpdateAsync(salist,new BulkConfig() { BatchSize=10000 }); + } await _repository.DbContext.BulkInsertAsync(invlist); await _repository.DbContext.BulkInsertAsync(groupList); await _repository.DbContext.BulkInsertAsync(detailList); - - if (salist.Count > 0) - { - await _repository.DbContext.BulkUpdateAsync(salist); - } + if (adjlist.Count > 0) { await _repository.DbContext.BulkUpdateAsync(adjlist); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs index c8a4c691..bca294e7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs @@ -95,6 +95,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } var billNumber = OrderNumberGenerator.GenerateOrderNumber("N"); var _entity = new PUB_CAN_SA(); + _entity.SetId(Guid.NewGuid()); _entity.BillNum = billNumber; _entity.InvGroupNum = billNumber; _entity.Version = DateTime.Now.Year + DateTime.Now.Month; @@ -134,6 +135,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { var billNumber = OrderNumberGenerator.GenerateOrderNumber("N"); var _entity = new PUB_CAN_SA(); + _entity.SetId(Guid.NewGuid()); _entity.BillNum = billNumber; _entity.InvGroupNum = billNumber; _entity.Version = DateTime.Now.Year + DateTime.Now.Month; From 8493d5f7c5ed27184c4a6bd69b343a720cf36fc3 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Thu, 24 Aug 2023 16:44:59 +0800 Subject: [PATCH 2/6] up --- .../UserManagement/UserAppService.cs | 17 +++-- .../wwwroot/api/site.js | 4 ++ .../wwwroot/layouts/header.js | 14 +--- .../wwwroot/layouts/logo.js | 4 +- .../wwwroot/locale/index.js | 14 ++-- .../wwwroot/main.js | 4 +- .../wwwroot/models/account.js | 38 +++++++++++ .../wwwroot/models/settle/inventory-detail.js | 27 ++++++-- .../wwwroot/request/index.js | 9 ++- .../wwwroot/router/index.js | 8 +++ .../wwwroot/styles/site.css | 3 +- .../wwwroot/utils/index.js | 17 ++--- .../wwwroot/utils/validation.js | 4 +- .../wwwroot/views/account.js | 64 +++++++++++++++++++ .../wwwroot/views/login.js | 23 ++++--- 15 files changed, 185 insertions(+), 65 deletions(-) create mode 100644 code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/account.js create mode 100644 code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/account.js diff --git a/code/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs b/code/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs index 30621f88..88d7bc8d 100644 --- a/code/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs +++ b/code/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs @@ -1,3 +1,7 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; using BaseService.BaseData; using BaseService.BaseData.Permissions.Dto; using BaseService.RelationBaseData; @@ -6,10 +10,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Omu.ValueInjecter; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; @@ -25,7 +25,6 @@ using IdentityUser = Volo.Abp.Identity.IdentityUser; namespace BaseService.Systems.UserManagement { [Route("api/base/user")] - //[Authorize(IdentityPermissions.Users.Default)] public class UserAppService : ApplicationService, IUserAppService { protected IdentityUserManager UserManager { get; } @@ -417,5 +416,13 @@ namespace BaseService.Systems.UserManagement await UserManager.DeleteAsync(entity).ConfigureAwait(false); return new OkResult(); } + + [Route("{userId}/change-password")] + public async Task ChangePassword(Guid userId, ChangePasswordInput input) + { + var user = await UserManager.GetByIdAsync(userId).ConfigureAwait(false); + var result = await UserManager.ChangePasswordAsync(user, input.CurrentPassword, input.NewPassword).ConfigureAwait(false); + result.CheckErrors(); + } } } diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/api/site.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/api/site.js index e81de595..9e01ac51 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/api/site.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/api/site.js @@ -2,6 +2,7 @@ async function getLocalizationAsync() { // const url = "abp/application-configuration"; // const data = (await get(url, null, null, true, true)).data; return { + legacy: false, options: [ { value: "zh", @@ -144,6 +145,9 @@ async function getLocalizationAsync() { isOnline: "在线", heartbeat: "心跳", userAgent: "用户代理", + ["Invalid username or password!"]: "用户名或密码错误", + ["The user account has been locked out due to invalid login attempts. Please wait a while and try again."]: "用户已锁定,请稍后重试", + ["Volo.Abp.Identity:PasswordMismatch"]: "密码错误", }, en: { application: "WTA Framework", diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/header.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/header.js index d57f347f..40fa8e0a 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/header.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/header.js @@ -41,13 +41,7 @@ export default { v-model="searchModel" :loading="searchLoading" > - + @@ -63,7 +57,7 @@ export default { - {{ appStore.user.name }} + {{ appStore.user.userName }} @@ -112,9 +106,7 @@ export default { try { searchLoading.value = true; const menus = treeToList(router.getRoutes().find((o) => o.path === "/").children); - searchOptions.value = menus - .filter((o) => !o.children || o.children.length === 0) - .filter((o) => o.meta.fullName.indexOf(query) > -1); + searchOptions.value = menus.filter((o) => !o.children || o.children.length === 0).filter((o) => o.meta.fullName.indexOf(query) > -1); } finally { searchLoading.value = false; } diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/logo.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/logo.js index 8fb65d32..e4e4070a 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/logo.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/logo.js @@ -1,8 +1,9 @@ import html from "html"; import { useAppStore } from "../store/index.js"; +import { reload } from "../utils/index.js"; export default { - template: html`