From 7ef3c4c30d960531ffd79812d2cc88fa516f1e08 Mon Sep 17 00:00:00 2001 From: zhangxiaofeng Date: Mon, 19 Feb 2024 17:12:05 +0800 Subject: [PATCH] =?UTF-8?q?AMS=E8=B0=83=E6=95=B4=EF=BC=9A=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E5=B7=B2=E6=94=B6=E5=88=B0ISF=E5=B7=B2=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E7=9A=84=E7=8A=B6=E6=80=81=EF=BC=8C=E5=88=99=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=8F=91=E9=80=81=E6=97=B6=EF=BC=8C=E4=BF=9D=E7=95=99?= =?UTF-8?q?ISF=E5=B7=B2=E5=8C=B9=E9=85=8D=E7=9A=84=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/djy.Service/Afr/AfrService.cs | 2 +- web/djy.Service/Ams/AmsService.cs | 51 +++++++++++++-------- web/djy.WebApi/Startup.cs | 4 +- web/djy.WebApi/appsettings.Development.json | 14 +++--- 4 files changed, 42 insertions(+), 29 deletions(-) diff --git a/web/djy.Service/Afr/AfrService.cs b/web/djy.Service/Afr/AfrService.cs index ae4f40e..eda26a0 100644 --- a/web/djy.Service/Afr/AfrService.cs +++ b/web/djy.Service/Afr/AfrService.cs @@ -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()) { diff --git a/web/djy.Service/Ams/AmsService.cs b/web/djy.Service/Ams/AmsService.cs index 916766f..04bcbc9 100644 --- a/web/djy.Service/Ams/AmsService.cs +++ b/web/djy.Service/Ams/AmsService.cs @@ -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().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() + .Set(w => new AMS_House { MateState = matestate, ReportState = "已提交", NewNotice = "修改发送成功" }) + .Where(w => w.GID == item.GID) + .ExecuteAffrows(); } - DbBus.Get(DbList.AMSCenter).Update().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().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().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().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().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().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); diff --git a/web/djy.WebApi/Startup.cs b/web/djy.WebApi/Startup.cs index b9343f1..d200e16 100644 --- a/web/djy.WebApi/Startup.cs +++ b/web/djy.WebApi/Startup.cs @@ -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(); + //ȡϢ Configuration.Bind("WebConfig", sysOptionConfig.Webconfig); sysOptionConfig._Configuration = Configuration; diff --git a/web/djy.WebApi/appsettings.Development.json b/web/djy.WebApi/appsettings.Development.json index a7a0761..72f355b 100644 --- a/web/djy.WebApi/appsettings.Development.json +++ b/web/djy.WebApi/appsettings.Development.json @@ -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" }