记得上下班打卡 | 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
62f64c6d
Commit
62f64c6d
authored
Mar 04, 2022
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~API:商品编辑:SPU添加、编辑:ISBN校验调整;
parent
dd8186b2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
17 deletions
+70
-17
GoblinStoreMgtGoodsController.java
...blin/controller/manage/GoblinStoreMgtGoodsController.java
+70
-17
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 @
62f64c6d
...
@@ -14,10 +14,7 @@ import com.liquidnet.service.base.PagedResult;
...
@@ -14,10 +14,7 @@ import com.liquidnet.service.base.PagedResult;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto
;
import
com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto
;
import
com.liquidnet.service.goblin.dto.GoblinStoreMgtGoodsListVoExcel
;
import
com.liquidnet.service.goblin.dto.GoblinStoreMgtGoodsListVoExcel
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsActionParam
;
import
com.liquidnet.service.goblin.dto.manage.*
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsAddParam
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsEditSkuParam
;
import
com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsFilterParam
;
import
com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsInfoVo
;
import
com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsInfoVo
;
import
com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsListVo
;
import
com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsListVo
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.goblin.dto.vo.*
;
...
@@ -214,7 +211,8 @@ public class GoblinStoreMgtGoodsController {
...
@@ -214,7 +211,8 @@ public class GoblinStoreMgtGoodsController {
if
(
log
.
isDebugEnabled
())
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"商品管理:SPU添加:[GoblinStoreMgtGoodsAddParam={}]"
,
JsonUtils
.
toJson
(
storeMgtGoodsAddParam
));
log
.
debug
(
"商品管理:SPU添加:[GoblinStoreMgtGoodsAddParam={}]"
,
JsonUtils
.
toJson
(
storeMgtGoodsAddParam
));
}
}
if
(
CollectionUtils
.
isEmpty
(
storeMgtGoodsAddParam
.
getSkuParamList
()))
{
List
<
GoblinStoreMgtGoodsAddSkuParam
>
skuParamList
=
storeMgtGoodsAddParam
.
getSkuParamList
();
if
(
CollectionUtils
.
isEmpty
(
skuParamList
))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149006"
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149006"
));
}
}
if
(
CollectionUtils
.
isEmpty
(
storeMgtGoodsAddParam
.
getImageList
()))
{
if
(
CollectionUtils
.
isEmpty
(
storeMgtGoodsAddParam
.
getImageList
()))
{
...
@@ -222,15 +220,41 @@ public class GoblinStoreMgtGoodsController {
...
@@ -222,15 +220,41 @@ public class GoblinStoreMgtGoodsController {
}
}
String
cateSid
=
storeMgtGoodsAddParam
.
getCateSid
(),
cateTid
=
storeMgtGoodsAddParam
.
getCateTid
();
String
cateSid
=
storeMgtGoodsAddParam
.
getCateSid
(),
cateTid
=
storeMgtGoodsAddParam
.
getCateTid
();
List
<
GoblinSelfGoodsCategoryVo
>
selfGoodsCategoryVos
=
goblinStoreMgtExtraService
.
listCategoryVo
();
List
<
GoblinSelfGoodsCategoryVo
>
selfGoodsCategoryVos
=
goblinStoreMgtExtraService
.
listCategoryVo
();
if
(
selfGoodsCategoryVos
.
stream
().
noneMatch
(
r
->
r
.
getCateId
().
equals
(
storeMgtGoodsAddParam
.
getCateFid
())
&&
r
.
getGrade
().
equals
(
"1"
)))
{
Optional
<
GoblinSelfGoodsCategoryVo
>
categoryVoOptional
=
selfGoodsCategoryVos
.
stream
().
filter
(
r
->
r
.
getCateId
().
equals
(
storeMgtGoodsAddParam
.
getCateFid
())
&&
r
.
getGrade
().
equals
(
"1"
)).
findAny
();
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"商品分类1无效"
);
if
(!
categoryVoOptional
.
isPresent
())
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"商品一级分类无效"
);
}
}
if
(
StringUtils
.
isNotBlank
(
cateSid
)
&&
selfGoodsCategoryVos
.
stream
().
noneMatch
(
r
->
r
.
getCateId
().
equals
(
cateSid
)
&&
r
.
getGrade
().
equals
(
"2"
)))
{
GoblinSelfGoodsCategoryVo
selfGoodsCategoryVo
=
categoryVoOptional
.
get
();
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"商品分类2无效"
);
if
(
selfGoodsCategoryVo
.
getNeIsbn
().
equals
(
"1"
)
&&
skuParamList
.
stream
().
anyMatch
(
r
->
StringUtils
.
isBlank
(
r
.
getSkuIsbn
())))
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"请核实输入ISBN"
);
}
}
if
(
StringUtils
.
isNotBlank
(
cateTid
)
&&
selfGoodsCategoryVos
.
stream
().
noneMatch
(
r
->
r
.
getCateId
().
equals
(
cateTid
)
&&
r
.
getGrade
().
equals
(
"3"
)))
{
if
(
StringUtils
.
isNotBlank
(
cateSid
))
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"商品分类3无效"
);
if
(!(
categoryVoOptional
=
selfGoodsCategoryVos
.
stream
().
filter
(
r
->
r
.
getCateId
().
equals
(
cateSid
)
&&
r
.
getGrade
().
equals
(
"2"
)).
findAny
()).
isPresent
())
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"商品二级分类无效"
);
}
}
selfGoodsCategoryVo
=
categoryVoOptional
.
get
();
if
(
selfGoodsCategoryVo
.
getNeIsbn
().
equals
(
"1"
)
&&
skuParamList
.
stream
().
anyMatch
(
r
->
StringUtils
.
isBlank
(
r
.
getSkuIsbn
())))
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"请核实输入ISBN"
);
}
}
if
(
StringUtils
.
isNotBlank
(
cateTid
))
{
if
(!(
categoryVoOptional
=
selfGoodsCategoryVos
.
stream
().
filter
(
r
->
r
.
getCateId
().
equals
(
cateTid
)
&&
r
.
getGrade
().
equals
(
"3"
)).
findAny
()).
isPresent
())
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"商品三级分类无效"
);
}
selfGoodsCategoryVo
=
categoryVoOptional
.
get
();
if
(
selfGoodsCategoryVo
.
getNeIsbn
().
equals
(
"1"
)
&&
skuParamList
.
stream
().
anyMatch
(
r
->
StringUtils
.
isBlank
(
r
.
getSkuIsbn
())))
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"请核实输入ISBN"
);
}
}
// if (selfGoodsCategoryVos.stream().noneMatch(r -> r.getCateId().equals(storeMgtGoodsAddParam.getCateFid()) && r.getGrade().equals("1"))) {
// return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品一级分类无效");
// }
// if (StringUtils.isNotBlank(cateSid) && selfGoodsCategoryVos.stream().noneMatch(r -> r.getCateId().equals(cateSid) && r.getGrade().equals("2"))) {
// return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品二级分类无效");
// }
// if (StringUtils.isNotBlank(cateTid) && selfGoodsCategoryVos.stream().noneMatch(r -> r.getCateId().equals(cateTid) && r.getGrade().equals("3"))) {
// return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品三级分类无效");
// }
GoblinGoodsInfoVo
mgtGoodsInfoVo
=
goblinMongoUtils
.
getMgtGoodsInfoVo
(
storeId
,
storeMgtGoodsAddParam
.
getName
());
GoblinGoodsInfoVo
mgtGoodsInfoVo
=
goblinMongoUtils
.
getMgtGoodsInfoVo
(
storeId
,
storeMgtGoodsAddParam
.
getName
());
if
(
null
!=
mgtGoodsInfoVo
)
{
if
(
null
!=
mgtGoodsInfoVo
)
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149007"
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149007"
));
...
@@ -333,17 +357,46 @@ public class GoblinStoreMgtGoodsController {
...
@@ -333,17 +357,46 @@ public class GoblinStoreMgtGoodsController {
if
(
null
!=
mgtGoodsInfoVo
&&
!
mgtGoodsInfoVo
.
getSpuId
().
equals
(
storeMgtGoodsAddParam
.
getSpuId
()))
{
if
(
null
!=
mgtGoodsInfoVo
&&
!
mgtGoodsInfoVo
.
getSpuId
().
equals
(
storeMgtGoodsAddParam
.
getSpuId
()))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149007"
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"149007"
));
}
}
List
<
GoblinGoodsSkuInfoVo
>
goodsSkuInfoVos
=
goblinMongoUtils
.
getGoodsSkuInfoVos
(
mgtGoodsInfoVo
.
getSkuIdList
());
boolean
hasSkuFlg
=
CollectionUtils
.
isEmpty
(
goodsSkuInfoVos
);
String
cateSid
=
storeMgtGoodsAddParam
.
getCateSid
(),
cateTid
=
storeMgtGoodsAddParam
.
getCateTid
();
String
cateSid
=
storeMgtGoodsAddParam
.
getCateSid
(),
cateTid
=
storeMgtGoodsAddParam
.
getCateTid
();
List
<
GoblinSelfGoodsCategoryVo
>
selfGoodsCategoryVos
=
goblinStoreMgtExtraService
.
listCategoryVo
();
List
<
GoblinSelfGoodsCategoryVo
>
selfGoodsCategoryVos
=
goblinStoreMgtExtraService
.
listCategoryVo
();
if
(
selfGoodsCategoryVos
.
stream
().
noneMatch
(
r
->
r
.
getCateId
().
equals
(
storeMgtGoodsAddParam
.
getCateFid
())
&&
r
.
getGrade
().
equals
(
"1"
)))
{
Optional
<
GoblinSelfGoodsCategoryVo
>
categoryVoOptional
=
selfGoodsCategoryVos
.
stream
().
filter
(
r
->
r
.
getCateId
().
equals
(
storeMgtGoodsAddParam
.
getCateFid
())
&&
r
.
getGrade
().
equals
(
"1"
)).
findAny
();
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"商品分类1无效"
);
if
(!
categoryVoOptional
.
isPresent
())
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"商品一级分类无效"
);
}
}
if
(
StringUtils
.
isNotBlank
(
cateSid
)
&&
selfGoodsCategoryVos
.
stream
().
noneMatch
(
r
->
r
.
getCateId
().
equals
(
cateSid
)
&&
r
.
getGrade
().
equals
(
"2"
)))
{
GoblinSelfGoodsCategoryVo
selfGoodsCategoryVo
=
categoryVoOptional
.
get
();
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"商品分类2无效"
);
if
(
selfGoodsCategoryVo
.
getNeIsbn
().
equals
(
"1"
)
&&
hasSkuFlg
&&
goodsSkuInfoVos
.
stream
().
anyMatch
(
r
->
StringUtils
.
isBlank
(
r
.
getSkuIsbn
())))
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"请核实输入ISBN"
);
}
}
if
(
StringUtils
.
isNotBlank
(
cateTid
)
&&
selfGoodsCategoryVos
.
stream
().
noneMatch
(
r
->
r
.
getCateId
().
equals
(
cateTid
)
&&
r
.
getGrade
().
equals
(
"3"
)))
{
if
(
StringUtils
.
isNotBlank
(
cateSid
))
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"商品分类3无效"
);
if
(!(
categoryVoOptional
=
selfGoodsCategoryVos
.
stream
().
filter
(
r
->
r
.
getCateId
().
equals
(
cateSid
)
&&
r
.
getGrade
().
equals
(
"2"
)).
findAny
()).
isPresent
())
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"商品二级分类无效"
);
}
}
selfGoodsCategoryVo
=
categoryVoOptional
.
get
();
if
(
selfGoodsCategoryVo
.
getNeIsbn
().
equals
(
"1"
)
&&
hasSkuFlg
&&
goodsSkuInfoVos
.
stream
().
anyMatch
(
r
->
StringUtils
.
isBlank
(
r
.
getSkuIsbn
())))
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"请核实输入ISBN"
);
}
}
if
(
StringUtils
.
isNotBlank
(
cateTid
))
{
if
(!(
categoryVoOptional
=
selfGoodsCategoryVos
.
stream
().
filter
(
r
->
r
.
getCateId
().
equals
(
cateTid
)
&&
r
.
getGrade
().
equals
(
"3"
)).
findAny
()).
isPresent
())
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"商品三级分类无效"
);
}
selfGoodsCategoryVo
=
categoryVoOptional
.
get
();
if
(
selfGoodsCategoryVo
.
getNeIsbn
().
equals
(
"1"
)
&&
hasSkuFlg
&&
goodsSkuInfoVos
.
stream
().
anyMatch
(
r
->
StringUtils
.
isBlank
(
r
.
getSkuIsbn
())))
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"请核实输入ISBN"
);
}
}
// if (selfGoodsCategoryVos.stream().noneMatch(r -> r.getCateId().equals(storeMgtGoodsAddParam.getCateFid()) && r.getGrade().equals("1"))) {
// return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品分类1无效");
// }
// if (StringUtils.isNotBlank(cateSid) && selfGoodsCategoryVos.stream().noneMatch(r -> r.getCateId().equals(cateSid) && r.getGrade().equals("2"))) {
// return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品分类2无效");
// }
// if (StringUtils.isNotBlank(cateTid) && selfGoodsCategoryVos.stream().noneMatch(r -> r.getCateId().equals(cateTid) && r.getGrade().equals("3"))) {
// return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品分类3无效");
// }
GoblinGoodsInfoVo
goodsInfoVo
;
GoblinGoodsInfoVo
goodsInfoVo
;
if
(
StringUtils
.
isBlank
(
storeMgtGoodsAddParam
.
getSpuId
())
if
(
StringUtils
.
isBlank
(
storeMgtGoodsAddParam
.
getSpuId
())
||
null
==
(
goodsInfoVo
=
goblinRedisUtils
.
getGoodsInfoVo
(
storeMgtGoodsAddParam
.
getSpuId
()))
||
null
==
(
goodsInfoVo
=
goblinRedisUtils
.
getGoodsInfoVo
(
storeMgtGoodsAddParam
.
getSpuId
()))
...
...
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