diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 11e0d730..c95341d7 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -2510,6 +2510,7 @@ namespace Myshipping.Application { var list = await _repLetterYard.AsQueryable() .InnerJoin((ly, ord) => ly.BookingId == ord.Id) + .Where(ly => ly.CreatedUserId == UserManager.UserId) .WhereIF(!string.IsNullOrEmpty(input.MBLNO), (ly, ord) => ord.MBLNO.Contains(input.MBLNO)) .WhereIF(!string.IsNullOrEmpty(input.HBLNO), (ly, ord) => ord.HBLNO.Contains(input.HBLNO)) .WhereIF(!string.IsNullOrEmpty(input.BOOKINGNO), (ly, ord) => ord.BOOKINGNO.Contains(input.BOOKINGNO)) @@ -8056,7 +8057,8 @@ namespace Myshipping.Application { await _rep.AsUpdateable(order).IgnoreColumns().ExecuteCommandAsync(); await SendBookingOrder(new long[] { Id }); - if (!string.IsNullOrEmpty(order.VESSEL)&&!string.IsNullOrEmpty(order.VOYNO)) { + if (!string.IsNullOrEmpty(order.VESSEL) && !string.IsNullOrEmpty(order.VOYNO)) + { var orderlist = await _rep.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.TenantId == UserManager.TENANT_ID && x.CARRIERID == order.CARRIERID && x.VESSEL == order.VESSEL && x.VOYNO == order.VOYNO && x.Id != order.Id) .WhereIF(!string.IsNullOrEmpty(order.VOYNOINNER), x => x.VOYNOINNER == order.VOYNOINNER).ToListAsync(); foreach (var i in orderlist) diff --git a/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowManageService.cs b/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowManageService.cs index 38f06cc8..de116f5b 100644 --- a/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowManageService.cs +++ b/Myshipping.Application/Service/TrackingSystem/ServiceWorkFlowManageService.cs @@ -135,7 +135,7 @@ namespace Myshipping.Application //检索状态对应所有的服务流程,如果已经提取到的状态数量与推送的不一致,提示错误不能入库s var skuList = _statusSkuBaseInfoRepository.AsQueryable().Filter(null, true) .LeftJoin((sts, act) => sts.PK_ID == act.STATUS_SKU_ID) - .LeftJoin((sts,act,rela)=> + .LeftJoin((sts,act,rela)=> act.PK_ID == rela.SERVICE_ACTIVITIES_ID) .LeftJoin((sts, act, rela,wf)=> rela.SERVICE_WORKFLOW_ID == wf.PK_ID && rela.WF_VERSION == wf.RELEASE_VERSION) @@ -181,43 +181,22 @@ namespace Myshipping.Application var wfList = skuList.Select(a => a.WF) .Distinct().ToList(); - //var ddd = wfList.GroupJoin(runList, l => l.PK_ID, - // r => r.main.SERVICE_WF_ID, - // (l, r) => { - // var currList = r.ToList(); - - // if (currList.Count > 0) - // { - // return new { Exists = true, WF = l }; - // } - - // return { Exists = true, WF = l }; + var checkList = wfList.GroupJoin(runList, l => l.PK_ID, + r => r.main.SERVICE_WF_ID, + (l, r) => + { + var currList = r.ToList(); - // }).ToList(); + if (currList.Count > 0) + { + return new { Exists = true, WF = l }; + } + return new { Exists = false, WF = l }; + }).ToList(); - //状态关联的服务流程与运行表中的服务流程对应,对已经有的进行更新,对未进入运行表的进行写入 - var actArg = reqStatusList.Select(a => a.Act.PK_ID).ToArray(); - //根据服务流程活动获取所有相关的服务流程 - var wfRlt = _serviceWorkFlowBaseService.GetServiceWorkFlowListByActivities(actArg).GetAwaiter().GetResult(); - if (!wfRlt.succ) - { - string errMsg = $"获取服务流程失败,原因:{wfRlt.msg}"; - - _logger.LogInformation("批次={no} {msg}", batchNo, errMsg); - - throw Oops.Oh(errMsg, typeof(InvalidOperationException)); - } - - var list = JSON.Deserialize>(JSON.Serialize(wfRlt.ext)); - - - - - //list.GroupJoin(runList,l=>l.) - //如果有已经运行的业务主键则只补充对应的活动表 - if (runList.Count > 0) + if(checkList.Any(a=>a.Exists)) { reqStatusList.ForEach(async reqMd => { @@ -228,7 +207,7 @@ namespace Myshipping.Application currRunAct.ACT_DATE = reqMd.Req.StatusDate; currRunAct.IS_YIELD = 1; - + await _serviceWorkFlowRunActivitiesInfoRepository.AsUpdateable(currRunAct).UpdateColumns(it => new { it.ACT_DATE, @@ -236,19 +215,36 @@ namespace Myshipping.Application }).ExecuteCommandAsync(); }); } - else + + + if (checkList.Any(a => !a.Exists)) { - + var noExistsList = checkList.Where(l => !l.Exists).Select(a=>a.WF.PK_ID).Distinct().ToList(); - + //状态关联的服务流程与运行表中的服务流程对应,对已经有的进行更新,对未进入运行表的进行写入 + var actArg = reqStatusList.Select(a => a.Act.PK_ID).ToArray(); + //根据服务流程活动获取所有相关的服务流程 + var wfRlt = _serviceWorkFlowBaseService.GetServiceWorkFlowListByActivities(actArg).GetAwaiter().GetResult(); + if (!wfRlt.succ) + { + string errMsg = $"获取服务流程失败,原因:{wfRlt.msg}"; - DateTime nowDate = DateTime.Now; + _logger.LogInformation("批次={no} {msg}", batchNo, errMsg); - + throw Oops.Oh(errMsg, typeof(InvalidOperationException)); + } + + var list = JSON.Deserialize>(JSON.Serialize(wfRlt.ext)); + + if(list.Count > 0) + list = list.Where(a=> noExistsList.Contains( a.PKId)).ToList(); + + DateTime nowDate = DateTime.Now; list.ForEach(async wf => { - ServiceWorkFlowRunInfo serviceWorkFlowRunInfo = new ServiceWorkFlowRunInfo { + ServiceWorkFlowRunInfo serviceWorkFlowRunInfo = new ServiceWorkFlowRunInfo + { PK_ID = IDGen.NextID().ToString(), SERVICE_WF_ID = wf.PKId, BUSI_SYSTEM_CODE = info.Main.BusiSystemCode.ToUpper(), @@ -277,9 +273,9 @@ namespace Myshipping.Application wf.StatusSkuList.ForEach(async sku => { - var currReq = + var currReq = reqStatusList.FirstOrDefault(x => x.Act.PK_ID == sku.PKId); - + ServiceWorkFlowRunActivitiesInfo activitiesRunInfo = new ServiceWorkFlowRunActivitiesInfo { PK_ID = IDGen.NextID().ToString(), @@ -304,13 +300,13 @@ namespace Myshipping.Application SOURCE_TYPE = "AUTO" }; - if(currReq != null) + if (currReq != null) { activitiesRunInfo.ACT_DATE = currReq.Req.StatusDate; activitiesRunInfo.ACT_VAL = currReq.Req.StatusVal; activitiesRunInfo.IS_YIELD = 1; } - + if (!string.IsNullOrWhiteSpace(lastActId)) activitiesRunInfo.NEXT_ACT_ID = lastActId; @@ -353,7 +349,7 @@ namespace Myshipping.Application PARENT_ID = activitiesRunInfo.PK_ID }; - if(currSubReq != null) + if (currSubReq != null) { activitiesSubRunInfo.ACT_DATE = currSubReq.Req.StatusDate; activitiesSubRunInfo.ACT_VAL = currSubReq.Req.StatusVal; diff --git a/Myshipping.Core/Entity/DJY/DjyCustomerAddr.cs b/Myshipping.Core/Entity/DJY/DjyCustomerAddr.cs index 6ccca5d5..b90dbca7 100644 --- a/Myshipping.Core/Entity/DJY/DjyCustomerAddr.cs +++ b/Myshipping.Core/Entity/DJY/DjyCustomerAddr.cs @@ -30,5 +30,15 @@ namespace Myshipping.Core.Entity /// 地址类型 factory-工厂地址 /// public string AddrType { get; set; } + + /// + /// 联系人 + /// + public string ContactName { get; set; } + + /// + /// 联系电话 + /// + public string ContactTel { get; set; } } } diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index 6ef58e4b..29e2a6b4 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -1974,6 +1974,16 @@ 地址类型 factory-工厂地址 + + + 联系人 + + + + + 联系电话 + + @@ -10236,6 +10246,16 @@ 地址类型 factory-工厂地址 + + + 联系人 + + + + + 联系电话 + + 订舱客户联系人输出参数 diff --git a/Myshipping.Core/Service/DjyCustomer/Dto/DjyCustomerAddrInput.cs b/Myshipping.Core/Service/DjyCustomer/Dto/DjyCustomerAddrInput.cs index 2f2cd893..5ca2781b 100644 --- a/Myshipping.Core/Service/DjyCustomer/Dto/DjyCustomerAddrInput.cs +++ b/Myshipping.Core/Service/DjyCustomer/Dto/DjyCustomerAddrInput.cs @@ -28,5 +28,15 @@ namespace Myshipping.Core.Service /// 地址类型 factory-工厂地址 /// public string AddrType { get; set; } + + /// + /// 联系人 + /// + public string ContactName { get; set; } + + /// + /// 联系电话 + /// + public string ContactTel { get; set; } } }