# Conflicts:
#	Myshipping.Application/Service/BookingOrder/BookingOrderService.cs
optimize
wanghaomei 1 year ago
commit 569811f48a

@ -1,32 +0,0 @@
using System;
using SqlSugar;
using System.ComponentModel;
using Myshipping.Core.Entity;
namespace Myshipping.Application.Entity
{
/// <summary>
/// 订舱打印模板分享
/// </summary>
[SugarTable("booking_template_share")]
[Description("订舱打印模板分享")]
public class BookingPrintTemplateShare : DBEntityTenant
{
/// <summary>
/// 模板id
/// </summary>
public long TemplateId { get; set; }
/// <summary>
/// 分享用户Id
/// </summary>
public long ShareToId { get; set; }
/// <summary>
/// 分享用户
/// </summary>
public string ShareToName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -492,9 +492,9 @@ namespace Myshipping.Application
{ {
itconfig.RemoveAll(x => x.ConfigId == ii.ConfigId); itconfig.RemoveAll(x => x.ConfigId == ii.ConfigId);
} }
item.IsVGM = itgoods.Where(x => x.StatusName == "提交VGM").FirstOrDefault() == null ? null : itgoods.Where(x => x.StatusName == "提交VGM").Select(x => x.FinishTime).FirstOrDefault(); item.IsVGM=itgoods.Where(x => x.SystemCode == "YFVGM").FirstOrDefault()==null?null: itgoods.Where(x => x.SystemCode == "YFVGM").Select(x=>x.FinishTime).FirstOrDefault();
item.IsCanDan = itgoods.Where(x => x.StatusName == "提交舱单").FirstOrDefault() == null ? null : itgoods.Where(x => x.StatusName == "提交舱单").Select(x => x.FinishTime).FirstOrDefault(); item.IsCanDan = itgoods.Where(x => x.SystemCode == "YFCD").FirstOrDefault() == null ? null : itgoods.Where(x => x.SystemCode == "YFCD").Select(x => x.FinishTime).FirstOrDefault();
item.IsZZFX = itgoods.Where(x => x.StatusName == "装载放行").FirstOrDefault() == null ? null : itgoods.Where(x => x.StatusName == "装载放行").Select(x => x.FinishTime).FirstOrDefault(); item.IsZZFX = itgoods.Where(x => x.SystemCode == "ZZFX").FirstOrDefault() == null ? null : itgoods.Where(x => x.SystemCode == "ZZFX").Select(x => x.FinishTime).FirstOrDefault();
item.GoodsStatusList = itgoods.Union<GoodsStatusList>(itconfig).OrderBy(x => x.Sort).ToList(); item.GoodsStatusList = itgoods.Union<GoodsStatusList>(itconfig).OrderBy(x => x.Sort).ToList();
////获取提箱返场状态 ////获取提箱返场状态
//var statuslog = statusloglist.Where(x => x.BookingId == item.Id).OrderByDescending(x => x.CreatedTime).ToList(); //var statuslog = statusloglist.Where(x => x.BookingId == item.Id).OrderByDescending(x => x.CreatedTime).ToList();
@ -871,9 +871,9 @@ namespace Myshipping.Application
{ {
itconfig.RemoveAll(x => x.ConfigId == ii.ConfigId); itconfig.RemoveAll(x => x.ConfigId == ii.ConfigId);
} }
item.IsVGM = itgoods.Where(x => x.StatusName == "提交VGM").FirstOrDefault() == null ? null : itgoods.Where(x => x.StatusName == "提交VGM").Select(x => x.FinishTime).FirstOrDefault(); item.IsVGM = itgoods.Where(x => x.SystemCode == "YFVGM").FirstOrDefault() == null ? null : itgoods.Where(x => x.SystemCode == "YFVGM").Select(x => x.FinishTime).FirstOrDefault();
item.IsCanDan = itgoods.Where(x => x.StatusName == "提交舱单").FirstOrDefault() == null ? null : itgoods.Where(x => x.StatusName == "提交舱单").Select(x => x.FinishTime).FirstOrDefault(); item.IsCanDan = itgoods.Where(x => x.SystemCode == "YFCD").FirstOrDefault() == null ? null : itgoods.Where(x => x.SystemCode == "YFCD").Select(x => x.FinishTime).FirstOrDefault();
item.IsZZFX = itgoods.Where(x => x.StatusName == "装载放行").FirstOrDefault() == null ? null : itgoods.Where(x => x.StatusName == "装载放行").Select(x => x.FinishTime).FirstOrDefault(); item.IsZZFX = itgoods.Where(x => x.SystemCode == "ZZFX").FirstOrDefault() == null ? null : itgoods.Where(x => x.SystemCode == "ZZFX").Select(x => x.FinishTime).FirstOrDefault();
item.GoodsStatusList = itgoods.Union<GoodsStatusList>(itconfig).OrderBy(x => x.Sort).ToList(); item.GoodsStatusList = itgoods.Union<GoodsStatusList>(itconfig).OrderBy(x => x.Sort).ToList();
//获取提箱返场状态 //获取提箱返场状态
//var statuslog = statusloglist.Where(x => x.BookingId == item.Id).OrderByDescending(x => x.CreatedTime).ToList(); //var statuslog = statusloglist.Where(x => x.BookingId == item.Id).OrderByDescending(x => x.CreatedTime).ToList();

@ -36,10 +36,10 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<BookingOrder> _repOrder; private readonly SqlSugarRepository<BookingOrder> _repOrder;
private readonly SqlSugarRepository<BookingPrintTemplate> _repPrintTemplate; private readonly SqlSugarRepository<BookingPrintTemplate> _repPrintTemplate;
private readonly SqlSugarRepository<BookingPrintTemplateShare> _repPrintTemplateShare; private readonly SqlSugarRepository<BookingTemplateShare> _repPrintTemplateShare;
private readonly ILogger<BookingTemplate> _logger; private readonly ILogger<BookingTemplate> _logger;
public BookingTemplateService(SqlSugarRepository<BookingTemplate> rep, SqlSugarRepository<BookingOrder> repOrder, SqlSugarRepository<BookingPrintTemplate> repPrintTemplate, SqlSugarRepository<BookingPrintTemplateShare> repPrintTemplateShare,ILogger<BookingTemplate> logger) public BookingTemplateService(SqlSugarRepository<BookingTemplate> rep, SqlSugarRepository<BookingOrder> repOrder, SqlSugarRepository<BookingPrintTemplate> repPrintTemplate, SqlSugarRepository<BookingTemplateShare> repPrintTemplateShare,ILogger<BookingTemplate> logger)
{ {
@ -133,7 +133,7 @@ namespace Myshipping.Application
/// <param name="dto"></param> /// <param name="dto"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost("/BookingTemplate/SaveTemplateShare")] [HttpPost("/BookingTemplate/SaveTemplateShare")]
public async Task SaveTemplateShare(List<BookingPrintTemplateShareDto> dto) public async Task SaveTemplateShare(List<BookingTemplateShareDto> dto)
{ {
if (dto==null|| dto.Count==0) { if (dto==null|| dto.Count==0) {
@ -141,7 +141,7 @@ namespace Myshipping.Application
} }
foreach (var item in dto) foreach (var item in dto)
{ {
var entity = item.Adapt<BookingPrintTemplateShare>(); var entity = item.Adapt<BookingTemplateShare>();
if (entity.Id == 0) if (entity.Id == 0)
{ {
@ -184,12 +184,15 @@ namespace Myshipping.Application
/// 获取分享列表 /// 获取分享列表
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public async Task<dynamic> GetTemplateShare() { [HttpGet("/BookingTemplate/GetTemplateShare")]
public async Task<dynamic> GetTemplateShare(string TemplateName)
{
var TemplateIds=_repPrintTemplateShare.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.ShareToId == UserManager.UserId).Select(x => x.TemplateId).ToList();
var list =await _rep.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && (TemplateIds.Contains(x.Id) || x.CreatedUserId == UserManager.UserId)).
WhereIF(!string.IsNullOrEmpty(TemplateName),x=>x.Title.Contains(TemplateName)).ToListAsync();
return null; return list;
} }
} }

@ -64,7 +64,7 @@ namespace Myshipping.Application
/// <summary> /// <summary>
/// 订舱模板修改输入参数 /// 订舱模板修改输入参数
/// </summary> /// </summary>
public class UpdateBookingTemplateInput: BookingTemplateInput public class UpdateBookingTemplateInput : BookingTemplateInput
{ {
/// <summary> /// <summary>
/// 主键 /// 主键
@ -92,7 +92,7 @@ namespace Myshipping.Application
/// </summary> /// </summary>
public class QueryBookingTemplateInput : PageInputBase public class QueryBookingTemplateInput : PageInputBase
{ {
/// <summary> /// <summary>
/// 标题 /// 标题
@ -104,11 +104,12 @@ namespace Myshipping.Application
/// </summary> /// </summary>
public virtual string Type { get; set; } public virtual string Type { get; set; }
} }
public class BookingPrintTemplateShareDto { public class BookingTemplateShareDto
{
/// <summary> /// <summary>
@ -138,4 +139,15 @@ namespace Myshipping.Application
} }
public class BookingTemplateShareQuery
{
public string TemplateName { get; set; }
public string ShareToId { get; set; }
}
} }

Loading…
Cancel
Save