From 8f1840d823bc067bad8def6f334eb6a6f7096214 Mon Sep 17 00:00:00 2001 From: 18631081161 <2088094923@qq.com> Date: Thu, 22 Jan 2026 20:36:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AllocationQuotaPropertyTests.cs | 4 +-- .../RequiredFieldValidationPropertyTests.cs | 10 +++---- .../Properties/WorkflowStatePropertyTests.cs | 16 +++++------ .../Services/AllocationServiceTests.cs | 6 ++-- .../Services/ReportingServiceTests.cs | 2 +- .../Controllers/AllocationsController.cs | 24 ++++++++-------- .../ConsumptionChangeRequestsController.cs | 10 +++---- .../MaterialCategoriesController.cs | 28 +++++++++---------- .../Controllers/ReportsController.cs | 2 +- .../Controllers/StatsController.cs | 2 +- .../Data/AuditInterceptor.cs | 2 +- .../Models/DTOs/AllocationDTOs.cs | 18 ++++++------ .../Models/DTOs/MaterialCategoryDTOs.cs | 4 +-- .../Models/Entities/AllocationDistribution.cs | 4 +-- .../Models/Entities/MaterialAllocation.cs | 4 +-- .../Models/Entities/MaterialCategory.cs | 2 +- src/MilitaryTrainingManagement/Program.cs | 10 +++---- .../Implementations/AllocationService.cs | 8 +++--- .../Services/Implementations/AuditService.cs | 2 +- .../Implementations/ReportingService.cs | 2 +- .../Services/Interfaces/IAllocationService.cs | 16 +++++------ src/frontend/src/layouts/MainLayout.vue | 4 +-- src/frontend/src/router/index.ts | 2 +- src/frontend/src/views/AuditLogs.vue | 4 +-- src/frontend/src/views/Dashboard.vue | 6 ++-- .../src/views/allocations/AllocationForm.vue | 6 ++-- .../src/views/allocations/AllocationList.vue | 16 +++++------ .../views/allocations/AllocationReport.vue | 2 +- .../views/allocations/ChangeRequestList.vue | 6 ++-- src/frontend/src/views/reports/ReportList.vue | 4 +-- 30 files changed, 113 insertions(+), 113 deletions(-) diff --git a/src/MilitaryTrainingManagement.Tests/Properties/AllocationQuotaPropertyTests.cs b/src/MilitaryTrainingManagement.Tests/Properties/AllocationQuotaPropertyTests.cs index 95d868a..5893b5d 100644 --- a/src/MilitaryTrainingManagement.Tests/Properties/AllocationQuotaPropertyTests.cs +++ b/src/MilitaryTrainingManagement.Tests/Properties/AllocationQuotaPropertyTests.cs @@ -13,7 +13,7 @@ public class AllocationQuotaPropertyTests { /// /// 属性2:配额总和验证 - /// *对于任何*带有单位配额的物资配额,所有单位配额的总和不应超过总配额指标 + /// *对于任何*带有单位配额的弹种配额,所有单位配额的总和不应超过总配额指标 /// **验证需求:需求2.3** /// [Property(MaxTest = 100)] @@ -167,7 +167,7 @@ public class AllocationQuotaPropertyTests } /// - /// 创建带有分配的物资配额 + /// 创建带有分配的弹种配额 /// private static MaterialAllocation CreateAllocationWithDistributions(decimal totalQuota, decimal[] quotas) { diff --git a/src/MilitaryTrainingManagement.Tests/Properties/RequiredFieldValidationPropertyTests.cs b/src/MilitaryTrainingManagement.Tests/Properties/RequiredFieldValidationPropertyTests.cs index abe0b7a..5a434cd 100644 --- a/src/MilitaryTrainingManagement.Tests/Properties/RequiredFieldValidationPropertyTests.cs +++ b/src/MilitaryTrainingManagement.Tests/Properties/RequiredFieldValidationPropertyTests.cs @@ -129,8 +129,8 @@ public class RequiredFieldValidationPropertyTests /// - /// 属性7扩展:物资配额必填字段验证 - /// *对于任何*物资配额创建,物资名称、单位和总配额必须存在且有效 + /// 属性7扩展:弹种配额必填字段验证 + /// *对于任何*弹种配额创建,弹种名称、单位和总配额必须存在且有效 /// **验证需求:需求2.2** /// [Property(MaxTest = 100)] @@ -163,7 +163,7 @@ public class RequiredFieldValidationPropertyTests } /// - /// 属性7扩展:缺少物资名称的配额应该无效 + /// 属性7扩展:缺少弹种名称的配额应该无效 /// **验证需求:需求2.2** /// [Property(MaxTest = 100)] @@ -175,14 +175,14 @@ public class RequiredFieldValidationPropertyTests var allocation = new MaterialAllocation { Category = TruncateString(category.Get, 100), - MaterialName = "", // 缺少物资名称 + MaterialName = "", // 缺少弹种名称 Unit = TruncateString(unit.Get, 50), TotalQuota = totalQuotaInt.Get, CreatedByUnitId = 1, CreatedAt = DateTime.UtcNow }; - // 缺少物资名称应该无效 + // 缺少弹种名称应该无效 return string.IsNullOrWhiteSpace(allocation.MaterialName); } diff --git a/src/MilitaryTrainingManagement.Tests/Properties/WorkflowStatePropertyTests.cs b/src/MilitaryTrainingManagement.Tests/Properties/WorkflowStatePropertyTests.cs index c38de91..ae68837 100644 --- a/src/MilitaryTrainingManagement.Tests/Properties/WorkflowStatePropertyTests.cs +++ b/src/MilitaryTrainingManagement.Tests/Properties/WorkflowStatePropertyTests.cs @@ -119,11 +119,11 @@ public class WorkflowStatePropertyTests var (hierarchy, users) = CreateHierarchyWithUsers(context); var workflowService = new WorkflowService(context); - // 创建物资配额 + // 创建弹种配额 var allocation = new MaterialAllocation { Category = "弹药", - MaterialName = "测试物资", + MaterialName = "测试弹种", Unit = "发", TotalQuota = 1000, CreatedByUnitId = hierarchy[OrganizationalLevel.Division].Id, @@ -170,11 +170,11 @@ public class WorkflowStatePropertyTests var (hierarchy, users) = CreateHierarchyWithUsers(context); var workflowService = new WorkflowService(context); - // 创建物资配额 + // 创建弹种配额 var allocation = new MaterialAllocation { Category = "弹药", - MaterialName = "测试物资", + MaterialName = "测试弹种", Unit = "发", TotalQuota = 1000, CreatedByUnitId = hierarchy[OrganizationalLevel.Division].Id, @@ -238,11 +238,11 @@ public class WorkflowStatePropertyTests var (hierarchy, users) = CreateHierarchyWithUsers(context); var workflowService = new WorkflowService(context); - // 创建物资配额 + // 创建弹种配额 var allocation = new MaterialAllocation { Category = "弹药", - MaterialName = "测试物资", + MaterialName = "测试弹种", Unit = "发", TotalQuota = 1000, CreatedByUnitId = hierarchy[OrganizationalLevel.Division].Id, @@ -314,11 +314,11 @@ public class WorkflowStatePropertyTests var (hierarchy, users) = CreateHierarchyWithUsers(context); var workflowService = new WorkflowService(context); - // 创建物资配额 + // 创建弹种配额 var allocation = new MaterialAllocation { Category = "弹药", - MaterialName = "测试物资", + MaterialName = "测试弹种", Unit = "发", TotalQuota = 1000, CreatedByUnitId = hierarchy[OrganizationalLevel.Division].Id, diff --git a/src/MilitaryTrainingManagement.Tests/Services/AllocationServiceTests.cs b/src/MilitaryTrainingManagement.Tests/Services/AllocationServiceTests.cs index 13cf0a6..bac6472 100644 --- a/src/MilitaryTrainingManagement.Tests/Services/AllocationServiceTests.cs +++ b/src/MilitaryTrainingManagement.Tests/Services/AllocationServiceTests.cs @@ -7,7 +7,7 @@ using MilitaryTrainingManagement.Services.Implementations; namespace MilitaryTrainingManagement.Tests.Services; /// -/// 物资配额服务单元测试 +/// 弹种配额服务单元测试 /// 测试配额创建、验证逻辑、分发算法和错误处理场景 /// _需求:2.1, 2.2, 2.3, 2.4, 2.5_ /// @@ -136,7 +136,7 @@ public class AllocationServiceTests } /// - /// 测试创建配额时必填字段验证 - 空物资名称 + /// 测试创建配额时必填字段验证 - 空弹种名称 /// [Fact] public async Task CreateAsync_WithEmptyMaterialName_ThrowsArgumentException() @@ -154,7 +154,7 @@ public class AllocationServiceTests var exception = await Assert.ThrowsAsync(() => service.CreateAsync("弹药", "", "件", 100m, division.Id, new Dictionary())); - Assert.Equal("物资名称不能为空", exception.Message); + Assert.Equal("弹种名称不能为空", exception.Message); } /// diff --git a/src/MilitaryTrainingManagement.Tests/Services/ReportingServiceTests.cs b/src/MilitaryTrainingManagement.Tests/Services/ReportingServiceTests.cs index 6895272..d8ed850 100644 --- a/src/MilitaryTrainingManagement.Tests/Services/ReportingServiceTests.cs +++ b/src/MilitaryTrainingManagement.Tests/Services/ReportingServiceTests.cs @@ -459,7 +459,7 @@ public class ReportingServiceTests } /// - /// 测试获取详细上报记录 - 包含物资信息 + /// 测试获取详细上报记录 - 包含弹种信息 /// [Fact] public async Task GetDetailedReportsAsync_IncludesMaterialInfo() diff --git a/src/MilitaryTrainingManagement/Controllers/AllocationsController.cs b/src/MilitaryTrainingManagement/Controllers/AllocationsController.cs index 29ab980..960902f 100644 --- a/src/MilitaryTrainingManagement/Controllers/AllocationsController.cs +++ b/src/MilitaryTrainingManagement/Controllers/AllocationsController.cs @@ -8,7 +8,7 @@ using MilitaryTrainingManagement.Services.Interfaces; namespace MilitaryTrainingManagement.Controllers; /// -/// 物资配额控制器 +/// 弹种配额控制器 /// [Authorize] public class AllocationsController : BaseApiController @@ -33,7 +33,7 @@ public class AllocationsController : BaseApiController } /// - /// 获取当前用户可见的所有物资配额 + /// 获取当前用户可见的所有弹种配额 /// [HttpGet] public async Task GetAll( @@ -94,7 +94,7 @@ public class AllocationsController : BaseApiController } /// - /// 获取当前单位创建的物资配额 + /// 获取当前单位创建的弹种配额 /// [HttpGet("my")] public async Task GetMyAllocations() @@ -124,7 +124,7 @@ public class AllocationsController : BaseApiController } /// - /// 根据ID获取物资配额 + /// 根据ID获取弹种配额 /// 需求1.1, 1.2, 1.3:营部及以下级别用户只能查看本单位及直接下级的配额 /// [HttpGet("{id}")] @@ -200,9 +200,9 @@ public class AllocationsController : BaseApiController } /// - /// 创建物资配额 - /// 需求2.1:师团管理员可以创建物资类别 - /// 需求2.2:创建配额需要物资名称、单位、总配额和目标单位 + /// 创建弹种配额 + /// 需求2.1:师团管理员可以创建弹种类别 + /// 需求2.2:创建配额需要弹种名称、单位、总配额和目标单位 /// 需求2.4:创建后自动分发给目标单位 /// [HttpPost] @@ -233,7 +233,7 @@ public class AllocationsController : BaseApiController "MaterialAllocation", allocation.Id, "Create", - $"创建物资配额:{request.Category} - {request.MaterialName},总配额:{request.TotalQuota}{request.Unit}", + $"创建弹种配额:{request.Category} - {request.MaterialName},总配额:{request.TotalQuota}{request.Unit}", userId, unitId, GetClientIpAddress()); @@ -247,7 +247,7 @@ public class AllocationsController : BaseApiController } /// - /// 更新物资配额基本信息 + /// 更新弹种配额基本信息 /// [HttpPut("{id}")] [Authorize(Policy = "DivisionLevel")] @@ -285,7 +285,7 @@ public class AllocationsController : BaseApiController "MaterialAllocation", id, "Update", - $"更新物资配额:{request.Category} - {request.MaterialName},总配额:{request.TotalQuota}{request.Unit}", + $"更新弹种配额:{request.Category} - {request.MaterialName},总配额:{request.TotalQuota}{request.Unit}", userId, unitId, GetClientIpAddress()); @@ -387,7 +387,7 @@ public class AllocationsController : BaseApiController } /// - /// 删除物资配额 + /// 删除弹种配额 /// [HttpDelete("{id}")] [Authorize(Policy = "DivisionLevel")] @@ -419,7 +419,7 @@ public class AllocationsController : BaseApiController "MaterialAllocation", id, "Delete", - $"删除物资配额:{category} - {materialName}", + $"删除弹种配额:{category} - {materialName}", userId, unitId, GetClientIpAddress()); diff --git a/src/MilitaryTrainingManagement/Controllers/ConsumptionChangeRequestsController.cs b/src/MilitaryTrainingManagement/Controllers/ConsumptionChangeRequestsController.cs index ef1d5a7..0336552 100644 --- a/src/MilitaryTrainingManagement/Controllers/ConsumptionChangeRequestsController.cs +++ b/src/MilitaryTrainingManagement/Controllers/ConsumptionChangeRequestsController.cs @@ -84,13 +84,13 @@ public class ConsumptionChangeRequestsController : BaseApiController // 记录审计日志 var requestTypeName = request.RequestType == ChangeRequestType.Delete ? "删除" : "修改"; - var materialName = report.AllocationDistribution?.Allocation?.MaterialName ?? "未知物资"; + var materialName = report.AllocationDistribution?.Allocation?.MaterialName ?? "未知弹种"; await _auditService.LogApprovalAsync( "ConsumptionReportChangeRequest", changeRequest.Id, "Create", - $"提交消耗记录{requestTypeName}申请,物资:{materialName},申请原因:{request.Reason}", + $"提交消耗记录{requestTypeName}申请,弹种:{materialName},申请原因:{request.Reason}", userId, unitId, GetClientIpAddress()); @@ -289,14 +289,14 @@ public class ConsumptionChangeRequestsController : BaseApiController // 记录审计日志 var requestTypeName = changeRequest.RequestType == ChangeRequestType.Delete ? "删除" : "修改"; - var materialName = changeRequest.ConsumptionReport?.AllocationDistribution?.Allocation?.MaterialName ?? "未知物资"; + var materialName = changeRequest.ConsumptionReport?.AllocationDistribution?.Allocation?.MaterialName ?? "未知弹种"; var reportedByUnitName = changeRequest.RequestedByUnit?.Name ?? "未知单位"; await _auditService.LogApprovalAsync( "ConsumptionReportChangeRequest", id, request.Approved ? "Approve" : "Reject", - $"{action}「{reportedByUnitName}」的消耗记录{requestTypeName}申请,物资:{materialName},原因:{changeRequest.Reason},处理意见:{request.Comments ?? "无"}", + $"{action}「{reportedByUnitName}」的消耗记录{requestTypeName}申请,弹种:{materialName},原因:{changeRequest.Reason},处理意见:{request.Comments ?? "无"}", userId, unitId, GetClientIpAddress()); @@ -351,7 +351,7 @@ public class ConsumptionChangeRequestsController : BaseApiController // 记录审计日志 var userId = GetCurrentUserId(); - var materialName = distribution.Allocation?.MaterialName ?? "未知物资"; + var materialName = distribution.Allocation?.MaterialName ?? "未知弹种"; await _auditService.LogApprovalAsync( "ConsumptionReport", diff --git a/src/MilitaryTrainingManagement/Controllers/MaterialCategoriesController.cs b/src/MilitaryTrainingManagement/Controllers/MaterialCategoriesController.cs index 7798fc8..b498667 100644 --- a/src/MilitaryTrainingManagement/Controllers/MaterialCategoriesController.cs +++ b/src/MilitaryTrainingManagement/Controllers/MaterialCategoriesController.cs @@ -9,7 +9,7 @@ using MilitaryTrainingManagement.Services.Interfaces; namespace MilitaryTrainingManagement.Controllers; /// -/// 物资类别管理控制器 +/// 弹种类别管理控制器 /// [Authorize] public class MaterialCategoriesController : BaseApiController @@ -29,7 +29,7 @@ public class MaterialCategoriesController : BaseApiController } /// - /// 获取所有物资类别 + /// 获取所有弹种类别 /// [HttpGet] public async Task GetAll([FromQuery] bool? activeOnly = true) @@ -50,7 +50,7 @@ public class MaterialCategoriesController : BaseApiController } /// - /// 根据ID获取物资类别 + /// 根据ID获取弹种类别 /// [HttpGet("{id}")] public async Task GetById(int id) @@ -58,13 +58,13 @@ public class MaterialCategoriesController : BaseApiController var category = await _context.MaterialCategories.FindAsync(id); if (category == null) { - return NotFound(new { message = "物资类别不存在" }); + return NotFound(new { message = "弹种类别不存在" }); } return Ok(category); } /// - /// 创建物资类别 + /// 创建弹种类别 /// [HttpPost] public async Task Create([FromBody] CreateMaterialCategoryRequest request) @@ -77,7 +77,7 @@ public class MaterialCategoriesController : BaseApiController .AnyAsync(c => c.Name == request.Name); if (exists) { - return BadRequest(new { message = "物资类别名称已存在" }); + return BadRequest(new { message = "弹种类别名称已存在" }); } var category = new MaterialCategory @@ -97,7 +97,7 @@ public class MaterialCategoriesController : BaseApiController "MaterialCategory", category.Id, "Create", - $"创建物资类别:{request.Name}", + $"创建弹种类别:{request.Name}", userId, unitId, GetClientIpAddress()); @@ -106,7 +106,7 @@ public class MaterialCategoriesController : BaseApiController } /// - /// 更新物资类别 + /// 更新弹种类别 /// [HttpPut("{id}")] public async Task Update(int id, [FromBody] UpdateMaterialCategoryRequest request) @@ -117,7 +117,7 @@ public class MaterialCategoriesController : BaseApiController var category = await _context.MaterialCategories.FindAsync(id); if (category == null) { - return NotFound(new { message = "物资类别不存在" }); + return NotFound(new { message = "弹种类别不存在" }); } // 检查名称是否与其他类别重复 @@ -125,7 +125,7 @@ public class MaterialCategoriesController : BaseApiController .AnyAsync(c => c.Name == request.Name && c.Id != id); if (exists) { - return BadRequest(new { message = "物资类别名称已存在" }); + return BadRequest(new { message = "弹种类别名称已存在" }); } category.Name = request.Name; @@ -140,7 +140,7 @@ public class MaterialCategoriesController : BaseApiController "MaterialCategory", id, "Update", - $"更新物资类别:{request.Name}", + $"更新弹种类别:{request.Name}", userId, unitId, GetClientIpAddress()); @@ -149,7 +149,7 @@ public class MaterialCategoriesController : BaseApiController } /// - /// 删除物资类别 + /// 删除弹种类别 /// [HttpDelete("{id}")] public async Task Delete(int id) @@ -160,7 +160,7 @@ public class MaterialCategoriesController : BaseApiController var category = await _context.MaterialCategories.FindAsync(id); if (category == null) { - return NotFound(new { message = "物资类别不存在" }); + return NotFound(new { message = "弹种类别不存在" }); } // 检查是否有配额使用此类别 @@ -180,7 +180,7 @@ public class MaterialCategoriesController : BaseApiController "MaterialCategory", id, "Delete", - $"删除物资类别:{categoryName}", + $"删除弹种类别:{categoryName}", userId, unitId, GetClientIpAddress()); return Ok(new { message = "删除成功" }); diff --git a/src/MilitaryTrainingManagement/Controllers/ReportsController.cs b/src/MilitaryTrainingManagement/Controllers/ReportsController.cs index a339d92..6ea7762 100644 --- a/src/MilitaryTrainingManagement/Controllers/ReportsController.cs +++ b/src/MilitaryTrainingManagement/Controllers/ReportsController.cs @@ -30,7 +30,7 @@ public class ReportsController : BaseApiController /// /// 获取当前单位的分配记录 - /// 需求3.1:显示类别、物资名称、单位、配额、实际完成和完成率 + /// 需求3.1:显示类别、弹种名称、单位、配额、实际完成和完成率 /// [HttpGet] public async Task GetByUnit([FromQuery] int pageNumber = 1, [FromQuery] int pageSize = 10) diff --git a/src/MilitaryTrainingManagement/Controllers/StatsController.cs b/src/MilitaryTrainingManagement/Controllers/StatsController.cs index d56baf7..49b89ba 100644 --- a/src/MilitaryTrainingManagement/Controllers/StatsController.cs +++ b/src/MilitaryTrainingManagement/Controllers/StatsController.cs @@ -97,7 +97,7 @@ public class StatsController : BaseApiController } /// - /// 获取各团物资配额统计(饼状图数据) + /// 获取各团弹种配额统计(饼状图数据) /// [HttpGet("regiment-allocations")] public async Task GetRegimentAllocationsStats() diff --git a/src/MilitaryTrainingManagement/Data/AuditInterceptor.cs b/src/MilitaryTrainingManagement/Data/AuditInterceptor.cs index 1d73c70..3a2b322 100644 --- a/src/MilitaryTrainingManagement/Data/AuditInterceptor.cs +++ b/src/MilitaryTrainingManagement/Data/AuditInterceptor.cs @@ -220,7 +220,7 @@ public class AuditInterceptor : SaveChangesInterceptor { var entityDisplayName = entityType switch { - "MaterialAllocation" => "物资配额", + "MaterialAllocation" => "弹种配额", "AllocationDistribution" => "配额分配", "Personnel" => "人员", "OrganizationalUnit" => "组织单位", diff --git a/src/MilitaryTrainingManagement/Models/DTOs/AllocationDTOs.cs b/src/MilitaryTrainingManagement/Models/DTOs/AllocationDTOs.cs index 10ecc8f..d1d8f93 100644 --- a/src/MilitaryTrainingManagement/Models/DTOs/AllocationDTOs.cs +++ b/src/MilitaryTrainingManagement/Models/DTOs/AllocationDTOs.cs @@ -12,7 +12,7 @@ public class DistributionRequestItem } /// -/// 创建物资配额请求 +/// 创建弹种配额请求 /// public class CreateAllocationRequest { @@ -24,10 +24,10 @@ public class CreateAllocationRequest public string Category { get; set; } = string.Empty; /// - /// 物资名称 + /// 弹种名称 /// - [Required(ErrorMessage = "物资名称为必填项")] - [MaxLength(200, ErrorMessage = "物资名称长度不能超过200个字符")] + [Required(ErrorMessage = "弹种名称为必填项")] + [MaxLength(200, ErrorMessage = "弹种名称长度不能超过200个字符")] public string MaterialName { get; set; } = string.Empty; /// @@ -60,7 +60,7 @@ public class CreateAllocationRequest } /// -/// 更新物资配额请求 +/// 更新弹种配额请求 /// public class UpdateAllocationRequest { @@ -72,10 +72,10 @@ public class UpdateAllocationRequest public string Category { get; set; } = string.Empty; /// - /// 物资名称 + /// 弹种名称 /// - [Required(ErrorMessage = "物资名称为必填项")] - [MaxLength(200, ErrorMessage = "物资名称长度不能超过200个字符")] + [Required(ErrorMessage = "弹种名称为必填项")] + [MaxLength(200, ErrorMessage = "弹种名称长度不能超过200个字符")] public string MaterialName { get; set; } = string.Empty; /// @@ -112,7 +112,7 @@ public class UpdateDistributionRequest } /// -/// 物资配额响应 +/// 弹种配额响应 /// public class AllocationResponse { diff --git a/src/MilitaryTrainingManagement/Models/DTOs/MaterialCategoryDTOs.cs b/src/MilitaryTrainingManagement/Models/DTOs/MaterialCategoryDTOs.cs index c355633..385a4bb 100644 --- a/src/MilitaryTrainingManagement/Models/DTOs/MaterialCategoryDTOs.cs +++ b/src/MilitaryTrainingManagement/Models/DTOs/MaterialCategoryDTOs.cs @@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations; namespace MilitaryTrainingManagement.Models.DTOs; /// -/// 创建物资类别请求 +/// 创建弹种类别请求 /// public class CreateMaterialCategoryRequest { @@ -18,7 +18,7 @@ public class CreateMaterialCategoryRequest } /// -/// 更新物资类别请求 +/// 更新弹种类别请求 /// public class UpdateMaterialCategoryRequest { diff --git a/src/MilitaryTrainingManagement/Models/Entities/AllocationDistribution.cs b/src/MilitaryTrainingManagement/Models/Entities/AllocationDistribution.cs index efe2927..65ec4b4 100644 --- a/src/MilitaryTrainingManagement/Models/Entities/AllocationDistribution.cs +++ b/src/MilitaryTrainingManagement/Models/Entities/AllocationDistribution.cs @@ -10,12 +10,12 @@ public class AllocationDistribution public int Id { get; set; } /// - /// 关联的物资配额ID + /// 关联的弹种配额ID /// public int AllocationId { get; set; } /// - /// 关联的物资配额 + /// 关联的弹种配额 /// public MaterialAllocation Allocation { get; set; } = null!; diff --git a/src/MilitaryTrainingManagement/Models/Entities/MaterialAllocation.cs b/src/MilitaryTrainingManagement/Models/Entities/MaterialAllocation.cs index 20fa039..b5cbe56 100644 --- a/src/MilitaryTrainingManagement/Models/Entities/MaterialAllocation.cs +++ b/src/MilitaryTrainingManagement/Models/Entities/MaterialAllocation.cs @@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations; namespace MilitaryTrainingManagement.Models.Entities; /// -/// 物资配额实体 +/// 弹种配额实体 /// public class MaterialAllocation { @@ -19,7 +19,7 @@ public class MaterialAllocation /// /// 弹药/器材名称 /// - [Required(ErrorMessage = "物资名称为必填项")] + [Required(ErrorMessage = "弹种名称为必填项")] [MaxLength(200)] public string MaterialName { get; set; } = string.Empty; diff --git a/src/MilitaryTrainingManagement/Models/Entities/MaterialCategory.cs b/src/MilitaryTrainingManagement/Models/Entities/MaterialCategory.cs index 2b35c76..808b8b1 100644 --- a/src/MilitaryTrainingManagement/Models/Entities/MaterialCategory.cs +++ b/src/MilitaryTrainingManagement/Models/Entities/MaterialCategory.cs @@ -1,7 +1,7 @@ namespace MilitaryTrainingManagement.Models.Entities; /// -/// 物资类别 +/// 弹种类别 /// public class MaterialCategory { diff --git a/src/MilitaryTrainingManagement/Program.cs b/src/MilitaryTrainingManagement/Program.cs index 74dc889..aec656d 100644 --- a/src/MilitaryTrainingManagement/Program.cs +++ b/src/MilitaryTrainingManagement/Program.cs @@ -106,7 +106,7 @@ builder.Services.AddControllers() builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(c => { - c.SwaggerDoc("v1", new OpenApiInfo { Title = "兵团训练物资管控系统 API", Version = "v1" }); + c.SwaggerDoc("v1", new OpenApiInfo { Title = "兵团训练弹药管控系统 API", Version = "v1" }); c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme { Description = "JWT Authorization header using the Bearer scheme", @@ -349,7 +349,7 @@ using (var scope = app.Services.CreateScope()) Console.WriteLine($"创建 ConsumptionReportChangeRequests 表时出错: {ex.Message}"); } - // 如果没有物资类别,创建默认类别 + // 如果没有弹种类别,创建默认类别 if (!context.MaterialCategories.Any()) { var categories = new[] @@ -372,8 +372,8 @@ using (var scope = app.Services.CreateScope()) }, new MilitaryTrainingManagement.Models.Entities.MaterialCategory { - Name = "物资", - Description = "训练保障物资", + Name = "其他", + Description = "其他训练弹种", IsActive = true, SortOrder = 3, CreatedAt = DateTime.UtcNow @@ -389,7 +389,7 @@ using (var scope = app.Services.CreateScope()) }; context.MaterialCategories.AddRange(categories); await context.SaveChangesAsync(); - Console.WriteLine("默认物资类别已创建!"); + Console.WriteLine("默认弹种类别已创建!"); } // 如果没有组织单位,创建种子数据 diff --git a/src/MilitaryTrainingManagement/Services/Implementations/AllocationService.cs b/src/MilitaryTrainingManagement/Services/Implementations/AllocationService.cs index c2ac9bf..5ab9ed4 100644 --- a/src/MilitaryTrainingManagement/Services/Implementations/AllocationService.cs +++ b/src/MilitaryTrainingManagement/Services/Implementations/AllocationService.cs @@ -7,7 +7,7 @@ using MilitaryTrainingManagement.Services.Interfaces; namespace MilitaryTrainingManagement.Services.Implementations; /// -/// 物资配额服务实现 +/// 弹种配额服务实现 /// public class AllocationService : IAllocationService { @@ -139,7 +139,7 @@ public class AllocationService : IAllocationService if (string.IsNullOrWhiteSpace(category)) throw new ArgumentException("类别不能为空"); if (string.IsNullOrWhiteSpace(materialName)) - throw new ArgumentException("物资名称不能为空"); + throw new ArgumentException("弹种名称不能为空"); if (string.IsNullOrWhiteSpace(unit)) throw new ArgumentException("计量单位不能为空"); if (totalQuota <= 0) @@ -156,7 +156,7 @@ public class AllocationService : IAllocationService if (!await ValidateTargetUnitsExistAsync(distributions.Keys)) throw new ArgumentException("目标单位不存在"); - // 创建物资配额 + // 创建弹种配额 var allocation = new MaterialAllocation { Category = category, @@ -205,7 +205,7 @@ public class AllocationService : IAllocationService if (string.IsNullOrWhiteSpace(category)) throw new ArgumentException("类别不能为空"); if (string.IsNullOrWhiteSpace(materialName)) - throw new ArgumentException("物资名称不能为空"); + throw new ArgumentException("弹种名称不能为空"); if (string.IsNullOrWhiteSpace(unit)) throw new ArgumentException("计量单位不能为空"); if (totalQuota <= 0) diff --git a/src/MilitaryTrainingManagement/Services/Implementations/AuditService.cs b/src/MilitaryTrainingManagement/Services/Implementations/AuditService.cs index e8b6dd2..435a913 100644 --- a/src/MilitaryTrainingManagement/Services/Implementations/AuditService.cs +++ b/src/MilitaryTrainingManagement/Services/Implementations/AuditService.cs @@ -388,7 +388,7 @@ public class AuditService : IAuditService { return entityType switch { - "MaterialAllocation" => "物资配额", + "MaterialAllocation" => "弹种配额", "AllocationDistribution" => "配额分配", "Personnel" => "人员", "OrganizationalUnit" => "组织单位", diff --git a/src/MilitaryTrainingManagement/Services/Implementations/ReportingService.cs b/src/MilitaryTrainingManagement/Services/Implementations/ReportingService.cs index cb7a85b..5baa24a 100644 --- a/src/MilitaryTrainingManagement/Services/Implementations/ReportingService.cs +++ b/src/MilitaryTrainingManagement/Services/Implementations/ReportingService.cs @@ -36,7 +36,7 @@ public class ReportingService : IReportingService /// /// 获取单位的分配记录 - /// 需求3.1:显示类别、物资名称、单位、配额、实际完成和完成率 + /// 需求3.1:显示类别、弹种名称、单位、配额、实际完成和完成率 /// public async Task> GetDistributionsByUnitAsync(int unitId) { diff --git a/src/MilitaryTrainingManagement/Services/Interfaces/IAllocationService.cs b/src/MilitaryTrainingManagement/Services/Interfaces/IAllocationService.cs index 6c5d923..8d27806 100644 --- a/src/MilitaryTrainingManagement/Services/Interfaces/IAllocationService.cs +++ b/src/MilitaryTrainingManagement/Services/Interfaces/IAllocationService.cs @@ -4,27 +4,27 @@ using MilitaryTrainingManagement.Models.Enums; namespace MilitaryTrainingManagement.Services.Interfaces; /// -/// 物资配额服务接口 +/// 弹种配额服务接口 /// public interface IAllocationService { /// - /// 根据ID获取物资配额 + /// 根据ID获取弹种配额 /// Task GetByIdAsync(int id); /// - /// 获取所有物资配额 + /// 获取所有弹种配额 /// Task> GetAllAsync(); /// - /// 获取指定单位创建的物资配额 + /// 获取指定单位创建的弹种配额 /// Task> GetByUnitAsync(int unitId); /// - /// 获取指定单位可见的物资配额(包括分配给该单位及其下级单位的配额) + /// 获取指定单位可见的弹种配额(包括分配给该单位及其下级单位的配额) /// Task> GetVisibleToUnitAsync(int unitId); @@ -39,12 +39,12 @@ public interface IAllocationService Task GetDistributionByIdAsync(int id); /// - /// 创建物资配额并自动分发给目标单位 + /// 创建弹种配额并自动分发给目标单位 /// Task CreateAsync(string category, string materialName, string unit, decimal totalQuota, int createdByUnitId, Dictionary distributions); /// - /// 更新物资配额基本信息 + /// 更新弹种配额基本信息 /// Task UpdateAsync(int id, string category, string materialName, string unit, decimal totalQuota); @@ -59,7 +59,7 @@ public interface IAllocationService Task UpdateDistributionCompletionAsync(int distributionId, int unitId, int userId, decimal actualCompletion, string? remarks = null); /// - /// 删除物资配额 + /// 删除弹种配额 /// Task DeleteAsync(int id); diff --git a/src/frontend/src/layouts/MainLayout.vue b/src/frontend/src/layouts/MainLayout.vue index 1551968..607c428 100644 --- a/src/frontend/src/layouts/MainLayout.vue +++ b/src/frontend/src/layouts/MainLayout.vue @@ -25,7 +25,7 @@ 配额列表 创建配额 @@ -104,7 +104,7 @@ const authStore = useAuthStore() const activeMenu = computed(() => route.path) const currentRoute = computed(() => route) -// 只有师本部和团本部可以查看物资配额(营、连级隐藏) +// 只有师本部和团本部可以查看弹种配额(营、连级隐藏) const canViewAllocations = computed(() => authStore.organizationalLevelNum <= 2) const levelName = computed(() => { diff --git a/src/frontend/src/router/index.ts b/src/frontend/src/router/index.ts index 00b93b9..cce67e4 100644 --- a/src/frontend/src/router/index.ts +++ b/src/frontend/src/router/index.ts @@ -33,7 +33,7 @@ const routes: RouteRecordRaw[] = [ path: 'allocations', name: 'Allocations', component: () => import('@/views/allocations/AllocationList.vue'), - meta: { title: '物资配额' } + meta: { title: '弹种配额' } }, { path: 'allocations/categories', diff --git a/src/frontend/src/views/AuditLogs.vue b/src/frontend/src/views/AuditLogs.vue index 81f4c5a..eb891fc 100644 --- a/src/frontend/src/views/AuditLogs.vue +++ b/src/frontend/src/views/AuditLogs.vue @@ -25,7 +25,7 @@ - + @@ -228,7 +228,7 @@ function getActionTagType(action: string): string { function getEntityTypeName(entityType: string): string { const nameMap: Record = { - 'MaterialAllocation': '物资配额', + 'MaterialAllocation': '弹种配额', 'AllocationDistribution': '配额分配', 'ConsumptionReport': '消耗记录', 'ConsumptionReportChangeRequest': '消耗删改申请', diff --git a/src/frontend/src/views/Dashboard.vue b/src/frontend/src/views/Dashboard.vue index e56d5b9..ad32615 100644 --- a/src/frontend/src/views/Dashboard.vue +++ b/src/frontend/src/views/Dashboard.vue @@ -1,13 +1,13 @@ - + @@ -164,7 +164,7 @@
-
物资类别
+
弹种类别
{{ selectedAllocation?.category }} @@ -230,7 +230,7 @@
- + - + @@ -90,7 +90,7 @@ - + @@ -192,7 +192,7 @@
- + {{ selectedRequest.consumptionReport.materialName }} diff --git a/src/frontend/src/views/reports/ReportList.vue b/src/frontend/src/views/reports/ReportList.vue index b2295ad..a89c846 100644 --- a/src/frontend/src/views/reports/ReportList.vue +++ b/src/frontend/src/views/reports/ReportList.vue @@ -69,7 +69,7 @@ - + @@ -155,7 +155,7 @@ {{ selectedReport?.category }} - + {{ selectedReport?.materialName }}