Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gogirl-miniapp-backend
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huluobin
gogirl-miniapp-backend
Commits
48e2ecfa
Commit
48e2ecfa
authored
Jul 01, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
死锁
parent
1494fb28
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
ScheduleManageController.java
...girl/interfaces/order/serve/ScheduleManageController.java
+11
-4
No files found.
src/main/java/com/gogirl/interfaces/order/serve/ScheduleManageController.java
View file @
48e2ecfa
...
...
@@ -5,12 +5,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.gogirl.application.market.discount.IVipServeService
;
import
com.gogirl.application.order.serve.ScheduleManageService
;
import
com.gogirl.application.order.serve.ScheduleServeService
;
import
com.gogirl.application.user.customer.CustomerBalanceService
;
import
com.gogirl.application.xcx.GogirlTokenService
;
import
com.gogirl.assembler.PurchaseSkuDTOAssembler
;
import
com.gogirl.assembler.ScheduleManageDTOAssembler
;
import
com.gogirl.domain.market.discount.VipServe
;
import
com.gogirl.domain.order.serve.ScheduleManage
;
import
com.gogirl.domain.order.serve.ScheduleServe
;
import
com.gogirl.domain.product.serve.BaseProduce
;
import
com.gogirl.domain.store.store.StoreTechnician
;
import
com.gogirl.domain.xcx.GogirlToken
;
...
...
@@ -21,7 +23,6 @@ import com.gogirl.infrastructure.mapper.product.purchase.PurchaseSkuMapper;
import
com.gogirl.infrastructure.mapper.product.serve.BaseProduceMapper
;
import
com.gogirl.infrastructure.util.SessionUtils
;
import
com.gogirl.infrastructure.util.lock.CustomerIdLock
;
import
com.gogirl.infrastructure.util.lock.ScheduleServeIdLock
;
import
com.gogirl.infrastructure.util.lock.ScheduledLock
;
import
com.gogirl.shared.order.*
;
import
com.gogirl.shared.product.LeisureScheduleServeQuery
;
...
...
@@ -50,6 +51,7 @@ import java.util.stream.Collectors;
@Slf4j
public
class
ScheduleManageController
{
private
final
ScheduleServeService
scheduleServeService
;
private
final
ScheduleManageService
scheduleManageService
;
private
final
GogirlTokenService
gogirlTokenService
;
private
final
CustomerBalanceService
customerBalanceService
;
...
...
@@ -246,12 +248,17 @@ public class ScheduleManageController {
@RequestParam
Integer
scheduleServeId
,
@RequestParam
Integer
status
,
@RequestParam
Integer
forceLeisureConfig
)
{
ScheduleServeIdLock
lock
=
ScheduleServeIdLock
.
getInstance
();
ScheduleServe
scheduleServe
=
scheduleServeService
.
getById
(
scheduleServeId
);
if
(
scheduleServe
.
getSchId
()
==
null
)
{
throw
new
InvalidParameterException
();
}
int
scheduleId
=
scheduleServe
.
getSchId
();
ScheduledLock
lock
=
ScheduledLock
.
getInstance
();
try
{
lock
.
lock
(
schedule
Serve
Id
);
lock
.
lock
(
scheduleId
);
scheduleManageService
.
updateScheduledServeStatus
(
scheduleServeId
,
status
,
forceLeisureConfig
);
}
finally
{
lock
.
unlock
(
schedule
Serve
Id
);
lock
.
unlock
(
scheduleId
);
}
return
JsonResult
.
success
();
}
...
...
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