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
883765f5
Commit
883765f5
authored
Dec 10, 2020
by
yu.sun
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.freemud.com:order-group-application/order-group
parents
01287fbb
0e309673
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
71 additions
and
37 deletions
+71
-37
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/service/impl/CollageOrderBaseServiceImpl.java
+12
-11
order-application-service/src/main/java/cn/freemud/adapter/DeliveryAdapter.java
+24
-9
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
+5
-2
order-application-service/src/main/java/cn/freemud/entities/vo/ProductInfo.java
+5
-0
order-application-service/src/main/java/cn/freemud/service/impl/MCCafeOrderServiceImpl.java
+7
-3
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
+6
-2
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/CollageOrderRequestVo.java
+0
-3
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CollageOrderServiceImpl.java
+8
-7
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartCollageServiceImpl.java
+4
-0
No files found.
assortment-shoppingcart-sdk/src/main/java/com/freemud/sdk/api/assortment/shoppingcart/service/impl/CollageOrderBaseServiceImpl.java
View file @
883765f5
...
@@ -11,6 +11,7 @@ import com.freemud.sdk.api.assortment.shoppingcart.domain.CollagePartnerMember;
...
@@ -11,6 +11,7 @@ import com.freemud.sdk.api.assortment.shoppingcart.domain.CollagePartnerMember;
import
com.freemud.sdk.api.assortment.shoppingcart.service.CollageOrderBaseService
;
import
com.freemud.sdk.api.assortment.shoppingcart.service.CollageOrderBaseService
;
import
com.freemud.sdk.api.assortment.shoppingcart.util.CartResponseUtil
;
import
com.freemud.sdk.api.assortment.shoppingcart.util.CartResponseUtil
;
import
com.freemud.sdk.api.assortment.shoppingcart.util.DateTimeUtils
;
import
com.freemud.sdk.api.assortment.shoppingcart.util.DateTimeUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
...
@@ -58,15 +59,18 @@ public class CollageOrderBaseServiceImpl implements CollageOrderBaseService {
...
@@ -58,15 +59,18 @@ public class CollageOrderBaseServiceImpl implements CollageOrderBaseService {
*/
*/
@Override
@Override
public
BaseResponse
<
CollageOrder
>
queryCollageOrder
(
CollageOrderDto
collageOrderDto
)
{
public
BaseResponse
<
CollageOrder
>
queryCollageOrder
(
CollageOrderDto
collageOrderDto
)
{
CollageOrder
collageOrder
=
null
;
try
{
try
{
// 仅支持两种查询场景
// 1、createCollageUserId存在,则只根据当前三要素查询,若无直接返回不存在
if
(
StringUtils
.
isNotBlank
(
collageOrderDto
.
getCreateCollageUserId
()))
{
// 通过商户ID、门店ID、用户ID组装拼单订单Redis缓存基本信息Key
// 通过商户ID、门店ID、用户ID组装拼单订单Redis缓存基本信息Key
String
collageBaseHashKey
=
this
.
genCollageBaseHashKey
(
collageOrderDto
.
getPartnerId
(),
collageOrderDto
.
getStoreId
(),
collageOrderDto
.
getCreateCollageUserId
());
String
collageBaseHashKey
=
this
.
genCollageBaseHashKey
(
collageOrderDto
.
getPartnerId
(),
collageOrderDto
.
getStoreId
(),
collageOrderDto
.
getCreateCollageUserId
());
// 查询Redis缓存中拼单订单基础信息
// 查询Redis缓存中拼单订单基础信息
CollageOrder
collageOrder
=
this
.
getCollageBaseHash
(
collageBaseHashKey
);
collageOrder
=
this
.
getCollageBaseHash
(
collageBaseHashKey
);
}
//
若按发起人维度查询不到,则按参与人维度查询
//
2、createCollageUserId不存在,则只从当前商户拼单参与人信息列表中查询并返回,若商户级别拼单不存在,则提示拼单不存在
if
(
ObjectUtils
.
isEmpty
(
collageOrder
))
{
else
{
String
collagePartnerMemberHashKey
=
this
.
genCollagePartnerMemberHashKey
(
collageOrderDto
.
getPartnerId
());
String
collagePartnerMemberHashKey
=
this
.
genCollagePartnerMemberHashKey
(
collageOrderDto
.
getPartnerId
());
CollagePartnerMember
collagePartnerMember
=
this
.
getCollagePartnerMember
(
collagePartnerMemberHashKey
,
collageOrderDto
.
getCurrentUserId
());
CollagePartnerMember
collagePartnerMember
=
this
.
getCollagePartnerMember
(
collagePartnerMemberHashKey
,
collageOrderDto
.
getCurrentUserId
());
...
@@ -79,16 +83,13 @@ public class CollageOrderBaseServiceImpl implements CollageOrderBaseService {
...
@@ -79,16 +83,13 @@ public class CollageOrderBaseServiceImpl implements CollageOrderBaseService {
return
CartResponseUtil
.
error
(
CollageOrderConstant
.
COLLAGE_ORDER_NOT_EXIST
);
return
CartResponseUtil
.
error
(
CollageOrderConstant
.
COLLAGE_ORDER_NOT_EXIST
);
}
else
{
}
else
{
// 从商户拼单参与人列表中获取信息再次查询拼单信息
// 从商户拼单参与人列表中获取信息再次查询拼单信息
collageBaseHashKey
=
this
.
genCollageBaseHashKey
(
collagePartnerMember
.
getPartnerId
(),
collagePartnerMember
.
getStoreId
(),
collagePartnerMember
.
getCreateCollageUserId
());
String
collageBaseHashKey
=
this
.
genCollageBaseHashKey
(
collagePartnerMember
.
getPartnerId
(),
collagePartnerMember
.
getStoreId
(),
collagePartnerMember
.
getCreateCollageUserId
());
collageOrder
=
this
.
getCollageBaseHash
(
collageBaseHashKey
);
collageOrder
=
this
.
getCollageBaseHash
(
collageBaseHashKey
);
// 若拼单订单信息依然不存在,则返回错误提示【拼单订单信息不存在】,由前端根据场景处理(静默、提示拼单已取消)
if
(
ObjectUtils
.
isEmpty
(
collageOrder
))
{
return
CartResponseUtil
.
error
(
CollageOrderConstant
.
COLLAGE_ORDER_NOT_EXIST
);
}
}
}
}
if
(
ObjectUtils
.
isEmpty
(
collageOrder
))
{
return
CartResponseUtil
.
error
(
CollageOrderConstant
.
COLLAGE_ORDER_NOT_EXIST
);
}
}
// 若拼单订单信息存在,则构造订单拼单对象并返回成功提示
// 若拼单订单信息存在,则构造订单拼单对象并返回成功提示
return
CartResponseUtil
.
success
(
collageOrder
);
return
CartResponseUtil
.
success
(
collageOrder
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
order-application-service/src/main/java/cn/freemud/adapter/DeliveryAdapter.java
View file @
883765f5
...
@@ -7,18 +7,14 @@ import cn.freemud.entities.vo.CreateDeliveryVo;
...
@@ -7,18 +7,14 @@ import cn.freemud.entities.vo.CreateDeliveryVo;
import
cn.freemud.entities.vo.ProductInfo
;
import
cn.freemud.entities.vo.ProductInfo
;
import
cn.freemud.enums.DeliveryChannelEnum
;
import
cn.freemud.enums.DeliveryChannelEnum
;
import
cn.freemud.enums.OrderSourceType
;
import
cn.freemud.enums.OrderSourceType
;
import
cn.freemud.enums.OrderType
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.freemud.application.sdk.api.deliverycenter.dto.CreateDeliveryOrderRequestDto
;
import
com.freemud.application.sdk.api.deliverycenter.dto.CreateDeliveryOrderRequestDto
;
import
com.freemud.application.sdk.api.ordercenter.request.OrderExtInfoDto
;
import
com.freemud.application.sdk.api.ordercenter.request.OrderExtInfoDto
;
import
com.freemud.application.sdk.api.storecenter.response.StoreResponse
;
import
com.freemud.application.sdk.api.storecenter.response.StoreResponse
;
import
com.freemud.sdk.api.assortment.order.enums.OldOrderAccountType
;
import
com.freemud.sdk.api.assortment.order.enums.OldOrderAccountType
;
import
com.freemud.sdk.api.assortment.order.enums.QueryOrderAccountType
;
import
com.freemud.sdk.api.assortment.order.request.order.CreateOrderProductRequest
;
import
com.freemud.sdk.api.assortment.order.request.order.OrderProductAddInfoDto
;
import
com.freemud.sdk.api.assortment.order.request.order.OrderProductAddInfoDto
;
import
com.freemud.sdk.api.assortment.order.request.order.OrderSpecialExtraAttrRequest
;
import
com.freemud.sdk.api.assortment.order.request.order.OrderSpecialExtraAttrRequest
;
import
com.freemud.sdk.api.assortment.order.response.order.QueryOrdersResponse
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -28,10 +24,9 @@ import java.text.SimpleDateFormat;
...
@@ -28,10 +24,9 @@ import java.text.SimpleDateFormat;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
@Component
@Component
public
class
DeliveryAdapter
{
public
class
DeliveryAdapter
{
...
@@ -187,6 +182,8 @@ public class DeliveryAdapter {
...
@@ -187,6 +182,8 @@ public class DeliveryAdapter {
ProductInfo
deliveryProductInfo
=
new
ProductInfo
();
ProductInfo
deliveryProductInfo
=
new
ProductInfo
();
deliveryProductInfo
.
setProductCode
(
productList
.
getProductId
().
substring
(
4
));
deliveryProductInfo
.
setProductCode
(
productList
.
getProductId
().
substring
(
4
));
String
productName
=
StringUtils
.
isBlank
(
productList
.
getSpecificationName
())
?
productList
.
getProductName
()
:
productList
.
getSpecificationName
();
String
productName
=
StringUtils
.
isBlank
(
productList
.
getSpecificationName
())
?
productList
.
getProductName
()
:
productList
.
getSpecificationName
();
String
grilling
=
""
;
OrderProductAddInfoDto
extInfo
=
JSON
.
parseObject
(
productList
.
getExtInfo
(),
OrderProductAddInfoDto
.
class
);
OrderProductAddInfoDto
extInfo
=
JSON
.
parseObject
(
productList
.
getExtInfo
(),
OrderProductAddInfoDto
.
class
);
if
(
CollectionUtils
.
isNotEmpty
(
extInfo
.
getSpecialAttrs
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
extInfo
.
getSpecialAttrs
()))
{
String
attr
=
""
;
String
attr
=
""
;
...
@@ -203,9 +200,13 @@ public class DeliveryAdapter {
...
@@ -203,9 +200,13 @@ public class DeliveryAdapter {
if
(
CollectionUtils
.
isNotEmpty
(
productList
.
getMaterialProduct
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
productList
.
getMaterialProduct
()))
{
for
(
QueryOrdersResponseDto
.
DataBean
.
OrderBean
.
ProductBean
material
:
productList
.
getMaterialProduct
())
{
for
(
QueryOrdersResponseDto
.
DataBean
.
OrderBean
.
ProductBean
material
:
productList
.
getMaterialProduct
())
{
productName
+=
"/"
+
material
.
getSpecificationName
();
grilling
+=
material
.
getSpecificationName
()
+
"/"
;
}
}
}
if
(
grilling
.
length
()
>
0
)
{
grilling
=
grilling
.
substring
(
0
,
grilling
.
length
()-
1
);
}
}
deliveryProductInfo
.
setGrilling
(
grilling
);
deliveryProductInfo
.
setProductName
(
productName
);
deliveryProductInfo
.
setProductName
(
productName
);
deliveryProductInfo
.
setProductNumber
(
productList
.
getNumber
());
deliveryProductInfo
.
setProductNumber
(
productList
.
getNumber
());
deliveryProductInfo
.
setProductPrice
(
productList
.
getSalePrice
().
intValue
());
deliveryProductInfo
.
setProductPrice
(
productList
.
getSalePrice
().
intValue
());
...
@@ -218,11 +219,15 @@ public class DeliveryAdapter {
...
@@ -218,11 +219,15 @@ public class DeliveryAdapter {
productInfos
.
add
(
deliveryProductInfo
);
productInfos
.
add
(
deliveryProductInfo
);
boolean
isFeiChangDa
=
productList
.
getProductName
().
equalsIgnoreCase
(
"啡常搭"
);
if
(
CollectionUtils
.
isNotEmpty
(
productList
.
getComboProduct
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
productList
.
getComboProduct
()))
{
productList
.
getComboProduct
().
forEach
(
comboProduct
->
{
productList
.
getComboProduct
().
forEach
(
comboProduct
->
{
ProductInfo
deliveryComboProductInfo
=
new
ProductInfo
();
ProductInfo
deliveryComboProductInfo
=
new
ProductInfo
();
deliveryComboProductInfo
.
setProductCode
(
comboProduct
.
getProductId
().
length
()>
4
?
comboProduct
.
getProductId
().
substring
(
4
):
comboProduct
.
getProductId
());
deliveryComboProductInfo
.
setProductCode
(
comboProduct
.
getProductId
().
length
()>
4
?
comboProduct
.
getProductId
().
substring
(
4
):
comboProduct
.
getProductId
());
String
productNameCombo
=
StringUtils
.
isBlank
(
comboProduct
.
getSpecificationName
())
?
comboProduct
.
getProductName
()
:
comboProduct
.
getSpecificationName
();
String
productNameCombo
=
StringUtils
.
isBlank
(
comboProduct
.
getSpecificationName
())
?
comboProduct
.
getProductName
()
:
comboProduct
.
getSpecificationName
();
String
grillingCombo
=
""
;
OrderProductAddInfoDto
extInfoCombo
=
JSON
.
parseObject
(
comboProduct
.
getExtInfo
(),
OrderProductAddInfoDto
.
class
);
OrderProductAddInfoDto
extInfoCombo
=
JSON
.
parseObject
(
comboProduct
.
getExtInfo
(),
OrderProductAddInfoDto
.
class
);
if
(
CollectionUtils
.
isNotEmpty
(
extInfoCombo
.
getSpecialAttrs
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
extInfoCombo
.
getSpecialAttrs
()))
{
String
attr
=
""
;
String
attr
=
""
;
...
@@ -239,14 +244,24 @@ public class DeliveryAdapter {
...
@@ -239,14 +244,24 @@ public class DeliveryAdapter {
if
(
CollectionUtils
.
isNotEmpty
(
comboProduct
.
getMaterialProduct
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
comboProduct
.
getMaterialProduct
()))
{
for
(
QueryOrdersResponseDto
.
DataBean
.
OrderBean
.
ProductBean
material
:
comboProduct
.
getMaterialProduct
())
{
for
(
QueryOrdersResponseDto
.
DataBean
.
OrderBean
.
ProductBean
material
:
comboProduct
.
getMaterialProduct
())
{
productNameCombo
+=
"/"
+
material
.
getSpecificationName
()
;
grillingCombo
+=
material
.
getSpecificationName
()
+
"/"
;
}
}
}
}
if
(
grillingCombo
.
length
()
>
0
)
{
grillingCombo
=
grillingCombo
.
substring
(
0
,
grillingCombo
.
length
()-
1
);
}
deliveryComboProductInfo
.
setGrilling
(
grillingCombo
);
deliveryComboProductInfo
.
setProductName
(
productNameCombo
);
deliveryComboProductInfo
.
setProductName
(
productNameCombo
);
deliveryComboProductInfo
.
setProductNumber
(
comboProduct
.
getNumber
()/
productList
.
getNumber
());
deliveryComboProductInfo
.
setProductNumber
(
comboProduct
.
getNumber
()/
productList
.
getNumber
());
if
(
isFeiChangDa
)
{
deliveryComboProductInfo
.
setProductPrice
(
comboProduct
.
getSalePrice
().
intValue
());
deliveryComboProductInfo
.
setProductPrice
(
comboProduct
.
getSalePrice
().
intValue
());
//餐道使用
//餐道使用
deliveryComboProductInfo
.
setCumulatedTotal
(
comboProduct
.
getNumber
()
*
comboProduct
.
getSalePrice
().
intValue
());
deliveryComboProductInfo
.
setCumulatedTotal
(
comboProduct
.
getNumber
()
*
comboProduct
.
getSalePrice
().
intValue
());
}
else
{
deliveryComboProductInfo
.
setProductPrice
(
0
);
//餐道使用
deliveryComboProductInfo
.
setCumulatedTotal
(
0
);
}
OrderProductAddInfoDto
orderComboProductAddInfoDto
=
JSON
.
parseObject
(
comboProduct
.
getAddInfo
(),
OrderProductAddInfoDto
.
class
);
OrderProductAddInfoDto
orderComboProductAddInfoDto
=
JSON
.
parseObject
(
comboProduct
.
getAddInfo
(),
OrderProductAddInfoDto
.
class
);
deliveryComboProductInfo
.
setTaxId
(
StringUtils
.
isNotEmpty
(
orderComboProductAddInfoDto
.
getTaxId
())
?
orderComboProductAddInfoDto
.
getTaxId
()
:
"10"
);
deliveryComboProductInfo
.
setTaxId
(
StringUtils
.
isNotEmpty
(
orderComboProductAddInfoDto
.
getTaxId
())
?
orderComboProductAddInfoDto
.
getTaxId
()
:
"10"
);
deliveryComboProductInfo
.
setTaxRate
(
orderComboProductAddInfoDto
.
getTax
()
>
0
?
orderComboProductAddInfoDto
.
getTax
()
:
6
);
deliveryComboProductInfo
.
setTaxRate
(
orderComboProductAddInfoDto
.
getTax
()
>
0
?
orderComboProductAddInfoDto
.
getTax
()
:
6
);
...
@@ -278,7 +293,7 @@ public class DeliveryAdapter {
...
@@ -278,7 +293,7 @@ public class DeliveryAdapter {
});
});
}
}
});
});
deliveryOrderRequestDto
.
setProductTotal
(
productInfos
.
stream
().
mapToInt
(
t
->
t
.
getCumulatedTotal
()).
sum
());
deliveryOrderRequestDto
.
setProductTotal
(
productInfos
.
stream
().
mapToInt
(
t
->
t
.
getCumulatedTotal
()
==
null
?
0
:
t
.
getCumulatedTotal
()
).
sum
());
}
}
...
...
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
View file @
883765f5
...
@@ -1128,7 +1128,7 @@ public class OrderAdapter {
...
@@ -1128,7 +1128,7 @@ public class OrderAdapter {
responseVo
.
setPayStatusDesc
(
Optional
.
ofNullable
(
PayStatus
.
getByCode
(
ordersBean
.
getPayStatus
()))
responseVo
.
setPayStatusDesc
(
Optional
.
ofNullable
(
PayStatus
.
getByCode
(
ordersBean
.
getPayStatus
()))
.
map
(
PayStatus:
:
getDesc
).
orElse
(
""
));
.
map
(
PayStatus:
:
getDesc
).
orElse
(
""
));
responseVo
.
setPayVoucher
(
orderExtInfoDto
!=
null
?
orderExtInfoDto
.
getPayTransId
()
:
""
);
responseVo
.
setPayVoucher
(
orderExtInfoDto
!=
null
?
orderExtInfoDto
.
getPayTransId
()
:
""
);
if
(
mcCafePartnerId
.
equals
(
ordersBean
.
getCompanyId
()))
{
if
(
mcCafePartnerId
.
equals
(
ordersBean
.
getCompanyId
())
&&
StringUtils
.
isNotBlank
(
responseVo
.
getPayVoucher
())
)
{
responseVo
.
setPayVoucherBarCode
(
Base64
.
getEncoder
().
encodeToString
(
responseVo
.
setPayVoucherBarCode
(
Base64
.
getEncoder
().
encodeToString
(
BarcodeUtil
.
generateBarCode128
(
responseVo
.
getPayVoucher
(),
null
,
null
,
true
,
true
)));
BarcodeUtil
.
generateBarCode128
(
responseVo
.
getPayVoucher
(),
null
,
null
,
true
,
true
)));
}
}
...
@@ -2346,11 +2346,14 @@ public class OrderAdapter {
...
@@ -2346,11 +2346,14 @@ public class OrderAdapter {
if
(
cartGoodsDetailDto
.
getProductType
()
!=
null
)
{
if
(
cartGoodsDetailDto
.
getProductType
()
!=
null
)
{
if
(
cartGoodsDetailDto
.
getProductType
()
==
ProductType
.
SETMEALPRODUCT
.
getCode
()
if
(
cartGoodsDetailDto
.
getProductType
()
==
ProductType
.
SETMEALPRODUCT
.
getCode
()
||
cartGoodsDetailDto
.
getProductType
()
==
ProductType
.
SETMEALPRODUCT_UPPRICE
.
getCode
())
{
||
cartGoodsDetailDto
.
getProductType
()
==
ProductType
.
SETMEALPRODUCT_UPPRICE
.
getCode
())
{
createOrderProductDemoDto
.
setPrice
(
0
l
);
//
createOrderProductDemoDto.setPrice(0l);
//套餐
//套餐
List
<
CreateOrderProductRequest
>
comboProducts
=
new
ArrayList
<>();
List
<
CreateOrderProductRequest
>
comboProducts
=
new
ArrayList
<>();
cartGoodsDetailDto
.
getComboProducts
().
forEach
(
product
->
{
cartGoodsDetailDto
.
getComboProducts
().
forEach
(
product
->
{
CreateOrderProductRequest
createOrderComboProduct
=
convent2MCCafeOrderProductDemo
(
product
,
product
.
getProductType
());
CreateOrderProductRequest
createOrderComboProduct
=
convent2MCCafeOrderProductDemo
(
product
,
product
.
getProductType
());
if
(!
product
.
getIsFixedProduct
())
{
createOrderProductDemoDto
.
setPrice
(
createOrderProductDemoDto
.
getPrice
()+
product
.
getOriginalPrice
());
}
comboProducts
.
add
(
createOrderComboProduct
);
comboProducts
.
add
(
createOrderComboProduct
);
if
(
CollectionUtils
.
isNotEmpty
(
product
.
getMaterialList
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
product
.
getMaterialList
()))
{
//加料商品
//加料商品
...
...
order-application-service/src/main/java/cn/freemud/entities/vo/ProductInfo.java
View file @
883765f5
...
@@ -40,6 +40,11 @@ public class ProductInfo {
...
@@ -40,6 +40,11 @@ public class ProductInfo {
private
String
productName
;
private
String
productName
;
/**
/**
* 特挑和加料信息
*/
private
String
grilling
;
/**
* 商品数量
* 商品数量
* productNumber不能为空
* productNumber不能为空
* productNumber不能小于1
* productNumber不能小于1
...
...
order-application-service/src/main/java/cn/freemud/service/impl/MCCafeOrderServiceImpl.java
View file @
883765f5
...
@@ -981,7 +981,11 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
...
@@ -981,7 +981,11 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
if
(
deliveryResponse
==
null
||
RESPONSE_SUCCESS_CODE
!=
deliveryResponse
.
getCode
()
||
deliveryResponse
.
getData
()
==
null
)
{
if
(
deliveryResponse
==
null
||
RESPONSE_SUCCESS_CODE
!=
deliveryResponse
.
getCode
()
||
deliveryResponse
.
getData
()
==
null
)
{
String
deliveryId
=
deliveryResponse
!=
null
&&
deliveryResponse
.
getData
()
!=
null
?
deliveryResponse
.
getData
().
getDeliveryId
()
:
""
;
String
deliveryId
=
deliveryResponse
!=
null
&&
deliveryResponse
.
getData
()
!=
null
?
deliveryResponse
.
getData
().
getDeliveryId
()
:
""
;
String
operator
=
"系统"
;
String
operator
=
"系统"
;
updateDeliveryAbnormal
(
orderBean
.
getCompanyId
(),
orderBean
.
getOid
(),
deliveryId
,
operator
);
String
abnormalDesc
=
"配送异常"
;
if
(
null
!=
deliveryResponse
&&
StringUtils
.
isNotBlank
(
deliveryResponse
.
getMsg
()))
{
abnormalDesc
=
deliveryResponse
.
getMsg
();
}
updateDeliveryAbnormal
(
orderBean
.
getCompanyId
(),
orderBean
.
getOid
(),
deliveryId
,
operator
,
abnormalDesc
);
emailAlertService
.
sendEmailAlert
(
"创建配送单失败"
,
String
.
format
(
"request:%s \r\nresponse:%s"
,
JSONObject
.
toJSONString
(
createDeliveryVo
),
JSONObject
.
toJSONString
(
deliveryResponse
)));
emailAlertService
.
sendEmailAlert
(
"创建配送单失败"
,
String
.
format
(
"request:%s \r\nresponse:%s"
,
JSONObject
.
toJSONString
(
createDeliveryVo
),
JSONObject
.
toJSONString
(
deliveryResponse
)));
return
sendPaySuccessNoticeMessage
();
return
sendPaySuccessNoticeMessage
();
}
else
{
}
else
{
...
@@ -1001,9 +1005,9 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
...
@@ -1001,9 +1005,9 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
* @param orderCode
* @param orderCode
* @param deliveryId
* @param deliveryId
*/
*/
public
void
updateDeliveryAbnormal
(
String
partnerId
,
String
orderCode
,
String
deliveryId
,
String
operator
)
{
public
void
updateDeliveryAbnormal
(
String
partnerId
,
String
orderCode
,
String
deliveryId
,
String
operator
,
String
abnormalDesc
)
{
AssortmentUpdateDeliveryAbnormalRequest
request
=
AssortmentUpdateDeliveryAbnormalRequest
.
builder
()
AssortmentUpdateDeliveryAbnormalRequest
request
=
AssortmentUpdateDeliveryAbnormalRequest
.
builder
()
.
abnormalDesc
(
"配送异常"
)
.
abnormalDesc
(
abnormalDesc
)
.
deliveryId
(
deliveryId
)
.
deliveryId
(
deliveryId
)
.
orderCode
(
orderCode
)
.
orderCode
(
orderCode
)
.
partnerId
(
partnerId
)
.
partnerId
(
partnerId
)
...
...
shopping-cart-application-service/src/main/java/cn/freemud/adapter/ShoppingCartConvertAdapter.java
View file @
883765f5
...
@@ -384,9 +384,13 @@ public class ShoppingCartConvertAdapter {
...
@@ -384,9 +384,13 @@ public class ShoppingCartConvertAdapter {
cartGoods
.
setCreateTimeMili
(
cartGood
.
getCreateTimeMili
());
cartGoods
.
setCreateTimeMili
(
cartGood
.
getCreateTimeMili
());
cartGoods
.
setSkuName
(
cartGood
.
getSkuName
());
cartGoods
.
setSkuName
(
cartGood
.
getSkuName
());
cartGoods
.
setSkuName
(
cartGood
.
getSkuName
());
cartGoods
.
setSkuName
(
cartGood
.
getSkuName
());
cartGood
.
setClassificationId
(
cartGood
.
getClassificationId
());
cartGood
s
.
setClassificationId
(
cartGood
.
getClassificationId
());
cartGood
.
setClassificationName
(
cartGood
.
getClassificationName
());
cartGood
s
.
setClassificationName
(
cartGood
.
getClassificationName
());
cartGoods
.
setActivityType
(
ActivityTypeEnum
.
TYPE_61
.
getCode
());
cartGoods
.
setActivityType
(
ActivityTypeEnum
.
TYPE_61
.
getCode
());
cartGoods
.
setUserId
(
cartGood
.
getUserId
());
cartGoods
.
setUserName
(
cartGood
.
getUserName
());
cartGoods
.
setOpenId
(
cartGood
.
getOpenId
());
cartGoods
.
setPhotoUrl
(
cartGood
.
getPhotoUrl
());
return
cartGoods
;
return
cartGoods
;
}
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/CollageOrderRequestVo.java
View file @
883765f5
...
@@ -24,9 +24,6 @@ public class CollageOrderRequestVo {
...
@@ -24,9 +24,6 @@ public class CollageOrderRequestVo {
@NotEmpty
(
message
=
"sessionId不能为空"
)
@NotEmpty
(
message
=
"sessionId不能为空"
)
private
String
sessionId
;
private
String
sessionId
;
@ApiModelProperty
(
value
=
"当前操作人用户ID"
)
private
String
currentUserId
;
@ApiModelProperty
(
value
=
"拼单创建人用户ID"
)
@ApiModelProperty
(
value
=
"拼单创建人用户ID"
)
private
String
createCollageUserId
;
private
String
createCollageUserId
;
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CollageOrderServiceImpl.java
View file @
883765f5
...
@@ -58,18 +58,19 @@ public class CollageOrderServiceImpl implements CollageOrderService {
...
@@ -58,18 +58,19 @@ public class CollageOrderServiceImpl implements CollageOrderService {
@Override
@Override
public
BaseResponse
queryCollageOrder
(
CollageOrderRequestVo
request
)
{
public
BaseResponse
queryCollageOrder
(
CollageOrderRequestVo
request
)
{
CollageOrderDto
collageOrderDto
=
this
.
collageOrderAdapter
.
convert2CollageOrderDto
(
request
);
CollageOrderDto
collageOrderDto
=
this
.
collageOrderAdapter
.
convert2CollageOrderDto
(
request
);
// 查询时需传入拼单创建人的userId,若上送字段为空时,默认查询当前登录人自己的拼单信息
CustomerInfoVo
userInfo
=
this
.
getUserInfo
(
request
.
getSessionId
());
String
currentUserId
=
StringUtils
.
isNotBlank
(
request
.
getCurrentUserId
())
?
request
.
getCurrentUserId
()
:
this
.
getUserIdBySessionId
(
request
.
getSessionId
());
String
currentUserId
=
userInfo
.
getMemberId
();
// 当前登录人userId
collageOrderDto
.
setCurrentUserId
(
currentUserId
);
collageOrderDto
.
setCurrentUserId
(
currentUserId
);
// 若拼单发起人ID为空,则默认按当前用户查询
// 若拼单发起人ID为空,则默认按当前用户查询
if
(
StringUtils
.
isEmpty
(
request
.
getCreateCollageUserId
()))
{
collageOrderDto
.
setCreateCollageUserId
(
currentUserId
);
}
BaseResponse
<
CollageOrder
>
queryCollageOrderResponse
=
this
.
collageOrderBaseService
.
queryCollageOrder
(
collageOrderDto
);
BaseResponse
<
CollageOrder
>
queryCollageOrderResponse
=
this
.
collageOrderBaseService
.
queryCollageOrder
(
collageOrderDto
);
CollageOrder
collageOrder
=
queryCollageOrderResponse
.
getResult
();
CollageOrder
collageOrder
=
queryCollageOrderResponse
.
getResult
();
// SDK查询订单返回非成功code或返回结果订单信息为空时,返回前端异常信息
if
(
null
==
collageOrder
)
{
Optional
.
ofNullable
(
queryCollageOrderResponse
).
filter
(
resp
->
(
ResponseResult
.
SUCCESS
.
getCode
().
equals
(
resp
.
getCode
())
&&
!
ObjectUtils
.
isEmpty
(
collageOrder
))).
orElseThrow
(()
->
new
ServiceException
(
ResponseResult
.
COLLAGE_NOT_EXIST
));
return
ResponseUtil
.
error
(
ResponseResult
.
COLLAGE_NOT_EXIST
);
}
// 现在改为同时可查询自己发起以及参与的拼单所以查询到拼单信息后,后续查询需要使用拼单hash的三要素信息继续查询
// 现在改为同时可查询自己发起以及参与的拼单所以查询到拼单信息后,后续查询需要使用拼单hash的三要素信息继续查询
collageOrderDto
.
setPartnerId
(
collageOrder
.
getPartnerId
());
collageOrderDto
.
setPartnerId
(
collageOrder
.
getPartnerId
());
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartCollageServiceImpl.java
View file @
883765f5
...
@@ -720,6 +720,10 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
...
@@ -720,6 +720,10 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
*/
*/
private
void
updatePackPrice
(
ShoppingCartGoodsResponseVo
shoppingCartGoodsResponseVo
,
ShoppingCartGoodsDto
shoppingCartGoodsDto
)
{
private
void
updatePackPrice
(
ShoppingCartGoodsResponseVo
shoppingCartGoodsResponseVo
,
ShoppingCartGoodsDto
shoppingCartGoodsDto
)
{
if
(
shoppingCartGoodsResponseVo
!=
null
&&
shoppingCartGoodsResponseVo
.
getProducts
()
!=
null
&&
shoppingCartGoodsDto
!=
null
&&
shoppingCartGoodsDto
.
getProducts
()
!=
null
)
{
if
(
shoppingCartGoodsResponseVo
!=
null
&&
shoppingCartGoodsResponseVo
.
getProducts
()
!=
null
&&
shoppingCartGoodsDto
!=
null
&&
shoppingCartGoodsDto
.
getProducts
()
!=
null
)
{
if
(
shoppingCartGoodsResponseVo
.
getNewPackAmount
()
==
null
||
shoppingCartGoodsResponseVo
.
getNewPackAmount
()
==
0
)
{
// 当整单包装费为0时,不计算购物车行包装费
return
;
}
shoppingCartGoodsResponseVo
.
getProducts
().
stream
().
forEach
(
product
->
{
shoppingCartGoodsResponseVo
.
getProducts
().
stream
().
forEach
(
product
->
{
shoppingCartGoodsDto
.
getProducts
().
stream
().
forEach
(
goods
->
{
shoppingCartGoodsDto
.
getProducts
().
stream
().
forEach
(
goods
->
{
if
(
goods
.
getCartGoodsUid
().
equals
(
product
.
getCartGoodsUid
()))
{
if
(
goods
.
getCartGoodsUid
().
equals
(
product
.
getCartGoodsUid
()))
{
...
...
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