Browse Source

添加一个方法修改api缓存进度

develop-lawyerExampaper
胡超1 2 years ago
parent
commit
4c3b8a5937
  1. 37
      24Hour/Controllers/Common/LawyerArchivesUnAuthorizeController.cs

37
24Hour/Controllers/Common/LawyerArchivesUnAuthorizeController.cs

@ -4,6 +4,8 @@ using Elight.Entity.APPDto.Lawyer;
using Elight.Entity.AppMode.Lawyer;
using Elight.Logic;
using Elight.Utility.Code;
using Elight.Utility.logs;
using java.util;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
@ -82,6 +84,41 @@ namespace _24Hour.Controllers.Common
result.IsSucceed = true;
return result;
}
/// <summary>
/// 上传一体机的文件缓存状态
/// </summary>
/// <param name="dic"></param>
/// <returns></returns>
[HttpPost("UploadWJDownloadStatus")]
public async Task<Result> UploadWJDownloadStatus(IEnumerable<LawyerArchivesDto> dtos)
{
var result = new Result();
try
{
_db.BeginTran();
var updatelist = await _db.Queryable<LawyerArchives>().In(q => q.jzlbxxId, dtos.Select(x => x.jzlbxxId).ToList()).ToListAsync();
updatelist.ForEach(q =>
{
var value = dtos.FirstOrDefault(x => x.jzlbxxId == q.jzlbxxId);
q.downloadedCount = value?.downloadedCount;
});
var num = await _db.Updateable(updatelist).ExecuteCommandAsync();
_db.CommitTran();
if (num > 0)
{
result.IsSucceed = true;
result.result = "更新成功";
}
}
catch (System.Exception ex)
{
_db.RollbackTran();
result.IsSucceed = false;
result.Message = ex.Message;
}
return result;
}
/// <summary>
/// 解密字符串信息
/// </summary>

Loading…
Cancel
Save