AFR日志记录功能测试

master
zhangxiaofeng 7 months ago
parent b6c9f28bc6
commit cd812a9d4d

@ -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
/// </summary>
public class AFRRequestDto
{
[LogProperty("主单信息")]
public MasterBillInfo masterBillInfo { get; set; }
[LogProperty("分单信息")]
public List<HouseBillInfo> houseBillInfoList { get; set; }
}
public class MasterBillInfo
@ -16,85 +19,102 @@ namespace djy.Model.AFRDto
/// <summary>
/// 船东提单号
/// </summary>
[LogProperty("船东提单号")]
public string masterBillNo { get; set; }
/// <summary>
/// 船东单运编号(选填)
/// </summary>
[LogProperty("船东单运编号")]
public string shippingNo { get; set; }
/// <summary>
/// 运输条款代码
/// </summary>
[LogProperty("运输条款代码")]
public string clause { get; set; }
/// <summary>
/// 整箱/拼箱 FCL整箱 LCL拼箱
/// </summary>
[LogProperty("整箱/拼箱")]
public string consignmentType { get; set; }
/// <summary>
/// 卸货港全称
/// </summary>
[LogProperty("卸货港全称")]
public string dischargeHarbour { get; set; }
/// <summary>
/// 卸货港五字码
/// </summary>
[LogProperty("卸货港五字码")]
public string dischargeHarbourCode { get; set; }
/// <summary>
/// 预计到达日期
/// </summary>
[LogProperty("预计到达日期")]
public DateTime? estimatedArrivalTime { get; set; }
/// <summary>
/// 申报运输类型
/// </summary>
[LogProperty("申报运输类型")]
public string filingType { get; set; }
/// <summary>
/// 交货地全称条件申报运输类型Tranship时必填
/// </summary>
[LogProperty("交货地全称")]
public string lastForeignHarbour { get; set; }
/// <summary>
/// 交货地五字码条件申报运输类型Tranship时必填
/// </summary>
[LogProperty("交货地五字码")]
public string lastForeignHarbourCode { get; set; }
/// <summary>
/// 预计开船日期
/// </summary>
[LogProperty("预计开船日期")]
public DateTime? loadDate { get; set; }
/// <summary>
/// 装货港全称
/// </summary>
[LogProperty("装货港全称")]
public string loadHarbour { get; set; }
/// <summary>
/// 装货港五字码
/// </summary>
[LogProperty("装货港五字码")]
public string loadHarbourCode { get; set; }
/// <summary>
/// 船司MapName
/// </summary>
[LogProperty("船司")]
public string shipCompany { get; set; }
/// <summary>
///
/// </summary>
[LogProperty("船名")]
public string vessel { get; set; }
/// <summary>
///
/// </summary>
[LogProperty("航次")]
public string voyage { get; set; }
/// <summary>
/// 发送方DEA CARGOEDI账号联系运营人员配置
/// </summary>
[LogProperty(null, Readable = false)]
public string requesterDea { get; set; }
}
public class HouseBillInfo
@ -102,128 +122,154 @@ namespace djy.Model.AFRDto
/// <summary>
/// 货代提单号唯一编号 同货代提单号,原始修改删除重发报文,该值要一致
/// </summary>
[LogProperty("货代提单号唯一编号")]
public string businessId { get; set; }
/// <summary>
/// 货代单运编号(选填)
/// </summary>
[LogProperty("货代单运编号")]
public string shippingNo { get; set; }
/// <summary>
/// 货代提单号 修改报文,该值不可以变更
/// </summary>
[LogProperty("货代提单号")]
public string houseBillNo { get; set; }
/// <summary>
/// 通知人地址
/// </summary>
[LogProperty("通知人地址")]
public string notifyAddress { get; set; }
/// <summary>
/// 通知人城市
/// </summary>
[LogProperty("通知人城市")]
public string notifyCity { get; set; }
/// <summary>
/// 通知人联系人
/// </summary>
[LogProperty("通知人联系人")]
public string notifyContact { get; set; }
/// <summary>
/// 通知人国家
/// </summary>
[LogProperty("通知人国家")]
public string notifyCountry { get; set; }
/// <summary>
/// 通知人国家代码
/// </summary>
[LogProperty("通知人国家代码")]
public string notifyCountryCode { get; set; }
/// <summary>
/// 通知人名称
/// </summary>
[LogProperty("通知人名称")]
public string notifyName { get; set; }
/// <summary>
/// 通知人联系人电话
/// </summary>
[LogProperty("通知人联系人电话")]
public string notifyTel { get; set; }
/// <summary>
/// 收货人地址
/// </summary>
[LogProperty("收货人地址")]
public string receiveAddress { get; set; }
/// <summary>
/// 收货人城市
/// </summary>
[LogProperty("收货人城市")]
public string receiveCity { get; set; }
/// <summary>
/// 收货人联系人
/// </summary>
[LogProperty("收货人联系人")]
public string receiveContact { get; set; }
/// <summary>
/// 收货人国家
/// </summary>
[LogProperty("收货人国家")]
public string receiveCountry { get; set; }
/// <summary>
/// 收货人国家代码
/// </summary>
[LogProperty("收货人国家代码")]
public string receiveCountryCode { get; set; }
/// <summary>
/// 收货人名称
/// </summary>
[LogProperty("收货人名称")]
public string receiveName { get; set; }
/// <summary>
/// 收货人联系人电话
/// </summary>
[LogProperty("收货人联系人电话")]
public string receiveTel { get; set; }
/// <summary>
/// 发货人地址
/// </summary>
[LogProperty("发货人地址")]
public string sendAddress { get; set; }
/// <summary>
/// 发货人城市
/// </summary>
[LogProperty("发货人城市")]
public string sendCity { get; set; }
/// <summary>
/// 发货人联系人
/// </summary>
[LogProperty("发货人联系人")]
public string sendContact { get; set; }
/// <summary>
/// 发货人国家
/// </summary>
[LogProperty("发货人国家")]
public string sendCountry { get; set; }
/// <summary>
/// 发货人国家代码
/// </summary>
[LogProperty("发货人国家代码")]
public string sendCountryCode { get; set; }
/// <summary>
/// 发货人名称
/// </summary>
[LogProperty("发货人名称")]
public string sendName { get; set; }
/// <summary>
/// 发货人联系人电话
/// </summary>
[LogProperty("发货人联系人电话")]
public string sendTel { get; set; }
//public List<CtnInfo> ctnInfo { get; set; }
[LogProperty("箱信息")]
public CtnInfo ctnInfo { get; set; }
}
public class CtnInfo
{
[LogProperty("箱信息列表")]
public List<InsertList> insertList { get; set; }
}
public class InsertList
@ -231,100 +277,120 @@ namespace djy.Model.AFRDto
/// <summary>
/// 货主箱标志
/// </summary>
[LogProperty("货主箱标志")]
public string containerMark { get; set; }
/// <summary>
/// 箱号
/// </summary>
[LogProperty("箱号")]
public string containerNo { get; set; }
/// <summary>
/// 箱型
/// </summary>
[LogProperty("箱型")]
public string containerType { get; set; }
/// <summary>
/// 危品联系人(选填)
/// </summary>
[LogProperty("危品联系人")]
public string dangerContact { get; set; }
/// <summary>
/// 危品联系人电话(选填)
/// </summary>
[LogProperty("危品联系人电话")]
public string dangerContactTel { get; set; }
/// <summary>
/// 危品等级(条件必填)
/// </summary>
[LogProperty("危品等级")]
public string dangerGrade { get; set; }
/// <summary>
/// 危品备注(选填)
/// </summary>
[LogProperty("危品备注")]
public string dangerMemo { get; set; }
/// <summary>
/// 件数
/// </summary>
[LogProperty("件数")]
public string digit { get; set; }
/// <summary>
/// 品名
/// </summary>
[LogProperty("品名")]
public string enProductName { get; set; }
/// <summary>
/// 毛重
/// </summary>
[LogProperty("毛重")]
public string grossWeight { get; set; }
/// <summary>
/// HSCode
/// </summary>
[LogProperty("HSCode")]
public string hscode { get; set; }
/// <summary>
/// 燃点,摄氏度(选填)
/// </summary>
[LogProperty("燃点")]
public string ignite { get; set; }
/// <summary>
/// 原产国(选填)
/// </summary>
[LogProperty("原产国")]
public string originCountry { get; set; }
/// <summary>
/// 原产国国家代码(选填)
/// </summary>
[LogProperty("原产国国家代码")]
public string originCountryCode { get; set; }
/// <summary>
/// 包装
/// </summary>
[LogProperty("包装")]
public string packing { get; set; }
/// <summary>
/// 包装代码
/// </summary>
[LogProperty("包装代码")]
public string packingCode { get; set; }
/// <summary>
/// 封号
/// </summary>
[LogProperty("封号")]
public string sealNo { get; set; }
/// <summary>
/// 唛头
/// </summary>
[LogProperty("唛头")]
public string shippingMark { get; set; }
/// <summary>
/// UN CODE条件必填
/// </summary>
[LogProperty("UN CODE")]
public string unCode { get; set; }
/// <summary>
/// 体积
/// </summary>
[LogProperty("体积")]
public string volume { get; set; }
}
}

