记得上下班打卡 | 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
ec5e7c15
Commit
ec5e7c15
authored
May 09, 2022
by
zhanggb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+api:商品管理:藏品AR删除;
parent
19f07844
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
41 deletions
+45
-41
GoblinStoreMgtGoodsSkuExtraController.java
...troller/manage/GoblinStoreMgtGoodsSkuExtraController.java
+45
-41
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStoreMgtGoodsSkuExtraController.java
View file @
ec5e7c15
...
...
@@ -2,11 +2,13 @@ package com.liquidnet.service.goblin.controller.manage;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.github.xiaoymin.knife4j.annotations.ApiSupport
;
import
com.liquidnet.common.exception.constant.ErrorCode
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.base.ErrorMapping
;
import
com.liquidnet.service.base.PagedResult
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsSkuArActionParam
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsSkuArAddParam
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsSkuArFilterParam
;
import
com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsSkuArListVo
;
...
...
@@ -18,10 +20,12 @@ import io.swagger.annotations.ApiOperation;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.Valid
;
import
java.util.List
;
@ApiSupport
(
order
=
149005
)
@Api
(
tags
=
"商品管理:单品拓展信息"
)
...
...
@@ -50,47 +54,47 @@ public class GoblinStoreMgtGoodsSkuExtraController {
return
ResponseDto
.
success
(
goblinStoreMgtGoodsSkuExtraService
.
skuArList
(
mgtGoodsSkuArFilterParam
));
}
//
@ApiOperationSupport(order = 2)
//
@ApiOperation(value = "藏品AR:管理")
//
@PostMapping("ar_action")
//
public ResponseDto<Object> action(@Valid @RequestBody GoblinStoreMgtGoodsSkuArActionParam mgtGoodsSkuArActionParam) {
//
String currentUid = CurrentUtil.getCurrentUid(), storeId = mgtGoodsSkuArActionParam.getStoreId();
//
if (!goblinRedisUtils.hasStoreId(currentUid, storeId)) {
//
return ResponseDto.failure(ErrorMapping.get("149002"));
//
}
//
List<String> skuIdList = mgtGoodsSkuArActionParam.getSkuIdList();
//
if (CollectionUtils.isEmpty(skuIdList)) {
//
return ResponseDto.failure(ErrorMapping.get("149021"));
//
}
//
if (log.isDebugEnabled()) {
//
log.debug("商品管理:藏品AR:管理[UID={},GoblinStoreMgtGoodsActionParam={}]", currentUid, JsonUtils.toJson(mgtGoodsSkuArActionParam));
//
}
//
boolean resultFlg;
//
switch (mgtGoodsSkuArActionParam.getAction()) {
//
case "REMOVE":
//
for (String skuId : skuIdList) {
//
GoblinGoodsSkuInfoVo mgtGoodsSkuInfoVo = goblinRedisUtils.getGoodsSkuInfoVo(skuId);
//
if (null == mgtGoodsSkuInfoVo || !mgtGoodsSkuInfoVo.getDelFlg().equals("0")) {
//
log.warn("商品管理:藏品AR:管理:藏品不存在或已删除[UID={},skuId={}]", currentUid, skuId);
//
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "藏品AR不存在或已删除");
//
}
//
if (mgtGoodsSkuInfoVo.getSkuType() != 1) {
//
log.warn("商品管理:藏品AR:管理:非数字藏品不支持此操作[UID={},skuId={}]", currentUid, skuId);
//
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "无效操作,非数字藏品");
//
}
//
if (!mgtGoodsSkuInfoVo.getStoreId().equals(storeId)) {
//
log.warn("商品管理:藏品AR:管理:非本店铺藏品,无权操作[UID={},skuId={}]", currentUid, skuId);
//
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "非本店铺藏品,无权操作");
//
}
//
}
//
resultFlg = goblinStoreMgtGoodsSkuExtraService.skuArDel(currentUid, skuIdList);
//
break;
//
default:
//
log.warn("商品管理:藏品AR:管理:Invalid operation[UID={},GoblinStoreMgtGoodsSkuArActionParam={}]", currentUid, JsonUtils.toJson(mgtGoodsSkuArActionParam));
//
return ResponseDto.failure(ErrorMapping.get("149001"));
//
}
//
return resultFlg ? ResponseDto.success() : ResponseDto.failure();
//
}
@ApiOperationSupport
(
order
=
2
)
@ApiOperation
(
value
=
"藏品AR:管理"
)
@PostMapping
(
"ar_action"
)
public
ResponseDto
<
Object
>
action
(
@Valid
@RequestBody
GoblinStoreMgtGoodsSkuArActionParam
mgtGoodsSkuArActionParam
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
(),
storeId
=
mgtGoodsSkuArActionParam
.
getStoreId
();
if
(!
goblinRedisUtils
.
hasStoreId
(
currentUid
,
storeId
))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149002"
));
}
List
<
String
>
skuIdList
=
mgtGoodsSkuArActionParam
.
getSkuIdList
();
if
(
CollectionUtils
.
isEmpty
(
skuIdList
))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149021"
));
}
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"商品管理:藏品AR:管理[UID={},GoblinStoreMgtGoodsActionParam={}]"
,
currentUid
,
JsonUtils
.
toJson
(
mgtGoodsSkuArActionParam
));
}
boolean
resultFlg
;
switch
(
mgtGoodsSkuArActionParam
.
getAction
())
{
case
"REMOVE"
:
for
(
String
skuId
:
skuIdList
)
{
GoblinGoodsSkuInfoVo
mgtGoodsSkuInfoVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
skuId
);
if
(
null
==
mgtGoodsSkuInfoVo
||
!
mgtGoodsSkuInfoVo
.
getDelFlg
().
equals
(
"0"
))
{
log
.
warn
(
"商品管理:藏品AR:管理:藏品不存在或已删除[UID={},skuId={}]"
,
currentUid
,
skuId
);
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"藏品AR不存在或已删除"
);
}
if
(
mgtGoodsSkuInfoVo
.
getSkuType
()
!=
1
)
{
log
.
warn
(
"商品管理:藏品AR:管理:非数字藏品不支持此操作[UID={},skuId={}]"
,
currentUid
,
skuId
);
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"无效操作,非数字藏品"
);
}
if
(!
mgtGoodsSkuInfoVo
.
getStoreId
().
equals
(
storeId
))
{
log
.
warn
(
"商品管理:藏品AR:管理:非本店铺藏品,无权操作[UID={},skuId={}]"
,
currentUid
,
skuId
);
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"非本店铺藏品,无权操作"
);
}
}
resultFlg
=
goblinStoreMgtGoodsSkuExtraService
.
skuArDel
(
currentUid
,
skuIdList
);
break
;
default
:
log
.
warn
(
"商品管理:藏品AR:管理:Invalid operation[UID={},GoblinStoreMgtGoodsSkuArActionParam={}]"
,
currentUid
,
JsonUtils
.
toJson
(
mgtGoodsSkuArActionParam
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149001"
));
}
return
resultFlg
?
ResponseDto
.
success
()
:
ResponseDto
.
failure
();
}
@ApiOperationSupport
(
order
=
4
)
@ApiOperation
(
value
=
"藏品AR:添加"
)
...
...
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