Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -466,9 +466,13 @@ namespace Tnb.ProductionMgr
|
||||
|
||||
if (detail.feeding_num + num < detail.num)
|
||||
{
|
||||
if (wmsCarryCode.codeqty < num)
|
||||
{
|
||||
throw new Exception("条码数量小于投料数量");
|
||||
}
|
||||
await db.Updateable<WmsCarryCode>()
|
||||
.SetColumns(x => x.codeqty == x.codeqty - num)
|
||||
.Where(x => x.carry_id == detail.member_carry_id)
|
||||
.Where(x => x.carry_id == carry.id)
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -76,6 +76,7 @@ namespace Tnb.ProductionMgr
|
||||
private readonly IWmsCarryService _wmsCarryService;
|
||||
private readonly ElevatorControlConfiguration _eleCtlCfg = App.Configuration.Build<ElevatorControlConfiguration>();
|
||||
private readonly RedisData _redisData;
|
||||
private static SemaphoreSlim prdreportSemaphore = new(1);
|
||||
|
||||
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
|
||||
public PrdMoTaskService(
|
||||
@@ -1609,32 +1610,34 @@ namespace Tnb.ProductionMgr
|
||||
[HttpPost]
|
||||
public async Task<dynamic> PrdReport(PrdReportCrInput input)
|
||||
{
|
||||
Log.Information($"生产提报参数:{JsonConvert.SerializeObject(input)}");
|
||||
ISqlSugarClient db = _repository.AsSugarClient();
|
||||
PrdMoTask? prdMoTask = await db.Queryable<PrdMoTask>().SingleAsync(x => x.id == input.mo_task_id);
|
||||
EqpEquipment equip = await db.Queryable<EqpEquipment>().SingleAsync(x => x.id == prdMoTask.eqp_id);
|
||||
BasMaterial basMaterial = await db.Queryable<BasMaterial>().SingleAsync(x => x.id == prdMoTask.material_id);
|
||||
PrdReport report = await db.Queryable<PrdReport>().FirstAsync(it => it.mo_task_id == input.mo_task_id);
|
||||
|
||||
if (basMaterial == null)
|
||||
{
|
||||
throw Oops.Bah($"未找到物料{prdMoTask.material_id}");
|
||||
}
|
||||
|
||||
Dictionary<String, String> dic = new Dictionary<string, string>()
|
||||
{
|
||||
["30019971917589"] = "外包装箱码垛线"
|
||||
};
|
||||
|
||||
Dictionary<String, String> dic2 = new Dictionary<string, string>()
|
||||
{
|
||||
[WmsWareHouseConst.XUELUGUAN1XIAN] = "WBZX_x1_Enquantity",
|
||||
[WmsWareHouseConst.XUELUGUAN2XIAN] = "WBZX_x2_Enquantity"
|
||||
};
|
||||
string materialBoxCode = input.material_box_code;
|
||||
BasLocation location = null;
|
||||
await prdreportSemaphore.WaitAsync();
|
||||
try
|
||||
{
|
||||
Log.Information($"生产提报参数:{JsonConvert.SerializeObject(input)}");
|
||||
ISqlSugarClient db = _repository.AsSugarClient();
|
||||
PrdMoTask? prdMoTask = await db.Queryable<PrdMoTask>().SingleAsync(x => x.id == input.mo_task_id);
|
||||
EqpEquipment equip = await db.Queryable<EqpEquipment>().SingleAsync(x => x.id == prdMoTask.eqp_id);
|
||||
BasMaterial basMaterial = await db.Queryable<BasMaterial>().SingleAsync(x => x.id == prdMoTask.material_id);
|
||||
PrdReport report = await db.Queryable<PrdReport>().FirstAsync(it => it.mo_task_id == input.mo_task_id);
|
||||
|
||||
if (basMaterial == null)
|
||||
{
|
||||
throw Oops.Bah($"未找到物料{prdMoTask.material_id}");
|
||||
}
|
||||
|
||||
Dictionary<String, String> dic = new Dictionary<string, string>()
|
||||
{
|
||||
["30019971917589"] = "外包装箱码垛线"
|
||||
};
|
||||
|
||||
Dictionary<String, String> dic2 = new Dictionary<string, string>()
|
||||
{
|
||||
[WmsWareHouseConst.XUELUGUAN1XIAN] = "WBZX_x1_Enquantity",
|
||||
[WmsWareHouseConst.XUELUGUAN2XIAN] = "WBZX_x2_Enquantity"
|
||||
};
|
||||
string materialBoxCode = input.material_box_code;
|
||||
BasLocation location = null;
|
||||
|
||||
await _db.Ado.BeginTranAsync();
|
||||
int row = -1;
|
||||
PrdMo prdMo = await db.Queryable<PrdMo>().SingleAsync(x => x.id == prdMoTask.mo_id);
|
||||
@@ -2181,6 +2184,9 @@ namespace Tnb.ProductionMgr
|
||||
await _db.Ado.RollbackTranAsync();
|
||||
throw Oops.Bah("提报失败:"+ex.Message);
|
||||
}
|
||||
finally{
|
||||
prdreportSemaphore.Release();
|
||||
}
|
||||
|
||||
// DbResult<bool> result = await _repository.AsSugarClient().Ado.UseTranAsync(async () =>
|
||||
// {
|
||||
|
||||
@@ -3,6 +3,7 @@ using JNPF.Common.Extension;
|
||||
using JNPF.FriendlyException;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using Senparc.Weixin.MP.AdvancedAPIs.Semantic;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData.Entities;
|
||||
@@ -102,7 +103,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
throw new AppFriendlyException("载具条码数据异常,有料箱为空", 500);
|
||||
}
|
||||
|
||||
|
||||
int i = 0;
|
||||
foreach ((string mCarryId, object v) in mCarryIdDic)
|
||||
{
|
||||
@@ -121,6 +122,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
if (carryCodeQueryOutput.member_carrycode == null)
|
||||
{
|
||||
Logger.Information($"WmsCarryD数据:{JsonConvert.SerializeObject(mCarryIdDic)}||||||carryCodes数据:{JsonConvert.SerializeObject(carryCodes)}");
|
||||
throw new AppFriendlyException("载具与条码数量可能不匹配", 500);
|
||||
}
|
||||
carryCodeQueryOutput.member_carryid = mCarryIdDic2.GetOrDefault(carryCodeQueryOutput.member_carrycode).ToString();
|
||||
|
||||
Reference in New Issue
Block a user