Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
20df19c5
Commit
20df19c5
authored
Dec 13, 2024
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
dfb73b51
4935a06b
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
49 additions
and
109 deletions
+49
-109
Config.cs
Mall.Common/Config.cs
+1
-0
RB_Building_CarrierRepository.cs
...Repository/TradePavilion/RB_Building_CarrierRepository.cs
+1
-4
OssService.cs
Mall.ThirdCore/Oss/OssService.cs
+2
-2
TencentOss.cs
Mall.ThirdCore/Oss/TencentOss.cs
+11
-4
FileController.cs
Mall.WebApi/Controllers/File/FileController.cs
+2
-1
TradeController.cs
Mall.WebApi/Controllers/TradePavilion/TradeController.cs
+8
-3
YBTradeController.cs
Mall.WebApi/Controllers/TradePavilion/YBTradeController.cs
+1
-72
TenantController.cs
Mall.WebApi/Controllers/User/TenantController.cs
+18
-21
appsettings.json
Mall.WebApi/appsettings.json
+3
-1
UploadHelper.cs
TestCore/UploadHelper.cs
+2
-1
No files found.
Mall.Common/Config.cs
View file @
20df19c5
...
...
@@ -838,6 +838,7 @@ namespace Mall.Common
ossObj
[
"accessKeyId"
]
=
ReadConfigKey
(
"tencentOSS"
,
"accessKeyId"
);
ossObj
[
"accessKeySecret"
]
=
ReadConfigKey
(
"tencentOSS"
,
"accessKeySecret"
);
ossObj
[
"domain"
]
=
ReadConfigKey
(
"tencentOSS"
,
"domain"
);
ossObj
[
"fileStoragePath"
]
=
ReadConfigKey
(
"tencentOSS"
,
"fileStoragePath"
);
return
ossObj
;
}
}
...
...
Mall.Repository/TradePavilion/RB_Building_CarrierRepository.cs
View file @
20df19c5
...
...
@@ -133,10 +133,7 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND A.{0} in ({1}) "
,
nameof
(
RB_Building_Carrier_Extend
.
ID
),
query
.
SelectIds
);
}
//if (query.BuildingCarrierType > 0)
//{
// builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Building_Carrier_Extend.BuildingCarrierType), query.BuildingCarrierType);
//}
if
(!
string
.
IsNullOrEmpty
(
query
.
CarrierName
))
{
builder
.
AppendFormat
(
" AND A.{0} LIKE @CarrierName "
,
nameof
(
RB_Building_Carrier_Extend
.
CarrierName
));
...
...
Mall.ThirdCore/Oss/OssService.cs
View file @
20df19c5
...
...
@@ -8,9 +8,9 @@ namespace Mall.ThirdCore.Oss
/// 创建上传实例
/// </summary>
/// <returns></returns>
public
static
IOssService
GetTencent
(
string
endpoint
=
null
,
string
accessKeyId
=
null
,
string
accessKeySecret
=
null
,
string
bucketName
=
null
)
public
static
IOssService
GetTencent
(
string
endpoint
=
null
,
string
accessKeyId
=
null
,
string
accessKeySecret
=
null
,
string
bucketName
=
null
,
string
fileStoragePath
=
null
)
{
return
TencentOss
.
Instance
(
endpoint
,
accessKeyId
,
accessKeySecret
,
bucketName
);
return
TencentOss
.
Instance
(
endpoint
,
accessKeyId
,
accessKeySecret
,
bucketName
,
fileStoragePath
);
}
/// <summary>
...
...
Mall.ThirdCore/Oss/TencentOss.cs
View file @
20df19c5
...
...
@@ -20,6 +20,10 @@ namespace Mall.ThirdCore.Oss
private
string
accessKeyId
=
""
;
private
string
accessKeySecret
=
""
;
private
string
bucketName
=
""
;
/// <summary>
/// 文件存储位置
/// </summary>
private
string
fileStoragePath
=
""
;
/// <summary>
/// 构造函数
...
...
@@ -28,25 +32,28 @@ namespace Mall.ThirdCore.Oss
/// <param name="accessKeyId"></param>
/// <param name="accessKeySecret"></param>
/// <param name="bucketName"></param>
public
TencentOss
(
string
endpoint
,
string
accessKeyId
,
string
accessKeySecret
,
string
bucketName
)
/// <param name="fileStoragePath">文件存储位置</param>
public
TencentOss
(
string
endpoint
,
string
accessKeyId
,
string
accessKeySecret
,
string
bucketName
,
string
fileStoragePath
)
{
this
.
endpoint
=
endpoint
;
this
.
accessKeyId
=
accessKeyId
;
this
.
accessKeySecret
=
accessKeySecret
;
this
.
bucketName
=
bucketName
;
this
.
fileStoragePath
=
fileStoragePath
;
}
/// <summary>
/// 创建实例
/// </summary>
/// <returns></returns>
public
static
TencentOss
Instance
(
string
endpoint
,
string
accessKeyId
,
string
accessKeySecret
,
string
bucketName
)
public
static
TencentOss
Instance
(
string
endpoint
,
string
accessKeyId
,
string
accessKeySecret
,
string
bucketName
,
string
fileStoragePath
)
{
endpoint
??=
"ap-chengdu"
;
accessKeyId
??=
"AKIDDPnbIzi8C1eqEOPP8dw6MNAg9H9ldDKd"
;
accessKeySecret
??=
"PdcLtOjslUzNFYdU4OSI1fKtdHpFT2Ob"
;
bucketName
??=
"viitto-1301420277"
;
return
new
TencentOss
(
endpoint
,
accessKeyId
,
accessKeySecret
,
bucketName
);
fileStoragePath
??=
"/SaleBefore/Goods/"
;
return
new
TencentOss
(
endpoint
,
accessKeyId
,
accessKeySecret
,
bucketName
,
fileStoragePath
);
}
/// <summary>
...
...
@@ -76,7 +83,7 @@ namespace Mall.ThirdCore.Oss
{
string
fileExtention
=
System
.
IO
.
Path
.
GetExtension
(
filePath
);
string
bucket
=
this
.
bucketName
;
//存储桶,格式:BucketName-APPID
string
key
=
@"/YB2024/Goods/"
+
DateTime
.
Now
.
Ticks
.
ToString
()+
fileExtention
;
//对象在存储桶中的位置,即称对象键
string
key
=
fileStoragePath
+
DateTime
.
Now
.
Ticks
.
ToString
()
+
fileExtention
;
//对象在存储桶中的位置,即称对象键
PutObjectRequest
request
=
new
PutObjectRequest
(
bucket
,
key
,
filePath
);
//设置签名有效时长
request
.
SetSign
(
TimeUtils
.
GetCurrentTime
(
TimeUnit
.
SECONDS
),
600
);
...
...
Mall.WebApi/Controllers/File/FileController.cs
View file @
20df19c5
...
...
@@ -172,8 +172,9 @@ namespace Mall.WebApi.Controllers.File
{
fileModel
.
Bucket
=
Common
.
Config
.
TencentOSS
.
GetStringValue
(
"bucket"
);
}
string
fileStorePath
=
Common
.
Config
.
TencentOSS
.
GetStringValue
(
"fileStoragePath"
);
IsDefault
=
false
;
IOssService
ossService
=
OssService
.
GetTencent
(
fileModel
.
Region
,
fileModel
.
SecretId
,
fileModel
.
SecretKey
,
fileModel
.
Bucket
);
IOssService
ossService
=
OssService
.
GetTencent
(
fileModel
.
Region
,
fileModel
.
SecretId
,
fileModel
.
SecretKey
,
fileModel
.
Bucket
,
fileStorePath
);
OssResult
result
=
ossService
.
UploadFile
(
path_server
,
null
);
try
{
...
...
Mall.WebApi/Controllers/TradePavilion/TradeController.cs
View file @
20df19c5
...
...
@@ -3717,6 +3717,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
[
HttpPost
]
public
async
Task
<
ApiResult
>
CheckBuildingCarrierFile
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
RB_Building_Carrier_Extend
query
=
new
RB_Building_Carrier_Extend
()
{
...
...
@@ -3726,13 +3727,17 @@ namespace Mall.WebApi.Controllers.TradePavilion
QEndDate
=
parms
.
GetStringValue
(
"QEndDate"
),
MetroName
=
parms
.
GetStringValue
(
"MetroName"
),
MetroNum
=
parms
.
GetInt
(
"MetroNum"
),
BuildingCarrierType
=
parms
.
GetInt
(
"BuildingCarrierType"
),
OpeningStatus
=
parms
.
GetInt
(
"OpeningStatus"
,
-
1
),
OpeningStatus
=
-
1
,
QShopType
=
parms
.
GetInt
(
"QShopType"
),
MallBaseId
=
RequestParm
.
MallBaseId
,
TenantId
=
RequestParm
.
TenantId
,
};
string
OpeningStatusStr
=
parms
.
GetStringValue
(
"OpeningStatus"
);
if
(!
string
.
IsNullOrEmpty
(
OpeningStatusStr
))
{
Int32
.
TryParse
(
OpeningStatusStr
,
out
int
OpeningStatus
);
query
.
OpeningStatus
=
OpeningStatus
;
}
string
RandomNum
=
parms
.
GetStringValue
(
"RandomNum"
);
string
ExcelEnumIdsStr
=
parms
.
GetStringValue
(
"ExcelEnumIds"
);
List
<
int
>
ExcelEnumIds
=
JsonConvert
.
DeserializeObject
<
List
<
int
>>(
ExcelEnumIdsStr
);
...
...
Mall.WebApi/Controllers/TradePavilion/YBTradeController.cs
View file @
20df19c5
...
...
@@ -480,78 +480,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
// }));
//}
///// <summary>
///// 检查【商再通】载体、楼宇文件是否存在
///// </summary>
///// <returns></returns>
//[HttpPost]
//public async Task<ApiResult> CheckBuildingCarrierFile()
//{
// JObject parms = JObject.Parse(RequestParm.msg.ToString());
// RB_Building_Carrier_Extend query = new RB_Building_Carrier_Extend()
// {
// CarrierName = parms.GetStringValue("CarrierName"),
// CategoryId = parms.GetInt("CategoryId"),
// QStartDate = parms.GetStringValue("QStartDate"),
// QEndDate = parms.GetStringValue("QEndDate"),
// MetroName = parms.GetStringValue("MetroName"),
// MetroNum = parms.GetInt("MetroNum"),
// BuildingCarrierType = parms.GetInt("BuildingCarrierType"),
// OpeningStatus = parms.GetInt("OpeningStatus", -1),
// QShopType = parms.GetInt("QShopType"),
// MallBaseId = RequestParm.MallBaseId,
// TenantId = RequestParm.TenantId,
// };
// string RandomNum = parms.GetStringValue("RandomNum");
// string ExcelEnumIdsStr = parms.GetStringValue("ExcelEnumIds");
// List<int> ExcelEnumIds = JsonConvert.DeserializeObject<List<int>>(ExcelEnumIdsStr);
// string hashKey = Common.Config.GetHash(Common.Plugin.JsonHelper.Serialize(query) + ExcelEnumIdsStr + RandomNum);
// string fileName = "载体楼宇" + ".xls";
// string filePath = Path.Combine(Directory.GetCurrentDirectory(), "upfile/temporary");
// if (System.IO.Directory.Exists(filePath) == false)//如果不存在就创建file文件夹
// {
// System.IO.Directory.CreateDirectory(filePath);
// }
// string tempPath = filePath + "\\" + hashKey + "\\";
// //如果不存在就创建file文件夹
// if (!System.IO.Directory.Exists(tempPath))
// {
// System.IO.Directory.CreateDirectory(tempPath);
// }
// string fileUrl = tempPath + fileName;
// string key = "Mall_SD_BUILDINGCARRIER_" + hashKey;
// string redisValue = redisHelper.StringGet(key);
// if (string.IsNullOrEmpty(redisValue))
// {
// redisValue = redisHelper.StringGet(key);
// if (string.IsNullOrEmpty(redisValue))
// {
// redisHelper.StringSet(key, fileName, TimeSpan.FromMinutes(10));
// Task.Run(() =>
// {
// GetBuildingCarrierListToExcel(query, ExcelEnumIds, tempPath, fileUrl);
// });
// }
// }
// return await Task.Run<ApiResult>(() =>
// {
// ApiResult apiResult = new ApiResult()
// {
// resultCode = 0,
// };
// if (System.IO.File.Exists(fileUrl))
// {
// var filePath = "/upfile/temporary/" + hashKey + "/";
// var fileUrl = "/upfile/temporary/" + hashKey + "/" + fileName;
// apiResult.resultCode = 1;
// apiResult.data = new { filePath, fileUrl };
// apiResult.message = key;
// }
// return apiResult;
// });
//}
///// <summary>
///// 生成【商载通】载体、楼宇文件
...
...
Mall.WebApi/Controllers/User/TenantController.cs
View file @
20df19c5
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
Mall.Common.API
;
using
Mall.WebApi.Filter
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Mvc
;
using
Mall.Model.Extend.User
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Linq
;
using
Dnc.Api.Throttle
;
using
Mall.CacheKey
;
using
Mall.CacheManager.User
;
using
Mall.Common
;
using
Mall.Common.API
;
using
Mall.Common.Enum
;
using
Mall.CacheManager.User
;
using
Mall.CacheKey
;
using
Mall.Common.Plugin
;
using
Mall.Common.Enum.MallBase
;
using
Mall.Common.Plugin
;
using
Mall.DataHelper.Import
;
using
Mall.Model.Entity.User
;
using
Mall.Module.Product
;
using
Microsoft.AspNetCore.Authorization
;
using
Mall.Model.Query
;
using
Mall.Model.Extend.AppletWeChat
;
using
Mall.Model.Extend.User
;
using
Mall.Model.Query
;
using
Mall.Module.Product
;
using
Mall.Module.User
;
using
Dnc.Api.Throttle
;
using
Mall.WebApi.Filter
;
using
Mall.WebApi.Helper
;
using
Mall.DataHelper.Import
;
using
Microsoft.AspNetCore.Authorization
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Mvc
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Linq
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
Microsoft.AspNetCore.Mvc.RazorPages
;
using
DotNetCore.CAP.Dashboard
;
using
Consul
;
using
System.Linq
;
namespace
Mall.WebApi.Controllers.User
{
...
...
Mall.WebApi/appsettings.json
View file @
20df19c5
...
...
@@ -114,7 +114,9 @@
"bucket"
:
"viitto-1301420277"
,
"accessKeyId"
:
"AKIDDPnbIzi8C1eqEOPP8dw6MNAg9H9ldDKd"
,
"accessKeySecret"
:
"PdcLtOjslUzNFYdU4OSI1fKtdHpFT2Ob"
,
"domain"
:
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com"
"domain"
:
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com"
,
//腾讯云文件存储路径
"fileStoragePath"
:
"/SaleBefore/Goods/"
},
//阿里OSS配置
"aliOSS"
:
{
...
...
TestCore/UploadHelper.cs
View file @
20df19c5
...
...
@@ -20,7 +20,8 @@ namespace TestCore
string
SecretId
=
"AKIDDPnbIzi8C1eqEOPP8dw6MNAg9H9ldDKd"
;
string
SecretKey
=
"PdcLtOjslUzNFYdU4OSI1fKtdHpFT2Ob"
;
string
Bucket
=
"viitto-1301420277"
;
IOssService
ossService
=
OssService
.
GetTencent
(
Region
,
SecretId
,
SecretKey
,
Bucket
);
string
fileStoragePath
=
string
.
Format
(
"/{0}Mall/SaleBefore/Goods/"
,
DateTime
.
Now
.
ToString
(
"yyyy"
));
IOssService
ossService
=
OssService
.
GetTencent
(
Region
,
SecretId
,
SecretKey
,
Bucket
,
fileStoragePath
);
OssResult
result
=
ossService
.
UploadFile
(
filePath
,
null
);
return
result
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment