优化箱唛列表
This commit is contained in:
@@ -49,7 +49,7 @@ namespace WMS.Web.Api.Controllers
|
||||
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
||||
if (loginInfo == null || loginInfo.UserInfo == null)
|
||||
return ResultPagedList<BoxMarkQueryResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
|
||||
var (list, count) = await _boxMarkRepositories.GetPagedList(dto, loginInfo.UserInfo.CompanyId);
|
||||
var (list, count) = await _boxMarkService.GetPagedList(dto, loginInfo.UserInfo.CompanyId);
|
||||
return ResultPagedList<BoxMarkQueryResponse>.ReSuccess(list, count);
|
||||
}
|
||||
|
||||
|
||||
@@ -440,6 +440,16 @@
|
||||
是否是尾箱
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.BoxMarkQueryResponse.BoxSortCount">
|
||||
<summary>
|
||||
装箱总数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.BoxMarkQueryResponse.ProductQty">
|
||||
<summary>
|
||||
产品数量
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Core.Dto.GenerateBoxMarkDto">
|
||||
<summary>
|
||||
生成箱唛dto
|
||||
|
||||
@@ -2803,6 +2803,14 @@
|
||||
<param name="loginInfo"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.IService.IBoxMarkService.GetPagedList(WMS.Web.Core.Dto.BoxMarkQueryRequest,System.Int32)">
|
||||
<summary>
|
||||
列表-分页
|
||||
</summary>
|
||||
<param name="dto"></param>
|
||||
<param name="companyId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Domain.IService.IChangeMoveBoxService">
|
||||
<summary>
|
||||
改箱 移箱服务
|
||||
@@ -4103,6 +4111,22 @@
|
||||
<param name="loginInfo"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Services.BoxMarkService.GetPagedList(WMS.Web.Core.Dto.BoxMarkQueryRequest,System.Int32)">
|
||||
<summary>
|
||||
列表分页
|
||||
</summary>
|
||||
<param name="dto"></param>
|
||||
<param name="companyId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Services.BoxMarkService.GetSortCount(System.Decimal,System.Decimal)">
|
||||
<summary>
|
||||
装箱总数
|
||||
</summary>
|
||||
<param name="productQty"></param>
|
||||
<param name="cratingQty"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Domain.Services.BoxService">
|
||||
<summary>
|
||||
箱服务信息
|
||||
|
||||
@@ -97,5 +97,15 @@ namespace WMS.Web.Core.Dto
|
||||
/// 是否是尾箱
|
||||
/// </summary>
|
||||
public bool IsTail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 装箱总数
|
||||
/// </summary>
|
||||
public int BoxSortCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产品数量
|
||||
/// </summary>
|
||||
public decimal ProductQty { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,5 +20,13 @@ namespace WMS.Web.Domain.IService
|
||||
/// <param name="loginInfo"></param>
|
||||
/// <returns></returns>
|
||||
Task<ResultList<BoxMarkQueryResponse>> Generate(GenerateBoxMarkDto dto, LoginInDto loginInfo);
|
||||
|
||||
/// <summary>
|
||||
/// 列表-分页
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <param name="companyId"></param>
|
||||
/// <returns></returns>
|
||||
Task<(List<BoxMarkQueryResponse> list, int total)> GetPagedList(BoxMarkQueryRequest dto, int companyId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,5 +61,46 @@ namespace WMS.Web.Domain.Services
|
||||
var list= await _boxMarkRepositories.GetListInfoBy(model.Id, loginInfo.UserInfo.CompanyId);
|
||||
return ResultList<BoxMarkQueryResponse>.ReSuccess(list);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 列表分页
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <param name="companyId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<(List<BoxMarkQueryResponse> list, int total)> GetPagedList(BoxMarkQueryRequest dto, int companyId)
|
||||
{
|
||||
var (list, count) = await _boxMarkRepositories.GetPagedList(dto, companyId);
|
||||
|
||||
if (list != null && list.Count != 0)
|
||||
{
|
||||
list.ForEach(x =>
|
||||
{
|
||||
x.BoxSortCount = this.GetSortCount(x.ProductQty, x.CratingQty);
|
||||
});
|
||||
}
|
||||
|
||||
return (list, count);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 装箱总数
|
||||
/// </summary>
|
||||
/// <param name="productQty"></param>
|
||||
/// <param name="cratingQty"></param>
|
||||
/// <returns></returns>
|
||||
private int GetSortCount(decimal productQty, decimal cratingQty)
|
||||
{
|
||||
//计算要装的箱数量
|
||||
var boxCount_tag = productQty / cratingQty;
|
||||
var boxCount = Convert.ToInt32(boxCount_tag);
|
||||
//判断是否存在小数点;true表明有尾箱数,false没有尾箱数
|
||||
var hasPart = Math.Floor(boxCount_tag) != boxCount_tag;
|
||||
|
||||
//有小数点向上取整
|
||||
if (hasPart)
|
||||
boxCount = Convert.ToInt32(Math.Ceiling(boxCount_tag));
|
||||
return boxCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,6 +120,8 @@ namespace WMS.Web.Repositories
|
||||
var mids = materials.Select(x => x.MaterialId).ToList();
|
||||
query = query.Where(w => mids.Contains(w.order.MaterialId));
|
||||
}
|
||||
else
|
||||
query = query.Where(w => w.order.MaterialId == 0);
|
||||
}
|
||||
|
||||
if (cr_ids.Count != 0)
|
||||
@@ -152,7 +154,9 @@ namespace WMS.Web.Repositories
|
||||
IsTail=s.detail.IsTail,
|
||||
Creator = _singleDataService.GetSingleData(SingleAction.Staffs, companyId, s.order.CreatorId),
|
||||
CreateTime = s.order.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
Remark = s.order.Remark
|
||||
Remark = s.order.Remark,
|
||||
ProductQty=s.order.ProductQty,
|
||||
|
||||
}).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
||||
|
||||
return (list, total);
|
||||
|
||||
Reference in New Issue
Block a user