wet 2 years ago
commit e68c421571

@ -61,6 +61,12 @@ namespace Myshipping.Application.Entity
/// </summary>
[Description("ATTN邮箱")]
public string AttnMail { get; set; }
/// <summary>
/// ATTN传真
/// </summary>
[Description("ATTN传真")]
public string AttnFax { get; set; }
/// <summary>
/// FROM
/// </summary>
@ -77,6 +83,11 @@ namespace Myshipping.Application.Entity
[Description("FROM邮箱")]
public string FromMail { get; set; }
/// <summary>
/// FROM传真
/// </summary>
[Description("FROM传真")]
public string FromFax { get; set; }
/// <summary>
/// 吨数
/// </summary>
[Description("吨数")]
@ -190,7 +201,7 @@ namespace Myshipping.Application.Entity
/// 是否挂机
/// </summary>
[Description("是否挂机")]
public bool IsGuaJi { get; set; }
public bool IsGuaJi { get; set; } = false;
/// <summary>
/// 状态
/// </summary>
@ -252,5 +263,6 @@ namespace Myshipping.Application.Entity
/// </summary>
[Description("工厂地址")]
public string FactoryAddr { get; set; }
}
}

@ -15,6 +15,7 @@ using Myshipping.Core.Entity;
using Myshipping.Core.Service;
using MySqlX.XDevAPI.Common;
using NetTaste;
using Newtonsoft.Json.Linq;
using NPOI.OpenXmlFormats.Wordprocessing;
using NPOI.SS.Formula.Functions;
using Org.BouncyCastle.Crypto;
@ -41,13 +42,19 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<BookingTruckCtn> _bookingTruckContaRepository;
private readonly SqlSugarRepository<BookingOrder> _bookingOrderRepository;
private readonly SqlSugarRepository<BookingCtn> _bookingCtnRepository;
private readonly SqlSugarRepository<BookingPrintTemplate> _bookingPrintTemplateTemplate;
private readonly SqlSugarRepository<DjyUserConfig> _djyUserConfigConfig;
private readonly ITaskManageExternalService _taskManageExternalService;
const string PRINT_LIST_TYPE_KEY = "booking_truck_print_list";
public BookingTruckService(ISysCacheService cache, ILogger<BookingTruckService> logger,
SqlSugarRepository<BookingTruck> bookingTruckRepository,
SqlSugarRepository<BookingTruckCtn> bookingTruckContaRepository,
SqlSugarRepository<BookingOrder> bookingOrderRepository,
SqlSugarRepository<BookingCtn> bookingCtnRepository,
SqlSugarRepository<BookingPrintTemplate> bookingPrintTemplateTemplate,
SqlSugarRepository<DjyUserConfig> djyUserConfigConfig,
ITaskManageExternalService taskManageExternalService)
{
_cache = cache;
@ -59,6 +66,8 @@ namespace Myshipping.Application
_bookingCtnRepository = bookingCtnRepository;
_taskManageExternalService = taskManageExternalService;
_bookingPrintTemplateTemplate = bookingPrintTemplateTemplate;
_djyUserConfigConfig = djyUserConfigConfig;
}
/// <summary>
@ -649,6 +658,9 @@ namespace Myshipping.Application
messageInfo.Main.TaskUserId = UserManager.UserId.ToString();
messageInfo.Main.TaskUserName = UserManager.Name;
messageInfo.Main.RecvUserId = model.DispatcherId.ToString();
messageInfo.Main.RecvUserName = model.DispatcherName;
messageInfo.Main.TaskTitle = $"{model.MBLNo}_派车任务";
messageInfo.Main.TaskDesp = $"{model.MBLNo}_派车任务";
messageInfo.Main.TaskSource = TaskSourceEnum.CUSTOMER_SUBMIT;
@ -808,6 +820,7 @@ namespace Myshipping.Application
/// </summary>
/// <param name="ids">派车主键组</param>
/// <returns>返回回执</returns>
[HttpPost("/BookingTruck/CancelBatch")]
public async Task<TaskManageOrderResultDto> CancelBatch([FromBody] long[] ids)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
@ -867,7 +880,8 @@ namespace Myshipping.Application
}
catch (Exception ex)
{
result.succ = false;
result.msg = $"撤销派车异常,原因:{ex.Message}";
}
return result;
@ -986,6 +1000,7 @@ namespace Myshipping.Application
/// </summary>
/// <param name="id">派车主键</param>
/// <returns>返回回执</returns>
[HttpGet("/BookingTruck/Delete")]
public async Task<TaskManageOrderResultDto> Delete(long id)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
@ -1023,7 +1038,8 @@ namespace Myshipping.Application
/// </summary>
/// <param name="ids">派车主键组</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> DeleteBatch(long[] ids)
[HttpPost("/BookingTruck/DeleteBatch")]
public async Task<TaskManageOrderResultDto> DeleteBatch([FromBody]long[] ids)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
@ -1051,32 +1067,83 @@ namespace Myshipping.Application
}
catch (Exception ex)
{
result.succ = false;
result.msg = $"删除派车异常,原因:{ex.Message}";
}
return result;
}
/// <summary>
/// 打印派车
/// 获取订舱打印模板列表(带有当前用户打印历史排序)
/// </summary>
/// <param name="id">派车主键</param>
/// <returns>返回回执</returns>
[HttpGet("/BookingTruck/Print")]
public async Task<TaskManageOrderResultDto> Print(long id)
/// <param name="cateCode">分类代码使用字典【booking_template_category】中的代码</param>
/// <param name="printType">打印分类10FastReport、20Excel模板</param>
/// <returns></returns>
[HttpGet("/BookingTruck/PrintTemplateWithHistoryList")]
public async Task<dynamic> PrintTemplateWithHistoryList(string cateCode, BookingPrintTemplateType printType)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
var typeCode = printType.ToString();
//当前公司所有已配置的模板
var allList = await _bookingPrintTemplateTemplate.AsQueryable()
.Filter(null, true).InnerJoin<BookingPrinttemplateRight>((d, t) => d.Id == t.PrintTemplateId && t.SysUserId == UserManager.UserId)
.Where(d => d.TenantId == UserManager.TENANT_ID && d.CateCode.Contains(cateCode) && d.Type == typeCode)
.Select(d => new
{
d.Id,
d.CateCode,
d.CateName,
d.DisplayName
})
.ToListAsync();
var listReult = new List<dynamic>();
//当前用户打印历史数据
var printRecentListKey = $"{PRINT_LIST_TYPE_KEY}_{cateCode}_{printType}";
var usrCfg = await _djyUserConfigConfig.AsQueryable().FirstAsync(x => x.CreatedUserId == UserManager.UserId && x.Type == printRecentListKey);
if (usrCfg != null)
{
var arr = JArray.Parse(usrCfg.ConfigJson).Select(x => Convert.ToInt64(x)).ToList();
//按顺序加入到结果
arr.ForEach(x =>
{
var find = allList.FirstOrDefault(y => y.Id == x);
if (find != null)
{
listReult.Add(find);
}
});
var listOut = allList.Where(x => !arr.Contains(x.Id)).ToList();
listReult.AddRange(listOut);
return listReult;
}
catch (Exception ex)
else
{
return allList;
}
}
return result;
/// <summary>
/// 打印派车
/// </summary>
/// <param name="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("/BookingTruck/Print")]
public async Task<string> Print(long id, long templateId, string cateCode, int type = 1,
BookingPrintTemplateType printType = BookingPrintTemplateType.FastReport)
{
return string.Empty;
}

