记得上下班打卡 | 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
89109bde
Commit
89109bde
authored
Nov 10, 2022
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~api:导入:模板/校验调整;
parent
8a550ad4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
GoblinStoreMgtGoodsImportController.java
...ontroller/manage/GoblinStoreMgtGoodsImportController.java
+1
-1
GoblinStoreMgtGoodsImportService.java
...service/impl/manage/GoblinStoreMgtGoodsImportService.java
+6
-3
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStoreMgtGoodsImportController.java
View file @
89109bde
...
@@ -51,7 +51,7 @@ public class GoblinStoreMgtGoodsImportController {
...
@@ -51,7 +51,7 @@ public class GoblinStoreMgtGoodsImportController {
String
analysisResultMsg
;
String
analysisResultMsg
;
try
{
try
{
switch
(
dataType
)
{
switch
(
dataType
)
{
case
1
:
case
1
:
// 模板https://img.zhengzai.tv/2022/11/09/shoppingmallimport.xlsx
analysisResultMsg
=
goblinStoreMgtGoodsImportService
.
goodsInformationDataAnalysisProcessing
(
file
,
currentUid
,
storeId
);
analysisResultMsg
=
goblinStoreMgtGoodsImportService
.
goodsInformationDataAnalysisProcessing
(
file
,
currentUid
,
storeId
);
break
;
break
;
case
2
:
case
2
:
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreMgtGoodsImportService.java
View file @
89109bde
...
@@ -61,14 +61,14 @@ public class GoblinStoreMgtGoodsImportService {
...
@@ -61,14 +61,14 @@ public class GoblinStoreMgtGoodsImportService {
throw
new
LiquidnetServiceException
(
"-1"
,
String
.
format
(
"数据内容不规范【第%s行商品编码有误】"
,
rowNum
));
throw
new
LiquidnetServiceException
(
"-1"
,
String
.
format
(
"数据内容不规范【第%s行商品编码有误】"
,
rowNum
));
}
}
/* 商品名称校验|------------------------------------------------------------------------------ */
/* 商品名称校验|------------------------------------------------------------------------------ */
if
(
StringUtils
.
isEmpty
(
dto
.
getSpuName
())
||
dto
.
getSpuName
().
length
()
>
10
0
)
{
if
(
StringUtils
.
isEmpty
(
dto
.
getSpuName
())
||
dto
.
getSpuName
().
length
()
>
3
0
)
{
throw
new
LiquidnetServiceException
(
"-1"
,
String
.
format
(
"数据内容不规范【第%s行商品名称有误】"
,
rowNum
));
throw
new
LiquidnetServiceException
(
"-1"
,
String
.
format
(
"数据内容不规范【第%s行商品名称有误】"
,
rowNum
));
}
}
/* 商品图片校验|------------------------------------------------------------------------------ */
/* 商品图片校验|------------------------------------------------------------------------------ */
if
(
StringUtils
.
isNotEmpty
(
dto
.
getSpuImgs
()))
{
if
(
StringUtils
.
isNotEmpty
(
dto
.
getSpuImgs
()))
{
if
(
dto
.
getSpuImgs
().
startsWith
(
"【图片链接】"
))
{
if
(
dto
.
getSpuImgs
().
startsWith
(
"【图片链接】"
))
{
String
[]
spuImgsArr
=
dto
.
getSpuImgs
().
replace
(
"【图片链接】"
,
""
).
replace
(
";"
,
";"
).
split
(
";"
);
String
[]
spuImgsArr
=
dto
.
getSpuImgs
().
replace
(
"【图片链接】"
,
""
).
replace
(
";"
,
";"
).
split
(
";"
);
if
(
spuImgsArr
.
length
>
15
)
{
if
(
spuImgsArr
.
length
>
9
)
{
throw
new
LiquidnetServiceException
(
"-1"
,
String
.
format
(
"数据内容不规范【第%s行商品图片最多支持15张】"
,
rowNum
));
throw
new
LiquidnetServiceException
(
"-1"
,
String
.
format
(
"数据内容不规范【第%s行商品图片最多支持15张】"
,
rowNum
));
}
}
ArrayList
<
String
>
spuImgList
=
CollectionUtil
.
arrayListString
();
ArrayList
<
String
>
spuImgList
=
CollectionUtil
.
arrayListString
();
...
@@ -99,13 +99,16 @@ public class GoblinStoreMgtGoodsImportService {
...
@@ -99,13 +99,16 @@ public class GoblinStoreMgtGoodsImportService {
if
(
ArrayUtils
.
isEmpty
(
specArr
)
||
specArr
.
length
!=
2
||
specArr
[
0
].
length
()
>
5
||
specArr
[
1
].
length
()
>
40
)
{
if
(
ArrayUtils
.
isEmpty
(
specArr
)
||
specArr
.
length
!=
2
||
specArr
[
0
].
length
()
>
5
||
specArr
[
1
].
length
()
>
40
)
{
throw
new
LiquidnetServiceException
(
"-1"
,
String
.
format
(
"数据内容不规范【第%s行商品规格信息有误】"
,
rowNum
));
throw
new
LiquidnetServiceException
(
"-1"
,
String
.
format
(
"数据内容不规范【第%s行商品规格信息有误】"
,
rowNum
));
}
}
if
(
skuSpecDtos
.
size
()
>
5
)
{
throw
new
LiquidnetServiceException
(
"-1"
,
String
.
format
(
"数据内容不规范【第%s行商品规格项超出5个】"
,
rowNum
));
}
GoblinGoodsSpecDto
skuSpecDto
=
GoblinGoodsSpecDto
.
getNew
();
GoblinGoodsSpecDto
skuSpecDto
=
GoblinGoodsSpecDto
.
getNew
();
skuSpecDto
.
setSpecName
(
specArr
[
0
]);
skuSpecDto
.
setSpecName
(
specArr
[
0
]);
skuSpecDto
.
setSpecVname
(
specArr
[
1
]);
skuSpecDto
.
setSpecVname
(
specArr
[
1
]);
skuSpecDtos
.
add
(
skuSpecDto
);
skuSpecDtos
.
add
(
skuSpecDto
);
dto
.
setSkuSpecDtos
(
skuSpecDtos
);
}
}
dto
.
setSkuSpecDtos
(
skuSpecDtos
);
/* 规格编码校验|------------------------------------------------------------------------------ */
/* 规格编码校验|------------------------------------------------------------------------------ */
if
(
StringUtils
.
isNotEmpty
(
dto
.
getSkuCode
())
&&
!
Pattern
.
matches
(
LnsRegex
.
Valid
.
ALPHABET_NUMBER_UNDER_50
,
dto
.
getSkuCode
()))
{
if
(
StringUtils
.
isNotEmpty
(
dto
.
getSkuCode
())
&&
!
Pattern
.
matches
(
LnsRegex
.
Valid
.
ALPHABET_NUMBER_UNDER_50
,
dto
.
getSkuCode
()))
{
throw
new
LiquidnetServiceException
(
"-1"
,
String
.
format
(
"数据内容不规范【第%s行规格编码格式有误】"
,
rowNum
));
throw
new
LiquidnetServiceException
(
"-1"
,
String
.
format
(
"数据内容不规范【第%s行规格编码格式有误】"
,
rowNum
));
...
...
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