调整接口

This commit is contained in:
18942506660
2023-11-15 11:48:17 +08:00
parent 9840fb93fb
commit a1b1cdedbd
9 changed files with 85 additions and 11 deletions

View File

@@ -263,6 +263,23 @@ namespace WMS.Web.Api.Controllers
var r = await _basicsRepositories.GetSubUcStockAsync(ManagementSystemCode.GLXT0004.ToString(), name, loginInfo.UserInfo.CompanyId);
return Result<List<UcSubStockResponse>>.ReSuccess(r);
}
/// <summary>
/// 获取仓位:精确名字
/// </summary>
/// <param name="name">精确名字</param>
/// <returns></returns>
[HttpGet]
[Route("GetSubUcStockPrecisionByName/{name}")]
public async Task<Result<UcSubStockResponse>> GetSubUcStockPrecisionByName([FromRoute] string name)
{
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
if (loginInfo == null || loginInfo.UserInfo == null)
return Result<UcSubStockResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
var r = await _basicsRepositories.GetSubUcStockAsync(ManagementSystemCode.GLXT0004.ToString(), name, loginInfo.UserInfo.CompanyId);
var subStock = r.FirstOrDefault(f => f.Name.Equals(name));
if (subStock == null) return Result<UcSubStockResponse>.ReFailure(ResultCodes.NoDateError);
return Result<UcSubStockResponse>.ReSuccess(subStock);
}
/// <summary>
/// 根据箱号获取箱信息

View File

@@ -11,6 +11,7 @@ using System.ServiceModel;
using System.Threading.Tasks;
using WMS.Web.Core.Dto;
using WMS.Web.Core.Internal.Results;
using WMS.Web.Domain.Entitys;
using WMS.Web.Domain.Infrastructure;
using WMS.Web.Domain.IService;
using WMS.Web.Domain.IService.Public;
@@ -26,21 +27,59 @@ namespace WMS.Web.Api.Controllers
private IBasicsRepositories _transactionRepositories;
private readonly IOpsService _opsService;
private readonly IBoxService _boxService;
private readonly IOutStockTaskRepositories _outStockTaskRepositories;
public TestController(IErpService erpService, IInStockTaskService inStockTaskService,
IBasicsRepositories transactionRepositories, IOpsService opsService, IBoxService boxService)
IBasicsRepositories transactionRepositories, IOpsService opsService, IBoxService boxService,
IOutStockTaskRepositories outStockTaskRepositories)
{
this._erpService = erpService;
this._inStockTaskService = inStockTaskService;
this._transactionRepositories = transactionRepositories;
_opsService = opsService;
_boxService = boxService;
_outStockTaskRepositories = outStockTaskRepositories;
}
[HttpGet]
[Route("hj")]
public async Task<string> TestHJ()
{
await _boxService.Sync();
OutStockTask entity = new OutStockTask()
{
DeliveryOrgId = 1,
ReceiptCustomerId = 1
};
try
{
var d = new OutStockTaskDetails();
d.MaterialId = 1;
d.AccruedQty = 1;
d.Erp_DetailId = 1;
d.SaleBillNo = "sdf34343";
d.StockCode = "234";
d.SubStockId =234;
d.SourceBillNos = new List<string>() { "wwre", "32423" };
entity.Details.Add(d);
}
catch (Exception ex)
{
throw ex;
}
entity.Details.Add(new OutStockTaskDetails()
{
MaterialId = 1,
AccruedQty = 1,
Erp_DetailId = 1,
SaleBillNo = "ddddd",
StockCode = "ddd",
SubStockId = 1
});
var b = await _outStockTaskRepositories.Add(entity, true);
var bc = await _outStockTaskRepositories.Get(entity.Id);
// await _boxService.Sync();
//var res = await this._erpService.BillQueryForDeliveryNoticeOutStock(null,DateTime.Now.AddDays(-300));
//var result= await this._erpService.BillQueryForPurchaseInStock();
//var result = await this._erpService.BillQueryForOrg();

View File

@@ -433,6 +433,13 @@
<param name="name">仓位名称模糊匹配</param>
<returns></returns>
</member>
<member name="M:WMS.Web.Api.Controllers.SysConfigController.GetSubUcStockPrecisionByName(System.String)">
<summary>
获取仓位:精确名字
</summary>
<param name="name">精确名字</param>
<returns></returns>
</member>
<member name="M:WMS.Web.Api.Controllers.SysConfigController.GetBox(System.Collections.Generic.List{System.String})">
<summary>
根据箱号获取箱信息

View File

@@ -410,6 +410,11 @@
目标箱子ID
</summary>
</member>
<member name="P:WMS.Web.Core.Dto.ChangeBoxRecord.SaveChangeBoxRecordRequest.Details">
<summary>
明细
</summary>
</member>
<member name="T:WMS.Web.Core.Dto.ChangeBoxRecord.SaveChangeBoxRecordDetailsRequest">
<summary>
明细

View File

@@ -19,8 +19,10 @@ namespace WMS.Web.Core.Dto.ChangeBoxRecord
/// </summary>
[Required(ErrorMessage = "目标箱子不能为空")]
public int DestBoxId { get; set; }
public List<SaveChangeBoxRecordDetailsRequest> Details = new List<SaveChangeBoxRecordDetailsRequest>();
/// <summary>
/// 明细
/// </summary>
public List<SaveChangeBoxRecordDetailsRequest> Details { get; set; } = new List<SaveChangeBoxRecordDetailsRequest>();
}
/// <summary>
/// 明细

View File

@@ -1,4 +1,5 @@
using System;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
@@ -36,6 +37,7 @@ namespace WMS.Web.Domain.Entitys
///</summary>
[Column("SourceBillNo")]
public List<string> SourceBillNos { get; set; }
/// <summary>
/// 销售订单号
///</summary>

View File

@@ -20,7 +20,7 @@ namespace WMS.Web.Domain.Values
/// 数据操作失败
/// </summary>
public static ValueTuple<int, string> DateWriteError = (40004, "数据操作失败");
public static ValueTuple<int, string> NoDateError = (40005, "数据不存在");
//出库任务单
public static ValueTuple<int, string> MergeStatusError = (70000, "所选单据数据不一致,不能合并");

View File

@@ -263,7 +263,9 @@ namespace WMS.Web.Repositories
if (dto.Ids.Count() > 0)
query = query.Where(w => dto.Ids.Contains(w.detail.Id));
if (!string.IsNullOrEmpty(dto.SourceBillNo))
query = query.Where(w => w.detail.SourceBillNos.Where(sw => EF.Functions.Like(sw, "%" + dto.SourceBillNo + "%")).Contains(w.order.BillNo));
query = query.Where(w => w.detail.SourceBillNos.Contains(dto.SourceBillNo));
//query = query.Where(w => EF.Functions.Like(w.detail.SourceBillNos, "%" + dto.SourceBillNo + "%"));
//query = query.Where(w => w.detail.SourceBillNos.Where(sw => EF.Functions.Like(sw, "%" + dto.SourceBillNo + "%")).Contains(w.order.BillNo));
if (dto.Type != null)
query = query.Where(w => w.order.Type == (OutStockType)dto.Type);
if (dto.Status != null)