|
|
@ -16,6 +16,8 @@ using Common.DJYModel;
|
|
|
|
using System.Transactions;
|
|
|
|
using System.Transactions;
|
|
|
|
using Dapper.Contrib.Extensions;
|
|
|
|
using Dapper.Contrib.Extensions;
|
|
|
|
using Common.Utilities;
|
|
|
|
using Common.Utilities;
|
|
|
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
|
|
|
|
namespace djy.Service.Ams
|
|
|
|
namespace djy.Service.Ams
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -27,18 +29,19 @@ namespace djy.Service.Ams
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var result = new TableData();
|
|
|
|
var result = new TableData();
|
|
|
|
var user = DbBus.Get(DbList.djydb).Select<User>().Where(w => w.GID == userid).ToOne();
|
|
|
|
var user = DbBus.Get(DbList.djydb).Select<User>().Where(w => w.GID == userid).ToOne();
|
|
|
|
var dto = DbBus.Get(DbList.AMSCenter).Select<AMS_Master>().Where(x => x.IsDel == false || x.IsDel == null&&x.CompID==user.CompId).WhereIf(req.MBLNO != null, x => x.MBLNO == req.MBLNO);
|
|
|
|
var dto = DbBus.Get(DbList.AMSCenter).Select<AMS_Master>().Where(x => (x.IsDel == false || x.IsDel == null)&&x.CompID==user.CompId).WhereIf(req.MBLNO != null, x => x.MBLNO == req.MBLNO);
|
|
|
|
result.count = dto.ToList().Count();
|
|
|
|
result.count = dto.ToList().Count();
|
|
|
|
var list= dto.Page(req.Page,req.Limit).ToList<AMSDto>();
|
|
|
|
var list= dto.Page(req.Page,req.Limit).ToList<AMSDto>();
|
|
|
|
if (list != null) {
|
|
|
|
if (list != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
foreach (var item in list)
|
|
|
|
foreach (var item in list)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var hodto = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => x.IsDel == false || x.IsDel == null && x.PID == item.GID).ToList<AMS_HouseDto>();
|
|
|
|
var hodto = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x =>( x.IsDel == false || x.IsDel == null) && x.PID == item.GID).ToList<AMS_HouseDto>();
|
|
|
|
item.HouseDto = hodto;
|
|
|
|
item.HouseDto = hodto;
|
|
|
|
if (hodto!=null) {
|
|
|
|
if (hodto!=null) {
|
|
|
|
foreach (var it in hodto)
|
|
|
|
foreach (var it in hodto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var cnt = DbBus.Get(DbList.AMSCenter).Select<AMS_Cntrno>().Where(x => x.IsDel == false || x.IsDel == null && x.HID == it.GID).ToList();
|
|
|
|
var cnt = DbBus.Get(DbList.AMSCenter).Select<AMS_Cntrno>().Where(x => (x.IsDel == false || x.IsDel == null )&& x.HID == it.GID).ToList();
|
|
|
|
it.CntrnoDto = cnt;
|
|
|
|
it.CntrnoDto = cnt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -141,7 +144,6 @@ namespace djy.Service.Ams
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public List<CommonCodeValue> GetCountry()
|
|
|
|
public List<CommonCodeValue> GetCountry()
|
|
|
@ -209,5 +211,98 @@ namespace djy.Service.Ams
|
|
|
|
throw;
|
|
|
|
throw;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Response SendDE(string Gid,string userid)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var result = new Response();
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
if (Gid.IsNull()) {
|
|
|
|
|
|
|
|
result.Code = 500;
|
|
|
|
|
|
|
|
result.Message = "请传入相关业务id!";
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
string[] id = Gid.Split(',');
|
|
|
|
|
|
|
|
foreach (string oid in id)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (oid != "")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
MasterBillInfoDto dto = new MasterBillInfoDto();
|
|
|
|
|
|
|
|
masterBillInfo masterBillInfo = new masterBillInfo();
|
|
|
|
|
|
|
|
var user = DbBus.Get(DbList.djydb).Select<User>().Where(w => w.GID == userid).ToOne();
|
|
|
|
|
|
|
|
var master = DbBus.Get(DbList.AMSCenter).Select<AMS_Master>().Where(x => (x.IsDel == false || x.IsDel == null) && x.CompID == user.CompId&&x.GID==oid).ToOne();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
masterBillInfo.masterBillNo = master.MBLNO;
|
|
|
|
|
|
|
|
masterBillInfo.shipCompany = master.CARRIERID;
|
|
|
|
|
|
|
|
masterBillInfo.vessel = master.VESSEL;
|
|
|
|
|
|
|
|
masterBillInfo.voyage = master.VOYNO;
|
|
|
|
|
|
|
|
masterBillInfo.requesterDea = sysOptionConfig.Webconfig.requesterDea;
|
|
|
|
|
|
|
|
masterBillInfo.consignmentType = master.ConsignmentType;
|
|
|
|
|
|
|
|
masterBillInfo.loadHarbour = master.LoadingPort;
|
|
|
|
|
|
|
|
masterBillInfo.loadHarbourCode = master.LoadingPortCode;
|
|
|
|
|
|
|
|
masterBillInfo.dischargeHarbour = master.PORTDISCHARGE;
|
|
|
|
|
|
|
|
masterBillInfo.dischargeHarbourCode = master.PORTDISCHARGECode;
|
|
|
|
|
|
|
|
masterBillInfo.lastForeignHarbour = master.LastNoUsPort;
|
|
|
|
|
|
|
|
masterBillInfo.lastForeignHarbourCode = master.LastNoUsPortCode;
|
|
|
|
|
|
|
|
masterBillInfo.loadDate = master.ETA.ToString("yyyy-MM-dd hh:mm:ss");
|
|
|
|
|
|
|
|
masterBillInfo.estimatedArrivalTime = master.ETD.ToString("yyyy-MM-dd hh:mm:ss");
|
|
|
|
|
|
|
|
masterBillInfo.filingType = master.ShippingType;
|
|
|
|
|
|
|
|
dto.masterBillInfo = masterBillInfo;
|
|
|
|
|
|
|
|
var hodto = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => (x.IsDel == false || x.IsDel == null) && x.PID == master.GID).ToList<AMS_HouseDto>();
|
|
|
|
|
|
|
|
List<HouseBillInfoListItem> houseBillInfoListItems = new List<HouseBillInfoListItem>();
|
|
|
|
|
|
|
|
foreach (var item in hodto)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
HouseBillInfoListItem houseinfo = new HouseBillInfoListItem();
|
|
|
|
|
|
|
|
houseinfo.businessId = item.GID;
|
|
|
|
|
|
|
|
houseinfo.houseBillNo = item.HBLNo;
|
|
|
|
|
|
|
|
houseinfo.sendAddress = item.SHIPPERADDR;
|
|
|
|
|
|
|
|
houseinfo.sendName = item.SHIPPERNAME;
|
|
|
|
|
|
|
|
houseinfo.sendCity = item.SHIPPERCity;
|
|
|
|
|
|
|
|
houseinfo.sendCountry = item.SHIPPERCountry;
|
|
|
|
|
|
|
|
houseinfo.sendCountryCode = item.SHIPPERCountryCode;
|
|
|
|
|
|
|
|
houseinfo.receiveAddress = item.CONSIGNEEDADDR;
|
|
|
|
|
|
|
|
houseinfo.receiveName = item.CONSIGNEEName;
|
|
|
|
|
|
|
|
houseinfo.receiveCity = item.CONSIGNEECity;
|
|
|
|
|
|
|
|
houseinfo.receiveCountry = item.CONSIGNEECountry;
|
|
|
|
|
|
|
|
houseinfo.receiveCountryCode = item.CONSIGNEECountryCode;
|
|
|
|
|
|
|
|
houseinfo.notifyAddress = item.NOTIFYPARTYADDR;
|
|
|
|
|
|
|
|
houseinfo.notifyName = item.NOTIFYPARTYNAME;
|
|
|
|
|
|
|
|
houseinfo.notifyCity = item.NOTIFYPARTYCity;
|
|
|
|
|
|
|
|
houseinfo.notifyCountry = item.NOTIFYPARTYCountry;
|
|
|
|
|
|
|
|
houseinfo.notifyCountryCode = item.NOTIFYPARTYCountryCode;
|
|
|
|
|
|
|
|
var cnt = DbBus.Get(DbList.AMSCenter).Select<AMS_Cntrno>().Where(x => (x.IsDel == false || x.IsDel == null) && x.HID == item.GID).ToList();
|
|
|
|
|
|
|
|
CtnInfo CtnInfo = new CtnInfo();
|
|
|
|
|
|
|
|
List<InsertListItem> list = new List<InsertListItem>();
|
|
|
|
|
|
|
|
foreach (var it in cnt)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
InsertListItem insertList = new InsertListItem();
|
|
|
|
|
|
|
|
insertList.enProductName = it.ProductName;
|
|
|
|
|
|
|
|
insertList.containerNo = it.CNTRNO;
|
|
|
|
|
|
|
|
insertList.sealNo = it.SEALNO;
|
|
|
|
|
|
|
|
insertList.digit = it.PKGS.ToString();
|
|
|
|
|
|
|
|
insertList.grossWeight = it.KGS.ToString();
|
|
|
|
|
|
|
|
insertList.volume = it.CBM.ToString();
|
|
|
|
|
|
|
|
insertList.packing = it.KINDPKGS;
|
|
|
|
|
|
|
|
insertList.packingCode = it.KINDPKGSCode;
|
|
|
|
|
|
|
|
insertList.shippingMark = it.MARKS;
|
|
|
|
|
|
|
|
insertList.unCode = it.DUNNO;
|
|
|
|
|
|
|
|
insertList.dangerGrade = it.DangerGrade;
|
|
|
|
|
|
|
|
list.Add(insertList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
CtnInfo.insertList = list;
|
|
|
|
|
|
|
|
houseinfo.ctnInfo = CtnInfo;
|
|
|
|
|
|
|
|
houseBillInfoListItems.Add(houseinfo);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
dto.houseBillInfoList = houseBillInfoListItems;
|
|
|
|
|
|
|
|
var data = JsonConvert.SerializeObject(dto).ToBase64();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception e) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.Code = 500;
|
|
|
|
|
|
|
|
result.Message = e.InnerException?.Message ?? e.Message;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|