增加获取erp仓库接口
This commit is contained in:
Binary file not shown.
29
src/WMS.Web.Core/Dto/Erp/Stock/ErpStockDto.cs
Normal file
29
src/WMS.Web.Core/Dto/Erp/Stock/ErpStockDto.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WMS.Web.Core.Dto.Erp
|
||||
{
|
||||
/// <summary>
|
||||
/// 仓库信息
|
||||
/// </summary>
|
||||
public class ErpStockDto
|
||||
{
|
||||
/// <summary>
|
||||
/// id
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
/// <summary>
|
||||
/// 名字
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
/// <summary>
|
||||
/// 业务组织(使用组织)编码
|
||||
/// </summary>
|
||||
public string OrgCode { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -10,26 +10,29 @@ namespace WMS.Web.Core.Dto.Erp.TakeStock
|
||||
/// </summary>
|
||||
public class ErpTakeStockSaveDto
|
||||
{
|
||||
|
||||
public ErpTakeStockSaveDto() { }
|
||||
/*
|
||||
* 单据编号:FBillNo
|
||||
日期:FDate (必填项)
|
||||
|
||||
库存组织:FStockOrgId (必填项)
|
||||
单据类型:FBillTypeID (必填项)
|
||||
货主类型:FOwnerTypeIdHead (必填项)
|
||||
货主类型:FOwnerTypeIdHead (必填项) BD_OwnerOrg
|
||||
|
||||
物料编码:FMaterialId (必填项)
|
||||
单位:FUnitID (必填项)
|
||||
仓库:FStockId (必填项)
|
||||
库存状态:FStockStatusId (必填项)
|
||||
货主类型:FOwnerTypeId (必填项)
|
||||
货主类型:FOwnerTypeId (必填项) BD_OwnerOrg
|
||||
货主:FOwnerid (必填项)
|
||||
保管者类型:FKeeperTypeId (必填项)
|
||||
保管者类型:FKeeperTypeId (必填项) BD_KeeperOrg
|
||||
保管者:FKeeperId (必填项)
|
||||
子仓库:FStockLocId
|
||||
*/
|
||||
|
||||
/// <summary>
|
||||
/// 单据类型(标准盘亏单; 标准盘盈单)
|
||||
/// 单据类型(标准盘亏单; 标准盘盈单 PY01_SYS) 盘亏 PK01_SYS
|
||||
/// </summary>
|
||||
[JsonProperty("FBillTypeID")]
|
||||
public string Type { get; set; }
|
||||
@@ -39,10 +42,10 @@ namespace WMS.Web.Core.Dto.Erp.TakeStock
|
||||
[JsonProperty("FStockOrgId")]
|
||||
public string StockOrgId { get; set; }
|
||||
/// <summary>
|
||||
/// 货主类型: 默认为业务组织
|
||||
/// 货主类型: 默认为业务组织 BD_OwnerOrg
|
||||
/// </summary>
|
||||
[JsonProperty("FBillTypeID")]
|
||||
public string FOwnerTypeIdHead { get; set; }
|
||||
public string FOwnerTypeIdHead { get; set; } = "BD_OwnerOrg";
|
||||
/// <summary>
|
||||
/// 单据编号
|
||||
/// </summary>
|
||||
@@ -62,50 +65,50 @@ namespace WMS.Web.Core.Dto.Erp.TakeStock
|
||||
public class ErpTakeStockDetailsSaveDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 库存状态
|
||||
/// 库存状态 KCZT001
|
||||
/// </summary>
|
||||
[JsonProperty("FStockStatusId")]
|
||||
public int FStockStatusId { get; set; }
|
||||
public string FStockStatusId { get; set; } = "KCZT001";
|
||||
/// <summary>
|
||||
/// 货主类型: 默认为业务组织
|
||||
/// 货主类型: 默认为业务组织 BD_OwnerOrg
|
||||
/// </summary>
|
||||
[JsonProperty("FOwnerTypeId")]
|
||||
public int FOwnerTypeId { get; set; }
|
||||
public string FOwnerTypeId { get; set; } = "BD_OwnerOrg";
|
||||
/// <summary>
|
||||
/// 取仓库对应的货主信息
|
||||
/// 取仓库对应的货主信息 货主: 等于库存组织
|
||||
/// </summary>
|
||||
[JsonProperty("FOwnerid")]
|
||||
public int FOwnerid { get; set; }
|
||||
public string FOwnerid { get; set; }
|
||||
/// <summary>
|
||||
/// 保管者类型
|
||||
/// </summary>
|
||||
[JsonProperty("FKeeperTypeId")]
|
||||
public int FKeeperTypeId { get; set; }
|
||||
public string FKeeperTypeId { get; set; } = "BD_KeeperOrg";
|
||||
/// <summary>
|
||||
/// 保管者
|
||||
/// 保管者 仓库”库存组织”
|
||||
/// </summary>
|
||||
[JsonProperty("FKeeperId")]
|
||||
public int FKeeperId { get; set; }
|
||||
public string FKeeperId { get; set; }
|
||||
/// <summary>
|
||||
/// 物料ID
|
||||
/// </summary>
|
||||
[JsonProperty("FMaterialId")]
|
||||
public int MaterialId { get; set; }
|
||||
public string MaterialId { get; set; }
|
||||
/// <summary>
|
||||
/// 单位ID
|
||||
/// </summary>
|
||||
[JsonProperty("FUnitID")]
|
||||
public int UnitId { get; set; }
|
||||
public string UnitId { get; set; }
|
||||
/// <summary>
|
||||
/// 仓库ID
|
||||
/// </summary>
|
||||
[JsonProperty("FStockId")]
|
||||
public int StockId { get; set; }
|
||||
public string StockId { get; set; }
|
||||
/// <summary>
|
||||
/// 仓位ID
|
||||
/// </summary>
|
||||
[JsonProperty("FStockLocId")]
|
||||
public int SubStockId { get; set; }
|
||||
public string SubStockId { get; set; }
|
||||
/// <summary>
|
||||
/// 盘点前数量(wms系统数量)
|
||||
/// </summary>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WMS.Web.Core.Dto.Erp;
|
||||
using WMS.Web.Core.Dto.Erp.Org;
|
||||
using WMS.Web.Core.Dto.Erp.Purchase;
|
||||
using WMS.Web.Core.Internal.Results;
|
||||
@@ -21,5 +22,11 @@ namespace WMS.Web.Domain.IService.Public
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<ResultList<ErpOrgDto>> BillQueryForOrg();
|
||||
|
||||
/// <summary>
|
||||
/// 获取仓库信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<ResultList<ErpStockDto>> BillQueryForStock();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,5 +178,45 @@ namespace WMS.Web.Domain.Services.Public
|
||||
return ResultList<ErpOrgDto>.ReFailure("错误", 10002);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取使用组织
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<ResultList<ErpStockDto>> BillQueryForStock()
|
||||
{
|
||||
try
|
||||
{
|
||||
var token_result = await this.Init();
|
||||
if (!token_result.IsSuccess)
|
||||
return ResultList<ErpStockDto>.ReFailure(token_result);
|
||||
var query = new ErpBillQueryDto(token_result.Data);
|
||||
var param = new ErpBillQueryParamDto(FormIdParam.BD_STOCK.ToString());
|
||||
param.FieldKeys = "FStockId,FName,FNumber,FUseOrgId";
|
||||
param.FilterString = "";//FOrgID=100008
|
||||
query.Data = JsonConvert.SerializeObject(param);
|
||||
var json = JsonConvert.SerializeObject(query);
|
||||
|
||||
var result_json = await _client.ExecuteBillQueryAsync(json);
|
||||
var result = JsonConvert.DeserializeObject<List<List<string>>>(result_json);
|
||||
|
||||
var list = new List<ErpStockDto>();
|
||||
foreach (var item in result)
|
||||
{
|
||||
var lis = new ErpStockDto();
|
||||
lis.Id = int.Parse(item[0]);
|
||||
lis.Name = item[1];
|
||||
lis.Code = item[2];
|
||||
lis.OrgCode = item[3];
|
||||
list.Add(lis);
|
||||
|
||||
}
|
||||
return ResultList<ErpStockDto>.ReSuccess(list);
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return ResultList<ErpStockDto>.ReFailure("错误", 10002);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,5 +41,9 @@ namespace WMS.Web.Domain.Values.Erp
|
||||
/// 供应商
|
||||
/// </summary>
|
||||
BD_Supplier=8,
|
||||
/// <summary>
|
||||
/// 仓库
|
||||
/// </summary>
|
||||
BD_STOCK=9
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user