质检
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user