gwbvipvip před 8 měsíci
rodič
revize
63bd50a4eb
4 změnil soubory, kde provedl 25 přidání a 14 odebrání
  1. +1
    -1
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/CheckService/Services/CheckServices.cs
  2. +15
    -10
      BPA.SAAS.Manage.Application/AExternalPlatform/Service/Material/Services/MaterialService.cs
  3. +2
    -0
      BPA.SAAS.Manage.Core/System/BPA_ThirdpartyRequestLog.cs
  4. +7
    -3
      BPA.SAAS.Manage.Web.Core/Handlers/RequestAuditFiltercs.cs

+ 1
- 1
BPA.SAAS.Manage.Application/AExternalPlatform/Service/CheckService/Services/CheckServices.cs Zobrazit soubor

@@ -29,7 +29,7 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.CheckService.Ser
await CheckKey(key);

var thisSign = signStr + "&" + key;
var vvv = MD5Encryption.Encrypt(thisSign.ToUpper()).ToUpper();

if (MD5Encryption.Encrypt(thisSign.ToUpper()).ToUpper() != signMd5.ToUpper())
{


+ 15
- 10
BPA.SAAS.Manage.Application/AExternalPlatform/Service/Material/Services/MaterialService.cs Zobrazit soubor

@@ -139,15 +139,22 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Service
/// <returns></returns>
public async Task<bool> DelMaterial(BaseRequestDto<DelMaterialDto> inputDto)
{

var materialData = await SqlSugarDb.Db.Queryable<BPA_Batching>().FirstAsync(x => x.Id == inputDto.DataInfo.MaterialId);
if (materialData == null)
try
{
var materialData = await SqlSugarDb.Db.Queryable<BPA_Batching>().FirstAsync(x => x.Id == inputDto.DataInfo.MaterialId);
if (materialData == null)
{
throw Oops.Oh(ErrorCodeEnum.Code1003);
}
var res = await SqlSugarDb.Db.Deleteable(materialData).ExecuteCommandAsync();
return res > 0;
}
catch (Exception e)
{
throw Oops.Oh(ErrorCodeEnum.Code1003);
throw Oops.Oh(e.Message);
}
var res = await SqlSugarDb.Db.Deleteable(materialData).ExecuteCommandAsync();
return res > 0;
}

/// <summary>
@@ -194,8 +201,6 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Service
if (materialData == null)
{
throw Oops.Oh(ErrorCodeEnum.Code1003);


}
else
{
@@ -225,7 +230,7 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Material.Service
catch (Exception e)
{
SqlSugarDb.Db.Ado.RollbackTran();
throw Oops.Oh(ErrorCodeEnum.Code1001);
throw Oops.Oh(e.Message);
}
}
}


+ 2
- 0
BPA.SAAS.Manage.Core/System/BPA_ThirdpartyRequestLog.cs Zobrazit soubor

@@ -23,6 +23,8 @@ namespace BPA.SAAS.Manage.Core.System

public string ResultParm { get; set; }

public string ReauestParm { get; set; }

public string IP { get; set; }
}
}

+ 7
- 3
BPA.SAAS.Manage.Web.Core/Handlers/RequestAuditFiltercs.cs Zobrazit soubor

@@ -55,10 +55,12 @@ namespace BPA.SAAS.Manage.Web.Core
// 获取请求的方法
var method = actionDescriptor.MethodInfo;

// 获取请求参数(写入日志,需序列化成字符串后存储)
var parameters = context.ActionArguments;

if (requestUrl.ToUpper().Contains("ExternalPlatform".ToUpper()))
{
// 获取请求参数(写入日志,需序列化成字符串后存储)
var parameters = context.ActionArguments;
var key= httpRequest.Headers["key"];
var sign= httpRequest.Headers["sign"];
List<PropertyInfo> proplist = new List<PropertyInfo>();
@@ -84,11 +86,13 @@ namespace BPA.SAAS.Manage.Web.Core
{
await SqlSugarDb.Db.Insertable(new BPA_ThirdpartyRequestLog()
{
Id=Guid.NewGuid().ToString(),
CreateBy = DateTime.Now.ToString(),
GroupId = CurrentUser.GroupId,
RequestUrl = requestUrl,
ReauestMethod = httpRequest.Method,
ResultParm = returnResult == null ? "" : JsonConvert.SerializeObject(returnResult),
ReauestParm= JsonConvert.SerializeObject(parameters),
ResultParm = !isRequestSucceed? actionContext.Exception.ToString() : JsonConvert.SerializeObject(returnResult),
IP = remoteIPv4
}).ExecuteCommandAsync();



Načítá se…
Zrušit
Uložit