记得上下班打卡 | 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
129baaa7
Commit
129baaa7
authored
Aug 05, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'gaohu_0727_GoblinMix' into pre
parents
e0bf13c9
9fae46f9
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
252 additions
and
41 deletions
+252
-41
GoblinRedisConst.java
...m/liquidnet/service/goblin/constant/GoblinRedisConst.java
+5
-0
GoblinMixAppDetailsVo.java
...iquidnet/service/goblin/dto/vo/GoblinMixAppDetailsVo.java
+11
-1
GoblinMixAppListVo.java
...m/liquidnet/service/goblin/dto/vo/GoblinMixAppListVo.java
+10
-1
GoblinMixDetailsVo.java
...m/liquidnet/service/goblin/dto/vo/GoblinMixDetailsVo.java
+14
-0
GoblinMixReserveVo.java
...m/liquidnet/service/goblin/dto/vo/GoblinMixReserveVo.java
+47
-0
GoblinMixDetailsParam.java
...liquidnet/service/goblin/param/GoblinMixDetailsParam.java
+4
-1
GoblinMixUpdateParam.java
.../liquidnet/service/goblin/param/GoblinMixUpdateParam.java
+4
-0
IGoblinGoodsAnticipateService.java
...service/goblin/service/IGoblinGoodsAnticipateService.java
+14
-0
IGoblinGoodsAnticipateMgService.java
...oblin/service/manage/IGoblinGoodsAnticipateMgService.java
+2
-0
GoblinGoodsAnticipateController.java
...ce/goblin/controller/GoblinGoodsAnticipateController.java
+22
-0
GoblinMixAppController.java
...net/service/goblin/controller/GoblinMixAppController.java
+3
-0
GoblinGoodsAnticipateServiceImpl.java
...goblin/service/impl/GoblinGoodsAnticipateServiceImpl.java
+62
-15
GoblinMixAppServiceImpl.java
.../service/goblin/service/impl/GoblinMixAppServiceImpl.java
+11
-16
GoblinJobServiceImpl.java
...rvice/goblin/service/impl/inner/GoblinJobServiceImpl.java
+3
-2
GoblinGoodsAnticipateMgServiceImpl.java
...rvice/impl/manage/GoblinGoodsAnticipateMgServiceImpl.java
+4
-0
GoblinMixServiceImpl.java
...vice/goblin/service/impl/manage/GoblinMixServiceImpl.java
+14
-2
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+18
-0
sqlmap.properties
...-service-goblin-impl/src/main/resources/sqlmap.properties
+4
-3
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/constant/GoblinRedisConst.java
View file @
129baaa7
...
@@ -338,6 +338,11 @@ public class GoblinRedisConst {
...
@@ -338,6 +338,11 @@ public class GoblinRedisConst {
public
static
final
String
GOBLIN_MIX_LIMIT
=
PREFIX
.
concat
(
"mix:limit:"
);
//$key:$mixId:$uid 混合售开始列表
public
static
final
String
GOBLIN_MIX_LIMIT
=
PREFIX
.
concat
(
"mix:limit:"
);
//$key:$mixId:$uid 混合售开始列表
public
static
final
String
GOBLIN_MIX_RESERVE_UID
=
PREFIX
.
concat
(
"mix:reserve:uid:"
);
//$mixId:$uid 混合售用户预约保存
/* ----------------------------------------------------------------- */
/* ----------------------------------------------------------------- */
public
static
final
String
GOBLIN_ORDER_LOG
=
PREFIX
.
concat
(
"order:log:"
);
//无用
public
static
final
String
GOBLIN_ORDER_LOG
=
PREFIX
.
concat
(
"order:log:"
);
//无用
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinMixAppDetailsVo.java
View file @
129baaa7
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
vo
;
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
vo
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.service.goblin.param.GoblinMixDetailsParam
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
...
@@ -51,6 +50,14 @@ public class GoblinMixAppDetailsVo implements Serializable, Cloneable {
...
@@ -51,6 +50,14 @@ public class GoblinMixAppDetailsVo implements Serializable, Cloneable {
private
BigDecimal
sellPrice
;
private
BigDecimal
sellPrice
;
@ApiModelProperty
(
position
=
23
,
value
=
"原价"
)
@ApiModelProperty
(
position
=
23
,
value
=
"原价"
)
private
BigDecimal
price
;
private
BigDecimal
price
;
@ApiModelProperty
(
position
=
22
,
value
=
"上架时间"
)
private
String
shelvesTime
;
@ApiModelProperty
(
position
=
23
,
value
=
"预约开启标识[0:未开启,1:开启]"
)
private
int
reserve
;
@ApiModelProperty
(
value
=
"系统时间"
)
private
String
sysTime
;
@ApiModelProperty
(
value
=
"用户预约标识[0:未预约,1:预约]"
)
private
int
userReserve
;
private
static
final
GoblinMixAppDetailsVo
obj
=
new
GoblinMixAppDetailsVo
();
private
static
final
GoblinMixAppDetailsVo
obj
=
new
GoblinMixAppDetailsVo
();
...
@@ -82,6 +89,9 @@ public class GoblinMixAppDetailsVo implements Serializable, Cloneable {
...
@@ -82,6 +89,9 @@ public class GoblinMixAppDetailsVo implements Serializable, Cloneable {
this
.
setStoreName
(
storeName
);
this
.
setStoreName
(
storeName
);
this
.
setPrice
(
source
.
getPrice
());
this
.
setPrice
(
source
.
getPrice
());
this
.
setSellPrice
(
source
.
getSellPrice
());
this
.
setSellPrice
(
source
.
getSellPrice
());
this
.
setShelvesTime
(
source
.
getShelvesTime
());
this
.
setReserve
(
source
.
getReserve
());
this
.
setSysTime
(
DateUtil
.
getNowTime
());
return
this
;
return
this
;
}
}
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinMixAppListVo.java
View file @
129baaa7
...
@@ -33,6 +33,12 @@ public class GoblinMixAppListVo implements Serializable, Cloneable {
...
@@ -33,6 +33,12 @@ public class GoblinMixAppListVo implements Serializable, Cloneable {
private
BigDecimal
price
;
private
BigDecimal
price
;
@ApiModelProperty
(
position
=
9
,
value
=
"活动创建时间"
)
@ApiModelProperty
(
position
=
9
,
value
=
"活动创建时间"
)
private
String
createdAt
;
private
String
createdAt
;
@ApiModelProperty
(
position
=
10
,
value
=
"当前时间"
)
private
String
nowTime
;
@ApiModelProperty
(
position
=
22
,
value
=
"上架时间"
)
private
String
shelvesTime
;
@ApiModelProperty
(
position
=
23
,
value
=
"预约开启标识[0:未开启,1开启]"
)
private
int
reserve
;
private
static
final
GoblinMixAppListVo
obj
=
new
GoblinMixAppListVo
();
private
static
final
GoblinMixAppListVo
obj
=
new
GoblinMixAppListVo
();
...
@@ -44,7 +50,7 @@ public class GoblinMixAppListVo implements Serializable, Cloneable {
...
@@ -44,7 +50,7 @@ public class GoblinMixAppListVo implements Serializable, Cloneable {
}
}
}
}
public
GoblinMixAppListVo
copy
(
GoblinMixDetailsVo
source
)
{
public
GoblinMixAppListVo
copy
(
GoblinMixDetailsVo
source
,
String
nowTime
)
{
if
(
null
==
source
)
return
this
;
if
(
null
==
source
)
return
this
;
this
.
setMixId
(
source
.
getMixId
());
this
.
setMixId
(
source
.
getMixId
());
this
.
setName
(
source
.
getName
());
this
.
setName
(
source
.
getName
());
...
@@ -55,6 +61,9 @@ public class GoblinMixAppListVo implements Serializable, Cloneable {
...
@@ -55,6 +61,9 @@ public class GoblinMixAppListVo implements Serializable, Cloneable {
this
.
setSellPrice
(
source
.
getSellPrice
());
this
.
setSellPrice
(
source
.
getSellPrice
());
this
.
setPrice
(
source
.
getPrice
());
this
.
setPrice
(
source
.
getPrice
());
this
.
setCreatedAt
(
source
.
getCreatedAt
());
this
.
setCreatedAt
(
source
.
getCreatedAt
());
this
.
setShelvesTime
(
source
.
getShelvesTime
());
this
.
setNowTime
(
nowTime
);
this
.
setReserve
(
source
.
getReserve
());
return
this
;
return
this
;
}
}
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinMixDetailsVo.java
View file @
129baaa7
...
@@ -70,6 +70,10 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
...
@@ -70,6 +70,10 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
private
String
xlsName
;
private
String
xlsName
;
@ApiModelProperty
(
position
=
26
,
value
=
"店铺id"
)
@ApiModelProperty
(
position
=
26
,
value
=
"店铺id"
)
private
String
storeId
;
private
String
storeId
;
@ApiModelProperty
(
position
=
22
,
value
=
"上架时间"
)
private
String
shelvesTime
;
@ApiModelProperty
(
value
=
"预约开启标识"
)
private
int
reserve
;
private
static
final
GoblinMixDetailsVo
obj
=
new
GoblinMixDetailsVo
();
private
static
final
GoblinMixDetailsVo
obj
=
new
GoblinMixDetailsVo
();
...
@@ -111,6 +115,16 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
...
@@ -111,6 +115,16 @@ public class GoblinMixDetailsVo implements Serializable, Cloneable {
this
.
setPayType
(
source
.
getPayType
());
this
.
setPayType
(
source
.
getPayType
());
this
.
setXlsName
(
source
.
getXlsName
());
this
.
setXlsName
(
source
.
getXlsName
());
this
.
setStoreId
(
source
.
getStoreId
());
this
.
setStoreId
(
source
.
getStoreId
());
this
.
setShelvesTime
(
source
.
getShelvesTime
());
this
.
setReserve
(
source
.
getReserve
());
return
this
;
return
this
;
}
}
//上架时间不为空则返回上架时间否则返回开始时间
public
CharSequence
getTimeStartOrShelvesTime
(
GoblinMixDetailsVo
item
)
{
if
(
item
.
getShelvesTime
()!=
null
){
return
item
.
getShelvesTime
();
}
return
item
.
getTimeStart
();
}
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinMixReserveVo.java
0 → 100644
View file @
129baaa7
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
* <p>
* 商城订单表
* </p>
*
* @author liquidnet
* @since 2021-12-27
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
GoblinMixReserveVo
implements
Serializable
,
Cloneable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
" mix预约表生成id"
)
private
String
mid
;
@ApiModelProperty
(
value
=
" mixId"
)
private
String
mixId
;
@ApiModelProperty
(
value
=
" uid"
)
private
String
uid
;
@ApiModelProperty
(
value
=
" 预约人手机号"
)
private
String
phone
;
@ApiModelProperty
(
value
=
" 预约时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
createdDate
;
private
static
final
GoblinMixReserveVo
obj
=
new
GoblinMixReserveVo
();
public
static
GoblinMixReserveVo
getNew
()
{
try
{
return
(
GoblinMixReserveVo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
GoblinMixReserveVo
();
}
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/param/GoblinMixDetailsParam.java
View file @
129baaa7
...
@@ -53,7 +53,10 @@ public class GoblinMixDetailsParam implements Serializable, Cloneable {
...
@@ -53,7 +53,10 @@ public class GoblinMixDetailsParam implements Serializable, Cloneable {
private
String
xlsName
;
private
String
xlsName
;
@ApiModelProperty
(
position
=
21
,
value
=
"店铺id"
)
@ApiModelProperty
(
position
=
21
,
value
=
"店铺id"
)
private
String
storeId
;
private
String
storeId
;
@ApiModelProperty
(
position
=
22
,
value
=
"上架时间"
)
private
String
shelvesTime
;
@ApiModelProperty
(
position
=
23
,
value
=
"预约开启标识[0:未开启,1开启]"
)
private
int
reserve
;
private
static
final
GoblinMixDetailsParam
obj
=
new
GoblinMixDetailsParam
();
private
static
final
GoblinMixDetailsParam
obj
=
new
GoblinMixDetailsParam
();
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/param/GoblinMixUpdateParam.java
View file @
129baaa7
...
@@ -22,6 +22,10 @@ public class GoblinMixUpdateParam implements Serializable, Cloneable {
...
@@ -22,6 +22,10 @@ public class GoblinMixUpdateParam implements Serializable, Cloneable {
private
String
whiteUrl
;
private
String
whiteUrl
;
@ApiModelProperty
(
position
=
20
,
value
=
"xls名称"
)
@ApiModelProperty
(
position
=
20
,
value
=
"xls名称"
)
private
String
xlsName
;
private
String
xlsName
;
@ApiModelProperty
(
position
=
22
,
value
=
"上架时间"
)
private
String
shelvesTime
;
@ApiModelProperty
(
position
=
23
,
value
=
"预约开启标识[0:未开启,1开启]"
)
private
int
reserve
;
private
static
final
GoblinMixUpdateParam
obj
=
new
GoblinMixUpdateParam
();
private
static
final
GoblinMixUpdateParam
obj
=
new
GoblinMixUpdateParam
();
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/IGoblinGoodsAnticipateService.java
View file @
129baaa7
...
@@ -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 @
129baaa7
...
@@ -55,4 +55,6 @@ public interface IGoblinGoodsAnticipateMgService {
...
@@ -55,4 +55,6 @@ public interface IGoblinGoodsAnticipateMgService {
* @return 预约关联sku和spu表
* @return 预约关联sku和spu表
*/
*/
AnticipateValueVo
getAnticipateValueBySkuId
(
String
skuId
,
int
hasHead
);
AnticipateValueVo
getAnticipateValueBySkuId
(
String
skuId
,
int
hasHead
);
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinGoodsAnticipateController.java
View file @
129baaa7
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,25 @@ public class GoblinGoodsAnticipateController {
...
@@ -98,4 +99,25 @@ 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 @
129baaa7
...
@@ -5,6 +5,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiSupport;
...
@@ -5,6 +5,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.goblin.service.manage.IGoblinGoodsAnticipateMgService
;
import
com.liquidnet.service.goblin.service.manage.IGoblinMixAppService
;
import
com.liquidnet.service.goblin.service.manage.IGoblinMixAppService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
...
@@ -29,6 +30,7 @@ public class GoblinMixAppController {
...
@@ -29,6 +30,7 @@ public class GoblinMixAppController {
@Autowired
@Autowired
IGoblinMixAppService
goblinMixAppService
;
IGoblinMixAppService
goblinMixAppService
;
@ApiOperationSupport
(
order
=
1
)
@ApiOperationSupport
(
order
=
1
)
@ApiOperation
(
value
=
"列表"
)
@ApiOperation
(
value
=
"列表"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
...
@@ -78,4 +80,5 @@ public class GoblinMixAppController {
...
@@ -78,4 +80,5 @@ public class GoblinMixAppController {
public
ResponseDto
<
Boolean
>
mixCanBy
(
@RequestParam
(
value
=
"mixId"
,
required
=
true
)
String
mixId
)
{
public
ResponseDto
<
Boolean
>
mixCanBy
(
@RequestParam
(
value
=
"mixId"
,
required
=
true
)
String
mixId
)
{
return
goblinMixAppService
.
canBy
(
mixId
,
CurrentUtil
.
getCurrentUid
());
return
goblinMixAppService
.
canBy
(
mixId
,
CurrentUtil
.
getCurrentUid
());
}
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinGoodsAnticipateServiceImpl.java
View file @
129baaa7
...
@@ -2,6 +2,7 @@ package com.liquidnet.service.goblin.service.impl;
...
@@ -2,6 +2,7 @@ package com.liquidnet.service.goblin.service.impl;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.adam.dto.vo.AdamUserInfoVo
;
import
com.liquidnet.service.adam.dto.vo.AdamUserInfoVo
;
import
com.liquidnet.service.base.ErrorMapping
;
import
com.liquidnet.service.base.ErrorMapping
;
...
@@ -20,12 +21,16 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -20,12 +21,16 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.unit.DataUnit
;
import
java.time.Duration
;
import
java.time.Duration
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
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>
* 预约表 服务实现类
* 预约表 服务实现类
...
@@ -84,16 +89,16 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
...
@@ -84,16 +89,16 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
return
ResponseDto
.
failure
(
"预约失败!"
);
return
ResponseDto
.
failure
(
"预约失败!"
);
}
}
}
else
{
}
else
{
log
.
debug
(
"skuId:{},需要助力人数:{},uid:{},该用户未开启分享助力!"
,
skuId
,
anticipateValueVo
.
getPeopleType
(),
uid
);
log
.
debug
(
"skuId:{},需要助力人数:{},uid:{},该用户未开启分享助力!"
,
skuId
,
anticipateValueVo
.
getPeopleType
(),
uid
);
return
ResponseDto
.
failure
(
"预约失败!"
);
return
ResponseDto
.
failure
(
"预约失败!"
);
}
}
}
}
uidAboutBySkuId
(
skuId
,
uid
,
null
);
uidAboutBySkuId
(
skuId
,
uid
,
null
);
}
}
return
ResponseDto
.
success
();
return
ResponseDto
.
success
();
}
}
private
void
uidAboutBySkuId
(
String
skuId
,
String
uid
,
String
avatar
)
{
private
void
uidAboutBySkuId
(
String
skuId
,
String
uid
,
String
avatar
)
{
GoblinGoodAnticipateUserVo
user
=
new
GoblinGoodAnticipateUserVo
();
GoblinGoodAnticipateUserVo
user
=
new
GoblinGoodAnticipateUserVo
();
user
.
setUid
(
uid
);
user
.
setUid
(
uid
);
user
.
setSkuId
(
skuId
);
user
.
setSkuId
(
skuId
);
...
@@ -119,7 +124,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
...
@@ -119,7 +124,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
List
<
String
>
userAvatar
=
goblinRedisUtils
.
getUserAvatar
(
skuId
);
List
<
String
>
userAvatar
=
goblinRedisUtils
.
getUserAvatar
(
skuId
);
if
(
userAvatar
!=
null
&&
userAvatar
.
size
()
<=
2
)
{
if
(
userAvatar
!=
null
&&
userAvatar
.
size
()
<=
2
)
{
//获取预约人头像
//获取预约人头像
if
(
avatar
==
null
)
{
if
(
avatar
==
null
)
{
avatar
=
goblinAnticipateUtils
.
getUserInfo
().
getAvatar
();
avatar
=
goblinAnticipateUtils
.
getUserInfo
().
getAvatar
();
}
}
goblinRedisUtils
.
setUserAvatar
(
skuId
,
avatar
);
goblinRedisUtils
.
setUserAvatar
(
skuId
,
avatar
);
...
@@ -149,8 +154,8 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
...
@@ -149,8 +154,8 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//可以创建分享
//可以创建分享
//查询redis关联记录
//查询redis关联记录
String
sid
=
goblinRedisUtils
.
getShare
(
skuId
,
uid
);
String
sid
=
goblinRedisUtils
.
getShare
(
skuId
,
uid
);
if
(
sid
!=
null
)
{
if
(
sid
!=
null
)
{
return
ResponseDto
.
failure
(
"0"
,
"已开启助力"
,
sid
);
return
ResponseDto
.
failure
(
"0"
,
"已开启助力"
,
sid
);
}
else
{
}
else
{
//查询sku需要助力人数
//查询sku需要助力人数
//Integer skuIdPeople = goblinRedisUtils.getSharePeopleBySkuId(skuId);
//Integer skuIdPeople = goblinRedisUtils.getSharePeopleBySkuId(skuId);
...
@@ -177,7 +182,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
...
@@ -177,7 +182,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//redis缓存
//redis缓存
Duration
between
=
Duration
.
between
(
valueBySkuId
.
getAboutStartDate
(),
valueBySkuId
.
getAboutEndDate
());
Duration
between
=
Duration
.
between
(
valueBySkuId
.
getAboutStartDate
(),
valueBySkuId
.
getAboutEndDate
());
goblinRedisUtils
.
setShare
(
skuId
,
uid
,
sid
,
between
.
toDays
());
goblinRedisUtils
.
setShare
(
skuId
,
uid
,
sid
,
between
.
toDays
());
//redis存储用户分享
//redis存储用户分享
goblinRedisUtils
.
setShareVo
(
goblinGoodsAnticipateShareVo
);
goblinRedisUtils
.
setShareVo
(
goblinGoodsAnticipateShareVo
);
...
@@ -213,7 +218,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
...
@@ -213,7 +218,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//获取uid
//获取uid
String
uid
=
CurrentUtil
.
getCurrentUid
();
String
uid
=
CurrentUtil
.
getCurrentUid
();
if
(
shareVo
.
getUid
().
equals
(
uid
)){
if
(
shareVo
.
getUid
().
equals
(
uid
))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
150003
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
150003
));
}
}
//查询mongodb 是否助力过该分享
//查询mongodb 是否助力过该分享
...
@@ -235,10 +240,10 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
...
@@ -235,10 +240,10 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
if
(
helpUserAvatar
.
size
()
<=
6
)
{
if
(
helpUserAvatar
.
size
()
<=
6
)
{
//获取用户头像保存
//获取用户头像保存
AdamUserInfoVo
userInfo
=
goblinAnticipateUtils
.
getUserInfo
();
AdamUserInfoVo
userInfo
=
goblinAnticipateUtils
.
getUserInfo
();
if
(
userInfo
!=
null
)
{
if
(
userInfo
!=
null
)
{
//新增助力头像
//新增助力头像
goblinRedisUtils
.
setHelpUserAvatar
(
sid
,
userInfo
.
getAvatar
());
goblinRedisUtils
.
setHelpUserAvatar
(
sid
,
userInfo
.
getAvatar
());
}
else
{
}
else
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
150008
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
150008
));
}
}
}
}
...
@@ -260,13 +265,13 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
...
@@ -260,13 +265,13 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
sendRedis
(
"goblin_goods_anticipate_help"
,
sqlValue
);
sendRedis
(
"goblin_goods_anticipate_help"
,
sqlValue
);
//判断主力人数是否达标,达标则自动预约
//判断主力人数是否达标,达标则自动预约
if
(
shareVo
.
getPeopleType
().
equals
(
goblinRedisUtils
.
getHelpSidAddHelp
(
sid
))){
if
(
shareVo
.
getPeopleType
().
equals
(
goblinRedisUtils
.
getHelpSidAddHelp
(
sid
)))
{
//主力人数达到可预约条件
//主力人数达到可预约条件
uidAboutBySkuId
(
shareVo
.
getSkuId
(),
shareVo
.
getUid
(),
shareVo
.
getAvatar
());
uidAboutBySkuId
(
shareVo
.
getSkuId
(),
shareVo
.
getUid
(),
shareVo
.
getAvatar
());
}
}
return
ResponseDto
.
success
();
return
ResponseDto
.
success
();
}
else
{
}
else
{
log
.
debug
(
"help() false ------> sid:{}"
,
sid
);
log
.
debug
(
"help() false ------> sid:{}"
,
sid
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
150004
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
150004
));
}
}
}
}
...
@@ -293,7 +298,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
...
@@ -293,7 +298,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
public
ResponseDto
<
Boolean
>
helpSid
(
String
sid
)
{
public
ResponseDto
<
Boolean
>
helpSid
(
String
sid
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
String
uid
=
CurrentUtil
.
getCurrentUid
();
Integer
help
=
goblinRedisUtils
.
getHelpByUidAndSid
(
uid
,
sid
);
Integer
help
=
goblinRedisUtils
.
getHelpByUidAndSid
(
uid
,
sid
);
if
(
help
==
null
){
if
(
help
==
null
)
{
return
ResponseDto
.
success
(
false
);
return
ResponseDto
.
success
(
false
);
}
}
return
ResponseDto
.
success
(
true
);
return
ResponseDto
.
success
(
true
);
...
@@ -308,4 +313,46 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
...
@@ -308,4 +313,46 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
sqlStr
);
sqlStr
);
}
}
@Override
public
ResponseDto
<
Boolean
>
reserveByMix
(
String
mixId
)
{
//获取udi
String
uid
=
CurrentUtil
.
getCurrentUid
();
String
nowTime
=
DateUtil
.
getNowTime
();
//redis查询用户预约组合购记录
if
(
goblinRedisUtils
.
getReserveMixByUid
(
uid
,
mixId
)
==
null
)
{
//该混合狗能否被预约
GoblinMixDetailsVo
mixDetails
=
goblinRedisUtils
.
getMixDetails
(
mixId
);
//组合购开启预约且当前时间大于预约购开始时间或者上架时间才可预约
if
(
mixDetails
.
getReserve
()
!=
0
&&
DateUtil
.
compareStrDay
(
nowTime
,
mixDetails
.
getTimeStart
())
<=
0
)
{
GoblinMixReserveVo
goblinMixReserveVo
=
GoblinMixReserveVo
.
getNew
();
goblinMixReserveVo
.
setMixId
(
mixId
);
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
DateUtil
.
DATE_FULL_STR
);
goblinMixReserveVo
.
setCreatedDate
(
LocalDateTime
.
parse
(
nowTime
,
formatter
));
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/GoblinMixAppServiceImpl.java
View file @
129baaa7
package
com
.
liquidnet
.
service
.
goblin
.
service
.
impl
;
package
com
.
liquidnet
.
service
.
goblin
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.commons.lang.util.
IDGenerator
;
import
com.liquidnet.commons.lang.util.
DateUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.goblin.param.GoblinMixDetailsItemParam
;
import
com.liquidnet.service.goblin.param.GoblinMixDetailsParam
;
import
com.liquidnet.service.goblin.param.GoblinMixUpdateParam
;
import
com.liquidnet.service.goblin.service.manage.IGoblinMixAppService
;
import
com.liquidnet.service.goblin.service.manage.IGoblinMixAppService
;
import
com.liquidnet.service.goblin.service.manage.IGoblinMixService
;
import
com.liquidnet.service.goblin.util.*
;
import
com.liquidnet.service.goblin.util.*
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
...
@@ -21,12 +12,9 @@ import org.springframework.beans.BeanUtils;
...
@@ -21,12 +12,9 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
liquidnet
.
commons
.
lang
.
util
.
DateUtil
.
DTF_YMD_HMS
;
import
static
com
.
liquidnet
.
commons
.
lang
.
util
.
DateUtil
.
DTF_YMD_HMS
;
...
@@ -59,16 +47,17 @@ public class GoblinMixAppServiceImpl implements IGoblinMixAppService {
...
@@ -59,16 +47,17 @@ public class GoblinMixAppServiceImpl implements IGoblinMixAppService {
}
else
{
}
else
{
return
ResponseDto
.
failure
();
return
ResponseDto
.
failure
();
}
}
String
nowTime
=
DateUtil
.
getNowTime
();
for
(
String
mixId
:
startList
)
{
for
(
String
mixId
:
startList
)
{
GoblinMixDetailsVo
vo
=
redisUtils
.
getMixDetails
(
mixId
);
GoblinMixDetailsVo
vo
=
redisUtils
.
getMixDetails
(
mixId
);
GoblinMixAppListVo
itemVo
=
GoblinMixAppListVo
.
getNew
().
copy
(
vo
);
GoblinMixAppListVo
itemVo
=
GoblinMixAppListVo
.
getNew
().
copy
(
vo
,
nowTime
);
itemVo
.
setStatus
(
6
);
itemVo
.
setStatus
(
6
);
voList
.
add
(
itemVo
);
voList
.
add
(
itemVo
);
}
}
for
(
String
mixId
:
stockList
)
{
for
(
String
mixId
:
stockList
)
{
GoblinMixDetailsVo
vo
=
redisUtils
.
getMixDetails
(
mixId
);
GoblinMixDetailsVo
vo
=
redisUtils
.
getMixDetails
(
mixId
);
GoblinMixAppListVo
itemVo
=
GoblinMixAppListVo
.
getNew
().
copy
(
vo
);
GoblinMixAppListVo
itemVo
=
GoblinMixAppListVo
.
getNew
().
copy
(
vo
,
nowTime
);
itemVo
.
setStatus
(
8
);
itemVo
.
setStatus
(
8
);
voList
.
add
(
itemVo
);
voList
.
add
(
itemVo
);
}
}
...
@@ -79,11 +68,17 @@ public class GoblinMixAppServiceImpl implements IGoblinMixAppService {
...
@@ -79,11 +68,17 @@ public class GoblinMixAppServiceImpl implements IGoblinMixAppService {
@Override
@Override
public
ResponseDto
<
GoblinMixAppDetailsVo
>
mixDetails
(
String
mixId
)
{
public
ResponseDto
<
GoblinMixAppDetailsVo
>
mixDetails
(
String
mixId
)
{
GoblinMixDetailsVo
baseVo
=
redisUtils
.
getMixDetails
(
mixId
);
GoblinMixDetailsVo
baseVo
=
redisUtils
.
getMixDetails
(
mixId
);
if
(
baseVo
==
null
)
{
if
(
baseVo
==
null
)
{
return
ResponseDto
.
failure
(
"参数异常"
);
return
ResponseDto
.
failure
(
"参数异常"
);
}
}
GoblinStoreInfoVo
storeInfoVo
=
redisUtils
.
getStoreInfoVo
(
baseVo
.
getStoreId
());
GoblinStoreInfoVo
storeInfoVo
=
redisUtils
.
getStoreInfoVo
(
baseVo
.
getStoreId
());
GoblinMixAppDetailsVo
vo
=
GoblinMixAppDetailsVo
.
getNew
().
copy
(
baseVo
,
storeInfoVo
.
getStoreName
());
GoblinMixAppDetailsVo
vo
=
GoblinMixAppDetailsVo
.
getNew
().
copy
(
baseVo
,
storeInfoVo
.
getStoreName
());
//获取用户预约情况
//获取udi
String
uid
=
CurrentUtil
.
getCurrentUid
();
if
(
vo
.
getReserve
()
==
1
&&
uid
!=
null
&&
redisUtils
.
getReserveMixByUid
(
uid
,
mixId
)
!=
null
)
{
vo
.
setUserReserve
(
1
);
}
int
stock
=
0
;
int
stock
=
0
;
for
(
GoblinMixDetailsItemVo
item
:
vo
.
getItem
())
{
for
(
GoblinMixDetailsItemVo
item
:
vo
.
getItem
())
{
GoblinGoodsSkuInfoVo
skuInfoVo
=
redisUtils
.
getGoodsSkuInfoVo
(
item
.
getSkuId
());
GoblinGoodsSkuInfoVo
skuInfoVo
=
redisUtils
.
getGoodsSkuInfoVo
(
item
.
getSkuId
());
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/inner/GoblinJobServiceImpl.java
View file @
129baaa7
...
@@ -72,7 +72,7 @@ public class GoblinJobServiceImpl {
...
@@ -72,7 +72,7 @@ public class GoblinJobServiceImpl {
LocalDateTime
nt
=
LocalDateTime
.
now
();
LocalDateTime
nt
=
LocalDateTime
.
now
();
//筛选 活动中 和 活动中且售罄的
//筛选 活动中 和 活动中且售罄的
for
(
GoblinMixDetailsVo
item
:
nftDetailsList
)
{
for
(
GoblinMixDetailsVo
item
:
nftDetailsList
)
{
LocalDateTime
st
=
LocalDateTime
.
parse
(
item
.
getTimeStart
(
),
DTF_YMD_HMS
);
LocalDateTime
st
=
LocalDateTime
.
parse
(
item
.
getTimeStart
OrShelvesTime
(
item
),
DTF_YMD_HMS
);
LocalDateTime
et
=
LocalDateTime
.
parse
(
item
.
getTimeEnd
(),
DTF_YMD_HMS
);
LocalDateTime
et
=
LocalDateTime
.
parse
(
item
.
getTimeEnd
(),
DTF_YMD_HMS
);
if
(
nt
.
isAfter
(
st
)
&&
nt
.
isBefore
(
et
))
{
//活动中
if
(
nt
.
isAfter
(
st
)
&&
nt
.
isBefore
(
et
))
{
//活动中
int
stock
=
0
;
int
stock
=
0
;
...
@@ -98,7 +98,8 @@ public class GoblinJobServiceImpl {
...
@@ -98,7 +98,8 @@ public class GoblinJobServiceImpl {
}
}
for
(
GoblinMixDetailsVo
item
:
skuDetailsList
)
{
for
(
GoblinMixDetailsVo
item
:
skuDetailsList
)
{
LocalDateTime
st
=
LocalDateTime
.
parse
(
item
.
getTimeStart
(),
DTF_YMD_HMS
);
//修改开始时间获取 开始时间/上架时间
LocalDateTime
st
=
LocalDateTime
.
parse
(
item
.
getTimeStartOrShelvesTime
(
item
),
DTF_YMD_HMS
);
LocalDateTime
et
=
LocalDateTime
.
parse
(
item
.
getTimeEnd
(),
DTF_YMD_HMS
);
LocalDateTime
et
=
LocalDateTime
.
parse
(
item
.
getTimeEnd
(),
DTF_YMD_HMS
);
if
(
nt
.
isAfter
(
st
)
&&
nt
.
isBefore
(
et
))
{
//活动中
if
(
nt
.
isAfter
(
st
)
&&
nt
.
isBefore
(
et
))
{
//活动中
int
stock
=
0
;
int
stock
=
0
;
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinGoodsAnticipateMgServiceImpl.java
View file @
129baaa7
...
@@ -14,6 +14,8 @@ import com.liquidnet.service.goblin.dto.manage.GoblinGoodsAnticipateValueParam;
...
@@ -14,6 +14,8 @@ import com.liquidnet.service.goblin.dto.manage.GoblinGoodsAnticipateValueParam;
import
com.liquidnet.service.goblin.dto.manage.vo.AnticipateValueVo
;
import
com.liquidnet.service.goblin.dto.manage.vo.AnticipateValueVo
;
import
com.liquidnet.service.goblin.dto.manage.vo.GoblinGoodsAnticipateValueVo
;
import
com.liquidnet.service.goblin.dto.manage.vo.GoblinGoodsAnticipateValueVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinGoodsAnticipateVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinGoodsAnticipateVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinMixDetailsVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinMixReserveVo
;
import
com.liquidnet.service.goblin.service.manage.IGoblinGoodsAnticipateMgService
;
import
com.liquidnet.service.goblin.service.manage.IGoblinGoodsAnticipateMgService
;
import
com.liquidnet.service.goblin.util.GoblinAnticipateUtils
;
import
com.liquidnet.service.goblin.util.GoblinAnticipateUtils
;
import
com.liquidnet.service.goblin.util.GoblinMongoUtils
;
import
com.liquidnet.service.goblin.util.GoblinMongoUtils
;
...
@@ -30,6 +32,8 @@ import java.util.HashMap;
...
@@ -30,6 +32,8 @@ import java.util.HashMap;
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>
* 预约表 服务实现类
* 预约表 服务实现类
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinMixServiceImpl.java
View file @
129baaa7
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.SqlMapping
;
...
@@ -150,6 +151,10 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
...
@@ -150,6 +151,10 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
String
uid
=
CurrentUtil
.
getCurrentUid
();
String
uid
=
CurrentUtil
.
getCurrentUid
();
List
<
GoblinMixDetailsItemVo
>
itemList
=
ObjectUtil
.
goblinMixDetailsItemVo
();
List
<
GoblinMixDetailsItemVo
>
itemList
=
ObjectUtil
.
goblinMixDetailsItemVo
();
List
<
GoblinMixDetailsItemParam
>
itemParams
=
param
.
getItem
();
List
<
GoblinMixDetailsItemParam
>
itemParams
=
param
.
getItem
();
//开启预约 判断上架时间必须大于开始时间
if
(
DateUtil
.
compareStrDay
(
param
.
getShelvesTime
(),
param
.
getTimeStart
())
>
0
)
{
return
ResponseDto
.
failure
(
"售卖时间不能超过上架时间!"
);
}
//判断活动名称
//判断活动名称
int
count
=
(
int
)
mongoUtils
.
getMixNameCount
(
param
.
getName
());
int
count
=
(
int
)
mongoUtils
.
getMixNameCount
(
param
.
getName
());
...
@@ -195,7 +200,7 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
...
@@ -195,7 +200,7 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
mixId
,
uid
,
vo
.
getName
(),
vo
.
getTimeStart
(),
vo
.
getTimeEnd
(),
6
,
vo
.
getShowPosition
(),
mixId
,
uid
,
vo
.
getName
(),
vo
.
getTimeStart
(),
vo
.
getTimeEnd
(),
6
,
vo
.
getShowPosition
(),
vo
.
getSellName
(),
vo
.
getExpressPrice
(),
vo
.
getIntro
(),
vo
.
getWatchType
(),
vo
.
getCoverPic
(),
vo
.
getSellName
(),
vo
.
getExpressPrice
(),
vo
.
getIntro
(),
vo
.
getWatchType
(),
vo
.
getCoverPic
(),
vo
.
getVideo
(),
vo
.
getDetailUrl
(),
vo
.
getDetails
(),
vo
.
getStock
(),
vo
.
getStockLock
(),
vo
.
getVideo
(),
vo
.
getDetailUrl
(),
vo
.
getDetails
(),
vo
.
getStock
(),
vo
.
getStockLock
(),
vo
.
getIsLock
(),
vo
.
getLimit
(),
vo
.
getWhiteType
(),
vo
.
getWhiteUrl
(),
vo
.
getPayType
(),
vo
.
getStoreId
(),
LocalDateTime
.
now
()
vo
.
getIsLock
(),
vo
.
getLimit
(),
vo
.
getWhiteType
(),
vo
.
getWhiteUrl
(),
vo
.
getPayType
(),
vo
.
getStoreId
(),
LocalDateTime
.
now
()
,
vo
.
getShelvesTime
(),
vo
.
getReserve
()
});
});
//设置redis
//设置redis
redisUtils
.
setMixDetails
(
mixId
,
vo
);
redisUtils
.
setMixDetails
(
mixId
,
vo
);
...
@@ -215,6 +220,11 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
...
@@ -215,6 +220,11 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
String
uid
=
CurrentUtil
.
getCurrentUid
();
String
uid
=
CurrentUtil
.
getCurrentUid
();
GoblinMixDetailsVo
vo
=
redisUtils
.
getMixDetails
(
param
.
getMixId
());
GoblinMixDetailsVo
vo
=
redisUtils
.
getMixDetails
(
param
.
getMixId
());
String
oldWhiteUrl
=
vo
.
getWhiteUrl
();
String
oldWhiteUrl
=
vo
.
getWhiteUrl
();
//开启预约 判断上架时间必须大于开始时间
if
(
DateUtil
.
compareStrDay
(
param
.
getShelvesTime
(),
vo
.
getTimeStart
())
>
0
)
{
return
ResponseDto
.
failure
(
"售卖时间不能超过上架时间!"
);
}
if
(!
vo
.
getUserId
().
equals
(
uid
))
{
if
(!
vo
.
getUserId
().
equals
(
uid
))
{
return
ResponseDto
.
failure
(
"身份异常"
);
return
ResponseDto
.
failure
(
"身份异常"
);
}
}
...
@@ -235,6 +245,8 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
...
@@ -235,6 +245,8 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
vo
.
setWhiteType
(
param
.
getWhiteType
());
vo
.
setWhiteType
(
param
.
getWhiteType
());
vo
.
setWhiteUrl
(
param
.
getWhiteUrl
());
vo
.
setWhiteUrl
(
param
.
getWhiteUrl
());
vo
.
setXlsName
(
param
.
getXlsName
());
vo
.
setXlsName
(
param
.
getXlsName
());
vo
.
setShelvesTime
(
param
.
getShelvesTime
());
vo
.
setReserve
(
param
.
getReserve
());
//redis
//redis
redisUtils
.
setMixDetails
(
param
.
getMixId
(),
vo
);
redisUtils
.
setMixDetails
(
param
.
getMixId
(),
vo
);
redisList
(
vo
.
getShowPosition
(),
vo
.
getMixId
(),
vo
.
getStatus
());
redisList
(
vo
.
getShowPosition
(),
vo
.
getMixId
(),
vo
.
getStatus
());
...
@@ -245,7 +257,7 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
...
@@ -245,7 +257,7 @@ public class GoblinMixServiceImpl implements IGoblinMixService {
mongoUtils
.
changeGoblinMixDetailsVo
(
vo
);
mongoUtils
.
changeGoblinMixDetailsVo
(
vo
);
//sql入库
//sql入库
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_STORE_MARKET
.
getKey
(),
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_STORE_MARKET
.
getKey
(),
SqlMapping
.
get
(
"goblin_mix_update"
,
vo
.
getShowPosition
(),
vo
.
getLimit
(),
vo
.
getWhiteType
(),
vo
.
getWhiteUrl
(),
LocalDateTime
.
now
(),
param
.
getMixId
()));
SqlMapping
.
get
(
"goblin_mix_update"
,
vo
.
getShowPosition
(),
vo
.
getLimit
(),
vo
.
getWhiteType
(),
vo
.
getWhiteUrl
(),
LocalDateTime
.
now
(),
vo
.
getShelvesTime
(),
vo
.
getReserve
(),
param
.
getMixId
()));
return
ResponseDto
.
success
();
return
ResponseDto
.
success
();
}
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
129baaa7
...
@@ -2597,6 +2597,24 @@ public class GoblinRedisUtils {
...
@@ -2597,6 +2597,24 @@ public class GoblinRedisUtils {
mixIds
.
add
(
mixId
);
mixIds
.
add
(
mixId
);
setGoblinMixSkuStartList
(
mixIds
);
setGoblinMixSkuStartList
(
mixIds
);
}
}
//保存用户预约
public
void
setReserveMixByUid
(
GoblinMixReserveVo
goblinMixReserveVo
)
{
String
rdk
=
GoblinRedisConst
.
GOBLIN_MIX_RESERVE_UID
.
concat
(
goblinMixReserveVo
.
getMixId
()).
concat
(
":"
).
concat
(
goblinMixReserveVo
.
getUid
());
redisUtil
.
set
(
rdk
,
goblinMixReserveVo
);
}
//根据用户uid和混合mixId查询用户预约
public
GoblinMixReserveVo
getReserveMixByUid
(
String
uid
,
String
mixId
)
{
Object
obj
=
redisUtil
.
get
(
GoblinRedisConst
.
GOBLIN_MIX_RESERVE_UID
.
concat
(
mixId
).
concat
(
":"
).
concat
(
uid
));
if
(
obj
==
null
)
{
return
null
;
}
else
{
return
(
GoblinMixReserveVo
)
obj
;
}
}
/* ---------------------------------------- ---------------------------------------- */
/* ---------------------------------------- ---------------------------------------- */
/* ---------------------------------------- ---------------------------------------- */
/* ---------------------------------------- ---------------------------------------- */
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/resources/sqlmap.properties
View file @
129baaa7
...
@@ -142,6 +142,7 @@ goblin_goods_anticipate_help=INSERT INTO goblin_goods_anticipate_help(sid,help_u
...
@@ -142,6 +142,7 @@ goblin_goods_anticipate_help=INSERT INTO goblin_goods_anticipate_help(sid,help_u
goblin_goods_anticipate_share
=
INSERT INTO goblin_goods_anticipate_share(sid,uid,sku_id,created_date) VALUES(?,?,?,?)
goblin_goods_anticipate_share
=
INSERT INTO goblin_goods_anticipate_share(sid,uid,sku_id,created_date) VALUES(?,?,?,?)
goblin_goods_anticipate_user_update
=
UPDATE goblin_goods_anticipate_user SET state = 1 WHERE uid = ? AND sku_id = ?
goblin_goods_anticipate_user_update
=
UPDATE goblin_goods_anticipate_user SET state = 1 WHERE uid = ? AND sku_id = ?
goblin_goods_anticipate_user_update_sku
=
UPDATE goblin_goods_anticipate_user SET state = 1 WHERE sku_id = ?
goblin_goods_anticipate_user_update_sku
=
UPDATE goblin_goods_anticipate_user SET state = 1 WHERE sku_id = ?
goblin_goods_anticipate_mix
=
INSERT INTO goblin_goods_anticipate_mix ( mid, uid, phone, mix_id, state, created_date ) VALUES(?,?,?,?,0,NOW())
#---- \u4E1A\u52A1\u8D26\u53F7\u8BB0\u5F55
#---- \u4E1A\u52A1\u8D26\u53F7\u8BB0\u5F55
adam_user_busi_acct.add
=
INSERT INTO adam_user_busi_acct (`uid`, busi, uuid, `work`, ppwd, `state`, created_at) VALUES (?,?,?,?,?,?,?)
adam_user_busi_acct.add
=
INSERT INTO adam_user_busi_acct (`uid`, busi, uuid, `work`, ppwd, `state`, created_at) VALUES (?,?,?,?,?,?,?)
#---- \u9ED1\u767D\u540D\u5355 ----
#---- \u9ED1\u767D\u540D\u5355 ----
...
@@ -149,8 +150,8 @@ goblin_list_insert=INSERT INTO goblin_list (`list_id`,`uid`,`name`,`white_type`,
...
@@ -149,8 +150,8 @@ goblin_list_insert=INSERT INTO goblin_list (`list_id`,`uid`,`name`,`white_type`,
goblin_list_detail_insert
=
INSERT INTO goblin_list_details (`list_id`,`spu_id`,`sku_id`,`created_at`,`sku_stock`,`price_v`,`product_id`,`price`) VALUES (?,?,?,?,?,?,?,?)
goblin_list_detail_insert
=
INSERT INTO goblin_list_details (`list_id`,`spu_id`,`sku_id`,`created_at`,`sku_stock`,`price_v`,`product_id`,`price`) VALUES (?,?,?,?,?,?,?,?)
goblin_list_update
=
UPDATE goblin_list SET white_url = ? ,white_type = ? , black_url = ? , updated_at = ? WHERE list_id = ?
goblin_list_update
=
UPDATE goblin_list SET white_url = ? ,white_type = ? , black_url = ? , updated_at = ? WHERE list_id = ?
goblin_list_remove
=
UPDATE goblin_list set del_tag = 1 , updated_at = ? WHERE list_id = ?
goblin_list_remove
=
UPDATE goblin_list set del_tag = 1 , updated_at = ? WHERE list_id = ?
#----
混合售卖
----
#----
\u6DF7\u5408\u552E\u5356
----
goblin_mix_insert
=
INSERT INTO goblin_mix (`mix_id`,`uid`,`name`,`time_start`,`time_end`,`status`,`show_position`,`sell_name`,`express_price`,`intro`,`watch_type`,`cover_pic`,`video`,`detail_url`,`details`,`stock`,`stock_lock`,`is_lock`,`limit`,`white_type`,`white_url`,`pay_type`,`store_id`,`created_at`
) VALUES (
?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin_mix_insert
=
INSERT INTO goblin_mix (`mix_id`,`uid`,`name`,`time_start`,`time_end`,`status`,`show_position`,`sell_name`,`express_price`,`intro`,`watch_type`,`cover_pic`,`video`,`detail_url`,`details`,`stock`,`stock_lock`,`is_lock`,`limit`,`white_type`,`white_url`,`pay_type`,`store_id`,`created_at`
,`shelves_time`,`reserve`) VALUES (?,?,
?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin_mix_details_insert
=
INSERT INTO goblin_mix_details (`mix_id`,`position`,`spu_id`,`sku_id`,`price`,`price_v`,`product_id`,`count`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?)
goblin_mix_details_insert
=
INSERT INTO goblin_mix_details (`mix_id`,`position`,`spu_id`,`sku_id`,`price`,`price_v`,`product_id`,`count`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?)
goblin_mix_status_update
=
UPDATE goblin_mix SET status = ? , updated_at = ? WHERE mix_id = ?
goblin_mix_status_update
=
UPDATE goblin_mix SET status = ? , updated_at = ? WHERE mix_id = ?
goblin_mix_update
=
UPDATE goblin_mix SET show_position = ? , `limit`=?,white_type=?,white_url=? , updated_at = ? WHERE mix_id = ?
goblin_mix_update
=
UPDATE goblin_mix SET show_position = ? , `limit`=?,white_type=?,white_url=? , updated_at = ?,shelves_time = ?,reserve = ? WHERE mix_id = ?
\ No newline at end of file
\ No newline at end of file
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