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
8cad0697
Commit
8cad0697
authored
Jun 18, 2021
by
周晓航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
评价有礼开发
Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent
61b9d1a3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
10 deletions
+32
-10
order-application-service/src/main/java/cn/freemud/entities/vo/GetEvaluationStatusNewRequestVo.java
+2
-0
order-application-service/src/main/java/cn/freemud/service/impl/EvaluationServiceImpl.java
+30
-10
No files found.
order-application-service/src/main/java/cn/freemud/entities/vo/GetEvaluationStatusNewRequestVo.java
View file @
8cad0697
...
@@ -20,4 +20,6 @@ public class GetEvaluationStatusNewRequestVo {
...
@@ -20,4 +20,6 @@ public class GetEvaluationStatusNewRequestVo {
private
String
orderId
;
private
String
orderId
;
private
String
sessionId
;
}
}
order-application-service/src/main/java/cn/freemud/service/impl/EvaluationServiceImpl.java
View file @
8cad0697
...
@@ -13,6 +13,7 @@ import cn.freemud.entities.vo.GetEvaluationDetailByOrderIdRequestVo;
...
@@ -13,6 +13,7 @@ import cn.freemud.entities.vo.GetEvaluationDetailByOrderIdRequestVo;
import
cn.freemud.entities.vo.GetEvaluationStatusNewRequestVo
;
import
cn.freemud.entities.vo.GetEvaluationStatusNewRequestVo
;
import
cn.freemud.enums.EvaluationStatus
;
import
cn.freemud.enums.EvaluationStatus
;
import
cn.freemud.enums.ResponseResult
;
import
cn.freemud.enums.ResponseResult
;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.service.EvaluationService
;
import
cn.freemud.service.EvaluationService
;
import
cn.freemud.service.thirdparty.ActivityApplicationClient
;
import
cn.freemud.service.thirdparty.ActivityApplicationClient
;
import
cn.freemud.utils.DateUtils
;
import
cn.freemud.utils.DateUtils
;
...
@@ -80,14 +81,14 @@ public class EvaluationServiceImpl implements EvaluationService {
...
@@ -80,14 +81,14 @@ public class EvaluationServiceImpl implements EvaluationService {
// 已经评价 查询是否有活动数据
// 已经评价 查询是否有活动数据
AssortmentOrderEvaluation
assortmentOrderEvaluation
=
orderEvaluationDetails
.
get
(
0
);
AssortmentOrderEvaluation
assortmentOrderEvaluation
=
orderEvaluationDetails
.
get
(
0
);
orderEvaluationStatus
.
setStatus
(
EvaluationStatus
.
REPEAT
.
getCode
());
orderEvaluationStatus
.
setStatus
(
EvaluationStatus
.
REPEAT
.
getCode
());
CheckAndJoinResponse
checkAndJoinMsg
=
getCheckAndJoinMsg
(
orderDetailResponse
.
getData
(),
request
,
assortmentOrderEvaluation
.
getActivityId
());
CheckAndJoinResponse
checkAndJoinMsg
=
getCheckAndJoinMsg
(
orderDetailResponse
.
getData
(),
request
.
getSessionId
(),
request
.
getOrderId
()
,
assortmentOrderEvaluation
.
getActivityId
());
orderEvaluationStatus
.
setResult
(
checkAndJoinMsg
);
orderEvaluationStatus
.
setResult
(
checkAndJoinMsg
);
return
ResponseUtil
.
success
(
orderEvaluationStatus
);
return
ResponseUtil
.
success
(
orderEvaluationStatus
);
}
}
// 添加订单评价信息
// 添加订单评价信息
InsertOrderEvaluationReqDto
insertOrderEvaluationReqDto
=
evaluationAdapter
.
convent2InsertOrderEvaluationReqDto
(
request
,
order
);
InsertOrderEvaluationReqDto
insertOrderEvaluationReqDto
=
evaluationAdapter
.
convent2InsertOrderEvaluationReqDto
(
request
,
order
);
// fisherman 有评价有礼数据 就设置到对象中
// fisherman 有评价有礼数据 就设置到对象中
orderEvaluationStatus
.
setResult
(
getCheckAndJoinMsg
(
orderDetailResponse
.
getData
(),
request
,
null
));
orderEvaluationStatus
.
setResult
(
getCheckAndJoinMsg
(
orderDetailResponse
.
getData
(),
request
.
getSessionId
(),
request
.
getOrderId
()
,
null
));
assortmentEvaluationManager
.
insertOrderEvaluationDetails
(
insertOrderEvaluationReqDto
);
assortmentEvaluationManager
.
insertOrderEvaluationDetails
(
insertOrderEvaluationReqDto
);
// 添加订单下的商品评价信息
// 添加订单下的商品评价信息
List
<
AddProductEvaluationReqDto
>
addProductEvaluationList
=
request
.
getProductEvaluationList
();
List
<
AddProductEvaluationReqDto
>
addProductEvaluationList
=
request
.
getProductEvaluationList
();
...
@@ -108,11 +109,16 @@ public class EvaluationServiceImpl implements EvaluationService {
...
@@ -108,11 +109,16 @@ public class EvaluationServiceImpl implements EvaluationService {
* 获取活动数据 用于校验
* 获取活动数据 用于校验
*
*
* @param data
* @param data
* @param request
* @param sessionId
* @param orderId
* @param activityId
* @param activityId
* @return
*/
*/
private
CheckAndJoinResponse
getCheckAndJoinMsg
(
QueryOrdersResponse
.
DataBean
.
OrderBean
data
,
AddUserOrderEvaluationNewRequestVo
request
,
String
activityId
)
{
private
CheckAndJoinResponse
getCheckAndJoinMsg
(
QueryOrdersResponse
.
DataBean
.
OrderBean
data
,
CheckAndJoinRequest
requestCommon
=
getCheckAndJoinRequest
(
data
,
request
,
activityId
);
String
sessionId
,
String
orderId
,
String
activityId
)
{
CheckAndJoinRequest
requestCommon
=
getCheckAndJoinRequest
(
data
,
sessionId
,
orderId
,
activityId
);
BaseResponse
<
CheckAndJoinResponse
>
checkAndJoin
=
activityApplicationClient
.
checkAndJoin
(
requestCommon
);
BaseResponse
<
CheckAndJoinResponse
>
checkAndJoin
=
activityApplicationClient
.
checkAndJoin
(
requestCommon
);
if
(
checkAndJoin
!=
null
if
(
checkAndJoin
!=
null
&&
checkAndJoin
.
getCode
().
equals
(
ResponseResult
.
SUCCESS
.
getCode
()))
{
&&
checkAndJoin
.
getCode
().
equals
(
ResponseResult
.
SUCCESS
.
getCode
()))
{
...
@@ -122,11 +128,12 @@ public class EvaluationServiceImpl implements EvaluationService {
...
@@ -122,11 +128,12 @@ public class EvaluationServiceImpl implements EvaluationService {
}
}
private
CheckAndJoinRequest
getCheckAndJoinRequest
(
QueryOrdersResponse
.
DataBean
.
OrderBean
data
,
private
CheckAndJoinRequest
getCheckAndJoinRequest
(
QueryOrdersResponse
.
DataBean
.
OrderBean
data
,
AddUserOrderEvaluationNewRequestVo
request
,
String
sessionId
,
String
orderId
,
String
activityId
)
{
String
activityId
)
{
CheckAndJoinRequest
requestCommon
=
new
CheckAndJoinRequest
();
CheckAndJoinRequest
requestCommon
=
new
CheckAndJoinRequest
();
requestCommon
.
setOid
(
request
.
getOrderId
()
);
requestCommon
.
setOid
(
orderId
);
requestCommon
.
setSessionId
(
request
.
getSessionId
()
);
requestCommon
.
setSessionId
(
sessionId
);
requestCommon
.
setStoreId
(
data
.
getShopId
());
requestCommon
.
setStoreId
(
data
.
getShopId
());
requestCommon
.
setOrderCreateTime
(
DateUtil
.
convert2Str
(
new
Date
(
data
.
getGmtCreate
()),
DateUtil
.
FORMAT_YYYY_MM_DD_HHMMSS
));
requestCommon
.
setOrderCreateTime
(
DateUtil
.
convert2Str
(
new
Date
(
data
.
getGmtCreate
()),
DateUtil
.
FORMAT_YYYY_MM_DD_HHMMSS
));
requestCommon
.
setActivityId
(
activityId
);
requestCommon
.
setActivityId
(
activityId
);
...
@@ -196,11 +203,24 @@ public class EvaluationServiceImpl implements EvaluationService {
...
@@ -196,11 +203,24 @@ public class EvaluationServiceImpl implements EvaluationService {
if
(
StringUtils
.
isEmpty
(
request
.
getOrderId
()))
{
if
(
StringUtils
.
isEmpty
(
request
.
getOrderId
()))
{
return
ResponseUtil
.
success
(
new
OrderEvaluationStatus
(
2
));
return
ResponseUtil
.
success
(
new
OrderEvaluationStatus
(
2
));
}
}
BaseQueryOrderRequest
baseQueryOrderRequest
=
new
BaseQueryOrderRequest
();
baseQueryOrderRequest
.
setOrderId
(
request
.
getOrderId
());
OrderDetailResponse
orderDetailResponse
=
orderCenterSdkService
.
getByIdForParentProduct
(
baseQueryOrderRequest
);
if
(
orderDetailResponse
==
null
||
!
ResponseResult
.
SUCCESS
.
getCode
().
equals
(
orderDetailResponse
.
getErrcode
()
+
""
)
||
orderDetailResponse
.
getData
()
==
null
)
{
throw
new
ServiceException
(
ResponseResult
.
ORDER_NOT_EXIST
);
}
OrderEvaluationStatus
orderEvaluationStatus
=
new
OrderEvaluationStatus
(
1
);
List
<
AssortmentOrderEvaluation
>
orderEvaluationListAmount
=
assortmentEvaluationManager
.
getOrderEvaluationDetailsByOrderId
(
request
.
getOrderId
());
List
<
AssortmentOrderEvaluation
>
orderEvaluationListAmount
=
assortmentEvaluationManager
.
getOrderEvaluationDetailsByOrderId
(
request
.
getOrderId
());
if
(
orderEvaluationListAmount
!=
null
&&
orderEvaluationListAmount
.
size
()
>
0
)
{
if
(
orderEvaluationListAmount
!=
null
&&
orderEvaluationListAmount
.
size
()
>
0
)
{
return
ResponseUtil
.
success
(
new
OrderEvaluationStatus
(
1
));
// 获取 评价有礼活动
AssortmentOrderEvaluation
assortmentOrderEvaluation
=
orderEvaluationListAmount
.
get
(
0
);
CheckAndJoinResponse
checkAndJoinMsg
=
getCheckAndJoinMsg
(
orderDetailResponse
.
getData
(),
request
.
getSessionId
(),
assortmentOrderEvaluation
.
getOrderId
(),
assortmentOrderEvaluation
.
getActivityId
());
orderEvaluationStatus
.
setResult
(
checkAndJoinMsg
);
}
else
{
}
else
{
return
ResponseUtil
.
success
(
new
OrderEvaluationStatus
(
2
)
);
orderEvaluationStatus
.
setStatus
(
2
);
}
}
return
ResponseUtil
.
success
(
orderEvaluationStatus
);
}
}
}
}
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