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
39029bb0
Commit
39029bb0
authored
Jan 05, 2021
by
徐康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
麦咖啡随单购改造
parent
5cd709d7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
29 deletions
+63
-29
assortment-ordercenter-sdk/src/main/java/com/freemud/sdk/api/assortment/order/request/order/CreateOrderProductRequest.java
+1
-1
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
+43
-28
order-application-service/src/test/java/cn/freemud/service/impl/MallOrderServiceImplTest.java
+18
-0
ordercenter-sdk/src/main/java/com/freemud/application/sdk/api/ordercenter/enums/ProductTypeEnum.java
+1
-0
No files found.
assortment-ordercenter-sdk/src/main/java/com/freemud/sdk/api/assortment/order/request/order/CreateOrderProductRequest.java
View file @
39029bb0
...
...
@@ -173,7 +173,7 @@ public class CreateOrderProductRequest extends BaseConfig {
private
String
category
;
/** 商品税率**/
private
d
ouble
tax
;
private
D
ouble
tax
;
private
String
taxId
;
...
...
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
View file @
39029bb0
...
...
@@ -109,6 +109,12 @@ public class OrderAdapter {
private
String
mcCafePartnerId
;
@Value
(
"${mcCafe.refund.interval}"
)
private
String
mccafeRefundInterval
;
@Value
(
"${macafe.waimai.tag}"
)
private
String
maCafeWaimaiTag
;
@Value
(
"${macafe.pick.tag}"
)
private
String
maCafePickTag
;
@Value
(
"${mccafe.monthCard.goodsId}"
)
private
String
mccafeMonthCardGoodsId
;
@Value
(
"${saas.reverseNotifyiDcUrl}"
)
private
String
reverseNotifyiDcUrl
;
...
...
@@ -118,10 +124,6 @@ public class OrderAdapter {
private
String
backOrdersChangeOrderStatusConsumerQueue
;
@Value
(
"${program.backorders_notify_activity_exchange}"
)
private
String
backOrdersNotifyActivityExchange
;
@Value
(
"${macafe.waimai.tag}"
)
private
String
maCafeWaimaiTag
;
@Value
(
"${macafe.pick.tag}"
)
private
String
maCafePickTag
;
@Autowired
private
ShoppingCartAdapter
shoppingCartAdapter
;
@Autowired
...
...
@@ -183,6 +185,43 @@ public class OrderAdapter {
}
}
}
if
(
null
!=
shoppingCartGoodsDto
.
getPayCardFee
()
&&
0
l
!=
shoppingCartGoodsDto
.
getPayCardFee
()
&&
StringUtils
.
isNotBlank
(
createOrderVo
.
getCardKeyCode
()))
{
CreateOrderProductRequest
createOrderProductDemoDto
=
new
CreateOrderProductRequest
();
createOrderProductDemoDto
.
setProductId
(
mccafeMonthCardGoodsId
);
createOrderProductDemoDto
.
setProductName
(
"啡常月享卡"
);
createOrderProductDemoDto
.
setSpecification
(
mccafeMonthCardGoodsId
);
createOrderProductDemoDto
.
setSpecificationName
(
"啡常月享卡"
);
createOrderProductDemoDto
.
setPrice
(
shoppingCartGoodsDto
.
getPayCardFee
());
createOrderProductDemoDto
.
setSalePrice
(
shoppingCartGoodsDto
.
getPayCardFee
());
createOrderProductDemoDto
.
setTotalDiscountAmount
(
0
l
);
createOrderProductDemoDto
.
setNumber
(
1
);
createOrderProductDemoDto
.
setProductType
(
ProductTypeEnum
.
WITH_ORDER_VIRTUAL_PRODUCT
.
getCode
());
createOrderProductDemoDto
.
setParentProductId
(
"0"
);
createOrderProductDemoDto
.
setIsFixedProduct
(
null
);
createOrderProductDemoDto
.
setCustomerCode
(
createOrderVo
.
getCardKeyCode
());
createOrderProductDemoDto
.
setProductCode
(
createOrderVo
.
getCardKeyCode
());
createOrderProductDemoDto
.
setHasStockProudct
(
false
);
createOrderProductDemoDto
.
setWeight
(
0
d
);
createOrderProductDemoDto
.
setStapleFood
(
0
);
createOrderProductDemoDto
.
setTax
(
0
d
);
createOrderProductDemoDto
.
setTaxId
(
""
);
if
(
products
.
get
(
products
.
size
()-
1
).
getProductType
().
equals
(
ProductTypeEnum
.
TABLEWARE_PRODUCT
.
getCode
()))
{
products
.
add
(
products
.
size
()-
1
,
createOrderProductDemoDto
);
}
else
{
products
.
add
(
createOrderProductDemoDto
);
}
CreateOrderAccountRequest
createOrderAccountDto
=
CreateOrderAccountRequest
.
builder
()
.
accountId
(
""
)
.
name
(
"啡常月享卡"
)
.
price
(
shoppingCartGoodsDto
.
getPayCardFee
())
.
accountType
(
QueryOrderAccountType
.
MCCAFE_MONTH_CARD
)
.
sequence
(
orderAccountIndex
++)
.
productId
(
createOrderVo
.
getCardKeyCode
())
.
build
();
orderAccountDtos
.
add
(
createOrderAccountDto
);
}
createOrderDto
.
setProducts
(
products
);
boolean
hasDeliveryMonthCard
=
false
;
for
(
ActivityDiscountsDto
activityDiscountsDto
:
activityDiscountsDtos
)
{
...
...
@@ -271,17 +310,6 @@ public class OrderAdapter {
.
build
();
orderAccountDtos
.
add
(
createOrderAccountDto
);
}
if
(
null
!=
shoppingCartGoodsDto
.
getPayCardFee
()
&&
0
l
!=
shoppingCartGoodsDto
.
getPayCardFee
()
&&
StringUtils
.
isNotBlank
(
createOrderVo
.
getCardKeyCode
()))
{
CreateOrderAccountRequest
createOrderAccountDto
=
CreateOrderAccountRequest
.
builder
()
.
accountId
(
""
)
.
name
(
"啡常月享卡"
)
.
price
(
shoppingCartGoodsDto
.
getPayCardFee
())
.
accountType
(
QueryOrderAccountType
.
MCCAFE_MONTH_CARD
)
.
sequence
(
orderAccountIndex
++)
.
productId
(
createOrderVo
.
getCardKeyCode
())
.
build
();
orderAccountDtos
.
add
(
createOrderAccountDto
);
}
createOrderDto
.
setAccounts
(
CollectionUtils
.
isNotEmpty
(
orderAccountDtos
)
?
orderAccountDtos
:
Collections
.
emptyList
());
// update by miaohui 20201030 for 【ID1018638】【C端服务端】活动库存接口调整对接
...
...
@@ -1284,19 +1312,6 @@ public class OrderAdapter {
//商品信息转换
convent2ProductVos
(
ordersBean
.
getProductList
(),
responseVo
,
ordersBean
.
getCompanyId
());
responseVo
.
setOrderAccounts
(
convent2OrderAccountVo
(
ordersBean
.
getApportionDetails
()));
if
(
CollectionUtils
.
isNotEmpty
(
ordersBean
.
getOrderCostDetailList
()))
{
ordersBean
.
getOrderCostDetailList
().
forEach
(
o
->
{
if
(
o
.
getCostType
()
==
10
&&
o
.
getBillType
()
==
1
)
{
ProductVo
productVo
=
new
ProductVo
();
productVo
.
setQty
(
1
);
productVo
.
setName
(
o
.
getCostName
());
productVo
.
setSpuName
(
o
.
getCostName
());
productVo
.
setFinalPrice
(
o
.
getCostAmount
().
longValue
());
productVo
.
setOriginalPrice
(
o
.
getActualCostAmount
().
longValue
());
responseVo
.
getProducts
().
add
(
productVo
);
}
});
}
Long
promotionAmount
=
0L
;
Long
deliveryAmount
=
0L
;
Long
packageAmount
=
0L
;
...
...
order-application-service/src/test/java/cn/freemud/service/impl/MallOrderServiceImplTest.java
View file @
39029bb0
package
cn
.
freemud
.
service
.
impl
;
import
cn.freemud.entities.vo.CreateOrderVo
;
import
cn.freemud.management.entities.dto.request.order.OrderManagerRequest
;
import
cn.freemud.management.service.adapter.OrderManagerAdapter
;
import
cn.freemud.management.thirdparty.MulitiPaymentClient
;
...
...
@@ -8,6 +9,8 @@ import com.freemud.application.sdk.api.ordercenter.request.OrderConditionsReq;
import
com.freemud.application.sdk.api.ordercenter.service.OrderDownLoadSdkService
;
import
com.freemud.sdk.api.assortment.order.request.order.MultiOrderRefundRequest
;
import
com.freemud.sdk.api.assortment.order.response.order.MultiOrderRefundResponse
;
import
org.hibernate.validator.HibernateValidator
;
import
org.hibernate.validator.HibernateValidatorConfiguration
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -18,6 +21,11 @@ import org.springframework.cloud.netflix.feign.EnableFeignClients;
import
org.springframework.test.context.junit4.SpringRunner
;
import
springfox.documentation.spring.web.json.Json
;
import
javax.validation.ConstraintViolation
;
import
javax.validation.Validation
;
import
javax.validation.ValidatorFactory
;
import
java.util.Set
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
@EnableDiscoveryClient
...
...
@@ -56,6 +64,16 @@ public class MallOrderServiceImplTest {
// new OrderExtendedReq(),
// OrderClientType.SAAS,"www");
// }
@Test
public
void
f2
()
{
HibernateValidatorConfiguration
configuration
=
Validation
.
byProvider
(
HibernateValidator
.
class
)
.
configure
()
.
failFast
(
false
);
ValidatorFactory
validatorFactory
=
configuration
.
buildValidatorFactory
();
Set
<
ConstraintViolation
<
CreateOrderVo
>>
set
=
validatorFactory
.
getValidator
().
validate
(
new
CreateOrderVo
());
}
//
// @Test
// public void testPaySuccess() {
...
...
ordercenter-sdk/src/main/java/com/freemud/application/sdk/api/ordercenter/enums/ProductTypeEnum.java
View file @
39029bb0
...
...
@@ -25,6 +25,7 @@ public enum ProductTypeEnum {
TABLEWARE_PRODUCT
(
12
,
"餐具商品"
),
MATERIAL_PRODUCT
(
88
,
"加料商品"
),
LITTLE_MATERIAL_PRODUCT
(
89
,
"小料"
),
WITH_ORDER_VIRTUAL_PRODUCT
(
90
,
"随单购虚拟商品"
),
;
...
...
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