Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gogirl-miniapp-backend
Overview
Overview
Details
Activity
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
huluobin
gogirl-miniapp-backend
Commits
075f959d
Commit
075f959d
authored
Jul 20, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会员福利提前一天预约
parent
71122a23
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
4 deletions
+46
-4
ScheduleManageServiceImpl.java
...plication/order/serve/impl/ScheduleManageServiceImpl.java
+9
-3
BaseTypeService.java
...com/gogirl/application/product/serve/BaseTypeService.java
+8
-0
BaseTypeServiceImpl.java
...l/application/product/serve/impl/BaseTypeServiceImpl.java
+12
-0
BaseTypeMapper.java
...l/infrastructure/mapper/product/serve/BaseTypeMapper.java
+9
-1
BaseTypeMapper.xml
src/main/resources/mapper/product/BaseTypeMapper.xml
+8
-0
No files found.
src/main/java/com/gogirl/application/order/serve/impl/ScheduleManageServiceImpl.java
View file @
075f959d
...
...
@@ -43,6 +43,7 @@ import com.gogirl.infrastructure.mapper.store.store.StoreTechnicianMapper;
import
com.gogirl.infrastructure.service.push.TechnicianPushService
;
import
com.gogirl.infrastructure.util.MapDistanceUtils
;
import
com.gogirl.infrastructure.util.SessionUtils
;
import
com.gogirl.shared.order.Period
;
import
com.gogirl.shared.order.*
;
import
com.gogirl.shared.product.LeisureScheduleServeQuery
;
import
com.gogirl.shared.product.LeisureScheduleServeResp
;
...
...
@@ -56,9 +57,7 @@ import org.springframework.util.CollectionUtils;
import
java.math.BigDecimal
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDateTime
;
import
java.time.ZoneId
;
import
java.time.ZoneOffset
;
import
java.time.*
;
import
java.util.*
;
import
java.util.concurrent.ExecutionException
;
import
java.util.concurrent.ForkJoinPool
;
...
...
@@ -131,6 +130,7 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
//一天结束的时间
long
dayEndTime
=
simpleDateFormat
.
parse
(
day
+
" 23:59:59"
).
getTime
();
boolean
containFreeServe
=
baseTypeService
.
containFreeServe
(
serveIdList
);
//遍历美甲师排班 获取每个美甲师的不可用时间段
for
(
StoreClassesTechnician
storeClassesTechnician
:
storeClassesTechnicianList
)
{
...
...
@@ -186,6 +186,12 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
periodList
.
add
(
period4
);
}
if
(
containFreeServe
)
{
Period
today
=
new
Period
(
LocalDateTime
.
of
(
LocalDate
.
now
(),
LocalTime
.
MIN
).
toInstant
(
ZoneOffset
.
of
(
"+8"
)).
toEpochMilli
(),
LocalDateTime
.
of
(
LocalDate
.
now
().
plusDays
(
1
),
LocalTime
.
MIN
).
toInstant
(
ZoneOffset
.
of
(
"+8"
)).
toEpochMilli
());
periodList
.
add
(
today
);
}
/*9、构造返回值*/
StoreTechnicianPeriod
storeTechnicianDTO
=
new
StoreTechnicianPeriod
(
periodList
,
storeClassesTechnician
.
getTechnicianManage
());
storeTechnicianPeriodList
.
add
(
storeTechnicianDTO
);
...
...
src/main/java/com/gogirl/application/product/serve/BaseTypeService.java
View file @
075f959d
...
...
@@ -4,10 +4,18 @@ package com.gogirl.application.product.serve;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.gogirl.domain.product.serve.BaseType
;
import
java.util.List
;
/**
* Created by yinyong on 2018/9/4.
* 美容服务类型 服务接口
*/
public
interface
BaseTypeService
extends
IService
<
BaseType
>
{
/**
* 是否包含会员福利
* @param serveIdList
* @return
*/
boolean
containFreeServe
(
List
<
Integer
>
serveIdList
);
}
src/main/java/com/gogirl/application/product/serve/impl/BaseTypeServiceImpl.java
View file @
075f959d
...
...
@@ -7,11 +7,23 @@ import com.gogirl.domain.product.serve.BaseType;
import
com.gogirl.infrastructure.mapper.product.serve.BaseTypeMapper
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* Created by yinyong on 2018/9/4.
*/
@Service
public
class
BaseTypeServiceImpl
extends
ServiceImpl
<
BaseTypeMapper
,
BaseType
>
implements
BaseTypeService
{
@Resource
private
BaseTypeMapper
baseTypeMapper
;
@Override
public
boolean
containFreeServe
(
List
<
Integer
>
serveIdList
)
{
List
<
BaseType
>
baseTypeList
=
baseTypeMapper
.
selectByServeIds
(
serveIdList
);
return
baseTypeList
.
stream
().
map
(
BaseType:
:
getName
).
collect
(
Collectors
.
toList
()).
contains
(
"会员福利"
);
}
}
src/main/java/com/gogirl/infrastructure/mapper/product/serve/BaseTypeMapper.java
View file @
075f959d
...
...
@@ -3,9 +3,17 @@ package com.gogirl.infrastructure.mapper.product.serve;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.gogirl.domain.product.serve.BaseType
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
public
interface
BaseTypeMapper
extends
BaseMapper
<
BaseType
>
{
/**
* 查询服务id对应的服务类型
*
* @param serveIdList
* @return
*/
List
<
BaseType
>
selectByServeIds
(
List
<
Integer
>
serveIdList
);
}
src/main/resources/mapper/product/BaseTypeMapper.xml
View file @
075f959d
...
...
@@ -3,4 +3,12 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.gogirl.infrastructure.mapper.product.serve.BaseTypeMapper"
>
<select
id=
"selectByServeIds"
resultType=
"com.gogirl.domain.product.serve.BaseType"
>
SELECT t2.* from base_serve t1
LEFT JOIN base_type t2 on t1.type_id = t2.id
where t1.id in
<foreach
collection=
"serveIdList"
item=
"id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</select>
</mapper>
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