Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
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
pseer
gxpt_ht
Commits
b55b3015
Commit
b55b3015
authored
Aug 09, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'refs/heads/dev' into test
parents
32e0b52a
5582a7e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
8 deletions
+54
-8
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+54
-8
No files found.
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
b55b3015
...
...
@@ -980,7 +980,14 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
map
.
put
(
"orderNo"
,
sOrder
.
getOrderNo
());
map
.
put
(
"expirationTime"
,
sOrder
.
getEndDate
().
toString
());
JSONObject
jsonObject
=
new
JSONObject
(
map
);
redisUtil
.
set
(
ReceiptRdeisEnum
.
ORDER_NO_KEY
.
getValue
()
+
sOrder
.
getOrderNo
(),
jsonObject
.
toString
());
new
Thread
(()
->
{
try
{
Thread
.
sleep
(
1000
);
redisUtil
.
set
(
ReceiptRdeisEnum
.
ORDER_NO_KEY
.
getValue
()
+
sOrder
.
getOrderNo
(),
jsonObject
.
toString
());
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
}).
start
();
unLockOrder
(
request
.
getRoomId
());
}
if
(
response
.
getStatus
().
equals
(
YesNoEnum
.
yes
.
getFlag
()))
{
...
...
@@ -998,7 +1005,14 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
map
.
put
(
"expirationTime"
,
sOrder
.
getPreStartDate
().
toString
());
JSONObject
jsonObject
=
new
JSONObject
(
map
);
if
(
sOrder
.
getOrderType
().
equals
(
OrderTypeEnum
.
RESERVER
.
getCode
()))
{
redisUtil
.
set
(
ReceiptRdeisEnum
.
ORDER_NO
.
getValue
()
+
sOrder
.
getOrderNo
(),
jsonObject
.
toString
());
new
Thread
(()
->
{
try
{
Thread
.
sleep
(
1000
);
redisUtil
.
set
(
ReceiptRdeisEnum
.
ORDER_NO
.
getValue
()
+
sOrder
.
getOrderNo
(),
jsonObject
.
toString
());
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
}).
start
();
unLockOrder
(
request
.
getRoomId
());
}
// 订单预定成功, 发送短信通知运维客服
...
...
@@ -1883,13 +1897,27 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
map
.
put
(
"orderNo"
,
sOrder
.
getOrderNo
());
map
.
put
(
"expirationTime"
,
sOrder
.
getEndDate
().
toString
());
JSONObject
jsonObject
=
new
JSONObject
(
map
);
redisUtil
.
set
(
ReceiptRdeisEnum
.
ORDER_NO_KEY
.
getValue
()
+
sOrder
.
getOrderNo
(),
jsonObject
.
toString
());
new
Thread
(()
->
{
try
{
Thread
.
sleep
(
1000
);
redisUtil
.
set
(
ReceiptRdeisEnum
.
ORDER_NO_KEY
.
getValue
()
+
sOrder
.
getOrderNo
(),
jsonObject
.
toString
());
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
}).
start
();
}
else
if
(
sOrder
.
getOrderType
().
equals
(
OrderTypeEnum
.
RESERVER
.
getCode
()))
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"orderNo"
,
sOrder
.
getOrderNo
());
map
.
put
(
"expirationTime"
,
sOrder
.
getPreStartDate
().
toString
());
JSONObject
jsonObject
=
new
JSONObject
(
map
);
redisUtil
.
set
(
ReceiptRdeisEnum
.
ORDER_NO
.
getValue
()
+
sOrder
.
getOrderNo
(),
jsonObject
.
toString
());
new
Thread
(()
->
{
try
{
Thread
.
sleep
(
1000
);
redisUtil
.
set
(
ReceiptRdeisEnum
.
ORDER_NO
.
getValue
()
+
sOrder
.
getOrderNo
(),
jsonObject
.
toString
());
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
}).
start
();
}
Long
couponId
=
sOrder
.
getCouponId
();
SStore
sStore
=
storeService
.
getById
(
sOrder
.
getStoreId
());
...
...
@@ -2231,13 +2259,20 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
sOrder
.
setEndDate
(
sOrder
.
getPreEndDate
());
}
}
sOrder
.
setArrivalTime
(
new
Date
());
baseMapper
.
updateById
(
sOrder
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"orderNo"
,
sOrder
.
getOrderNo
());
map
.
put
(
"expirationTime"
,
sOrder
.
getEndDate
().
toString
());
JSONObject
jsonObject
=
new
JSONObject
(
map
);
redisUtil
.
set
(
ReceiptRdeisEnum
.
ORDER_NO_KEY
.
getValue
()
+
sOrder
.
getOrderNo
(),
jsonObject
.
toString
());
sOrder
.
setArrivalTime
(
new
Date
());
baseMapper
.
updateById
(
sOrder
);
new
Thread
(()
->
{
try
{
Thread
.
sleep
(
1000
);
redisUtil
.
set
(
ReceiptRdeisEnum
.
ORDER_NO_KEY
.
getValue
()
+
sOrder
.
getOrderNo
(),
jsonObject
.
toString
());
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
}).
start
();
//更改房间状态
SRoom
sRoom
=
new
SRoom
();
sRoom
.
setId
(
sOrder
.
getRoomId
());
...
...
@@ -2341,6 +2376,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
queryWrapper
.
eq
(
Activity:
:
getLabelId
,
roomLabel
.
getLabelId
());
activity
=
activityService
.
getOne
(
queryWrapper
);
totalFee
=
getBigDecimal
(
request
,
activity
,
payPrice
,
user
,
consumerMember
);
priceResponse
.
setTotalFeeNow
(
totalFee
);
priceResponse
.
setMemberDiscount
(
payPrice
.
subtract
(
totalFee
));
// priceResponse.setTotalFeeNow(totalFee);
priceResponse
.
setDiscount
(
totalFee
.
divide
(
payPrice
,
2
,
RoundingMode
.
HALF_UP
).
multiply
(
new
BigDecimal
(
100
)));
totalFee
=
getBigDecimal
(
consumerWallet
,
activity
,
timeLong
,
priceResponse
,
totalFee
,
room
,
request
,
consumerMember
);
...
...
@@ -2370,7 +2407,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
queryWrapper
.
eq
(
Activity:
:
getLabelId
,
roomLabel
.
getLabelId
());
activity
=
activityService
.
getOne
(
queryWrapper
);
totalFee
=
getBigDecimal
(
request
,
activity
,
payPrice
,
user
,
consumerMember
);
// priceResponse.setTotalFeeNow(totalFee);
priceResponse
.
setTotalFeeNow
(
totalFee
);
priceResponse
.
setMemberDiscount
(
payPrice
.
subtract
(
totalFee
));
priceResponse
.
setDiscount
(
totalFee
.
divide
(
payPrice
,
2
,
RoundingMode
.
HALF_UP
).
multiply
(
new
BigDecimal
(
100
)));
totalFee
=
getBigDecimal
(
consumerWallet
,
activity
,
timeLong
,
priceResponse
,
totalFee
,
room
,
request
,
consumerMember
);
}
...
...
@@ -2564,10 +2602,14 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
boolean
match1
=
executionTime
.
isMatch
(
ZonedDateTime
.
ofInstant
(
request
.
getPreEndDate
().
toInstant
(),
ZoneId
.
systemDefault
()));
if
(
match
&&
match1
)
{
if
(
consumerWallet
.
getBalance
().
compareTo
(
totalFee
)
>=
0
)
{
priceResponse
.
setTotalFeeNow
(
totalFee
);
priceResponse
.
setMemberDiscount
(
totalFee
);
priceResponse
.
setBalance
(
totalFee
);
priceResponse
.
setRemainingBalance
(
consumerWallet
.
getBalance
().
subtract
(
totalFee
));
totalFee
=
new
BigDecimal
(
0
);
}
else
if
(
consumerWallet
.
getBalance
().
compareTo
(
totalFee
)
<
0
)
{
priceResponse
.
setTotalFeeNow
(
totalFee
);
priceResponse
.
setMemberDiscount
(
totalFee
);
priceResponse
.
setBalance
(
consumerWallet
.
getBalance
());
priceResponse
.
setRemainingBalance
(
new
BigDecimal
(
0
));
totalFee
=
totalFee
.
subtract
(
consumerWallet
.
getBalance
());
...
...
@@ -2578,6 +2620,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
priceResponse
.
setRemainingDuration
(
consumerWallet
.
getRemainingDuration
().
subtract
(
timeLong
));
totalFee
=
new
BigDecimal
(
0
);
}
else
if
(
consumerWallet
.
getRemainingDuration
().
compareTo
(
timeLong
)
<
0
)
{
priceResponse
.
setMemberDiscount
(
priceResponse
.
getTotalFeeNow
().
subtract
(
totalFee
));
priceResponse
.
setTotalFeeNow
(
totalFee
);
if
(
consumerWallet
.
getBalance
().
compareTo
(
priceResponse
.
getTotalFeeNow
())
>=
0
)
{
priceResponse
.
setBalance
(
priceResponse
.
getTotalFeeNow
());
priceResponse
.
setRemainingBalance
(
consumerWallet
.
getBalance
().
subtract
(
priceResponse
.
getTotalFeeNow
()));
...
...
@@ -2595,6 +2639,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
priceResponse
.
setRemainingDuration
(
consumerWallet
.
getRemainingDuration
().
subtract
(
timeLong
));
totalFee
=
new
BigDecimal
(
0
);
}
else
if
(
consumerWallet
.
getRemainingDuration
().
compareTo
(
timeLong
)
<
0
)
{
priceResponse
.
setMemberDiscount
(
priceResponse
.
getTotalFeeNow
().
subtract
(
totalFee
));
priceResponse
.
setTotalFeeNow
(
totalFee
);
if
(
consumerWallet
.
getBalance
().
compareTo
(
priceResponse
.
getTotalFeeNow
())
>=
0
)
{
priceResponse
.
setBalance
(
priceResponse
.
getTotalFeeNow
());
priceResponse
.
setRemainingBalance
(
consumerWallet
.
getBalance
().
subtract
(
priceResponse
.
getTotalFeeNow
()));
...
...
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