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 } }