@ -0,0 +1,35 @@
using System;
namespace djy.Model.Attributes
{
/// <summary>
/// 用于格式化日志输出的属性
/// </summary>
[AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = false)]
public class LogPropertyAttribute : Attribute
{
/// <summary>
/// 反序列化时要读取的属性名称
/// </summary>
public string ReadName { get; set; }
/// <summary>
/// 序列化时要写入的属性名称
/// </summary>
public string WriteName { get; set; }
/// <summary>
/// 是否可读
/// </summary>
public bool Readable { get; set; }
/// <summary>
/// 是否可写
/// </summary>
public bool Writable { get; set; }
public LogPropertyAttribute(string writeName)
{
Readable = true;
Writable = true;
WriteName = writeName;
}
}
}

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

@ -0,0 +1,17 @@
using FreeSql.DataAnnotations;
namespace djy.Model
{
/// <summary>
///
/// </summary>
[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; }
}
}

@ -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;
@ -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();
}
@ -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
@ -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
/// 保存操作历史或回执接收历史
/// </summary>
/// <param name="mid">主单主键</param>
/// <param name="hids">分单主键列表</param>
/// <param name="houseList">分单列表</param>
/// <param name="state">状态</param>
/// <param name="type">0人工操作历史1回执接收历史</param>
/// <param name="remark"></param>
/// <param name="requestLog">请求的详细日志内容</param>
/// <param name="tran"></param>
/// <returns></returns>
private async Task SaveHistoryAsync(string mid, IEnumerable<AFRHouse> houseList, string state, int type, string remark, DbTransaction tran = null)
{
List<AFRMasterHistory> list = new(houseList.Count());
private async Task SaveHistoryAsync(string mid,
IEnumerable<AFRHouse> houseList,
string state,
int type,
string remark,
string requestLog = null,
DbTransaction tran = null)
{
List<AFRMasterHistory> historyList = new(houseList.Count());
List<HistoryDetail> 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();
}
}

