From f63cc58a2bf6af1662060ef6756e564f551f11b9 Mon Sep 17 00:00:00 2001 From: zhangxiaofeng <1939543722@qq.com> Date: Wed, 12 Jun 2024 18:56:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E6=B5=8B=E9=97=AE=E9=A2=98=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/OpenController.cs | 10 +++++++ .../Controllers/OrderController.cs | 27 +++++++++++++++---- .../QuartzNet/Jobs/JobHydStatusQuartz.cs | 6 ++--- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/EntrustSettle.Api/Controllers/OpenController.cs b/EntrustSettle.Api/Controllers/OpenController.cs index 25d035e..21bd7e8 100644 --- a/EntrustSettle.Api/Controllers/OpenController.cs +++ b/EntrustSettle.Api/Controllers/OpenController.cs @@ -243,6 +243,16 @@ namespace EntrustSettle.Api.Controllers isUpdate = true; order.Status = input.status; orderUpdateable.SetColumns(x => x.Status == input.status); + + // 记录订单状态变更历史 + await orderHistoryService.Add(new OrderHistory() + { + Pid = order.Id, + Status = (int)input.status, + StatusTime = DateTime.Now, + CreateBy = "系统", + Remark = "(状态接收)" + }); } if (isHasBill) { diff --git a/EntrustSettle.Api/Controllers/OrderController.cs b/EntrustSettle.Api/Controllers/OrderController.cs index 3d14a36..09635c6 100644 --- a/EntrustSettle.Api/Controllers/OrderController.cs +++ b/EntrustSettle.Api/Controllers/OrderController.cs @@ -586,7 +586,8 @@ namespace EntrustSettle.Api.Controllers var annexList = await annexService.Query(x => bindDto.AnnexIdList.Contains(x.Id)); foreach (Annex item in annexList) { - string fileUrl = string.Join(",", annexList.Select(x => $"{domainUrl}/api/Annex/Download?key={x.Key}")); + //string fileUrl = string.Join(",", annexList.Select(x => $"{domainUrl}/api/Annex/Download?key={x.Key}")); + string fileUrl = $"{domainUrl}/api/Annex/Download?key={item.Key}"; hydFeedbackDtoList.Add(new HydFeedbackDto() { @@ -687,10 +688,14 @@ namespace EntrustSettle.Api.Controllers { if (!string.IsNullOrWhiteSpace(bindDto.Remark)) { - string remark = string.IsNullOrEmpty(order.Remark) ? - bindDto.Remark : + if (string.IsNullOrEmpty(order.Remark)) + { + order.Remark = bindDto.Remark; + } + else + { order.Remark += (Environment.NewLine + bindDto.Remark); - order.Remark = remark; + } } } else if (bindDto.OperType == FileTypeEnum.发票) @@ -710,11 +715,23 @@ namespace EntrustSettle.Api.Controllers string msg = $"Id:[{order.Id}],提单号:[{order.Mblno}],更新账单或发票后推送队列"; try { + int type = bindDto.OperType switch + { + FileTypeEnum.账单 => 3, + FileTypeEnum.发票 => 4, + _ => 0 + }; + var billIdList = orderAnnexService.AsQueryable() + .LeftJoin((o, a) => o.AnnexId == a.Id) + .Where((o, a) => o.OrderId == order.Id && a.Type == type) + .Select((o, a) => a.Id) + .ToList(); + BillPushDto pushDto = new() { OrderId = order.Id, Mblno = order.Mblno, - AnnexIdList = bindDto.AnnexIdList, + AnnexIdList = billIdList, }; if (bindDto.OperType == FileTypeEnum.账单) { diff --git a/EntrustSettle.Tasks/QuartzNet/Jobs/JobHydStatusQuartz.cs b/EntrustSettle.Tasks/QuartzNet/Jobs/JobHydStatusQuartz.cs index 49e69ce..d61dff9 100644 --- a/EntrustSettle.Tasks/QuartzNet/Jobs/JobHydStatusQuartz.cs +++ b/EntrustSettle.Tasks/QuartzNet/Jobs/JobHydStatusQuartz.cs @@ -87,7 +87,7 @@ namespace EntrustSettle.Tasks continue; } var order = orderList[0]; - if (order.Status != item.status) + if (item.status != null && order.Status != item.status) { order.Status = item.status; var updateSuccess = await orderService.Update(order, x => new { x.Status }); @@ -97,7 +97,7 @@ namespace EntrustSettle.Tasks await orderHistoryService.Add(new OrderHistory() { Pid = order.Id, - Status = item.status, + Status = item.status ?? 0, StatusTime = DateTime.Now, CreateBy = "系统", Remark = "(后台任务自动设置)" @@ -118,7 +118,7 @@ namespace EntrustSettle.Tasks MessageType = 1, MessageDesc = "状态更新推送", Remark = "", - Status = item.status, + Status = item.status ?? 0, StatusDesc = item.status switch { 0 => "已下单",