From 4c3b8a59373ba0d0b4d2371c15cda3a0f486b2ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=87=E9=98=B3=20=E9=82=B9?= Date: Tue, 31 Oct 2023 09:08:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E4=BF=AE=E6=94=B9api=E7=BC=93=E5=AD=98=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LawyerArchivesUnAuthorizeController.cs | 45 +++++++++++++++++-- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/24Hour/Controllers/Common/LawyerArchivesUnAuthorizeController.cs b/24Hour/Controllers/Common/LawyerArchivesUnAuthorizeController.cs index 4deb315..5508f6d 100644 --- a/24Hour/Controllers/Common/LawyerArchivesUnAuthorizeController.cs +++ b/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; @@ -44,7 +46,7 @@ namespace _24Hour.Controllers.Common .Where(x => x.IsDeleted == 0) .Where(x => x.status != 2 && x.permissibleEndTime > DateTime.Now) .Where(x => x.unitcode == unitcode) - .Where(x=>x.IsDeleted==0) + .Where(x => x.IsDeleted == 0) .ToListAsync(); var data = mapper.Map>(list); res.result = data; @@ -67,7 +69,7 @@ namespace _24Hour.Controllers.Common var dtos = mapper.Map>(list); var listdata = dtos.Select(x => new { - jzid=x.Id, + jzid = x.Id, files = x.jzml.OrderBy(x => x.mlsxh) .SelectMany(e => e.jzwj.OrderBy(x => x.wjsxh)) .Select((q) => new @@ -82,6 +84,41 @@ namespace _24Hour.Controllers.Common result.IsSucceed = true; return result; } + /// + /// 上传一体机的文件缓存状态 + /// + /// + /// + [HttpPost("UploadWJDownloadStatus")] + public async Task UploadWJDownloadStatus(IEnumerable dtos) + { + var result = new Result(); + try + { + _db.BeginTran(); + var updatelist = await _db.Queryable().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; + } + /// /// 解密字符串信息 /// @@ -98,9 +135,9 @@ namespace _24Hour.Controllers.Common result.IsSucceed = true; return Task.FromResult(result); } - catch(Exception ex) + catch (Exception ex) { - logger.LogError(ex,""); + logger.LogError(ex, ""); result.IsSucceed = false; return Task.FromResult(result); }