记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
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
董敬伟
liquidnet-bus-v1
Commits
152844a5
Commit
152844a5
authored
Aug 01, 2022
by
GaoHu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exit添加注解
parent
e6f4ad34
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
82 additions
and
75 deletions
+82
-75
GoblinMixDetailsVo.java
...m/liquidnet/service/goblin/dto/vo/GoblinMixDetailsVo.java
+1
-0
IGoblinGoodsAnticipateService.java
...service/goblin/service/IGoblinGoodsAnticipateService.java
+14
-0
IGoblinGoodsAnticipateMgService.java
...oblin/service/manage/IGoblinGoodsAnticipateMgService.java
+0
-12
GoblinGoodsAnticipateController.java
...ce/goblin/controller/GoblinGoodsAnticipateController.java
+21
-0
GoblinMixAppController.java
...net/service/goblin/controller/GoblinMixAppController.java
+0
-21
GoblinGoodsAnticipateServiceImpl.java
...goblin/service/impl/GoblinGoodsAnticipateServiceImpl.java
+44
-0
GoblinGoodsAnticipateMgServiceImpl.java
...rvice/impl/manage/GoblinGoodsAnticipateMgServiceImpl.java
+0
-42
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+2
-0
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinMixDetailsVo.java
View file @
152844a5
...
@@ -120,6 +120,7 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
...
@@ -120,6 +120,7 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
return
this
;
return
this
;
}
}
//上架时间不为空则返回上架时间否则返回开始时间
public
CharSequence
getTimeStartOrShelvesTime
(
GoblinMixDetailsVo
item
)
{
public
CharSequence
getTimeStartOrShelvesTime
(
GoblinMixDetailsVo
item
)
{
if
(
item
.
getShelvesTime
()!=
null
){
if
(
item
.
getShelvesTime
()!=
null
){
return
item
.
getShelvesTime
();
return
item
.
getShelvesTime
();
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/IGoblinGoodsAnticipateService.java
View file @
152844a5
...
@@ -57,4 +57,18 @@ public interface IGoblinGoodsAnticipateService {
...
@@ -57,4 +57,18 @@ public interface IGoblinGoodsAnticipateService {
ResponseDto
<
String
>
getTurnOnHelp
(
String
skuId
);
ResponseDto
<
String
>
getTurnOnHelp
(
String
skuId
);
ResponseDto
<
Boolean
>
helpSid
(
String
sid
);
ResponseDto
<
Boolean
>
helpSid
(
String
sid
);
/**
* 组合购用户预约
* @param mixId 组合购id
* @return Boolean
*/
ResponseDto
<
Boolean
>
reserveByMix
(
String
mixId
);
/**
* 根据mixId查询用户是否预约该混合购
* @param mixId 组合购id
* @return Boolean
*/
ResponseDto
<
Boolean
>
reserveMixByUid
(
String
mixId
);
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/manage/IGoblinGoodsAnticipateMgService.java
View file @
152844a5
...
@@ -56,17 +56,5 @@ public interface IGoblinGoodsAnticipateMgService {
...
@@ -56,17 +56,5 @@ public interface IGoblinGoodsAnticipateMgService {
*/
*/
AnticipateValueVo
getAnticipateValueBySkuId
(
String
skuId
,
int
hasHead
);
AnticipateValueVo
getAnticipateValueBySkuId
(
String
skuId
,
int
hasHead
);
/**
* 组合购用户预约
* @param mixId 组合购id
* @return Boolean
*/
ResponseDto
<
Boolean
>
reserveByMix
(
String
mixId
);
/**
* 根据mixId查询用户是否预约该混合购
* @param mixId 组合购id
* @return Boolean
*/
ResponseDto
<
Boolean
>
reserveMixByUid
(
String
mixId
);
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinGoodsAnticipateController.java
View file @
152844a5
package
com
.
liquidnet
.
service
.
goblin
.
controller
;
package
com
.
liquidnet
.
service
.
goblin
.
controller
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.manage.vo.HelpValueVo
;
import
com.liquidnet.service.goblin.dto.manage.vo.HelpValueVo
;
import
com.liquidnet.service.goblin.service.IGoblinGoodsAnticipateService
;
import
com.liquidnet.service.goblin.service.IGoblinGoodsAnticipateService
;
...
@@ -98,4 +99,24 @@ public class GoblinGoodsAnticipateController {
...
@@ -98,4 +99,24 @@ public class GoblinGoodsAnticipateController {
return
goblinGoodsAnticipateService
.
getTurnOnHelp
(
skuId
);
return
goblinGoodsAnticipateService
.
getTurnOnHelp
(
skuId
);
}
}
@ApiOperationSupport
(
order
=
6
)
@ApiOperation
(
value
=
"混合购【用户预约MIX混合购】"
)
@GetMapping
(
"reserveByMix"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"mixId"
,
value
=
"混合售id"
),
})
public
ResponseDto
<
Boolean
>
reserveByMix
(
@RequestParam
(
value
=
"mixId"
,
required
=
true
)
String
mixId
)
{
return
goblinGoodsAnticipateService
.
reserveByMix
(
mixId
);
}
@ApiOperationSupport
(
order
=
7
)
@ApiOperation
(
value
=
"混合购【根据mixId查询用户是否预约该混合购】"
)
@GetMapping
(
"reserveMixByUid"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"mixId"
,
value
=
"混合售id"
),
})
public
ResponseDto
<
Boolean
>
reserveMixByUid
(
@RequestParam
(
value
=
"mixId"
,
required
=
true
)
String
mixId
)
{
return
goblinGoodsAnticipateService
.
reserveMixByUid
(
mixId
);
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinMixAppController.java
View file @
152844a5
...
@@ -30,8 +30,6 @@ public class GoblinMixAppController {
...
@@ -30,8 +30,6 @@ public class GoblinMixAppController {
@Autowired
@Autowired
IGoblinMixAppService
goblinMixAppService
;
IGoblinMixAppService
goblinMixAppService
;
@Autowired
IGoblinGoodsAnticipateMgService
goblinGoodsAnticipateMgService
;
@ApiOperationSupport
(
order
=
1
)
@ApiOperationSupport
(
order
=
1
)
@ApiOperation
(
value
=
"列表"
)
@ApiOperation
(
value
=
"列表"
)
...
@@ -83,23 +81,4 @@ public class GoblinMixAppController {
...
@@ -83,23 +81,4 @@ public class GoblinMixAppController {
return
goblinMixAppService
.
canBy
(
mixId
,
CurrentUtil
.
getCurrentUid
());
return
goblinMixAppService
.
canBy
(
mixId
,
CurrentUtil
.
getCurrentUid
());
}
}
@ApiOperationSupport
(
order
=
6
)
@ApiOperation
(
value
=
"用户预约MIX混合购"
)
@GetMapping
(
"reserveByMix"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"mixId"
,
value
=
"混合售id"
),
})
public
ResponseDto
<
Boolean
>
reserveByMix
(
@RequestParam
(
value
=
"mixId"
,
required
=
true
)
String
mixId
)
{
return
goblinGoodsAnticipateMgService
.
reserveByMix
(
mixId
);
}
@ApiOperationSupport
(
order
=
7
)
@ApiOperation
(
value
=
"根据mixId查询用户是否预约该混合购"
)
@GetMapping
(
"reserveMixByUid"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"mixId"
,
value
=
"混合售id"
),
})
public
ResponseDto
<
Boolean
>
reserveMixByUid
(
@RequestParam
(
value
=
"mixId"
,
required
=
true
)
String
mixId
)
{
return
goblinGoodsAnticipateMgService
.
reserveMixByUid
(
mixId
);
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinGoodsAnticipateServiceImpl.java
View file @
152844a5
...
@@ -26,6 +26,8 @@ import java.time.LocalDateTime;
...
@@ -26,6 +26,8 @@ import java.time.LocalDateTime;
import
java.util.LinkedList
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.List
;
import
static
com
.
liquidnet
.
commons
.
lang
.
util
.
DateUtil
.
DTF_YMD_HMS
;
/**
/**
* <p>
* <p>
* 预约表 服务实现类
* 预约表 服务实现类
...
@@ -308,4 +310,46 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
...
@@ -308,4 +310,46 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
sqlStr
);
sqlStr
);
}
}
@Override
public
ResponseDto
<
Boolean
>
reserveByMix
(
String
mixId
)
{
//获取udi
String
uid
=
CurrentUtil
.
getCurrentUid
();
LocalDateTime
now
=
LocalDateTime
.
now
();
//redis查询用户预约组合购记录
if
(
goblinRedisUtils
.
getReserveMixByUid
(
uid
,
mixId
)
==
null
)
{
//该混合狗能否被预约
GoblinMixDetailsVo
mixDetails
=
goblinRedisUtils
.
getMixDetails
(
mixId
);
LocalDateTime
st
=
LocalDateTime
.
parse
(
mixDetails
.
getTimeStartOrShelvesTime
(
mixDetails
),
DTF_YMD_HMS
);
//组合购开启预约且当前时间大于预约购开始时间或者上架时间才可预约
if
(
mixDetails
.
getReserve
()
!=
0
&&
now
.
isBefore
(
st
))
{
GoblinMixReserveVo
goblinMixReserveVo
=
GoblinMixReserveVo
.
getNew
();
goblinMixReserveVo
.
setMixId
(
mixId
);
goblinMixReserveVo
.
setCreatedDate
(
now
);
goblinMixReserveVo
.
setUid
(
uid
);
String
mobile
=
StringUtils
.
defaultString
(((
String
)
CurrentUtil
.
getTokenClaims
().
get
(
CurrentUtil
.
TOKEN_MOBILE
)),
""
);
goblinMixReserveVo
.
setPhone
(
mobile
);
//redis保存用户预约组合购记录
goblinRedisUtils
.
setReserveMixByUid
(
goblinMixReserveVo
);
//发送redis消息修改mysql记录用户预约
String
mid
=
IDGenerator
.
nextTimeId2
();
LinkedList
<
Object
[]>
sqlValue
=
CollectionUtil
.
linkedListObjectArr
();
sqlValue
.
add
(
new
Object
[]{
mid
,
uid
,
mobile
,
mixId
});
sendRedis
(
"goblin_goods_anticipate_mix"
,
sqlValue
);
}
}
return
ResponseDto
.
success
();
}
@Override
public
ResponseDto
<
Boolean
>
reserveMixByUid
(
String
mixId
)
{
//获取udi
String
uid
=
CurrentUtil
.
getCurrentUid
();
return
ResponseDto
.
success
(
goblinRedisUtils
.
getReserveMixByUid
(
uid
,
mixId
)
!=
null
);
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinGoodsAnticipateMgServiceImpl.java
View file @
152844a5
...
@@ -247,46 +247,4 @@ public class GoblinGoodsAnticipateMgServiceImpl implements IGoblinGoodsAnticipat
...
@@ -247,46 +247,4 @@ public class GoblinGoodsAnticipateMgServiceImpl implements IGoblinGoodsAnticipat
sqlStr
);
sqlStr
);
}
}
@Override
public
ResponseDto
<
Boolean
>
reserveByMix
(
String
mixId
)
{
//获取udi
String
uid
=
CurrentUtil
.
getCurrentUid
();
LocalDateTime
now
=
LocalDateTime
.
now
();
//redis查询用户预约组合购记录
if
(
goblinRedisUtils
.
getReserveMixByUid
(
uid
,
mixId
)
==
null
)
{
//该混合狗能否被预约
GoblinMixDetailsVo
mixDetails
=
goblinRedisUtils
.
getMixDetails
(
mixId
);
LocalDateTime
st
=
LocalDateTime
.
parse
(
mixDetails
.
getTimeStartOrShelvesTime
(
mixDetails
),
DTF_YMD_HMS
);
//组合购开启预约且当前时间大于预约购开始时间或者上架时间才可预约
if
(
mixDetails
.
getReserve
()
!=
0
&&
now
.
isBefore
(
st
))
{
GoblinMixReserveVo
goblinMixReserveVo
=
GoblinMixReserveVo
.
getNew
();
goblinMixReserveVo
.
setMixId
(
mixId
);
goblinMixReserveVo
.
setCreatedDate
(
now
);
goblinMixReserveVo
.
setUid
(
uid
);
String
mobile
=
StringUtils
.
defaultString
(((
String
)
CurrentUtil
.
getTokenClaims
().
get
(
CurrentUtil
.
TOKEN_MOBILE
)),
""
);
goblinMixReserveVo
.
setPhone
(
mobile
);
//redis保存用户预约组合购记录
goblinRedisUtils
.
setReserveMixByUid
(
goblinMixReserveVo
);
//发送redis消息修改mysql记录用户预约
String
mid
=
IDGenerator
.
nextTimeId2
();
LinkedList
<
Object
[]>
sqlValue
=
CollectionUtil
.
linkedListObjectArr
();
sqlValue
.
add
(
new
Object
[]{
mid
,
uid
,
mobile
,
mixId
});
sendRedis
(
"goblin_goods_anticipate_mix"
,
sqlValue
);
}
}
return
ResponseDto
.
success
();
}
@Override
public
ResponseDto
<
Boolean
>
reserveMixByUid
(
String
mixId
)
{
//获取udi
String
uid
=
CurrentUtil
.
getCurrentUid
();
return
ResponseDto
.
success
(
goblinRedisUtils
.
getReserveMixByUid
(
uid
,
mixId
)
!=
null
);
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
152844a5
...
@@ -2594,11 +2594,13 @@ public class GoblinRedisUtils {
...
@@ -2594,11 +2594,13 @@ public class GoblinRedisUtils {
setGoblinMixSkuStartList
(
mixIds
);
setGoblinMixSkuStartList
(
mixIds
);
}
}
//保存用户预约
public
void
setReserveMixByUid
(
GoblinMixReserveVo
goblinMixReserveVo
)
{
public
void
setReserveMixByUid
(
GoblinMixReserveVo
goblinMixReserveVo
)
{
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_RESERVE_UID
.
concat
(
goblinMixReserveVo
.
getMixId
()).
concat
(
":"
).
concat
(
goblinMixReserveVo
.
getUid
());
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_RESERVE_UID
.
concat
(
goblinMixReserveVo
.
getMixId
()).
concat
(
":"
).
concat
(
goblinMixReserveVo
.
getUid
());
redisUtil
.
set
(
rdk
,
1
);
redisUtil
.
set
(
rdk
,
1
);
}
}
//根据用户uid和混合mixId查询用户预约
public
GoblinMixReserveVo
getReserveMixByUid
(
String
uid
,
String
mixId
)
{
public
GoblinMixReserveVo
getReserveMixByUid
(
String
uid
,
String
mixId
)
{
return
(
GoblinMixReserveVo
)
redisUtil
.
get
(
GoblinRedisConst
.
GOBLIN_MIX_RESERVE_UID
.
concat
(
mixId
).
concat
(
":"
).
concat
(
uid
));
return
(
GoblinMixReserveVo
)
redisUtil
.
get
(
GoblinRedisConst
.
GOBLIN_MIX_RESERVE_UID
.
concat
(
mixId
).
concat
(
":"
).
concat
(
uid
));
}
}
...
...
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