|
|
|
@ -2,14 +2,17 @@
|
|
|
|
|
using Furion.DistributedIDGenerator;
|
|
|
|
|
using Furion.DynamicApiController;
|
|
|
|
|
using Furion.FriendlyException;
|
|
|
|
|
using Furion.RemoteRequest;
|
|
|
|
|
using Mapster;
|
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
using Myshipping.Application.Entity;
|
|
|
|
|
using Myshipping.Core;
|
|
|
|
|
using MySqlX.XDevAPI.Common;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
@ -26,17 +29,29 @@ namespace Myshipping.Application
|
|
|
|
|
private readonly SqlSugarRepository<TaskBaseInfo> _taskBaseInfoRepository;
|
|
|
|
|
private readonly SqlSugarRepository<TaskSIFeedBackInfo> _taskSIFeedBackInfoRepository;
|
|
|
|
|
private readonly SqlSugarRepository<TaskSIFeedBackContaInfo> _taskSIFeedBackContaInfoRepository;
|
|
|
|
|
private readonly SqlSugarRepository<TaskBillFeeDetailInfo> _taskBillFeeDetailInfoRepository;
|
|
|
|
|
private readonly SqlSugarRepository<TaskFileInfo> _taskFileInfoRepository;
|
|
|
|
|
private readonly SqlSugarRepository<TaskEmailInfo> _taskEmailInfoRepository;
|
|
|
|
|
private readonly SqlSugarRepository<TaskVGMFeedBackInfo> _taskVGMFeedBackInfoRepository;
|
|
|
|
|
|
|
|
|
|
private readonly ILogger<BookingOrderService> _logger;
|
|
|
|
|
|
|
|
|
|
public TaskManageService(SqlSugarRepository<TaskBaseInfo> taskBaseInfoRepository,
|
|
|
|
|
SqlSugarRepository<TaskSIFeedBackInfo> taskSIFeedBackInfoRepository,
|
|
|
|
|
SqlSugarRepository<TaskSIFeedBackContaInfo> taskSIFeedBackContaInfoRepository,
|
|
|
|
|
SqlSugarRepository<TaskBillFeeDetailInfo> taskBillFeeDetailInfoRepository,
|
|
|
|
|
SqlSugarRepository<TaskFileInfo> taskFileInfoRepository,
|
|
|
|
|
SqlSugarRepository<TaskEmailInfo> taskEmailInfoRepository,
|
|
|
|
|
SqlSugarRepository<TaskVGMFeedBackInfo> taskVGMFeedBackInfoRepository,
|
|
|
|
|
ILogger<BookingOrderService> logger)
|
|
|
|
|
{
|
|
|
|
|
_taskBaseInfoRepository = taskBaseInfoRepository;
|
|
|
|
|
_taskSIFeedBackInfoRepository = taskSIFeedBackInfoRepository;
|
|
|
|
|
_taskSIFeedBackContaInfoRepository = taskSIFeedBackContaInfoRepository;
|
|
|
|
|
_taskBillFeeDetailInfoRepository = taskBillFeeDetailInfoRepository;
|
|
|
|
|
_taskFileInfoRepository = taskFileInfoRepository;
|
|
|
|
|
_taskEmailInfoRepository = taskEmailInfoRepository;
|
|
|
|
|
_taskVGMFeedBackInfoRepository = taskVGMFeedBackInfoRepository;
|
|
|
|
|
|
|
|
|
|
_logger = logger;
|
|
|
|
|
}
|
|
|
|
@ -120,6 +135,52 @@ namespace Myshipping.Application
|
|
|
|
|
//新增
|
|
|
|
|
await _taskBaseInfoRepository.InsertAsync(taskInfo);
|
|
|
|
|
|
|
|
|
|
//附件
|
|
|
|
|
if(info.Main.FileList != null && info.Main.FileList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
info.Main.FileList.ForEach(async file => {
|
|
|
|
|
var fileInfo = new TaskFileInfo();
|
|
|
|
|
|
|
|
|
|
fileInfo.PK_ID = IDGen.NextID().ToString();
|
|
|
|
|
fileInfo.TASK_PKID = taskInfo.PK_ID;
|
|
|
|
|
|
|
|
|
|
fileInfo.CreatedTime = taskInfo.CreatedTime;
|
|
|
|
|
fileInfo.UpdatedTime = taskInfo.CreatedTime;
|
|
|
|
|
|
|
|
|
|
fileInfo.FILE_PATH = file.FilePath;
|
|
|
|
|
fileInfo.FILE_NAME = file.FileName;
|
|
|
|
|
fileInfo.FILE_TYPE = file.FileType;
|
|
|
|
|
|
|
|
|
|
if(string.IsNullOrWhiteSpace(fileInfo.FILE_NAME))
|
|
|
|
|
{
|
|
|
|
|
var fileModel = new FileInfo(file.FilePath);
|
|
|
|
|
|
|
|
|
|
fileInfo.FILE_NAME = fileModel.Name;
|
|
|
|
|
fileInfo.FILE_TYPE = fileModel.Extension?.Replace(".","");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await _taskFileInfoRepository.InsertAsync(fileInfo);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//邮件
|
|
|
|
|
if (info.Main.EmailList != null && info.Main.EmailList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
info.Main.EmailList.ForEach(async email => {
|
|
|
|
|
var emailInfo = new TaskEmailInfo();
|
|
|
|
|
|
|
|
|
|
emailInfo.PK_ID = IDGen.NextID().ToString();
|
|
|
|
|
emailInfo.TASK_PKID = taskInfo.PK_ID;
|
|
|
|
|
|
|
|
|
|
emailInfo.CreatedTime = taskInfo.CreatedTime;
|
|
|
|
|
emailInfo.UpdatedTime = taskInfo.CreatedTime;
|
|
|
|
|
|
|
|
|
|
emailInfo.MAIL_PATH = email.MailPath;
|
|
|
|
|
|
|
|
|
|
await _taskEmailInfoRepository.InsertAsync(emailInfo);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//SI反馈入库
|
|
|
|
|
if (info.Main.TaskType == TaskBaseTypeEnum.SI_FEEDBACK)
|
|
|
|
|
{
|
|
|
|
@ -153,6 +214,41 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//费用明细
|
|
|
|
|
if(info.Main.TaskType == TaskBaseTypeEnum.INVOICE_BILL_MAIL || info.Main.TaskType == TaskBaseTypeEnum.PER_BILL)
|
|
|
|
|
{
|
|
|
|
|
if (info.Main.FeeList != null && info.Main.FeeList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
info.Main.FeeList.ForEach(async fee => {
|
|
|
|
|
var feeInfo = fee.Adapt<TaskBillFeeDetailInfo>();
|
|
|
|
|
|
|
|
|
|
feeInfo.PK_ID = IDGen.NextID().ToString();
|
|
|
|
|
feeInfo.TASK_PKID = taskInfo.PK_ID;
|
|
|
|
|
|
|
|
|
|
feeInfo.CreatedTime = taskInfo.CreatedTime;
|
|
|
|
|
feeInfo.UpdatedTime = taskInfo.CreatedTime;
|
|
|
|
|
|
|
|
|
|
await _taskBillFeeDetailInfoRepository.InsertAsync(feeInfo);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//VGM反馈入库
|
|
|
|
|
if (info.Main.VGMFeedBackList != null && info.Main.VGMFeedBackList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
info.Main.VGMFeedBackList.ForEach(async vgm => {
|
|
|
|
|
var vgmInfo = vgm.Adapt<TaskVGMFeedBackInfo>();
|
|
|
|
|
|
|
|
|
|
vgmInfo.PK_ID = IDGen.NextID().ToString();
|
|
|
|
|
vgmInfo.TASK_PKID = taskInfo.PK_ID;
|
|
|
|
|
|
|
|
|
|
vgmInfo.CreatedTime = taskInfo.CreatedTime;
|
|
|
|
|
vgmInfo.UpdatedTime = taskInfo.CreatedTime;
|
|
|
|
|
|
|
|
|
|
await _taskVGMFeedBackInfoRepository.InsertAsync(vgmInfo);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.succ = true;
|
|
|
|
|
result.msg = "新增任务成功";
|
|
|
|
|
}
|
|
|
|
@ -163,5 +259,45 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取查询参数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="ParaType">参数类型 STATUS-任务状态;TASK_TYPE-任务类型;SOURCE-任务来源</param>
|
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
|
/// <example>TASK_TYPE</example>
|
|
|
|
|
[HttpGet("/TaskManage/GetParaInfo")]
|
|
|
|
|
public async Task<TaskManageOrderResultDto> GetParaInfo([QueryString]string ParaType)
|
|
|
|
|
{
|
|
|
|
|
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Dictionary<int, string> dict = new Dictionary<int, string>();
|
|
|
|
|
|
|
|
|
|
if (ParaType == "STATUS")
|
|
|
|
|
{
|
|
|
|
|
dict = EnumUtil.GetEnumDictionary(typeof(TaskStatusEnum));
|
|
|
|
|
}
|
|
|
|
|
else if (ParaType == "TASK_TYPE")
|
|
|
|
|
{
|
|
|
|
|
dict = EnumUtil.GetEnumDictionary(typeof(TaskBusiTypeEnum));
|
|
|
|
|
}
|
|
|
|
|
else if (ParaType == "SOURCE")
|
|
|
|
|
{
|
|
|
|
|
dict = EnumUtil.GetEnumDictionary(typeof(TaskSourceEnum));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.succ = true;
|
|
|
|
|
result.rows = dict.Select(t => new { Code = t.Value.ToString(), Name = t.Key }).ToList();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.succ = false;
|
|
|
|
|
result.msg = ex.Message;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|