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
42a40f5d
Commit
42a40f5d
authored
May 28, 2021
by
徐康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询最近一单数据
parent
3030cee3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
45 deletions
+78
-45
order-application-service/src/main/java/cn/freemud/entities/vo/mccafe/RecentGoodsInfoVo.java
+14
-44
order-application-service/src/main/java/cn/freemud/service/impl/MCCafeOrderServiceImpl.java
+64
-1
No files found.
order-application-service/src/main/java/cn/freemud/entities/vo/mccafe/RecentGoodsInfoVo.java
View file @
42a40f5d
...
@@ -32,32 +32,22 @@ public class RecentGoodsInfoVo {
...
@@ -32,32 +32,22 @@ public class RecentGoodsInfoVo {
private
Integer
qty
;
private
Integer
qty
;
/**
/**
*
操作类型 1= 添加商品券 2=加价购
*
商品的spuName
*/
*/
private
Integer
operationType
;
private
String
spuName
;
/**
* 套餐名称
*/
private
String
groupName
;
/**
/**
*
1.6.0 版本增加 分类名
*
商品的skuName
*/
*/
private
String
categoryName
;
private
String
skuName
;
/**
* 商品额外的属性
*/
private
List
<
CartGoodsExtra
>
extra
;
/**
/**
* 套餐固定商品
* 套餐固定商品
*/
*/
private
List
<
Combo
x
GoodsVo
>
productComboList
;
private
List
<
ComboGoodsVo
>
productComboList
;
/**
/**
* 套餐可选商品
* 套餐可选商品
*/
*/
private
List
<
Combo
x
GoodsVo
>
productGroupList
;
private
List
<
ComboGoodsVo
>
productGroupList
;
/**
/**
* 加料
* 加料
...
@@ -70,7 +60,7 @@ public class RecentGoodsInfoVo {
...
@@ -70,7 +60,7 @@ public class RecentGoodsInfoVo {
private
List
<
SpecialExtra
>
specialExtra
;
private
List
<
SpecialExtra
>
specialExtra
;
@Data
@Data
public
final
static
class
Combo
x
GoodsVo
{
public
final
static
class
ComboGoodsVo
{
/**
/**
* 麦咖啡多规格商品spuid
* 麦咖啡多规格商品spuid
...
@@ -78,20 +68,17 @@ public class RecentGoodsInfoVo {
...
@@ -78,20 +68,17 @@ public class RecentGoodsInfoVo {
private
String
spuId
;
private
String
spuId
;
private
String
skuId
;
private
String
skuId
;
private
Integer
qty
;
/**
* 商品组Id
*/
private
String
productGroupId
;
/**
/**
*
麦咖啡空键位
*
商品的spuName
*/
*/
private
String
emptyKey
;
private
String
spuName
;
/**
/**
* 商品
额外的属性
* 商品
的skuName
*/
*/
List
<
CartGoods
.
CartGoodsExtra
>
extra
;
private
String
skuName
;
private
Integer
qty
;
private
List
<
SpecialExtra
>
specialExtra
;
private
List
<
SpecialExtra
>
specialExtra
;
...
@@ -108,10 +95,7 @@ public class RecentGoodsInfoVo {
...
@@ -108,10 +95,7 @@ public class RecentGoodsInfoVo {
* 加料商品ID
* 加料商品ID
*/
*/
private
String
spuId
;
private
String
spuId
;
/**
private
String
spuName
;
* 加料商品组ID
*/
private
String
groupId
;
/**
/**
* 数量
* 数量
...
@@ -143,18 +127,4 @@ public class RecentGoodsInfoVo {
...
@@ -143,18 +127,4 @@ public class RecentGoodsInfoVo {
*/
*/
private
String
specialCode
;
private
String
specialCode
;
}
}
@Data
public
final
static
class
CartGoodsExtra
{
/**
* 属性Id
*/
private
String
attributeId
;
/**
* 属性名
*/
private
String
attributeName
;
private
String
attributeForeignName
;
}
}
}
order-application-service/src/main/java/cn/freemud/service/impl/MCCafeOrderServiceImpl.java
View file @
42a40f5d
...
@@ -41,6 +41,7 @@ import cn.freemud.entities.dto.user.SendCouponForqujiaDtoResponseDto;
...
@@ -41,6 +41,7 @@ import cn.freemud.entities.dto.user.SendCouponForqujiaDtoResponseDto;
import
cn.freemud.entities.dto.user.SendCouponForqujiaRequestDto
;
import
cn.freemud.entities.dto.user.SendCouponForqujiaRequestDto
;
import
cn.freemud.entities.vo.*
;
import
cn.freemud.entities.vo.*
;
import
cn.freemud.entities.vo.CreateDeliveryVo
;
import
cn.freemud.entities.vo.CreateDeliveryVo
;
import
cn.freemud.entities.vo.mccafe.RecentGoodsInfoVo
;
import
cn.freemud.enums.*
;
import
cn.freemud.enums.*
;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.management.entities.dto.request.order.MCCafeCouponRequest
;
import
cn.freemud.management.entities.dto.request.order.MCCafeCouponRequest
;
...
@@ -2396,7 +2397,69 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
...
@@ -2396,7 +2397,69 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
if
(
queryOrderResponse
.
getData
()
==
null
||
queryOrderResponse
.
getData
().
getCount
()
==
0
)
{
if
(
queryOrderResponse
.
getData
()
==
null
||
queryOrderResponse
.
getData
().
getCount
()
==
0
)
{
return
ResponseUtil
.
error
(
ResponseResult
.
ORDER_QUERYORDER_ERROR
);
return
ResponseUtil
.
error
(
ResponseResult
.
ORDER_QUERYORDER_ERROR
);
}
}
return
ResponseUtil
.
success
(
queryOrderResponse
.
getData
().
getOrders
().
get
(
0
).
getOid
());
List
<
RecentGoodsInfoVo
>
recentGoodsInfoVoList
=
new
ArrayList
<>();
queryOrderResponse
.
getData
().
getOrders
().
get
(
0
).
getProductList
().
forEach
(
o
->
{
RecentGoodsInfoVo
recentGoodsInfoVo
=
new
RecentGoodsInfoVo
();
recentGoodsInfoVo
.
setSpuId
(
o
.
getProductId
());
recentGoodsInfoVo
.
setSpuName
(
o
.
getProductName
());
recentGoodsInfoVo
.
setSkuId
(
o
.
getSpecification
());
recentGoodsInfoVo
.
setSkuName
(
o
.
getSpecificationName
());
recentGoodsInfoVo
.
setQty
(
o
.
getNumber
());
if
(
StringUtils
.
isNotBlank
(
o
.
getExtInfo
()))
{
OrderProductAddInfoDto
orderProductAddInfoDto
=
JSON
.
parseObject
(
o
.
getExtInfo
(),
OrderProductAddInfoDto
.
class
);
if
(
null
!=
orderProductAddInfoDto
)
{
recentGoodsInfoVo
.
setSpecialExtra
(
JSON
.
parseArray
(
JSON
.
toJSONString
(
orderProductAddInfoDto
.
getSpecialAttrs
()),
RecentGoodsInfoVo
.
SpecialExtra
.
class
));
}
}
if
(
CollectionUtils
.
isNotEmpty
(
o
.
getComboProduct
()))
{
recentGoodsInfoVo
.
setProductComboList
(
new
ArrayList
<
RecentGoodsInfoVo
.
ComboGoodsVo
>());
recentGoodsInfoVo
.
setProductGroupList
(
new
ArrayList
<
RecentGoodsInfoVo
.
ComboGoodsVo
>());
o
.
getComboProduct
().
forEach
(
p
->
{
RecentGoodsInfoVo
.
ComboGoodsVo
comboGoodsVo
=
new
RecentGoodsInfoVo
.
ComboGoodsVo
();
comboGoodsVo
.
setSpuId
(
p
.
getProductId
());
comboGoodsVo
.
setSpuName
(
p
.
getProductName
());
comboGoodsVo
.
setSkuId
(
p
.
getSpecification
());
comboGoodsVo
.
setSkuName
(
p
.
getSpecificationName
());
comboGoodsVo
.
setQty
(
p
.
getNumber
());
OrderProductAddInfoDto
orderProductAddInfoDto
=
JSON
.
parseObject
(
p
.
getExtInfo
(),
OrderProductAddInfoDto
.
class
);
if
(
null
!=
orderProductAddInfoDto
)
{
comboGoodsVo
.
setSpecialExtra
(
JSON
.
parseArray
(
JSON
.
toJSONString
(
orderProductAddInfoDto
.
getSpecialAttrs
()),
RecentGoodsInfoVo
.
SpecialExtra
.
class
));
}
if
(
CollectionUtils
.
isNotEmpty
(
p
.
getMaterialProduct
()))
{
comboGoodsVo
.
setProductMaterialList
(
new
ArrayList
<
RecentGoodsInfoVo
.
MaterialGoodsVo
>());
p
.
getMaterialProduct
().
forEach
(
q
->
{
RecentGoodsInfoVo
.
MaterialGoodsVo
materialGoodsVo
=
new
RecentGoodsInfoVo
.
MaterialGoodsVo
();
materialGoodsVo
.
setSpuId
(
q
.
getProductId
());
materialGoodsVo
.
setSpuName
(
q
.
getProductName
());
materialGoodsVo
.
setQty
(
q
.
getNumber
());
materialGoodsVo
.
setCustomerCode
(
q
.
getProductCode
());
comboGoodsVo
.
getProductMaterialList
().
add
(
materialGoodsVo
);
});
}
if
(
orderProductAddInfoDto
.
getIsFixedProduct
())
{
recentGoodsInfoVo
.
getProductComboList
().
add
(
comboGoodsVo
);
}
else
{
recentGoodsInfoVo
.
getProductGroupList
().
add
(
comboGoodsVo
);
}
});
}
if
(
CollectionUtils
.
isNotEmpty
(
o
.
getMaterialProduct
()))
{
recentGoodsInfoVo
.
setProductMaterialList
(
new
ArrayList
<
RecentGoodsInfoVo
.
MaterialGoodsVo
>());
o
.
getMaterialProduct
().
forEach
(
p
->
{
RecentGoodsInfoVo
.
MaterialGoodsVo
materialGoodsVo
=
new
RecentGoodsInfoVo
.
MaterialGoodsVo
();
materialGoodsVo
.
setSpuId
(
p
.
getProductId
());
materialGoodsVo
.
setSpuName
(
p
.
getProductName
());
materialGoodsVo
.
setQty
(
p
.
getNumber
());
materialGoodsVo
.
setCustomerCode
(
p
.
getProductCode
());
recentGoodsInfoVo
.
getProductMaterialList
().
add
(
materialGoodsVo
);
});
}
recentGoodsInfoVoList
.
add
(
recentGoodsInfoVo
);
});
return
ResponseUtil
.
success
(
recentGoodsInfoVoList
);
}
}
...
...
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