Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-dj-goods-listing
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b98c6bc9
authored
May 10, 2026
by
zhoulm
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: 修正重复数据校验的错误类型为SERVER_ERROR
将重复数据校验的错误类型从PARAMETER_NULL改为SERVER_ERROR,以更准确地反映错误性质
1 parent
0fc3597f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
rpc-dj-goods-listing/src/main/java/cn/com/glsx/dj/goods/listing/service/GoodsListingGoodsTypeGroupRelationService.java
rpc-dj-goods-listing/src/main/java/cn/com/glsx/dj/goods/listing/service/GoodsListingGoodsTypeGroupRelationService.java
View file @
b98c6bc
...
@@ -196,19 +196,19 @@ public class GoodsListingGoodsTypeGroupRelationService {
...
@@ -196,19 +196,19 @@ public class GoodsListingGoodsTypeGroupRelationService {
if
(
Objects
.
equals
(
group
.
getCategoryType
(),
GoodsGroupCategoryTypeEnum
.
GOODS_TYPE
.
getValue
()))
{
if
(
Objects
.
equals
(
group
.
getCategoryType
(),
GoodsGroupCategoryTypeEnum
.
GOODS_TYPE
.
getValue
()))
{
RpcAssert
.
assertNotNull
(
item
.
getGoodsType
(),
DefaultErrorEnum
.
PARAMETER_NULL
,
"goodsTypeGroupRelation.goodsType is null"
);
RpcAssert
.
assertNotNull
(
item
.
getGoodsType
(),
DefaultErrorEnum
.
PARAMETER_NULL
,
"goodsTypeGroupRelation.goodsType is null"
);
RpcAssert
.
assertNotEmpty
(
item
.
getGoodsTypeName
(),
DefaultErrorEnum
.
PARAMETER_NULL
,
"goodsTypeGroupRelation.goodsTypeName is null"
);
RpcAssert
.
assertNotEmpty
(
item
.
getGoodsTypeName
(),
DefaultErrorEnum
.
PARAMETER_NULL
,
"goodsTypeGroupRelation.goodsTypeName is null"
);
RpcAssert
.
assertIsTrue
(!
relationKeySet
.
contains
(
String
.
valueOf
(
item
.
getGoodsType
())),
DefaultErrorEnum
.
PARAMETER_NULL
,
"按商品品类存在重复数据"
);
RpcAssert
.
assertIsTrue
(!
relationKeySet
.
contains
(
String
.
valueOf
(
item
.
getGoodsType
())),
DefaultErrorEnum
.
SERVER_ERROR
,
"按商品品类存在重复数据"
);
relationKeySet
.
add
(
String
.
valueOf
(
item
.
getGoodsType
()));
relationKeySet
.
add
(
String
.
valueOf
(
item
.
getGoodsType
()));
}
else
if
(
Objects
.
equals
(
group
.
getCategoryType
(),
GoodsGroupCategoryTypeEnum
.
UPGRADE_GOODS
.
getValue
()))
{
}
else
if
(
Objects
.
equals
(
group
.
getCategoryType
(),
GoodsGroupCategoryTypeEnum
.
UPGRADE_GOODS
.
getValue
()))
{
RpcAssert
.
assertNotNull
(
item
.
getUpgradeGoodsId
(),
DefaultErrorEnum
.
PARAMETER_NULL
,
"goodsTypeGroupRelation.upgradeGoodsId is null"
);
RpcAssert
.
assertNotNull
(
item
.
getUpgradeGoodsId
(),
DefaultErrorEnum
.
PARAMETER_NULL
,
"goodsTypeGroupRelation.upgradeGoodsId is null"
);
RpcAssert
.
assertNotEmpty
(
item
.
getUpgradeGoodsName
(),
DefaultErrorEnum
.
PARAMETER_NULL
,
"goodsTypeGroupRelation.upgradeGoodsName is null"
);
RpcAssert
.
assertNotEmpty
(
item
.
getUpgradeGoodsName
(),
DefaultErrorEnum
.
PARAMETER_NULL
,
"goodsTypeGroupRelation.upgradeGoodsName is null"
);
RpcAssert
.
assertNotEmpty
(
item
.
getUpgradeCommodityCode
(),
DefaultErrorEnum
.
PARAMETER_NULL
,
"goodsTypeGroupRelation.upgradeCommodityCode is null"
);
RpcAssert
.
assertNotEmpty
(
item
.
getUpgradeCommodityCode
(),
DefaultErrorEnum
.
PARAMETER_NULL
,
"goodsTypeGroupRelation.upgradeCommodityCode is null"
);
RpcAssert
.
assertNotEmpty
(
item
.
getMerchantGoodsCode
(),
DefaultErrorEnum
.
PARAMETER_NULL
,
"goodsTypeGroupRelation.merchantGoodsCode is null"
);
RpcAssert
.
assertNotEmpty
(
item
.
getMerchantGoodsCode
(),
DefaultErrorEnum
.
PARAMETER_NULL
,
"goodsTypeGroupRelation.merchantGoodsCode is null"
);
RpcAssert
.
assertIsTrue
(!
relationKeySet
.
contains
(
item
.
getMerchantGoodsCode
()),
DefaultErrorEnum
.
PARAMETER_NULL
,
"按具体商品存在重复数据"
);
RpcAssert
.
assertIsTrue
(!
relationKeySet
.
contains
(
item
.
getMerchantGoodsCode
()),
DefaultErrorEnum
.
SERVER_ERROR
,
"按具体商品存在重复数据"
);
relationKeySet
.
add
(
item
.
getMerchantGoodsCode
());
relationKeySet
.
add
(
item
.
getMerchantGoodsCode
());
}
else
if
(
Objects
.
equals
(
group
.
getCategoryType
(),
GoodsGroupCategoryTypeEnum
.
GOODS_PACKAGE
.
getValue
()))
{
}
else
if
(
Objects
.
equals
(
group
.
getCategoryType
(),
GoodsGroupCategoryTypeEnum
.
GOODS_PACKAGE
.
getValue
()))
{
RpcAssert
.
assertNotEmpty
(
item
.
getPackageCode
(),
DefaultErrorEnum
.
PARAMETER_NULL
,
"goodsTypeGroupRelation.packageCode is null"
);
RpcAssert
.
assertNotEmpty
(
item
.
getPackageCode
(),
DefaultErrorEnum
.
PARAMETER_NULL
,
"goodsTypeGroupRelation.packageCode is null"
);
RpcAssert
.
assertNotEmpty
(
item
.
getPackageName
(),
DefaultErrorEnum
.
PARAMETER_NULL
,
"goodsTypeGroupRelation.packageName is null"
);
RpcAssert
.
assertNotEmpty
(
item
.
getPackageName
(),
DefaultErrorEnum
.
PARAMETER_NULL
,
"goodsTypeGroupRelation.packageName is null"
);
RpcAssert
.
assertIsTrue
(!
relationKeySet
.
contains
(
item
.
getPackageCode
()),
DefaultErrorEnum
.
PARAMETER_NULL
,
"按具体套餐存在重复数据"
);
RpcAssert
.
assertIsTrue
(!
relationKeySet
.
contains
(
item
.
getPackageCode
()),
DefaultErrorEnum
.
SERVER_ERROR
,
"按具体套餐存在重复数据"
);
relationKeySet
.
add
(
item
.
getPackageCode
());
relationKeySet
.
add
(
item
.
getPackageCode
());
}
else
{
}
else
{
throw
new
RpcServiceException
(
DefaultErrorEnum
.
SERVER_ERROR
,
"分账品类错误"
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
SERVER_ERROR
,
"分账品类错误"
);
...
@@ -228,13 +228,13 @@ public class GoodsListingGoodsTypeGroupRelationService {
...
@@ -228,13 +228,13 @@ public class GoodsListingGoodsTypeGroupRelationService {
List
<
GoodsListingGoodsTypeGroupRelation
>
relationList
=
relationMap
.
get
(
group
.
getId
());
List
<
GoodsListingGoodsTypeGroupRelation
>
relationList
=
relationMap
.
get
(
group
.
getId
());
for
(
GoodsListingGoodsTypeGroupRelation
item:
relationList
)
{
for
(
GoodsListingGoodsTypeGroupRelation
item:
relationList
)
{
if
(
Objects
.
equals
(
group
.
getCategoryType
(),
GoodsGroupCategoryTypeEnum
.
GOODS_TYPE
.
getValue
()))
{
if
(
Objects
.
equals
(
group
.
getCategoryType
(),
GoodsGroupCategoryTypeEnum
.
GOODS_TYPE
.
getValue
()))
{
RpcAssert
.
assertIsTrue
(!
goodsTypeSet
.
contains
(
item
.
getGoodsType
()),
DefaultErrorEnum
.
PARAMETER_NULL
,
"按商品品类存在重复数据"
);
RpcAssert
.
assertIsTrue
(!
goodsTypeSet
.
contains
(
item
.
getGoodsType
()),
DefaultErrorEnum
.
SERVER_ERROR
,
"按商品品类存在重复数据"
);
goodsTypeSet
.
add
(
item
.
getGoodsType
());
goodsTypeSet
.
add
(
item
.
getGoodsType
());
}
else
if
(
Objects
.
equals
(
group
.
getCategoryType
(),
GoodsGroupCategoryTypeEnum
.
UPGRADE_GOODS
.
getValue
()))
{
}
else
if
(
Objects
.
equals
(
group
.
getCategoryType
(),
GoodsGroupCategoryTypeEnum
.
UPGRADE_GOODS
.
getValue
()))
{
RpcAssert
.
assertIsTrue
(!
merchantGoodsCodeSet
.
contains
(
item
.
getMerchantGoodsCode
()),
DefaultErrorEnum
.
PARAMETER_NULL
,
"按具体商品存在重复数据"
);
RpcAssert
.
assertIsTrue
(!
merchantGoodsCodeSet
.
contains
(
item
.
getMerchantGoodsCode
()),
DefaultErrorEnum
.
SERVER_ERROR
,
"按具体商品存在重复数据"
);
merchantGoodsCodeSet
.
add
(
item
.
getMerchantGoodsCode
());
merchantGoodsCodeSet
.
add
(
item
.
getMerchantGoodsCode
());
}
else
if
(
Objects
.
equals
(
group
.
getCategoryType
(),
GoodsGroupCategoryTypeEnum
.
GOODS_PACKAGE
.
getValue
()))
{
}
else
if
(
Objects
.
equals
(
group
.
getCategoryType
(),
GoodsGroupCategoryTypeEnum
.
GOODS_PACKAGE
.
getValue
()))
{
RpcAssert
.
assertIsTrue
(!
packageCodeSet
.
contains
(
item
.
getPackageCode
()),
DefaultErrorEnum
.
PARAMETER_NULL
,
"按具体套餐存在重复数据"
);
RpcAssert
.
assertIsTrue
(!
packageCodeSet
.
contains
(
item
.
getPackageCode
()),
DefaultErrorEnum
.
SERVER_ERROR
,
"按具体套餐存在重复数据"
);
packageCodeSet
.
add
(
item
.
getPackageCode
());
packageCodeSet
.
add
(
item
.
getPackageCode
());
}
else
{
}
else
{
throw
new
RpcServiceException
(
DefaultErrorEnum
.
SERVER_ERROR
,
"分账品类错误"
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
SERVER_ERROR
,
"分账品类错误"
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment