|
|
|
@ -313,6 +313,22 @@ namespace djy.Service.Ams
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<CommonCodeValue> GetCodePortLoad()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var List = DbBus.Get(DbList.Common).Select<CodePortLoad>().ToList().Select(x => new CommonCodeValue
|
|
|
|
|
{
|
|
|
|
|
Code = x.EdiCode,
|
|
|
|
|
Value = x.EnName,
|
|
|
|
|
}).Distinct().ToList();
|
|
|
|
|
return List;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
throw;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<CommonCodeValue> GetVessel(string strlink)
|
|
|
|
@ -393,6 +409,7 @@ namespace djy.Service.Ams
|
|
|
|
|
|
|
|
|
|
var cARRIERIDList = DbBus.Get(DbList.Common).Select<MappingCarrier>().Where(map => map.Module == "AMS").ToList();
|
|
|
|
|
var portList = DbBus.Get(DbList.Common).Select<CodePort>().ToList();
|
|
|
|
|
var CodePortLoadList = DbBus.Get(DbList.Common).Select<CodePortLoad>().ToList();
|
|
|
|
|
var containerTypeList = DbBus.Get(DbList.Common).Select<MappingCtn>().Where(map => map.Module == "AMS").ToList();
|
|
|
|
|
var packageList = DbBus.Get(DbList.Common).Select<MappingPackage>().Where(map => map.Module == "AMS").ToList();
|
|
|
|
|
MasterBillInfoDto dto = new MasterBillInfoDto();
|
|
|
|
@ -406,7 +423,7 @@ namespace djy.Service.Ams
|
|
|
|
|
masterBillInfo.requesterDea = sysOptionConfig.Webconfig.requesterDea;
|
|
|
|
|
masterBillInfo.consignmentType = master.ConsignmentType;
|
|
|
|
|
masterBillInfo.loadHarbour = master.LoadingPort;
|
|
|
|
|
masterBillInfo.loadHarbourCode = portList.Where(x => x.Code == master.LoadingPortCode).Select(x => x.EdiCode).FirstOrDefault();
|
|
|
|
|
masterBillInfo.loadHarbourCode = master.LoadingPortCode;
|
|
|
|
|
masterBillInfo.dischargeHarbour = master.PORTDISCHARGE;
|
|
|
|
|
masterBillInfo.dischargeHarbourCode = portList.Where(x => x.Code == master.PORTDISCHARGECode).Select(x => x.EdiCode).FirstOrDefault();
|
|
|
|
|
masterBillInfo.lastForeignHarbour = master.LastNoUsPort;
|
|
|
|
@ -632,9 +649,7 @@ namespace djy.Service.Ams
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { ReportState = "已删除", NewNotice = "删除发送成功" }).Where(w => w.GID == oid).ExecuteAffrows();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
@ -660,17 +675,45 @@ namespace djy.Service.Ams
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Response SaveReceipt(AMSReturnDto retdto,string Key)
|
|
|
|
|
public Response SaveReceipt(string msg)
|
|
|
|
|
{
|
|
|
|
|
Response req = new Response();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
AMSReturnDto retdto = Json.JsonToObject<AMSReturnDto>(msg);
|
|
|
|
|
_LogsAdd("SaveReceipt", "post", $"AMS接口推送:{msg}");
|
|
|
|
|
if (retdto != null)
|
|
|
|
|
{
|
|
|
|
|
if (retdto.status == "W2")
|
|
|
|
|
{
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { State = "1" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
|
}
|
|
|
|
|
else if (retdto.status == "W1")
|
|
|
|
|
{
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { State = "0" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var masterid = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => (x.IsDel == false || x.IsDel == null) && x.GID == retdto.businessId).ToList().Select(x => x.PID).FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
_LogsAdd("SaveReceipt", "post", $"AMS接口推送:{JsonConvert.SerializeObject(retdto)}");
|
|
|
|
|
var houses = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => (x.IsDel == false || x.IsDel == null) && x.PID == masterid && x.State != "1").ToList();
|
|
|
|
|
if (houses != null && houses.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = "匹配成功", NewNotice = "匹配成功" }).Where(w => w.GID == masterid).ExecuteAffrows();
|
|
|
|
|
}
|
|
|
|
|
var faillist = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => (x.IsDel == false || x.IsDel == null) && x.PID == masterid && x.State == "0").ToList();
|
|
|
|
|
if (faillist != null && faillist.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_Master>().Set(w => new AMS_Master { MateState = "匹配失败", NewNotice = "匹配成功" }).Where(w => w.GID == masterid).ExecuteAffrows();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
req.Code = 200;
|
|
|
|
|
req.Message = "未收到参数";
|
|
|
|
|
return req;
|
|
|
|
|
}
|
|
|
|
|
return req;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|