调整接口

This commit is contained in:
18942506660
2023-12-29 09:22:52 +08:00
parent 2b8b5d605b
commit e9d17dcae7
3 changed files with 8 additions and 12 deletions

View File

@@ -227,7 +227,7 @@ namespace WMS.Web.Api.Controllers
return Result<List<UcStockResponse>>.ReSuccess(list); return Result<List<UcStockResponse>>.ReSuccess(list);
var subs = await _erpService.BillQueryForSubStock(); var subs = await _erpService.BillQueryForSubStock();
var res = subs.Data.Where(w => w.OrgCode.Equals(orgCode)&&w.StockCode.Equals(number)); var res = subs.Data.Where(w => w.OrgCode.Equals(orgCode) && w.StockCode.Equals(number));
if (!string.IsNullOrEmpty(name)) if (!string.IsNullOrEmpty(name))
res = res.Where(w => w.Name.Contains(name)); res = res.Where(w => w.Name.Contains(name));
list = res.Select(s => new UcStockResponse() list = res.Select(s => new UcStockResponse()
@@ -338,10 +338,11 @@ namespace WMS.Web.Api.Controllers
/// 根据箱号获取箱信息(综合) /// 根据箱号获取箱信息(综合)
/// </summary> /// </summary>
/// <param name="boxBillNo">必填</param> /// <param name="boxBillNo">必填</param>
/// <param name="isReminder">没有箱时是否提示 false 返回数据 true或者不传 弹出提示</param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
[Route("GetBoxSynthesis")] [Route("GetBoxSynthesis")]
public async Task<Result<BoxResponse>> GetBoxSynthesis([FromQuery] string boxBillNo) public async Task<Result<BoxResponse>> GetBoxSynthesis([FromQuery] string boxBillNo, [FromQuery] bool? isReminder = true)
{ {
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]); var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
if (loginInfo == null || loginInfo.UserInfo == null) if (loginInfo == null || loginInfo.UserInfo == null)
@@ -367,6 +368,7 @@ namespace WMS.Web.Api.Controllers
} }
var res = await _boxRepositories.GetBox(new List<string>() { boxBillNo }); var res = await _boxRepositories.GetBox(new List<string>() { boxBillNo });
if (res.Count() <= 0 && isReminder == false) return Result<BoxResponse>.ReSuccess(new BoxResponse());
if (res.Count() <= 0) return Result<BoxResponse>.ReFailure(ResultCodes.BoxNoData); if (res.Count() <= 0) return Result<BoxResponse>.ReFailure(ResultCodes.BoxNoData);
return Result<BoxResponse>.ReSuccess(res.First()); return Result<BoxResponse>.ReSuccess(res.First());
} }

View File

@@ -517,11 +517,12 @@
<param name="boxBillNos">必填</param> <param name="boxBillNos">必填</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:WMS.Web.Api.Controllers.SysConfigController.GetBoxSynthesis(System.String)"> <member name="M:WMS.Web.Api.Controllers.SysConfigController.GetBoxSynthesis(System.String,System.Nullable{System.Boolean})">
<summary> <summary>
根据箱号获取箱信息(综合) 根据箱号获取箱信息(综合)
</summary> </summary>
<param name="boxBillNo">必填</param> <param name="boxBillNo">必填</param>
<param name="isReminder">没有箱时是否提示 false 返回数据 true或者不传 弹出提示</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:WMS.Web.Api.Controllers.SysConfigController.GetBox_OutStock(System.String)"> <member name="M:WMS.Web.Api.Controllers.SysConfigController.GetBox_OutStock(System.String)">

View File

@@ -68,21 +68,14 @@ namespace WMS.Web.Domain.Services
if (IsPDA) if (IsPDA)
{ {
var d = dto.First(); var d = dto.First();
var dBox = await _boxRepositories.GetByNo(d.DestBoxBillNo); if (d.DestBoxId == 0)
if (dBox == null)
{ {
var dBox = await _boxRepositories.GetByNo(d.DestBoxBillNo);
var res = await CreateBox(d); var res = await CreateBox(d);
if (!res.IsSuccess) return res; if (!res.IsSuccess) return res;
dBox = await _boxRepositories.GetByNo(d.DestBoxBillNo); dBox = await _boxRepositories.GetByNo(d.DestBoxBillNo);
dto.First().DestBoxId = dBox.Id; dto.First().DestBoxId = dBox.Id;
} }
else
{
var destInventoryBoxs = await _boxInventoryRepositories.Get(dBox.Id);
dto.First().DestBoxId = dBox.Id;
if (destInventoryBoxs != null)
dto.First().SubStockId = destInventoryBoxs.SubStockId;
}
} }
//1.有原箱时 需要判断 物料对应的序列号是否存在 //1.有原箱时 需要判断 物料对应的序列号是否存在
var srcIds = dto.Select(s => s.SrcBoxId).Distinct().ToList(); var srcIds = dto.Select(s => s.SrcBoxId).Distinct().ToList();