Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fileServe
Overview
Overview
Details
Activity
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
vanke
fileServe
Commits
9517d9ca
Commit
9517d9ca
authored
Jun 10, 2020
by
XiaHou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权星登录注册
parent
a9a2203b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
PmsProductServiceImpl.java
...acro/mall/service/product/impl/PmsProductServiceImpl.java
+10
-0
No files found.
mall-service/src/main/java/com/macro/mall/service/product/impl/PmsProductServiceImpl.java
View file @
9517d9ca
...
@@ -130,10 +130,12 @@ public class PmsProductServiceImpl implements PmsProductService {
...
@@ -130,10 +130,12 @@ public class PmsProductServiceImpl implements PmsProductService {
}
}
pmsProductRequestParam
.
getPmsProduct
().
setCreateDate
(
new
Date
());
pmsProductRequestParam
.
getPmsProduct
().
setCreateDate
(
new
Date
());
pmsProductRequestParam
.
getPmsProduct
().
setUpdateDate
(
new
Date
());
pmsProductRequestParam
.
getPmsProduct
().
setUpdateDate
(
new
Date
());
//先插入商品 获取商品Id
this
.
pmsProductMapper
.
insertSelective
(
pmsProductRequestParam
.
getPmsProduct
());
this
.
pmsProductMapper
.
insertSelective
(
pmsProductRequestParam
.
getPmsProduct
());
//商品规格值不为空 则执行插入操作
//商品规格值不为空 则执行插入操作
if
(
pmsProductRequestParam
.
getPmsProductSkuValueList
()
!=
null
&&
pmsProductRequestParam
.
getPmsProductSkuValueList
().
size
()
>
0
){
if
(
pmsProductRequestParam
.
getPmsProductSkuValueList
()
!=
null
&&
pmsProductRequestParam
.
getPmsProductSkuValueList
().
size
()
>
0
){
pmsProductRequestParam
.
getPmsProductSkuValueList
().
forEach
(
pmsProductSkuValue
->{
pmsProductRequestParam
.
getPmsProductSkuValueList
().
forEach
(
pmsProductSkuValue
->{
pmsProductSkuValue
.
setProductId
(
pmsProductRequestParam
.
getPmsProduct
().
getId
());
pmsProductSkuValue
.
setCreateDate
(
new
Date
());
pmsProductSkuValue
.
setCreateDate
(
new
Date
());
pmsProductSkuValue
.
setUpdateDate
(
new
Date
());
pmsProductSkuValue
.
setUpdateDate
(
new
Date
());
this
.
pmsProductSkuValueMapper
.
insertSelective
(
pmsProductSkuValue
);
this
.
pmsProductSkuValueMapper
.
insertSelective
(
pmsProductSkuValue
);
...
@@ -142,6 +144,14 @@ public class PmsProductServiceImpl implements PmsProductService {
...
@@ -142,6 +144,14 @@ public class PmsProductServiceImpl implements PmsProductService {
//sku值不为空 则执行插入
//sku值不为空 则执行插入
if
(
pmsProductRequestParam
.
getPmsSkuStockList
()
!=
null
&&
pmsProductRequestParam
.
getPmsSkuStockList
().
size
()
>
0
){
if
(
pmsProductRequestParam
.
getPmsSkuStockList
()
!=
null
&&
pmsProductRequestParam
.
getPmsSkuStockList
().
size
()
>
0
){
pmsProductRequestParam
.
getPmsSkuStockList
().
forEach
(
pmsSkuStock
->{
pmsProductRequestParam
.
getPmsSkuStockList
().
forEach
(
pmsSkuStock
->{
//skuCode 生成规格 productId + 规格值id
String
skuCode
=
pmsProductRequestParam
.
getPmsProduct
().
getId
()
+
""
;
String
[]
categoryIds
=
pmsSkuStock
.
getItemIds
().
split
(
","
);
for
(
int
i
=
0
;
i
<
categoryIds
.
length
;
i
++)
{
skuCode
=
skuCode
+
"_"
+
categoryIds
[
i
];
}
pmsSkuStock
.
setSkuCode
(
skuCode
);
pmsSkuStock
.
setProductId
(
pmsProductRequestParam
.
getPmsProduct
().
getId
());
pmsSkuStock
.
setCreateDate
(
new
Date
());
pmsSkuStock
.
setCreateDate
(
new
Date
());
pmsSkuStock
.
setUpdateDate
(
new
Date
());
pmsSkuStock
.
setUpdateDate
(
new
Date
());
this
.
pmsSkuStockMapper
.
insertSelective
(
pmsSkuStock
);
this
.
pmsSkuStockMapper
.
insertSelective
(
pmsSkuStock
);
...
...
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