船名映射

optimize
wet 2 years ago
parent 47c3fd6685
commit 4fe47d56d9

@ -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); JsonUtil.TrimFields(input);
if (input.ctnInputs != null) if (input.ctnInputs != null)
{ {
@ -471,7 +471,7 @@ namespace Myshipping.Application
throw Oops.Bah("请填写分提单号"); 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); JsonUtil.TrimFields(input);
if (input.ctnInputs != null) if (input.ctnInputs != null)
{ {
@ -911,17 +911,18 @@ namespace Myshipping.Application
foreach (var item in dto) 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) 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) if (et != null)
{ {
throw Oops.Bah("提单号" + item.MBLNO + "已订阅!"); throw Oops.Bah("提单号" + item.MBLNO + "已订阅!");
@ -943,15 +944,15 @@ namespace Myshipping.Application
bookingStatusLog.BookingId = Convert.ToInt64(item.BusinessId); bookingStatusLog.BookingId = Convert.ToInt64(item.BusinessId);
bookingStatusLog.Category = "ship"; bookingStatusLog.Category = "ship";
bookingStatusLog.CreatedTime = DateTime.Now; bookingStatusLog.CreatedTime = DateTime.Now;
if (item.YardCode == "" && item.CARRIERID != "") if (string.IsNullOrWhiteSpace( item.YardCode) && !string.IsNullOrWhiteSpace( item.CARRIERID ))
{ {
bookingStatusLog.Status = "订阅目的港"; bookingStatusLog.Status = "订阅目的港";
} }
if (item.YardCode != "" && item.CARRIERID == "") if (!string.IsNullOrWhiteSpace(item.YardCode) && string.IsNullOrWhiteSpace(item.CARRIERID))
{ {
bookingStatusLog.Status = "订阅起运港"; bookingStatusLog.Status = "订阅起运港";
} }
if (item.YardCode != "" && item.CARRIERID != "") if (!string.IsNullOrWhiteSpace(item.YardCode) && !string.IsNullOrWhiteSpace(item.CARRIERID))
{ {
bookingStatusLog.Status = "订阅起运港,目的港"; bookingStatusLog.Status = "订阅起运港,目的港";
} }
@ -959,7 +960,7 @@ namespace Myshipping.Application
bookingStatusLog.MBLNO = item.MBLNO; bookingStatusLog.MBLNO = item.MBLNO;
await _repStatuslog.InsertAsync(bookingStatusLog); await _repStatuslog.InsertAsync(bookingStatusLog);
if (item.CARRIERID != "") if (!string.IsNullOrWhiteSpace(item.CARRIERID))
{ {
BookingStatus bookingStatus = new BookingStatus(); BookingStatus bookingStatus = new BookingStatus();
bookingStatus.BookingId = Convert.ToInt64(item.BusinessId); bookingStatus.BookingId = Convert.ToInt64(item.BusinessId);
@ -969,7 +970,7 @@ namespace Myshipping.Application
bookingStatus.StaCate = "book_sta_cate_billtrace"; bookingStatus.StaCate = "book_sta_cate_billtrace";
await _repBookingStatus.InsertAsync(bookingStatus); await _repBookingStatus.InsertAsync(bookingStatus);
} }
if (item.YardCode != "") if (!string.IsNullOrWhiteSpace(item.YardCode))
{ {
BookingStatus bookingStatus = new BookingStatus(); BookingStatus bookingStatus = new BookingStatus();
bookingStatus.BookingId = Convert.ToInt64(item.BusinessId); bookingStatus.BookingId = Convert.ToInt64(item.BusinessId);

@ -279,7 +279,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
var list = await _sysCacheService.GetAllMappingVessel(); 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) if (count > 0)
{ {
throw Oops.Bah(ErrorCode.D1006); throw Oops.Bah(ErrorCode.D1006);
@ -888,7 +888,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
List<CodeCtn> list = await _sysCacheService.GetAllCodeCtn(); List<CodeCtn> 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) 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(); return queryList.ToList();

Loading…
Cancel
Save