optimize
wet 2 years ago
parent 2daf45cf56
commit 31b9ba2204

@ -113,6 +113,7 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<DjyCustomer> _djycustomer; private readonly SqlSugarRepository<DjyCustomer> _djycustomer;
private readonly SqlSugarRepository<BookingTemplate> _bookingTemplate; private readonly SqlSugarRepository<BookingTemplate> _bookingTemplate;
private readonly SqlSugarRepository<ParaGoodsInfo> _paraGoodsInfoRepository; private readonly SqlSugarRepository<ParaGoodsInfo> _paraGoodsInfoRepository;
private readonly SqlSugarRepository<ParaContractNoInfo> _paraContractNoInfoRepository;
private readonly IHttpContextAccessor _httpContextAccessor; private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IBookingGoodsStatusConfigService _GoodsConfig; private readonly IBookingGoodsStatusConfigService _GoodsConfig;
const string CONST_MAPPING_MODULE = "BOOK_OR_CLOSING"; const string CONST_MAPPING_MODULE = "BOOK_OR_CLOSING";
@ -128,7 +129,7 @@ namespace Myshipping.Application
SqlSugarRepository<BookingOrderUrl> repOrderUrl, SqlSugarRepository<BookingOrderContact> repOrderContact, SqlSugarRepository<BookingSampleBill> repSampleBill, SqlSugarRepository<DjyCustomer> djycustomer, SqlSugarRepository<BookingOrderUrl> repOrderUrl, SqlSugarRepository<BookingOrderContact> repOrderContact, SqlSugarRepository<BookingSampleBill> repSampleBill, SqlSugarRepository<DjyCustomer> djycustomer,
SqlSugarRepository<BookingExcelTemplate> excelrep, SqlSugarRepository<DjyUserMailAccount> repUserMail, SqlSugarRepository<BookingGoodsStatus> goodsStatus, SqlSugarRepository<BookingGoodsStatusConfig> goodsStatusConfig, SqlSugarRepository<BookingExcelTemplate> excelrep, SqlSugarRepository<DjyUserMailAccount> repUserMail, SqlSugarRepository<BookingGoodsStatus> goodsStatus, SqlSugarRepository<BookingGoodsStatusConfig> goodsStatusConfig,
SqlSugarRepository<SysTenant> repTenant, SqlSugarRepository<BookingStatus> repBookingStatus, SqlSugarRepository<BookingEDIExt> bookingEDIExt, SqlSugarRepository<BookingServiceItem> serviceItem, SqlSugarRepository<SysTenant> repTenant, SqlSugarRepository<BookingStatus> repBookingStatus, SqlSugarRepository<BookingEDIExt> bookingEDIExt, SqlSugarRepository<BookingServiceItem> serviceItem,
IHttpContextAccessor httpContextAccessor, IBookingGoodsStatusConfigService GoodsConfig) SqlSugarRepository<ParaContractNoInfo> paraContractNoInfoRepository, IHttpContextAccessor httpContextAccessor, IBookingGoodsStatusConfigService GoodsConfig)
{ {
this._logger = logger; this._logger = logger;
this._rep = rep; this._rep = rep;
@ -162,6 +163,7 @@ namespace Myshipping.Application
this._bookingTemplate = bookingTemplate; this._bookingTemplate = bookingTemplate;
this._djycustomer = djycustomer; this._djycustomer = djycustomer;
this._paraGoodsInfoRepository = paraGoodsInfoRepository; this._paraGoodsInfoRepository = paraGoodsInfoRepository;
this._paraContractNoInfoRepository = paraContractNoInfoRepository;
_httpContextAccessor = httpContextAccessor; _httpContextAccessor = httpContextAccessor;
_GoodsConfig = GoodsConfig; _GoodsConfig = GoodsConfig;
} }
@ -5150,11 +5152,6 @@ namespace Myshipping.Application
return allData; return allData;
} }
#endregion
/// <summary> /// <summary>
///获取下拉前10条接口 ///获取下拉前10条接口
/// </summary> /// </summary>
@ -5173,7 +5170,7 @@ namespace Myshipping.Application
var GWDL = _djycustomer.Where(x => x.PropString.Contains("out_agent")).Take(10).ToList(); var GWDL = _djycustomer.Where(x => x.PropString.Contains("out_agent")).Take(10).ToList();
//仓库 //仓库
var CK = _djycustomer.Where(x => x.PropString.Contains("warehouse") ).Take(10).ToList(); var CK = _djycustomer.Where(x => x.PropString.Contains("warehouse")).Take(10).ToList();
var Portload = _cache.GetAllCodePortLoad().Result.Take(10).ToList(); var Portload = _cache.GetAllCodePortLoad().Result.Take(10).ToList();
@ -5184,9 +5181,9 @@ namespace Myshipping.Application
var Customer = _djycustomer.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID).Take(10).ToList(); var Customer = _djycustomer.AsQueryable().Filter(null, true).Where(x => x.TenantId == UserManager.TENANT_ID).Take(10).ToList();
var Forwarder = _cache.GetAllCodeForwarder().Result.Take(10).ToList(); var Forwarder = _cache.GetAllCodeForwarder().Result.Take(10).ToList();
var Contractno = _paraGoodsInfoRepository.AsQueryable().OrderBy("GOODS_CODE asc").Take(50).ToList().Select(t => t.Adapt<ParaGoodsShowDto>()).ToList(); var GoodsName = _paraGoodsInfoRepository.AsQueryable().OrderBy("GOODS_CODE asc").Take(50).ToList().Select(t => t.Adapt<ParaGoodsShowDto>()).ToList();
var superAdmin = UserManager.IsSuperAdmin; var superAdmin = UserManager.IsSuperAdmin;
var contractno = _paraContractNoInfoRepository.AsQueryable().Take(10).Select(t => t.Adapt<ParaGoodsCategoryShowDto>()).ToList();
var User = _repUser.AsQueryable().InnerJoin<SysEmp>((u, e) => u.Id == e.Id) var User = _repUser.AsQueryable().InnerJoin<SysEmp>((u, e) => u.Id == e.Id)
.InnerJoin<SysOrg>((u, e, o) => e.OrgId == o.Id) .InnerJoin<SysOrg>((u, e, o) => e.OrgId == o.Id)
.InnerJoin<SysTenant>((u, e, o, t) => u.TenantId == t.Id) .InnerJoin<SysTenant>((u, e, o, t) => u.TenantId == t.Id)
@ -5203,13 +5200,20 @@ namespace Myshipping.Application
Port = Port, Port = Port,
Template = Template, Template = Template,
Customer = Customer, Customer = Customer,
Contractno = Contractno, GoodsName = GoodsName,
User = User, User = User,
Forwarder= Forwarder, Forwarder = Forwarder,
Service= Service Service = Service,
contractno = contractno
}; };
return obj; return obj;
} }
#endregion
} }
} }

