累积调整

master
zhangxiaofeng 10 months ago
parent 038d3b6a8c
commit e076e58132

@ -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
{
/// <summary>
/// 地址
/// </summary>
@ -18,6 +16,16 @@ namespace djy.Model.Afr
/// </summary>
public string City { get; set; }
/// <summary>
///
/// </summary>
public string CompID { get; set; }
/// <summary>
///
/// </summary>
public string CompName { get; set; }
/// <summary>
/// 联系人
/// </summary>
@ -43,9 +51,24 @@ namespace djy.Model.Afr
/// </summary>
public string Tel { get; set; }
/// <summary>
///
/// </summary>
public string TemPlateName { get; set; }
/// <summary>
/// 收发通类型 1:发货人 2:收货人 3:通知人
/// </summary>
public byte? Type { get; set; }
/// <summary>
///
/// </summary>
public string UserID { get; set; }
/// <summary>
///
/// </summary>
public string UserName { get; set; }
}
}

@ -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<AFRHouse>()
.Set(h => h.NewNotice == input.content);
var update = DbAMS.Update<AFRHouse>();
// 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<AFRAddrTemplate>()
.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<AFRAddrTemplate>().SetSource(input).Where(t => t.GID == input.GID).ExecuteAffrowsAsync();
}

@ -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
/// <summary>
/// 接收回执
/// </summary>
/// <param name="input"></param>
/// <param name="msg"></param >
/// <returns></returns>
[AllowAnonymous]
[HttpPost("Receipt")]
public async Task<Response> SaveReceiptAsync(AFRReceiptDto input)
public async Task<Response> SaveReceiptAsync([FromForm] string msg)
{
msg = HttpUtility.UrlDecode(msg);
AFRReceiptDto input = JsonConvert.DeserializeObject<AFRReceiptDto>(msg);
await _afrService.SaveReceipt(input);
return SuccessResp("接收成功");
}

@ -6,7 +6,7 @@
<Project>
<PropertyGroup>
<_PublishTargetUrl>D:\DJY\Code\djyweb_ams\web\djy_AfrApi\bin\Release\net5.0\publish-windows\</_PublishTargetUrl>
<History>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;</History>
<History>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;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<DeleteExistingFiles>true</DeleteExistingFiles>
<ExcludeApp_Data>false</ExcludeApp_Data>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>bin\Release\net5.0\publish-linux\</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<_TargetId>Folder</_TargetId>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>net5.0</TargetFramework>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
<ProjectGuid>e798a4ec-13e8-4681-8db7-cb9f3c32a3ee</ProjectGuid>
<SelfContained>false</SelfContained>
</PropertyGroup>
</Project>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<_PublishTargetUrl>D:\DJY\Code\djyweb_ams\web\djy_AfrApi\bin\Release\net5.0\publish-linux\</_PublishTargetUrl>
<History>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;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

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

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

Loading…
Cancel
Save