From 5e60661478dc9087a1f7e74562af01ab40cba203 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 18 Mar 2024 13:10:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9C=8D=E5=8A=A1=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ServiceWorkFlowBaseService.cs | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowBaseService.cs b/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowBaseService.cs index 660a9f23..69deff05 100644 --- a/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowBaseService.cs +++ b/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowBaseService.cs @@ -423,19 +423,22 @@ namespace Myshipping.Application await _serviceWorkFlowActivitiesSubRelationRepository.InsertAsync(wfRelationActivitiesSub); - sub.StatusTriggerList.ForEach(async trg => + if (sub != null && sub.StatusTriggerList != null && sub.StatusTriggerList.Count > 0) { - var triggerRela = new ServiceWorkFlowActivitiesTriggerRelation + sub.StatusTriggerList.ForEach(async trg => { - PK_ID = IDGen.NextID().ToString(), - SERVICE_WORKFLOW_ID = entity.PK_ID, - SERVICE_ACTIVITIES_ID = sub.PKId, - STATUS_TRIGGER_ID = trg.PKId, - WF_VERSION = currVersion - }; + var triggerRela = new ServiceWorkFlowActivitiesTriggerRelation + { + PK_ID = IDGen.NextID().ToString(), + SERVICE_WORKFLOW_ID = entity.PK_ID, + SERVICE_ACTIVITIES_ID = sub.PKId, + STATUS_TRIGGER_ID = trg.PKId, + WF_VERSION = currVersion + }; - await _serviceWorkFlowActivitiesTriggerRelationRepository.InsertAsync(triggerRela); - }); + await _serviceWorkFlowActivitiesTriggerRelationRepository.InsertAsync(triggerRela); + }); + } }); }