mes物料签收后调用wms载具签收接口

This commit is contained in:
2023-07-21 16:47:32 +08:00
parent 9b14c845e6
commit 4c2cef5fe6
3 changed files with 92 additions and 36 deletions

View File

@@ -27,7 +27,7 @@ using Tnb.BasicData;
namespace Tnb.ProductionMgr
{
/// <summary>
/// 业务实现:物料签收
/// 业务实现:物料投料
/// </summary>
[ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)]
[Route("api/[area]/[controller]/[action]")]
@@ -159,7 +159,7 @@ namespace Tnb.ProductionMgr
}
if(!result.IsSuccess) throw Oops.Oh(result.ErrorMessage);
return result.IsSuccess ? "签收成功" : result.ErrorMessage;
return result.IsSuccess ? "投料成功" : result.ErrorMessage;
}
[HttpPost]
@@ -272,34 +272,34 @@ namespace Tnb.ProductionMgr
// carry_code = input.carry_code ?? "",
// });
var mesCarrySignInput = new MESCarrySignInput()
{
org_id = _userManager.GetUserInfo().Result.organizeId,
create_id = _userManager.UserId,
carry_code = input.carry_code ?? "",
};
string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
Dictionary<string, object> header = new Dictionary<string, object>()
{
["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
};
var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CARRY_SIGN,JsonConvert.SerializeObject(mesCarrySignInput),header);
Log.Information(sendResult);
AuthResponse authResponse = JsonConvert.DeserializeObject<AuthResponse>(sendResult);
if (authResponse.code != 200)
{
throw Oops.Bah(authResponse.msg);
}
else
{
result2 = await db.Ado.UseTranAsync(async () =>
{
await db.Insertable<PrdFeedingH>(prdFeedingH).ExecuteCommandAsync();
await db.Insertable<PrdFeedingD>(list).ExecuteCommandAsync();
});
}
// var mesCarrySignInput = new MESCarrySignInput()
// {
// org_id = _userManager.GetUserInfo().Result.organizeId,
// create_id = _userManager.UserId,
// carry_code = input.carry_code ?? "",
// };
//
// string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
// Dictionary<string, object> header = new Dictionary<string, object>()
// {
// ["Authorization"] = App.HttpContext.Request.Headers["Authorization"]
// };
// var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_CARRY_SIGN,JsonConvert.SerializeObject(mesCarrySignInput),header);
// Log.Information(sendResult);
// AuthResponse authResponse = JsonConvert.DeserializeObject<AuthResponse>(sendResult);
// if (authResponse.code != 200)
// {
// throw Oops.Bah(authResponse.msg);
// }
// else
// {
// result2 = await db.Ado.UseTranAsync(async () =>
// {
// await db.Insertable<PrdFeedingH>(prdFeedingH).ExecuteCommandAsync();
// await db.Insertable<PrdFeedingD>(list).ExecuteCommandAsync();
// });
//
// }
}
if(!result2.IsSuccess) throw Oops.Oh(result2.ErrorMessage);