diff --git a/src/Shentun.Peis.Application.Contracts/CardTypes/CreateCardTypeDto.cs b/src/Shentun.Peis.Application.Contracts/CardTypes/CreateCardTypeDto.cs index 133e08d..47786ae 100644 --- a/src/Shentun.Peis.Application.Contracts/CardTypes/CreateCardTypeDto.cs +++ b/src/Shentun.Peis.Application.Contracts/CardTypes/CreateCardTypeDto.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Text; namespace Shentun.Peis.CardTypes @@ -9,18 +10,22 @@ namespace Shentun.Peis.CardTypes /// /// 名称 /// + [Required(ErrorMessage ="名称不能为空")] public string DisplayName { get; set; } /// /// 卡模式 (0:充值卡,1:积分卡) /// + [Required(ErrorMessage = "卡模式不能为空")] public char CardModeId { get; set; } /// /// 折扣 /// + [Required(ErrorMessage = "折扣不能为空")] public int Discount { get; set; } /// /// 有效期 /// + [Required(ErrorMessage = "有效期不能为空")] public int ExpiryDay { get; set; } /// diff --git a/src/Shentun.Peis.Application.Contracts/CardTypes/UpdateCardTypeDto.cs b/src/Shentun.Peis.Application.Contracts/CardTypes/UpdateCardTypeDto.cs index 439980e..64aa6f5 100644 --- a/src/Shentun.Peis.Application.Contracts/CardTypes/UpdateCardTypeDto.cs +++ b/src/Shentun.Peis.Application.Contracts/CardTypes/UpdateCardTypeDto.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Text; namespace Shentun.Peis.CardTypes @@ -9,18 +10,22 @@ namespace Shentun.Peis.CardTypes /// /// 名称 /// + [Required(ErrorMessage = "名称不能为空")] public string DisplayName { get; set; } /// /// 卡模式 (0:充值卡,1:积分卡) /// + [Required(ErrorMessage = "卡模式不能为空")] public char CardModeId { get; set; } /// /// 折扣 /// + [Required(ErrorMessage = "折扣不能为空")] public int Discount { get; set; } /// /// 有效期 /// + [Required(ErrorMessage = "有效期不能为空")] public int ExpiryDay { get; set; } /// diff --git a/src/Shentun.Peis.Application.Contracts/CustomerOrgGroups/CustomerOrgGroupDto.cs b/src/Shentun.Peis.Application.Contracts/CustomerOrgGroups/CustomerOrgGroupDto.cs index 355a94a..35bd82f 100644 --- a/src/Shentun.Peis.Application.Contracts/CustomerOrgGroups/CustomerOrgGroupDto.cs +++ b/src/Shentun.Peis.Application.Contracts/CustomerOrgGroups/CustomerOrgGroupDto.cs @@ -65,5 +65,10 @@ namespace Shentun.Peis.CustomerOrgGroups /// 显示顺序 /// public int DisplayOrder { get; set; } + + /// + /// 体检次数ID + /// + public Guid CustomerOrgRegisterId { get; set; } } } diff --git a/src/Shentun.Peis.Application/CustomerOrgGroups/CustomerOrgGroupAppService.cs b/src/Shentun.Peis.Application/CustomerOrgGroups/CustomerOrgGroupAppService.cs index 2788699..2fc5384 100644 --- a/src/Shentun.Peis.Application/CustomerOrgGroups/CustomerOrgGroupAppService.cs +++ b/src/Shentun.Peis.Application/CustomerOrgGroups/CustomerOrgGroupAppService.cs @@ -53,7 +53,14 @@ namespace Shentun.Peis.CustomerOrgGroups /// public override async Task GetAsync(Guid id) { - return await base.GetAsync(id); + var userList = await _userRepository.GetListAsync(); + var entityDto = await base.GetAsync(id); + entityDto.CreatorName = EntityHelper.GetUserNameNoSql(userList, entityDto.CreatorId); + entityDto.LastModifierName = EntityHelper.GetUserNameNoSql(userList, entityDto.CreatorId); + + return entityDto; + + } /// /// 获取列表 团检分组 @@ -125,7 +132,8 @@ namespace Shentun.Peis.CustomerOrgGroups LastModifierName = EntityHelper.GetUserNameNoSql(userList, s.LastModifierId), CustomerOrgId = s.CustomerOrgRegister.CustomerOrgId, CustomerOrgName = s.CustomerOrgRegister.CustomerOrg.DisplayName, - MedicalTimes = s.CustomerOrgRegister.MedicalTimes + MedicalTimes = s.CustomerOrgRegister.MedicalTimes, + CustomerOrgRegisterId = s.CustomerOrgRegisterId }).ToList(); return new PagedResultDto(totalCount, entdto); @@ -143,7 +151,7 @@ namespace Shentun.Peis.CustomerOrgGroups [HttpPost("api/customerorggroup/createcustomerorggroupincustomerorgregister")] public async Task CreateCustomerOrgGroupInCustomerOrgRegisterAsync(CreateCustomerOrgGroupInCustomerOrgRegisterDto input) { - + var createEntity = ObjectMapper.Map(input); var entity = await _manager.CreateAsync(input.IsMaxMedicalTimes, input.CustomerOrgRegisterId, input.CustomerOrgId, createEntity); @@ -249,7 +257,8 @@ namespace Shentun.Peis.CustomerOrgGroups AgeUpperLimit = s.AgeUpperLimit, AgeLowerLimit = s.AgeLowerLimit, CreatorName = EntityHelper.GetUserNameNoSql(userList, s.CreatorId), - LastModifierName = EntityHelper.GetUserNameNoSql(userList, s.LastModifierId) + LastModifierName = EntityHelper.GetUserNameNoSql(userList, s.LastModifierId), + CustomerOrgRegisterId = CustomerOrgRegisterId }).ToList(); return entdto;