|
|
@ -34,7 +34,7 @@ namespace djy.Service.Ams
|
|
|
|
public class AmsService : ServBase, IAmsService
|
|
|
|
public class AmsService : ServBase, IAmsService
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#region 查询列表
|
|
|
|
#region 查询列表
|
|
|
|
public TableData Load(AMSQuery req, User user, UserAuthorityDto aut)
|
|
|
|
public TableData Load(AMSQuery req, User user, UserAuthorityDto aut)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var result = new TableData();
|
|
|
|
var result = new TableData();
|
|
|
|
int count = 0;
|
|
|
|
int count = 0;
|
|
|
@ -62,12 +62,21 @@ namespace djy.Service.Ams
|
|
|
|
.WhereIf(hou != null, x => hou.Contains(x.GID))
|
|
|
|
.WhereIf(hou != null, x => hou.Contains(x.GID))
|
|
|
|
.WhereIf(req.BDate != null, x => x.CreateTime >= req.BDate)
|
|
|
|
.WhereIf(req.BDate != null, x => x.CreateTime >= req.BDate)
|
|
|
|
.WhereIf(req.EDate != null, x => x.CreateTime <= req.EDate).OrderByDescending(x => x.CreateTime);
|
|
|
|
.WhereIf(req.EDate != null, x => x.CreateTime <= req.EDate).OrderByDescending(x => x.CreateTime);
|
|
|
|
|
|
|
|
var SASCCODEList = DbBus.Get(DbList.djydb).Select<company_new_param_value>().Where(x => x.ParaCode == "AMSSASCCODE").ToList();
|
|
|
|
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 SASCCODE = SASCCODEList.Where(x => x.CompId == item.CompID).FirstOrDefault();
|
|
|
|
|
|
|
|
if (SASCCODE != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
item.SASCCODE = SASCCODE.ItemCode;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
item.SASCCODE = "NIAV";
|
|
|
|
|
|
|
|
}
|
|
|
|
var hodto = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => x.IsDel != true && x.PID == item.GID)
|
|
|
|
var hodto = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => x.IsDel != true && x.PID == item.GID)
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(req.Hid), x => x.GID == req.Hid)
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(req.Hid), x => x.GID == req.Hid)
|
|
|
|
.WhereIf(req.HBLNo != null, x => x.HBLNo.Contains(req.HBLNo.Trim()))
|
|
|
|
.WhereIf(req.HBLNo != null, x => x.HBLNo.Contains(req.HBLNo.Trim()))
|
|
|
@ -78,7 +87,6 @@ namespace djy.Service.Ams
|
|
|
|
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 != true && x.HID == it.GID).ToList();
|
|
|
|
var cnt = DbBus.Get(DbList.AMSCenter).Select<AMS_Cntrno>().Where(x => x.IsDel != true && x.HID == it.GID).ToList();
|
|
|
@ -89,8 +97,6 @@ namespace djy.Service.Ams
|
|
|
|
}
|
|
|
|
}
|
|
|
|
count += hodto.Count();
|
|
|
|
count += hodto.Count();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
result.data = list.Where(x => x.HouseDto != null && x.HouseDto.Count() > 0).ToList();
|
|
|
|
result.data = list.Where(x => x.HouseDto != null && x.HouseDto.Count() > 0).ToList();
|
|
|
|
if (req.ReportState == "0")
|
|
|
|
if (req.ReportState == "0")
|
|
|
@ -213,8 +219,8 @@ namespace djy.Service.Ams
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
if (DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => x.IsDel != true && x.PID == dto.GID).ToList().Where(x=>x.ReportState.Contains("未申报")).Count()>0)
|
|
|
|
if (DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => x.IsDel != true && x.PID == dto.GID).ToList().Where(x => x.ReportState.Contains("未申报")).Count() > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DbBus.Get(DbList.AMSCenter).Transaction(() =>
|
|
|
|
DbBus.Get(DbList.AMSCenter).Transaction(() =>
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -242,37 +248,37 @@ namespace djy.Service.Ams
|
|
|
|
DbBus.Get(DbList.AMSCenter).Delete<AMS_Cntrno>().Where(w => w.PID == master.GID).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Delete<AMS_Cntrno>().Where(w => w.PID == master.GID).ExecuteAffrows();
|
|
|
|
foreach (var item in dto.HouseDto)
|
|
|
|
foreach (var item in dto.HouseDto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var house = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(w => w.GID == item.GID).ToOne();
|
|
|
|
var house = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(w => w.GID == item.GID).ToOne();
|
|
|
|
house = item.MapTo<AMS_House>();
|
|
|
|
house = item.MapTo<AMS_House>();
|
|
|
|
house.GID = Guid.NewGuid().ToString("N");
|
|
|
|
house.GID = Guid.NewGuid().ToString("N");
|
|
|
|
house.PID = master.GID;
|
|
|
|
house.PID = master.GID;
|
|
|
|
house.IsDel = false;
|
|
|
|
house.IsDel = false;
|
|
|
|
house.State = "0";
|
|
|
|
house.State = "0";
|
|
|
|
house.ReportState = "未申报";
|
|
|
|
house.ReportState = "未申报";
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(house).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(house).ExecuteAffrows();
|
|
|
|
if (item.CntrnoDto != null && item.CntrnoDto.Count() > 0)
|
|
|
|
if (item.CntrnoDto != null && item.CntrnoDto.Count() > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var it in item.CntrnoDto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
foreach (var it in item.CntrnoDto)
|
|
|
|
AMS_Cntrno cntrno = it.MapTo<AMS_Cntrno>();
|
|
|
|
{
|
|
|
|
|
|
|
|
AMS_Cntrno cntrno = it.MapTo<AMS_Cntrno>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cntrno.GID = Guid.NewGuid().ToString("N");
|
|
|
|
cntrno.GID = Guid.NewGuid().ToString("N");
|
|
|
|
cntrno.PID = master.GID;
|
|
|
|
cntrno.PID = master.GID;
|
|
|
|
cntrno.HID = house.GID;
|
|
|
|
cntrno.HID = house.GID;
|
|
|
|
cntrno.IsDel = false;
|
|
|
|
cntrno.IsDel = false;
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(cntrno).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(cntrno).ExecuteAffrows();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
AMS_MasterHistory history = new AMS_MasterHistory();
|
|
|
|
}
|
|
|
|
history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
AMS_MasterHistory history = new AMS_MasterHistory();
|
|
|
|
history.AM_ID = house.GID;
|
|
|
|
history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
history.SendTime = DateTime.Now;
|
|
|
|
history.AM_ID = house.GID;
|
|
|
|
history.State = "新增";
|
|
|
|
history.SendTime = DateTime.Now;
|
|
|
|
history.Type = "0";
|
|
|
|
history.State = "新增";
|
|
|
|
history.Operator = user.SHOWNAME;
|
|
|
|
history.Type = "0";
|
|
|
|
history.Remark = user.SHOWNAME + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "创建了单据";
|
|
|
|
history.Operator = user.SHOWNAME;
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
history.Remark = user.SHOWNAME + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "创建了单据";
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
guid = master.GID;
|
|
|
|
guid = master.GID;
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -281,68 +287,68 @@ namespace djy.Service.Ams
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DbBus.Get(DbList.AMSCenter).Transaction(() =>
|
|
|
|
DbBus.Get(DbList.AMSCenter).Transaction(() =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var master = DbBus.Get(DbList.AMSCenter).Select<AMS_Master>().Where(w => w.GID == dto.GID).ToOne();
|
|
|
|
var master = DbBus.Get(DbList.AMSCenter).Select<AMS_Master>().Where(w => w.GID == dto.GID).ToOne();
|
|
|
|
master.CARRIERID = dto.CARRIERID;
|
|
|
|
master.CARRIERID = dto.CARRIERID;
|
|
|
|
master.MBLNO = dto.MBLNO;
|
|
|
|
master.MBLNO = dto.MBLNO;
|
|
|
|
master.VESSEL = dto.VESSEL;
|
|
|
|
master.VESSEL = dto.VESSEL;
|
|
|
|
master.VOYNO = dto.VOYNO;
|
|
|
|
master.VOYNO = dto.VOYNO;
|
|
|
|
master.ShippingType = dto.ShippingType;
|
|
|
|
master.ShippingType = dto.ShippingType;
|
|
|
|
master.SHIPPERADDR = dto.SHIPPERADDR;
|
|
|
|
master.SHIPPERADDR = dto.SHIPPERADDR;
|
|
|
|
master.ETA = dto.ETA;
|
|
|
|
master.ETA = dto.ETA;
|
|
|
|
master.ETD = dto.ETD;
|
|
|
|
master.ETD = dto.ETD;
|
|
|
|
master.LastUpdate = DateTime.Now;
|
|
|
|
master.LastUpdate = DateTime.Now;
|
|
|
|
master.ShippingNo = dto.ShippingNo;
|
|
|
|
master.ShippingNo = dto.ShippingNo;
|
|
|
|
master.ConsignmentType = dto.ConsignmentType;
|
|
|
|
master.ConsignmentType = dto.ConsignmentType;
|
|
|
|
master.LoadingPortCode = dto.LoadingPortCode;
|
|
|
|
master.LoadingPortCode = dto.LoadingPortCode;
|
|
|
|
master.PORTDISCHARGECode = dto.PORTDISCHARGECode;
|
|
|
|
master.PORTDISCHARGECode = dto.PORTDISCHARGECode;
|
|
|
|
master.LastNoUsPortCode = dto.LastNoUsPortCode;
|
|
|
|
master.LastNoUsPortCode = dto.LastNoUsPortCode;
|
|
|
|
master.PORTDISCHARGE = DbBus.Get(DbList.Common).Select<CodePort>().Where(x => x.Code == master.PORTDISCHARGECode).ToList().Select(x => x.EnName).FirstOrDefault();
|
|
|
|
master.PORTDISCHARGE = DbBus.Get(DbList.Common).Select<CodePort>().Where(x => x.Code == master.PORTDISCHARGECode).ToList().Select(x => x.EnName).FirstOrDefault();
|
|
|
|
master.CARRIER = DbBus.Get(DbList.Common).Select<CodeCarrier>().Where(x => x.Code == master.CARRIERID).ToList().Select(x => x.EnName).FirstOrDefault();
|
|
|
|
master.CARRIER = DbBus.Get(DbList.Common).Select<CodeCarrier>().Where(x => x.Code == master.CARRIERID).ToList().Select(x => x.EnName).FirstOrDefault();
|
|
|
|
master.LoadingPort = DbBus.Get(DbList.Common).Select<CodePortLoad>().Where(x => x.EdiCode == master.LoadingPortCode).ToList().Select(x => x.EnName).FirstOrDefault();
|
|
|
|
master.LoadingPort = DbBus.Get(DbList.Common).Select<CodePortLoad>().Where(x => x.EdiCode == master.LoadingPortCode).ToList().Select(x => x.EnName).FirstOrDefault();
|
|
|
|
master.LastNoUsPort = DbBus.Get(DbList.Common).Select<CodePort>().Where(x => x.Code == master.LastNoUsPortCode).ToList().Select(x => x.EnName).FirstOrDefault();
|
|
|
|
master.LastNoUsPort = DbBus.Get(DbList.Common).Select<CodePort>().Where(x => x.Code == master.LastNoUsPortCode).ToList().Select(x => x.EnName).FirstOrDefault();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().SetSource(master).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().SetSource(master).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Delete<AMS_Cntrno>().Where(w => w.PID == master.GID).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Delete<AMS_Cntrno>().Where(w => w.PID == master.GID).ExecuteAffrows();
|
|
|
|
List<string> houseid = dto.HouseDto.Select(x => x.GID).ToList();
|
|
|
|
List<string> houseid = dto.HouseDto.Select(x => x.GID).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in dto.HouseDto)
|
|
|
|
foreach (var item in dto.HouseDto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var house = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(w => w.GID == item.GID).ToOne();
|
|
|
|
var house = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(w => w.GID == item.GID).ToOne();
|
|
|
|
if (house != null)
|
|
|
|
if (house != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
house.HBLNo = item.HBLNo;
|
|
|
|
house.HBLNo = item.HBLNo;
|
|
|
|
house.SHIPPERNAME = item.SHIPPERNAME;
|
|
|
|
house.SHIPPERNAME = item.SHIPPERNAME;
|
|
|
|
house.SHIPPERADDR = item.SHIPPERADDR;
|
|
|
|
house.SHIPPERADDR = item.SHIPPERADDR;
|
|
|
|
house.SHIPPERTEL = item.SHIPPERTEL;
|
|
|
|
house.SHIPPERTEL = item.SHIPPERTEL;
|
|
|
|
house.CONSIGNEEName = item.CONSIGNEEName;
|
|
|
|
house.CONSIGNEEName = item.CONSIGNEEName;
|
|
|
|
house.CONSIGNEEDADDR = item.CONSIGNEEDADDR;
|
|
|
|
house.CONSIGNEEDADDR = item.CONSIGNEEDADDR;
|
|
|
|
house.CONSIGNEETEL = item.CONSIGNEETEL;
|
|
|
|
house.CONSIGNEETEL = item.CONSIGNEETEL;
|
|
|
|
house.NOTIFYPARTYNAME = item.NOTIFYPARTYNAME;
|
|
|
|
house.NOTIFYPARTYNAME = item.NOTIFYPARTYNAME;
|
|
|
|
house.NOTIFYPARTYADDR = item.NOTIFYPARTYADDR;
|
|
|
|
house.NOTIFYPARTYADDR = item.NOTIFYPARTYADDR;
|
|
|
|
house.NOTIFYPARTYTEL = item.NOTIFYPARTYTEL;
|
|
|
|
house.NOTIFYPARTYTEL = item.NOTIFYPARTYTEL;
|
|
|
|
house.SHIPPERCountry = item.SHIPPERCountry;
|
|
|
|
house.SHIPPERCountry = item.SHIPPERCountry;
|
|
|
|
house.SHIPPERCountryCode = item.SHIPPERCountryCode;
|
|
|
|
house.SHIPPERCountryCode = item.SHIPPERCountryCode;
|
|
|
|
house.SHIPPERCity = item.SHIPPERCity;
|
|
|
|
house.SHIPPERCity = item.SHIPPERCity;
|
|
|
|
house.CONSIGNEECountry = item.CONSIGNEECountry;
|
|
|
|
house.CONSIGNEECountry = item.CONSIGNEECountry;
|
|
|
|
house.CONSIGNEECountryCode = item.CONSIGNEECountryCode;
|
|
|
|
house.CONSIGNEECountryCode = item.CONSIGNEECountryCode;
|
|
|
|
house.CONSIGNEECity = item.CONSIGNEECity;
|
|
|
|
house.CONSIGNEECity = item.CONSIGNEECity;
|
|
|
|
house.NOTIFYPARTYCountry = item.NOTIFYPARTYCountry;
|
|
|
|
house.NOTIFYPARTYCountry = item.NOTIFYPARTYCountry;
|
|
|
|
house.NOTIFYPARTYCountryCode = item.NOTIFYPARTYCountryCode;
|
|
|
|
house.NOTIFYPARTYCountryCode = item.NOTIFYPARTYCountryCode;
|
|
|
|
house.NOTIFYPARTYCity = item.NOTIFYPARTYCity;
|
|
|
|
house.NOTIFYPARTYCity = item.NOTIFYPARTYCity;
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().SetSource(house).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().SetSource(house).ExecuteAffrows();
|
|
|
|
if (item.CntrnoDto != null && item.CntrnoDto.Count() > 0)
|
|
|
|
if (item.CntrnoDto != null && item.CntrnoDto.Count() > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
foreach (var it in item.CntrnoDto)
|
|
|
|
foreach (var it in item.CntrnoDto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var cntrno = new AMS_Cntrno();
|
|
|
|
var cntrno = new AMS_Cntrno();
|
|
|
|
cntrno = it.MapTo<AMS_Cntrno>();
|
|
|
|
cntrno = it.MapTo<AMS_Cntrno>();
|
|
|
|
cntrno.GID = Guid.NewGuid().ToString("N");
|
|
|
|
cntrno.GID = Guid.NewGuid().ToString("N");
|
|
|
|
cntrno.PID = master.GID;
|
|
|
|
cntrno.PID = master.GID;
|
|
|
|
cntrno.HID = house.GID;
|
|
|
|
cntrno.HID = house.GID;
|
|
|
|
cntrno.IsDel = false;
|
|
|
|
cntrno.IsDel = false;
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(cntrno).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(cntrno).ExecuteAffrows();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//AMS_MasterHistory history = new AMS_MasterHistory();
|
|
|
|
//AMS_MasterHistory history = new AMS_MasterHistory();
|
|
|
|
//history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
//history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
//history.AM_ID = item.GID;
|
|
|
|
//history.AM_ID = item.GID;
|
|
|
@ -390,8 +396,8 @@ namespace djy.Service.Ams
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
guid = master.GID;
|
|
|
|
guid = master.GID;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return guid;
|
|
|
|
return guid;
|
|
|
@ -423,6 +429,7 @@ namespace djy.Service.Ams
|
|
|
|
var url = DbBus.Get(DbList.djydb).Select<ParamSet>().Where(x => x.PARAMNAME == "AMSURL").ToOne();
|
|
|
|
var url = DbBus.Get(DbList.djydb).Select<ParamSet>().Where(x => x.PARAMNAME == "AMSURL").ToOne();
|
|
|
|
var method = DbBus.Get(DbList.djydb).Select<ParamSet>().Where(x => x.PARAMNAME == "AMSMethod").ToOne();
|
|
|
|
var method = DbBus.Get(DbList.djydb).Select<ParamSet>().Where(x => x.PARAMNAME == "AMSMethod").ToOne();
|
|
|
|
var timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
var timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
var AMSRequestDEA = DbBus.Get(DbList.djydb).Select<company_new_param_value>().Where(x => x.CompId == user.CompId && x.ParaCode == "AMSRequestDEA").First();
|
|
|
|
foreach (string oid in id)
|
|
|
|
foreach (string oid in id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (oid != "")
|
|
|
|
if (oid != "")
|
|
|
@ -457,8 +464,15 @@ namespace djy.Service.Ams
|
|
|
|
{
|
|
|
|
{
|
|
|
|
masterBillInfo.voyage = master.VOYNO;
|
|
|
|
masterBillInfo.voyage = master.VOYNO;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (AMSRequestDEA != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
masterBillInfo.requesterDea = AMSRequestDEA.ItemCode;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
masterBillInfo.requesterDea = sysOptionConfig.Webconfig.requesterDea;
|
|
|
|
|
|
|
|
|
|
|
|
masterBillInfo.requesterDea = sysOptionConfig.Webconfig.requesterDea;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
masterBillInfo.consignmentType = master.ConsignmentType;
|
|
|
|
masterBillInfo.consignmentType = master.ConsignmentType;
|
|
|
|
masterBillInfo.loadHarbour = master.LoadingPort;
|
|
|
|
masterBillInfo.loadHarbour = master.LoadingPort;
|
|
|
|
masterBillInfo.loadHarbourCode = master.LoadingPortCode;
|
|
|
|
masterBillInfo.loadHarbourCode = master.LoadingPortCode;
|
|
|
@ -597,7 +611,15 @@ namespace djy.Service.Ams
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
masterBillInfo.requesterDea = sysOptionConfig.Webconfig.requesterDea;
|
|
|
|
if (AMSRequestDEA != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
masterBillInfo.requesterDea = AMSRequestDEA.ItemCode;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
masterBillInfo.requesterDea = sysOptionConfig.Webconfig.requesterDea;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
masterBillInfo.consignmentType = master.ConsignmentType;
|
|
|
|
masterBillInfo.consignmentType = master.ConsignmentType;
|
|
|
|
masterBillInfo.loadHarbour = master.LoadingPort;
|
|
|
|
masterBillInfo.loadHarbour = master.LoadingPort;
|
|
|
|
masterBillInfo.loadHarbourCode = master.LoadingPortCode;
|
|
|
|
masterBillInfo.loadHarbourCode = master.LoadingPortCode;
|
|
|
@ -618,7 +640,7 @@ namespace djy.Service.Ams
|
|
|
|
req.Message = "当前状态不能重发!如有疑问,请联系相关客服!";
|
|
|
|
req.Message = "当前状态不能重发!如有疑问,请联系相关客服!";
|
|
|
|
return req;
|
|
|
|
return req;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (docType == "AMSDOC"&&(item.NewNotice== "新增发送成功"))
|
|
|
|
if (docType == "AMSDOC" && (item.NewNotice == "新增发送成功"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
req.Code = 201;
|
|
|
|
req.Code = 201;
|
|
|
|
req.Message = "当前单据已经发送,不能再次发送!如有疑问,请联系相关客服!";
|
|
|
|
req.Message = "当前单据已经发送,不能再次发送!如有疑问,请联系相关客服!";
|
|
|
@ -874,7 +896,7 @@ namespace djy.Service.Ams
|
|
|
|
history.Remark = user.SHOWNAME + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "发送单据失败,失败原因:" + msg + errorInfo;
|
|
|
|
history.Remark = user.SHOWNAME + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "发送单据失败,失败原因:" + msg + errorInfo;
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
req.Code = 201;
|
|
|
|
req.Code = 201;
|
|
|
|
req.Message = "操作失败," + msg + errorInfo;
|
|
|
|
req.Message = "操作失败," + msg + errorInfo;
|
|
|
|
return req;
|
|
|
|
return req;
|
|
|
@ -889,22 +911,22 @@ namespace djy.Service.Ams
|
|
|
|
if (docType == "AMSDOC")
|
|
|
|
if (docType == "AMSDOC")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
history.State = "新增发送成功";
|
|
|
|
history.State = "新增发送成功";
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (docType == "AMSAR")
|
|
|
|
else if (docType == "AMSAR")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
history.State = "重发成功";
|
|
|
|
history.State = "重发成功";
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (docType == "AMSM")
|
|
|
|
else if (docType == "AMSM")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
history.State = "修改发送成功";
|
|
|
|
history.State = "修改发送成功";
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
history.State = "删除发送成功";
|
|
|
|
history.State = "删除发送成功";
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
history.Operator = user.SHOWNAME;
|
|
|
|
history.Operator = user.SHOWNAME;
|
|
|
|
history.Remark = user.SHOWNAME + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "发送了单据";
|
|
|
|
history.Remark = user.SHOWNAME + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "发送了单据";
|
|
|
@ -1066,7 +1088,7 @@ namespace djy.Service.Ams
|
|
|
|
if (house.MateState.Contains("3Z"))
|
|
|
|
if (house.MateState.Contains("3Z"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = "3Z," + retdto.status, NewNotice = "海关接收成功"}).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = "3Z," + retdto.status, NewNotice = "海关接收成功" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -1103,7 +1125,7 @@ namespace djy.Service.Ams
|
|
|
|
if (house.NewNotice == "删除发送成功")
|
|
|
|
if (house.NewNotice == "删除发送成功")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = retdto.status, NewNotice = "船司匹配成功"}).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = retdto.status, NewNotice = "船司匹配成功" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (house.NewNotice == "修改发送成功")
|
|
|
|
else if (house.NewNotice == "修改发送成功")
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1115,7 +1137,7 @@ namespace djy.Service.Ams
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = house.MateState + "," + retdto.status, NewNotice = "船司匹配成功"}).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = house.MateState + "," + retdto.status, NewNotice = "船司匹配成功" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1206,7 +1228,7 @@ namespace djy.Service.Ams
|
|
|
|
if (house.NewNotice == "删除发送成功")
|
|
|
|
if (house.NewNotice == "删除发送成功")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = retdto.status, NewNotice = "箱货信息不匹配"}).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = retdto.status, NewNotice = "箱货信息不匹配" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if (house.NewNotice == "修改发送成功")
|
|
|
|
if (house.NewNotice == "修改发送成功")
|
|
|
@ -1227,42 +1249,42 @@ namespace djy.Service.Ams
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
//else
|
|
|
|
{
|
|
|
|
//{
|
|
|
|
AMS_MasterHistory history = new AMS_MasterHistory();
|
|
|
|
// AMS_MasterHistory history = new AMS_MasterHistory();
|
|
|
|
history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
// history.GID = Guid.NewGuid().ToString("N");
|
|
|
|
history.AM_ID = retdto.businessId;
|
|
|
|
// history.AM_ID = retdto.businessId;
|
|
|
|
history.SendTime = DateTime.Now;
|
|
|
|
// history.SendTime = DateTime.Now;
|
|
|
|
history.State = "匹配失败";
|
|
|
|
// history.State = "匹配失败";
|
|
|
|
history.Type = "1";
|
|
|
|
// history.Type = "1";
|
|
|
|
history.Operator = "系统管理员";
|
|
|
|
// history.Operator = "系统管理员";
|
|
|
|
history.Remark = "您的单据" + house.HBLNo + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "匹配失败";
|
|
|
|
// history.Remark = "您的单据" + house.HBLNo + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "匹配失败";
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
// DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
|
|
|
|
|
|
|
|
if (house.NewNotice == "删除发送成功")
|
|
|
|
// if (house.NewNotice == "删除发送成功")
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = retdto.status, NewNotice = "匹配失败" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
// DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = retdto.status, NewNotice = "匹配失败" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
else
|
|
|
|
// else
|
|
|
|
if (house.NewNotice == "修改发送成功")
|
|
|
|
// if (house.NewNotice == "修改发送成功")
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = retdto.status, NewNotice = "匹配失败" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
// DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = retdto.status, NewNotice = "匹配失败" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
else
|
|
|
|
// else
|
|
|
|
if (house.NewNotice == "重发发送成功" || house.NewNotice == "新增发送成功")
|
|
|
|
// if (house.NewNotice == "重发发送成功" || house.NewNotice == "新增发送成功")
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = retdto.status, NewNotice = "匹配失败" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
// DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = retdto.status, NewNotice = "匹配失败" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
else
|
|
|
|
// else
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = retdto.status, NewNotice = "匹配失败" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
// DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = retdto.status, NewNotice = "匹配失败" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -1313,8 +1335,9 @@ namespace djy.Service.Ams
|
|
|
|
}).Distinct().ToList();
|
|
|
|
}).Distinct().ToList();
|
|
|
|
return List;
|
|
|
|
return List;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else
|
|
|
|
var List = DbBus.Get(DbList.Common).Select<CodeCountry>().WhereIf(strlink != "", x => x.Code.Contains(strlink.Trim()) || x.EnName.Contains(strlink.Trim())|| x.CnName.Contains(strlink.Trim()) ).Page(page, limit).ToList().Select(x => new CommonCNEN
|
|
|
|
{
|
|
|
|
|
|
|
|
var List = DbBus.Get(DbList.Common).Select<CodeCountry>().WhereIf(strlink != "", x => x.Code.Contains(strlink.Trim()) || x.EnName.Contains(strlink.Trim()) || x.CnName.Contains(strlink.Trim())).Page(page, limit).ToList().Select(x => new CommonCNEN
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Code = x.Code,
|
|
|
|
Code = x.Code,
|
|
|
|
ENName = x.EnName,
|
|
|
|
ENName = x.EnName,
|
|
|
@ -1416,7 +1439,8 @@ namespace djy.Service.Ams
|
|
|
|
}).Distinct().ToList();
|
|
|
|
}).Distinct().ToList();
|
|
|
|
return List;
|
|
|
|
return List;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
var List = DbBus.Get(DbList.Common).Select<CodePort>().WhereIf(strlink != "", x => x.Code.Contains(strlink.Trim()) || x.EnName.Contains(strlink.Trim())).Page(page, limit).ToList().Select(x => new CommonCodeValue
|
|
|
|
var List = DbBus.Get(DbList.Common).Select<CodePort>().WhereIf(strlink != "", x => x.Code.Contains(strlink.Trim()) || x.EnName.Contains(strlink.Trim())).Page(page, limit).ToList().Select(x => new CommonCodeValue
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1452,7 +1476,7 @@ namespace djy.Service.Ams
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<CommonCodeValue> GetVessel(string strlink,int page,int limit)
|
|
|
|
public List<CommonCodeValue> GetVessel(string strlink, int page, int limit)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1465,8 +1489,9 @@ namespace djy.Service.Ams
|
|
|
|
}).Distinct().ToList();
|
|
|
|
}).Distinct().ToList();
|
|
|
|
return List;
|
|
|
|
return List;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else
|
|
|
|
var List = DbBus.Get(DbList.Common).Select<CodeVessel>().WhereIf(strlink != "", x => x.Name.Contains(strlink.Trim())).Page(page,limit).ToList().Select(x => new CommonCodeValue
|
|
|
|
{
|
|
|
|
|
|
|
|
var List = DbBus.Get(DbList.Common).Select<CodeVessel>().WhereIf(strlink != "", x => x.Name.Contains(strlink.Trim())).Page(page, limit).ToList().Select(x => new CommonCodeValue
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Code = x.Name,
|
|
|
|
Code = x.Name,
|
|
|
|
Value = x.Name,
|
|
|
|
Value = x.Name,
|
|
|
@ -1733,6 +1758,21 @@ namespace djy.Service.Ams
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public async Task<company_new_param_value> GetSASCCODE(User user)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var List = await DbBus.Get(DbList.djydb).Select<company_new_param_value>().Where(x => x.CompId == user.CompId && x.ParaCode == "AMSSASCCODE").FirstAsync();
|
|
|
|
|
|
|
|
return List;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|