optimize
wet 2 years ago
parent 2daf45cf56
commit 31b9ba2204

@ -113,6 +113,7 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<DjyCustomer> _djycustomer;
private readonly SqlSugarRepository<BookingTemplate> _bookingTemplate;
private readonly SqlSugarRepository<ParaGoodsInfo> _paraGoodsInfoRepository;
private readonly SqlSugarRepository<ParaContractNoInfo> _paraContractNoInfoRepository;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IBookingGoodsStatusConfigService _GoodsConfig;
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<BookingExcelTemplate> excelrep, SqlSugarRepository<DjyUserMailAccount> repUserMail, SqlSugarRepository<BookingGoodsStatus> goodsStatus, SqlSugarRepository<BookingGoodsStatusConfig> goodsStatusConfig,
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._rep = rep;
@ -162,6 +163,7 @@ namespace Myshipping.Application
this._bookingTemplate = bookingTemplate;
this._djycustomer = djycustomer;
this._paraGoodsInfoRepository = paraGoodsInfoRepository;
this._paraContractNoInfoRepository = paraContractNoInfoRepository;
_httpContextAccessor = httpContextAccessor;
_GoodsConfig = GoodsConfig;
}
@ -5150,11 +5152,6 @@ namespace Myshipping.Application
return allData;
}
#endregion
/// <summary>
///获取下拉前10条接口
/// </summary>
@ -5173,7 +5170,7 @@ namespace Myshipping.Application
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();
@ -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 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 contractno = _paraContractNoInfoRepository.AsQueryable().Take(10).Select(t => t.Adapt<ParaGoodsCategoryShowDto>()).ToList();
var User = _repUser.AsQueryable().InnerJoin<SysEmp>((u, e) => u.Id == e.Id)
.InnerJoin<SysOrg>((u, e, o) => e.OrgId == o.Id)
.InnerJoin<SysTenant>((u, e, o, t) => u.TenantId == t.Id)
@ -5203,13 +5200,20 @@ namespace Myshipping.Application
Port = Port,
Template = Template,
Customer = Customer,
Contractno = Contractno,
GoodsName = GoodsName,
User = User,
Forwarder= Forwarder,
Service= Service
Forwarder = Forwarder,
Service = Service,
contractno = contractno
};
return obj;
}
#endregion
}
}

@ -1867,19 +1867,50 @@ namespace Myshipping.Application
#region 下载数据
#endregion
#region 其他
/// <summary>
/// 测试用
///
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
[HttpGet("/DataSync/Test"), ApiUser(ApiCode = "Test")]
public async Task<string> Test()
{
return $"当前用户:{UserManager.UserId} {UserManager.Name} ,当前租户:{UserManager.TENANT_ID} {UserManager.TENANT_NAME},管理员类型:{(UserManager.IsSuperAdmin ? "" : (UserManager.IsTenantAdmin ? "" : ""))}";
[NonAction]
public async Task<List<SyncBookingOrderDto>> SendBookingOrder(List<long> ids) {
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
}
}

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

Loading…
Cancel
Save