Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -3,7 +3,7 @@ using Tnb.ProductionMgr.Entities.Dto;
|
||||
namespace Tnb.ProductionMgr.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料签收服务接口
|
||||
/// 物料投料服务接口
|
||||
/// </summary>
|
||||
public interface IPrdFeedingService
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
using JNPF;
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Logging;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.ProductionMgr.Entities;
|
||||
@@ -14,6 +19,13 @@ using Tnb.ProductionMgr.Interfaces;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Dto;
|
||||
using Tnb.ProductionMgr.Entities.Consts;
|
||||
using Tnb.ProductionMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities.Dto;
|
||||
using Tnb.ProductionMgr.Interfaces;
|
||||
using Tnb.ProductionMgr.Entities.Consts;
|
||||
using Tnb.WarehouseMgr;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.BasicData;
|
||||
|
||||
namespace Tnb.ProductionMgr
|
||||
{
|
||||
@@ -71,6 +83,9 @@ namespace Tnb.ProductionMgr
|
||||
public async Task<dynamic> SaveData(MaterialReceiptInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
DbResult<bool> result2 = new DbResult<bool>();
|
||||
PrdMaterialReceiptH prdMaterialReceiptH = null;
|
||||
List<PrdMaterialReceiptD> list = new List<PrdMaterialReceiptD>();
|
||||
DbResult<bool> result = await db.Ado.UseTranAsync(async () =>
|
||||
{
|
||||
var moTask = await db.Queryable<PrdMoTask>().FirstAsync(x => x.id == input.mo_task_id);
|
||||
@@ -80,7 +95,7 @@ namespace Tnb.ProductionMgr
|
||||
.ToListAsync();
|
||||
|
||||
string code = await _billRullService.GetBillNumber(Tnb.BasicData.CodeTemplateConst.MATERIAL_RECEIPT_CODE);
|
||||
PrdMaterialReceiptH prdMaterialReceiptH = new PrdMaterialReceiptH()
|
||||
prdMaterialReceiptH = new PrdMaterialReceiptH()
|
||||
{
|
||||
code = code,
|
||||
station_id = input.station_id,
|
||||
@@ -125,13 +140,54 @@ namespace Tnb.ProductionMgr
|
||||
}
|
||||
|
||||
|
||||
await db.Insertable<PrdMaterialReceiptH>(prdMaterialReceiptH).ExecuteCommandAsync();
|
||||
await db.Insertable<PrdMaterialReceiptD>(list).ExecuteCommandAsync();
|
||||
// await db.Insertable<PrdMaterialReceiptH>(prdMaterialReceiptH).ExecuteCommandAsync();
|
||||
// await db.Insertable<PrdMaterialReceiptD>(list).ExecuteCommandAsync();
|
||||
|
||||
});
|
||||
|
||||
if(!result.IsSuccess) throw Oops.Oh(result.ErrorMessage);
|
||||
return result.IsSuccess ? "签收成功" : result.ErrorMessage;
|
||||
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
//签收后调用载具签收接口
|
||||
// await _wmsSignForDeliveryService.MESCarrySign(new MESCarrySignInput()
|
||||
// {
|
||||
// org_id = _userManager.GetUserInfo().Result.organizeId,
|
||||
// create_id = _userManager.UserId,
|
||||
// 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<PrdMaterialReceiptH>(prdMaterialReceiptH).ExecuteCommandAsync();
|
||||
await db.Insertable<PrdMaterialReceiptD>(list).ExecuteCommandAsync();
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(!result2.IsSuccess) throw Oops.Oh(result2.ErrorMessage);
|
||||
return result2.IsSuccess ? "签收成功" : result2.ErrorMessage;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,7 +67,9 @@ namespace Tnb.WarehouseMgr
|
||||
try
|
||||
{
|
||||
var carry = await _db.Queryable<WmsCarryH>().SingleAsync(it => it.carry_code == input.carry_code);
|
||||
var carryCodes = await _db.Queryable<WmsCarryCode>().Where(it => it.carry_id == carry.id).ToListAsync();
|
||||
var carryDs = await _db.Queryable<WmsCarryD>().Where(it => it.carry_id == carry.id).ToListAsync();
|
||||
var mCarryIds = carryDs.Select(x=>x.membercarry_id).ToList();
|
||||
var carryCodes = await _db.Queryable<WmsCarryCode>().Where(it => mCarryIds.Contains(it.carry_id)).ToListAsync();
|
||||
data = carry.Adapt<CarryQueryOutput>();
|
||||
data.wmsCarryCodes = carryCodes.Adapt<List<CarryCodeQueryOutput>>();
|
||||
|
||||
|
||||
@@ -360,6 +360,7 @@ namespace Tnb.WarehouseMgr
|
||||
await _db.Ado.BeginTranAsync();
|
||||
List<WmsKittingoutD> kittingOutDs = new();
|
||||
var kittingOuts = input.Adapt<List<WmsKittingoutH>>();
|
||||
var ids = input.Select(x => x.location_code).ToArray();
|
||||
|
||||
for (int i = 0; i < kittingOuts.Count; i++)
|
||||
{
|
||||
@@ -370,6 +371,7 @@ namespace Tnb.WarehouseMgr
|
||||
x.bill_type = WmsWareHouseConst.BIZTYPE_WMSKITTINGOUTSTK_ID;
|
||||
x.status = WmsWareHouseConst.BILLSTATUS_ADD_ID;
|
||||
x.biz_type = WmsWareHouseConst.BIZTYPE_WMSKITTINGOUTSTK_ID;
|
||||
x.location_id = ids[i];
|
||||
var d = input[i]?.wmsKittingoutDs?.Adapt<List<WmsKittingoutD>>();
|
||||
d?.ForEach(it =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user