|
|
|
@ -48,11 +48,11 @@ namespace djy.Service.Ams
|
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
|
.WhereIf(req.MBLNO != null, x => req.MBLNO.Contains(x.MBLNO))
|
|
|
|
|
.WhereIf(req.ReportState != null, x =>ReportStates.Contains(x.ReportState))
|
|
|
|
|
.WhereIf(req.PORTDISCHARGECode!=null,x=>x.PORTDISCHARGECode==req.PORTDISCHARGECode)
|
|
|
|
|
.WhereIf(req.LoadingPortCode != null, x => x.LoadingPortCode == req.LoadingPortCode)
|
|
|
|
|
.WhereIf(req.UserName!=null,x=>x.UserName==req.UserName)
|
|
|
|
|
.WhereIf(req.UserName!=null,x=> req.UserName.Contains(x.UserName) )
|
|
|
|
|
.WhereIf(req.CARRIERID != null, x =>req.CARRIERID==x.CARRIERID)
|
|
|
|
|
.WhereIf(req.BDate!=null,x=>x.CreateTime>=req.BDate)
|
|
|
|
|
.WhereIf(req.EDate!=null,x=>x.CreateTime<=req.EDate);
|
|
|
|
@ -252,31 +252,30 @@ namespace djy.Service.Ams
|
|
|
|
|
return req;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (docType == "AMSAR" || docType == "AMSDOC")
|
|
|
|
|
{
|
|
|
|
|
var getfinrs = fin.Expend(new CustFee
|
|
|
|
|
{
|
|
|
|
|
SENDUSERID = userid,
|
|
|
|
|
LURURENID = userid,
|
|
|
|
|
CtnrCount = 1,
|
|
|
|
|
CtnrInfo = string.Empty,
|
|
|
|
|
BSTYPE = 15,
|
|
|
|
|
SENDTYPE = 0,
|
|
|
|
|
BSNO = oid.ToString(),
|
|
|
|
|
MBLNO = master.MBLNO.ToString(),
|
|
|
|
|
}
|
|
|
|
|
, 0);
|
|
|
|
|
if (!getfinrs.Status)
|
|
|
|
|
{
|
|
|
|
|
req.Code = 200;
|
|
|
|
|
req.Message = getfinrs.Message;
|
|
|
|
|
return req;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//if (docType == "AMSAR" || docType == "AMSDOC")
|
|
|
|
|
//{
|
|
|
|
|
// var getfinrs = fin.Expend(new CustFee
|
|
|
|
|
// {
|
|
|
|
|
// SENDUSERID = userid,
|
|
|
|
|
// LURURENID = userid,
|
|
|
|
|
// CtnrCount = 1,
|
|
|
|
|
// CtnrInfo = string.Empty,
|
|
|
|
|
// BSTYPE = 15,
|
|
|
|
|
// SENDTYPE = 0,
|
|
|
|
|
// BSNO = oid.ToString(),
|
|
|
|
|
// MBLNO = master.MBLNO.ToString(),
|
|
|
|
|
// }
|
|
|
|
|
// , 0);
|
|
|
|
|
// if (!getfinrs.Status)
|
|
|
|
|
// {
|
|
|
|
|
// req.Code = 200;
|
|
|
|
|
// req.Message = getfinrs.Message;
|
|
|
|
|
// return req;
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
@ -408,14 +407,16 @@ namespace djy.Service.Ams
|
|
|
|
|
dic.Add("sign", sign);
|
|
|
|
|
dic.Add("docLength", docContent.ToString().Length.ToString());
|
|
|
|
|
#region 接口调用
|
|
|
|
|
_LogsAdd("SendDE", "post", $"AMS接口调用发送:{dic}");
|
|
|
|
|
_LogsAdd("SendDE", "post", $"AMS接口调用地址:{url.PARAMVALUE}");
|
|
|
|
|
_LogsAdd("SendDE", "post", $"timestamp:{timestamp}");
|
|
|
|
|
_LogsAdd("SendDE", "post", $"AMS接口调用发送{oid}:{ JsonConvert.SerializeObject(dic)}");
|
|
|
|
|
_LogsAdd("SendDE", "post", $"AMS接口调用地址{oid}:{url.PARAMVALUE}");
|
|
|
|
|
string gethtml = await HttpHelp.Post(dic, url.PARAMVALUE, PsotType.Urlencoded);
|
|
|
|
|
_LogsAdd("SendDE", "post", $"AMS接口调用返回:{gethtml}");
|
|
|
|
|
_LogsAdd("SendDE", "post", $"AMS接口调用返回{oid}:{gethtml}");
|
|
|
|
|
if (gethtml != null)
|
|
|
|
|
{
|
|
|
|
|
JObject rlt = JObject.Parse(gethtml);
|
|
|
|
|
var code = rlt.GetValue("code").ToString();
|
|
|
|
|
var msg = rlt.GetValue("msg").ToString();
|
|
|
|
|
if (code == "F")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
@ -445,8 +446,11 @@ namespace djy.Service.Ams
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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") + "发送单据失败,失败原因:"+ msg;
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
|
req.Code = 200;
|
|
|
|
|
req.Message = "操作失败,"+ msg;
|
|
|
|
|
return req;
|
|
|
|
|
}
|
|
|
|
|
if (code == "T")
|
|
|
|
|
{
|
|
|
|
@ -541,9 +545,6 @@ namespace djy.Service.Ams
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Response SaveReceipt(string msg)
|
|
|
|
|
{
|
|
|
|
|
Response req = new Response();
|
|
|
|
@ -615,8 +616,6 @@ namespace djy.Service.Ams
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据日期生成14位随机数
|
|
|
|
|
/// </summary>
|
|
|
|
@ -822,7 +821,9 @@ namespace djy.Service.Ams
|
|
|
|
|
{
|
|
|
|
|
Document document = new Document(PageSize.A4);
|
|
|
|
|
//指定字体文件,IDENTITY_H:支持中文
|
|
|
|
|
BaseFont customfont = BaseFont.CreateFont(@"C:\Windows\Fonts\MSYH.TTC,0", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
|
|
|
|
|
var path = Path.Combine( AppDomain.CurrentDomain.BaseDirectory, "msyh.ttc,0");
|
|
|
|
|
_LogsAdd("PDF", "Get", $"PDF字体路径:{path }");
|
|
|
|
|
BaseFont customfont = BaseFont.CreateFont(path, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
|
|
|
|
|
var Fonttable = new Font(customfont, 12);
|
|
|
|
|
Font font = new Font(customfont, 14);
|
|
|
|
|
Font datefont = new Font(customfont, 9);
|
|
|
|
@ -845,7 +846,7 @@ namespace djy.Service.Ams
|
|
|
|
|
document.Add(new Paragraph("\r"));//换行
|
|
|
|
|
PdfPTable table = new PdfPTable(2); //生成只有2列的行数据
|
|
|
|
|
table.DefaultCell.Border = Rectangle.NO_BORDER; //无边框
|
|
|
|
|
table.DefaultCell.MinimumHeight = 40f; //高度
|
|
|
|
|
table.DefaultCell.MinimumHeight = 50f; //高度
|
|
|
|
|
float[] widths = new float[] { 100f,200f }; //宽度
|
|
|
|
|
table.SetWidths(widths);
|
|
|
|
|
|
|
|
|
@ -903,8 +904,8 @@ namespace djy.Service.Ams
|
|
|
|
|
document.Add(new Paragraph("\r"));//换行
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Image image = Image.GetInstance(@"F:\DJY.Ams\djyweb_ams\ams\djy.WebApi\logo.png");
|
|
|
|
|
var imgpath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logo.png");
|
|
|
|
|
Image image = Image.GetInstance(imgpath);
|
|
|
|
|
image.ScalePercent(10f);
|
|
|
|
|
//设置图片的宽高
|
|
|
|
|
image.ScaleAbsolute(180f, 66f);
|
|
|
|
@ -965,11 +966,11 @@ namespace djy.Service.Ams
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var List = DbBus.Get(DbList.Common).Select<AMS_AddrTemplate>().
|
|
|
|
|
var List = DbBus.Get(DbList.AMSCenter).Select<AMS_AddrTemplate>().
|
|
|
|
|
Where(x => x.IsDel == false || x.IsDel == null).
|
|
|
|
|
WhereIf(companyid != "", x => x.CompID == companyid).
|
|
|
|
|
WhereIf(type != "", x => x.Type == type).
|
|
|
|
|
WhereIf(TemPlateName != "", x => TemPlateName.Contains(x.TemPlateName)).
|
|
|
|
|
WhereIf(companyid != null, x => x.CompID == companyid).
|
|
|
|
|
WhereIf(type != null, x => x.Type == type).
|
|
|
|
|
WhereIf(TemPlateName != null, x => TemPlateName.Contains(x.TemPlateName)).
|
|
|
|
|
ToList();
|
|
|
|
|
return List;
|
|
|
|
|
}
|
|
|
|
|