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
23aa6918
Commit
23aa6918
authored
Nov 02, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
c4664bc2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
140 additions
and
6 deletions
+140
-6
RB_Stores_Extend.cs
Mall.Model/Extend/User/RB_Stores_Extend.cs
+26
-0
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+87
-6
RB_Reserve_ServicePersonalRepository.cs
...epository/Reserve/RB_Reserve_ServicePersonalRepository.cs
+27
-0
No files found.
Mall.Model/Extend/User/RB_Stores_Extend.cs
View file @
23aa6918
...
@@ -39,4 +39,30 @@ namespace Mall.Model.Entity.User
...
@@ -39,4 +39,30 @@ namespace Mall.Model.Entity.User
/// </summary>
/// </summary>
public
string
QIds
{
get
;
set
;
}
public
string
QIds
{
get
;
set
;
}
}
}
/// <summary>
/// 门店预约实体
/// </summary>
public
class
StoreReserveDate
{
/// <summary>
/// 天数
/// </summary>
public
DateTime
DayDate
{
get
;
set
;
}
/// <summary>
/// 日期字符串
/// </summary>
public
string
DayDateStr
{
get
;
set
;
}
/// <summary>
/// 星期
/// </summary>
public
string
WeekDayStr
{
get
;
set
;
}
/// <summary>
/// 具体时间点
/// </summary>
public
List
<
string
>
TimeList
{
get
;
set
;
}
}
}
}
Mall.Module.Product/ProductModule.cs
View file @
23aa6918
...
@@ -3530,16 +3530,96 @@ namespace Mall.Module.Product
...
@@ -3530,16 +3530,96 @@ namespace Mall.Module.Product
}
}
};
};
}
}
var
servicePersionList
=
reserve_ServicePersonalRepository
.
GetServicePersonalList
(
new
Model
.
Extend
.
Reserve
.
RB_Reserve_ServicePersonal_Extend
()
#
region
门店相关
string
categoryIds
=
"0"
;
if
(
model
.
CategoryList
!=
null
&&
model
.
CategoryList
.
Count
>
0
)
{
{
StoreId
=
storeId
,
categoryIds
=
string
.
Join
(
","
,
model
.
CategoryList
.
Select
(
qitem
=>
qitem
.
CategoryId
));
})?.
ToList
()
??
new
List
<
Model
.
Extend
.
Reserve
.
RB_Reserve_ServicePersonal_Extend
>();
}
var
servicePersionList
=
reserve_ServicePersonalRepository
.
GetServicePersonalListExtRepository
(
storeId
,
model
.
Id
,
categoryIds
)?.
ToList
()
??
new
List
<
Model
.
Extend
.
Reserve
.
RB_Reserve_ServicePersonal_Extend
>();
var
storeModel
=
storesRepository
.
GetEntity
(
storeId
);
var
storeModel
=
storesRepository
.
GetEntity
(
storeId
);
List
<
StoreReserveDate
>
storeDateList
=
new
List
<
StoreReserveDate
>();
DateTime
currentDay
=
Convert
.
ToDateTime
(
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
));
for
(
int
i
=
0
;
i
<=
7
;
i
++)
{
var
storeDateModel
=
new
StoreReserveDate
()
{
DayDate
=
Convert
.
ToDateTime
(
DateTime
.
Now
.
AddDays
(
i
).
ToString
(
"yyyy-MM-dd"
)),
DayDateStr
=
DateTime
.
Now
.
AddDays
(
i
).
ToString
(
"MM-dd"
),
WeekDayStr
=
(
i
==
0
?
"今天"
:
"周"
+
Common
.
Plugin
.
CommonHelper
.
GetWeekDay
(
DateTime
.
Now
.
AddDays
(
i
))),
TimeList
=
new
List
<
string
>()
};
for
(
var
j
=
0
;
j
<
48
;
j
++)
{
string
tempTimeStr
=
""
;
if
(
j
%
2
==
0
)
{
tempTimeStr
=
currentDay
.
AddHours
((
j
/
2
)).
ToString
(
"HH:mm"
);
}
else
{
tempTimeStr
=
currentDay
.
AddHours
((
Convert
.
ToDouble
(
j
)
/
2.0
)).
ToString
(
"HH:mm"
);
}
storeDateModel
.
TimeList
.
Add
(
tempTimeStr
);
}
storeDateList
.
Add
(
storeDateModel
);
}
if
(
storeModel
!=
null
&&
storeModel
.
Id
>
0
)
if
(
storeModel
!=
null
&&
storeModel
.
Id
>
0
)
{
{
//全天营业
if
(
storeModel
.
IsAllDay
==
1
)
{
List
<
string
>
tempTimeList
=
new
List
<
string
>();
var
firstModel
=
storeDateList
[
0
];
foreach
(
var
timeItem
in
firstModel
.
TimeList
)
{
if
(
DateTime
.
Now
<
Convert
.
ToDateTime
(
firstModel
.
DayDate
.
ToString
(
"yyyy-MM-dd"
)
+
" "
+
timeItem
))
{
tempTimeList
.
Add
(
timeItem
);
}
}
firstModel
.
TimeList
=
tempTimeList
;
}
//有具体时间
else
{
for
(
var
i
=
0
;
i
<
storeDateList
.
Count
;
i
++)
{
List
<
string
>
tempTimeList
=
new
List
<
string
>();
var
firstModel
=
storeDateList
[
i
];
DateTime
startTime
=
Convert
.
ToDateTime
(
firstModel
.
DayDate
.
ToString
(
"yyyy-MM-dd"
)
+
" "
+
storeModel
.
StartTime
);
DateTime
endTime
=
Convert
.
ToDateTime
(
firstModel
.
DayDate
.
ToString
(
"yyyy-MM-dd"
)
+
" "
+
storeModel
.
EndTime
);
if
(
i
==
0
)
{
foreach
(
var
timeItem
in
firstModel
.
TimeList
)
{
DateTime
currentTime
=
Convert
.
ToDateTime
(
firstModel
.
DayDate
.
ToString
(
"yyyy-MM-dd"
)
+
" "
+
timeItem
);
if
(
DateTime
.
Now
<
currentTime
&&
currentTime
>
startTime
&&
currentTime
<
endTime
)
{
tempTimeList
.
Add
(
timeItem
);
}
}
firstModel
.
TimeList
=
tempTimeList
;
}
else
{
foreach
(
var
timeItem
in
firstModel
.
TimeList
)
{
DateTime
currentTime
=
Convert
.
ToDateTime
(
firstModel
.
DayDate
.
ToString
(
"yyyy-MM-dd"
)
+
" "
+
timeItem
);
if
(
currentTime
>
startTime
&&
currentTime
<
endTime
)
{
tempTimeList
.
Add
(
timeItem
);
}
}
firstModel
.
TimeList
=
tempTimeList
;
}
}
}
}
}
#
endregion
return
new
return
new
{
{
goods
=
new
goods
=
new
...
@@ -3674,7 +3754,8 @@ namespace Mall.Module.Product
...
@@ -3674,7 +3754,8 @@ namespace Mall.Module.Product
qitem
.
Name
,
qitem
.
Name
,
qitem
.
Major
,
qitem
.
Major
,
Gender
=
qitem
.
Gender
.
ToInt
()
Gender
=
qitem
.
Gender
.
ToInt
()
})
}),
storeDateList
=
storeDateList
.
Select
(
qitem
=>
new
{
qitem
.
DayDateStr
,
qitem
.
WeekDayStr
,
qitem
.
TimeList
})
},
},
delivery
=
""
delivery
=
""
};
};
...
...
Mall.Repository/Reserve/RB_Reserve_ServicePersonalRepository.cs
View file @
23aa6918
...
@@ -148,5 +148,32 @@ LEFT JOIN (SELECT ServicePersonalId,COUNT(*) as CommentNum from rb_goods_commen
...
@@ -148,5 +148,32 @@ LEFT JOIN (SELECT ServicePersonalId,COUNT(*) as CommentNum from rb_goods_commen
}
}
return
Get
<
RB_Reserve_ServicePersonal_Extend
>(
builder
.
ToString
()).
ToList
();
return
Get
<
RB_Reserve_ServicePersonal_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
/// <summary>
/// 根据门店、商品编号和商品分类编号获取服务人员列表
/// </summary>
/// <param name="storeId"></param>
/// <param name="productId"></param>
/// <param name="categoryIds"></param>
/// <returns></returns>
public
List
<
RB_Reserve_ServicePersonal_Extend
>
GetServicePersonalListExtRepository
(
int
storeId
,
int
productId
,
string
categoryIds
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT DISTINCT A.*
FROM RB_Reserve_ServicePersonal AS A
INNER JOIN
(
SELECT * FROM rb_reserve_servicepersonalproduct WHERE ServiceType=3 AND `Status`=0
UNION
SELECT * FROM rb_reserve_servicepersonalproduct WHERE ServiceType=2 AND `Status`=0 AND ProductId={0}
UNION
SELECT * FROM rb_reserve_servicepersonalproduct WHERE ServiceType=1 AND `Status`=0 AND ProductId IN({1})
) AS B ON A.ID=B.ServiceId
WHERE A.Status=0 AND A.StoreId={2}
"
,
productId
,
categoryIds
,
storeId
);
return
Get
<
RB_Reserve_ServicePersonal_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
}
}
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