AMS调整:如果已收到ISF已匹配的状态,则修改发送时,保留ISF已匹配的状态

master
zhangxiaofeng 9 months ago
parent 651b2ff9c5
commit 7ef3c4c30d

@ -548,7 +548,7 @@ namespace djy.Service.AFR
{
await DbAMS.Insert(waitInsertHouseList).WithTransaction(tran).ExecuteAffrowsAsync();
await SaveHistoryAsync(input.GID, waitInsertHouseList, "新增", 0, "新增了单据", tran);
await SaveHistoryAsync(input.GID, waitInsertHouseList, "新增", 0, "创建了分单", tran);
}
if (waitDeleteHouseGids.Any())
{

@ -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);

@ -21,6 +21,7 @@ using djy.Service;
using Common.Extensions;
using djy.Service.DjyService;
using djy.IService.Djy;
using djy.Model;
namespace djy_AmsApi
{
@ -45,7 +46,8 @@ namespace djy_AmsApi
});
services.AddHttpClient();
services.AddScoped<IUser, AspNetUser>();
//读取配置信息
Configuration.Bind("WebConfig", sysOptionConfig.Webconfig);
sysOptionConfig._Configuration = Configuration;

@ -22,13 +22,13 @@
"ConnName": "sqldb",
"cache_time": 10,
"WebHostUrl": "http://192.168.1.83:30816",
"Redis": "192.168.1.83:6379,password=,defaultDatabase=4",
"Redis": "127.0.0.1:6379,password=,defaultDatabase=4",
"RedisDb": 4,
"Rbmq_Host": "",
"Rbmq_UserName": "admin",
"Rbmq_Password": "admin",
"Rbmq_Sqlhost": "Data Source =192.168.1.83; Initial Catalog=djy_logs; Persist Security Info=True; User ID =sa; Password=sa@djy.net;pooling=true",
"DapperDbString": "Data Source =192.168.1.83,32009; Initial Catalog=DevAMS; Persist Security Info=True; User ID =sa; Password=sa@djy.net;pooling=true;",
"Rbmq_Sqlhost": "Data Source =192.168.1.83; Initial Catalog=djy_logs; Persist Security Info=True; User ID =sa; Password=Djy@Sql2022.test;pooling=true",
"DapperDbString": "Data Source =192.168.1.83,32009; Initial Catalog=DevAMS; Persist Security Info=True; User ID =sa; Password=Djy@Sql2022.test;pooling=true;",
"requesterDea": "nbforwarder",
"DataConnList": [
@ -38,7 +38,7 @@
"Index": 100,
"DataType": 1,
"Status": 0,
"ConnString": "Data Source =192.168.1.83,32009; Initial Catalog=DevAMS; Persist Security Info=True; User ID =sa; Password=sa@djy.net;pooling=true;"
"ConnString": "Data Source =60.209.125.238,32009; Initial Catalog=DevAMS; Persist Security Info=True; User ID =sa; Password=Djy@Sql2022.test;pooling=true;"
},
{
"SysKey": "Common",
@ -46,7 +46,7 @@
"Index": 100,
"DataType": 1,
"Status": 0,
"ConnString": "Data Source =192.168.1.83,32009; Initial Catalog=DevCommonDB; Persist Security Info=True; User ID =sa; Password=sa@djy.net;pooling=true;"
"ConnString": "Data Source =60.209.125.238,32009; Initial Catalog=TestCommonDB; Persist Security Info=True; User ID =sa; Password=Djy@Sql2022.test;pooling=true;"
},
{
"SysKey": "djydb",
@ -54,7 +54,7 @@
"Index": 100,
"DataType": 1,
"Status": 0,
"ConnString": "Data Source =192.168.1.83,32009; Initial Catalog=TestDsPingTai; Persist Security Info=True; User ID =sa; Password=sa@djy.net;pooling=true"
"ConnString": "Data Source =60.209.125.238,32009; Initial Catalog=TestDsPingTai; Persist Security Info=True; User ID =sa; Password=Djy@Sql2022.test;pooling=true"
},
{
@ -63,7 +63,7 @@
"Index": 100,
"DataType": 1,
"Status": 0,
"ConnString": "Data Source =192.168.1.83,32009; Initial Catalog=TestDjyLogs; Persist Security Info=True; User ID =sa; Password=sa@djy.net;pooling=true"
"ConnString": "Data Source =60.209.125.238,32009; Initial Catalog=TestDjyLogs; Persist Security Info=True; User ID =sa; Password=Djy@Sql2022.test;pooling=true"
}

Loading…
Cancel
Save