增加获取金蝶子仓库信息
This commit is contained in:
Binary file not shown.
@@ -12,6 +12,7 @@ using WMS.Web.Core.Internal.Results;
|
||||
using WMS.Web.Domain.Infrastructure;
|
||||
using WMS.Web.Domain.IService.Public;
|
||||
using WMS.Web.Domain.Values;
|
||||
using WMS.Web.Domain.Values.Single;
|
||||
|
||||
namespace WMS.Web.Api.Controllers
|
||||
{
|
||||
@@ -25,12 +26,16 @@ namespace WMS.Web.Api.Controllers
|
||||
private readonly ILoginService _loginService;
|
||||
private readonly IBasicsRepositories _basicsRepositories;
|
||||
private readonly IBoxRepositories _boxRepositories;
|
||||
private readonly IErpService _erpService;
|
||||
private readonly ISingleDataService _singleDataService;
|
||||
public SysConfigController(ILoginService loginService, IBasicsRepositories basicsRepositories,
|
||||
IBoxRepositories boxRepositories)
|
||||
IBoxRepositories boxRepositories, IErpService erpService, ISingleDataService singleDataService)
|
||||
{
|
||||
_loginService = loginService;
|
||||
_basicsRepositories = basicsRepositories;
|
||||
_boxRepositories = boxRepositories;
|
||||
_erpService = erpService;
|
||||
_singleDataService = singleDataService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -111,6 +116,37 @@ namespace WMS.Web.Api.Controllers
|
||||
var r = await _basicsRepositories.GetSubUcStockAsync(id);
|
||||
return Result<List<UcStockResponse>>.ReSuccess(r);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据仓库获取金蝶子仓库
|
||||
/// </summary>
|
||||
/// <param name="id">仓库id</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Route("GetErp_SubUcStock/{id}")]
|
||||
public async Task<Result<List<UcStockResponse>>> GetErp_SubUcStock([FromRoute] int id)
|
||||
{
|
||||
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
||||
if (loginInfo == null || loginInfo.UserInfo == null)
|
||||
return Result<List<UcStockResponse>>.ReFailure(ResultCodes.Token_Invalid_Error);
|
||||
|
||||
List<UcStockResponse> list = new List<UcStockResponse>();
|
||||
var code = _singleDataService.GetSingleDataCode(SingleAction.Stocks, loginInfo.UserInfo.CompanyId, id);
|
||||
if (code.Substring(0, 2).Equals("HD") || code.Substring(0, 2).Equals("GD"))
|
||||
{
|
||||
var subs = await _erpService.BillQueryForSubStock(code);
|
||||
foreach (var s in subs.Data)
|
||||
{
|
||||
list.Add(new UcStockResponse()
|
||||
{
|
||||
Id = s.Id,
|
||||
Code = s.Code,
|
||||
Name = s.Name,
|
||||
Disable = false
|
||||
});
|
||||
}
|
||||
}
|
||||
return Result<List<UcStockResponse>>.ReSuccess(list);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取仓位:模糊名称
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace WMS.Web.Api.Controllers
|
||||
[Route("hj")]
|
||||
public async Task<string> TestHJ()
|
||||
{
|
||||
var res = await this._erpService.BillQueryForTransferDirectOutStock();
|
||||
var res = await this._erpService.BillQueryForSubStock();
|
||||
//var result= await this._erpService.BillQueryForPurchaseInStock();
|
||||
//var result = await this._erpService.BillQueryForOrg();
|
||||
var result = await this._erpService.BillQueryForMaterial();
|
||||
|
||||
@@ -993,6 +993,11 @@
|
||||
仓位ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.TakeStock.Erp_SubStockId">
|
||||
<summary>
|
||||
子仓库(跟金蝶交互字段)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.TakeStock.BeforeQty">
|
||||
<summary>
|
||||
盘点前数量(wms系统数量)
|
||||
@@ -1570,6 +1575,12 @@
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.IService.Public.IErpService.BillQueryForSubStock(System.String)">
|
||||
<summary>
|
||||
获取仓位信息信息 根据仓库编码
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Domain.IService.Public.ILoginService">
|
||||
<summary>
|
||||
登录服务接口
|
||||
@@ -2316,6 +2327,13 @@
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Services.Public.ErpService.BillQueryForSubStock(System.String)">
|
||||
<summary>
|
||||
根据仓库编码获取仓位
|
||||
</summary>
|
||||
<param name="code"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Services.Public.ErpService.Sync``1(``0,System.String)">
|
||||
<summary>
|
||||
同步数据(保存提交审核)
|
||||
|
||||
@@ -61,6 +61,11 @@ namespace WMS.Web.Domain.Entitys
|
||||
[Column("SubStockId")]
|
||||
public int SubStockId { get; set; }
|
||||
/// <summary>
|
||||
/// 子仓库(跟金蝶交互字段)
|
||||
/// </summary>
|
||||
[Column("Erp_SubStockId")]
|
||||
public int Erp_SubStockId { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// 盘点前数量(wms系统数量)
|
||||
/// </summary>
|
||||
[Column("BeforeQty")]
|
||||
|
||||
@@ -65,6 +65,11 @@ namespace WMS.Web.Domain.IService.Public
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<ResultList<ErpStockDto>> BillQueryForStock();
|
||||
/// <summary>
|
||||
/// 获取仓位信息信息 根据仓库编码
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<ResultList<ErpStockDto>> BillQueryForSubStock(string code=null);
|
||||
//同步数据(保存提交审核)
|
||||
Task<Result> Sync<T>(T dto, string formId);
|
||||
//下推
|
||||
|
||||
@@ -192,7 +192,7 @@ namespace WMS.Web.Domain.Services.Public
|
||||
param.FieldKeys = "FMATERIALID,FName,FNumber,FSpecification,FForbidStatus,FUseOrgId";
|
||||
param.Limit = 10000;
|
||||
Console.Write("请输入第几行:");
|
||||
var row=Console.ReadLine();
|
||||
var row = Console.ReadLine();
|
||||
param.StartRow = (Convert.ToInt32(row) * param.Limit);
|
||||
|
||||
//查询条件:备注其中的条件值以金蝶的值为准!!!
|
||||
@@ -310,6 +310,49 @@ namespace WMS.Web.Domain.Services.Public
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据仓库编码获取仓位
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ResultList<ErpStockDto>> BillQueryForSubStock(string code = null)
|
||||
{
|
||||
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 = "FStockFlexDetail_FDetailID,FFlexEntryName,FFlexEntryId,'0'";
|
||||
param.Limit = 100000;
|
||||
if (!string.IsNullOrEmpty(code))
|
||||
param.FilterString = "FNumber='" + code + "'";//FNumber='C'
|
||||
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.OrgId = Convert.ToInt32(item[3]);
|
||||
list.Add(lis);
|
||||
|
||||
}
|
||||
return ResultList<ErpStockDto>.ReSuccess(list);
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return ResultList<ErpStockDto>.ReFailure("错误", 10002);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 同步数据(保存提交审核)
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
@@ -393,7 +436,7 @@ namespace WMS.Web.Domain.Services.Public
|
||||
param.FilterString = "FCreateDate>='" + beginTime + "' and FCreateDate<='" + endTime + "' and FDocumentStatus='C' and FRemainOutQty>=0";
|
||||
//string srt = JsonConvert.SerializeObject(stocks_codes);
|
||||
//param.FilterString = param.FilterString + " and FStockID in (" + srt.Substring(1, srt.Length - 2) + ")";
|
||||
|
||||
|
||||
//根据原订单号查询
|
||||
if (sourceBillNos != null && sourceBillNos.Count() > 0)
|
||||
{
|
||||
@@ -812,6 +855,7 @@ namespace WMS.Web.Domain.Services.Public
|
||||
return ResultList<ErpDeliveryNoticeOutStockResultDto>.ReFailure(ResultCodes.Erp_BillQuery_Error);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user