@ -4,8 +4,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_PublishTargetUrl>D:\DJY\Code\djyweb_ams\web\djy.WebApi\bin\publish\net5</_PublishTargetUrl>
<History>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;</History>
<_PublishTargetUrl>D:\Code\djyweb_ams\web\djy.WebApi\bin\publish\net5</_PublishTargetUrl>
<History>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;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

@ -3,7 +3,7 @@
<PropertyGroup>
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
<NameOfLastUsedPublishProfile>D:\DJY\Code\djyweb_ams\web\djy.WebApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<NameOfLastUsedPublishProfile>D:\Code\djyweb_ams\web\djy.WebApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<ActiveDebugProfile>djy_AmsApi</ActiveDebugProfile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

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

@ -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",

@ -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"
}
]
}

@ -3,7 +3,7 @@
<PropertyGroup>
<Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common/Api</Controller_SelectedScaffolderCategoryPath>
<ActiveDebugProfile>djy_AfrApi</ActiveDebugProfile>
<ActiveDebugProfile>djy_AfrApi_正式环境</ActiveDebugProfile>
<NameOfLastUsedPublishProfile>D:\DJY\Code\djyweb_ams\web\djy_AfrApi\Properties\PublishProfiles\FolderProfile-linux.pubxml</NameOfLastUsedPublishProfile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

Loading…
Cancel
Save