雅达-简化收货单创建逻辑并更新数据类型
在 `WMS_U9C.cs` 中,注释掉了创建 `CreateRcvBySrcASNParam` 的代码,直接使用 `input.CreateRcvBySrcASNParam` 进行 POST 请求,以简化代码并更新日志记录。
在 `U9CParameter.cs` 中,将 `UOMMain`、`UOMMain_SKey` 和 `UOMSub_SKey` 的 `ID` 属性类型从 `string` 更改为 `double`,并为其提供默认值 `1002212260110007`。同时,`CreateRcvBySrcASNInput` 类中添加了 `CreateRcvBySrcASNParam` 属性,以便于传递创建收货单所需的参数。
| | |
| | | Logger.Interface.Info($"U9C登录token: {input.token}"); |
| | | } |
| | | } |
| | | List<CreateRcvBySrcASNParam> param = new() { |
| | | new() { |
| | | aSNToRcvTransDTOs = new(){ |
| | | new(){ |
| | | TransQty=new() { |
| | | m_amount1= input.CurRevQty, |
| | | m_uOM1 = new() { |
| | | UOMMain = "1002212260110007", |
| | | UOMMain_SKey=new(){ |
| | | ID="1002212260110007", |
| | | }, |
| | | UOMSub_SKey = new(){ |
| | | ID="1002212260110007", |
| | | } |
| | | }, |
| | | }, |
| | | ASNLineKey=input.ASNLineKey, |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | var response = await HttpHelper.PostAsync(CreateRcvBySrcASNUrl, JsonConvert.SerializeObject(param), new Dictionary<string, string>() { { "token", input.token } }); |
| | | //List<CreateRcvBySrcASNParam> param = new() { |
| | | // new() { |
| | | // aSNToRcvTransDTOs = new(){ |
| | | // new(){ |
| | | // TransQty=new() { |
| | | // m_amount1= input.CurRevQty, |
| | | // m_uOM1 = new() { |
| | | // UOMMain = "1002212260110007", |
| | | // UOMMain_SKey=new(){ |
| | | // ID="1002212260110007", |
| | | // }, |
| | | // UOMSub_SKey = new(){ |
| | | // ID="1002212260110007", |
| | | // } |
| | | // }, |
| | | // }, |
| | | // ASNLineKey=input.ASNLineKey, |
| | | // } |
| | | // } |
| | | // } |
| | | //}; |
| | | var response = await HttpHelper.PostAsync(CreateRcvBySrcASNUrl, JsonConvert.SerializeObject(input.CreateRcvBySrcASNParam), new Dictionary<string, string>() { { "token", input.token } }); |
| | | var result = JsonConvert.DeserializeObject<U9CResult2>(response.Message); |
| | | if (result != null) |
| | | { |
| | | if (result.Success && result.Data[0].IsSucess) |
| | | { |
| | | action.Data = result.Data; |
| | | Logger.Interface.Info($"新增收货单-来源ASN单接口提交Json: {JsonConvert.SerializeObject(param)},返回Json: {response.Message}"); |
| | | Logger.Interface.Info($"新增收货单-来源ASN单接口提交Json: {JsonConvert.SerializeObject(input.CreateRcvBySrcASNParam)},返回Json: {response.Message}"); |
| | | } |
| | | else |
| | | { |
| | |
| | | /// <summary> |
| | | /// 单位id |
| | | /// </summary> |
| | | public string UOMMain { get; set; } |
| | | public double UOMMain { get; set; } = 1002212260110007; |
| | | /// <summary> |
| | | /// 单位id |
| | | /// </summary> |
| | |
| | | |
| | | public class UOMMain_SKey |
| | | { |
| | | public string ID { get; set; } |
| | | public double ID { get; set; } = 1002212260110007; |
| | | } |
| | | |
| | | public class UOMSub_SKey |
| | | { |
| | | public string ID { get; set; } |
| | | public double ID { get; set; } = 1002212260110007; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public class CreateRcvBySrcASNInput : U9CBaseInput |
| | | { |
| | | /// <summary> |
| | | /// 当前收货数量 - m_amount1 |
| | | /// </summary> |
| | | public string CurRevQty { get; set; } |
| | | /// <summary> |
| | | /// ASN单行ID |
| | | /// </summary> |
| | | public string ASNLineKey { get; set; } |
| | | public List<CreateRcvBySrcASNParam> CreateRcvBySrcASNParam { get; set; } |
| | | } |
| | | |
| | | #region 无来源 |