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
6bce9490
Commit
6bce9490
authored
Oct 29, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'HK' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
into sdzq
parents
6750f2ce
44ade3ea
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
2090 additions
and
8 deletions
+2090
-8
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
+16
-2
RB_StoresRepository.cs
Mall.Repository/User/RB_StoresRepository.cs
+117
-6
AppletStoresController.cs
Mall.WebApi/Controllers/Reserve/AppletStoresController.cs
+127
-0
OSGoodsController.cs
Mall.WebApi/Controllers/Reserve/OSGoodsController.cs
+622
-0
No files found.
Mall.Common/Plugin/ConvertHelper.cs
View file @
6bce9490
...
...
@@ -129,6 +129,32 @@ namespace Mall.Common
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>
/// 转Int
/// </summary>
...
...
Mall.Model/Entity/Product/RB_Goods.cs
View file @
6bce9490
...
...
@@ -553,5 +553,20 @@ namespace Mall.Model.Entity.Product
/// 课程标签
/// </summary>
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 @
6bce9490
...
...
@@ -161,5 +161,15 @@ namespace Mall.Model.Entity.User
/// 服务项目
/// </summary>
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 @
6bce9490
...
...
@@ -339,5 +339,15 @@ namespace Mall.Model.Extend.Product
/// </summary>
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 @
6bce9490
...
...
@@ -13,5 +13,25 @@ namespace Mall.Model.Entity.User
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
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 @
6bce9490
...
...
@@ -5,6 +5,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Mall.AOP\Mall.AOP.csproj" />
<ProjectReference Include="..\Mall.Repository\Mall.Repository.csproj" />
</ItemGroup>
...
...
Mall.Module.Reserve/OfflineGoodsModule.cs
0 → 100644
View file @
6bce9490
This diff is collapsed.
Click to expand it.
Mall.Module.User/ContentModule.cs
View file @
6bce9490
...
...
@@ -261,10 +261,11 @@ namespace Mall.Module.User
/// 门店分类列表
/// </summary>
/// <param name="query"></param>
/// <param name="isFirst">是否取第一条</param>
/// <returns></returns>
public
List
<
RB_Stores_Extend
>
GetStoresListModule
(
RB_Stores_Extend
query
)
public
List
<
RB_Stores_Extend
>
GetStoresListModule
(
RB_Stores_Extend
query
,
bool
isFirst
=
false
)
{
return
storesRepository
.
GetStoresListRepository
(
query
);
return
storesRepository
.
GetStoresListRepository
(
query
,
isFirst
:
isFirst
);
}
/// <summary>
...
...
@@ -275,6 +276,17 @@ namespace Mall.Module.User
public
bool
SetStoresModule
(
RB_Stores_Extend
extModel
)
{
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
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
...
...
@@ -291,6 +303,8 @@ namespace Mall.Module.User
{
nameof
(
RB_Stores_Extend
.
EndTime
),
extModel
.
EndTime
},
{
nameof
(
RB_Stores_Extend
.
IsAllDay
),
extModel
.
IsAllDay
},
{
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
));
}
...
...
Mall.Repository/User/RB_StoresRepository.cs
View file @
6bce9490
...
...
@@ -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
)
{
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
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Stores_Extend
.
TenantId
),
query
.
TenantId
);
...
...
@@ -40,19 +58,73 @@ namespace Mall.Repository.User
{
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
();
}
/// <summary>
/// 门店
分类
列表
/// 门店列表
/// </summary>
/// <param name="query"></param>
/// <param name="isFirst">是否取第一条</param>
/// <returns></returns>
public
List
<
RB_Stores_Extend
>
GetStoresListRepository
(
RB_Stores_Extend
query
)
public
List
<
RB_Stores_Extend
>
GetStoresListRepository
(
RB_Stores_Extend
query
,
bool
isFirst
=
false
)
{
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
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Stores_Extend
.
TenantId
),
query
.
TenantId
);
...
...
@@ -69,7 +141,46 @@ namespace Mall.Repository.User
{
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 "
);
}
if
(
isFirst
)
{
builder
.
Append
(
" LIMIT 1; "
);
}
return
Get
<
RB_Stores_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
...
...
Mall.WebApi/Controllers/Reserve/AppletStoresController.cs
0 → 100644
View file @
6bce9490
using
System
;
using
System.Linq
;
using
Mall.AOP
;
using
Mall.Common.API
;
using
Mall.Common.Plugin
;
using
Mall.Model.Entity.User
;
using
Mall.Module.User
;
using
Mall.WebApi.Filter
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Mvc
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Linq
;
namespace
Mall.WebApi.Controllers.Reserve
{
/// <summary>
/// 小程序门店商品
/// </summary>
[
Route
(
"api/[controller]/[action]"
)]
[
ApiExceptionFilter
]
[
ApiController
]
[
EnableCors
(
"AllowCors"
)]
public
class
AppletStoresController
:
BaseController
{
/// <summary>
/// 门店处理类对象
/// </summary>
private
readonly
ContentModule
contentModule
=
AOPHelper
.
CreateAOPObject
<
ContentModule
>();
/// <summary>
/// 线下服务首页获取当前距离最近门店
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
virtual
ApiResult
GetCurrentStore
(
object
requestMsg
)
{
var
parms
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
if
(
parms
.
MallBaseId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
JObject
parm
=
JObject
.
Parse
(
parms
.
msg
.
ToString
());
var
position
=
parm
.
GetStringValue
(
"position"
);
int
storeId
=
parm
.
GetInt
(
"storeId"
);
var
storeModel
=
contentModule
.
GetStoresListModule
(
new
RB_Stores_Extend
()
{
CurrentPosition
=
position
,
Id
=
storeId
,
MallBaseId
=
parms
.
MallBaseId
},
isFirst
:
true
)?.
FirstOrDefault
();
object
result
=
new
{
storeInfo
=
new
{
storeId
=
storeModel
?.
Id
,
storeName
=
storeModel
?.
Name
,
storeAddress
=
storeModel
?.
Address
,
storeTel
=
storeModel
?.
Tel
,
distance
=
storeModel
?.
KM
,
storeCoverImg
=
storeModel
?.
CoverImg
,
storeNavImg
=
storeModel
?.
NavImg
},
};
return
ApiResult
.
Success
(
data
:
result
);
}
/// <summary>
/// 小程序获取门店分页列表
/// </summary>
/// <param name="requestMsg"></param>
/// <returns></returns>
public
virtual
ApiResult
GetStorePage
(
object
requestMsg
)
{
var
parms
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
if
(
parms
.
MallBaseId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
ResultPageModel
pageModel
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Stores_Extend
>(
parms
.
msg
.
ToString
());
query
.
TenantId
=
parms
.
TenantId
;
query
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
contentModule
.
GetStoresPageListModule
(
pageModel
.
pageIndex
,
pageModel
.
pageSize
,
out
long
rowsCount
,
query
);
pageModel
.
pageData
=
list
;
pageModel
.
count
=
Convert
.
ToInt32
(
rowsCount
);
return
ApiResult
.
Success
(
data
:
pageModel
);
}
/// <summary>
/// 获取门店详情
/// </summary>
/// <param name="requestMsg"></param>
/// <returns></returns>
public
virtual
ApiResult
GetStoreInfo
(
object
requestMsg
)
{
var
parms
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
if
(
parms
.
MallBaseId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
JObject
parm
=
JObject
.
Parse
(
parms
.
msg
.
ToString
());
int
storeId
=
parm
.
GetInt
(
"storeId"
);
var
position
=
parm
.
GetStringValue
(
"position"
);
var
storeModel
=
contentModule
.
GetStoresListModule
(
new
RB_Stores_Extend
()
{
Id
=
storeId
,
MallBaseId
=
parms
.
MallBaseId
},
isFirst
:
true
)?.
FirstOrDefault
();
object
result
=
new
{
storeInfo
=
new
{
storeId
=
storeModel
?.
Id
,
storeName
=
storeModel
?.
Name
,
storeAddress
=
storeModel
?.
Address
,
storeTel
=
storeModel
?.
Tel
,
distance
=
storeModel
?.
KM
,
storeCoverImg
=
storeModel
?.
CoverImg
,
storeNavImg
=
storeModel
?.
NavImg
},
};
return
ApiResult
.
Success
(
data
:
result
);
}
}
}
Mall.WebApi/Controllers/Reserve/OSGoodsController.cs
0 → 100644
View file @
6bce9490
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