记得上下班打卡 | 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
d7d1b160
Commit
d7d1b160
authored
Aug 10, 2022
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~api:藏品管理:添加盲盒+校验;
parent
7d39ddce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
19 deletions
+22
-19
GoblinStoreMgtGoodsController.java
...blin/controller/manage/GoblinStoreMgtGoodsController.java
+22
-19
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStoreMgtGoodsController.java
View file @
d7d1b160
...
...
@@ -1087,25 +1087,7 @@ public class GoblinStoreMgtGoodsController {
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149010"
));
}
if
(
goodsInfoVo
.
getSpuType
()
==
0
)
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"无效操作,该商品非数字藏品"
);
}
if
(
"23"
.
contains
(
mgtDigitalGoodsAddSkuParam
.
getWatchType
()))
{
if
(
StringUtils
.
isBlank
(
mgtDigitalGoodsAddSkuParam
.
getSkuWatchPic
()))
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"展示预览图不能为空"
);
}
}
else
{
mgtDigitalGoodsAddSkuParam
.
setSkuWatchPic
(
null
);
}
BigDecimal
hitRatio
=
mgtDigitalGoodsAddSkuParam
.
getHitRatio
();
if
(
null
!=
hitRatio
&&
hitRatio
.
scale
()
>
2
)
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"概率值只支持小数点后两位"
);
}
if
(
goblinMongoUtils
.
countMgtGoodsSkuInfoVo
(
mgtDigitalGoodsAddSkuParam
.
getName
(),
1
)
>
0
)
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149018"
));
}
JsonNode
priceVNode
=
goblinRedisUtils
.
getIosProducts
().
get
(
mgtDigitalGoodsAddSkuParam
.
getProductId
());
if
(
null
==
priceVNode
)
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"无效的IOS商品ID"
);
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"该商品非数字藏品"
);
}
String
unbox
=
mgtDigitalGoodsAddSkuParam
.
getUnbox
();
boolean
notUnboxFlg
=
StringUtils
.
isEmpty
(
unbox
)
||
unbox
.
equals
(
"0"
);
...
...
@@ -1132,10 +1114,31 @@ public class GoblinStoreMgtGoodsController {
// }
// }
}
else
{
// 盲盒校验
if
(
CollectionUtils
.
isEmpty
(
goodsInfoVo
.
getSkuIdList
()))
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"请先添加SKU"
);
}
if
(
StringUtils
.
isEmpty
(
mgtDigitalGoodsAddSkuParam
.
getOpeningTime
()))
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"盲盒开启时间不能为空"
);
}
}
if
(
"23"
.
contains
(
mgtDigitalGoodsAddSkuParam
.
getWatchType
()))
{
if
(
StringUtils
.
isBlank
(
mgtDigitalGoodsAddSkuParam
.
getSkuWatchPic
()))
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"展示预览图不能为空"
);
}
}
else
{
mgtDigitalGoodsAddSkuParam
.
setSkuWatchPic
(
null
);
}
BigDecimal
hitRatio
=
mgtDigitalGoodsAddSkuParam
.
getHitRatio
();
if
(
null
!=
hitRatio
&&
hitRatio
.
scale
()
>
2
)
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"概率值只支持小数点后两位"
);
}
if
(
goblinMongoUtils
.
countMgtGoodsSkuInfoVo
(
mgtDigitalGoodsAddSkuParam
.
getName
(),
1
)
>
0
)
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149018"
));
}
JsonNode
priceVNode
=
goblinRedisUtils
.
getIosProducts
().
get
(
mgtDigitalGoodsAddSkuParam
.
getProductId
());
if
(
null
==
priceVNode
)
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"无效的IOS商品ID"
);
}
if
(
"3"
.
equals
(
mgtDigitalGoodsAddSkuParam
.
getShelvesHandle
())
&&
StringUtils
.
isEmpty
(
mgtDigitalGoodsAddSkuParam
.
getShelvesTime
()))
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"请指定预约上架时间"
);
}
...
...
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