diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MesCheckdCallbackUpInput.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MesCheckdCallbackUpInput.cs
new file mode 100644
index 00000000..c0675af0
--- /dev/null
+++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Dto/Inputs/MesCheckdCallbackUpInput.cs
@@ -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
+{
+ ///
+ /// Mes检验后回传输入参数
+ ///
+ public class MesCheckdCallbackUpinput
+ {
+ ///
+ /// 主表Id
+ ///
+ public string maintableid { get; set; }
+ ///
+ /// 检验结论
+ ///
+ public int check_conclusion { get; set; }
+ }
+}
diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/InOutCheckStatusUpdateEntity.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/InOutCheckStatusUpdateEntity.cs
new file mode 100644
index 00000000..c69f364c
--- /dev/null
+++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/Constraints/InOutCheckStatusUpdateEntity.cs
@@ -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
+{
+ ///
+ /// 修改出入库检验状态
+ ///
+ public interface InOutCheckStatusUpdateEntity
+ {
+ ///
+ /// 检验状态
+ ///
+ public int? check_conclusion { get; set; }
+ }
+}
diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockH.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockH.cs
index 97516e77..44e6c1c0 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockH.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsInstockH.cs
@@ -1,6 +1,7 @@
using JNPF.Common.Contracts;
using JNPF.Common.Security;
using SqlSugar;
+using Tnb.WarehouseMgr.Entities.Entity.Constraints;
namespace Tnb.WarehouseMgr.Entities;
@@ -8,7 +9,7 @@ namespace Tnb.WarehouseMgr.Entities;
/// 入库申请主表
///
[SugarTable("wms_instock_h")]
-public partial class WmsInstockH : BaseEntity
+public partial class WmsInstockH : BaseEntity, InOutCheckStatusUpdateEntity
{
public WmsInstockH()
{
@@ -212,4 +213,8 @@ public partial class WmsInstockH : BaseEntity
/// 采购单号
///
public string purchase_code { get; set; }
+ ///
+ /// 检验结论
+ ///
+ public int? check_conclusion { get; set; }
}
diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockH.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockH.cs
index 6416d598..18b25742 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockH.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsOutstockH.cs
@@ -1,6 +1,7 @@
using JNPF.Common.Contracts;
using JNPF.Common.Security;
using SqlSugar;
+using Tnb.WarehouseMgr.Entities.Entity.Constraints;
namespace Tnb.WarehouseMgr.Entities;
@@ -8,7 +9,7 @@ namespace Tnb.WarehouseMgr.Entities;
/// 出库申请主表
///
[SugarTable("wms_outstock_h")]
-public partial class WmsOutstockH : BaseEntity
+public partial class WmsOutstockH : BaseEntity, InOutCheckStatusUpdateEntity
{
public WmsOutstockH()
{
@@ -170,4 +171,8 @@ public partial class WmsOutstockH : BaseEntity
/// 载具Id
///
public string carry_id { get; set; }
+ ///
+ /// 检验结论
+ ///
+ public int? check_conclusion { get; set; }
}
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/Tnb.WarehouseMgr.csproj b/WarehouseMgr/Tnb.WarehouseMgr/Tnb.WarehouseMgr.csproj
index 7d6b065d..238adaa3 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/Tnb.WarehouseMgr.csproj
+++ b/WarehouseMgr/Tnb.WarehouseMgr/Tnb.WarehouseMgr.csproj
@@ -14,6 +14,7 @@
+
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPurchaseAndSaleCommonService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPurchaseAndSaleCommonService.cs
index 7e6db845..ab4e11cd 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPurchaseAndSaleCommonService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPurchaseAndSaleCommonService.cs
@@ -118,5 +118,10 @@ namespace Tnb.WarehouseMgr
return await _db.Updateable().SetColumns(it => it.audit_status == (int)input.auditType).Where(it => input.ids.Contains(it.id)).ExecuteCommandHasChangeAsync();
}
+ protected async Task UpdateChackStatus(MesCheckdCallbackUpinput input) where TEntity : BaseEntity, InOutCheckStatusUpdateEntity, new()
+ {
+ return await _db.Updateable().SetColumns(it => it.check_conclusion == input.check_conclusion).Where(it => it.id == input.maintableid).ExecuteCommandHasChangeAsync();
+ }
+
}
}
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPurchaseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPurchaseService.cs
index 35225662..c00e83ae 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPurchaseService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPurchaseService.cs
@@ -18,6 +18,9 @@ using NPOI.OpenXmlFormats.Dml.Diagram;
using SqlSugar;
using Tnb.BasicData.Entities;
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.Consts;
using Tnb.WarehouseMgr.Entities.Dto;
@@ -34,11 +37,13 @@ namespace Tnb.WarehouseMgr
{
private readonly ISqlSugarClient _db;
private readonly IUserManager _userManager;
- public WmsPurchaseService(ISqlSugarRepository repo, IUserManager userManager)
+ private readonly IQcCheckPlanService _qcCheckPlanService;
+ public WmsPurchaseService(ISqlSugarRepository repo, IUserManager userManager, IQcCheckPlanService qcCheckPlanService)
: base(repo, userManager)
{
_db = repo.AsSugarClient();
_userManager = userManager;
+ _qcCheckPlanService = qcCheckPlanService;
}
private async Task xxx(VisualDevModelDataCrInput input)
@@ -84,7 +89,11 @@ namespace Tnb.WarehouseMgr
await _db.Insertable(instockDs).ExecuteCommandAsync();
}
//通知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();
}
catch (Exception ex)
@@ -119,5 +128,16 @@ namespace Tnb.WarehouseMgr
{
return await Audit(input);
}
+ ///
+ /// mes 检验完后通知wms(采购) 回调接口
+ ///
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task MesCheckdPurchaseCallback(MesCheckdCallbackUpinput input)
+ {
+ return await UpdateChackStatus(input);
+ }
}
}
diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsSaleService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsSaleService.cs
index 47b614c5..1605a513 100644
--- a/WarehouseMgr/Tnb.WarehouseMgr/WmsSaleService.cs
+++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsSaleService.cs
@@ -72,5 +72,17 @@ namespace Tnb.WarehouseMgr
return await Audit(input);
}
+ ///
+ /// mes 检验完后通知wms(销售) 回调接口
+ ///
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task MesCheckdSaleCallback(MesCheckdCallbackUpinput input)
+ {
+ return await UpdateChackStatus(input);
+ }
+
}
}