From cd812a9d4d04ac091693cc879481dd15d768c17f Mon Sep 17 00:00:00 2001 From: zhangxiaofeng <1939543722@qq.com> Date: Thu, 25 Apr 2024 09:50:02 +0800 Subject: [PATCH] =?UTF-8?q?AFR=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/djy.Model/AFRDto/AFRRequestDto.cs | 68 ++++++++++++++++- .../Attributes/LogPropertyAttribute.cs | 35 +++++++++ .../Converter/LogPropertyWriteResolver.cs | 23 ++++++ web/djy.Model/HistoryDetail.cs | 17 +++++ web/djy.Service/Afr/AfrService.cs | 73 +++++++++++++++---- .../PublishProfiles/FolderProfile.pubxml.user | 4 +- web/djy.WebApi/djy_AmsApi.csproj.user | 2 +- web/djy_AfrApi/Program.cs | 11 +++ web/djy_AfrApi/Properties/launchSettings.json | 12 +-- web/djy_AfrApi/appsettings.Production.json | 16 ++-- web/djy_AfrApi/djy_AfrApi.csproj.user | 2 +- 11 files changed, 228 insertions(+), 35 deletions(-) create mode 100644 web/djy.Model/Attributes/LogPropertyAttribute.cs create mode 100644 web/djy.Model/Converter/LogPropertyWriteResolver.cs create mode 100644 web/djy.Model/HistoryDetail.cs diff --git a/web/djy.Model/AFRDto/AFRRequestDto.cs b/web/djy.Model/AFRDto/AFRRequestDto.cs index 17e3d3f..44cf104 100644 --- a/web/djy.Model/AFRDto/AFRRequestDto.cs +++ b/web/djy.Model/AFRDto/AFRRequestDto.cs @@ -1,4 +1,5 @@ -using System; +using djy.Model.Attributes; +using System; using System.Collections.Generic; namespace djy.Model.AFRDto @@ -8,7 +9,9 @@ namespace djy.Model.AFRDto /// public class AFRRequestDto { + [LogProperty("主单信息")] public MasterBillInfo masterBillInfo { get; set; } + [LogProperty("分单信息")] public List houseBillInfoList { get; set; } } public class MasterBillInfo @@ -16,85 +19,102 @@ namespace djy.Model.AFRDto /// /// 船东提单号 /// + [LogProperty("船东提单号")] public string masterBillNo { get; set; } /// /// 船东单运编号(选填) /// + [LogProperty("船东单运编号")] public string shippingNo { get; set; } /// /// 运输条款代码 /// + [LogProperty("运输条款代码")] public string clause { get; set; } /// /// 整箱/拼箱 FCL:整箱 LCL:拼箱 /// + [LogProperty("整箱/拼箱")] public string consignmentType { get; set; } /// /// 卸货港全称 /// + [LogProperty("卸货港全称")] public string dischargeHarbour { get; set; } /// /// 卸货港五字码 /// + [LogProperty("卸货港五字码")] public string dischargeHarbourCode { get; set; } /// /// 预计到达日期 /// + [LogProperty("预计到达日期")] public DateTime? estimatedArrivalTime { get; set; } /// /// 申报运输类型 /// + [LogProperty("申报运输类型")] public string filingType { get; set; } /// /// 交货地全称(条件)申报运输类型Tranship时,必填 /// + [LogProperty("交货地全称")] public string lastForeignHarbour { get; set; } /// /// 交货地五字码(条件)申报运输类型Tranship时,必填 /// + [LogProperty("交货地五字码")] public string lastForeignHarbourCode { get; set; } /// /// 预计开船日期 /// + [LogProperty("预计开船日期")] public DateTime? loadDate { get; set; } /// /// 装货港全称 /// + [LogProperty("装货港全称")] public string loadHarbour { get; set; } /// /// 装货港五字码 /// + [LogProperty("装货港五字码")] public string loadHarbourCode { get; set; } /// /// 船司MapName /// + [LogProperty("船司")] public string shipCompany { get; set; } /// /// /// + [LogProperty("船名")] public string vessel { get; set; } /// /// /// + [LogProperty("航次")] public string voyage { get; set; } /// /// 发送方DEA CARGOEDI账号,联系运营人员配置 /// + [LogProperty(null, Readable = false)] public string requesterDea { get; set; } } public class HouseBillInfo @@ -102,128 +122,154 @@ namespace djy.Model.AFRDto /// /// 货代提单号唯一编号 同货代提单号,原始修改删除重发报文,该值要一致 /// + [LogProperty("货代提单号唯一编号")] public string businessId { get; set; } /// /// 货代单运编号(选填) /// + [LogProperty("货代单运编号")] public string shippingNo { get; set; } /// /// 货代提单号 修改报文,该值不可以变更 /// + [LogProperty("货代提单号")] public string houseBillNo { get; set; } /// /// 通知人地址 /// + [LogProperty("通知人地址")] public string notifyAddress { get; set; } /// /// 通知人城市 /// + [LogProperty("通知人城市")] public string notifyCity { get; set; } /// /// 通知人联系人 /// + [LogProperty("通知人联系人")] public string notifyContact { get; set; } /// /// 通知人国家 /// + [LogProperty("通知人国家")] public string notifyCountry { get; set; } /// /// 通知人国家代码 /// + [LogProperty("通知人国家代码")] public string notifyCountryCode { get; set; } /// /// 通知人名称 /// + [LogProperty("通知人名称")] public string notifyName { get; set; } /// /// 通知人联系人电话 /// + [LogProperty("通知人联系人电话")] public string notifyTel { get; set; } /// /// 收货人地址 /// + [LogProperty("收货人地址")] public string receiveAddress { get; set; } /// /// 收货人城市 /// + [LogProperty("收货人城市")] public string receiveCity { get; set; } /// /// 收货人联系人 /// + [LogProperty("收货人联系人")] public string receiveContact { get; set; } /// /// 收货人国家 /// + [LogProperty("收货人国家")] public string receiveCountry { get; set; } /// /// 收货人国家代码 /// + [LogProperty("收货人国家代码")] public string receiveCountryCode { get; set; } /// /// 收货人名称 /// + [LogProperty("收货人名称")] public string receiveName { get; set; } /// /// 收货人联系人电话 /// + [LogProperty("收货人联系人电话")] public string receiveTel { get; set; } /// /// 发货人地址 /// + [LogProperty("发货人地址")] public string sendAddress { get; set; } /// /// 发货人城市 /// + [LogProperty("发货人城市")] public string sendCity { get; set; } /// /// 发货人联系人 /// + [LogProperty("发货人联系人")] public string sendContact { get; set; } /// /// 发货人国家 /// + [LogProperty("发货人国家")] public string sendCountry { get; set; } /// /// 发货人国家代码 /// + [LogProperty("发货人国家代码")] public string sendCountryCode { get; set; } /// /// 发货人名称 /// + [LogProperty("发货人名称")] public string sendName { get; set; } /// /// 发货人联系人电话 /// + [LogProperty("发货人联系人电话")] public string sendTel { get; set; } //public List ctnInfo { get; set; } + [LogProperty("箱信息")] public CtnInfo ctnInfo { get; set; } } public class CtnInfo { + [LogProperty("箱信息列表")] public List insertList { get; set; } } public class InsertList @@ -231,100 +277,120 @@ namespace djy.Model.AFRDto /// /// 货主箱标志 /// + [LogProperty("货主箱标志")] public string containerMark { get; set; } /// /// 箱号 /// + [LogProperty("箱号")] public string containerNo { get; set; } /// /// 箱型 /// + [LogProperty("箱型")] public string containerType { get; set; } /// /// 危品联系人(选填) /// + [LogProperty("危品联系人")] public string dangerContact { get; set; } /// /// 危品联系人电话(选填) /// + [LogProperty("危品联系人电话")] public string dangerContactTel { get; set; } /// /// 危品等级(条件必填) /// + [LogProperty("危品等级")] public string dangerGrade { get; set; } /// /// 危品备注(选填) /// + [LogProperty("危品备注")] public string dangerMemo { get; set; } /// /// 件数 /// + [LogProperty("件数")] public string digit { get; set; } /// /// 品名 /// + [LogProperty("品名")] public string enProductName { get; set; } /// /// 毛重 /// + [LogProperty("毛重")] public string grossWeight { get; set; } /// /// HSCode /// + [LogProperty("HSCode")] public string hscode { get; set; } /// /// 燃点,摄氏度(选填) /// + [LogProperty("燃点")] public string ignite { get; set; } /// /// 原产国(选填) /// + [LogProperty("原产国")] public string originCountry { get; set; } /// /// 原产国国家代码(选填) /// + [LogProperty("原产国国家代码")] public string originCountryCode { get; set; } /// /// 包装 /// + [LogProperty("包装")] public string packing { get; set; } /// /// 包装代码 /// + [LogProperty("包装代码")] public string packingCode { get; set; } /// /// 封号 /// + [LogProperty("封号")] public string sealNo { get; set; } /// /// 唛头 /// + [LogProperty("唛头")] public string shippingMark { get; set; } /// /// UN CODE(条件必填) /// + [LogProperty("UN CODE")] public string unCode { get; set; } /// /// 体积 /// + [LogProperty("体积")] public string volume { get; set; } } } diff --git a/web/djy.Model/Attributes/LogPropertyAttribute.cs b/web/djy.Model/Attributes/LogPropertyAttribute.cs new file mode 100644 index 0000000..b89d922 --- /dev/null +++ b/web/djy.Model/Attributes/LogPropertyAttribute.cs @@ -0,0 +1,35 @@ +using System; + +namespace djy.Model.Attributes +{ + /// + /// 用于格式化日志输出的属性 + /// + [AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = false)] + public class LogPropertyAttribute : Attribute + { + /// + /// 反序列化时要读取的属性名称 + /// + public string ReadName { get; set; } + /// + /// 序列化时要写入的属性名称 + /// + public string WriteName { get; set; } + /// + /// 是否可读 + /// + public bool Readable { get; set; } + /// + /// 是否可写 + /// + public bool Writable { get; set; } + + public LogPropertyAttribute(string writeName) + { + Readable = true; + Writable = true; + WriteName = writeName; + } + } +} diff --git a/web/djy.Model/Converter/LogPropertyWriteResolver.cs b/web/djy.Model/Converter/LogPropertyWriteResolver.cs new file mode 100644 index 0000000..ddf313b --- /dev/null +++ b/web/djy.Model/Converter/LogPropertyWriteResolver.cs @@ -0,0 +1,23 @@ +using djy.Model.Attributes; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; +using System.Reflection; + +namespace djy.Model.Converter +{ + public class LogPropertyWriteResolver : DefaultContractResolver + { + protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) + { + var property = base.CreateProperty(member, memberSerialization); + var attr = member.GetCustomAttribute(typeof(LogPropertyAttribute)) as LogPropertyAttribute; + if (attr != null) + { + property.PropertyName = attr.WriteName ?? property.PropertyName; + property.Writable = attr.Writable; + property.Readable = attr.Readable; + } + return property; + } + } +} diff --git a/web/djy.Model/HistoryDetail.cs b/web/djy.Model/HistoryDetail.cs new file mode 100644 index 0000000..fb954f0 --- /dev/null +++ b/web/djy.Model/HistoryDetail.cs @@ -0,0 +1,17 @@ +using FreeSql.DataAnnotations; + +namespace djy.Model +{ + /// + /// + /// + [Table(Name = "HistoryDetail", DisableSyncStructure = true)] + public partial class HistoryDetail + { + [Column(IsIdentity = true, IsPrimary = true)] + public long ID { get; set; } + public int Type { get; set; } + public string HistoryID { get; set; } + public string RequestLog { get; set; } + } +} \ No newline at end of file diff --git a/web/djy.Service/Afr/AfrService.cs b/web/djy.Service/Afr/AfrService.cs index 59167fc..5a9a3bb 100644 --- a/web/djy.Service/Afr/AfrService.cs +++ b/web/djy.Service/Afr/AfrService.cs @@ -11,9 +11,11 @@ using djy.Model.Afr; using djy.Model.AFRDto; using djy.Model.Ams; using djy.Model.AmsDto; +using djy.Model.Converter; using djy.Service.DjyService; using FreeSql; using Microsoft.Extensions.Logging; +using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; @@ -388,7 +390,7 @@ namespace djy.Service.AFR input.HouseList.ForEach(house => { StringTrimmer.TrimStringProperties(house); - + house.GID = Guid.NewGuid().ToString(); house.PID = input.GID; house.LastUpdateUserID = User.GID; @@ -426,7 +428,7 @@ namespace djy.Service.AFR .WithTransaction(tran) .ExecuteAffrowsAsync(); - await SaveHistoryAsync(input.GID, input.HouseList, "新增", 0, "创建了单据", tran); + await SaveHistoryAsync(input.GID, input.HouseList, "新增", 0, "创建了单据", null, tran); tran.Commit(); } @@ -451,7 +453,7 @@ namespace djy.Service.AFR foreach (var house in input.HouseList) { StringTrimmer.TrimStringProperties(house); - + house.LastUpdate = nowTime; house.LastUpdateUserID = User.GID; house.LastUpdateUserName = User.ShowName; @@ -558,7 +560,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, "创建了分单", null, tran); } if (waitDeleteHouseGids.Any()) { @@ -569,7 +571,7 @@ namespace djy.Service.AFR .Where(h => waitDeleteHouseGids.Contains(h.GID)) .ExecuteAffrowsAsync(); - await SaveHistoryAsync(input.GID, waitDeleteHouseGids.Select(gid => new AFRHouse() { GID = gid }), "删除", 0, "删除了单据", tran); + await SaveHistoryAsync(input.GID, waitDeleteHouseGids.Select(gid => new AFRHouse() { GID = gid }), "删除", 0, "删除了单据", null, tran); } if (waitUpdateHouseGids.Any()) { @@ -579,7 +581,7 @@ namespace djy.Service.AFR .WithTransaction(tran) .ExecuteAffrowsAsync(); - await SaveHistoryAsync(input.GID, waitUpdateHouseList, "修改", 0, "修改了单据", tran); + await SaveHistoryAsync(input.GID, waitUpdateHouseList, "修改", 0, "修改了单据", null, tran); } // 箱子执行 @@ -863,7 +865,7 @@ namespace djy.Service.AFR { masterBillNo = masterItem.MBLNO, shippingNo = masterItem.ShippingNo, - clause = masterItem.Clause, //test + clause = masterItem.Clause, consignmentType = masterItem.ConsignmentType, dischargeHarbour = masterItem.DischargeHarbour, dischargeHarbourCode = masterItem.DischargeHarbourCode, @@ -874,7 +876,7 @@ namespace djy.Service.AFR loadDate = masterItem.LoadDate, loadHarbour = masterItem.LoadHarbour, loadHarbourCode = masterItem.LoadHarbourCode, - requesterDea = sysOptionConfig.Webconfig.requesterDea, //test + requesterDea = sysOptionConfig.Webconfig.requesterDea, shipCompany = masterItem.ShipCompanyMapCode, vessel = masterItem.Vessel, voyage = masterItem.Voyno @@ -950,7 +952,7 @@ namespace djy.Service.AFR requestDto.houseBillInfoList.Add(houseBillInfo); } } - + // 开始请求电子口岸的接口 var masterBillInfoStr = JsonHelper.Instance.Serialize(requestDto); var businessParam = new Dictionary() @@ -1035,7 +1037,26 @@ namespace djy.Service.AFR .ExecuteAffrowsAsync(); // 记录历史 - await SaveHistoryAsync(masterItem.GID, houseList, state, 0, "发送了单据"); + // 生成详细的发送日志 + string requestLog = JsonConvert.SerializeObject(requestDto, Formatting.Indented, new JsonSerializerSettings() + { + ContractResolver = new LogPropertyWriteResolver(), + DateFormatString = "yyyy-MM-dd HH:mm:ss" + }); + await SaveHistoryAsync(masterItem.GID, houseList, state, 0, "发送了单据", requestLog); + + //await SaveHistoryAsync(masterItem.GID, houseList, "新增发送成功", 0, "发送了单据", requestLog); + //requestDto.masterBillInfo.estimatedArrivalTime = new DateTime(1999,12,12); + //requestDto.houseBillInfoList[0].notifyName = "测试人"; + //requestDto.houseBillInfoList[0].ctnInfo.insertList[0].containerNo = "12312312"; + + //string requestLog2 = JsonConvert.SerializeObject(requestDto, Formatting.Indented, new JsonSerializerSettings() + //{ + // ContractResolver = new LogPropertyWriteResolver(), + // DateFormatString = "yyyy-MM-dd HH:mm:ss" + //}); + //await SaveHistoryAsync(masterItem.GID, houseList, "修改发送成功", 0, "发送了单据", requestLog2); + } else { @@ -1335,15 +1356,23 @@ namespace djy.Service.AFR /// 保存操作历史或回执接收历史 /// /// 主单主键 - /// 分单主键列表 + /// 分单列表 /// 状态 /// 0:人工操作历史;1:回执接收历史 /// + /// 请求的详细日志内容 /// /// - private async Task SaveHistoryAsync(string mid, IEnumerable houseList, string state, int type, string remark, DbTransaction tran = null) + private async Task SaveHistoryAsync(string mid, + IEnumerable houseList, + string state, + int type, + string remark, + string requestLog = null, + DbTransaction tran = null) { - List list = new(houseList.Count()); + List historyList = new(houseList.Count()); + List detailList = new(houseList.Count()); foreach (AFRHouse item in houseList) { var history = new AFRMasterHistory() @@ -1364,15 +1393,27 @@ namespace djy.Service.AFR { history.Remark = $"您的单据 {item.HouseBillNo} 于 {(DateTime)history.CreateTime:yyyy-MM-dd HH:mm:ss} 接收到回执:{remark}"; } - list.Add(history); + historyList.Add(history); + + if (requestLog != null) + { + detailList.Add(new HistoryDetail() + { + HistoryID = history.GID, + RequestLog = requestLog, + Type = 3 + }); + } } if (tran == null) { - await DbAMS.Insert(list).ExecuteAffrowsAsync(); + await DbAMS.Insert(historyList).ExecuteAffrowsAsync(); + await DbAMS.Insert(detailList).ExecuteAffrowsAsync(); } else { - await DbAMS.Insert(list).WithTransaction(tran).ExecuteAffrowsAsync(); + await DbAMS.Insert(historyList).WithTransaction(tran).ExecuteAffrowsAsync(); + await DbAMS.Insert(detailList).WithTransaction(tran).ExecuteAffrowsAsync(); } } diff --git a/web/djy.WebApi/Properties/PublishProfiles/FolderProfile.pubxml.user b/web/djy.WebApi/Properties/PublishProfiles/FolderProfile.pubxml.user index 5b32fc3..cf8d06b 100644 --- a/web/djy.WebApi/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/web/djy.WebApi/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -4,8 +4,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - <_PublishTargetUrl>D:\DJY\Code\djyweb_ams\web\djy.WebApi\bin\publish\net5 - True|2024-02-20T00:48:34.1425408Z;True|2023-06-16T09:09:45.1637530+08:00;True|2023-06-15T17:35:47.2298327+08:00;True|2022-10-24T13:58:36.8728872+08:00;True|2022-10-11T17:36:04.7506103+08:00;True|2022-09-29T09:16:51.0738556+08:00;True|2022-09-29T09:12:44.1994050+08:00;True|2022-09-29T09:05:28.1343572+08:00;True|2022-09-28T17:22:24.8692737+08:00;True|2022-09-28T16:15:13.4883777+08:00;True|2022-09-28T10:59:23.5270093+08:00;True|2022-08-31T10:01:14.0996702+08:00;True|2022-08-29T11:10:30.2643117+08:00;True|2022-08-29T10:55:49.0496591+08:00;True|2022-08-16T10:30:57.6816257+08:00;True|2022-08-15T17:50:55.2965000+08:00;True|2022-08-12T18:07:20.4848662+08:00;True|2022-08-12T17:46:41.1829405+08:00;True|2022-08-12T15:08:58.5925841+08:00;True|2022-07-20T16:18:49.1737260+08:00;True|2022-07-14T13:44:55.2043481+08:00;True|2022-07-13T10:21:13.3628429+08:00;True|2022-07-12T15:45:11.4672604+08:00;True|2022-07-12T10:48:29.8013532+08:00;True|2022-07-04T09:32:18.4540585+08:00;True|2022-07-01T17:34:50.7575127+08:00;True|2022-07-01T15:51:14.9076477+08:00;True|2022-06-30T15:06:12.0032112+08:00;True|2022-06-30T15:05:33.2540874+08:00;True|2022-06-30T10:26:41.3365814+08:00;True|2022-06-30T09:56:20.9021741+08:00;True|2022-06-30T08:53:10.0864638+08:00;True|2022-06-29T17:05:03.3034364+08:00;True|2022-06-29T16:50:10.1873653+08:00;True|2022-06-29T16:32:36.1524378+08:00;True|2022-06-29T15:56:09.9746651+08:00;True|2022-06-29T10:56:16.8088978+08:00;True|2022-06-29T08:54:20.5334051+08:00;True|2022-06-28T19:41:08.7023145+08:00;True|2022-06-28T19:26:28.7000486+08:00;True|2022-06-28T19:14:38.4827828+08:00;True|2022-06-28T18:56:21.8997711+08:00;True|2022-06-28T17:46:58.3643830+08:00;True|2022-06-28T17:10:20.1461539+08:00;True|2022-06-28T16:09:53.0805413+08:00;True|2022-06-28T15:52:30.2951989+08:00;True|2022-06-28T11:01:29.3265564+08:00;True|2022-06-28T10:35:04.6353020+08:00;True|2022-06-28T10:25:10.0426356+08:00;True|2022-06-28T10:22:28.8860296+08:00;True|2022-06-28T10:10:33.8758083+08:00;True|2022-06-28T10:03:21.1254163+08:00;True|2022-06-28T09:15:06.8911689+08:00;True|2022-06-27T17:07:03.5262846+08:00;True|2022-06-27T16:51:26.5898864+08:00;True|2022-06-27T16:28:43.2026298+08:00;True|2022-06-27T16:28:18.9494990+08:00;True|2022-06-27T16:27:16.7453474+08:00;True|2022-06-27T16:18:19.4634998+08:00;True|2022-06-27T16:02:41.1823096+08:00;True|2022-06-27T15:43:51.5116456+08:00;True|2022-06-27T15:23:40.6693098+08:00;True|2022-06-27T15:22:19.3671271+08:00;True|2022-06-27T14:41:57.2976612+08:00;True|2022-06-27T14:33:00.0677612+08:00;True|2022-06-27T14:24:08.5216447+08:00;True|2022-06-27T14:02:02.8566739+08:00;True|2022-06-27T09:23:01.1910441+08:00;True|2022-06-24T10:33:51.1549131+08:00;True|2022-06-24T09:59:03.2881122+08:00;True|2022-06-24T09:15:37.5422200+08:00;True|2022-06-23T15:11:47.3175395+08:00;True|2022-06-17T09:45:32.1714267+08:00;True|2022-06-16T17:03:22.3921843+08:00;True|2022-06-16T15:35:33.2295367+08:00;True|2022-06-16T15:21:17.5490522+08:00;True|2022-06-16T14:53:00.4693599+08:00;True|2022-06-10T14:25:18.7355725+08:00;True|2022-06-09T18:13:39.8032757+08:00;True|2022-06-09T17:57:35.8696074+08:00;True|2022-06-01T17:48:15.4107624+08:00;True|2022-05-31T16:09:22.2674554+08:00;True|2022-05-31T14:15:19.3700456+08:00;True|2022-05-18T09:06:11.5118231+08:00;True|2022-05-17T16:08:22.9679914+08:00;True|2022-02-07T09:32:52.8608715+08:00;True|2022-01-29T15:30:35.5581322+08:00;True|2022-01-29T15:13:03.4191677+08:00;True|2022-01-29T14:52:16.3700211+08:00;True|2022-01-29T14:48:59.8000767+08:00;True|2022-01-29T14:45:14.4545309+08:00;True|2022-01-29T14:38:57.6540259+08:00;True|2022-01-29T13:36:16.2370205+08:00;True|2022-01-29T11:46:45.8432136+08:00;True|2022-01-29T11:20:54.2763765+08:00;True|2022-01-29T11:16:23.0172880+08:00;True|2022-01-29T11:06:15.3648999+08:00;True|2022-01-29T11:00:39.8926536+08:00;True|2022-01-28T14:35:21.7742884+08:00;True|2022-01-28T13:44:47.5005402+08:00; + <_PublishTargetUrl>D:\Code\djyweb_ams\web\djy.WebApi\bin\publish\net5 + True|2024-04-03T01:23:32.8437777Z;True|2024-02-20T08:48:34.1425408+08:00;True|2023-06-16T09:09:45.1637530+08:00;True|2023-06-15T17:35:47.2298327+08:00;True|2022-10-24T13:58:36.8728872+08:00;True|2022-10-11T17:36:04.7506103+08:00;True|2022-09-29T09:16:51.0738556+08:00;True|2022-09-29T09:12:44.1994050+08:00;True|2022-09-29T09:05:28.1343572+08:00;True|2022-09-28T17:22:24.8692737+08:00;True|2022-09-28T16:15:13.4883777+08:00;True|2022-09-28T10:59:23.5270093+08:00;True|2022-08-31T10:01:14.0996702+08:00;True|2022-08-29T11:10:30.2643117+08:00;True|2022-08-29T10:55:49.0496591+08:00;True|2022-08-16T10:30:57.6816257+08:00;True|2022-08-15T17:50:55.2965000+08:00;True|2022-08-12T18:07:20.4848662+08:00;True|2022-08-12T17:46:41.1829405+08:00;True|2022-08-12T15:08:58.5925841+08:00;True|2022-07-20T16:18:49.1737260+08:00;True|2022-07-14T13:44:55.2043481+08:00;True|2022-07-13T10:21:13.3628429+08:00;True|2022-07-12T15:45:11.4672604+08:00;True|2022-07-12T10:48:29.8013532+08:00;True|2022-07-04T09:32:18.4540585+08:00;True|2022-07-01T17:34:50.7575127+08:00;True|2022-07-01T15:51:14.9076477+08:00;True|2022-06-30T15:06:12.0032112+08:00;True|2022-06-30T15:05:33.2540874+08:00;True|2022-06-30T10:26:41.3365814+08:00;True|2022-06-30T09:56:20.9021741+08:00;True|2022-06-30T08:53:10.0864638+08:00;True|2022-06-29T17:05:03.3034364+08:00;True|2022-06-29T16:50:10.1873653+08:00;True|2022-06-29T16:32:36.1524378+08:00;True|2022-06-29T15:56:09.9746651+08:00;True|2022-06-29T10:56:16.8088978+08:00;True|2022-06-29T08:54:20.5334051+08:00;True|2022-06-28T19:41:08.7023145+08:00;True|2022-06-28T19:26:28.7000486+08:00;True|2022-06-28T19:14:38.4827828+08:00;True|2022-06-28T18:56:21.8997711+08:00;True|2022-06-28T17:46:58.3643830+08:00;True|2022-06-28T17:10:20.1461539+08:00;True|2022-06-28T16:09:53.0805413+08:00;True|2022-06-28T15:52:30.2951989+08:00;True|2022-06-28T11:01:29.3265564+08:00;True|2022-06-28T10:35:04.6353020+08:00;True|2022-06-28T10:25:10.0426356+08:00;True|2022-06-28T10:22:28.8860296+08:00;True|2022-06-28T10:10:33.8758083+08:00;True|2022-06-28T10:03:21.1254163+08:00;True|2022-06-28T09:15:06.8911689+08:00;True|2022-06-27T17:07:03.5262846+08:00;True|2022-06-27T16:51:26.5898864+08:00;True|2022-06-27T16:28:43.2026298+08:00;True|2022-06-27T16:28:18.9494990+08:00;True|2022-06-27T16:27:16.7453474+08:00;True|2022-06-27T16:18:19.4634998+08:00;True|2022-06-27T16:02:41.1823096+08:00;True|2022-06-27T15:43:51.5116456+08:00;True|2022-06-27T15:23:40.6693098+08:00;True|2022-06-27T15:22:19.3671271+08:00;True|2022-06-27T14:41:57.2976612+08:00;True|2022-06-27T14:33:00.0677612+08:00;True|2022-06-27T14:24:08.5216447+08:00;True|2022-06-27T14:02:02.8566739+08:00;True|2022-06-27T09:23:01.1910441+08:00;True|2022-06-24T10:33:51.1549131+08:00;True|2022-06-24T09:59:03.2881122+08:00;True|2022-06-24T09:15:37.5422200+08:00;True|2022-06-23T15:11:47.3175395+08:00;True|2022-06-17T09:45:32.1714267+08:00;True|2022-06-16T17:03:22.3921843+08:00;True|2022-06-16T15:35:33.2295367+08:00;True|2022-06-16T15:21:17.5490522+08:00;True|2022-06-16T14:53:00.4693599+08:00;True|2022-06-10T14:25:18.7355725+08:00;True|2022-06-09T18:13:39.8032757+08:00;True|2022-06-09T17:57:35.8696074+08:00;True|2022-06-01T17:48:15.4107624+08:00;True|2022-05-31T16:09:22.2674554+08:00;True|2022-05-31T14:15:19.3700456+08:00;True|2022-05-18T09:06:11.5118231+08:00;True|2022-05-17T16:08:22.9679914+08:00;True|2022-02-07T09:32:52.8608715+08:00;True|2022-01-29T15:30:35.5581322+08:00;True|2022-01-29T15:13:03.4191677+08:00;True|2022-01-29T14:52:16.3700211+08:00;True|2022-01-29T14:48:59.8000767+08:00;True|2022-01-29T14:45:14.4545309+08:00;True|2022-01-29T14:38:57.6540259+08:00;True|2022-01-29T13:36:16.2370205+08:00;True|2022-01-29T11:46:45.8432136+08:00;True|2022-01-29T11:20:54.2763765+08:00;True|2022-01-29T11:16:23.0172880+08:00;True|2022-01-29T11:06:15.3648999+08:00;True|2022-01-29T11:00:39.8926536+08:00;True|2022-01-28T14:35:21.7742884+08:00; \ No newline at end of file diff --git a/web/djy.WebApi/djy_AmsApi.csproj.user b/web/djy.WebApi/djy_AmsApi.csproj.user index c20dfe8..87d8bc0 100644 --- a/web/djy.WebApi/djy_AmsApi.csproj.user +++ b/web/djy.WebApi/djy_AmsApi.csproj.user @@ -3,7 +3,7 @@ MvcControllerEmptyScaffolder root/Common/MVC/Controller - D:\DJY\Code\djyweb_ams\web\djy.WebApi\Properties\PublishProfiles\FolderProfile.pubxml + D:\Code\djyweb_ams\web\djy.WebApi\Properties\PublishProfiles\FolderProfile.pubxml djy_AmsApi diff --git a/web/djy_AfrApi/Program.cs b/web/djy_AfrApi/Program.cs index 189463d..4058f12 100644 --- a/web/djy_AfrApi/Program.cs +++ b/web/djy_AfrApi/Program.cs @@ -1,8 +1,10 @@ using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using NLog.Extensions.Logging; using NLog.Web; +using System; namespace djy_AfrApi { @@ -24,6 +26,15 @@ namespace djy_AfrApi //logging.SetMinimumLevel(LogLevel.Information); logging.AddConsole(); logging.AddDebug(); + }).ConfigureHostConfiguration(x => + { + // жϵǰǷΪ + if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Development") + { + x.Sources.Clear(); + x.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) + .AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}.json", optional: true, reloadOnChange: true); + } }).UseNLog(); } } diff --git a/web/djy_AfrApi/Properties/launchSettings.json b/web/djy_AfrApi/Properties/launchSettings.json index 1d46bbd..9e64f1b 100644 --- a/web/djy_AfrApi/Properties/launchSettings.json +++ b/web/djy_AfrApi/Properties/launchSettings.json @@ -1,6 +1,6 @@ { "profiles": { - "djy_AfrApi": { + "djy_AfrApi_测试环境": { "commandName": "Project", "launchUrl": "swagger", "environmentVariables": { @@ -8,13 +8,13 @@ }, "applicationUrl": "http://localhost:30818" }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, + "djy_AfrApi_正式环境": { + "commandName": "Project", "launchUrl": "swagger", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } + "ASPNETCORE_ENVIRONMENT": "Production" + }, + "applicationUrl": "http://localhost:30818" } }, "$schema": "http://json.schemastore.org/launchsettings.json", diff --git a/web/djy_AfrApi/appsettings.Production.json b/web/djy_AfrApi/appsettings.Production.json index 717e997..34c50b8 100644 --- a/web/djy_AfrApi/appsettings.Production.json +++ b/web/djy_AfrApi/appsettings.Production.json @@ -8,7 +8,7 @@ } }, "AllowedHosts": "*", - "Urls": "http://*:5012", + "Urls": "http://*:30818", "WebConfig": { "IdentServerUrl": "http://djy-identity.myshipping.net", "WebId": 236, @@ -23,13 +23,13 @@ "ConnName": "sqldb", "cache_time": 10, "WebHostUrl": "https://zh-userapi.jingyiji.net", - "Redis": "172.31.85.169:6379,defaultDatabase=9,", + "Redis": "127.0.0.1,defaultDatabase=9,", "RedisDb": "9", "Rbmq_Host": "172.31.85.169:13866", "Rbmq_UserName": "ams", "Rbmq_Password": "djy_ams", - "Rbmq_Sqlhost": "Data Source =172.31.85.154; Initial Catalog=djy_logs; Persist Security Info=True; User ID =sa; Password=QDdjy#2020*;pooling=true", - "DapperDbString": "Data Source =172.31.85.161; Initial Catalog=AMS; Persist Security Info=True; User ID =sa; Password=QDdjy#2020*;pooling=true;", + "Rbmq_Sqlhost": "Data Source =47.104.73.97,6761; Initial Catalog=djy_logs; Persist Security Info=True; User ID =sa; Password=QDdjy#2020*;pooling=true", + "DapperDbString": "Data Source =47.104.73.97,6762; Initial Catalog=AMS; Persist Security Info=True; User ID =sa; Password=QDdjy#2020*;pooling=true;", "requesterDea": "HWCDDS", "DataConnList": [ { @@ -38,7 +38,7 @@ "Index": 100, "DataType": 1, "Status": 0, - "ConnString": "Data Source=172.31.85.161; Initial Catalog=AMS; Persist Security Info=True; User ID =sa; Password=QDdjy#2020*;pooling=true;" + "ConnString": "Data Source=47.104.73.97,6762; Initial Catalog=AMS; Persist Security Info=True; User ID =sa; Password=QDdjy#2020*;pooling=true;" }, { "SysKey": "Common", @@ -46,7 +46,7 @@ "Index": 100, "DataType": 1, "Status": 0, - "ConnString": "Data Source=172.31.85.161; Initial Catalog=CommonDB; Persist Security Info=True; User ID =sa; Password=QDdjy#2020*;pooling=true;" + "ConnString": "Data Source=47.104.73.97,6762; Initial Catalog=CommonDB; Persist Security Info=True; User ID =sa; Password=QDdjy#2020*;pooling=true;" }, { "SysKey": "djydb", @@ -54,7 +54,7 @@ "Index": 100, "DataType": 1, "Status": 0, - "ConnString": "Data Source =172.31.85.154; Initial Catalog=DsPingTai; Persist Security Info=True; User ID =sa; Password=QDdjy#2020*;pooling=true" + "ConnString": "Data Source =47.104.73.97,6761; Initial Catalog=DsPingTai; Persist Security Info=True; User ID =sa; Password=QDdjy#2020*;pooling=true" }, { @@ -63,7 +63,7 @@ "Index": 100, "DataType": 1, "Status": 0, - "ConnString": "Data Source=172.31.85.154,1433; Initial Catalog=djy_logs; Persist Security Info=True; User ID =sa; Password=QDdjy#2020*;pooling=true" + "ConnString": "Data Source=47.104.73.97,6761,1433; Initial Catalog=djy_logs; Persist Security Info=True; User ID =sa; Password=QDdjy#2020*;pooling=true" } ] } diff --git a/web/djy_AfrApi/djy_AfrApi.csproj.user b/web/djy_AfrApi/djy_AfrApi.csproj.user index 83f85f6..df802be 100644 --- a/web/djy_AfrApi/djy_AfrApi.csproj.user +++ b/web/djy_AfrApi/djy_AfrApi.csproj.user @@ -3,7 +3,7 @@ ApiControllerEmptyScaffolder root/Common/Api - djy_AfrApi + djy_AfrApi_正式环境 D:\DJY\Code\djyweb_ams\web\djy_AfrApi\Properties\PublishProfiles\FolderProfile-linux.pubxml