This commit is contained in:
yang.lee
2023-11-08 17:07:55 +08:00
6 changed files with 55 additions and 4 deletions

View File

@@ -4,6 +4,5 @@ namespace Tnb.ProductionMgr.Entities.Dto
{ {
public string equip_code { get; set; } public string equip_code { get; set; }
public string label_code { get; set; } public string label_code { get; set; }
public string as_location_code { get; set; }
} }
} }

View File

@@ -43,5 +43,12 @@ namespace Tnb.ProductionMgr.Interfaces
/// <param name="input"></param> /// <param name="input"></param>
/// <returns></returns> /// <returns></returns>
public Task<string> InstockTubeThree(PrdReport prdReport); public Task<string> InstockTubeThree(PrdReport prdReport);
/// <summary>
/// 外包装入库申请
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public Task<string> InstockOutPack(InstockInput inut);
} }
} }

View File

@@ -263,7 +263,6 @@ namespace Tnb.ProductionMgr
{ {
string equip_code = inut.equip_code; string equip_code = inut.equip_code;
string label_code = inut.label_code; string label_code = inut.label_code;
string as_location_code = inut.as_location_code;
string warehouse_id = "2"; string warehouse_id = "2";
if (!string.IsNullOrEmpty(equip_code)) if (!string.IsNullOrEmpty(equip_code))
{ {
@@ -621,5 +620,15 @@ namespace Tnb.ProductionMgr
return result2.IsSuccess ? "true" : "false"; return result2.IsSuccess ? "true" : "false";
} }
/// <summary>
/// 外包装入库申请
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public Task<string> InstockOutPack(InstockInput inut)
{
throw new NotImplementedException();
}
} }
} }

View File

@@ -120,7 +120,12 @@ namespace Tnb.ProductionMgr
{ {
if (res.Value<bool>("Value")) if (res.Value<bool>("Value"))
{ {
// InstockInput instockInput = new()
{
equip_code = res["DevName"]!.ToString(),
label_code = res["TagName"]!.ToString()
};
_prdInstockService.InstockOutPack(instockInput);
} }
} }
} }

View File