@ -49,6 +49,10 @@ namespace Myshipping.Application
/// </summary>
public string AttnMail { get; set; }
/// <summary>
/// ATTN传真
/// </summary>
public string AttnFax { get; set; }
/// <summary>
/// FROM
/// </summary>
public string FromName { get; set; }
@ -61,6 +65,10 @@ namespace Myshipping.Application
/// </summary>
public string FromMail { get; set; }
/// <summary>
/// FROM传真
/// </summary>
public string FromFax { get; set; }
/// <summary>
/// 吨数
/// </summary>
public Nullable<decimal> KGS { get; set; }

@ -44,6 +44,10 @@ namespace Myshipping.Application
/// </summary>
public string AttnMail { get; set; }
/// <summary>
/// ATTN传真
/// </summary>
public string AttnFax { get; set; }
/// <summary>
/// FROM
/// </summary>
public string FromName { get; set; }
@ -56,6 +60,10 @@ namespace Myshipping.Application
/// </summary>
public string FromMail { get; set; }
/// <summary>
/// FROM传真
/// </summary>
public string FromFax { get; set; }
/// <summary>
/// 吨数
/// </summary>
public Nullable<decimal> KGS { get; set; }

@ -108,8 +108,13 @@ namespace Myshipping.Application
/// 打印派车
/// </summary>
/// <param name="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>
Task<TaskManageOrderResultDto> Print(long id);
Task<string> Print(long id, long templateId, string cateCode, int type = 1,
BookingPrintTemplateType printType = BookingPrintTemplateType.FastReport);
}

@ -69,6 +69,16 @@ namespace Myshipping.Application
/// </summary>
public string TaskUserName { get; set; }
/// <summary>
/// 任务对应接收操作人ID
/// </summary>
public string RecvUserId { get; set; }
/// <summary>
/// 任务对应接收操作人名称
/// </summary>
public string RecvUserName { get; set; }
/// <summary>
/// 任务对应部门代码
/// </summary>

@ -48,6 +48,10 @@ namespace Myshipping.Application
/// </summary>
public string AttnMail { get; set; }
/// <summary>
/// ATTN传真
/// </summary>
public string AttnFax { get; set; }
/// <summary>
/// FROM
/// </summary>
public string FromName { get; set; }
@ -60,6 +64,10 @@ namespace Myshipping.Application
/// </summary>
public string FromMail { get; set; }
/// <summary>
/// FROM传真
/// </summary>
public string FromFax { get; set; }
/// <summary>
/// 吨数
/// </summary>
public Nullable<decimal> KGS { get; set; }

@ -41,6 +41,10 @@ namespace Myshipping.Application
/// </summary>
public string AttnMail { get; set; }
/// <summary>
/// ATTN传真
/// </summary>
public string AttnFax { get; set; }
/// <summary>
/// FROM
/// </summary>
public string FromName { get; set; }
@ -53,6 +57,10 @@ namespace Myshipping.Application
/// </summary>
public string FromMail { get; set; }
/// <summary>
/// FROM传真
/// </summary>
public string FromFax { get; set; }
/// <summary>
/// 吨数
/// </summary>
public Nullable<decimal> KGS { get; set; }

@ -238,7 +238,7 @@ namespace Myshipping.Application
TASK_TYPE = info.Main.TaskType.ToString(),
};
UserTendDto userTendInfo = GetUserTendInfo(info.Main.TaskUserId);
UserTendDto userTendInfo = GetUserTendInfo(info.Main.RecvUserId);
taskInfo.CreatedUserId = userTendInfo.userId;
taskInfo.CreatedUserName = userTendInfo.userName;

Loading…
Cancel
Save