新增Mes检验结束后,回调通知功能
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Tnb.WarehouseMgr.Entities.Dto.Inputs
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Mes检验后回传输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class MesCheckdCallbackUpinput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主表Id
|
||||||
|
/// </summary>
|
||||||
|
public string maintableid { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 检验结论
|
||||||
|
/// </summary>
|
||||||
|
public int check_conclusion { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Tnb.WarehouseMgr.Entities.Entity.Constraints
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 修改出入库检验状态
|
||||||
|
/// </summary>
|
||||||
|
public interface InOutCheckStatusUpdateEntity
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 检验状态
|
||||||
|
/// </summary>
|
||||||
|
public int? check_conclusion { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
using JNPF.Common.Contracts;
|
using JNPF.Common.Contracts;
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
using Tnb.WarehouseMgr.Entities.Entity.Constraints;
|
||||||
|
|
||||||
namespace Tnb.WarehouseMgr.Entities;
|
namespace Tnb.WarehouseMgr.Entities;
|
||||||
|
|
||||||
@@ -8,7 +9,7 @@ namespace Tnb.WarehouseMgr.Entities;
|
|||||||
/// 入库申请主表
|
/// 入库申请主表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("wms_instock_h")]
|
[SugarTable("wms_instock_h")]
|
||||||
public partial class WmsInstockH : BaseEntity<string>
|
public partial class WmsInstockH : BaseEntity<string>, InOutCheckStatusUpdateEntity
|
||||||
{
|
{
|
||||||
public WmsInstockH()
|
public WmsInstockH()
|
||||||
{
|
{
|
||||||
@@ -212,4 +213,8 @@ public partial class WmsInstockH : BaseEntity<string>
|
|||||||
/// 采购单号
|
/// 采购单号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string purchase_code { get; set; }
|
public string purchase_code { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 检验结论
|
||||||
|
/// </summary>
|
||||||
|
public int? check_conclusion { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using JNPF.Common.Contracts;
|
using JNPF.Common.Contracts;
|
||||||
using JNPF.Common.Security;
|
using JNPF.Common.Security;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
using Tnb.WarehouseMgr.Entities.Entity.Constraints;
|
||||||
|
|
||||||
namespace Tnb.WarehouseMgr.Entities;
|
namespace Tnb.WarehouseMgr.Entities;
|
||||||
|
|
||||||
@@ -8,7 +9,7 @@ namespace Tnb.WarehouseMgr.Entities;
|
|||||||
/// 出库申请主表
|
/// 出库申请主表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("wms_outstock_h")]
|
[SugarTable("wms_outstock_h")]
|
||||||
public partial class WmsOutstockH : BaseEntity<string>
|
public partial class WmsOutstockH : BaseEntity<string>, InOutCheckStatusUpdateEntity
|
||||||
{
|
{
|
||||||
public WmsOutstockH()
|
public WmsOutstockH()
|
||||||
{
|
{
|
||||||
@@ -170,4 +171,8 @@ public partial class WmsOutstockH : BaseEntity<string>
|
|||||||
/// 载具Id
|
/// 载具Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string carry_id { get; set; }
|
public string carry_id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 检验结论
|
||||||
|
/// </summary>
|
||||||
|
public int? check_conclusion { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<ProjectReference Include="..\..\EquipMgr\Tnb.EquipMgr.Entities\Tnb.EquipMgr.Entities.csproj" />
|
<ProjectReference Include="..\..\EquipMgr\Tnb.EquipMgr.Entities\Tnb.EquipMgr.Entities.csproj" />
|
||||||
<ProjectReference Include="..\..\message\Tnb.Message.Interfaces\Tnb.Message.Interfaces.csproj" />
|
<ProjectReference Include="..\..\message\Tnb.Message.Interfaces\Tnb.Message.Interfaces.csproj" />
|
||||||
<ProjectReference Include="..\..\ProductionMgr\Tnb.ProductionMgr.Interfaces\Tnb.ProductionMgr.Interfaces.csproj" />
|
<ProjectReference Include="..\..\ProductionMgr\Tnb.ProductionMgr.Interfaces\Tnb.ProductionMgr.Interfaces.csproj" />
|
||||||
|
<ProjectReference Include="..\..\QcMgr\Tnb.QcMgr.Interfaces\Tnb.QcMgr.Interfaces.csproj" />
|
||||||
<ProjectReference Include="..\..\visualdev\Tnb.VisualDev.Engine\Tnb.VisualDev.Engine.csproj" />
|
<ProjectReference Include="..\..\visualdev\Tnb.VisualDev.Engine\Tnb.VisualDev.Engine.csproj" />
|
||||||
<ProjectReference Include="..\Tnb.WarehouseMgr.Interfaces\Tnb.WarehouseMgr.Interfaces.csproj" />
|
<ProjectReference Include="..\Tnb.WarehouseMgr.Interfaces\Tnb.WarehouseMgr.Interfaces.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -118,5 +118,10 @@ namespace Tnb.WarehouseMgr
|
|||||||
return await _db.Updateable<TEntity>().SetColumns(it => it.audit_status == (int)input.auditType).Where(it => input.ids.Contains(it.id)).ExecuteCommandHasChangeAsync();
|
return await _db.Updateable<TEntity>().SetColumns(it => it.audit_status == (int)input.auditType).Where(it => input.ids.Contains(it.id)).ExecuteCommandHasChangeAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected async Task<bool> UpdateChackStatus<TEntity>(MesCheckdCallbackUpinput input) where TEntity : BaseEntity<string>, InOutCheckStatusUpdateEntity, new()
|
||||||
|
{
|
||||||
|
return await _db.Updateable<TEntity>().SetColumns(it => it.check_conclusion == input.check_conclusion).Where(it => it.id == input.maintableid).ExecuteCommandHasChangeAsync();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ using NPOI.OpenXmlFormats.Dml.Diagram;
|
|||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.BasicData.Entities;
|
using Tnb.BasicData.Entities;
|
||||||
using Tnb.Common.Utils;
|
using Tnb.Common.Utils;
|
||||||
|
using Tnb.QcMgr.Entities;
|
||||||
|
using Tnb.QcMgr.Entities.Enums;
|
||||||
|
using Tnb.QcMgr.Interfaces;
|
||||||
using Tnb.WarehouseMgr.Entities;
|
using Tnb.WarehouseMgr.Entities;
|
||||||
using Tnb.WarehouseMgr.Entities.Consts;
|
using Tnb.WarehouseMgr.Entities.Consts;
|
||||||
using Tnb.WarehouseMgr.Entities.Dto;
|
using Tnb.WarehouseMgr.Entities.Dto;
|
||||||
@@ -34,11 +37,13 @@ namespace Tnb.WarehouseMgr
|
|||||||
{
|
{
|
||||||
private readonly ISqlSugarClient _db;
|
private readonly ISqlSugarClient _db;
|
||||||
private readonly IUserManager _userManager;
|
private readonly IUserManager _userManager;
|
||||||
public WmsPurchaseService(ISqlSugarRepository<WmsPurchaseH> repo, IUserManager userManager)
|
private readonly IQcCheckPlanService _qcCheckPlanService;
|
||||||
|
public WmsPurchaseService(ISqlSugarRepository<WmsPurchaseH> repo, IUserManager userManager, IQcCheckPlanService qcCheckPlanService)
|
||||||
: base(repo, userManager)
|
: base(repo, userManager)
|
||||||
{
|
{
|
||||||
_db = repo.AsSugarClient();
|
_db = repo.AsSugarClient();
|
||||||
_userManager = userManager;
|
_userManager = userManager;
|
||||||
|
_qcCheckPlanService = qcCheckPlanService;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<dynamic> xxx(VisualDevModelDataCrInput input)
|
private async Task<dynamic> xxx(VisualDevModelDataCrInput input)
|
||||||
@@ -84,7 +89,11 @@ namespace Tnb.WarehouseMgr
|
|||||||
await _db.Insertable(instockDs).ExecuteCommandAsync();
|
await _db.Insertable(instockDs).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
//通知Mes接口
|
//通知Mes接口
|
||||||
|
CreateTaskEntity ctEntity = new();
|
||||||
|
ctEntity.maintableid = instock.id;
|
||||||
|
ctEntity.materialids = instockDs.Select(x => x.material_id).ToList();
|
||||||
|
ctEntity.triggerevent = EnumTriggerEvent.入厂检按物料编号;
|
||||||
|
_ = _qcCheckPlanService.CreateWmsTask(ctEntity);
|
||||||
await _db.Ado.CommitTranAsync();
|
await _db.Ado.CommitTranAsync();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -119,5 +128,16 @@ namespace Tnb.WarehouseMgr
|
|||||||
{
|
{
|
||||||
return await Audit<WmsPurchaseH>(input);
|
return await Audit<WmsPurchaseH>(input);
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// mes 检验完后通知wms(采购) 回调接口
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input">
|
||||||
|
/// </param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<dynamic> MesCheckdPurchaseCallback(MesCheckdCallbackUpinput input)
|
||||||
|
{
|
||||||
|
return await UpdateChackStatus<WmsInstockH>(input);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,5 +72,17 @@ namespace Tnb.WarehouseMgr
|
|||||||
return await Audit<WmsSaleH>(input);
|
return await Audit<WmsSaleH>(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// mes 检验完后通知wms(销售) 回调接口
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input">
|
||||||
|
/// </param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<dynamic> MesCheckdSaleCallback(MesCheckdCallbackUpinput input)
|
||||||
|
{
|
||||||
|
return await UpdateChackStatus<WmsOutstockH>(input);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user