任务接收

usertest
zhangxiaofeng 4 months ago
parent 513c458218
commit 8078426bda

@ -698,28 +698,29 @@ namespace DS.WMS.Core.TaskPlat.Method
{
var codeCtnCache = (await codeCtnService.GetAllList())?.Data ?? new List<Code.Dtos.CodeCtnRes>();
info.Main.SIFeedBack.ContaList.ForEach(ctn =>
{
var contaInfo = ctn.Adapt<TaskSiSubmittedCtn>();
var list = info.Main.SIFeedBack.ContaList.Select(ctn =>
{
var contaInfo = ctn.Adapt<TaskSiSubmittedCtn>();
contaInfo.P_PKID = taskSISubmitted.Id;
contaInfo.P_PKID = taskSISubmitted.Id;
if (string.IsNullOrWhiteSpace(contaInfo.CTNCODE) && !string.IsNullOrWhiteSpace(contaInfo.CTNALL))
{
if (codeCtnCache != null && codeCtnCache.Count > 0)
{
var ctnCodeInfo = codeCtnCache.FirstOrDefault(x => !string.IsNullOrWhiteSpace(x.CtnName)
&& x.CtnName.Equals(contaInfo.CTNALL, StringComparison.OrdinalIgnoreCase));
if (string.IsNullOrWhiteSpace(contaInfo.CTNCODE) && !string.IsNullOrWhiteSpace(contaInfo.CTNALL))
{
if (codeCtnCache != null && codeCtnCache.Count > 0)
{
var ctnCodeInfo = codeCtnCache.FirstOrDefault(x => !string.IsNullOrWhiteSpace(x.CtnName)
&& x.CtnName.Equals(contaInfo.CTNALL, StringComparison.OrdinalIgnoreCase));
if (ctnCodeInfo != null)
{
contaInfo.CTNCODE = ctnCodeInfo.EdiCode;
}
}
}
if (ctnCodeInfo != null)
{
contaInfo.CTNCODE = ctnCodeInfo.EdiCode;
}
}
}
tenantDb.Insertable<TaskSiSubmittedCtn>(contaInfo).ExecuteCommand();
});
return contaInfo;
}).ToList();
await tenantDb.Insertable<TaskSiSubmittedCtn>(list).ExecuteCommandAsync();
}
// 执行自动化操作
@ -1236,7 +1237,7 @@ namespace DS.WMS.Core.TaskPlat.Method
if (info.Main.PODDischargeGateoutFull.DetailList != null
&& info.Main.PODDischargeGateoutFull.DetailList.Count > 0)
{
info.Main.PODDischargeGateoutFull.DetailList.ForEach(async ctn =>
var list = info.Main.PODDischargeGateoutFull.DetailList.Select(ctn =>
{
var detailInfo = ctn.Adapt<TaskPodDischargeGateoutFullDetail>();
@ -1244,8 +1245,9 @@ namespace DS.WMS.Core.TaskPlat.Method
detailInfo.CreateTime = taskInfo.CreateTime;
await tenantDb.Insertable(detailInfo).ExecuteCommandAsync();
});
return detailInfo;
}).ToList();
await tenantDb.Insertable(list).ExecuteCommandAsync();
}
////触发推送消息
@ -1412,27 +1414,30 @@ namespace DS.WMS.Core.TaskPlat.Method
if (info.Main.TransportPlanHasChangeInfo.From.vesselList != null
&& info.Main.TransportPlanHasChangeInfo.From.vesselList.Count > 0)
{
info.Main.TransportPlanHasChangeInfo.From.vesselList.ForEach(async p =>
{
TaskTransPlanHasChangeDetail detailInfo = new TaskTransPlanHasChangeDetail
{
VESSEL = p.Vessel,
VOYNO = p.Voyno,
SHIP_FLAG = p.Flag,
SORT_NO = p.Indx,
IS_REMOVED = p.IsRemoved
};
var list = info.Main.TransportPlanHasChangeInfo.From.vesselList.Select(p =>
{
TaskTransPlanHasChangeDetail detailInfo = new TaskTransPlanHasChangeDetail
{
VESSEL = p.Vessel,
VOYNO = p.Voyno,
SHIP_FLAG = p.Flag,
SORT_NO = p.Indx,
IS_REMOVED = p.IsRemoved
};
detailInfo.P_ID = taskTransPlanHasChangeInfo.Id;
detailInfo.P_ID = taskTransPlanHasChangeInfo.Id;
detailInfo.PLAN_TYPE = "FROM";
detailInfo.COLUMN_TYPE = "VESSEL";
detailInfo.PLAN_TYPE = "FROM";
detailInfo.COLUMN_TYPE = "VESSEL";
detailInfo.CreateTime = taskInfo.CreateTime;
detailInfo.CreateTime = taskInfo.CreateTime;
return detailInfo;
await tenantDb.Insertable(detailInfo).ExecuteCommandAsync();
});
}).ToList();
await tenantDb.Insertable(list).ExecuteCommandAsync();
}
}

Loading…
Cancel
Save