|
|
|
@ -18,7 +18,9 @@ using Microsoft.AspNetCore.Authentication;
|
|
|
|
|
using Microsoft.AspNetCore.Identity;
|
|
|
|
|
using Furion.FriendlyException;
|
|
|
|
|
using Furion.Logging;
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
|
|
|
|
|
namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
@ -28,12 +30,16 @@ namespace Myshipping.Application
|
|
|
|
|
public class BookingOrderService : IBookingOrderService, IDynamicApiController, ITransient
|
|
|
|
|
{
|
|
|
|
|
private readonly SqlSugarRepository<BookingOrder> _rep;
|
|
|
|
|
private readonly SqlSugarRepository<BookingCtn> _repCtn;
|
|
|
|
|
|
|
|
|
|
public BookingOrderService(SqlSugarRepository<BookingOrder> rep, SqlSugarRepository<BookingCtn> repCtn)
|
|
|
|
|
private readonly SqlSugarRepository<BookingCtn> _repCtn;
|
|
|
|
|
private readonly SqlSugarRepository<BookingCtnDetail> _ctndetailrep;
|
|
|
|
|
private readonly ILogger<BookingOrderService> _logger;
|
|
|
|
|
public BookingOrderService(SqlSugarRepository<BookingOrder> rep, SqlSugarRepository<BookingCtn> repCtn, SqlSugarRepository<BookingCtnDetail> ctndetailrep, ILogger<BookingOrderService> logger)
|
|
|
|
|
{
|
|
|
|
|
_rep = rep;
|
|
|
|
|
_repCtn = repCtn;
|
|
|
|
|
this._logger = logger;
|
|
|
|
|
this._rep = rep;
|
|
|
|
|
this._repCtn = repCtn;
|
|
|
|
|
this._ctndetailrep = ctndetailrep;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -46,41 +52,47 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
var entities = await _rep.AsQueryable()
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.BSSTATUS), u => u.BSSTATUS == input.BSSTATUS)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.MBLNO), u => u.MBLNO == input.MBLNO)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.HBLNO), u => u.HBLNO == input.HBLNO)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.BOOKINGNO), u => u.BOOKINGNO == input.BOOKINGNO)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CONTRACTNO), u => u.CONTRACTNO == input.CONTRACTNO)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SERVICECONTRACTNO), u => u.SERVICECONTRACTNO == input.SERVICECONTRACTNO)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SHIPPER), u => u.SHIPPER == input.SHIPPER)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CONSIGNEE), u => u.CONSIGNEE == input.CONSIGNEE)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.NOTIFYPARTY), u => u.NOTIFYPARTY == input.NOTIFYPARTY)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.NOTIFYPARTY2), u => u.NOTIFYPARTY2 == input.NOTIFYPARTY2)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.MBLNO), u => input.MBLNO.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Contains(u.MBLNO))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.HBLNO), u => input.HBLNO.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Contains(u.HBLNO))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.BOOKINGNO), u => u.BOOKINGNO.IndexOf(input.BOOKINGNO) > -1)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CONTRACTNO), u => u.CONTRACTNO.IndexOf(input.CONTRACTNO) > -1)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SERVICECONTRACTNO), u => u.SERVICECONTRACTNO.IndexOf(input.SERVICECONTRACTNO) > -1)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SHIPPER), u => u.SHIPPER.Contains(input.SHIPPER))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CONSIGNEE), u => u.CONSIGNEE.Contains(input.CONSIGNEE))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.NOTIFYPARTY), u => u.NOTIFYPARTY.Contains(input.NOTIFYPARTY))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.NOTIFYPARTY2), u => u.NOTIFYPARTY2.Contains(input.NOTIFYPARTY2))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.YARDID), u => u.YARDID == input.YARDID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.YARD), u => u.YARD == input.YARD)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.VESSELID), u => u.VESSELID == input.VESSELID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.VESSEL), u => u.VESSEL == input.VESSEL)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.VOYNO), u => u.VOYNO == input.VOYNO)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.VOYNOINNER), u => u.VOYNOINNER == input.VOYNOINNER)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PLACERECEIPT), u => u.PLACERECEIPT == input.PLACERECEIPT)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PORTLOAD), u => u.PORTLOAD == input.PORTLOAD)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PORTDISCHARGE), u => u.PORTDISCHARGE == input.PORTDISCHARGE)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PLACEDELIVERY), u => u.PLACEDELIVERY == input.PLACEDELIVERY)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.DESTINATION), u => u.DESTINATION == input.DESTINATION)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.VESSELID), u => u.VESSELID.IndexOf(input.VESSELID) > -1)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.VESSEL), u => u.VESSEL.ToLower().IndexOf(u.VESSEL.ToLower()) > -1)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.VOYNO), u => u.VOYNO.IndexOf(input.VOYNO) > -1)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.VOYNOINNER), u => u.VOYNOINNER.IndexOf(input.VOYNOINNER) > -1)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PLACERECEIPT), u => u.PLACERECEIPT.Contains(input.PLACERECEIPT))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PLACERECEIPTID), u => u.PLACERECEIPTID == input.PLACERECEIPTID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PORTLOAD), u => u.PORTLOAD.IndexOf(input.PORTLOAD) > -1)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PORTDISCHARGE), u => u.PORTDISCHARGE.IndexOf(input.PORTDISCHARGE) > -1)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PLACEDELIVERY), u => u.PLACEDELIVERY.Contains(input.PLACEDELIVERY))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PLACEDELIVERYID), u => u.PLACEDELIVERYID == input.PLACEDELIVERYID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.DESTINATION), u => u.DESTINATION.Contains(input.DESTINATION))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.DESTINATIONID), u => u.DESTINATIONID == input.DESTINATIONID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.NOBILL), u => u.NOBILL == input.NOBILL)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.COPYNOBILLL), u => u.COPYNOBILLL == input.COPYNOBILLL)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.ISSUETYPE), u => u.ISSUETYPE == input.ISSUETYPE)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.ISSUEPLACE), u => u.ISSUEPLACE == input.ISSUEPLACE)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.ISSUEPLACE), u => u.ISSUEPLACE.Contains(input.ISSUEPLACE))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.ISSUEPLACEID), u => u.ISSUEPLACEID == input.ISSUEPLACEID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.BLFRT), u => u.BLFRT == input.BLFRT)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PREPARDATID), u => u.PREPARDATID == input.PREPARDATID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PREPARDAT), u => u.PREPARDAT == input.PREPARDAT)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PAYABLEAT), u => u.PAYABLEAT == input.PAYABLEAT)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SERVICE), u => u.SERVICE == input.SERVICE)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.MARKS), u => u.MARKS == input.MARKS)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.HSCODE), u => u.HSCODE == input.HSCODE)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.DESCRIPTION), u => u.DESCRIPTION == input.DESCRIPTION)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PAYABLEAT), u => u.PAYABLEAT.Contains(input.PAYABLEAT))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PAYABLEATID), u => u.PAYABLEATID == input.PAYABLEATID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SERVICE), u => u.SERVICE.Contains(input.SERVICE))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.MARKS), u => u.MARKS.Contains(input.MARKS))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.HSCODE), u => u.HSCODE.IndexOf(input.HSCODE) > -1)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.DESCRIPTION), u => u.DESCRIPTION.Contains(input.DESCRIPTION))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.KINDPKGS), u => u.KINDPKGS == input.KINDPKGS)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CNTRTOTAL), u => u.CNTRTOTAL == input.CNTRTOTAL)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CARRIERID), u => u.CARRIERID == input.CARRIERID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CARRIER), u => u.CARRIER == input.CARRIER)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CARRIER), u => u.CARRIER.Contains(input.CARRIER))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CARGOID), u => u.CARGOID == input.CARGOID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.DCLASS), u => u.DCLASS == input.DCLASS)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.DUNNO), u => u.DUNNO == input.DUNNO)
|
|
|
|
@ -93,41 +105,32 @@ namespace Myshipping.Application
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.HUMIDITY), u => u.HUMIDITY == input.HUMIDITY)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.TEMPMIN), u => u.TEMPMIN == input.TEMPMIN)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.TEMPMAX), u => u.TEMPMAX == input.TEMPMAX)
|
|
|
|
|
//.WhereIF(!input.ISCONTAINERSOC, u => u.ISCONTAINERSOC == input.ISCONTAINERSOC)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SOREMARK), u => u.SOREMARK == input.SOREMARK)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SIREMARK), u => u.SIREMARK == input.SIREMARK)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.YARDREMARK), u => u.YARDREMARK == input.YARDREMARK)
|
|
|
|
|
.WhereIF(!input.ISCONTAINERSOC, u => u.ISCONTAINERSOC == input.ISCONTAINERSOC)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SOREMARK), u => u.SOREMARK.Contains(input.SOREMARK))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SIREMARK), u => u.SIREMARK.Contains(input.SIREMARK))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.YARDREMARK), u => u.YARDREMARK.Contains(input.YARDREMARK))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.COMPID), u => u.COMPID == input.COMPID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.COMPNAME), u => u.COMPNAME == input.COMPNAME)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SHIPPERNAME), u => u.SHIPPERNAME == input.SHIPPERNAME)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SHIPPERADDR1), u => u.SHIPPERADDR1 == input.SHIPPERADDR1)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SHIPPERADDR2), u => u.SHIPPERADDR2 == input.SHIPPERADDR2)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SHIPPERADDR3), u => u.SHIPPERADDR3 == input.SHIPPERADDR3)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SHIPPERCITY), u => u.SHIPPERCITY == input.SHIPPERCITY)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.COMPNAME), u => u.COMPNAME.IndexOf(input.COMPNAME) > -1)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SHIPPERNAME), u => u.SHIPPERNAME.Contains(input.SHIPPERNAME))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SHIPPERCITY), u => u.SHIPPERCITY.Contains(input.SHIPPERCITY))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SHIPPERPROVINCE), u => u.SHIPPERPROVINCE == input.SHIPPERPROVINCE)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SHIPPERPOSTCODE), u => u.SHIPPERPOSTCODE == input.SHIPPERPOSTCODE)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SHIPPERCOUNTRY), u => u.SHIPPERCOUNTRY == input.SHIPPERCOUNTRY)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SHIPPERATTN), u => u.SHIPPERATTN == input.SHIPPERATTN)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SHIPPERATTN), u => u.SHIPPERATTN.Contains(input.SHIPPERATTN))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SHIPPERTEL), u => u.SHIPPERTEL == input.SHIPPERTEL)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CONSIGNEENAME), u => u.CONSIGNEENAME == input.CONSIGNEENAME)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CONSIGNEEADDR1), u => u.CONSIGNEEADDR1 == input.CONSIGNEEADDR1)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CONSIGNEEADDR2), u => u.CONSIGNEEADDR2 == input.CONSIGNEEADDR2)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CONSIGNEEADDR3), u => u.CONSIGNEEADDR3 == input.CONSIGNEEADDR3)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CONSIGNEECITY), u => u.CONSIGNEECITY == input.CONSIGNEECITY)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CONSIGNEENAME), u => u.CONSIGNEENAME.Contains(input.CONSIGNEENAME))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CONSIGNEECITY), u => u.CONSIGNEECITY.Contains(input.CONSIGNEECITY))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CONSIGNEEPROVINCE), u => u.CONSIGNEEPROVINCE == input.CONSIGNEEPROVINCE)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CONSIGNEEPOSTCODE), u => u.CONSIGNEEPOSTCODE == input.CONSIGNEEPOSTCODE)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CONSIGNEERCOUNTRY), u => u.CONSIGNEERCOUNTRY == input.CONSIGNEERCOUNTRY)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CONSIGNEEATTN), u => u.CONSIGNEEATTN == input.CONSIGNEEATTN)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CONSIGNEEATTN), u => u.CONSIGNEEATTN.Contains(input.CONSIGNEEATTN))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CONSIGNEETEL), u => u.CONSIGNEETEL == input.CONSIGNEETEL)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.NOTIFYPARTYNAME), u => u.NOTIFYPARTYNAME == input.NOTIFYPARTYNAME)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.NOTIFYPARTYADDR1), u => u.NOTIFYPARTYADDR1 == input.NOTIFYPARTYADDR1)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.NOTIFYPARTYADDR2), u => u.NOTIFYPARTYADDR2 == input.NOTIFYPARTYADDR2)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.NOTIFYPARTYADDR3), u => u.NOTIFYPARTYADDR3 == input.NOTIFYPARTYADDR3)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.NOTIFYPARTYCITY), u => u.NOTIFYPARTYCITY == input.NOTIFYPARTYCITY)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.NOTIFYPARTYNAME), u => u.NOTIFYPARTYNAME.Contains(input.NOTIFYPARTYNAME))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.NOTIFYPARTYCITY), u => u.NOTIFYPARTYCITY.Contains(input.NOTIFYPARTYCITY))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.NOTIFYPARTYPROVINCE), u => u.NOTIFYPARTYPROVINCE == input.NOTIFYPARTYPROVINCE)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.NOTIFYPARTYPOSTCODE), u => u.NOTIFYPARTYPOSTCODE == input.NOTIFYPARTYPOSTCODE)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.NOTIFYPARTYCOUNTRY), u => u.NOTIFYPARTYCOUNTRY == input.NOTIFYPARTYCOUNTRY)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.NOTIFYPARTYATTN), u => u.NOTIFYPARTYATTN == input.NOTIFYPARTYATTN)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.NOTIFYPARTYATTN), u => u.NOTIFYPARTYATTN.Contains(input.NOTIFYPARTYATTN))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.NOTIFYPARTYTEL), u => u.NOTIFYPARTYTEL == input.NOTIFYPARTYTEL)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PONO), u => u.PONO == input.PONO)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.OPID), u => u.OPID == input.OPID)
|
|
|
|
@ -135,8 +138,12 @@ namespace Myshipping.Application
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.OP), u => u.OP == input.OP)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.DOC), u => u.DOC == input.DOC)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SALEID), u => u.SALEID == input.SALEID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SALE), u => u.SALE == input.SALE)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SALE), u => u.SALE.Contains(input.SALE))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CUSTSERVICEID), u => u.CUSTSERVICEID == input.CUSTSERVICEID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CUSTSERVICE), u => u.CUSTSERVICE.Contains(input.CUSTSERVICE))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CUSTOMERNAME), u => u.CUSTOMERNAME.Contains(input.CUSTOMERNAME))
|
|
|
|
|
.WhereIF(input.CUSTOMERID != null, u => u.CUSTOMERID == input.CUSTOMERID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.FORWARDER), u => u.FORWARDER.Contains(input.FORWARDER))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CUSTSERVICE), u => u.CUSTSERVICE == input.CUSTSERVICE)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CUSTOMERNAME), u => u.CUSTOMERNAME == input.CUSTOMERNAME)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.FORWARDER), u => u.FORWARDER == input.FORWARDER)
|
|
|
|
@ -145,64 +152,107 @@ namespace Myshipping.Application
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.TRUCKER), u => u.TRUCKER == input.TRUCKER)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.AGENTID), u => u.AGENTID == input.AGENTID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.FORWARDERID), u => u.FORWARDERID == input.FORWARDERID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SHIPAGENCY), u => u.SHIPAGENCY.Contains(input.SHIPAGENCY))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SHIPAGENCYID), u => u.SHIPAGENCYID == input.SHIPAGENCYID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CUSTOMSER), u => u.CUSTOMSER.Contains(input.CUSTOMSER))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CUSTOMSERID), u => u.CUSTOMSERID == input.CUSTOMSERID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.TRUCKER), u => u.TRUCKER.Contains(input.TRUCKER))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.TRUCKERID), u => u.TRUCKERID == input.TRUCKERID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.AGENTNAME), u => u.AGENTNAME == input.AGENTNAME)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.WEITUO), u => u.WEITUO == input.WEITUO)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CONSIGNEEDOORADDR), u => u.CONSIGNEEDOORADDR == input.CONSIGNEEDOORADDR)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SHIPPERDOORADDR), u => u.SHIPPERDOORADDR == input.SHIPPERDOORADDR)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.AGENTNAME), u => u.AGENTNAME.Contains(input.AGENTNAME))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.AGENTID), u => u.AGENTID == input.AGENTID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.WEITUO), u => u.WEITUO.Contains(input.WEITUO))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.SCACCODE), u => u.SCACCODE == input.SCACCODE)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.ITNCODE), u => u.ITNCODE == input.ITNCODE)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PREPARDATID), u => u.PREPARDATID == input.PREPARDATID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PAYABLEATID), u => u.PAYABLEATID == input.PAYABLEATID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CUSTNO), u => u.CUSTNO == input.CUSTNO)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CUSTNO), u => u.CUSTNO.Contains(input.CUSTNO))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.TRANSPORTID), u => u.TRANSPORTID == input.TRANSPORTID)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.TRANSPORT), u => u.TRANSPORT == input.TRANSPORT)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.THIRDPAYADDR), u => u.THIRDPAYADDR == input.THIRDPAYADDR)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.TRANSPORT), u => u.TRANSPORT.Contains(input.TRANSPORT))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.YARDCONTRACTTEL), u => u.YARDCONTRACTTEL == input.YARDCONTRACTTEL)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.YARDCONTRACTEMAIL), u => u.YARDCONTRACTEMAIL == input.YARDCONTRACTEMAIL)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.LANECODE), u => u.LANECODE == input.LANECODE)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.LANENAME), u => u.LANENAME == input.LANENAME)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.FREIGHTPAYER), u => u.FREIGHTPAYER == input.FREIGHTPAYER)
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.LANENAME), u => u.LANENAME.Contains(input.LANENAME))
|
|
|
|
|
.WhereIF(!string.IsNullOrWhiteSpace(input.FREIGHTPAYER), u => u.FREIGHTPAYER.Contains(input.FREIGHTPAYER))
|
|
|
|
|
.ToPagedListAsync(input.PageNo, input.PageSize);
|
|
|
|
|
return entities.XnPagedResult();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 增加订舱主表
|
|
|
|
|
/// 增加订舱
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[SqlSugarUnitOfWork]
|
|
|
|
|
[HttpPost("/BookingOrder/add")]
|
|
|
|
|
public async Task Add(AddBookingOrderInput input)
|
|
|
|
|
{
|
|
|
|
|
JsonUtil.PropToUpper(input, "ORDNO", "BSSTATUS", "YardContract", "YardContractTel", "YardContractEmail");
|
|
|
|
|
JsonUtil.TrimFields(input);
|
|
|
|
|
var groupList = input.ctnInputs.Where(x => x.CTNNUM > 0).GroupBy(c => c.CTNALL).Select(g => $"{g.Key}*{g.Sum(gg => gg.CTNNUM)}");
|
|
|
|
|
input.CNTRTOTAL = string.Join(" / ", groupList);
|
|
|
|
|
var entity = input.Adapt<BookingOrder>();
|
|
|
|
|
entity.Create();
|
|
|
|
|
await _rep.InsertAsync(entity);
|
|
|
|
|
foreach (var item in input.ctnInputs)
|
|
|
|
|
{
|
|
|
|
|
var ctnentity=item.Adapt<BookingCtn>();
|
|
|
|
|
ctnentity.BILLID = entity.Id;
|
|
|
|
|
await _repCtn.InsertAsync(ctnentity);
|
|
|
|
|
foreach (var it in item.ctnDetailInputs)
|
|
|
|
|
{
|
|
|
|
|
var ctndetail=it.Adapt<BookingCtnDetail>();
|
|
|
|
|
ctndetail.CTNID = ctnentity.Id;
|
|
|
|
|
await _ctndetailrep.InsertAsync(ctndetail);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 删除订舱主表
|
|
|
|
|
/// 删除订舱
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[SqlSugarUnitOfWork]
|
|
|
|
|
[HttpPost("/BookingOrder/delete")]
|
|
|
|
|
public async Task Delete(DeleteBookingOrderInput input)
|
|
|
|
|
public async Task Delete(QueryeBookingOrderInput input)
|
|
|
|
|
{
|
|
|
|
|
var entity = await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
|
|
|
|
|
await _rep.DeleteAsync(entity);
|
|
|
|
|
|
|
|
|
|
await _rep.UpdateAsync(x=>x.Id==input.Id,x=> new BookingOrder { IsDeleted= true} );
|
|
|
|
|
var ctnlist=await _repCtn.AsQueryable().Where(x => x.BILLID == input.Id).Select(x => x.Id).ToListAsync();
|
|
|
|
|
|
|
|
|
|
await _repCtn.UpdateAsync(x => x.BILLID == input.Id, x => new BookingCtn { IsDeleted = true });
|
|
|
|
|
|
|
|
|
|
await _ctndetailrep.UpdateAsync(x=>ctnlist.Contains((long)x.CTNID),x=>new BookingCtnDetail { IsDeleted=true});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 更新订舱主表
|
|
|
|
|
/// 更新订舱
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[SqlSugarUnitOfWork]
|
|
|
|
|
[HttpPost("/BookingOrder/edit")]
|
|
|
|
|
public async Task Update(UpdateBookingOrderInput input)
|
|
|
|
|
{
|
|
|
|
|
var entity = input.Adapt<BookingOrder>();
|
|
|
|
|
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
|
var ctnlist = await _repCtn.AsQueryable().Where(x => x.BILLID == input.Id).Select(x => x.Id).ToListAsync();
|
|
|
|
|
|
|
|
|
|
await _repCtn.DeleteAsync(x => x.BILLID == input.Id);
|
|
|
|
|
|
|
|
|
|
await _ctndetailrep.DeleteAsync(x => ctnlist.Contains((long)x.CTNID));
|
|
|
|
|
foreach (var item in input.ctnInputs)
|
|
|
|
|
{
|
|
|
|
|
var ctnentity = item.Adapt<BookingCtn>();
|
|
|
|
|
ctnentity.BILLID = entity.Id;
|
|
|
|
|
await _repCtn.InsertAsync(ctnentity);
|
|
|
|
|
foreach (var it in item.ctnDetailInputs)
|
|
|
|
|
{
|
|
|
|
|
var ctndetail = it.Adapt<BookingCtnDetail>();
|
|
|
|
|
ctndetail.CTNID = ctnentity.Id;
|
|
|
|
|
await _ctndetailrep.InsertAsync(ctndetail);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -211,40 +261,20 @@ namespace Myshipping.Application
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("/BookingOrder/detail")]
|
|
|
|
|
public async Task<BookingOrder> Get([FromQuery] QueryeBookingOrderInput input)
|
|
|
|
|
public async Task<BookingOrderOutput> Get([FromQuery] QueryeBookingOrderInput input)
|
|
|
|
|
{
|
|
|
|
|
return await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
|
|
|
|
|
}
|
|
|
|
|
var main = await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
|
|
|
|
|
var list= main.Adapt<BookingOrderOutput>();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="input"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[AllowAnonymous, ApiUser]
|
|
|
|
|
[HttpGet("/BookingOrder/updata")]
|
|
|
|
|
public async Task<dynamic> Updata()
|
|
|
|
|
{
|
|
|
|
|
return Task.Run(() =>
|
|
|
|
|
{
|
|
|
|
|
return $"当前用户:{UserManager.Name} {UserManager.TENANT_ID} {UserManager.CLAINM_TENANT_NAME}";
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[AllowAnonymous, SqlSugarUnitOfWork]
|
|
|
|
|
[HttpGet("/BookingOrder/test")]
|
|
|
|
|
public async Task<dynamic> Test()
|
|
|
|
|
{
|
|
|
|
|
var bo = new BookingOrder();
|
|
|
|
|
await _rep.InsertAsync(bo);
|
|
|
|
|
Log.Information($"ins book id {bo.Id}");
|
|
|
|
|
var ctn = new BookingCtn();
|
|
|
|
|
ctn.BILLID = bo.Id;
|
|
|
|
|
await _repCtn.InsertAsync(ctn);
|
|
|
|
|
return await _rep.InsertAsync(new BookingOrder());
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|