@ -1867,19 +1867,50 @@ namespace Myshipping.Application
#region 下载数据 #region 下载数据
#endregion #endregion
#region 其他 #region 其他
/// <summary> /// <summary>
/// 测试用 ///
/// </summary> /// </summary>
/// <param name="ids"></param>
/// <returns></returns> /// <returns></returns>
[HttpGet("/DataSync/Test"), ApiUser(ApiCode = "Test")] [NonAction]
public async Task<string> Test() public async Task<List<SyncBookingOrderDto>> SendBookingOrder(List<long> ids) {
{
return $"当前用户:{UserManager.UserId} {UserManager.Name} ,当前租户:{UserManager.TENANT_ID} {UserManager.TENANT_NAME},管理员类型:{(UserManager.IsSuperAdmin ? "" : (UserManager.IsTenantAdmin ? "" : ""))}";
if (ids.Count()==0) {
throw Oops.Bah("请上传正确数据");
}
var dto = await _rep.AsQueryable().Filter(null, true).Where(x => ids.Contains(x.Id) && x.TenantId == UserManager.TENANT_ID && x.ParentId == 0).Select(t => t.Adapt<SyncBookingOrderDto>()).ToListAsync();
foreach (var item in dto)
{
var ctn = await _repCtn.AsQueryable().Filter(null, true).Where(x => x.BILLID == item.Id).ToListAsync();
}
return dto;
}
}
#endregion #endregion
} }
} }

@ -11,7 +11,7 @@ namespace Myshipping.Application.Service.DataSync.Dto
///// <summary> ///// <summary>
///// 主键 ///// 主键
///// </summary> ///// </summary>
//public long Id { get; set; } public long Id { get; set; }
/// <summary> /// <summary>
/// 业务编号 /// 业务编号
@ -697,9 +697,6 @@ namespace Myshipping.Application.Service.DataSync.Dto
///货物状态 ///货物状态
///</summary> ///</summary>
public List<BookingGoodsStatusDto> GoodsStatus { get; set; } public List<BookingGoodsStatusDto> GoodsStatus { get; set; }
} }

Loading…
Cancel
Save