记得上下班打卡 | 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
21ebe7a4
Commit
21ebe7a4
authored
Nov 09, 2022
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~api:店铺商品管理:批量导入数据;
parent
671ae42c
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
302 additions
and
141 deletions
+302
-141
GoblinGoodsImportDto.java
...om/liquidnet/service/goblin/dto/GoblinGoodsImportDto.java
+3
-0
GoblinStoreMgtGoodsImportController.java
...ontroller/manage/GoblinStoreMgtGoodsImportController.java
+5
-5
GoblinStoreMgtGoodsImportService.java
...service/impl/manage/GoblinStoreMgtGoodsImportService.java
+294
-136
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/GoblinGoodsImportDto.java
View file @
21ebe7a4
...
...
@@ -4,6 +4,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.List
;
@Data
public
class
GoblinGoodsImportDto
{
...
...
@@ -13,8 +14,10 @@ public class GoblinGoodsImportDto {
private
String
spuName
;
@ExcelProperty
(
value
=
"商品图片"
)
private
String
spuImgs
;
private
List
<
String
>
spuImgList
;
@ExcelProperty
(
value
=
"商品规格"
)
private
String
skuSpec
;
private
List
<
GoblinGoodsSpecDto
>
skuSpecDtos
;
@ExcelProperty
(
value
=
"规格编码"
)
private
String
skuCode
;
@ExcelProperty
(
value
=
"价格"
)
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStoreMgtGoodsImportController.java
View file @
21ebe7a4
...
...
@@ -34,9 +34,9 @@ public class GoblinStoreMgtGoodsImportController {
@PostMapping
(
"/upload"
)
@ApiOperation
(
value
=
"批量导入数据"
,
notes
=
""
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"File"
,
name
=
"file"
,
value
=
"文件"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"Integer"
,
name
=
"dataType"
,
value
=
"导入数据类型[1-商品数据]"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"String"
,
name
=
"storeId"
,
value
=
"店铺ID"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"File"
,
name
=
"file"
,
value
=
"文件"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"Integer"
,
name
=
"dataType"
,
value
=
"导入数据类型[1-商品数据]"
,
example
=
"1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"storeId"
,
value
=
"店铺ID"
),
})
public
ResponseDto
<
String
>
upload
(
@RequestParam
MultipartFile
file
,
@RequestParam
int
dataType
,
@RequestParam
@NotBlank
(
message
=
"店铺ID不能为空"
)
String
storeId
)
{
...
...
@@ -51,12 +51,12 @@ public class GoblinStoreMgtGoodsImportController {
break
;
case
2
:
default
:
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"
3
9001"
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"
14
9001"
));
}
}
catch
(
LiquidnetServiceException
e
)
{
return
ResponseDto
.
failure
(
e
.
getMessage
());
}
catch
(
IOException
e
)
{
log
.
error
(
"店铺商品管理:批量导入数据:异常[UID={},dataType={},fileName={}]"
,
currentUid
,
dataType
,
file
.
getOriginalFilename
(),
e
);
log
.
warn
(
"店铺商品管理:批量导入数据:异常[UID={},dataType={},fileName={}]"
,
currentUid
,
dataType
,
file
.
getOriginalFilename
(),
e
);
return
ResponseDto
.
failure
(
"数据错误,解析失败"
);
}
return
ResponseDto
.
success
();
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreMgtGoodsImportService.java
View file @
21ebe7a4
This diff is collapsed.
Click to expand it.
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