Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
11601461
Commit
11601461
authored
Nov 20, 2020
by
wuwz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加订单判断是否评论
parent
f7b0c111
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
1 deletion
+39
-1
UserCommentBiz.java
...com/github/wxiaoqi/security/admin/biz/UserCommentBiz.java
+18
-1
BaseOrder.java
...c/main/java/com/xxfc/platform/order/entity/BaseOrder.java
+3
-0
OrderFeign.java
...c/main/java/com/xxfc/platform/order/feign/OrderFeign.java
+7
-0
BaseOrderController.java
...ava/com/xxfc/platform/order/rest/BaseOrderController.java
+11
-0
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/UserCommentBiz.java
View file @
11601461
...
@@ -14,6 +14,8 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
...
@@ -14,6 +14,8 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.order.entity.BaseOrder
;
import
com.xxfc.platform.order.feign.OrderFeign
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -26,7 +28,7 @@ import java.util.List;
...
@@ -26,7 +28,7 @@ import java.util.List;
@Service
@Service
@Slf4j
@Slf4j
public
class
UserCommentBiz
extends
BaseBiz
<
UserCommentMapper
,
UserComment
>{
public
class
UserCommentBiz
extends
BaseBiz
<
UserCommentMapper
,
UserComment
>{
private
OrderFeign
orderFeign
;
...
@@ -142,11 +144,23 @@ public class UserCommentBiz extends BaseBiz<UserCommentMapper, UserComment>{
...
@@ -142,11 +144,23 @@ public class UserCommentBiz extends BaseBiz<UserCommentMapper, UserComment>{
}
}
/**
/**
* 订单评论
* 处理维度
* 处理维度
* 总分
* 总分
* @param userComment
* @param userComment
*/
*/
public
void
saveComment
(
UserComment
userComment
){
public
void
saveComment
(
UserComment
userComment
){
String
no
=
userComment
.
getOrderNo
();
if
(
no
==
null
||
(
""
).
equals
(
no
)){
throw
new
BaseException
(
"订单号不能为空"
,
ResultCode
.
FAILED_CODE
);
}
BaseOrder
baseOrder
=
orderFeign
.
queryByNo
(
no
);
if
(
baseOrder
==
null
){
throw
new
BaseException
(
"订单错误"
,
ResultCode
.
FAILED_CODE
);
}
if
(
baseOrder
.
getIsAppraise
()
==
1
){
throw
new
BaseException
(
"订单已评价,不能重复评论"
,
ResultCode
.
FAILED_CODE
);
}
JSONArray
jsonArray
=
JSONArray
.
parseArray
(
userComment
.
getAppraiseJson
());
JSONArray
jsonArray
=
JSONArray
.
parseArray
(
userComment
.
getAppraiseJson
());
if
(
jsonArray
==
null
||
jsonArray
.
size
()
==
0
){
if
(
jsonArray
==
null
||
jsonArray
.
size
()
==
0
){
throw
new
BaseException
(
"评论维度不能为空"
,
ResultCode
.
FAILED_CODE
);
throw
new
BaseException
(
"评论维度不能为空"
,
ResultCode
.
FAILED_CODE
);
...
@@ -191,6 +205,9 @@ public class UserCommentBiz extends BaseBiz<UserCommentMapper, UserComment>{
...
@@ -191,6 +205,9 @@ public class UserCommentBiz extends BaseBiz<UserCommentMapper, UserComment>{
mapper
.
addreplyNum
(
rootParentId
);
mapper
.
addreplyNum
(
rootParentId
);
}
}
}
}
baseOrder
.
setIsAppraise
(
1
);
orderFeign
.
updateBaseOrder
(
baseOrder
);
}
}
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/BaseOrder.java
View file @
11601461
...
@@ -363,4 +363,7 @@ public class BaseOrder implements Serializable {
...
@@ -363,4 +363,7 @@ public class BaseOrder implements Serializable {
@Column
(
name
=
"order_sign"
)
@Column
(
name
=
"order_sign"
)
private
Integer
orderSign
;
private
Integer
orderSign
;
@Column
(
name
=
"is_appraise"
)
private
Integer
isAppraise
;
}
}
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/feign/OrderFeign.java
View file @
11601461
...
@@ -52,4 +52,11 @@ public interface OrderFeign {
...
@@ -52,4 +52,11 @@ public interface OrderFeign {
@PostMapping
(
value
=
"chw/orderPulishReceive/add"
)
@PostMapping
(
value
=
"chw/orderPulishReceive/add"
)
ObjectRestResponse
<
BaseOrder
>
add
(
@RequestBody
PulishReceiveBO
bo
);
ObjectRestResponse
<
BaseOrder
>
add
(
@RequestBody
PulishReceiveBO
bo
);
@GetMapping
(
value
=
"/baseOrder/queryByNo"
)
BaseOrder
queryByNo
(
@RequestParam
(
"no"
)
String
no
);
@PostMapping
(
value
=
"/baseOrder/updateBaseOrder"
)
BaseOrder
updateBaseOrder
(
@RequestBody
BaseOrder
baseOrder
);
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/BaseOrderController.java
View file @
11601461
...
@@ -523,4 +523,15 @@ public class BaseOrderController extends CommonBaseController implements UserRes
...
@@ -523,4 +523,15 @@ public class BaseOrderController extends CommonBaseController implements UserRes
return
baseOrderBiz
.
updateBaseOrder
(
baseOrder
);
return
baseOrderBiz
.
updateBaseOrder
(
baseOrder
);
}
}
@RequestMapping
(
value
=
"/queryByNo"
,
method
=
RequestMethod
.
GET
)
public
BaseOrder
queryByNo
(
@RequestParam
(
"no"
)
String
no
)
{
BaseOrder
baseOrder
=
new
BaseOrder
();
baseOrder
.
setNo
(
no
);
return
baseOrderBiz
.
selectOne
(
baseOrder
);
}
@RequestMapping
(
value
=
"/updateBaseOrder"
,
method
=
RequestMethod
.
POST
)
public
void
updateBaseOrder
(
@RequestBody
BaseOrder
baseOrder
)
{
baseOrderBiz
.
updateSelectiveById
(
baseOrder
);
}
}
}
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