记得上下班打卡 | 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
dac9d249
Commit
dac9d249
authored
Jan 21, 2022
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~API:店铺认证:+身份校验;
parent
441ba20b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
16 deletions
+27
-16
GoblinStoreMgtCertificationController.java
...troller/manage/GoblinStoreMgtCertificationController.java
+21
-7
GoblinStoreMgtCertificationServiceImpl.java
...e/impl/manage/GoblinStoreMgtCertificationServiceImpl.java
+0
-7
GoblinStoreMgtGoodsServiceImpl.java
...n/service/impl/manage/GoblinStoreMgtGoodsServiceImpl.java
+4
-0
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+1
-1
errors.properties
...-service-goblin-impl/src/main/resources/errors.properties
+1
-1
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStoreMgtCertificationController.java
View file @
dac9d249
package
com
.
liquidnet
.
service
.
goblin
.
controller
.
manage
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.github.xiaoymin.knife4j.annotations.ApiSupport
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.commons.lang.util.IdentityUtils
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.base.ErrorMapping
;
import
com.liquidnet.service.base.ResponseDto
;
...
...
@@ -46,13 +48,24 @@ public class GoblinStoreMgtCertificationController {
@ApiOperation
(
value
=
"店铺认证第一步:认证资料"
)
@PostMapping
(
"fstep"
)
public
ResponseDto
<
String
>
certificationFirstStep
(
@Valid
@RequestBody
GoblinStoreMgtCertificationParam
certificationParam
)
{
GoblinStoreInfoVo
storeInfoVo
=
goblinRedisUtils
.
getStoreInfoVoByUid
(
CurrentUtil
.
getCurrentUid
());
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
GoblinStoreInfoVo
storeInfoVo
=
goblinRedisUtils
.
getStoreInfoVoByUid
(
currentUid
);
if
(
null
!=
storeInfoVo
&&
!
ENABLE_CERT_STATUS
.
contains
(
storeInfoVo
.
getStatus
()))
{
log
.
warn
(
"店铺认证:无效请求:店铺已认证,无需再次认证[UID={},storeId={},storeStatus={}]"
,
CurrentUtil
.
getCurrentUid
()
,
storeInfoVo
.
getStoreId
(),
storeInfoVo
.
getStatus
());
log
.
warn
(
"店铺认证:无效请求:店铺已认证,无需再次认证[UID={},storeId={},storeStatus={}]"
,
currentUid
,
storeInfoVo
.
getStoreId
(),
storeInfoVo
.
getStatus
());
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149001"
));
}
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"店铺认证[GoblinStoreMgtCertificationParam:{}]"
,
JsonUtils
.
toJson
(
certificationParam
));
log
.
debug
(
"店铺认证[UID={},GoblinStoreMgtCertificationParam:{}]"
,
currentUid
,
JsonUtils
.
toJson
(
certificationParam
));
}
if
(
certificationParam
.
getPersonCertType
().
equals
(
"1"
))
{
String
personName
=
certificationParam
.
getPersonName
();
String
personCertCode
=
certificationParam
.
getPersonCertCode
();
String
respStr
=
IdentityUtils
.
aliThird
(
personName
,
personCertCode
);
JsonNode
respJNode
=
JsonUtils
.
fromJson
(
respStr
,
JsonNode
.
class
);
if
(
null
==
respJNode
||
!
"0"
.
equals
(
String
.
valueOf
(
respJNode
.
get
(
"error_code"
))))
{
log
.
info
(
"###实名认证失败[UID={},name={},idcard={},respStr={}]"
,
currentUid
,
personName
,
personCertCode
,
respStr
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149004"
));
}
}
storeInfoVo
=
goblinStoreMgtCertificationService
.
certificationInformationProcessing
(
certificationParam
,
storeInfoVo
);
return
ResponseDto
.
success
(
storeInfoVo
.
getStoreId
());
...
...
@@ -62,17 +75,18 @@ public class GoblinStoreMgtCertificationController {
@ApiOperation
(
value
=
"店铺认证第二步:完善信息"
)
@PostMapping
(
"sstep"
)
public
ResponseDto
<
Object
>
certificationSecondStep
(
@Valid
@RequestBody
GoblinStoreMgtCompleteParam
completeParam
)
{
GoblinStoreInfoVo
storeInfoVo
=
goblinRedisUtils
.
getStoreInfoVoByUid
(
CurrentUtil
.
getCurrentUid
());
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
GoblinStoreInfoVo
storeInfoVo
=
goblinRedisUtils
.
getStoreInfoVoByUid
(
currentUid
);
if
(
null
==
storeInfoVo
)
{
log
.
warn
(
"店铺认证:完善信息:店铺信息不存在,请按流程完成第一步:[UID={}]"
,
CurrentUtil
.
getCurrentUid
()
);
log
.
warn
(
"店铺认证:完善信息:店铺信息不存在,请按流程完成第一步:[UID={}]"
,
currentUid
);
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149001"
));
}
if
(!
ENABLE_CERT_STATUS
.
contains
(
storeInfoVo
.
getStatus
()))
{
log
.
warn
(
"店铺认证:无效请求:店铺已认证,无需再次认证[UID={},storeId={},storeStatus={}]"
,
CurrentUtil
.
getCurrentUid
()
,
storeInfoVo
.
getStoreId
(),
storeInfoVo
.
getStatus
());
log
.
warn
(
"店铺认证:无效请求:店铺已认证,无需再次认证[UID={},storeId={},storeStatus={}]"
,
currentUid
,
storeInfoVo
.
getStoreId
(),
storeInfoVo
.
getStatus
());
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149001"
));
}
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"店铺认证[
GoblinStoreMgtCompleteParam:{}]"
,
JsonUtils
.
toJson
(
completeParam
));
log
.
debug
(
"店铺认证[
UID={},GoblinStoreMgtCompleteParam:{}]"
,
currentUid
,
JsonUtils
.
toJson
(
completeParam
));
}
return
ResponseDto
.
success
(
goblinStoreMgtCertificationService
.
certificationCompleteProcessing
(
completeParam
,
storeInfoVo
));
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreMgtCertificationServiceImpl.java
View file @
dac9d249
...
...
@@ -54,8 +54,6 @@ public class GoblinStoreMgtCertificationServiceImpl implements IGoblinStoreMgtCe
goblinMongoUtils
.
setStoreInfoVo
(
storeInfoVo
);
goblinRedisUtils
.
addStoreId
(
uid
,
storeInfoVo
.
getStoreId
());
// TODO: 2022/1/6 zhanggb redis
// goblinRedisUtils.setStoreInfoVo(storeInfoVo);
LinkedList
<
String
>
toMqSqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
Object
[]>
initStoreInfoObjs
=
CollectionUtil
.
linkedListObjectArr
();
...
...
@@ -89,9 +87,6 @@ public class GoblinStoreMgtCertificationServiceImpl implements IGoblinStoreMgtCe
storeInfoVo
.
setCertificationVo
(
storeCertificationVo
);
if
(
goblinMongoUtils
.
updateStoreInfoVo
(
storeInfoVo
))
{
// TODO: 2022/1/6 zhanggb redis
// goblinRedisUtils.setStoreInfoVo(storeInfoVo);
LinkedList
<
String
>
toMqSqls
=
CollectionUtil
.
linkedListString
();
LinkedList
<
Object
[]>
updateStoreInfoObjs
=
CollectionUtil
.
linkedListObjectArr
();
toMqSqls
.
add
(
SqlMapping
.
get
(
"goblin_store_info.update_by_cert1"
));
...
...
@@ -124,8 +119,6 @@ public class GoblinStoreMgtCertificationServiceImpl implements IGoblinStoreMgtCe
storeInfoVo
.
setUpdatedAt
(
LocalDateTime
.
now
());
storeInfoVo
.
setUpdatedBy
(
CurrentUtil
.
getCurrentUid
());
if
(
goblinMongoUtils
.
updateStoreInfoVo
(
param
.
completeStoreInfoVo
(
storeInfoVo
)))
{
goblinRedisUtils
.
delStoreInfoVo
(
storeInfoVo
.
getStoreId
());
// LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
// LinkedList<Object[]> updateStoreInfoObjs = CollectionUtil.linkedListObjectArr();
// toMqSqls.add(SqlMapping.get("goblin_store_info.update_by_cert2"));
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreMgtGoodsServiceImpl.java
View file @
dac9d249
...
...
@@ -500,6 +500,8 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
if
(
goblinMongoUtils
.
updateGoodsInfoVoByShelves
(
storeId
,
spuIdList
,
shelvesFlg
,
uid
,
now
))
{
if
(
goblinMongoUtils
.
updateGoodsSkuInfoVoByShelves
(
storeId
,
spuIdList
,
shelvesFlg
,
uid
,
now
))
{
goblinRedisUtils
.
deleteKeyForSelectGoods
();
// 精选商品:商品上架、下架、删除 调用的方法
spuIdList
.
forEach
(
spuId
->
goblinRedisUtils
.
delGoodsInfoVo
(
spuId
));
List
<
String
>
skuIds
=
goblinMongoUtils
.
getMgtGoodsSkuIds
(
storeId
,
spuIdList
);
skuIds
.
forEach
(
skuId
->
goblinRedisUtils
.
delGoodsSkuInfoVo
(
skuId
));
...
...
@@ -528,6 +530,8 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
List
<
String
>
spuIdList
=
storeMgtGoodsActionParam
.
getSpuIdList
();
if
(
goblinMongoUtils
.
delGoodsInfoVoBySpuIds
(
storeId
,
spuIdList
,
uid
,
now
))
{
goblinRedisUtils
.
deleteKeyForSelectGoods
();
// 精选商品:商品上架、下架、删除 调用的方法
spuIdList
.
forEach
(
spuId
->
goblinRedisUtils
.
delGoodsInfoVo
(
spuId
));
List
<
String
>
skuIdList
=
goblinMongoUtils
.
getMgtGoodsSkuIds
(
storeId
,
spuIdList
);
skuIdList
.
forEach
(
skuId
->
goblinRedisUtils
.
delGoodsSkuInfoVo
(
skuId
));
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
dac9d249
...
...
@@ -388,7 +388,7 @@ public class GoblinMongoUtils {
// SPU信息
public
GoblinGoodsInfoVo
getGoodsInfoVo
(
String
spuId
)
{
return
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"spuId"
).
is
(
spuId
).
and
(
"delFlg"
).
is
(
"0"
).
and
(
"shelvesStatus"
).
is
(
"3"
)),
return
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"spuId"
).
is
(
spuId
).
and
(
"delFlg"
).
is
(
"0"
).
and
(
"shelvesStatus"
).
is
(
"3"
)
.
and
(
"spuAppear"
).
is
(
"0"
)
),
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/resources/errors.properties
View file @
dac9d249
...
...
@@ -18,7 +18,7 @@
149001
=
无效操作
149002
=
无权操作该店铺,请核实
149003
=
处理失败,请联系客服
149004
=
149004
=
身份认证失败,请核实
149005
=
149006
=
添加商品失败,规格信息无效
149007
=
添加商品失败,商品名称重复
...
...
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