@@ -15,6 +15,8 @@ using SqlSugar;
using Tnb.BasicData.Entities; using Tnb.BasicData.Entities;
using Tnb.QcMgr.Entities; using Tnb.QcMgr.Entities;
using Tnb.QcMgr.Interfaces; using Tnb.QcMgr.Interfaces;
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
using Tnb.WarehouseMgr.Interfaces;
namespace Tnb.QcMgr namespace Tnb.QcMgr
{ {
@@ -29,12 +31,16 @@ namespace Tnb.QcMgr
private const string ModuleId = "26745613138709"; private const string ModuleId = "26745613138709";
private readonly ISqlSugarRepository<QcCheckExecH> _repository; private readonly ISqlSugarRepository<QcCheckExecH> _repository;
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
private readonly IWmsSaleService _wmsSaleService;
private readonly IWmsPurchaseService _wmsPurchaseService;
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc(); public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
public QcCheckTaskService(ISqlSugarRepository<QcCheckExecH> repository, IUserManager userManager) public QcCheckTaskService(ISqlSugarRepository<QcCheckExecH> repository, IUserManager userManager, IWmsSaleService wmsSaleService, IWmsPurchaseService wmsPurchaseService)
{ {
_repository = repository; _repository = repository;
_userManager = userManager; _userManager = userManager;
OverideFuncs.GetListAsync = GetListAsync; OverideFuncs.GetListAsync = GetListAsync;
_wmsSaleService= wmsSaleService;
_wmsPurchaseService= wmsPurchaseService;
} }
private async Task<dynamic> GetListAsync(VisualDevModelListQueryInput input) private async Task<dynamic> GetListAsync(VisualDevModelListQueryInput input)
@@ -197,6 +203,14 @@ namespace Tnb.QcMgr
ISqlSugarClient db = _repository.AsSugarClient(); ISqlSugarClient db = _repository.AsSugarClient();
try try
{ {
Dictionary<string, int> dic = new()
{
{ "ok", 1 },
{ "no", 2 },
{ "barelyOk", 4 },
{ "await", 8 },
{ "temporarily", 16 }
};
QcCheckExecH QcCheckExecH = await db.Queryable<QcCheckExecH>().Where(p => p.id == CheckTaskInput.mainid).FirstAsync(); QcCheckExecH QcCheckExecH = await db.Queryable<QcCheckExecH>().Where(p => p.id == CheckTaskInput.mainid).FirstAsync();
DictionaryTypeEntity DictionaryType = await db.Queryable<DictionaryTypeEntity>().Where(p => p.FullName == "质检状态").FirstAsync(); DictionaryTypeEntity DictionaryType = await db.Queryable<DictionaryTypeEntity>().Where(p => p.FullName == "质检状态").FirstAsync();
DictionaryDataEntity DictionaryData = await db.Queryable<DictionaryDataEntity>().Where(p => p.DictionaryTypeId == DictionaryType.Id && p.FullName == "已完成").FirstAsync(); DictionaryDataEntity DictionaryData = await db.Queryable<DictionaryDataEntity>().Where(p => p.DictionaryTypeId == DictionaryType.Id && p.FullName == "已完成").FirstAsync();
@@ -267,6 +281,22 @@ namespace Tnb.QcMgr
_ = await db.Updateable(QcCheckExecH).ExecuteCommandAsync(); _ = await db.Updateable(QcCheckExecH).ExecuteCommandAsync();
_ = await db.Deleteable(QcCheckExecDdel).ExecuteCommandAsync(); _ = await db.Deleteable(QcCheckExecDdel).ExecuteCommandAsync();
_ = await db.Insertable(QcCheckExecDinsert).ExecuteCommandAsync(); _ = await db.Insertable(QcCheckExecDinsert).ExecuteCommandAsync();
//出厂检
if (QcCheckExecH.checktype == "26589783783701" && !string.IsNullOrEmpty(QcCheckExecH.extras))
{
MesCheckdCallbackUpinput mesCheckdCallbackUpinput = new MesCheckdCallbackUpinput();
mesCheckdCallbackUpinput.maintableid = QcCheckExecH.extras;
mesCheckdCallbackUpinput.check_conclusion = dic.Where(p => p.Key == CheckTaskInput.result).Any() ? dic.Where(p => p.Key == CheckTaskInput.result).First().Value : 0;
await _wmsSaleService.MesCheckdSaleCallback(mesCheckdCallbackUpinput);
}
//入厂检
else if (QcCheckExecH.checktype == "26589773352981" && !string.IsNullOrEmpty(QcCheckExecH.extras))
{
MesCheckdCallbackUpinput mesCheckdCallbackUpinput = new MesCheckdCallbackUpinput();
mesCheckdCallbackUpinput.maintableid = QcCheckExecH.extras;
mesCheckdCallbackUpinput.check_conclusion = dic.Where(p => p.Key == CheckTaskInput.result).Any() ? dic.Where(p => p.Key == CheckTaskInput.result).First().Value : 0;
await _wmsPurchaseService.MesCheckdPurchaseCallback(mesCheckdCallbackUpinput);
}
await db.Ado.CommitTranAsync(); await db.Ado.CommitTranAsync();
} }
catch (Exception) catch (Exception)

View File

@@ -10,6 +10,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\taskschedule\Tnb.TaskScheduler\Tnb.TaskScheduler.csproj" /> <ProjectReference Include="..\..\taskschedule\Tnb.TaskScheduler\Tnb.TaskScheduler.csproj" />
<ProjectReference Include="..\..\visualdev\Tnb.VisualDev.Engine\Tnb.VisualDev.Engine.csproj" /> <ProjectReference Include="..\..\visualdev\Tnb.VisualDev.Engine\Tnb.VisualDev.Engine.csproj" />
<ProjectReference Include="..\..\WarehouseMgr\Tnb.WarehouseMgr.Interfaces\Tnb.WarehouseMgr.Interfaces.csproj" />
<ProjectReference Include="..\Tnb.QcMgr.Interfaces\Tnb.QcMgr.Interfaces.csproj" /> <ProjectReference Include="..\Tnb.QcMgr.Interfaces\Tnb.QcMgr.Interfaces.csproj" />
</ItemGroup> </ItemGroup>