调整接口

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); var r = await _basicsRepositories.GetSubUcStockAsync(ManagementSystemCode.GLXT0004.ToString(), name, loginInfo.UserInfo.CompanyId);
return Result<List<UcSubStockResponse>>.ReSuccess(r); 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> /// <summary>
/// 根据箱号获取箱信息 /// 根据箱号获取箱信息

View File

@@ -11,6 +11,7 @@ using System.ServiceModel;
using System.Threading.Tasks; using System.Threading.Tasks;
using WMS.Web.Core.Dto; using WMS.Web.Core.Dto;
using WMS.Web.Core.Internal.Results; using WMS.Web.Core.Internal.Results;
using WMS.Web.Domain.Entitys;
using WMS.Web.Domain.Infrastructure; using WMS.Web.Domain.Infrastructure;
using WMS.Web.Domain.IService; using WMS.Web.Domain.IService;
using WMS.Web.Domain.IService.Public; using WMS.Web.Domain.IService.Public;
@@ -26,21 +27,59 @@ namespace WMS.Web.Api.Controllers
private IBasicsRepositories _transactionRepositories; private IBasicsRepositories _transactionRepositories;
private readonly IOpsService _opsService; private readonly IOpsService _opsService;
private readonly IBoxService _boxService; private readonly IBoxService _boxService;
private readonly IOutStockTaskRepositories _outStockTaskRepositories;
public TestController(IErpService erpService, IInStockTaskService inStockTaskService, public TestController(IErpService erpService, IInStockTaskService inStockTaskService,
IBasicsRepositories transactionRepositories, IOpsService opsService, IBoxService boxService) IBasicsRepositories transactionRepositories, IOpsService opsService, IBoxService boxService,
IOutStockTaskRepositories outStockTaskRepositories)
{ {
this._erpService = erpService; this._erpService = erpService;
this._inStockTaskService = inStockTaskService; this._inStockTaskService = inStockTaskService;
this._transactionRepositories = transactionRepositories; this._transactionRepositories = transactionRepositories;
_opsService = opsService; _opsService = opsService;
_boxService = boxService; _boxService = boxService;
_outStockTaskRepositories = outStockTaskRepositories;
} }
[HttpGet] [HttpGet]
[Route("hj")] [Route("hj")]
public async Task<string> TestHJ() 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 res = await this._erpService.BillQueryForDeliveryNoticeOutStock(null,DateTime.Now.AddDays(-300));
//var result= await this._erpService.BillQueryForPurchaseInStock(); //var result= await this._erpService.BillQueryForPurchaseInStock();
//var result = await this._erpService.BillQueryForOrg(); //var result = await this._erpService.BillQueryForOrg();

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,5 @@
using System; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Text; using System.Text;
@@ -13,7 +14,7 @@ namespace WMS.Web.Domain.Entitys
/// </summary> /// </summary>
[Serializable] [Serializable]
[Table("t_erp_outstock_task_details")] [Table("t_erp_outstock_task_details")]
public class OutStockTaskDetails : EntityBase public class OutStockTaskDetails : EntityBase
{ {
public OutStockTaskDetails() { } public OutStockTaskDetails() { }
/// <summary> /// <summary>
@@ -36,6 +37,7 @@ namespace WMS.Web.Domain.Entitys
///</summary> ///</summary>
[Column("SourceBillNo")] [Column("SourceBillNo")]
public List<string> SourceBillNos { get; set; } public List<string> SourceBillNos { get; set; }
/// <summary> /// <summary>
/// 销售订单号 /// 销售订单号
///</summary> ///</summary>
@@ -82,6 +84,6 @@ namespace WMS.Web.Domain.Entitys
[Column("OutStockEndTime")] [Column("OutStockEndTime")]
public DateTime? OutStockEndTime { get; set; } public DateTime? OutStockEndTime { get; set; }
} }
} }

View File

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

View File

@@ -114,8 +114,8 @@ namespace WMS.Web.Repositories.Configuration
ent.HasKey(x => x.Id); ent.HasKey(x => x.Id);
ent.Property(f => f.SourceBillNos).HasConversion( ent.Property(f => f.SourceBillNos).HasConversion(
v => JsonConvert.SerializeObject(v), v => JsonConvert.SerializeObject(v),
v => JsonConvert.DeserializeObject<List<string>>(v)); v => JsonConvert.DeserializeObject<List<string>>(v));
}); });
#endregion #endregion

View File

@@ -263,7 +263,9 @@ namespace WMS.Web.Repositories
if (dto.Ids.Count() > 0) if (dto.Ids.Count() > 0)
query = query.Where(w => dto.Ids.Contains(w.detail.Id)); query = query.Where(w => dto.Ids.Contains(w.detail.Id));
if (!string.IsNullOrEmpty(dto.SourceBillNo)) 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) if (dto.Type != null)
query = query.Where(w => w.order.Type == (OutStockType)dto.Type); query = query.Where(w => w.order.Type == (OutStockType)dto.Type);
if (dto.Status != null) if (dto.Status != null)