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
98af42d6
Commit
98af42d6
authored
Aug 24, 2021
by
ping.wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返回码修改
parent
5ae7add5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
order-application-service/src/main/java/cn/freemud/constant/ResponseCodeConstant.java
+2
-0
order-application-service/src/main/java/cn/freemud/service/impl/PointsMallOrderServiceImpl.java
+12
-11
No files found.
order-application-service/src/main/java/cn/freemud/constant/ResponseCodeConstant.java
View file @
98af42d6
...
@@ -9,6 +9,8 @@ public class ResponseCodeConstant {
...
@@ -9,6 +9,8 @@ public class ResponseCodeConstant {
public
final
static
String
RESPONSE_SUCCESS_STR
=
"100"
;
public
final
static
String
RESPONSE_SUCCESS_STR
=
"100"
;
public
final
static
String
RESPONSE_ERROR_STR
=
"101"
;
public
final
static
String
COCO_RESPONSE_COUPON_ERR_STR
=
"49000"
;
public
final
static
String
COCO_RESPONSE_COUPON_ERR_STR
=
"49000"
;
public
final
static
String
USER_HAVE_NO_COUPON
=
"44039"
;
public
final
static
String
USER_HAVE_NO_COUPON
=
"44039"
;
...
...
order-application-service/src/main/java/cn/freemud/service/impl/PointsMallOrderServiceImpl.java
View file @
98af42d6
...
@@ -3,6 +3,7 @@ package cn.freemud.service.impl;
...
@@ -3,6 +3,7 @@ package cn.freemud.service.impl;
import
cn.freemud.amp.service.SendCouponService
;
import
cn.freemud.amp.service.SendCouponService
;
import
cn.freemud.base.entity.BaseResponse
;
import
cn.freemud.base.entity.BaseResponse
;
import
cn.freemud.base.util.DateUtil
;
import
cn.freemud.base.util.DateUtil
;
import
cn.freemud.constant.ResponseCodeConstant
;
import
cn.freemud.entities.Active
;
import
cn.freemud.entities.Active
;
import
cn.freemud.entities.dto.BatchQueryActivityInfoRequestDto
;
import
cn.freemud.entities.dto.BatchQueryActivityInfoRequestDto
;
import
cn.freemud.entities.dto.BatchQueryActivityInfoResponseDto
;
import
cn.freemud.entities.dto.BatchQueryActivityInfoResponseDto
;
...
@@ -96,16 +97,16 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService {
...
@@ -96,16 +97,16 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService {
productInfoRequest
.
setValidateStock
(
true
);
productInfoRequest
.
setValidateStock
(
true
);
productInfoRequest
.
setValidateTime
(
true
);
productInfoRequest
.
setValidateTime
(
true
);
PointMallListProductInfoResponse
<
List
<
IntegralProductType
>>
productInfosDto
=
pointMallProductClient
.
listProductInfo
(
productInfoRequest
);
PointMallListProductInfoResponse
<
List
<
IntegralProductType
>>
productInfosDto
=
pointMallProductClient
.
listProductInfo
(
productInfoRequest
);
if
(!
Objects
.
equals
(
100
,
productInfosDto
.
getStatusCode
())
||
CollectionUtils
.
isEmpty
(
productInfosDto
.
getResult
()))
{
if
(!
Objects
.
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS
,
productInfosDto
.
getStatusCode
())
||
CollectionUtils
.
isEmpty
(
productInfosDto
.
getResult
()))
{
return
ResponseUtil
.
error
(
"101"
,
"商品异常"
);
return
ResponseUtil
.
error
(
ResponseCodeConstant
.
RESPONSE_ERROR_STR
,
"商品异常"
);
}
}
if
(
productInfosDto
.
getResult
().
get
(
0
).
getStatus
()
!=
IntegralProductStatusEnum
.
STATUS_2
.
getCode
())
{
if
(
productInfosDto
.
getResult
().
get
(
0
).
getStatus
()
!=
IntegralProductStatusEnum
.
STATUS_2
.
getCode
())
{
IntegralProductStatusEnum
message
=
IntegralProductStatusEnum
.
getByCode
(
productInfosDto
.
getResult
().
get
(
0
).
getStatus
());
IntegralProductStatusEnum
message
=
IntegralProductStatusEnum
.
getByCode
(
productInfosDto
.
getResult
().
get
(
0
).
getStatus
());
return
ResponseUtil
.
error
(
"101"
,
message
!=
null
?
message
.
getDesc
()
:
"商品异常"
);
return
ResponseUtil
.
error
(
ResponseCodeConstant
.
RESPONSE_ERROR_STR
,
message
!=
null
?
message
.
getDesc
()
:
"商品异常"
);
}
}
IntegralProductType
integralProductType
=
productInfosDto
.
getResult
().
get
(
0
);
IntegralProductType
integralProductType
=
productInfosDto
.
getResult
().
get
(
0
);
if
(!
Objects
.
equals
(
1
,
integralProductType
.
getExchangeType
()))
{
if
(!
Objects
.
equals
(
1
,
integralProductType
.
getExchangeType
()))
{
return
ResponseUtil
.
error
(
"101"
,
"积分商城暂不支持现金兑换"
);
return
ResponseUtil
.
error
(
ResponseCodeConstant
.
RESPONSE_ERROR_STR
,
"积分商城暂不支持现金兑换"
);
}
}
// integralProductType.setIntegralPrice(2);
// integralProductType.setIntegralPrice(2);
// integralProductType.setCashPrice(0);
// integralProductType.setCashPrice(0);
...
@@ -115,7 +116,7 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService {
...
@@ -115,7 +116,7 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService {
boolean
isCoupon
=
integralProductType
.
getProductType
()
==
1
;
boolean
isCoupon
=
integralProductType
.
getProductType
()
==
1
;
WeixinDeliveryAddressDto
weixinDeliveryAddress
=
createOrderVo
.
getWeixinDeliveryAddress
();
WeixinDeliveryAddressDto
weixinDeliveryAddress
=
createOrderVo
.
getWeixinDeliveryAddress
();
if
(!
isCoupon
&&
(
weixinDeliveryAddress
==
null
||
StringUtils
.
isEmpty
(
weixinDeliveryAddress
.
getProvinceName
())))
{
if
(!
isCoupon
&&
(
weixinDeliveryAddress
==
null
||
StringUtils
.
isEmpty
(
weixinDeliveryAddress
.
getProvinceName
())))
{
return
ResponseUtil
.
error
(
"101"
,
"收货地址异常"
);
return
ResponseUtil
.
error
(
ResponseCodeConstant
.
RESPONSE_ERROR_STR
,
"收货地址异常"
);
}
}
Active
active
=
null
;
Active
active
=
null
;
if
(
isCoupon
)
{
if
(
isCoupon
)
{
...
@@ -138,7 +139,7 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService {
...
@@ -138,7 +139,7 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService {
statisticalScoreRequest
.
setPartnerId
(
userLoginInfoDto
.
getPartnerId
());
statisticalScoreRequest
.
setPartnerId
(
userLoginInfoDto
.
getPartnerId
());
statisticalScoreRequest
.
setMemberId
(
userLoginInfoDto
.
getMemberId
());
statisticalScoreRequest
.
setMemberId
(
userLoginInfoDto
.
getMemberId
());
CustomerPropertyBaseResponse
<
StatislScoreResponse
>
statislScoreResponseBaseResponse
=
customerPropertyClient
.
statisticalScore
(
statisticalScoreRequest
);
CustomerPropertyBaseResponse
<
StatislScoreResponse
>
statislScoreResponseBaseResponse
=
customerPropertyClient
.
statisticalScore
(
statisticalScoreRequest
);
if
(!
Objects
.
equals
(
"100"
,
statislScoreResponseBaseResponse
.
getCode
()))
{
if
(!
Objects
.
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
,
statislScoreResponseBaseResponse
.
getCode
()))
{
return
ResponseUtil
.
error
(
statislScoreResponseBaseResponse
.
getCode
(),
"查询积分异常"
);
return
ResponseUtil
.
error
(
statislScoreResponseBaseResponse
.
getCode
(),
"查询积分异常"
);
}
}
if
(
statislScoreResponseBaseResponse
.
getData
()
!=
null
&&
statislScoreResponseBaseResponse
.
getData
().
getCurrentScore
()
<
points
)
{
if
(
statislScoreResponseBaseResponse
.
getData
()
!=
null
&&
statislScoreResponseBaseResponse
.
getData
().
getCurrentScore
()
<
points
)
{
...
@@ -149,7 +150,7 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService {
...
@@ -149,7 +150,7 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService {
CreateOrderRequest
createOrderRequest
=
convent2NEWCreateOrderRequest
(
OrderClientType
.
I_MEMBER
.
getIndex
(),
userLoginInfoDto
,
CreateOrderRequest
createOrderRequest
=
convent2NEWCreateOrderRequest
(
OrderClientType
.
I_MEMBER
.
getIndex
(),
userLoginInfoDto
,
storeId
,
""
,
""
,
4
,
integralProductType
,
skuId
,
active
,
weixinDeliveryAddress
);
storeId
,
""
,
""
,
4
,
integralProductType
,
skuId
,
active
,
weixinDeliveryAddress
);
com
.
freemud
.
application
.
sdk
.
api
.
ordercenter
.
response
.
BaseResponse
<
OrderInfoReqs
>
createOrderResponseDto
=
orderSdkService
.
createOrder
(
createOrderRequest
,
""
);
com
.
freemud
.
application
.
sdk
.
api
.
ordercenter
.
response
.
BaseResponse
<
OrderInfoReqs
>
createOrderResponseDto
=
orderSdkService
.
createOrder
(
createOrderRequest
,
""
);
if
(!
Objects
.
equals
(
"100"
,
createOrderResponseDto
.
getCode
()))
{
if
(!
Objects
.
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
,
createOrderResponseDto
.
getCode
()))
{
return
ResponseUtil
.
error
(
createOrderResponseDto
.
getCode
(),
"创建订单异常"
);
return
ResponseUtil
.
error
(
createOrderResponseDto
.
getCode
(),
"创建订单异常"
);
}
}
String
orderCode
=
createOrderResponseDto
.
getResult
().
getOrderCode
();
String
orderCode
=
createOrderResponseDto
.
getResult
().
getOrderCode
();
...
@@ -167,7 +168,7 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService {
...
@@ -167,7 +168,7 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService {
productStockRequest
.
setStockNumber
(
1
);
productStockRequest
.
setStockNumber
(
1
);
updatePointsMallStocksRequest
.
setProductStocks
(
Arrays
.
asList
(
productStockRequest
));
updatePointsMallStocksRequest
.
setProductStocks
(
Arrays
.
asList
(
productStockRequest
));
PointMallListProductInfoResponse
pointMallListProductInfoResponse
=
pointMallProductClient
.
updateStock
(
updatePointsMallStocksRequest
);
PointMallListProductInfoResponse
pointMallListProductInfoResponse
=
pointMallProductClient
.
updateStock
(
updatePointsMallStocksRequest
);
if
(!
Objects
.
equals
(
100
,
pointMallListProductInfoResponse
.
getStatusCode
()))
{
if
(!
Objects
.
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS
,
pointMallListProductInfoResponse
.
getStatusCode
()))
{
return
ResponseUtil
.
error
(
pointMallListProductInfoResponse
.
getStatusCode
().
toString
(),
"扣减库存失败"
);
return
ResponseUtil
.
error
(
pointMallListProductInfoResponse
.
getStatusCode
().
toString
(),
"扣减库存失败"
);
}
}
//扣减积分 (失败:失败冲正活动库存)
//扣减积分 (失败:失败冲正活动库存)
...
@@ -186,7 +187,7 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService {
...
@@ -186,7 +187,7 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService {
userScoreRequest
.
setIdempotencyBussinessType
(
"5"
);
userScoreRequest
.
setIdempotencyBussinessType
(
"5"
);
userScoreRequest
.
setAppId
(
userLoginInfoDto
.
getAppId
());
userScoreRequest
.
setAppId
(
userLoginInfoDto
.
getAppId
());
CustomerPropertyBaseResponse
baseResponse
=
customerPropertyClient
.
useScore
(
userScoreRequest
);
CustomerPropertyBaseResponse
baseResponse
=
customerPropertyClient
.
useScore
(
userScoreRequest
);
if
(!
Objects
.
equals
(
"100"
,
baseResponse
.
getCode
()))
{
if
(!
Objects
.
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
,
baseResponse
.
getCode
()))
{
createOrderFail
(
true
,
false
,
partnerId
,
memberId
,
orderCode
,
skuId
,
points
,
appId
);
createOrderFail
(
true
,
false
,
partnerId
,
memberId
,
orderCode
,
skuId
,
points
,
appId
);
return
ResponseUtil
.
error
(
baseResponse
.
getCode
(),
"扣减积分失败"
);
return
ResponseUtil
.
error
(
baseResponse
.
getCode
(),
"扣减积分失败"
);
}
}
...
@@ -200,7 +201,7 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService {
...
@@ -200,7 +201,7 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService {
request
.
setPayState
(
2
);
request
.
setPayState
(
2
);
request
.
setOperator
(
nickName
);
request
.
setOperator
(
nickName
);
updateOrderStateResp
=
orderSdkService
.
orderAffirm
(
request
,
LogThreadLocal
.
getTrackingNo
());
updateOrderStateResp
=
orderSdkService
.
orderAffirm
(
request
,
LogThreadLocal
.
getTrackingNo
());
if
(
Objects
.
equals
(
"100"
,
updateOrderStateResp
.
getCode
()))
{
if
(
Objects
.
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
,
updateOrderStateResp
.
getCode
()))
{
//发券mq
//发券mq
sendCouponService
.
sendCouponMq
(
createOrderResponseDto
.
getResult
());
sendCouponService
.
sendCouponMq
(
createOrderResponseDto
.
getResult
());
}
}
...
@@ -210,7 +211,7 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService {
...
@@ -210,7 +211,7 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService {
request
.
setOperator
(
nickName
);
request
.
setOperator
(
nickName
);
updateOrderStateResp
=
orderSdkService
.
paySuccess
(
request
,
LogThreadLocal
.
getTrackingNo
());
updateOrderStateResp
=
orderSdkService
.
paySuccess
(
request
,
LogThreadLocal
.
getTrackingNo
());
}
}
if
(!
Objects
.
equals
(
"100"
,
updateOrderStateResp
.
getCode
()))
{
if
(!
Objects
.
equals
(
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
,
updateOrderStateResp
.
getCode
()))
{
createOrderFail
(
false
,
true
,
partnerId
,
memberId
,
orderCode
,
skuId
,
points
,
appId
);
createOrderFail
(
false
,
true
,
partnerId
,
memberId
,
orderCode
,
skuId
,
points
,
appId
);
return
ResponseUtil
.
error
(
updateOrderStateResp
.
getCode
(),
"创建订单异常"
);
return
ResponseUtil
.
error
(
updateOrderStateResp
.
getCode
(),
"创建订单异常"
);
}
}
...
...
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