记得上下班打卡 | 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
0f0a62a9
Commit
0f0a62a9
authored
Apr 15, 2022
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~api:藏品管理:添加藏品+概率和<100校验;
parent
42a9feda
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
GoblinStoreMgtGoodsController.java
...blin/controller/manage/GoblinStoreMgtGoodsController.java
+11
-1
GoblinStoreMgtGoodsServiceImpl.java
...n/service/impl/manage/GoblinStoreMgtGoodsServiceImpl.java
+11
-1
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 @
0f0a62a9
...
...
@@ -5,6 +5,7 @@ import com.alibaba.excel.support.ExcelTypeEnum;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.github.xiaoymin.knife4j.annotations.ApiSupport
;
import
com.liquidnet.common.exception.LiquidnetServiceException
;
import
com.liquidnet.common.exception.constant.ErrorCode
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
...
...
@@ -1143,7 +1144,16 @@ public class GoblinStoreMgtGoodsController {
initGoodsSkuInfoVo
.
setExtagVoList
(
goodsExtagVoList
);
}
}
try
{
goblinstoreMgtGoodsService
.
digitalGoodsAddSku
(
currentUid
,
initGoodsSkuInfoVo
,
goodsInfoVo
);
}
catch
(
Exception
e
)
{
if
(
e
instanceof
LiquidnetServiceException
)
{
LiquidnetServiceException
lsEx
=
(
LiquidnetServiceException
)
e
;
return
ResponseDto
.
failure
(
lsEx
.
getCode
(),
lsEx
.
getMessage
());
}
log
.
error
(
"商品管理:商品编辑:SKU添加:异常[UID={},initGoodsSkuInfoVo={}]"
,
currentUid
,
JsonUtils
.
toJson
(
initGoodsSkuInfoVo
),
e
);
return
ResponseDto
.
failure
(
"添加失败"
);
}
return
ResponseDto
.
success
(
initGoodsSkuInfoVo
.
getSkuId
());
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreMgtGoodsServiceImpl.java
View file @
0f0a62a9
package
com
.
liquidnet
.
service
.
goblin
.
service
.
impl
.
manage
;
import
com.liquidnet.common.exception.LiquidnetServiceException
;
import
com.liquidnet.common.exception.constant.ErrorCode
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.base.PagedResult
;
...
...
@@ -982,13 +984,21 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
}
skuIdList
.
add
(
initGoodsSkuInfoVo
.
getSkuId
());
mgtGoodsInfoVo
.
setSkuIdList
(
skuIdList
);
BigDecimal
priceGe
=
BigDecimal
.
ZERO
,
priceLe
=
BigDecimal
.
ZERO
;
BigDecimal
priceGe
=
BigDecimal
.
ZERO
,
priceLe
=
BigDecimal
.
ZERO
,
hitRatioSum
=
BigDecimal
.
ZERO
;
for
(
String
skuIdStr
:
skuIdList
)
{
GoblinGoodsSkuInfoVo
skuInfoVo
=
skuIdStr
.
equals
(
skuId
)
?
initGoodsSkuInfoVo
:
goblinRedisUtils
.
getGoodsSkuInfoVo
(
skuIdStr
);
if
(
null
!=
skuInfoVo
&&
skuInfoVo
.
getDelFlg
().
equals
(
"0"
))
{
priceGe
=
priceGe
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
?
skuInfoVo
.
getPrice
()
:
(
priceGe
.
compareTo
(
skuInfoVo
.
getPrice
())
>
0
?
skuInfoVo
.
getPrice
()
:
priceGe
);
priceLe
=
priceLe
.
compareTo
(
skuInfoVo
.
getPrice
())
<
0
?
skuInfoVo
.
getPrice
()
:
priceLe
;
BigDecimal
hitRatio
=
skuInfoVo
.
getHitRatio
();
if
(
"0"
.
equals
(
skuInfoVo
.
getSoldoutStatus
())
&&
"0"
.
equals
(
skuInfoVo
.
getUnbox
())
&&
null
!=
hitRatio
)
{
hitRatioSum
=
hitRatioSum
.
add
(
hitRatio
);
}
}
}
if
(
hitRatioSum
.
compareTo
(
new
BigDecimal
(
"100"
))
>
0
)
{
throw
new
LiquidnetServiceException
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"各藏品概率之和不能大于100"
);
}
LinkedList
<
Object
[]>
updateGoodsObjs
=
CollectionUtil
.
linkedListObjectArr
();
if
(
priceGe
.
compareTo
(
mgtGoodsInfoVo
.
getPriceGe
())
!=
0
||
priceLe
.
compareTo
(
mgtGoodsInfoVo
.
getPriceLe
())
!=
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