Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
O
on-site-service
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
external
on-site-service
Commits
9a9165e8
Commit
9a9165e8
authored
Jul 28, 2022
by
lining
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 接口幂等处理
parent
148e5e17
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
ServiceOrderController.java
...ervice/admin/controller/order/ServiceOrderController.java
+7
-0
BizCodeEnum.java
...in/java/com/onsiteservice/constant/enums/BizCodeEnum.java
+7
-7
No files found.
admin/src/main/java/com/onsiteservice/admin/controller/order/ServiceOrderController.java
View file @
9a9165e8
...
...
@@ -5,6 +5,7 @@ import com.onsiteservice.admin.controller.order.vo.OrderDetailVO;
import
com.onsiteservice.admin.controller.order.vo.OrderPageVO
;
import
com.onsiteservice.admin.service.order.AdminOrderService
;
import
com.onsiteservice.common.annotation.dict.Dict
;
import
com.onsiteservice.common.annotation.idempotent.ApiIdempotent
;
import
com.onsiteservice.common.annotation.user.CurrentUserId
;
import
com.onsiteservice.common.order.dto.DispatchServiceOrderDTO
;
import
com.onsiteservice.common.order.dto.FinishServiceOrderDTO
;
...
...
@@ -60,12 +61,14 @@ public class ServiceOrderController {
}
@ApiOperation
(
value
=
"订单估价"
)
@ApiIdempotent
(
interval
=
6000L
)
@PostMapping
(
"valuation"
)
public
Result
valuation
(
@RequestBody
@NonNull
@Validated
ValuationServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderService
.
valuation
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
WEB
)
==
1
?
success
()
:
fail
(
"估价失败"
);
}
@ApiOperation
(
value
=
"修改估价"
)
@ApiIdempotent
(
interval
=
60000L
)
@PostMapping
(
"revaluation"
)
public
Result
revaluation
(
@RequestBody
@NonNull
@Validated
ValuationServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderService
.
revaluation
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
WEB
)
==
1
?
success
()
:
fail
(
"修改估价失败"
);
...
...
@@ -75,18 +78,21 @@ public class ServiceOrderController {
* 发送订单
*/
@ApiOperation
(
value
=
"发送订单"
)
@ApiIdempotent
(
interval
=
6000L
)
@PostMapping
(
"send"
)
public
Result
sendPrice
(
@RequestBody
@NonNull
@Validated
SendServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderService
.
sendOrder
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
WEB
)
==
1
?
success
()
:
fail
(
"发送失败"
);
}
@ApiOperation
(
value
=
"派单"
)
@ApiIdempotent
(
interval
=
6000L
)
@PostMapping
(
"dispatch"
)
public
Result
dispatch
(
@RequestBody
@NonNull
@Validated
DispatchServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderService
.
dispatch
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
WEB
)
==
1
?
success
()
:
fail
(
"派单失败"
);
}
@ApiOperation
(
value
=
"修改派单"
)
@ApiIdempotent
(
interval
=
60000L
)
@PostMapping
(
"redispatch"
)
public
Result
redispatch
(
@RequestBody
@NonNull
@Validated
DispatchServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderService
.
redispatch
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
WEB
)
==
1
?
success
()
:
fail
(
"修改派单失败"
);
...
...
@@ -97,6 +103,7 @@ public class ServiceOrderController {
*/
@ApiOperation
(
value
=
"完成订单"
)
@PostMapping
(
"finish"
)
@ApiIdempotent
(
interval
=
6000L
)
public
Result
finish
(
@RequestBody
@NonNull
@Validated
FinishServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderService
.
finishOrder
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
WEB
)
==
1
?
success
()
:
fail
(
"取消失败"
);
}
...
...
constant/src/main/java/com/onsiteservice/constant/enums/BizCodeEnum.java
View file @
9a9165e8
...
...
@@ -22,16 +22,16 @@ public enum BizCodeEnum {
* 订单分组
*/
SERVICE_ORDER_NOT_EXIST
(
"订单不存在"
),
SERVICE_ORDER_CANNOT_VALUATION
(
"
处于非预约状态的
订单不能派估价员"
),
SERVICE_ORDER_CANNOT_REVALUATION
(
"订单未
指派估价员
,不能修改"
),
SERVICE_ORDER_CANNOT_SEND
(
"订单未受理,不能发送
给客户
"
),
SERVICE_ORDER_CANNOT_VALUATION
(
"订单不能派估价员"
),
SERVICE_ORDER_CANNOT_REVALUATION
(
"订单未
估价
,不能修改"
),
SERVICE_ORDER_CANNOT_SEND
(
"订单未受理,不能发送
或已发送
"
),
SERVICE_ORDER_CANNOT_PAY
(
"订单未受理,暂不能支付"
),
SERVICE_ORDER_CANNOT_CANCEL
(
"订单不能取消"
),
SERVICE_ORDER_CANNOT_REFUND
(
"订单不能申请退款"
),
SERVICE_ORDER_CANNOT_DISPATCH
(
"订单未支付,不能派
维修
工"
),
SERVICE_ORDER_CANNOT_REDISPATCH
(
"订单未
指派维修
工,不能修改"
),
SERVICE_ORDER_TIMEOUT_CANNOT_DISPATCH
(
"已过
上门
维修时间,不能派维修工"
),
SERVICE_ORDER_CANNOT_FINISH
(
"订单未派单,不能完成
本次服务
"
),
SERVICE_ORDER_CANNOT_DISPATCH
(
"订单未支付,不能派
工或已派
工"
),
SERVICE_ORDER_CANNOT_REDISPATCH
(
"订单未
派
工,不能修改"
),
SERVICE_ORDER_TIMEOUT_CANNOT_DISPATCH
(
"已过维修时间,不能派维修工"
),
SERVICE_ORDER_CANNOT_FINISH
(
"订单未派单,不能完成
服务或已完成
"
),
SERVICE_ORDER_STATUS_ERROR
(
"请选择正确的订单状态"
),
...
...
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