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
4c56af02
Commit
4c56af02
authored
Oct 29, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增控制器
parent
133096d7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1953 additions
and
4 deletions
+1953
-4
ConvertHelper.cs
Mall.Common/Plugin/ConvertHelper.cs
+26
-0
RB_Goods.cs
Mall.Model/Entity/Product/RB_Goods.cs
+15
-0
RB_Stores.cs
Mall.Model/Entity/User/RB_Stores.cs
+10
-0
RB_Goods_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Extend.cs
+10
-0
RB_Stores_Extend.cs
Mall.Model/Extend/User/RB_Stores_Extend.cs
+20
-0
Mall.Module.Reserve.csproj
Mall.Module.Reserve/Mall.Module.Reserve.csproj
+1
-0
OfflineGoodsModule.cs
Mall.Module.Reserve/OfflineGoodsModule.cs
+1126
-0
ContentModule.cs
Mall.Module.User/ContentModule.cs
+13
-0
RB_StoresRepository.cs
Mall.Repository/User/RB_StoresRepository.cs
+110
-4
OSGoodsController.cs
Mall.WebApi/Controllers/Reserve/OSGoodsController.cs
+622
-0
No files found.
Mall.Common/Plugin/ConvertHelper.cs
View file @
4c56af02
...
@@ -129,6 +129,32 @@ namespace Mall.Common
...
@@ -129,6 +129,32 @@ namespace Mall.Common
return
ConvertTo
<
int
>(
obj
);
return
ConvertTo
<
int
>(
obj
);
}
}
/// <summary>
/// 字符串状态List<int>
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public
static
List
<
int
>
ConvertToListInt
(
object
obj
)
{
List
<
int
>
result
=
new
List
<
int
>();
if
(
obj
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
obj
.
ToString
()))
{
var
tempArray
=
obj
.
ToString
().
Split
(
','
);
if
(
tempArray
!=
null
&&
tempArray
.
Length
>
0
)
{
foreach
(
var
item
in
tempArray
)
{
Int32
.
TryParse
(
item
,
out
int
NewValue
);
if
(
NewValue
>
0
)
{
result
.
Add
(
NewValue
);
}
}
}
}
return
result
;
}
/// <summary>
/// <summary>
/// 转Int
/// 转Int
/// </summary>
/// </summary>
...
...
Mall.Model/Entity/Product/RB_Goods.cs
View file @
4c56af02
...
@@ -553,5 +553,20 @@ namespace Mall.Model.Entity.Product
...
@@ -553,5 +553,20 @@ namespace Mall.Model.Entity.Product
/// 课程标签
/// 课程标签
/// </summary>
/// </summary>
public
string
CourseLable
{
get
;
set
;
}
public
string
CourseLable
{
get
;
set
;
}
/// <summary>
/// 定金
/// </summary>
public
decimal
DepositMoney
{
get
;
set
;
}
/// <summary>
/// 是否选择服务人员(0-不选,1-选择)
/// </summary>
public
int
IsChooseServicePerson
{
get
;
set
;
}
/// <summary>
/// 门店编号
/// </summary>
public
string
StoresIds
{
get
;
set
;
}
}
}
}
}
Mall.Model/Entity/User/RB_Stores.cs
View file @
4c56af02
...
@@ -161,5 +161,15 @@ namespace Mall.Model.Entity.User
...
@@ -161,5 +161,15 @@ namespace Mall.Model.Entity.User
/// 服务项目
/// 服务项目
/// </summary>
/// </summary>
public
string
ServiceProject
{
get
;
set
;
}
public
string
ServiceProject
{
get
;
set
;
}
/// <summary>
/// 经度
/// </summary>
public
float
Lng
{
get
;
set
;
}
/// <summary>
/// 纬度
/// </summary>
public
float
Lat
{
get
;
set
;
}
}
}
}
}
Mall.Model/Extend/Product/RB_Goods_Extend.cs
View file @
4c56af02
...
@@ -339,5 +339,15 @@ namespace Mall.Model.Extend.Product
...
@@ -339,5 +339,15 @@ namespace Mall.Model.Extend.Product
/// </summary>
/// </summary>
public
object
ERPGoodObj
{
get
;
set
;
}
public
object
ERPGoodObj
{
get
;
set
;
}
/// <summary>
/// 门店列表
/// </summary>
public
List
<
int
>
StoresList
{
get
{
return
Common
.
ConvertHelper
.
ConvertToListInt
(
this
.
StoresIds
);
}
}
}
}
}
}
Mall.Model/Extend/User/RB_Stores_Extend.cs
View file @
4c56af02
...
@@ -13,5 +13,25 @@ namespace Mall.Model.Entity.User
...
@@ -13,5 +13,25 @@ namespace Mall.Model.Entity.User
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Stores_Extend
:
Model
.
Entity
.
User
.
RB_Stores
public
class
RB_Stores_Extend
:
Model
.
Entity
.
User
.
RB_Stores
{
{
/// <summary>
/// 排序(1-名称,2-距离,3-热度)
/// </summary>
public
int
OrderByType
{
get
;
set
;
}
/// <summary>
/// 当前经度纬度
/// </summary>
public
string
CurrentPosition
{
get
;
set
;
}
/// <summary>
/// 距离公里数
/// </summary>
public
decimal
KM
{
get
;
set
;
}
}
}
}
}
Mall.Module.Reserve/Mall.Module.Reserve.csproj
View file @
4c56af02
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Mall.AOP\Mall.AOP.csproj" />
<ProjectReference Include="..\Mall.Repository\Mall.Repository.csproj" />
<ProjectReference Include="..\Mall.Repository\Mall.Repository.csproj" />
</ItemGroup>
</ItemGroup>
...
...
Mall.Module.Reserve/OfflineGoodsModule.cs
0 → 100644
View file @
4c56af02
This diff is collapsed.
Click to expand it.
Mall.Module.User/ContentModule.cs
View file @
4c56af02
...
@@ -275,6 +275,17 @@ namespace Mall.Module.User
...
@@ -275,6 +275,17 @@ namespace Mall.Module.User
public
bool
SetStoresModule
(
RB_Stores_Extend
extModel
)
public
bool
SetStoresModule
(
RB_Stores_Extend
extModel
)
{
{
bool
flag
;
bool
flag
;
if
(!
string
.
IsNullOrEmpty
(
extModel
.
LngLat
))
{
var
tempArray
=
extModel
.
LngLat
.
Split
(
","
);
if
(
tempArray
!=
null
&&
tempArray
.
Length
==
2
)
{
float
.
TryParse
(
tempArray
[
0
],
out
float
Lng
);
extModel
.
Lng
=
Lng
;
float
.
TryParse
(
tempArray
[
1
],
out
float
Lat
);
extModel
.
Lat
=
Lat
;
}
}
if
(
extModel
.
Id
>
0
)
if
(
extModel
.
Id
>
0
)
{
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
...
@@ -291,6 +302,8 @@ namespace Mall.Module.User
...
@@ -291,6 +302,8 @@ namespace Mall.Module.User
{
nameof
(
RB_Stores_Extend
.
EndTime
),
extModel
.
EndTime
},
{
nameof
(
RB_Stores_Extend
.
EndTime
),
extModel
.
EndTime
},
{
nameof
(
RB_Stores_Extend
.
IsAllDay
),
extModel
.
IsAllDay
},
{
nameof
(
RB_Stores_Extend
.
IsAllDay
),
extModel
.
IsAllDay
},
{
nameof
(
RB_Stores_Extend
.
ServiceProject
),
extModel
.
ServiceProject
},
{
nameof
(
RB_Stores_Extend
.
ServiceProject
),
extModel
.
ServiceProject
},
{
nameof
(
RB_Stores_Extend
.
Lng
),
extModel
.
Lng
},
{
nameof
(
RB_Stores_Extend
.
Lat
),
extModel
.
Lat
},
};
};
flag
=
storesRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Stores_Extend
.
Id
),
extModel
.
Id
));
flag
=
storesRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Stores_Extend
.
Id
),
extModel
.
Id
));
}
}
...
...
Mall.Repository/User/RB_StoresRepository.cs
View file @
4c56af02
...
@@ -23,7 +23,25 @@ namespace Mall.Repository.User
...
@@ -23,7 +23,25 @@ namespace Mall.Repository.User
public
List
<
RB_Stores_Extend
>
GetStoresPageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Stores_Extend
query
)
public
List
<
RB_Stores_Extend
>
GetStoresPageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Stores_Extend
query
)
{
{
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@" SELECT * FROM RB_Stores WHERE 1=1 AND Status=0 "
);
float
lng
=
0
;
float
lat
=
0
;
if
(!
string
.
IsNullOrEmpty
(
query
.
CurrentPosition
))
{
var
tempArray
=
query
.
CurrentPosition
.
Split
(
','
);
if
(
tempArray
!=
null
&&
tempArray
.
Length
==
2
)
{
float
.
TryParse
(
tempArray
[
0
],
out
lng
);
float
.
TryParse
(
tempArray
[
1
],
out
lat
);
}
}
builder
.
AppendFormat
(
@" SELECT * "
);
if
(
lng
>
0
&&
lat
>
0
)
{
builder
.
AppendFormat
(
@",lat_lng_distance(Lng,Lat,{0},{1}) AS KM "
,
lng
,
lat
);
}
builder
.
AppendFormat
(
@"
FROM RB_Stores
WHERE 1 = 1 AND Status = 0 "
);
if
(
query
.
TenantId
>
0
)
if
(
query
.
TenantId
>
0
)
{
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Stores_Extend
.
TenantId
),
query
.
TenantId
);
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Stores_Extend
.
TenantId
),
query
.
TenantId
);
...
@@ -40,7 +58,42 @@ namespace Mall.Repository.User
...
@@ -40,7 +58,42 @@ namespace Mall.Repository.User
{
{
builder
.
AppendFormat
(
" AND {0} LIKE '%{1}%' "
,
nameof
(
RB_Stores_Extend
.
Name
),
query
.
Name
.
Trim
());
builder
.
AppendFormat
(
" AND {0} LIKE '%{1}%' "
,
nameof
(
RB_Stores_Extend
.
Name
),
query
.
Name
.
Trim
());
}
}
builder
.
Append
(
" ORDER BY Id DESC "
);
if
(
query
.
OrderByType
==
1
)
{
builder
.
Append
(
" ORDER BY Name ASC "
);
}
else
if
(
query
.
OrderByType
==
2
)
{
builder
.
Append
(
" ORDER BY Name DESC "
);
}
else
if
(
query
.
OrderByType
==
3
)
{
if
(
lng
>
0
&&
lat
>
0
)
{
builder
.
AppendFormat
(
" ORDER BY lat_lng_distance(Lng,Lat,{0},{1}) ASC "
,
lng
,
lat
);
}
}
else
if
(
query
.
OrderByType
==
4
)
{
if
(
lng
>
0
&&
lat
>
0
)
{
builder
.
AppendFormat
(
" ORDER BY lat_lng_distance(Lng,Lat,{0},{1}) DESC "
,
lng
,
lat
);
}
}
else
if
(
query
.
OrderByType
==
5
)
{
builder
.
Append
(
" ORDER BY Score ASC "
);
}
else
if
(
query
.
OrderByType
==
6
)
{
builder
.
Append
(
" ORDER BY Score DESC "
);
}
else
{
builder
.
Append
(
" ORDER BY Id DESC "
);
}
return
GetPage
<
RB_Stores_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
return
GetPage
<
RB_Stores_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
}
}
...
@@ -52,7 +105,26 @@ namespace Mall.Repository.User
...
@@ -52,7 +105,26 @@ namespace Mall.Repository.User
public
List
<
RB_Stores_Extend
>
GetStoresListRepository
(
RB_Stores_Extend
query
)
public
List
<
RB_Stores_Extend
>
GetStoresListRepository
(
RB_Stores_Extend
query
)
{
{
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@" SELECT * FROM RB_Stores WHERE 1=1 AND Status=0 "
);
float
lng
=
0
;
float
lat
=
0
;
if
(!
string
.
IsNullOrEmpty
(
query
.
CurrentPosition
))
{
var
tempArray
=
query
.
CurrentPosition
.
Split
(
','
);
if
(
tempArray
!=
null
&&
tempArray
.
Length
==
2
)
{
float
.
TryParse
(
tempArray
[
0
],
out
lng
);
float
.
TryParse
(
tempArray
[
1
],
out
lat
);
}
}
builder
.
AppendFormat
(
@" SELECT * "
);
if
(
lng
>
0
&&
lat
>
0
)
{
builder
.
AppendFormat
(
@",lat_lng_distance(Lng,Lat,{0},{1}) AS KM "
,
lng
,
lat
);
}
builder
.
AppendFormat
(
@"
FROM RB_Stores
WHERE 1 = 1 AND Status = 0 "
);
if
(
query
.
TenantId
>
0
)
if
(
query
.
TenantId
>
0
)
{
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Stores_Extend
.
TenantId
),
query
.
TenantId
);
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Stores_Extend
.
TenantId
),
query
.
TenantId
);
...
@@ -69,7 +141,41 @@ namespace Mall.Repository.User
...
@@ -69,7 +141,41 @@ namespace Mall.Repository.User
{
{
builder
.
AppendFormat
(
" AND {0} LIKE '%{1}%' "
,
nameof
(
RB_Stores_Extend
.
Name
),
query
.
Name
.
Trim
());
builder
.
AppendFormat
(
" AND {0} LIKE '%{1}%' "
,
nameof
(
RB_Stores_Extend
.
Name
),
query
.
Name
.
Trim
());
}
}
builder
.
Append
(
" ORDER BY Id DESC "
);
if
(
query
.
OrderByType
==
1
)
{
builder
.
Append
(
" ORDER BY Name ASC "
);
}
else
if
(
query
.
OrderByType
==
2
)
{
builder
.
Append
(
" ORDER BY Name DESC "
);
}
else
if
(
query
.
OrderByType
==
3
)
{
if
(
lng
>
0
&&
lat
>
0
)
{
builder
.
AppendFormat
(
" ORDER BY lat_lng_distance(Lng,Lat,{0},{1}) ASC "
,
lng
,
lat
);
}
}
else
if
(
query
.
OrderByType
==
4
)
{
if
(
lng
>
0
&&
lat
>
0
)
{
builder
.
AppendFormat
(
" ORDER BY lat_lng_distance(Lng,Lat,{0},{1}) DESC "
,
lng
,
lat
);
}
}
else
if
(
query
.
OrderByType
==
5
)
{
builder
.
Append
(
" ORDER BY Score ASC "
);
}
else
if
(
query
.
OrderByType
==
6
)
{
builder
.
Append
(
" ORDER BY Score DESC "
);
}
else
{
builder
.
Append
(
" ORDER BY Id DESC "
);
}
return
Get
<
RB_Stores_Extend
>(
builder
.
ToString
()).
ToList
();
return
Get
<
RB_Stores_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
}
...
...
Mall.WebApi/Controllers/Reserve/OSGoodsController.cs
0 → 100644
View file @
4c56af02
This diff is collapsed.
Click to expand it.
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