Merge branch 'master' of https://codeup.aliyun.com/62ce7bca487c500c27f70a79/OPS/WMS-Api
This commit is contained in:
44
src/WMS.Web.Core/Dto/Erp/ErpPushDto.cs
Normal file
44
src/WMS.Web.Core/Dto/Erp/ErpPushDto.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WMS.Web.Core.Dto.Erp
|
||||
{
|
||||
/// <summary>
|
||||
/// 下推
|
||||
/// </summary>
|
||||
public class ErpPushDto
|
||||
{
|
||||
public ErpPushDto() { }
|
||||
|
||||
public ErpPushDto(string formId,string number,List<int> detailIds,string type)
|
||||
{
|
||||
this.FormId = formId;
|
||||
this.Numbers.Add(number);
|
||||
this.DetailsId = detailIds.ToString();
|
||||
this.Type = type;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 业务对象表单Id(必录)
|
||||
/// </summary>
|
||||
[JsonProperty("FormId")]
|
||||
public string FormId { get; set; }
|
||||
/// <summary>
|
||||
/// 业务对象表单Id(必录)
|
||||
/// </summary>
|
||||
[JsonProperty("Numbers")]
|
||||
public List<string> Numbers { get; set; }
|
||||
/// <summary>
|
||||
/// 分录内码集合,逗号分隔(分录下推时必录) 注(按分录下推时,单据内码和编码不需要填,否则按整单下推)
|
||||
/// </summary>
|
||||
[JsonProperty("EntryIds")]
|
||||
public string DetailsId { get; set; }
|
||||
/// <summary>
|
||||
/// 目标单据类型内码
|
||||
/// </summary>
|
||||
[JsonProperty("TargetBillTypeId")]
|
||||
public string Type { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -37,5 +37,8 @@ namespace WMS.Web.Domain.IService.Public
|
||||
Task<ResultList<ErpStockDto>> BillQueryForStock();
|
||||
//同步数据(保存提交审核)
|
||||
Task<Result> Sync<T>(T dto, string formId);
|
||||
//下推
|
||||
Task<Result> Push(ErpPushDto dto);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,6 +340,22 @@ namespace WMS.Web.Domain.Services.Public
|
||||
return Result.ReFailure("错误", 10002);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 下推
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<Result> Push(ErpPushDto dto)
|
||||
{
|
||||
var token_result = await this.Init();
|
||||
if (!token_result.IsSuccess)
|
||||
return token_result;
|
||||
var query = new ErpBillQueryDto(token_result.Data);
|
||||
query.Data = JsonConvert.SerializeObject(dto);
|
||||
//下推
|
||||
var result_json = await _client.PushAsync(JsonConvert.SerializeObject(query));
|
||||
|
||||
return Result.ReSuccess();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user