记得上下班打卡 | 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
72892b21
Commit
72892b21
authored
Nov 10, 2022
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~api:店铺商品管理:批量导入数据;
parent
3fc7d2f6
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
115 additions
and
82 deletions
+115
-82
GoblinGoodsImportDto.java
...om/liquidnet/service/goblin/dto/GoblinGoodsImportDto.java
+16
-11
GoblinStoreMgtGoodsImportController.java
...ontroller/manage/GoblinStoreMgtGoodsImportController.java
+4
-3
GoblinStoreMgtGoodsImportService.java
...service/impl/manage/GoblinStoreMgtGoodsImportService.java
+95
-68
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/GoblinGoodsImportDto.java
View file @
72892b21
...
@@ -8,26 +8,31 @@ import java.util.List;
...
@@ -8,26 +8,31 @@ import java.util.List;
@Data
@Data
public
class
GoblinGoodsImportDto
{
public
class
GoblinGoodsImportDto
{
@ExcelProperty
(
value
=
"商品编码"
)
@ExcelProperty
(
value
=
"商品编码"
,
index
=
0
)
private
String
spuCode
;
private
String
spuCode
;
@ExcelProperty
(
value
=
"商品名称"
)
@ExcelProperty
(
value
=
"商品名称"
,
index
=
1
)
private
String
spuName
;
private
String
spuName
;
@ExcelProperty
(
value
=
"商品图片"
)
@ExcelProperty
(
value
=
"商品图片"
,
index
=
2
)
private
String
spuImgs
;
private
String
spuImgs
;
private
List
<
String
>
spuImgList
;
private
List
<
String
>
spuImgList
;
//
@ExcelProperty
(
value
=
"商品规格"
)
@ExcelProperty
(
value
=
"商品规格"
,
index
=
3
)
private
String
skuSpec
;
private
String
skuSpec
;
private
List
<
GoblinGoodsSpecDto
>
skuSpecDtos
;
private
List
<
GoblinGoodsSpecDto
>
skuSpecDtos
;
//
@ExcelProperty
(
value
=
"规格编码"
)
@ExcelProperty
(
value
=
"规格编码"
,
index
=
4
)
private
String
skuCode
;
private
String
skuCode
;
@ExcelProperty
(
value
=
"价格"
)
@ExcelProperty
(
value
=
"价格"
,
index
=
5
)
private
BigDecimal
price
;
private
BigDecimal
price
;
@ExcelProperty
(
value
=
"库存"
)
@ExcelProperty
(
value
=
"库存"
,
index
=
6
)
private
Integer
stock
;
private
Integer
stock
;
@ExcelProperty
(
value
=
"规格图片"
)
@ExcelProperty
(
value
=
"规格图片"
,
index
=
7
)
private
String
skuImg
;
private
String
skuImg
;
@ExcelProperty
(
value
=
"规格条码"
)
@ExcelProperty
(
value
=
"规格条码"
,
index
=
8
)
private
String
skuBarCode
;
private
String
skuBarCode
;
// @ExcelProperty(value = "商品条码")
// @ExcelProperty(value = "商品条码")
// private String spuBarCode;
// private String spuBarCode;
private
String
failureReason
;
//
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStoreMgtGoodsImportController.java
View file @
72892b21
...
@@ -48,10 +48,11 @@ public class GoblinStoreMgtGoodsImportController {
...
@@ -48,10 +48,11 @@ public class GoblinStoreMgtGoodsImportController {
if
(!
goblinRedisUtils
.
redisUtil
.
lock
(
GoblinRedisConst
.
BASIC_GOODS_SKU
.
concat
(
"lk"
).
concat
(
storeId
),
1
,
30
))
{
if
(!
goblinRedisUtils
.
redisUtil
.
lock
(
GoblinRedisConst
.
BASIC_GOODS_SKU
.
concat
(
"lk"
).
concat
(
storeId
),
1
,
30
))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"140000"
));
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"140000"
));
}
}
String
analysisResultMsg
;
try
{
try
{
switch
(
dataType
)
{
switch
(
dataType
)
{
case
1
:
case
1
:
goblinStoreMgtGoodsImportService
.
goodsInformationDataAnalysisProcessing
(
file
,
currentUid
,
storeId
);
analysisResultMsg
=
goblinStoreMgtGoodsImportService
.
goodsInformationDataAnalysisProcessing
(
file
,
currentUid
,
storeId
);
break
;
break
;
case
2
:
case
2
:
default
:
default
:
...
@@ -61,8 +62,8 @@ public class GoblinStoreMgtGoodsImportController {
...
@@ -61,8 +62,8 @@ public class GoblinStoreMgtGoodsImportController {
return
ResponseDto
.
failure
(
e
.
getMessage
());
return
ResponseDto
.
failure
(
e
.
getMessage
());
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
warn
(
"店铺商品管理:批量导入数据:异常[UID={},dataType={},fileName={}]"
,
currentUid
,
dataType
,
file
.
getOriginalFilename
(),
e
);
log
.
warn
(
"店铺商品管理:批量导入数据:异常[UID={},dataType={},fileName={}]"
,
currentUid
,
dataType
,
file
.
getOriginalFilename
(),
e
);
return
ResponseDto
.
failure
(
"数据
错
误,解析失败"
);
return
ResponseDto
.
failure
(
"数据
有
误,解析失败"
);
}
}
return
ResponseDto
.
success
();
return
ResponseDto
.
success
(
analysisResultMsg
);
}
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreMgtGoodsImportService.java
View file @
72892b21
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