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
a2a46aaa
Commit
a2a46aaa
authored
Jul 29, 2022
by
lining
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 接口幂等处理
parent
56cbc670
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
ServiceOrderController.java
...ervice/admin/controller/order/ServiceOrderController.java
+0
-6
ServiceOrderController.java
...vice/miniapp/controller/order/ServiceOrderController.java
+8
-0
No files found.
admin/src/main/java/com/onsiteservice/admin/controller/order/ServiceOrderController.java
View file @
a2a46aaa
...
@@ -61,14 +61,12 @@ public class ServiceOrderController {
...
@@ -61,14 +61,12 @@ public class ServiceOrderController {
}
}
@ApiOperation
(
value
=
"订单估价"
)
@ApiOperation
(
value
=
"订单估价"
)
@ApiIdempotent
(
interval
=
6000L
)
@PostMapping
(
"valuation"
)
@PostMapping
(
"valuation"
)
public
Result
valuation
(
@RequestBody
@NonNull
@Validated
ValuationServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
public
Result
valuation
(
@RequestBody
@NonNull
@Validated
ValuationServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderService
.
valuation
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
WEB
)
==
1
?
success
()
:
fail
(
"估价失败"
);
return
serviceOrderService
.
valuation
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
WEB
)
==
1
?
success
()
:
fail
(
"估价失败"
);
}
}
@ApiOperation
(
value
=
"修改估价"
)
@ApiOperation
(
value
=
"修改估价"
)
@ApiIdempotent
(
interval
=
60000L
)
@PostMapping
(
"revaluation"
)
@PostMapping
(
"revaluation"
)
public
Result
revaluation
(
@RequestBody
@NonNull
@Validated
ValuationServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
public
Result
revaluation
(
@RequestBody
@NonNull
@Validated
ValuationServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderService
.
revaluation
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
WEB
)
==
1
?
success
()
:
fail
(
"修改估价失败"
);
return
serviceOrderService
.
revaluation
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
WEB
)
==
1
?
success
()
:
fail
(
"修改估价失败"
);
...
@@ -78,21 +76,18 @@ public class ServiceOrderController {
...
@@ -78,21 +76,18 @@ public class ServiceOrderController {
* 发送订单
* 发送订单
*/
*/
@ApiOperation
(
value
=
"发送订单"
)
@ApiOperation
(
value
=
"发送订单"
)
@ApiIdempotent
(
interval
=
6000L
)
@PostMapping
(
"send"
)
@PostMapping
(
"send"
)
public
Result
sendPrice
(
@RequestBody
@NonNull
@Validated
SendServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
public
Result
sendPrice
(
@RequestBody
@NonNull
@Validated
SendServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderService
.
sendOrder
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
WEB
)
==
1
?
success
()
:
fail
(
"发送失败"
);
return
serviceOrderService
.
sendOrder
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
WEB
)
==
1
?
success
()
:
fail
(
"发送失败"
);
}
}
@ApiOperation
(
value
=
"派单"
)
@ApiOperation
(
value
=
"派单"
)
@ApiIdempotent
(
interval
=
6000L
)
@PostMapping
(
"dispatch"
)
@PostMapping
(
"dispatch"
)
public
Result
dispatch
(
@RequestBody
@NonNull
@Validated
DispatchServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
public
Result
dispatch
(
@RequestBody
@NonNull
@Validated
DispatchServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderService
.
dispatch
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
WEB
)
==
1
?
success
()
:
fail
(
"派单失败"
);
return
serviceOrderService
.
dispatch
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
WEB
)
==
1
?
success
()
:
fail
(
"派单失败"
);
}
}
@ApiOperation
(
value
=
"修改派单"
)
@ApiOperation
(
value
=
"修改派单"
)
@ApiIdempotent
(
interval
=
60000L
)
@PostMapping
(
"redispatch"
)
@PostMapping
(
"redispatch"
)
public
Result
redispatch
(
@RequestBody
@NonNull
@Validated
DispatchServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
public
Result
redispatch
(
@RequestBody
@NonNull
@Validated
DispatchServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderService
.
redispatch
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
WEB
)
==
1
?
success
()
:
fail
(
"修改派单失败"
);
return
serviceOrderService
.
redispatch
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
WEB
)
==
1
?
success
()
:
fail
(
"修改派单失败"
);
...
@@ -103,7 +98,6 @@ public class ServiceOrderController {
...
@@ -103,7 +98,6 @@ public class ServiceOrderController {
*/
*/
@ApiOperation
(
value
=
"完成订单"
)
@ApiOperation
(
value
=
"完成订单"
)
@PostMapping
(
"finish"
)
@PostMapping
(
"finish"
)
@ApiIdempotent
(
interval
=
6000L
)
public
Result
finish
(
@RequestBody
@NonNull
@Validated
FinishServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
public
Result
finish
(
@RequestBody
@NonNull
@Validated
FinishServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderService
.
finishOrder
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
WEB
)
==
1
?
success
()
:
fail
(
"取消失败"
);
return
serviceOrderService
.
finishOrder
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
WEB
)
==
1
?
success
()
:
fail
(
"取消失败"
);
}
}
...
...
mini-app/src/main/java/com/onsiteservice/miniapp/controller/order/ServiceOrderController.java
View file @
a2a46aaa
package
com
.
onsiteservice
.
miniapp
.
controller
.
order
;
package
com
.
onsiteservice
.
miniapp
.
controller
.
order
;
import
com.onsiteservice.common.annotation.dict.Dict
;
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.annotation.user.CurrentUserId
;
import
com.onsiteservice.common.order.dto.DispatchServiceOrderDTO
;
import
com.onsiteservice.common.order.dto.DispatchServiceOrderDTO
;
import
com.onsiteservice.common.order.dto.FinishServiceOrderDTO
;
import
com.onsiteservice.common.order.dto.FinishServiceOrderDTO
;
...
@@ -81,12 +82,14 @@ public class ServiceOrderController {
...
@@ -81,12 +82,14 @@ public class ServiceOrderController {
}
}
@ApiOperation
(
value
=
"订单估价"
)
@ApiOperation
(
value
=
"订单估价"
)
@ApiIdempotent
(
interval
=
3000L
)
@PostMapping
(
"valuation"
)
@PostMapping
(
"valuation"
)
public
Result
valuation
(
@RequestBody
@NonNull
@Validated
ValuationServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
public
Result
valuation
(
@RequestBody
@NonNull
@Validated
ValuationServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderService
.
valuation
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
MINI_APP
)
==
1
?
success
()
:
fail
(
"估价失败"
);
return
serviceOrderService
.
valuation
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
MINI_APP
)
==
1
?
success
()
:
fail
(
"估价失败"
);
}
}
@ApiOperation
(
value
=
"修改估价"
)
@ApiOperation
(
value
=
"修改估价"
)
@ApiIdempotent
(
interval
=
30000L
)
@PostMapping
(
"revaluation"
)
@PostMapping
(
"revaluation"
)
public
Result
revaluation
(
@RequestBody
@NonNull
@Validated
ValuationServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
public
Result
revaluation
(
@RequestBody
@NonNull
@Validated
ValuationServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderService
.
revaluation
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
MINI_APP
)
==
1
?
success
()
:
fail
(
"修改估价失败"
);
return
serviceOrderService
.
revaluation
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
MINI_APP
)
==
1
?
success
()
:
fail
(
"修改估价失败"
);
...
@@ -96,6 +99,7 @@ public class ServiceOrderController {
...
@@ -96,6 +99,7 @@ public class ServiceOrderController {
* 发送订单 已估价订单才能发送 <link>ServiceOrderStatusEnum</link>
* 发送订单 已估价订单才能发送 <link>ServiceOrderStatusEnum</link>
*/
*/
@ApiOperation
(
value
=
"发送订单"
)
@ApiOperation
(
value
=
"发送订单"
)
@ApiIdempotent
(
interval
=
3000L
)
@PostMapping
(
"send"
)
@PostMapping
(
"send"
)
public
Result
valuation
(
@RequestBody
@NonNull
@Validated
SendServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
public
Result
valuation
(
@RequestBody
@NonNull
@Validated
SendServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderService
.
sendOrder
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
MINI_APP
)
==
1
?
success
()
:
fail
(
"发送失败"
);
return
serviceOrderService
.
sendOrder
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
MINI_APP
)
==
1
?
success
()
:
fail
(
"发送失败"
);
...
@@ -103,12 +107,14 @@ public class ServiceOrderController {
...
@@ -103,12 +107,14 @@ public class ServiceOrderController {
@ApiOperation
(
value
=
"派单"
)
@ApiOperation
(
value
=
"派单"
)
@ApiIdempotent
(
interval
=
3000L
)
@PostMapping
(
"dispatch"
)
@PostMapping
(
"dispatch"
)
public
Result
dispatch
(
@RequestBody
@NonNull
@Validated
DispatchServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
public
Result
dispatch
(
@RequestBody
@NonNull
@Validated
DispatchServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderService
.
dispatch
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
MINI_APP
)
==
1
?
success
()
:
fail
(
"派单失败"
);
return
serviceOrderService
.
dispatch
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
MINI_APP
)
==
1
?
success
()
:
fail
(
"派单失败"
);
}
}
@ApiOperation
(
value
=
"修改派单"
)
@ApiOperation
(
value
=
"修改派单"
)
@ApiIdempotent
(
interval
=
30000L
)
@PostMapping
(
"redispatch"
)
@PostMapping
(
"redispatch"
)
public
Result
redispatch
(
@RequestBody
@NonNull
@Validated
DispatchServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
public
Result
redispatch
(
@RequestBody
@NonNull
@Validated
DispatchServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderService
.
redispatch
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
MINI_APP
)
==
1
?
success
()
:
fail
(
"修改派单失败"
);
return
serviceOrderService
.
redispatch
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
MINI_APP
)
==
1
?
success
()
:
fail
(
"修改派单失败"
);
...
@@ -118,6 +124,7 @@ public class ServiceOrderController {
...
@@ -118,6 +124,7 @@ public class ServiceOrderController {
* 未派单之前不能完成,已申请退款的也可以点击完成
* 未派单之前不能完成,已申请退款的也可以点击完成
*/
*/
@ApiOperation
(
value
=
"完成订单"
)
@ApiOperation
(
value
=
"完成订单"
)
@ApiIdempotent
(
interval
=
3000L
)
@PostMapping
(
"finish"
)
@PostMapping
(
"finish"
)
public
Result
finish
(
@RequestBody
@NonNull
@Validated
FinishServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
public
Result
finish
(
@RequestBody
@NonNull
@Validated
FinishServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderService
.
finishOrder
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
MINI_APP
)
==
1
?
success
()
:
fail
(
"取消失败"
);
return
serviceOrderService
.
finishOrder
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
MINI_APP
)
==
1
?
success
()
:
fail
(
"取消失败"
);
...
@@ -137,6 +144,7 @@ public class ServiceOrderController {
...
@@ -137,6 +144,7 @@ public class ServiceOrderController {
*/
*/
@ApiOperation
(
value
=
"取消订单"
)
@ApiOperation
(
value
=
"取消订单"
)
@PostMapping
(
"cancel"
)
@PostMapping
(
"cancel"
)
@ApiIdempotent
(
interval
=
3000L
)
public
Result
cancel
(
@RequestBody
@NonNull
@Validated
CancelServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
public
Result
cancel
(
@RequestBody
@NonNull
@Validated
CancelServiceOrderDTO
dto
,
@CurrentUserId
Long
userId
)
{
return
serviceOrderBizService
.
cancelOrder
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
MINI_APP
)
==
1
?
success
()
:
fail
(
"取消失败"
);
return
serviceOrderBizService
.
cancelOrder
(
dto
,
userId
,
ServiceOrderOpSourceEnum
.
MINI_APP
)
==
1
?
success
()
:
fail
(
"取消失败"
);
}
}
...
...
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