From 4fe47d56d98735243fa757ab77befc0b00e0b195 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Tue, 27 Dec 2022 17:02:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=88=B9=E5=90=8D=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingOrderService.cs | 25 ++++++++++--------- .../Service/CommonDB/CommonDBService.cs | 4 +-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 1c9ae63a..af8381c0 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -358,7 +358,7 @@ namespace Myshipping.Application } - JsonUtil.PropToUpper(input, "ORDNO", "BSSTATUS", "YardContract", "YardContractTel", "YardContractEmail"); + JsonUtil.PropToUpper(input, "ORDNO", "BSSTATUS", "YardContract", "YardContractTel", "YardContractEmail", "MARKS", "DESCRIPTION", "CONSIGNEENAME", "SHIPPERNAME", "NOTIFYPARTYNAME"); JsonUtil.TrimFields(input); if (input.ctnInputs != null) { @@ -471,7 +471,7 @@ namespace Myshipping.Application throw Oops.Bah("请填写分提单号"); } } - JsonUtil.PropToUpper(input, "ORDNO", "BSSTATUS", "YardContract", "YardContractTel", "YardContractEmail"); + JsonUtil.PropToUpper(input, "ORDNO", "BSSTATUS", "YardContract", "YardContractTel", "YardContractEmail", "MARKS", "DESCRIPTION", "CONSIGNEENAME", "SHIPPERNAME", "NOTIFYPARTYNAME"); JsonUtil.TrimFields(input); if (input.ctnInputs != null) { @@ -911,17 +911,18 @@ namespace Myshipping.Application foreach (var item in dto) { - if (item.CARRIERID != "") + if (!string.IsNullOrWhiteSpace(item.CARRIERID)) { - var et = _repBookingStatus.Where(x => x.StaCode == "sta_mudigang" && x.BookingId == Convert.ToInt64(item.BusinessId)).FirstAsync(); + var et = _repBookingStatus.AsQueryable().Where(x => x.StaCode == "sta_mudigang" && x.BookingId == Convert.ToInt64(item.BusinessId)).FirstAsync().Result; if (et != null) { - throw Oops.Bah("提单号"+item.MBLNO+"已订阅!"); + throw Oops.Bah("提单号" + item.MBLNO + "已订阅!"); } } - if (item.YardCode != "") + + if (!string.IsNullOrWhiteSpace(item.YardCode)) { - var et = _repBookingStatus.Where(x => x.StaCode == "sta_qiyungang" && x.BookingId == Convert.ToInt64(item.BusinessId)).FirstAsync(); + var et = _repBookingStatus.AsQueryable().Where(x => x.StaCode == "sta_qiyungang" && x.BookingId == Convert.ToInt64(item.BusinessId)).FirstAsync().Result; if (et != null) { throw Oops.Bah("提单号" + item.MBLNO + "已订阅!"); @@ -943,15 +944,15 @@ namespace Myshipping.Application bookingStatusLog.BookingId = Convert.ToInt64(item.BusinessId); bookingStatusLog.Category = "ship"; bookingStatusLog.CreatedTime = DateTime.Now; - if (item.YardCode == "" && item.CARRIERID != "") + if (string.IsNullOrWhiteSpace( item.YardCode) && !string.IsNullOrWhiteSpace( item.CARRIERID )) { bookingStatusLog.Status = "订阅目的港"; } - if (item.YardCode != "" && item.CARRIERID == "") + if (!string.IsNullOrWhiteSpace(item.YardCode) && string.IsNullOrWhiteSpace(item.CARRIERID)) { bookingStatusLog.Status = "订阅起运港"; } - if (item.YardCode != "" && item.CARRIERID != "") + if (!string.IsNullOrWhiteSpace(item.YardCode) && !string.IsNullOrWhiteSpace(item.CARRIERID)) { bookingStatusLog.Status = "订阅起运港,目的港"; } @@ -959,7 +960,7 @@ namespace Myshipping.Application bookingStatusLog.MBLNO = item.MBLNO; await _repStatuslog.InsertAsync(bookingStatusLog); - if (item.CARRIERID != "") + if (!string.IsNullOrWhiteSpace(item.CARRIERID)) { BookingStatus bookingStatus = new BookingStatus(); bookingStatus.BookingId = Convert.ToInt64(item.BusinessId); @@ -969,7 +970,7 @@ namespace Myshipping.Application bookingStatus.StaCate = "book_sta_cate_billtrace"; await _repBookingStatus.InsertAsync(bookingStatus); } - if (item.YardCode != "") + if (!string.IsNullOrWhiteSpace(item.YardCode)) { BookingStatus bookingStatus = new BookingStatus(); bookingStatus.BookingId = Convert.ToInt64(item.BusinessId); diff --git a/Myshipping.Core/Service/CommonDB/CommonDBService.cs b/Myshipping.Core/Service/CommonDB/CommonDBService.cs index 8061dde4..55adc55d 100644 --- a/Myshipping.Core/Service/CommonDB/CommonDBService.cs +++ b/Myshipping.Core/Service/CommonDB/CommonDBService.cs @@ -279,7 +279,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie var list = await _sysCacheService.GetAllMappingVessel(); - var count = list.Where(x => x.Name.Trim() == dto.Name.Trim()&&x.Module==dto.Module && x.GID != dto.GID).Count(); + var count = list.Where(x => x.Name == dto.Name.Trim()&&x.Module==dto.Module && x.GID != dto.GID).Count(); if (count > 0) { throw Oops.Bah(ErrorCode.D1006); @@ -888,7 +888,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie List list = await _sysCacheService.GetAllCodeCtn(); var queryList = list.WhereIF(!string.IsNullOrEmpty(input.KeyWord), x => x.Name.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase) || x.Code.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase) - || x.EdiCode.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase)); + || x.EdiCode.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase)).OrderByDescending(x=>x.CreateTime); return queryList.ToList();