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
76212641
Commit
76212641
authored
Aug 06, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
824d0e27
58fa7bb2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
132 additions
and
67 deletions
+132
-67
Config.cs
Mall.Common/Config.cs
+13
-3
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+40
-1
AppletGoodsController.cs
Mall.WebApi/Controllers/Product/AppletGoodsController.cs
+55
-40
Mall.WebApi.csproj
Mall.WebApi/Mall.WebApi.csproj
+4
-5
Startup.cs
Mall.WebApi/Startup.cs
+6
-11
appsettings.json
Mall.WebApi/appsettings.json
+8
-7
Mall.sln
Mall.sln
+6
-0
No files found.
Mall.Common/Config.cs
View file @
76212641
...
@@ -161,18 +161,28 @@ namespace Mall.Common
...
@@ -161,18 +161,28 @@ namespace Mall.Common
/// </summary>
/// </summary>
/// <param name="key"></param>
/// <param name="key"></param>
/// <returns></returns>
/// <returns></returns>
public
static
string
ReadConfigKey
(
string
key
)
public
static
string
ReadConfigKey
(
string
key
,
string
subKey
=
""
)
{
{
string
valueStr
=
""
;
try
try
{
{
return
Configuration
.
GetSection
(
key
).
Value
;
if
(!
string
.
IsNullOrWhiteSpace
(
subKey
))
{
valueStr
=
Configuration
.
GetSection
(
key
)[
subKey
].
ToString
();
}
else
{
valueStr
=
Configuration
.
GetSection
(
key
).
Value
;
}
}
}
catch
catch
{
{
return
""
;
}
}
return
valueStr
;
}
}
/// <summary>
/// <summary>
/// 阿里云oss域名
/// 阿里云oss域名
/// </summary>
/// </summary>
...
...
Mall.Module.Product/ProductModule.cs
View file @
76212641
...
@@ -246,6 +246,17 @@ namespace Mall.Module.Product
...
@@ -246,6 +246,17 @@ namespace Mall.Module.Product
}
}
string
goodsIds2
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
string
goodsIds2
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
List
<
RB_Goods_Order_Extend
>
orderlist
=
goods_OrderRepository
.
GetGoodsOrderNum
(
goodsIds
:
goodsIds2
);
List
<
RB_Goods_Order_Extend
>
orderlist
=
goods_OrderRepository
.
GetGoodsOrderNum
(
goodsIds
:
goodsIds2
);
//2020-08-06 Add by:W 查询商品分类获取分类包邮规则
string
allGoodsIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
var
goodsCategoryList
=
goods_CategoryRepository
.
GetList
(
new
RB_Goods_Category_Extend
()
{
GoodsIds
=
allGoodsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
string
categoryIds
=
string
.
Join
(
","
,
goodsCategoryList
.
Select
(
x
=>
x
.
CategoryId
).
Distinct
());
List
<
RB_FreeShipping_Extend
>
freeShippingList
=
new
List
<
RB_FreeShipping_Extend
>();
if
(!
string
.
IsNullOrWhiteSpace
(
categoryIds
))
{
freeShippingList
=
freeShippingRepository
.
GetFreeShippingListByCategoryIds
(
new
RB_FreeShipping_Extend
{
MallBaseId
=
demodel
.
MallBaseId
,
TenantId
=
demodel
.
TenantId
,
CategoryIds
=
categoryIds
});
}
//2020-08-06 Add by:W End
foreach
(
var
item
in
list
)
foreach
(
var
item
in
list
)
{
{
item
.
CoverImage
=
""
;
item
.
CoverImage
=
""
;
...
@@ -269,7 +280,35 @@ namespace Mall.Module.Product
...
@@ -269,7 +280,35 @@ namespace Mall.Module.Product
}
}
item
.
SalesNum
+=
(
orderlist
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
FirstOrDefault
()?.
OrderNum
??
0
);
item
.
SalesNum
+=
(
orderlist
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
FirstOrDefault
()?.
OrderNum
??
0
);
//2020-08-06 Add by:W 查询商品分类获取分类包邮规则
if
(
freeShippingList
!=
null
&&
freeShippingList
.
Any
())
{
var
nowcategory
=
goodsCategoryList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
Select
(
x
=>
x
.
CategoryId
);
var
fullNumPinkageModel
=
freeShippingList
.
Where
(
x
=>
nowcategory
.
Contains
(
x
.
CategoryId
)
&&
x
.
IsFreeShipping
==
1
&&
x
.
IsEnable
==
1
&&
x
.
FullNumPinkage
>
0
&&
x
.
CategoryId
>
0
).
OrderBy
(
x
=>
x
.
FullNumPinkage
).
ThenByDescending
(
x
=>
x
.
ID
).
FirstOrDefault
();
if
(
fullNumPinkageModel
==
null
||
fullNumPinkageModel
.
ID
<=
0
)
{
fullNumPinkageModel
=
freeShippingList
.
Where
(
x
=>
nowcategory
.
Contains
(
x
.
CategoryId
)
&&
x
.
IsFreeShipping
==
1
&&
x
.
IsEnable
==
1
&&
x
.
FullMoneyPinkage
>
0
&&
x
.
CategoryId
>
0
).
OrderBy
(
x
=>
x
.
FullMoneyPinkage
).
ThenByDescending
(
x
=>
x
.
ID
).
FirstOrDefault
();
}
if
(
fullNumPinkageModel
==
null
||
fullNumPinkageModel
.
ID
<=
0
)
{
fullNumPinkageModel
=
freeShippingList
.
Where
(
x
=>
nowcategory
.
Contains
(
x
.
CategoryId
)
&&
x
.
IsFreeShipping
==
1
&&
x
.
IsEnable
==
1
&&
x
.
FullNumPinkage
>
0
&&
x
.
CategoryId
==
0
).
OrderBy
(
x
=>
x
.
FullNumPinkage
).
ThenByDescending
(
x
=>
x
.
ID
).
FirstOrDefault
();
}
if
(
fullNumPinkageModel
==
null
||
fullNumPinkageModel
.
ID
<=
0
)
{
fullNumPinkageModel
=
freeShippingList
.
Where
(
x
=>
nowcategory
.
Contains
(
x
.
CategoryId
)
&&
x
.
IsFreeShipping
==
1
&&
x
.
IsEnable
==
1
&&
x
.
FullMoneyPinkage
>
0
&&
x
.
CategoryId
==
0
).
OrderBy
(
x
=>
x
.
FullMoneyPinkage
).
ThenByDescending
(
x
=>
x
.
ID
).
FirstOrDefault
();
}
item
.
FreeShippingModel
=
(
fullNumPinkageModel
==
null
||
fullNumPinkageModel
.
ID
<=
0
)
?
new
RB_FreeShipping_Extend
()
:
fullNumPinkageModel
;
}
else
{
item
.
FreeShippingModel
=
new
RB_FreeShipping_Extend
();
}
//2020-08-06 Add by:W End
}
}
}
}
return
list
;
return
list
;
}
}
...
@@ -1059,7 +1098,7 @@ namespace Mall.Module.Product
...
@@ -1059,7 +1098,7 @@ namespace Mall.Module.Product
var
freeShippingList
=
freeShippingRepository
.
GetFreeShippingListByCategoryIds
(
new
RB_FreeShipping_Extend
{
MallBaseId
=
model
.
MallBaseId
,
TenantId
=
model
.
TenantId
,
CategoryIds
=
categoryIds
});
var
freeShippingList
=
freeShippingRepository
.
GetFreeShippingListByCategoryIds
(
new
RB_FreeShipping_Extend
{
MallBaseId
=
model
.
MallBaseId
,
TenantId
=
model
.
TenantId
,
CategoryIds
=
categoryIds
});
if
(
freeShippingList
!=
null
&&
freeShippingList
.
Any
())
if
(
freeShippingList
!=
null
&&
freeShippingList
.
Any
())
{
{
var
fullNumPinkageModel
=
freeShippingList
.
Where
(
x
=>
x
.
IsFreeShipping
==
1
&&
x
.
IsEnable
==
1
&&
x
.
FullNumPinkage
>
0
&&
x
.
CategoryId
>
0
).
OrderBy
(
x
=>
x
.
FullNumPinkage
).
ThenByDescending
(
x
=>
x
.
ID
).
FirstOrDefault
();
var
fullNumPinkageModel
=
freeShippingList
.
Where
(
x
=>
x
.
IsFreeShipping
==
1
&&
x
.
IsEnable
==
1
&&
x
.
FullNumPinkage
>
0
&&
x
.
CategoryId
>
0
).
OrderBy
(
x
=>
x
.
FullNumPinkage
).
ThenByDescending
(
x
=>
x
.
ID
).
FirstOrDefault
();
if
(
fullNumPinkageModel
==
null
||
fullNumPinkageModel
.
ID
<=
0
)
if
(
fullNumPinkageModel
==
null
||
fullNumPinkageModel
.
ID
<=
0
)
{
{
fullNumPinkageModel
=
freeShippingList
.
Where
(
x
=>
x
.
IsFreeShipping
==
1
&&
x
.
IsEnable
==
1
&&
x
.
FullMoneyPinkage
>
0
&&
x
.
CategoryId
>
0
).
OrderBy
(
x
=>
x
.
FullMoneyPinkage
).
ThenByDescending
(
x
=>
x
.
ID
).
FirstOrDefault
();
fullNumPinkageModel
=
freeShippingList
.
Where
(
x
=>
x
.
IsFreeShipping
==
1
&&
x
.
IsEnable
==
1
&&
x
.
FullMoneyPinkage
>
0
&&
x
.
CategoryId
>
0
).
OrderBy
(
x
=>
x
.
FullMoneyPinkage
).
ThenByDescending
(
x
=>
x
.
ID
).
FirstOrDefault
();
...
...
Mall.WebApi/Controllers/Product/AppletGoodsController.cs
View file @
76212641
This diff is collapsed.
Click to expand it.
Mall.WebApi/Mall.WebApi.csproj
View file @
76212641
...
@@ -9,11 +9,10 @@
...
@@ -9,11 +9,10 @@
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="DotNetCore.CAP" Version="
3.0
.0" />
<PackageReference Include="DotNetCore.CAP" Version="
2.6
.0" />
<PackageReference Include="DotNetCore.CAP.M
ySql" Version="3.0
.0" />
<PackageReference Include="DotNetCore.CAP.M
ongoDB" Version="2.6
.0" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="
3.0
.0" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="
2.6
.0" />
<PackageReference Include="JWT" Version="5.3.1" />
<PackageReference Include="JWT" Version="5.3.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" />
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
</ItemGroup>
</ItemGroup>
...
@@ -31,7 +30,7 @@
...
@@ -31,7 +30,7 @@
<ProjectReference Include="..\Mall.ThirdCore\Mall.ThirdCore.csproj" />
<ProjectReference Include="..\Mall.ThirdCore\Mall.ThirdCore.csproj" />
</ItemGroup>
</ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>
<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JsonSchema="
https://json-schema.org/draft/2019-09/schema
" /></VisualStudio></ProjectExtensions>
</Project>
</Project>
Mall.WebApi/Startup.cs
View file @
76212641
...
@@ -5,7 +5,6 @@ using System.Linq;
...
@@ -5,7 +5,6 @@ using System.Linq;
using
System.Text.Encodings.Web
;
using
System.Text.Encodings.Web
;
using
System.Text.Unicode
;
using
System.Text.Unicode
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
DotNetCore.CAP.Messages
;
using
Mall.ThirdCore.Message
;
using
Mall.ThirdCore.Message
;
using
Mall.WebApi.Filter
;
using
Mall.WebApi.Filter
;
using
Microsoft.AspNetCore.Builder
;
using
Microsoft.AspNetCore.Builder
;
...
@@ -63,18 +62,14 @@ namespace Mall.WebApi
...
@@ -63,18 +62,14 @@ namespace Mall.WebApi
services
.
AddCap
(
x
=>
services
.
AddCap
(
x
=>
{
{
x
.
UseMySql
(
config
=>
x
.
UseMongoDB
(
Common
.
Config
.
ReadConfigKey
(
"Mongo"
));
{
config
.
ConnectionString
=
"server=192.168.2.214;user id=reborn;password=Reborn@2018;database=cap;CharSet=utf8; Convert Zero Datetime=true;"
;
});
x
.
UseRabbitMQ
(
cfg
=>
x
.
UseRabbitMQ
(
cfg
=>
{
{
cfg
.
HostName
=
"47.96.25.130"
;
cfg
.
HostName
=
Common
.
Config
.
ReadConfigKey
(
"RabbitMqConfig"
,
"HostName"
)
;
cfg
.
VirtualHost
=
"/"
;
cfg
.
VirtualHost
=
Common
.
Config
.
ReadConfigKey
(
"RabbitMqConfig"
,
"VirtualHost"
)
;
cfg
.
Port
=
Convert
.
ToInt32
(
5672
);
cfg
.
Port
=
Convert
.
ToInt32
(
Common
.
Config
.
ReadConfigKey
(
"RabbitMqConfig"
,
"Port"
)
);
cfg
.
UserName
=
"guest"
;
cfg
.
UserName
=
Common
.
Config
.
ReadConfigKey
(
"RabbitMqConfig"
,
"UserName"
)
;
cfg
.
Password
=
"viitto2019"
;
cfg
.
Password
=
Common
.
Config
.
ReadConfigKey
(
"RabbitMqConfig"
,
"Password"
)
;
});
});
//失败后的重试次数,默认50次;在FailedRetryInterval默认60秒的情况下,即默认重试50*60秒(50分钟)之后放弃失败重试
//失败后的重试次数,默认50次;在FailedRetryInterval默认60秒的情况下,即默认重试50*60秒(50分钟)之后放弃失败重试
x
.
FailedRetryCount
=
10
;
x
.
FailedRetryCount
=
10
;
...
...
Mall.WebApi/appsettings.json
View file @
76212641
{
{
"ConnectionStrings"
:
{
"ConnectionStrings"
:
{
"DefaultConnection"
:
"server=192.168.2.214;user id=reborn;password=Reborn@2018;database=test_reborn_mall_
4
;CharSet=utf8; Convert Zero Datetime=true; "
,
"DefaultConnection"
:
"server=192.168.2.214;user id=reborn;password=Reborn@2018;database=test_reborn_mall_
3
;CharSet=utf8; Convert Zero Datetime=true; "
,
"DefaultConnectionPName"
:
"MySql.Data.MySqlClient"
,
"DefaultConnectionPName"
:
"MySql.Data.MySqlClient"
,
"FinanceConnection"
:
"server=192.168.2.214;user id=reborn;password=Reborn@2018;database=reborn_finance;CharSet=utf8; Convert Zero Datetime=true; "
,
"FinanceConnection"
:
"server=192.168.2.214;user id=reborn;password=Reborn@2018;database=reborn_finance;CharSet=utf8; Convert Zero Datetime=true; "
,
"FinanceConnectionPName"
:
"MySql.Data.MySqlClient"
,
"FinanceConnectionPName"
:
"MySql.Data.MySqlClient"
,
...
@@ -25,7 +25,6 @@
...
@@ -25,7 +25,6 @@
"ViewFileSiteUrl"
:
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com"
,
"ViewFileSiteUrl"
:
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com"
,
"ImKey"
:
"b612b31e837c79c68f141aeb719d2b20"
,
"ImKey"
:
"b612b31e837c79c68f141aeb719d2b20"
,
"ImSecret"
:
"66000451fb72"
,
"ImSecret"
:
"66000451fb72"
,
//
"Mongo"
:
"mongodb://192.168.2.214:27017"
,
"Mongo"
:
"mongodb://47.96.25.130:27017"
,
"Mongo"
:
"mongodb://47.96.25.130:27017"
,
"MongoDBName"
:
"Mall"
,
"MongoDBName"
:
"Mall"
,
"ProjectUrl"
:
"D:/project/GitProject/mallapp"
,
"ProjectUrl"
:
"D:/project/GitProject/mallapp"
,
...
@@ -50,11 +49,13 @@
...
@@ -50,11 +49,13 @@
"PaymentFinanceApi"
:
"http://testapi.oytour.com/api/Mall/InsertFinanceBatchForMallOut"
,
"PaymentFinanceApi"
:
"http://testapi.oytour.com/api/Mall/InsertFinanceBatchForMallOut"
,
"FinanceKey"
:
"FinanceMallInsertToERPViitto2020"
,
"FinanceKey"
:
"FinanceMallInsertToERPViitto2020"
,
"SettlementRate"
:
"0.60"
,
"SettlementRate"
:
"0.60"
,
//
"RedisSetting"
:
{
"RabbitMqConfig"
:
{
//
"RedisServer"
:
"192.168.2.214"
,
"HostName"
:
"47.96.25.130"
,
//
"RedisPort"
:
"6379"
,
"VirtualHost"
:
"/"
,
//
"RedisPwd"
:
"123456"
"Port"
:
5672
,
//
},
"UserName"
:
"guest"
,
"Password"
:
"viitto2019"
},
"RedisSetting"
:
{
"RedisSetting"
:
{
"RedisServer"
:
"47.96.23.199"
,
"RedisServer"
:
"47.96.23.199"
,
"RedisPort"
:
"6379"
,
"RedisPort"
:
"6379"
,
...
...
Mall.sln
View file @
76212641
...
@@ -41,6 +41,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.WindowsService", "Mall
...
@@ -41,6 +41,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.WindowsService", "Mall
EndProject
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Module.Property", "Mall.Module.Property\Mall.Module.Property.csproj", "{C7DE85C9-8620-47A9-AE2F-DD1408DD886B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Module.Property", "Mall.Module.Property\Mall.Module.Property.csproj", "{C7DE85C9-8620-47A9-AE2F-DD1408DD886B}"
EndProject
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.AOP", "Mall.AOP\Mall.AOP.csproj", "{231B6093-D5A7-4FEB-A624-7FACE432EA86}"
EndProject
Global
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Any CPU = Debug|Any CPU
...
@@ -107,6 +109,10 @@ Global
...
@@ -107,6 +109,10 @@ Global
{C7DE85C9-8620-47A9-AE2F-DD1408DD886B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7DE85C9-8620-47A9-AE2F-DD1408DD886B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7DE85C9-8620-47A9-AE2F-DD1408DD886B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7DE85C9-8620-47A9-AE2F-DD1408DD886B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7DE85C9-8620-47A9-AE2F-DD1408DD886B}.Release|Any CPU.Build.0 = Release|Any CPU
{C7DE85C9-8620-47A9-AE2F-DD1408DD886B}.Release|Any CPU.Build.0 = Release|Any CPU
{231B6093-D5A7-4FEB-A624-7FACE432EA86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{231B6093-D5A7-4FEB-A624-7FACE432EA86}.Debug|Any CPU.Build.0 = Debug|Any CPU
{231B6093-D5A7-4FEB-A624-7FACE432EA86}.Release|Any CPU.ActiveCfg = Release|Any CPU
{231B6093-D5A7-4FEB-A624-7FACE432EA86}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
HideSolutionNode = FALSE
...
...
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