Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
c88c4dd8
Commit
c88c4dd8
authored
Nov 09, 2021
by
ping.wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
根据商品配置,保存货号到三方商品编号字段
parent
db83b850
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
15 deletions
+40
-15
order-application-service/src/main/java/cn/freemud/service/impl/ItemServiceImpl.java
+40
-14
order-application-service/src/main/java/cn/freemud/service/impl/OrderServiceImpl.java
+0
-1
No files found.
order-application-service/src/main/java/cn/freemud/service/impl/ItemServiceImpl.java
View file @
c88c4dd8
...
@@ -60,12 +60,18 @@ public class ItemServiceImpl implements ItemService{
...
@@ -60,12 +60,18 @@ public class ItemServiceImpl implements ItemService{
AppLogUtil
.
infoLog
(
"storeItemClient_listProductInfos"
,
gson
.
toJson
(
getProductInfoDto
),
gson
.
toJson
(
productInfosDto
));
AppLogUtil
.
infoLog
(
"storeItemClient_listProductInfos"
,
gson
.
toJson
(
getProductInfoDto
),
gson
.
toJson
(
productInfosDto
));
if
(
ResponseCodeConstant
.
RESPONSE_SUCCESS
.
equals
(
productInfosDto
.
getErrcode
())
&&
productInfosDto
.
getData
()
!=
null
if
(
ResponseCodeConstant
.
RESPONSE_SUCCESS
.
equals
(
productInfosDto
.
getErrcode
())
&&
productInfosDto
.
getData
()
!=
null
&&
CollectionUtils
.
isNotEmpty
(
productInfosDto
.
getData
().
getProducts
()))
{
&&
CollectionUtils
.
isNotEmpty
(
productInfosDto
.
getData
().
getProducts
()))
{
boolean
b
=
productInfosDto
.
getData
().
getToPosProductIdType
()
!=
null
&&
productInfosDto
.
getData
().
getToPosProductIdType
()
==
1
?
true
:
false
;
//1传货号给当三方商品编号给pos
boolean
toPosCustomerCode
=
productInfosDto
.
getData
().
getToPosProductIdType
()
!=
null
&&
productInfosDto
.
getData
().
getToPosProductIdType
()
==
1
;
productInfosDto
.
getData
().
getProducts
().
forEach
(
productBean
->
{
productInfosDto
.
getData
().
getProducts
().
forEach
(
productBean
->
{
GetProductsVo
spuProductsVo
=
new
GetProductsVo
();
GetProductsVo
spuProductsVo
=
new
GetProductsVo
();
//保存货号到三方商品编号字段
spuProductsVo
.
setCustomerCode
(
productBean
.
getCustomerCode
());
if
(
toPosCustomerCode
){
spuProductsVo
.
setProductCode
(
productBean
.
getProductCode
());
spuProductsVo
.
setCustomerCode
(
productBean
.
getProductCode
());
spuProductsVo
.
setProductCode
(
productBean
.
getCustomerCode
());
}
else
{
spuProductsVo
.
setCustomerCode
(
productBean
.
getCustomerCode
());
spuProductsVo
.
setProductCode
(
productBean
.
getProductCode
());
}
List
<
AttributeValue
>
attributeValues
=
new
ArrayList
<>();
List
<
AttributeValue
>
attributeValues
=
new
ArrayList
<>();
//第三方商品属性信息
//第三方商品属性信息
if
(
CollectionUtils
.
isNotEmpty
(
productBean
.
getProductAttributeGroupList
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
productBean
.
getProductAttributeGroupList
()))
{
...
@@ -86,9 +92,9 @@ public class ItemServiceImpl implements ItemService{
...
@@ -86,9 +92,9 @@ public class ItemServiceImpl implements ItemService{
resultMap
.
put
(
productBean
.
getPid
(),
spuProductsVo
);
resultMap
.
put
(
productBean
.
getPid
(),
spuProductsVo
);
//多规格商品
//多规格商品
saveSkuProductsThirdInfo
(
productBean
,
productBean
.
getProductAttributeGroupList
(),
resultMap
);
saveSkuProductsThirdInfo
(
productBean
,
productBean
.
getProductAttributeGroupList
(),
resultMap
,
toPosCustomerCode
);
//套餐商品内子商品
//套餐商品内子商品
saveComboProductsThirdInfo
(
productBean
,
resultMap
);
saveComboProductsThirdInfo
(
productBean
,
resultMap
,
toPosCustomerCode
);
});
});
}
}
return
resultMap
;
return
resultMap
;
...
@@ -98,12 +104,19 @@ public class ItemServiceImpl implements ItemService{
...
@@ -98,12 +104,19 @@ public class ItemServiceImpl implements ItemService{
/**
/**
* 多规格商品保存第三方信息
* 多规格商品保存第三方信息
*/
*/
private
void
saveSkuProductsThirdInfo
(
ProductInfo
productBean
,
List
<
ProductAttributeGroup
>
productAttributeGroupList
,
Map
<
String
,
GetProductsVo
>
resultMap
){
private
void
saveSkuProductsThirdInfo
(
ProductInfo
productBean
,
List
<
ProductAttributeGroup
>
productAttributeGroupList
,
Map
<
String
,
GetProductsVo
>
resultMap
,
boolean
toPosCustomerCode
){
if
(
CollectionUtils
.
isNotEmpty
(
productBean
.
getSkuList
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
productBean
.
getSkuList
()))
{
for
(
SkuProduct
skuProductBean
:
productBean
.
getSkuList
())
{
for
(
SkuProduct
skuProductBean
:
productBean
.
getSkuList
())
{
GetProductsVo
skuProductsVo
=
new
GetProductsVo
();
GetProductsVo
skuProductsVo
=
new
GetProductsVo
();
skuProductsVo
.
setCustomerCode
(
skuProductBean
.
getCustomerCode
());
//保存货号到三方商品编号字段
skuProductsVo
.
setProductCode
(
skuProductBean
.
getProductCode
());
if
(
toPosCustomerCode
){
skuProductsVo
.
setCustomerCode
(
productBean
.
getProductCode
());
skuProductsVo
.
setProductCode
(
productBean
.
getCustomerCode
());
}
else
{
skuProductsVo
.
setCustomerCode
(
productBean
.
getCustomerCode
());
skuProductsVo
.
setProductCode
(
productBean
.
getProductCode
());
}
//第三方商品规格值id
//第三方商品规格值id
if
(
CollectionUtils
.
isNotEmpty
(
skuProductBean
.
getSkuSpecValues
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
skuProductBean
.
getSkuSpecValues
()))
{
List
<
String
>
list
=
new
ArrayList
<>();
List
<
String
>
list
=
new
ArrayList
<>();
...
@@ -127,15 +140,21 @@ public class ItemServiceImpl implements ItemService{
...
@@ -127,15 +140,21 @@ public class ItemServiceImpl implements ItemService{
/**
/**
* 套餐商品保存第三方信息
* 套餐商品保存第三方信息
*/
*/
private
void
saveComboProductsThirdInfo
(
ProductInfo
productBean
,
Map
<
String
,
GetProductsVo
>
resultMap
){
private
void
saveComboProductsThirdInfo
(
ProductInfo
productBean
,
Map
<
String
,
GetProductsVo
>
resultMap
,
boolean
toPosCustomerCode
){
GetProductsVo
spuProductsVo
=
resultMap
.
get
(
productBean
.
getPid
());
GetProductsVo
spuProductsVo
=
resultMap
.
get
(
productBean
.
getPid
());
List
<
Integer
>
stapleFood
=
Arrays
.
asList
(
0
,
1
);
List
<
Integer
>
stapleFood
=
Arrays
.
asList
(
0
,
1
);
//套餐固定商品
//套餐固定商品
if
(
CollectionUtils
.
isNotEmpty
(
productBean
.
getProductComboList
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
productBean
.
getProductComboList
()))
{
for
(
ProductComboListDto
productComboListDto
:
productBean
.
getProductComboList
())
{
for
(
ProductComboListDto
productComboListDto
:
productBean
.
getProductComboList
())
{
GetProductsVo
comboProductsVo
=
new
GetProductsVo
();
GetProductsVo
comboProductsVo
=
new
GetProductsVo
();
comboProductsVo
.
setCustomerCode
(
productComboListDto
.
getCustomerCode
());
//保存货号到三方商品编号字段
comboProductsVo
.
setProductCode
(
productComboListDto
.
getProductCode
());
if
(
toPosCustomerCode
){
comboProductsVo
.
setCustomerCode
(
productBean
.
getProductCode
());
comboProductsVo
.
setProductCode
(
productBean
.
getCustomerCode
());
}
else
{
comboProductsVo
.
setCustomerCode
(
productBean
.
getCustomerCode
());
comboProductsVo
.
setProductCode
(
productBean
.
getProductCode
());
}
if
(
productComboListDto
.
getIsStaple
()!=
null
&&
stapleFood
.
contains
(
productComboListDto
.
getIsStaple
()))
{
if
(
productComboListDto
.
getIsStaple
()!=
null
&&
stapleFood
.
contains
(
productComboListDto
.
getIsStaple
()))
{
comboProductsVo
.
setStapleFood
(
productComboListDto
.
getIsStaple
());
comboProductsVo
.
setStapleFood
(
productComboListDto
.
getIsStaple
());
}
else
{
}
else
{
...
@@ -173,8 +192,15 @@ public class ItemServiceImpl implements ItemService{
...
@@ -173,8 +192,15 @@ public class ItemServiceImpl implements ItemService{
for
(
GroupDetail
groupDetailBean
:
group
.
getGroupDetail
()){
for
(
GroupDetail
groupDetailBean
:
group
.
getGroupDetail
()){
//多规格获取sku信息
//多规格获取sku信息
GetProductsVo
groupProductsVo
=
new
GetProductsVo
();
GetProductsVo
groupProductsVo
=
new
GetProductsVo
();
groupProductsVo
.
setCustomerCode
(
groupDetailBean
.
getCustomerCode
());
groupProductsVo
.
setProductCode
(
groupDetailBean
.
getProductCode
());
//保存货号到三方商品编号字段
if
(
toPosCustomerCode
){
groupProductsVo
.
setCustomerCode
(
productBean
.
getProductCode
());
groupProductsVo
.
setProductCode
(
productBean
.
getCustomerCode
());
}
else
{
groupProductsVo
.
setCustomerCode
(
productBean
.
getCustomerCode
());
groupProductsVo
.
setProductCode
(
productBean
.
getProductCode
());
}
//第三方商品属性信息
//第三方商品属性信息
groupProductsVo
.
setProductAttributeGroupList
(
groupDetailBean
.
getProductAttributeGroupList
());
groupProductsVo
.
setProductAttributeGroupList
(
groupDetailBean
.
getProductAttributeGroupList
());
...
...
order-application-service/src/main/java/cn/freemud/service/impl/OrderServiceImpl.java
View file @
c88c4dd8
...
@@ -2433,7 +2433,6 @@ public class OrderServiceImpl implements Orderservice {
...
@@ -2433,7 +2433,6 @@ public class OrderServiceImpl implements Orderservice {
if
(
CollectionUtils
.
isNotEmpty
(
productDto
.
getComboProduct
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
productDto
.
getComboProduct
()))
{
for
(
CreateOrderProductRequest
comboProduct
:
productDto
.
getComboProduct
())
{
for
(
CreateOrderProductRequest
comboProduct
:
productDto
.
getComboProduct
())
{
String
comboSkuId
=
comboProduct
.
getSpecification
();
String
comboSkuId
=
comboProduct
.
getSpecification
();
System
.
out
.
println
(
comboSkuId
);
if
(
products
.
get
(
comboSkuId
)
!=
null
)
{
if
(
products
.
get
(
comboSkuId
)
!=
null
)
{
comboProduct
.
setCustomerCode
(
products
.
get
(
comboSkuId
).
getCustomerCode
());
comboProduct
.
setCustomerCode
(
products
.
get
(
comboSkuId
).
getCustomerCode
());
comboProduct
.
setProductCode
(
products
.
get
(
comboSkuId
).
getProductCode
());
comboProduct
.
setProductCode
(
products
.
get
(
comboSkuId
).
getProductCode
());
...
...
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