jianghaiqing 1 year ago
commit cba96f6bdc

@ -30,12 +30,12 @@ namespace Myshipping.Application
/// <summary>
/// 箱量
/// </summary>
public int? CTNNUM { get; set; }
public int CTNNUM { get; set; }
/// <summary>
/// TEU
/// </summary>
public int? TEU { get; set; }
public int TEU { get; set; }
/// <summary>
/// 箱号
@ -50,7 +50,7 @@ namespace Myshipping.Application
/// <summary>
/// 件数
/// </summary>
public int? PKGS { get; set; }
public int PKGS { get; set; }
/// <summary>
/// 包装
@ -60,17 +60,17 @@ namespace Myshipping.Application
/// <summary>
/// 毛重
/// </summary>
public decimal? KGS { get; set; }
public decimal KGS { get; set; }
/// <summary>
/// 尺码
/// </summary>
public decimal? CBM { get; set; }
public decimal CBM { get; set; }
/// <summary>
/// 皮重
/// </summary>
public decimal? TAREWEIGHT { get; set; }
public decimal TAREWEIGHT { get; set; }
/// <summary>
/// 箱状态
@ -85,7 +85,7 @@ namespace Myshipping.Application
/// <summary>
/// 称重重量
/// </summary>
public decimal? WEIGHKGS { get; set; }
public decimal WEIGHKGS { get; set; }
/// <summary>
/// 称重联系人

@ -107,6 +107,7 @@ namespace Myshipping.Application
this._business = business;
this._detail = detail;
}
/// <summary>
/// 分页查询快递主表
/// </summary>
@ -175,11 +176,11 @@ namespace Myshipping.Application
{
throw Oops.Bah("发件人地址不能为空!");
}
var entity = input.Adapt<BookingOrderSFExpressDelivery>();
if (input.Id == 0)
{
var entity = input.Adapt<BookingOrderSFExpressDelivery>();
await _rep.InsertAsync(entity);
if (input.Business != null && input.Business.Count > 0)
{
@ -202,14 +203,100 @@ namespace Myshipping.Application
}
else
{
await _rep.AsUpdateable(entity).IgnoreColumns(it => new
{
it.TenantId,
it.CreatedTime,
it.CreatedUserId,
it.CreatedUserName
}).ExecuteCommandAsync();
await _business.DeleteAsync(x => x.PId == input.Id);
await _detail.DeleteAsync(x => x.PId == input.Id);
if (input.Business != null && input.Business.Count > 0)
{
foreach (var item in input.Business)
{
var buentity = item.Adapt<BookingOrderSFExpressdeliveryBusiness>();
buentity.PId = entity.Id;
await _business.InsertAsync(buentity);
}
}
if (input.detail != null && input.detail.Count > 0)
{
foreach (var item in input.detail)
{
var dentity = item.Adapt<BookingOrderSFExpressdeliveryDetail>();
dentity.PId = entity.Id;
await _detail.InsertAsync(dentity);
}
}
}
return Get(entity.Id);
}
/// <summary>
/// 删除单据
/// </summary>
/// <param name="Ids"></param>
/// <returns></returns>
[SqlSugarUnitOfWork]
[HttpPost("/BookingOrderSF/Delete")]
public async Task Delete(string Ids)
{
var arr = Ids.Split(",");
if (arr.Count() > 0)
{
foreach (var ar in arr)
{
long Id = Convert.ToInt64(ar);
await _rep.UpdateAsync(x => x.Id == Id, x => new BookingOrderSFExpressDelivery { IsDeleted = true });
await _detail.DeleteAsync(x => x.PId == Id);
await _business.DeleteAsync(x => x.PId == Id);
}
}
else
{
throw Oops.Bah("请上传正确参数");
}
}
/// <summary>
/// 获取详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpPost("/BookingOrderSF/Get")]
public async Task<dynamic> Get(long Id)
{
BookingOrderSFDto ordOut = new BookingOrderSFDto();
var main = await _rep.FirstOrDefaultAsync(u => u.Id == Id);
if (main != null)
{
ordOut = main.Adapt<BookingOrderSFDto>();
var detail = await _detail.AsQueryable().Where(x => x.PId == Id).ToListAsync();
ordOut.detail = detail;
var business = await _business.AsQueryable().Where(x => x.PId == Id).ToListAsync();
ordOut.Business = business;
}
return null;
return ordOut;
}
}
}

@ -578,9 +578,10 @@ public class SysUserService : ISysUserService, IDynamicApiController, ITransient
[HttpGet("/sysUser/GetTenantUser")]
public async Task<List<SysUser>> GetTenantUser(string name, long? tenantId = 0)
{
return await _sysUserRep.AsQueryable().Filter(null, true).WhereIF(tenantId == 0, x => x.TenantId == Convert.ToInt64(UserManager.TENANT_ID) && x.Status == CommonStatus.ENABLE&&x.IsDeleted==false)
.WhereIF(tenantId != 0, x => x.TenantId == tenantId)
return await _sysUserRep.AsQueryable().Filter(null, true)
.WhereIF(!string.IsNullOrWhiteSpace(name), x => x.Name.Contains(name))
.WhereIF(tenantId == 0, x => x.TenantId == Convert.ToInt64(UserManager.TENANT_ID) && x.Status == CommonStatus.ENABLE&&x.IsDeleted==false)
.WhereIF(tenantId != 0, x => x.TenantId == tenantId)
.OrderBy(x => x.Name).ToListAsync();
}

Loading…
Cancel
Save