|
|
|
@ -34,7 +34,7 @@ namespace djy.Service.Ams
|
|
|
|
|
public class AmsService : ServBase, IAmsService
|
|
|
|
|
{
|
|
|
|
|
#region 查询列表
|
|
|
|
|
public TableData Load(AMSQuery req, User user, UserAuthorityDto aut)
|
|
|
|
|
public TableData Load(AMSQuery req, User user, UserAuthorityDto aut)
|
|
|
|
|
{
|
|
|
|
|
var result = new TableData();
|
|
|
|
|
int count = 0;
|
|
|
|
@ -147,13 +147,13 @@ namespace djy.Service.Ams
|
|
|
|
|
it.HistoryDto = historyDto;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
result.data = list.Where(x => x.HouseDto != null && x.HouseDto.Count() > 0).Skip((req.Page-1) * req.Limit).Take(req.Limit).ToList();
|
|
|
|
|
result.data = list.Where(x => x.HouseDto != null && x.HouseDto.Count() > 0).Skip((req.Page - 1) * req.Limit).Take(req.Limit).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
@ -498,7 +498,8 @@ namespace djy.Service.Ams
|
|
|
|
|
var packageList = DbBus.Get(DbList.Common).Select<MappingPackage>().Where(map => map.Module == "AMS").ToList();
|
|
|
|
|
MasterBillInfoDto dto = new MasterBillInfoDto();
|
|
|
|
|
masterBillInfo masterBillInfo = new masterBillInfo();
|
|
|
|
|
if (string.IsNullOrEmpty(master.CARRIERID)) {
|
|
|
|
|
if (string.IsNullOrEmpty(master.CARRIERID))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
req.Code = 201;
|
|
|
|
|
req.Message = "船公司id为空";
|
|
|
|
@ -520,11 +521,12 @@ namespace djy.Service.Ams
|
|
|
|
|
{
|
|
|
|
|
masterBillInfo.requesterDea = AMSRequestDEA.ItemCode;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
masterBillInfo.requesterDea = sysOptionConfig.Webconfig.requesterDea;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
masterBillInfo.consignmentType = master.ConsignmentType;
|
|
|
|
|
masterBillInfo.loadHarbour = master.LoadingPort;
|
|
|
|
|
masterBillInfo.loadHarbourCode = master.LoadingPortCode;
|
|
|
|
@ -892,7 +894,7 @@ namespace djy.Service.Ams
|
|
|
|
|
dic.Add("docLength", docContent.ToString().Length.ToString());
|
|
|
|
|
#region 接口调用
|
|
|
|
|
_LogsAdd("SendDE", "post", $"timestamp:{timestamp}");
|
|
|
|
|
_LogsAdd("SendDE", "post", $"AMS接口调用发送{oid}:{ JsonConvert.SerializeObject(dic)}");
|
|
|
|
|
_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接口调用返回{oid}:{gethtml}");
|
|
|
|
@ -1053,8 +1055,17 @@ namespace djy.Service.Ams
|
|
|
|
|
BSNO = oid.ToString(),
|
|
|
|
|
MBLNO = master.MBLNO.ToString(),
|
|
|
|
|
}, 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 如果已收到ISF已匹配的状态,则修改发送时,保留ISF已匹配的状态
|
|
|
|
|
string matestate = item.MateState?.Contains("3Z") == true ? "3Z" : "";
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter)
|
|
|
|
|
.Update<AMS_House>()
|
|
|
|
|
.Set(w => new AMS_House { MateState = matestate, ReportState = "已提交", NewNotice = "修改发送成功" })
|
|
|
|
|
.Where(w => w.GID == item.GID)
|
|
|
|
|
.ExecuteAffrows();
|
|
|
|
|
}
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = "", ReportState = "已提交", NewNotice = "修改发送成功" }).Where(w => House.Contains(w.GID)).ExecuteAffrows();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -1094,7 +1105,7 @@ namespace djy.Service.Ams
|
|
|
|
|
{
|
|
|
|
|
req.Code = 500;
|
|
|
|
|
req.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
_LogsAdd("SendDE", "post", $"AMS_SendDE接口:{req.Message }");
|
|
|
|
|
_LogsAdd("SendDE", "post", $"AMS_SendDE接口:{req.Message}");
|
|
|
|
|
|
|
|
|
|
return req;
|
|
|
|
|
}
|
|
|
|
@ -1114,7 +1125,7 @@ namespace djy.Service.Ams
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Transaction(() =>
|
|
|
|
|
{
|
|
|
|
|
var masterid = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => x.IsDel != true && x.GID == retdto.businessId).ToList().Select(x => x.PID).FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (retdto.status == "W2")
|
|
|
|
|
{
|
|
|
|
|
var house = DbBus.Get(DbList.AMSCenter).Select<AMS_House>().Where(x => x.GID == retdto.businessId).ToOne();
|
|
|
|
@ -1131,7 +1142,7 @@ namespace djy.Service.Ams
|
|
|
|
|
history.Operator = "系统管理员";
|
|
|
|
|
history.Remark = "您的单据" + house.HBLNo + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "海关接收成功";
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
|
var matestate = $"{house.MateState},{ retdto.status}";
|
|
|
|
|
var matestate = $"{house.MateState},{retdto.status}";
|
|
|
|
|
if (house.NewNotice == "删除发送成功")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
@ -1147,7 +1158,7 @@ namespace djy.Service.Ams
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = matestate, NewNotice = "海关接收成功" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -1178,7 +1189,7 @@ namespace djy.Service.Ams
|
|
|
|
|
history.Operator = "系统管理员";
|
|
|
|
|
history.Remark = "您的单据" + house.HBLNo + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "船司匹配成功";
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
|
var matestate = $"{house.MateState},{ retdto.status}";
|
|
|
|
|
var matestate = $"{house.MateState},{retdto.status}";
|
|
|
|
|
if (house.NewNotice == "删除发送成功")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
@ -1194,7 +1205,7 @@ namespace djy.Service.Ams
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = matestate, NewNotice = "船司匹配成功" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -1229,7 +1240,7 @@ namespace djy.Service.Ams
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var matestate = $"{house.MateState},{ retdto.status}";
|
|
|
|
|
var matestate = $"{house.MateState},{retdto.status}";
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Update<AMS_House>().Set(w => new AMS_House { MateState = matestate, NewNotice = "ISF匹配成功" }).Where(w => w.GID == retdto.businessId).ExecuteAffrows();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1246,7 +1257,7 @@ namespace djy.Service.Ams
|
|
|
|
|
history.Operator = "系统管理员";
|
|
|
|
|
history.Remark = "您的单据" + house.HBLNo + "于" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "海关拒绝";
|
|
|
|
|
DbBus.Get(DbList.AMSCenter).Insert(history).ExecuteAffrows();
|
|
|
|
|
var matestate = $"{house.MateState},{ retdto.status}";
|
|
|
|
|
var matestate = $"{house.MateState},{retdto.status}";
|
|
|
|
|
|
|
|
|
|
if (house.NewNotice == "删除发送成功")
|
|
|
|
|
{
|
|
|
|
@ -1359,7 +1370,7 @@ namespace djy.Service.Ams
|
|
|
|
|
{
|
|
|
|
|
req.Code = 500;
|
|
|
|
|
req.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
_LogsAdd("SendDE", "post", $"AMS_SaveReceipt接口:{req.Message }");
|
|
|
|
|
_LogsAdd("SendDE", "post", $"AMS_SaveReceipt接口:{req.Message}");
|
|
|
|
|
return req;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1633,7 +1644,7 @@ namespace djy.Service.Ams
|
|
|
|
|
Document document = new Document(PageSize.A4);
|
|
|
|
|
//指定字体文件,IDENTITY_H:支持中文
|
|
|
|
|
var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "msyh.ttc,0");
|
|
|
|
|
_LogsAdd("PDF", "Get", $"PDF字体路径:{path }");
|
|
|
|
|
_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);
|
|
|
|
|