记得上下班打卡 | 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
b7495299
Commit
b7495299
authored
Dec 31, 2021
by
张国柄
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev_goblin' into dev_goblin
parents
df2ab097
15696cb6
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
128 additions
and
36 deletions
+128
-36
GoblinStorePurchaseCommonParam.java
...ice/goblin/dto/manage/GoblinStorePurchaseCommonParam.java
+1
-1
GoblinStorePurchaseItemParam.java
...rvice/goblin/dto/manage/GoblinStorePurchaseItemParam.java
+1
-1
GoblinStorePurchaseSkuVo.java
...idnet/service/goblin/dto/vo/GoblinStorePurchaseSkuVo.java
+2
-2
GoblinFrontBannerBuildParam.java
...net/service/goblin/param/GoblinFrontBannerBuildParam.java
+5
-4
GoblinFrontHotWordBuildParam.java
...et/service/goblin/param/GoblinFrontHotWordBuildParam.java
+4
-0
GoblinFrontNavigationBuildParam.java
...service/goblin/param/GoblinFrontNavigationBuildParam.java
+4
-0
GoblinFrontSeckillBuildParam.java
...et/service/goblin/param/GoblinFrontSeckillBuildParam.java
+18
-0
IGoblinStorePurchasingService.java
.../goblin/service/manage/IGoblinStorePurchasingService.java
+2
-2
GoblinFrontSeckillController.java
...troller/zhengzai/goblin/GoblinFrontSeckillController.java
+5
-4
GoblinFrontSeckillServiceImpl.java
...ai/goblin/service/impl/GoblinFrontSeckillServiceImpl.java
+46
-8
GoblinFrontController.java
...dnet/service/goblin/controller/GoblinFrontController.java
+16
-0
GoblinStorePurchasingController.java
...in/controller/manage/GoblinStorePurchasingController.java
+4
-4
GoblinStorePurchasingServiceImpl.java
...service/impl/manage/GoblinStorePurchasingServiceImpl.java
+19
-9
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+1
-1
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/manage/GoblinStorePurchaseCommonParam.java
View file @
b7495299
...
...
@@ -21,7 +21,7 @@ public class GoblinStorePurchaseCommonParam {
@ApiModelProperty
(
required
=
true
,
value
=
"spuId"
,
example
=
"1"
)
@NotBlank
(
message
=
"spuId不能空"
)
private
String
spuId
;
@ApiModelProperty
(
required
=
true
,
value
=
"相关配置"
,
example
=
"1"
)
@ApiModelProperty
(
required
=
true
,
value
=
"相关配置"
)
private
List
<
GoblinStorePurchaseItemParam
>
goblinStorePurchaseItemParam
;
}
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/manage/GoblinStorePurchaseItemParam.java
View file @
b7495299
...
...
@@ -18,7 +18,7 @@ public class GoblinStorePurchaseItemParam {
private
BigDecimal
priceMarketing
;
@ApiModelProperty
(
required
=
true
,
value
=
"活动库存"
,
example
=
"1.00"
)
@NotBlank
(
message
=
"活动库存不能为空"
)
private
String
stockMarketing
;
private
Integer
stockMarketing
;
@ApiModelProperty
(
required
=
true
,
value
=
"用户限购[0-不限购|x-限购数量]"
,
example
=
"1"
)
@NotBlank
(
message
=
"用户限购类型不能为空"
)
private
Integer
buyLimit
;
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinStorePurchaseSkuVo.java
View file @
b7495299
...
...
@@ -30,9 +30,9 @@ public class GoblinStorePurchaseSkuVo implements Serializable, Cloneable {
@ApiModelProperty
(
position
=
6
,
value
=
"限量[0-无限制|X:限购数量]"
)
private
Integer
buyLimit
;
@ApiModelProperty
(
position
=
7
,
value
=
"购买限制[0-全部用户|1-仅会员|2-指定用户]"
)
private
Integer
buyFactor
;
private
String
buyFactor
;
@ApiModelProperty
(
position
=
8
,
value
=
"购买限制人员名单[购买限制为2-指定用户时必填]"
)
private
Integer
buyRoster
;
private
String
buyRoster
;
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/param/GoblinFrontBannerBuildParam.java
View file @
b7495299
package
com
.
liquidnet
.
service
.
goblin
.
param
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -50,14 +51,14 @@ public class GoblinFrontBannerBuildParam implements Serializable {
* 开启时间
*/
@ApiModelProperty
(
value
=
"开启时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
startTime
;
/**
* 结束时间
*/
@ApiModelProperty
(
value
=
"结束时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
endTime
;
/**
...
...
@@ -82,14 +83,14 @@ public class GoblinFrontBannerBuildParam implements Serializable {
* 创建时间
*/
@ApiModelProperty
(
value
=
"创建时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
createTime
;
/**
* 修改时间
*/
@ApiModelProperty
(
value
=
"修改时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
updateTime
;
/**
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/param/GoblinFrontHotWordBuildParam.java
View file @
b7495299
package
com
.
liquidnet
.
service
.
goblin
.
param
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -62,12 +64,14 @@ public class GoblinFrontHotWordBuildParam implements Serializable {
* 创建时间
*/
@ApiModelProperty
(
value
=
"创建时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
createTime
;
/**
* 修改时间
*/
@ApiModelProperty
(
value
=
"创建时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
updateTime
;
/**
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/param/GoblinFrontNavigationBuildParam.java
View file @
b7495299
package
com
.
liquidnet
.
service
.
goblin
.
param
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -80,12 +82,14 @@ public class GoblinFrontNavigationBuildParam implements Serializable {
* 创建时间
*/
@ApiModelProperty
(
value
=
"创建时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
createTime
;
/**
* 修改时间
*/
@ApiModelProperty
(
value
=
"修改时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
updateTime
;
/**
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/param/GoblinFrontSeckillBuildParam.java
View file @
b7495299
package
com
.
liquidnet
.
service
.
goblin
.
param
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
...
...
@@ -49,12 +53,14 @@ public class GoblinFrontSeckillBuildParam implements Serializable {
* 创建时间
*/
@ApiModelProperty
(
value
=
"创建时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
createTime
;
/**
* 修改时间
*/
@ApiModelProperty
(
value
=
"修改时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
private
LocalDateTime
updateTime
;
/**
...
...
@@ -75,6 +81,18 @@ public class GoblinFrontSeckillBuildParam implements Serializable {
@ApiModelProperty
(
value
=
"秒杀id"
)
private
String
seckilId
;
//活动
public
List
<
Map
>
acityList
;
private
static
final
GoblinFrontSeckillBuildParam
obj
=
new
GoblinFrontSeckillBuildParam
();
public
static
GoblinFrontSeckillBuildParam
getNew
()
{
try
{
return
(
GoblinFrontSeckillBuildParam
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
return
new
GoblinFrontSeckillBuildParam
();
}
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/manage/IGoblinStorePurchasingService.java
View file @
b7495299
...
...
@@ -104,8 +104,8 @@ public interface IGoblinStorePurchasingService {
* 删除活动内sku
*
* @param marketId 活动秒杀id
* @param s
kuId sk
uId
* @param s
puId sp
uId
* @return
*/
ResponseDto
<
Boolean
>
purchasingS
kuDel
(
String
marketId
,
String
storeId
,
String
spuId
);
ResponseDto
<
Boolean
>
purchasingS
puDel
(
String
marketId
,
String
storeId
,
String
spuId
);
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/goblin/GoblinFrontSeckillController.java
View file @
b7495299
...
...
@@ -138,11 +138,12 @@ public class GoblinFrontSeckillController extends BaseController {
@PostMapping
(
"page"
)
@ApiOperation
(
value
=
"分页"
)
@ResponseBody
public
AjaxResult
page
(
@RequestParam
(
name
=
"pageSize"
,
required
=
true
)
int
pageSize
,
@RequestParam
(
name
=
"pageNumber"
,
required
=
true
)
int
pageNumber
,
@RequestBody
GoblinFrontSeckillBuildParam
goblinFrontSeckillBuildParam
)
{
GoblinFrontSeckill
goblinFrontSeckill
=
new
GoblinFrontSeckill
();
//@RequestParam(name = "pageSize", required = true) int pageSize,@RequestParam(name = "pageNumber", required = true)int pageNumber,@RequestBody GoblinFrontSeckillBuildParam goblinFrontSeckillBuildParam
public
AjaxResult
page
(
)
{
/*GoblinFrontSeckill goblinFrontSeckill=new GoblinFrontSeckill();
BeanUtils.copyProperties(goblinFrontSeckillBuildParam,goblinFrontSeckill);
logger
.
info
(
"限时秒杀分页{}"
,
JSON
.
toJSONString
(
goblinFrontSeckill
));
return
AjaxResult
.
success
(
goblinFrontSeckillService
.
page
(
pageSize
,
pageNumber
,
null
));
logger.info("限时秒杀分页{}", JSON.toJSONString(goblinFrontSeckill));
*/
return
AjaxResult
.
success
(
goblinFrontSeckillService
.
page
());
}
/**
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/impl/GoblinFrontSeckillServiceImpl.java
View file @
b7495299
...
...
@@ -4,18 +4,20 @@ import com.alibaba.fastjson.JSON;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinFrontSeckillService
;
import
com.liquidnet.common.cache.redis.util.RedisGoblinUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.entity.GoblinFrontSeckill
;
import
com.liquidnet.service.goblin.entity.GoblinSelfMarketing
;
import
com.liquidnet.service.goblin.entity.GoblinStoreMarketing
;
import
com.liquidnet.service.goblin.mapper.GoblinFrontSeckillMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinSelfMarketingMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinStoreMarketingMapper
;
import
com.liquidnet.service.goblin.param.GoblinFrontSeckillBuildParam
;
import
com.mongodb.BasicDBObject
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
...
...
@@ -23,7 +25,11 @@ import org.springframework.data.mongodb.core.query.Query;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
...
...
@@ -87,18 +93,50 @@ public class GoblinFrontSeckillServiceImpl extends ServiceImpl<GoblinFrontSeckil
* @Description:分页
* @date 2021/12/27 下午5:19
*/
public
PageInfo
<
GoblinFrontSeckill
>
page
(
int
pageSize
,
int
pageNumber
,
GoblinFrontSeckill
goblinFrontSeckill
)
{
PageInfo
<
GoblinFrontSeckill
>
pageInfoTmp
=
null
;
public
GoblinFrontSeckillBuildParam
page
()
{
try
{
PageHelper
.
startPage
(
pageNumber
,
pageSize
);
LambdaQueryWrapper
<
GoblinFrontSeckill
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
GoblinFrontSeckill
.
class
);
queryWrapper
.
orderByDesc
(
GoblinFrontSeckill:
:
getCreateTime
);
List
<
GoblinFrontSeckill
>
list
=
goblinFrontSeckillMapper
.
selectList
(
queryWrapper
);
pageInfoTmp
=
new
PageInfo
(
list
);
GoblinFrontSeckillBuildParam
goblinFrontSeckillBuildParam
=
GoblinFrontSeckillBuildParam
.
getNew
();
List
<
Map
>
acityList
=
new
ArrayList
<>();
//遍历list 然后查找 官方 或者商铺
if
(
list
.
size
()>
0
){
GoblinFrontSeckill
goblinFrontSeckill1
=
list
.
get
(
0
);
BeanUtils
.
copyProperties
(
goblinFrontSeckill1
,
goblinFrontSeckillBuildParam
);
String
selfActivityids
=
goblinFrontSeckill1
.
getSelfActivityids
();
String
[]
actiyids
=
selfActivityids
.
split
(
","
);
for
(
String
aid:
actiyids
){
String
type
=
aid
.
split
(
"_"
)[
0
];
String
id
=
aid
.
split
(
"_"
)[
1
];
if
(
type
.
equals
(
"g"
)){
//官方
GoblinSelfMarketing
goblinSelfMarketing
=
goblinSelfMarketingMapper
.
selectById
(
id
);
Map
a
=
new
HashMap
();
a
.
put
(
"name"
,
goblinSelfMarketing
.
getName
());
a
.
put
(
"startTime"
,
goblinSelfMarketing
.
getStartTime
()==
null
?
""
:
goblinSelfMarketing
.
getStartTime
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
a
.
put
(
"endTime"
,
goblinSelfMarketing
.
getEndTime
()==
null
?
""
:
goblinSelfMarketing
.
getEndTime
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
acityList
.
add
(
a
);
//封装
}
else
if
(
type
.
equals
(
"s"
)){
//商铺
GoblinStoreMarketing
goblinStoreMarketing
=
goblinStoreMarketingMapper
.
selectById
(
id
);
Map
a
=
new
HashMap
();
a
.
put
(
"name"
,
goblinStoreMarketing
.
getName
());
DateTimeFormatter
df
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
a
.
put
(
"startTime"
,
goblinStoreMarketing
.
getStartTime
()==
null
?
""
:
goblinStoreMarketing
.
getStartTime
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
a
.
put
(
"endTime"
,
goblinStoreMarketing
.
getEndTime
()==
null
?
""
:
goblinStoreMarketing
.
getEndTime
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
acityList
.
add
(
a
);
}
}
goblinFrontSeckillBuildParam
.
setAcityList
(
acityList
);
return
goblinFrontSeckillBuildParam
;
}
//pageInfoTmp = new PageInfo(Collections.singletonList(new ArrayList().add(goblinFrontSeckillBuildParam)));
}
catch
(
Exception
e
)
{
return
new
PageInfo
()
;
return
null
;
}
return
pageInfoTmp
;
return
null
;
}
/**
* @author zhangfuxin
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinFrontController.java
View file @
b7495299
...
...
@@ -7,6 +7,7 @@ import com.liquidnet.service.goblin.dto.vo.GoblinFrontBannerVo;
import
com.liquidnet.service.goblin.entity.GoblinFrontBanner
;
import
com.liquidnet.service.goblin.entity.GoblinFrontHotWord
;
import
com.liquidnet.service.goblin.entity.GoblinFrontNavigation
;
import
com.liquidnet.service.goblin.entity.GoblinFrontSeckill
;
import
com.liquidnet.service.goblin.util.ObjectUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -80,5 +81,20 @@ public class GoblinFrontController {
return
ResponseDto
.
success
(
list
);
}
@GetMapping
(
"getSeckilll"
)
@ApiOperation
(
"获得秒杀首页要用的"
)
public
ResponseDto
getSeckilll
()
{
List
<
GoblinFrontSeckill
>
list
=
(
List
<
GoblinFrontSeckill
>)
redisUtil
.
get
(
GoblinRedisConst
.
FRONT_SECKILL
);
//判断是否有
if
(
null
!=
list
&&
list
.
size
()>
0
){
//
}
return
ResponseDto
.
success
(
list
);
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStorePurchasingController.java
View file @
b7495299
...
...
@@ -131,18 +131,18 @@ public class GoblinStorePurchasingController {
return
goblinStorePurchasingService
.
purchasingSkuUpdate
(
params
);
}
@DeleteMapping
(
"purchasing/s
k
u"
)
@ApiOperation
(
"活动详情-限时秒杀-s
k
u删除"
)
@DeleteMapping
(
"purchasing/s
p
u"
)
@ApiOperation
(
"活动详情-限时秒杀-s
p
u删除"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"marketId"
,
value
=
"活动id"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"storeId"
,
value
=
"商铺id"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"spuId"
,
value
=
"spuId"
,
example
=
"1"
)
})
public
ResponseDto
<
Boolean
>
purchasingS
k
uDel
(
@RequestParam
(
"marketId"
)
@Valid
String
marketId
,
public
ResponseDto
<
Boolean
>
purchasingS
p
uDel
(
@RequestParam
(
"marketId"
)
@Valid
String
marketId
,
@RequestParam
(
"storeId"
)
@Valid
String
storeId
,
@RequestParam
(
"spuId"
)
@Valid
String
spuId
)
{
return
goblinStorePurchasingService
.
purchasingS
k
uDel
(
marketId
,
storeId
,
spuId
);
return
goblinStorePurchasingService
.
purchasingS
p
uDel
(
marketId
,
storeId
,
spuId
);
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStorePurchasingServiceImpl.java
View file @
b7495299
...
...
@@ -47,7 +47,9 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
HashMap
<
String
,
Object
>
map
=
goblinMongoUtils
.
getStoreMarketList
(
page
,
purchaseName
,
status
,
st
,
et
,
ct
);
List
<
GoblinStoreMarketVo
>
list
=
(
List
<
GoblinStoreMarketVo
>)
map
.
get
(
"data"
);
for
(
GoblinStoreMarketVo
item
:
list
)
{
if
(
LocalDateTime
.
parse
(
item
.
getStartTime
(),
DTF_YMD_HMS
).
isAfter
(
now
))
{
if
(
item
.
getStatus
().
equals
(
7
))
{
item
.
setStatus
(
7
);
}
else
if
(
LocalDateTime
.
parse
(
item
.
getStartTime
(),
DTF_YMD_HMS
).
isAfter
(
now
))
{
item
.
setStatus
(
0
);
}
else
if
(
LocalDateTime
.
parse
(
item
.
getEndTime
(),
DTF_YMD_HMS
).
isBefore
(
now
))
{
item
.
setStatus
(
2
);
...
...
@@ -178,7 +180,7 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
GoblinMarketSpuListVo
vo
=
GoblinMarketSpuListVo
.
getNew
();
String
marketSpuId
=
marketSpuList
.
get
(
i
);
GoblinGoodsInfoVo
spuVo
=
goblinRedisUtils
.
getGoodsInfoVo
(
marketSpuId
);
vo
.
setMarketSpuId
(
marketSpuId
);
vo
.
setMarketSpuId
(
marketSpuId
.
split
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_PURCHASE
.
getValue
())[
0
]
);
vo
.
setCoverPic
(
spuVo
.
getCoverPic
());
vo
.
setName
(
spuVo
.
getName
());
vo
.
setPriceGe
(
spuVo
.
getPriceGe
());
...
...
@@ -204,9 +206,9 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
vo
.
setSkuStock
(
skuVo
.
getSkuStock
());
vo
.
setPriceMarketing
(
marketSkuVo
.
getPrice
());
vo
.
setStockMarketing
(
marketSkuVo
.
getSkuStock
());
vo
.
setBuyFactor
(
v
o
.
getBuyFactor
());
vo
.
setBuyLimit
(
v
o
.
getBuyLimit
());
vo
.
setBuyRoster
(
v
o
.
getBuyRoster
());
vo
.
setBuyFactor
(
marketSkuV
o
.
getBuyFactor
());
vo
.
setBuyLimit
(
marketSkuV
o
.
getBuyLimit
());
vo
.
setBuyRoster
(
marketSkuV
o
.
getBuyRoster
());
voList
.
add
(
vo
);
}
return
ResponseDto
.
success
(
voList
);
...
...
@@ -224,6 +226,7 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
sqls
.
add
(
SqlMapping
.
get
(
"goblin.store.market.insertRelation"
));
LinkedList
<
Object
[]>
sqlsData
=
CollectionUtil
.
linkedListObjectArr
();
for
(
GoblinStorePurchaseItemParam
item
:
params
.
getGoblinStorePurchaseItemParam
())
{
//todo 修改 相关vo 修改库存 判断库存
String
purchaseId
=
IDGenerator
.
nextMilliId2
();
GoblinStoreMarketPurchasing
bean
=
GoblinStoreMarketPurchasing
.
getNew
();
bean
.
setStoreId
(
params
.
getStoreId
());
...
...
@@ -232,7 +235,7 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
bean
.
setPurchaseId
(
purchaseId
);
bean
.
setSkuId
(
item
.
getSkuId
());
bean
.
setPriceMarketing
(
item
.
getPriceMarketing
());
bean
.
setStockMarketing
(
item
.
hashCode
());
bean
.
setStockMarketing
(
item
.
getStockMarketing
());
bean
.
setBuyLimit
(
item
.
getBuyLimit
());
bean
.
setBuyFactor
(
item
.
getBuyFactor
());
bean
.
setBuyRoster
(
item
.
getBuyRoster
());
...
...
@@ -249,6 +252,7 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
skuVo
.
setBuyRoster
(
bean
.
getBuyRoster
());
skuVo
.
setBuyFactor
(
bean
.
getBuyFactor
().
toString
());
skuVo
.
setMarketId
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_PURCHASE
.
getValue
().
concat
(
params
.
getStoreMarketId
()));
goblinMongoUtils
.
setGoodsSkuInfoVo
(
skuVo
);
//redis
goblinRedisUtils
.
setGoodsSkuInfoVo
(
skuVo
);
//mysql
...
...
@@ -279,13 +283,15 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
public
ResponseDto
<
Boolean
>
purchasingSkuUpdate
(
GoblinStorePurchaseCommonParam
params
)
{
LocalDateTime
now
=
LocalDateTime
.
now
();
String
marketSpuId
=
params
.
getSpuId
().
concat
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_PURCHASE
.
getValue
()).
concat
(
IDGenerator
.
marketGoodId
(
params
.
getStoreMarketId
()));
List
<
String
>
marketSkuList
=
CollectionUtil
.
arrayListString
();
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
sqls
.
add
(
SqlMapping
.
get
(
"goblin.store.market.updateRelation"
));
LinkedList
<
Object
[]>
sqlsData
=
CollectionUtil
.
linkedListObjectArr
();
for
(
GoblinStorePurchaseItemParam
item
:
params
.
getGoblinStorePurchaseItemParam
())
{
//todo 修改 相关vo 修改库存 判断库存
GoblinStoreMarketPurchasing
bean
=
GoblinStoreMarketPurchasing
.
getNew
();
bean
.
setPriceMarketing
(
item
.
getPriceMarketing
());
bean
.
setStockMarketing
(
item
.
hashCode
());
bean
.
setStockMarketing
(
item
.
getStockMarketing
());
bean
.
setBuyLimit
(
item
.
getBuyLimit
());
bean
.
setBuyFactor
(
item
.
getBuyFactor
());
bean
.
setBuyRoster
(
item
.
getBuyRoster
());
...
...
@@ -300,17 +306,20 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
skuVo
.
setBuyRoster
(
bean
.
getBuyRoster
());
skuVo
.
setBuyFactor
(
bean
.
getBuyFactor
().
toString
());
skuVo
.
setMarketId
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_PURCHASE
.
getValue
().
concat
(
params
.
getStoreMarketId
()));
goblinMongoUtils
.
updateGoodsSkuInfoVo
(
skuVo
);
//redis
goblinRedisUtils
.
setGoodsSkuInfoVo
(
skuVo
);
//mysql
sqlsData
.
add
(
new
Object
[]{
bean
.
getPriceMarketing
(),
bean
.
getStockMarketing
(),
bean
.
getBuyFactor
(),
bean
.
getBuyRoster
(),
bean
.
getBuyLimit
(),
bean
.
getUpdatedAt
(),
params
.
getStoreMarketId
(),
params
.
getStoreId
()});
marketSkuList
.
add
(
skuVo
.
getSkuId
());
}
//mongo
GoblinGoodsInfoVo
spuVo
=
goblinRedisUtils
.
getGoodsInfoVo
(
params
.
getSpuId
());
spuVo
.
setSpuId
(
marketSpuId
);
spuVo
.
setSkuIdList
(
marketSkuList
);
spuVo
.
setMarketId
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_PURCHASE
.
getValue
().
concat
(
params
.
getStoreMarketId
()));
goblinMongoUtils
.
set
GoodsInfoVo
(
spuVo
);
goblinMongoUtils
.
update
GoodsInfoVo
(
spuVo
);
//redis
goblinRedisUtils
.
setGoodsInfoVo
(
spuVo
);
// 执行sql
...
...
@@ -321,7 +330,8 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
}
@Override
public
ResponseDto
<
Boolean
>
purchasingSkuDel
(
String
marketId
,
String
storeId
,
String
spuId
)
{
public
ResponseDto
<
Boolean
>
purchasingSpuDel
(
String
marketId
,
String
storeId
,
String
spuId
)
{
//todo 修改 相关vo 修改库存 判断库存
LocalDateTime
now
=
LocalDateTime
.
now
();
String
marketSpuId
=
spuId
.
concat
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_PURCHASE
.
getValue
()).
concat
(
IDGenerator
.
marketGoodId
(
marketId
));
GoblinStoreMarketPurchasing
bean
=
GoblinStoreMarketPurchasing
.
getNew
();
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
b7495299
...
...
@@ -146,7 +146,7 @@ public class GoblinMongoUtils {
public
boolean
updateGoodsSkuInfoVo
(
GoblinGoodsSkuInfoVo
vo
)
{
return
mongoTemplate
.
getCollection
(
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
())
.
updateOne
(
Query
.
query
(
Criteria
.
where
(
"skuId"
).
is
(
vo
.
getS
p
uId
())).
getQueryObject
(),
Query
.
query
(
Criteria
.
where
(
"skuId"
).
is
(
vo
.
getS
k
uId
())).
getQueryObject
(),
ObjectUtil
.
cloneBasicDBObject
().
append
(
"$set"
,
mongoConverter
.
convertToMongoType
(
vo
))
).
getModifiedCount
()
>
0
;
}
...
...
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