diff --git a/web/djy.Model/AFR/AFRAddrTemplate.cs b/web/djy.Model/AFR/AFRAddrTemplate.cs index 8c2c748..171db3a 100644 --- a/web/djy.Model/AFR/AFRAddrTemplate.cs +++ b/web/djy.Model/AFR/AFRAddrTemplate.cs @@ -1,13 +1,11 @@ using djy.Model.AFR; using FreeSql.DataAnnotations; -using System; namespace djy.Model.Afr { [Table(Name = "AFR_AddrTemplate", DisableSyncStructure = true)] public class AFRAddrTemplate : AFRBaseModel { - /// /// 地址 /// @@ -18,6 +16,16 @@ namespace djy.Model.Afr /// public string City { get; set; } + /// + /// + /// + public string CompID { get; set; } + + /// + /// + /// + public string CompName { get; set; } + /// /// 联系人 /// @@ -43,9 +51,24 @@ namespace djy.Model.Afr /// public string Tel { get; set; } + /// + /// + /// + public string TemPlateName { get; set; } + /// /// 收发通类型 1:发货人 2:收货人 3:通知人 /// public byte? Type { get; set; } + + /// + /// + /// + public string UserID { get; set; } + + /// + /// + /// + public string UserName { 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 41191fe..c8c92be 100644 --- a/web/djy.Service/Afr/AfrService.cs +++ b/web/djy.Service/Afr/AfrService.cs @@ -639,9 +639,9 @@ namespace djy.Service.AFR p.PARAMNAME, p.PARAMVALUE }); - var afrUrl = paramSets.FirstOrDefault(p => p.PARAMNAME == "AFRURL").PARAMVALUE ?? throw new Exception("需要配置电子口岸AFR服务的接口地址:AFRURL"); - var afrAccount = paramSets.FirstOrDefault(p => p.PARAMNAME == "AFRAccount")?.PARAMVALUE ?? throw new Exception("需要配置用于请求电子口岸AFR服务的账户名:AFRAccount"); - var afrKey = paramSets.FirstOrDefault(p => p.PARAMNAME == "AFRKey")?.PARAMVALUE ?? throw new Exception("需要配置用于请求电子口岸AFR服务的密钥:AFRKey"); + var afrUrl = paramSets.FirstOrDefault(p => p.PARAMNAME == "AFRURL").PARAMVALUE ?? throw new Exception("需要配置AFR服务的接口地址:AFRURL"); + var afrAccount = paramSets.FirstOrDefault(p => p.PARAMNAME == "AFRAccount")?.PARAMVALUE ?? throw new Exception("需要配置用于请求AFR服务的账户名:AFRAccount"); + var afrKey = paramSets.FirstOrDefault(p => p.PARAMNAME == "AFRKey")?.PARAMVALUE ?? throw new Exception("需要配置用于请求AFR服务的密钥:AFRKey"); #endregion #region 根据不同的发送类型,使用不同的方式从库里查询要发送的数据 @@ -932,12 +932,12 @@ namespace djy.Service.AFR } else { - throw new Exception($"电子口岸接口返回失败结果(code:{code2},msg:{msg2})"); + throw new Exception($"接口返回失败结果(code:{code2},msg:{msg2})"); } } else { - throw new Exception($"电子口岸接口调用失败(msg:{msg})"); + throw new Exception($"接口调用失败(msg:{msg})"); } } catch (Exception ex) @@ -1084,12 +1084,12 @@ namespace djy.Service.AFR } else { - throw new Exception($"电子口岸接口返回失败结果(code:{code2},msg:{msg2})"); + throw new Exception($"接口返回失败结果(code:{code2},msg:{msg2})"); } } else { - throw new Exception($"电子口岸接口调用失败(msg:{msg})"); + throw new Exception($"接口调用失败(msg:{msg})"); } } catch (Exception ex) @@ -1136,8 +1136,7 @@ namespace djy.Service.AFR return; } - var update = DbAMS.Update() - .Set(h => h.NewNotice == input.content); + var update = DbAMS.Update(); // Accept、Warning、Reject、Matched、Hold、Cancel string statusDesc = string.Empty; @@ -1149,6 +1148,7 @@ namespace djy.Service.AFR break; case "Matched": update.Set(h => h.StateIsMatched == true); + update.Set(h => h.StateIsAccept == true); statusDesc = "已匹配"; break; case "Warning": statusDesc = "警告"; break; @@ -1157,6 +1157,7 @@ namespace djy.Service.AFR case "Cancel": statusDesc = "海关删除"; break; default: break; } + update.Set(h => h.NewNotice == statusDesc); // 更新AFRHouse的状态 await update.Where(h => h.GID == house.GID) @@ -1272,8 +1273,9 @@ namespace djy.Service.AFR { var data = await DbAMS.Select() .WhereIf(!string.IsNullOrEmpty(type), t => t.Type == Convert.ToByte(type)) - .WhereIf(!string.IsNullOrEmpty(name), t => t.Name.Contains(name)) - .OrderByDescending(t=>t.CreateTime) + .WhereIf(!string.IsNullOrEmpty(name), t => t.TemPlateName.Contains(name)) + .Where(t => t.UserID == User.GID) + .OrderByDescending(t => t.CreateTime) .ToListAsync(); return data; } @@ -1286,12 +1288,16 @@ namespace djy.Service.AFR input.GID = Guid.NewGuid().ToString(); input.LastUpdate = nowTime; input.CreateTime = nowTime; + input.UserID = User.GID; + input.UserName = User.ShowName; + input.CompID = User.CompId; + input.CompName = User.CompName; await DbAMS.Insert(input).ExecuteAffrowsAsync(); } else { - input.LastUpdate = nowTime; + input.LastUpdate = nowTime; await DbAMS.Update().SetSource(input).Where(t => t.GID == input.GID).ExecuteAffrowsAsync(); } diff --git a/web/djy_AfrApi/Controllers/AfrController.cs b/web/djy_AfrApi/Controllers/AfrController.cs index 934a06d..a5a049d 100644 --- a/web/djy_AfrApi/Controllers/AfrController.cs +++ b/web/djy_AfrApi/Controllers/AfrController.cs @@ -6,10 +6,12 @@ using djy.Model.AFRDto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Threading.Tasks; +using System.Web; namespace djy_AfrApi.Controllers { @@ -119,12 +121,14 @@ namespace djy_AfrApi.Controllers /// /// 接收回执 /// - /// + /// /// [AllowAnonymous] [HttpPost("Receipt")] - public async Task SaveReceiptAsync(AFRReceiptDto input) + public async Task SaveReceiptAsync([FromForm] string msg) { + msg = HttpUtility.UrlDecode(msg); + AFRReceiptDto input = JsonConvert.DeserializeObject(msg); await _afrService.SaveReceipt(input); return SuccessResp("接收成功"); } diff --git a/web/djy_AfrApi/Properties/PublishProfiles/FolderProfile-Windows.pubxml.user b/web/djy_AfrApi/Properties/PublishProfiles/FolderProfile-Windows.pubxml.user index 511c61a..c5a211c 100644 --- a/web/djy_AfrApi/Properties/PublishProfiles/FolderProfile-Windows.pubxml.user +++ b/web/djy_AfrApi/Properties/PublishProfiles/FolderProfile-Windows.pubxml.user @@ -6,7 +6,7 @@ <_PublishTargetUrl>D:\DJY\Code\djyweb_ams\web\djy_AfrApi\bin\Release\net5.0\publish-windows\ - True|2024-01-19T03:20:41.9920968Z;True|2024-01-08T15:50:46.8011898+08:00;True|2024-01-05T17:51:52.2695558+08:00;True|2024-01-05T17:04:21.5306695+08:00;True|2024-01-05T16:48:05.1050469+08:00;True|2024-01-05T15:13:30.4657789+08:00;True|2024-01-05T15:00:49.5985418+08:00;True|2024-01-05T13:48:06.1634940+08:00;True|2024-01-05T11:59:09.7697688+08:00;True|2024-01-05T11:33:19.2093394+08:00;True|2024-01-05T11:27:31.2454199+08:00;True|2024-01-05T11:20:20.5464568+08:00;True|2024-01-04T18:36:38.8259124+08:00;True|2024-01-04T15:54:57.9348895+08:00;True|2024-01-04T15:44:34.6535493+08:00;False|2024-01-04T15:44:20.9673752+08:00;True|2024-01-04T11:14:33.4379160+08:00;True|2024-01-03T21:54:40.3579096+08:00;True|2024-01-03T21:52:09.6604718+08:00;True|2024-01-03T16:04:13.6208067+08:00;True|2024-01-03T15:07:08.9376581+08:00;True|2024-01-02T10:57:59.7067270+08:00;True|2024-01-02T10:28:44.8223638+08:00;True|2023-12-29T17:26:12.9612280+08:00; + True|2024-01-25T02:01:36.0649321Z;True|2024-01-23T11:01:55.0706970+08:00;True|2024-01-19T13:34:45.2044545+08:00;True|2024-01-19T11:20:41.9920968+08:00;True|2024-01-08T15:50:46.8011898+08:00;True|2024-01-05T17:51:52.2695558+08:00;True|2024-01-05T17:04:21.5306695+08:00;True|2024-01-05T16:48:05.1050469+08:00;True|2024-01-05T15:13:30.4657789+08:00;True|2024-01-05T15:00:49.5985418+08:00;True|2024-01-05T13:48:06.1634940+08:00;True|2024-01-05T11:59:09.7697688+08:00;True|2024-01-05T11:33:19.2093394+08:00;True|2024-01-05T11:27:31.2454199+08:00;True|2024-01-05T11:20:20.5464568+08:00;True|2024-01-04T18:36:38.8259124+08:00;True|2024-01-04T15:54:57.9348895+08:00;True|2024-01-04T15:44:34.6535493+08:00;False|2024-01-04T15:44:20.9673752+08:00;True|2024-01-04T11:14:33.4379160+08:00;True|2024-01-03T21:54:40.3579096+08:00;True|2024-01-03T21:52:09.6604718+08:00;True|2024-01-03T16:04:13.6208067+08:00;True|2024-01-03T15:07:08.9376581+08:00;True|2024-01-02T10:57:59.7067270+08:00;True|2024-01-02T10:28:44.8223638+08:00;True|2023-12-29T17:26:12.9612280+08:00; \ No newline at end of file diff --git a/web/djy_AfrApi/Properties/PublishProfiles/FolderProfile-linux.pubxml b/web/djy_AfrApi/Properties/PublishProfiles/FolderProfile-linux.pubxml new file mode 100644 index 0000000..d93a585 --- /dev/null +++ b/web/djy_AfrApi/Properties/PublishProfiles/FolderProfile-linux.pubxml @@ -0,0 +1,22 @@ + + + + + true + false + true + Release + Any CPU + FileSystem + bin\Release\net5.0\publish-linux\ + FileSystem + <_TargetId>Folder + + net5.0 + linux-x64 + e798a4ec-13e8-4681-8db7-cb9f3c32a3ee + false + + \ No newline at end of file diff --git a/web/djy_AfrApi/Properties/PublishProfiles/FolderProfile-linux.pubxml.user b/web/djy_AfrApi/Properties/PublishProfiles/FolderProfile-linux.pubxml.user new file mode 100644 index 0000000..f33a355 --- /dev/null +++ b/web/djy_AfrApi/Properties/PublishProfiles/FolderProfile-linux.pubxml.user @@ -0,0 +1,11 @@ + + + + + <_PublishTargetUrl>D:\DJY\Code\djyweb_ams\web\djy_AfrApi\bin\Release\net5.0\publish-linux\ + True|2024-01-29T06:55:22.3697340Z;True|2024-01-26T15:18:26.3618341+08:00;True|2024-01-26T14:55:05.3552141+08:00;True|2024-01-25T17:09:15.3482577+08:00;False|2024-01-25T17:08:55.2779489+08:00;True|2024-01-25T16:46:48.0925564+08:00; + + + \ No newline at end of file diff --git a/web/djy_AfrApi/appsettings.Production.json b/web/djy_AfrApi/appsettings.Production.json index 565515e..717e997 100644 --- a/web/djy_AfrApi/appsettings.Production.json +++ b/web/djy_AfrApi/appsettings.Production.json @@ -8,7 +8,7 @@ } }, "AllowedHosts": "*", - "Urls": "http://*:待配置待配置待配置待配置待配置待配置待配置待配置", + "Urls": "http://*:5012", "WebConfig": { "IdentServerUrl": "http://djy-identity.myshipping.net", "WebId": 236, @@ -23,14 +23,14 @@ "ConnName": "sqldb", "cache_time": 10, "WebHostUrl": "https://zh-userapi.jingyiji.net", - "Redis": "172.31.85.169:6379,defaultDatabase=待配置待配置待配置待配置待配置待配置待配置待配置,", - "RedisDb": "待配置待配置待配置待配置待配置待配置待配置待配置待配置待配置待配置待配置待配置待配置待配置待配置", + "Redis": "172.31.85.169:6379,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;", - "requesterDea": "待配置待配置待配置待配置待配置待配置待配置待配置待配置待配置待配置待配置待配置待配置待配置待配置", + "requesterDea": "HWCDDS", "DataConnList": [ { "SysKey": "AMS", diff --git a/web/djy_AfrApi/djy_AfrApi.csproj.user b/web/djy_AfrApi/djy_AfrApi.csproj.user index a281873..83f85f6 100644 --- a/web/djy_AfrApi/djy_AfrApi.csproj.user +++ b/web/djy_AfrApi/djy_AfrApi.csproj.user @@ -4,7 +4,7 @@ ApiControllerEmptyScaffolder root/Common/Api djy_AfrApi - D:\DJY\Code\djyweb_ams\web\djy_AfrApi\Properties\PublishProfiles\FolderProfile-Windows.pubxml + D:\DJY\Code\djyweb_ams\web\djy_AfrApi\Properties\PublishProfiles\FolderProfile-linux.pubxml ProjectDebugger