diff --git a/src/Shentun.Peis.Application.Contracts/ThirdPartyPublicInterfaces/UpdateCheckNoInputDto.cs b/src/Shentun.Peis.Application.Contracts/ThirdPartyPublicInterfaces/UpdateCheckNoInputDto.cs new file mode 100644 index 0000000..26c9cd7 --- /dev/null +++ b/src/Shentun.Peis.Application.Contracts/ThirdPartyPublicInterfaces/UpdateCheckNoInputDto.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Shentun.Peis.ThirdPartyPublicInterfaces +{ + public class UpdateCheckNoInputDto + { + /// + /// 体检编号 + /// + public string tjbh { get; set; } + + /// + /// 1 登记 0 取消登记 + /// + public string zxpb { get; set; } + + } +} diff --git a/src/Shentun.Peis.Application/ThirdPartyPublicInterfaces/ThirdPartyPublicInterfaceAppService.cs b/src/Shentun.Peis.Application/ThirdPartyPublicInterfaces/ThirdPartyPublicInterfaceAppService.cs index 7f95956..709b32b 100644 --- a/src/Shentun.Peis.Application/ThirdPartyPublicInterfaces/ThirdPartyPublicInterfaceAppService.cs +++ b/src/Shentun.Peis.Application/ThirdPartyPublicInterfaces/ThirdPartyPublicInterfaceAppService.cs @@ -362,7 +362,8 @@ namespace Shentun.Peis.ThirdPartyPublicInterfaces CheckRequestNo = registerCheck.CheckRequestNo, asbitem, ItemTypeName = itemTypeHaveEmpty != null ? itemTypeHaveEmpty.DisplayName : "", - ItemTypeId = itemTypeHaveEmpty != null ? itemTypeHaveEmpty.Id.ToString() : "" + ItemTypeId = itemTypeHaveEmpty != null ? itemTypeHaveEmpty.Id.ToString() : "", + IsSignIn = registerCheck.IsSignIn }); @@ -391,6 +392,9 @@ namespace Shentun.Peis.ThirdPartyPublicInterfaces if (queryList.Count() == 0) throw new UserFriendlyException($"体检编号不存在"); + if (queryList.FirstOrDefault().IsSignIn == 'Y') + throw new UserFriendlyException($"体检编号已登记"); + var patientInfo = new PatientPacsInfo_PatientInfoDto { addr = "", @@ -424,5 +428,32 @@ namespace Shentun.Peis.ThirdPartyPublicInterfaces }; } + + /// + /// 更新检查单签收状态 + /// + /// + [HttpPost("api/Third/ThirdPartyPublicInterface/UpdateCheckNoState")] + public async Task UpdateCheckNoStateAsync(UpdateCheckNoInputDto input) + { + + var registerCheck = await _registerCheckRepository.FirstOrDefaultAsync(f => f.CheckRequestNo == input.tjbh); + if (registerCheck == null) + throw new UserFriendlyException($"体检编号不存在"); + + if (input.zxpb == "1") + { + registerCheck.IsSignIn = 'Y'; + registerCheck.SignInTime = DateTime.Now; + } + else if (input.zxpb == "0") + { + registerCheck.IsSignIn = 'N'; + registerCheck.SignInTime = DateTime.Now; + } + + await _registerCheckRepository.UpdateAsync(registerCheck); + } + } } diff --git a/src/Shentun.Peis.HttpApi.Host/Filter/CustomerActionFilterAttribute.cs b/src/Shentun.Peis.HttpApi.Host/Filter/CustomerActionFilterAttribute.cs index 7cc99d9..670ab54 100644 --- a/src/Shentun.Peis.HttpApi.Host/Filter/CustomerActionFilterAttribute.cs +++ b/src/Shentun.Peis.HttpApi.Host/Filter/CustomerActionFilterAttribute.cs @@ -57,7 +57,7 @@ namespace Shentun.Peis else { - List filterApiUrl = new List { "/api/third/thirdpartypublicinterface/getpatientitems" }; + List filterApiUrl = new List { "/api/third/thirdpartypublicinterface/getpatientitems", "api/third/thirdpartypublicinterface/updatechecknostate" }; if (filterApiUrl.Contains(context.HttpContext.Request.Path.ToString().ToLower())) { diff --git a/src/Shentun.Peis.HttpApi.Host/Filter/CustomerExceptionFilterAttribute.cs b/src/Shentun.Peis.HttpApi.Host/Filter/CustomerExceptionFilterAttribute.cs index 542cf55..595486c 100644 --- a/src/Shentun.Peis.HttpApi.Host/Filter/CustomerExceptionFilterAttribute.cs +++ b/src/Shentun.Peis.HttpApi.Host/Filter/CustomerExceptionFilterAttribute.cs @@ -87,7 +87,7 @@ namespace Shentun.Peis } - List filterApiUrl = new List { "/api/third/thirdpartypublicinterface/getpatientitems" }; + List filterApiUrl = new List { "/api/third/thirdpartypublicinterface/getpatientitems", "api/third/thirdpartypublicinterface/updatechecknostate" }; if (filterApiUrl.Contains(exceptionContext.HttpContext.Request.Path.ToString().ToLower()))