From 09ea54206b5453717f89d628a04319e31b0dfe51 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 5 Aug 2024 10:50:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=BC=E5=BC=8F=E5=8D=95?= =?UTF-8?q?=E7=9A=84=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.WMS.Core/Op/Method/OpFileService.cs | 2 +- .../Method/Draft/TaskDraftCompareService.cs | 17 +++++++++++++- .../Controllers/TaskDraftCompareController.cs | 23 ++++++++++++++++--- 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/OpFileService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/OpFileService.cs index edeca562..dd9fe0d3 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/OpFileService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/OpFileService.cs @@ -258,7 +258,7 @@ namespace DS.WMS.Core.Op.Method var fileAbsPath = string.Empty; if (string.IsNullOrEmpty(basePath)) { - dirAbs = Path.Combine(_environment.WebRootPath, relativePath); + dirAbs = Path.Combine(_environment.WebRootPath ?? "", relativePath); } else { diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/Draft/TaskDraftCompareService.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/Draft/TaskDraftCompareService.cs index 8aa50e00..366e414a 100644 --- a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/Draft/TaskDraftCompareService.cs +++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/Draft/TaskDraftCompareService.cs @@ -617,6 +617,8 @@ namespace DS.WMS.Core.TaskPlat.Method result = await GetDraftCompareResult(msgModel); + Logger.Log(NLog.LogLevel.Info, "获取用户信息 userid={uid} userid={username} tendid={tid} OrgId={OrgId}", user.UserId,user.UserName,user.TenantId,user.OrgId); + var lastFileInfo = tenantDb.Queryable().Where(a => a.LinkId == bookingId && a.TypeCode.Equals(CONST_DRAFT_FILE_CODE)) .OrderByDescending(a => a.CreateTime).First(); @@ -1094,7 +1096,20 @@ namespace DS.WMS.Core.TaskPlat.Method // new ModifyServiceProjectStatusDetailDto { StatusCode = "XHZBDCHG" } } //}); - //Logger.Log(NLog.LogLevel.Info, "异步推送下货纸比对状态完成,结果={rlt}", JsonConvert.SerializeObject(saveStatusRlt)); + var pushModel = new EmbedServiceProjectStatusDto + { + businessId = model.bookingId.ToString(), + SourceType = 1, + StatusCodes = new List { + new EmbedServiceProjectStatusDetailDto{ + StatusCode = "XHZBDCHG" + } + } + }; + + var saveStatusRlt = await _djyServiceStatusService.SaveServiceStatus(pushModel); + + Logger.Log(NLog.LogLevel.Info, "异步推送下货纸比对状态完成,结果={rlt}", JsonConvert.SerializeObject(saveStatusRlt)); } } #endregion diff --git a/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskDraftCompareController.cs b/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskDraftCompareController.cs index 99a7b515..d13b531b 100644 --- a/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskDraftCompareController.cs +++ b/ds-wms-service/DS.WMS.TaskApi/Controllers/TaskDraftCompareController.cs @@ -1,7 +1,9 @@ using DS.Module.Core.Attributes; using DS.WMS.Core.Op.Dtos; +using DS.WMS.Core.Op.Interface; using DS.WMS.Core.TaskPlat.Dtos; using DS.WMS.Core.TaskPlat.Interface; +using DS.WMS.Core.TaskPlat.Method; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using ThirdParty.Json.LitJson; @@ -14,10 +16,12 @@ namespace DS.WMS.TaskApi.Controllers public class TaskDraftCompareController : ApiController { private readonly ITaskDraftCompareService _taskDraftCompareService; + private readonly IOpFileService _opFileService; - public TaskDraftCompareController(ITaskDraftCompareService taskDraftCompareService) + public TaskDraftCompareController(ITaskDraftCompareService taskDraftCompareService, IOpFileService opFileService) { _taskDraftCompareService = taskDraftCompareService; + _opFileService = opFileService; } #region 执行邮件Draft比对 @@ -41,7 +45,7 @@ namespace DS.WMS.TaskApi.Controllers /// /// 订舱主键 /// 返回回执 - [HttpPost("GetDraftCompareResultInfo")] + [HttpGet("GetDraftCompareResultInfo")] public async Task GetDraftCompareResultInfo([FromQuery] long bookingId) { return await _taskDraftCompareService.GetDraftCompareResultInfo(bookingId); @@ -71,10 +75,23 @@ namespace DS.WMS.TaskApi.Controllers /// 请求详情 /// 返回回执 [HttpPost("SaveDraftCompareManual")] - public async Task SaveDraftCompareManual(TaskDraftCompareFeedBackDto model) + public async Task SaveDraftCompareManual([FromBody] TaskDraftCompareFeedBackDto model) { await _taskDraftCompareService.SaveDraftCompareManual(model); } #endregion + + #region 根据文件ID下载附件 + /// + /// 根据文件ID下载附件 + /// + /// 文件主键 + /// 返回数据流 + [HttpGet("DownloadFile")] + public async Task DownloadFile([FromQuery] long Id) + { + return await _opFileService.DownloadFile(Id.ToString()); + } + #endregion } }