wet 2 years ago
commit 683ee5f98c

@ -13200,6 +13200,13 @@
<param name="model">提单纸登记请求参数</param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.ITaskManageService.DownloadTaskAttach(System.String)">
<summary>
下载任务附件
</summary>
<param name="taskPKId"></param>
<returns>返回文件流</returns>
</member>
<member name="T:Myshipping.Application.TaskManageService">
<summary>
任务管理
@ -13326,5 +13333,12 @@
<param name="PKIds">任务主键数组</param>
<returns>返回结果</returns>
</member>
<member name="M:Myshipping.Application.TaskManageService.DownloadTaskAttach(System.String)">
<summary>
下载任务附件
</summary>
<param name="taskPKId"></param>
<returns>返回文件流</returns>
</member>
</members>
</doc>

@ -1671,11 +1671,12 @@ namespace Myshipping.Application
/// </summary>
/// <param name="bookingId">订舱Id</param>
/// <param name="templateId">打印模板ID</param>
/// <param name="cateCode">分类代码使用字典【booking_template_category】中的代码</param>
/// <param name="type">类型1pdf、2xlsx、3docx</param>
/// <param name="printType">打印类型10FastReport、20Excel模板</param>
/// <returns></returns>
[HttpGet("/BookingOrder/PrintOrder")]
public async Task<string> PrintOrder(long bookingId, long templateId, int type = 1, BookingPrintTemplateType printType = BookingPrintTemplateType.FastReport)
public async Task<string> PrintOrder(long bookingId, long templateId, string cateCode, int type = 1, BookingPrintTemplateType printType = BookingPrintTemplateType.FastReport)
{
var printTemplate = await _repPrintTemplate.AsQueryable().Filter(null, true).FirstAsync(x => x.Id == templateId);
if (printTemplate == null)
@ -1777,7 +1778,7 @@ namespace Myshipping.Application
//记录打印次数和时间,用于前端动态展示常用的打印类型
var printRecentListKey = $"{PrintRecentListTypeKey}_{printTemplate.CateCode}_{printType}";
var printRecentListKey = $"{PrintRecentListTypeKey}_{cateCode}_{printType}";
var usrCfg = _repUserConfig.AsQueryable().First(x => x.CreatedUserId == UserManager.UserId && x.Type == printRecentListKey);
if (usrCfg == null)
{

@ -470,12 +470,12 @@ namespace Myshipping.Application
}
//这里需要判断当前的品名分类是否已经对应到品名上,如果已有对应则不能直接作废
var existsList = _paraGoodsCategoryInfoRepository.AsQueryable()
.LeftJoin(_paraGoodsInfoRepository.AsQueryable(),(cate, goods) => cate.GOODS_CATEGORY == goods.GOODS_CATEGORY)
var existsList = _paraGoodsCategoryInfoRepository.EntityContext.Queryable<ParaGoodsCategoryInfo>()
.InnerJoin<ParaGoodsInfo>((cate, goods) => cate.GOODS_CATEGORY == goods.GOODS_CATEGORY)
.Where(cate => Ids.Contains(cate.Id))
.Select((cate, goods) => new { Cate = cate, Goods = goods }).ToList();
if(existsList.Any(t=>t.Goods != null))
if(existsList.Count > 0)
throw Oops.Oh($"以下分类代码已指定品名参数不能直接删除,{string.Join(",",existsList.Select(t=>t.Cate.GOODS_CATEGORY).Distinct().ToArray())}");
list.ForEach(async entity =>

@ -97,5 +97,19 @@ namespace Myshipping.Application
/// <returns></returns>
Task<TaskManageOrderResultDto> LaraPaperRegistPost(string taskPKId, LaraPaperRegistPostDto model);
/// <summary>
/// 下载任务附件
/// </summary>
/// <param name="taskPKId"></param>
/// <returns>返回文件流</returns>
IActionResult DownloadTaskAttach(string taskPKId);
///// <summary>
///// 正本附件批量打印
///// </summary>
///// <param name="PKIds">任务主键数组</param>
///// <returns>返回结果</returns>
//Task<TaskManageOrderResultDto> PrintBatch(string[] PKIds);
}
}

@ -27,6 +27,7 @@ using System.Collections.Generic;
using System.Dynamic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Reflection.Metadata.Ecma335;
using System.Runtime.InteropServices;
@ -1208,6 +1209,7 @@ namespace Myshipping.Application
/// <param name="taskPKId">任务主键</param>
/// <param name="model">提单纸登记请求参数</param>
/// <returns></returns>
[HttpPost("/TaskManage/LaraPaperRegistPost")]
public async Task<TaskManageOrderResultDto> LaraPaperRegistPost(string taskPKId, LaraPaperRegistPostDto model)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
@ -1536,7 +1538,36 @@ namespace Myshipping.Application
return result;
}
#endregion
/// <summary>
/// 下载任务附件
/// </summary>
/// <param name="taskPKId"></param>
/// <returns>返回文件流</returns>
[HttpGet("/TaskManage/DownloadTaskAttach")]
public IActionResult DownloadTaskAttach([FromQuery] string taskPKId)
{
FileStreamResult result = null;
var fileList = _taskFileInfoRepository.AsQueryable().Where(t => t.TASK_PKID == taskPKId).ToList();
var fileInfo = fileList.FirstOrDefault();
if (fileInfo.FILE_PATH.StartsWith("http://"))
{
WebClient wc = new WebClient();
var data = wc.DownloadData(fileInfo.FILE_PATH);
result = new FileStreamResult(new MemoryStream(data), "application/octet-stream") { FileDownloadName = fileInfo.FILE_NAME };
}
else if (System.IO.File.Exists(fileInfo.FILE_PATH))
{
result = new FileStreamResult(new FileStream(fileInfo.FILE_PATH, FileMode.Open), "application/octet-stream") { FileDownloadName = fileInfo.FILE_NAME };
}
return result;
}
}
public static class DraftPaperExtension

@ -51,7 +51,7 @@ namespace Myshipping.Core.Service
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/DjyApiAuth/sava")]
[HttpPost("/DjyApiAuth/save")]
public async Task<long> Save(SaveDjyApiAuthInput input)
{
DjyApiAuth entity = null;

Loading…
Cancel
Save