系统通知统计
This commit is contained in:
@@ -84,7 +84,9 @@ namespace IRaCIS.Core.Application
|
||||
|
||||
|
||||
TotalSystemNoticeCount= _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin
|
||||
? 0:await _systemNoticeRepository.Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum== Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished).CountAsync(),
|
||||
? 0:await _systemNoticeRepository.Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum== Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished)
|
||||
.Where(t => t.EndDate == null || t.EndDate != null && t.EndDate > DateTime.Now)
|
||||
.CountAsync(),
|
||||
|
||||
NeedReadSystemNoticeCount = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin
|
||||
? 0 : await _systemNoticeRepository.Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
using IRaCIS.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
|
||||
namespace IRaCIS.Core.Application
|
||||
@@ -52,54 +50,7 @@ namespace IRaCIS.Core.Application
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 签名认证 +
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> VerifySignature(SignDTO signDTO)
|
||||
{
|
||||
|
||||
var user = await _repository.FirstOrDefaultAsync<User>(u => u.UserName == signDTO.UserName && u.Password == signDTO.PassWord);
|
||||
if (user == null)
|
||||
{
|
||||
return ResponseOutput.NotOk("password error");
|
||||
}
|
||||
else if (user.Status == UserStateEnum.Disable)
|
||||
{
|
||||
return ResponseOutput.NotOk("The user has been disabled!");
|
||||
}
|
||||
|
||||
//if (signDTO.IsAddSignData)
|
||||
//{
|
||||
// 记录签名信息
|
||||
var add = await _repository.AddAsync(_mapper.Map<TrialSign>(signDTO));
|
||||
|
||||
await _repository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok(add.Id);
|
||||
//}
|
||||
|
||||
//return ResponseOutput.Ok();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 业务接口操作成功后, 让签署数据生效
|
||||
/// </summary>
|
||||
/// <param name="signId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut("{signId:guid}")]
|
||||
[Obsolete]
|
||||
public async Task<IResponseOutput> MakeSignEffective(Guid signId)
|
||||
{
|
||||
var success = await _repository.BatchUpdateAsync<TrialSign>(t => t.Id == signId, u => new TrialSign() { IsCompleted = true });
|
||||
|
||||
return ResponseOutput.Result(success);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -299,8 +250,6 @@ namespace IRaCIS.Core.Application
|
||||
},true);
|
||||
|
||||
|
||||
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
@@ -387,8 +336,7 @@ namespace IRaCIS.Core.Application
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region 调整废弃
|
||||
[Obsolete]
|
||||
[HttpPost("{trialId:guid}/{type}")]
|
||||
public async Task<IResponseOutput> UploadTrialFile(IFormFile file, string type, Guid trialId, [FromServices] IWebHostEnvironment _hostEnvironment)
|
||||
@@ -423,6 +371,59 @@ namespace IRaCIS.Core.Application
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 签名认证 +
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Obsolete]
|
||||
public async Task<IResponseOutput> VerifySignature(SignDTO signDTO)
|
||||
{
|
||||
|
||||
var user = await _repository.FirstOrDefaultAsync<User>(u => u.UserName == signDTO.UserName && u.Password == signDTO.PassWord);
|
||||
if (user == null)
|
||||
{
|
||||
return ResponseOutput.NotOk("password error");
|
||||
}
|
||||
else if (user.Status == UserStateEnum.Disable)
|
||||
{
|
||||
return ResponseOutput.NotOk("The user has been disabled!");
|
||||
}
|
||||
|
||||
//if (signDTO.IsAddSignData)
|
||||
//{
|
||||
// 记录签名信息
|
||||
var add = await _repository.AddAsync(_mapper.Map<TrialSign>(signDTO));
|
||||
|
||||
await _repository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok(add.Id);
|
||||
//}
|
||||
|
||||
//return ResponseOutput.Ok();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 业务接口操作成功后, 让签署数据生效
|
||||
/// </summary>
|
||||
/// <param name="signId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut("{signId:guid}")]
|
||||
[Obsolete]
|
||||
public async Task<IResponseOutput> MakeSignEffective(Guid signId)
|
||||
{
|
||||
var success = await _repository.BatchUpdateAsync<TrialSign>(t => t.Id == signId, u => new TrialSign() { IsCompleted = true });
|
||||
|
||||
return ResponseOutput.Result(success);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user