记得上下班打卡 | 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
26e495bf
Commit
26e495bf
authored
May 05, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
黑名单 列表
parent
c236ceb5
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
114 additions
and
35 deletions
+114
-35
GoblinListVo.java
...ava/com/liquidnet/service/goblin/dto/vo/GoblinListVo.java
+32
-0
IGoblinListService.java
...net/service/goblin/service/manage/IGoblinListService.java
+6
-1
AbstractXlsRedisReceiver.java
...ice/consumer/kylin/receiver/AbstractXlsRedisReceiver.java
+13
-12
GoblinListController.java
...ervice/goblin/controller/manage/GoblinListController.java
+12
-9
GoblinListServiceImpl.java
...ice/goblin/service/impl/manage/GoblinListServiceImpl.java
+22
-4
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+18
-0
ObjectUtil.java
...in/java/com/liquidnet/service/goblin/util/ObjectUtil.java
+6
-0
QueueUtils.java
...in/java/com/liquidnet/service/goblin/util/QueueUtils.java
+5
-9
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinListVo.java
0 → 100644
View file @
26e495bf
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
public
class
GoblinListVo
implements
Serializable
,
Cloneable
{
@ApiModelProperty
(
value
=
"名单id"
)
private
String
listId
;
@ApiModelProperty
(
value
=
"优先购名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"优先购提前时间"
)
private
Integer
advanceMin
;
@ApiModelProperty
(
value
=
"是否有黑名单[1-有|2-无]"
)
private
Integer
hasBlack
;
@ApiModelProperty
(
value
=
"商品数量"
)
private
Integer
skuCount
;
private
static
final
GoblinListVo
obj
=
new
GoblinListVo
();
public
static
GoblinListVo
getNew
()
{
try
{
return
(
GoblinListVo
)
obj
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
e
.
printStackTrace
();
}
return
new
GoblinListVo
();
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/manage/IGoblinListService.java
View file @
26e495bf
package
com
.
liquidnet
.
service
.
goblin
.
service
.
manage
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.service.base.PagedResult
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.vo.GoblinListDetailsVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinListVo
;
import
com.liquidnet.service.goblin.param.GoblinListCreateParam
;
import
com.liquidnet.service.goblin.param.GoblinListUpdateParam
;
import
java.util.List
;
/**
* <p>
* 商城-名单表 服务类
...
...
@@ -16,7 +21,7 @@ import com.liquidnet.service.goblin.param.GoblinListUpdateParam;
*/
public
interface
IGoblinListService
{
void
getList
(
);
ResponseDto
<
PageInfo
<
GoblinListVo
>>
getList
(
String
name
,
Integer
page
);
ResponseDto
<
GoblinListDetailsVo
>
getDetails
(
String
listId
);
...
...
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-kylin/src/main/java/com/liquidnet/service/consumer/kylin/receiver/AbstractXlsRedisReceiver.java
View file @
26e495bf
...
...
@@ -87,19 +87,20 @@ public abstract class AbstractXlsRedisReceiver implements StreamListener<String,
objs
.
add
(
new
Object
[]{
skuId
,
xlsPath
,
type
,
1
,
LocalDateTime
.
now
()});
aBoolean
=
baseDao
.
batchSql
(
SQL_INSERT_GOODS_BUY_ROSTER_LOG
,
objs
);
}
else
if
(
finalType
.
equals
(
3
)
||
finalType
.
equals
(
4
))
{
//添加
EasyExcel
.
read
(
new
URL
(
xlsPath
).
openStream
(),
PhoneUnIdDto
.
class
,
new
PageReadListener
<
PhoneUnIdDto
>(
dataList
->
{
for
(
PhoneUnIdDto
data
:
dataList
)
{
if
(
data
.
getMobile
()
==
null
)
{
continue
;
}
if
(
finalType
.
equals
(
3
))
{
redisUtil
.
set
(
GoblinRedisConst
.
REDIS_WHITE
.
concat
(
finalSkuId
+
":"
).
concat
(
data
.
getMobile
()),
1
);
}
else
{
redisUtil
.
set
(
GoblinRedisConst
.
REDIS_BLACK
.
concat
(
finalSkuId
+
":"
).
concat
(
data
.
getMobile
()),
1
);
if
(
xlsPath
!=
null
)
{
//添加
EasyExcel
.
read
(
new
URL
(
xlsPath
).
openStream
(),
PhoneUnIdDto
.
class
,
new
PageReadListener
<
PhoneUnIdDto
>(
dataList
->
{
for
(
PhoneUnIdDto
data
:
dataList
)
{
if
(
data
.
getMobile
()
==
null
)
{
continue
;
}
if
(
finalType
.
equals
(
3
))
{
redisUtil
.
set
(
GoblinRedisConst
.
REDIS_WHITE
.
concat
(
finalSkuId
+
":"
).
concat
(
data
.
getMobile
()),
1
);
}
else
{
redisUtil
.
set
(
GoblinRedisConst
.
REDIS_BLACK
.
concat
(
finalSkuId
+
":"
).
concat
(
data
.
getMobile
()),
1
);
}
}
}
}
)).
sheet
().
doRead
();
}
)).
sheet
().
doRead
();
}
if
(
oXlsPath
!=
null
)
{
//删除旧的黑白名单
EasyExcel
.
read
(
new
URL
(
oXlsPath
).
openStream
(),
PhoneUnIdDto
.
class
,
new
PageReadListener
<
PhoneUnIdDto
>(
dataList
->
{
for
(
PhoneUnIdDto
data
:
dataList
)
{
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinListController.java
View file @
26e495bf
...
...
@@ -32,15 +32,18 @@ public class GoblinListController {
@Autowired
IGoblinListService
goblinListService
;
// @ApiOperationSupport(order = 1)
// @ApiOperation(value = "列表")
// @ApiImplicitParams({
// @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "店铺ID[64]"),
// })
// @GetMapping("list")
// public ResponseDto<List<GoblinStoreGoodsCategoryVo>> list(@NotBlank(message = "店铺ID不能为空") @RequestParam String storeId) {
// return ResponseDto.success(goblinListService.getList(storeId););
// }
@ApiOperationSupport
(
order
=
1
)
@ApiOperation
(
value
=
"列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"name"
,
value
=
"活动名称"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"Integer"
,
name
=
"page"
,
value
=
"页数"
),
})
@GetMapping
(
"list"
)
public
ResponseDto
<
PageInfo
<
GoblinListVo
>>
list
(
@RequestParam
String
name
,
@RequestParam
Integer
page
)
{
return
goblinListService
.
getList
(
name
,
page
);
}
@ApiOperation
(
value
=
"详情"
)
@ApiImplicitParams
({
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinListServiceImpl.java
View file @
26e495bf
package
com
.
liquidnet
.
service
.
goblin
.
service
.
impl
.
manage
;
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.IDGenerator
;
import
com.liquidnet.service.base.PagedResult
;
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.GoblinGoodsSkuInfoVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinListDetailsItemVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinListDetailsVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinListVo
;
import
com.liquidnet.service.goblin.param.GoblinListCreateItemParam
;
import
com.liquidnet.service.goblin.param.GoblinListCreateParam
;
import
com.liquidnet.service.goblin.param.GoblinListUpdateParam
;
...
...
@@ -21,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.LinkedList
;
import
java.util.List
;
...
...
@@ -43,8 +47,22 @@ public class GoblinListServiceImpl implements IGoblinListService {
QueueUtils
queueUtils
;
@Override
public
void
getList
()
{
public
ResponseDto
<
PageInfo
<
GoblinListVo
>>
getList
(
String
name
,
Integer
page
)
{
PageInfo
<
GoblinListVo
>
pageResult
;
HashMap
<
String
,
Object
>
map
=
mongoUtils
.
getGoblinListVo
(
name
,
CurrentUtil
.
getCurrentUid
(),
page
);
List
<
GoblinListDetailsVo
>
detailsVoList
=
(
List
<
GoblinListDetailsVo
>)
map
.
get
(
"data"
);
List
<
GoblinListVo
>
voList
=
ObjectUtil
.
getGoblinListVo
();
for
(
GoblinListDetailsVo
item
:
detailsVoList
)
{
GoblinListVo
vo
=
GoblinListVo
.
getNew
();
vo
.
setListId
(
item
.
getListId
());
vo
.
setName
(
item
.
getName
());
vo
.
setAdvanceMin
(
item
.
getAdvanceMin
());
vo
.
setSkuCount
(
item
.
getItemVo
().
size
());
vo
.
setHasBlack
(
item
.
getBlackUrl
().
equals
(
""
)
?
0
:
1
);
}
pageResult
=
new
PageInfo
(
voList
);
pageResult
.
setTotal
((
Long
)
map
.
get
(
"total"
));
return
ResponseDto
.
success
(
pageResult
);
}
@Override
...
...
@@ -110,9 +128,9 @@ public class GoblinListServiceImpl implements IGoblinListService {
itemVo
.
setSkuId
(
item
.
getSkuId
());
itemVo
.
setSpuId
(
item
.
getSpuId
());
// 白名单
queueUtils
.
sendMsgByRedisXls
(
param
.
getWhiteUrl
(),
null
,
"3"
,
item
.
getSkuId
());
queueUtils
.
sendMsgByRedisXls
(
param
.
getWhiteUrl
(),
""
,
"3"
,
item
.
getSkuId
());
// 黑名单
queueUtils
.
sendMsgByRedisXls
(
param
.
getBlackUrl
(),
null
,
"4"
,
item
.
getSkuId
());
queueUtils
.
sendMsgByRedisXls
(
param
.
getBlackUrl
(),
""
,
"4"
,
item
.
getSkuId
());
goblinListDetails
.
add
(
new
Object
[]{
vo
.
getListId
(),
itemVo
.
getSpuId
(),
itemVo
.
getSkuId
(),
now
});
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
26e495bf
...
...
@@ -1621,6 +1621,24 @@ public class GoblinMongoUtils {
).
getModifiedCount
()
>
0
;
}
public
HashMap
<
String
,
Object
>
getGoblinListVo
(
String
name
,
String
uid
,
Integer
pageNum
)
{
int
pageSize
=
20
;
Criteria
criteria
=
Criteria
.
where
(
"uid"
).
is
(
uid
);
if
(
name
!=
null
&&!
name
.
equals
(
""
)){
criteria
=
criteria
.
and
(
"name"
).
regex
(
"^.*"
+
name
+
".*$"
);
}
Query
query
=
Query
.
query
(
criteria
);
long
total
=
mongoTemplate
.
count
(
query
,
GoblinListDetailsVo
.
class
,
GoblinListDetailsVo
.
class
.
getSimpleName
());
query
.
with
(
PageRequest
.
of
(
pageNum
-
1
,
pageSize
)).
with
(
Sort
.
by
(
Sort
.
Order
.
desc
(
"createdAt"
)));
List
<
GoblinListDetailsVo
>
list
=
mongoTemplate
.
find
(
query
,
GoblinListDetailsVo
.
class
,
GoblinListDetailsVo
.
class
.
getSimpleName
());
HashMap
<
String
,
Object
>
map
=
CollectionUtil
.
mapStringObject
();
map
.
put
(
"data"
,
list
);
map
.
put
(
"total"
,
total
);
return
map
;
}
/* ---------------------------------------- ---------------------------------------- */
/* ---------------------------------------- ---------------------------------------- */
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/ObjectUtil.java
View file @
26e495bf
package
com
.
liquidnet
.
service
.
goblin
.
util
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.service.base.PagedResult
;
import
com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto
;
import
com.liquidnet.service.goblin.dto.GoblinStoreMarketDto
;
...
...
@@ -86,6 +87,7 @@ public class ObjectUtil {
private
static
final
ArrayList
<
TempCouponVo
>
tempCouponVo
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinUserDigitalArtworkListVo
>
GOBLIN_USER_DIGITAL_ARTWORK_LIST_VO_ARRAY_LIST
=
new
ArrayList
<>();
private
static
final
PagedResult
<
GoblinStoreMgtGoodsSkuListVo
>
goblinStoreMgtGoodsSkuListVo
=
new
PagedResult
<>();
private
static
final
ArrayList
<
GoblinListVo
>
goblinListVo
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinStoreMgtGoodsSkuListVo
>
goblinStoreMgtGoodsSkuListVoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinNftGoodsSkuListJobVo
>
goblinNftGoodsSkuListJobVoArrayList
=
new
ArrayList
<>();
private
static
final
ArrayList
<
GoblinListDetailsItemVo
>
goblinListDetailsItemVoArrayList
=
new
ArrayList
<>();
...
...
@@ -93,6 +95,10 @@ public class ObjectUtil {
private
static
final
BasicDBObject
basicDBObject
=
new
BasicDBObject
();
private
static
final
ArrayList
<
WriteModel
<
Document
>>
writeModelDocumentArrayList
=
new
ArrayList
<>();
public
static
ArrayList
<
GoblinListVo
>
getGoblinListVo
()
{
return
(
ArrayList
<
GoblinListVo
>)
goblinListVo
.
clone
();
}
public
static
PagedResult
<
GoblinStoreMgtGoodsListVo
>
getGoblinStoreMgtGoodsVoPagedResult
()
{
return
goblinStoreMgtGoodsVoPagedResult
.
clone
();
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/QueueUtils.java
View file @
26e495bf
...
...
@@ -69,14 +69,10 @@ public class QueueUtils {
* @param skuId skuId
*/
public
void
sendMsgByRedisXls
(
String
nXlsPath
,
String
oXlsPath
,
String
type
,
String
skuId
)
{
if
(
nXlsPath
==
null
||
nXlsPath
.
equals
(
""
)
||
oXlsPath
==
null
||
oXlsPath
.
equals
(
""
)
||
type
==
null
||
type
.
equals
(
""
)
||
skuId
==
null
||
skuId
.
equals
(
""
))
{
}
else
{
HashMap
<
String
,
String
>
map
=
CollectionUtil
.
mapStringString
();
map
.
put
(
MQConst
.
QUEUE_MESSAGE_KEY
,
nXlsPath
.
concat
(
","
).
concat
(
oXlsPath
));
map
.
put
(
"type"
,
type
);
map
.
put
(
"skuId"
,
skuId
);
stringRedisTemplate
.
opsForStream
().
add
(
StreamRecords
.
mapBacked
(
map
).
withStreamKey
(
MQConst
.
GoblinQueue
.
GOBLIN_XLS_OPERA
.
getKey
()));
}
HashMap
<
String
,
String
>
map
=
CollectionUtil
.
mapStringString
();
map
.
put
(
MQConst
.
QUEUE_MESSAGE_KEY
,
nXlsPath
.
concat
(
","
).
concat
(
oXlsPath
));
map
.
put
(
"type"
,
type
);
map
.
put
(
"skuId"
,
skuId
);
stringRedisTemplate
.
opsForStream
().
add
(
StreamRecords
.
mapBacked
(
map
).
withStreamKey
(
MQConst
.
GoblinQueue
.
GOBLIN_XLS_OPERA
.
getKey
()));
}
}
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