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
c885468c
Commit
c885468c
authored
Jan 13, 2024
by
wuwenlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create order bugfix;
parent
9d57fc19
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
29 deletions
+36
-29
ISConsumptionRecordsService.java
...ava/share/system/service/ISConsumptionRecordsService.java
+8
-0
SConsumptionRecordsServiceImpl.java
...e/system/service/impl/SConsumptionRecordsServiceImpl.java
+16
-0
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+12
-29
No files found.
share-system/src/main/java/share/system/service/ISConsumptionRecordsService.java
View file @
c885468c
...
@@ -2,6 +2,7 @@ package share.system.service;
...
@@ -2,6 +2,7 @@ package share.system.service;
import
java.util.List
;
import
java.util.List
;
import
share.system.domain.SConsumptionRecords
;
import
share.system.domain.SConsumptionRecords
;
import
share.system.domain.SOrder
;
import
share.system.domain.vo.SConsumptionRecordsVo
;
import
share.system.domain.vo.SConsumptionRecordsVo
;
/**
/**
...
@@ -37,6 +38,13 @@ public interface ISConsumptionRecordsService
...
@@ -37,6 +38,13 @@ public interface ISConsumptionRecordsService
public
int
insertSConsumptionRecords
(
SConsumptionRecords
sConsumptionRecords
);
public
int
insertSConsumptionRecords
(
SConsumptionRecords
sConsumptionRecords
);
/**
/**
* 新增消费记录
*
* @param sOrder 消费记录
* @return 结果
*/
public
int
insertSConsumptionRecords
(
SOrder
sOrder
);
/**
* 修改消费记录
* 修改消费记录
*
*
* @param sConsumptionRecords 消费记录
* @param sConsumptionRecords 消费记录
...
...
share-system/src/main/java/share/system/service/impl/SConsumptionRecordsServiceImpl.java
View file @
c885468c
...
@@ -6,6 +6,9 @@ import java.util.stream.Collectors;
...
@@ -6,6 +6,9 @@ import java.util.stream.Collectors;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
share.common.enums.ConsumeNameEnum
;
import
share.common.enums.PayTypeEnum
;
import
share.common.enums.SignEnum
;
import
share.common.utils.DateUtils
;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -103,6 +106,19 @@ public class SConsumptionRecordsServiceImpl implements ISConsumptionRecordsServi
...
@@ -103,6 +106,19 @@ public class SConsumptionRecordsServiceImpl implements ISConsumptionRecordsServi
return
sConsumptionRecordsMapper
.
insertSConsumptionRecords
(
sConsumptionRecords
);
return
sConsumptionRecordsMapper
.
insertSConsumptionRecords
(
sConsumptionRecords
);
}
}
@Override
public
int
insertSConsumptionRecords
(
SOrder
sOrder
)
{
SConsumptionRecords
sConsumptionRecords
=
new
SConsumptionRecords
();
sConsumptionRecords
.
setConsumerId
(
sOrder
.
getConsumerId
());
sConsumptionRecords
.
setOrderId
(
sOrder
.
getId
());
sConsumptionRecords
.
setName
(
ConsumeNameEnum
.
CONSUME
.
getValue
());
sConsumptionRecords
.
setPrice
(
sOrder
.
getPayPrice
());
sConsumptionRecords
.
setPayType
(
PayTypeEnum
.
WECHAT
.
getName
());
sConsumptionRecords
.
setSign
(
SignEnum
.
BURDEN
.
getValue
());
sConsumptionRecords
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
sConsumptionRecordsMapper
.
insertSConsumptionRecords
(
sConsumptionRecords
);
}
/**
/**
* 修改消费记录
* 修改消费记录
*
*
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
c885468c
...
@@ -312,18 +312,19 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -312,18 +312,19 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
checkOrderDate
(
request
);
checkOrderDate
(
request
);
//校验订单套餐
//校验订单套餐
checkOrderPack
(
request
,
user
);
checkOrderPack
(
request
,
user
);
SConsumerCoupon
byId
=
null
;
if
(
Objects
.
nonNull
(
request
.
getCouponId
())
&&
request
.
getCouponId
()
!=
0
)
{
if
(
Objects
.
nonNull
(
request
.
getCouponId
())
&&
request
.
getCouponId
()
!=
0
)
{
SConsumerCoupon
byId
=
consumerCouponService
.
getById
(
request
.
getCouponId
());
byId
=
consumerCouponService
.
getById
(
request
.
getCouponId
());
if
(
Objects
.
nonNull
(
byId
))
{
if
(
Objects
.
nonNull
(
byId
))
{
if
(
byId
.
getUseStatus
().
equals
(
UserStatusEnum
.
UNUSED
.
getCode
()))
{
if
(
byId
.
getUseStatus
().
equals
(
UserStatusEnum
.
UNUSED
.
getCode
()))
{
if
(
StringUtils
.
isNotEmpty
(
byId
.
getCouponCode
()))
{
if
(
StringUtils
.
isNotEmpty
(
byId
.
getCouponCode
()))
{
qpService
.
prepare
(
byId
.
getCouponCode
(),
sStore
.
getOpenShopUuid
(),
ConsumerCouponStatusEnum
.
ORDER
.
getCode
());
qpService
.
prepare
(
byId
.
getCouponCode
(),
sStore
.
getOpenShopUuid
(),
ConsumerCouponStatusEnum
.
ORDER
.
getCode
());
}
}
}
else
{
}
else
{
throw
new
BaseException
(
"优惠券
不存在
!"
);
throw
new
BaseException
(
"优惠券
已使用
!"
);
}
}
}
else
{
}
else
{
throw
new
BaseException
(
"优惠券
已使用
!"
);
throw
new
BaseException
(
"优惠券
不存在
!"
);
}
}
}
}
OrderPayResultResponse
response
=
new
OrderPayResultResponse
();
OrderPayResultResponse
response
=
new
OrderPayResultResponse
();
...
@@ -342,36 +343,24 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -342,36 +343,24 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
}
save
(
sOrder
);
save
(
sOrder
);
if
(
response
.
getStatus
().
equals
(
YesNoEnum
.
yes
.
getFlag
()))
{
if
(
response
.
getStatus
().
equals
(
YesNoEnum
.
yes
.
getFlag
()))
{
if
(
Objects
.
nonNull
(
request
.
getCouponId
())
&&
request
.
getCouponId
()
!=
0
)
{
if
(
Objects
.
nonNull
(
byId
))
{
SConsumerCoupon
byId
=
consumerCouponService
.
getById
(
request
.
getCouponId
());
if
(
StringUtils
.
isNotEmpty
(
byId
.
getCouponCode
()))
{
if
(
StringUtils
.
isNotEmpty
(
byId
.
getCouponCode
()))
{
if
(
byId
.
getUseStatus
().
equals
(
UserStatusEnum
.
UNUSED
.
getCode
()))
{
//验劵
if
(
StringUtils
.
isNotEmpty
(
byId
.
getCouponCode
()))
{
qpService
.
consume
(
byId
.
getCouponCode
(),
1
,
sStore
.
getOpenShopUuid
(),
ConsumerCouponStatusEnum
.
ORDER
.
getCode
());
//验劵
qpService
.
consume
(
byId
.
getCouponCode
(),
1
,
sStore
.
getOpenShopUuid
(),
ConsumerCouponStatusEnum
.
ORDER
.
getCode
());
}
}
else
{
throw
new
BaseException
(
"优惠券已使用!"
);
}
}
}
SConsumerCoupon
consumerCoupon
=
new
SConsumerCoupon
();
SConsumerCoupon
consumerCoupon
=
new
SConsumerCoupon
();
consumerCoupon
.
setId
(
request
.
getCouponId
());
consumerCoupon
.
setId
(
request
.
getCouponId
());
consumerCoupon
.
setUseStatus
(
UserStatusEnum
.
USED
.
getCode
());
consumerCoupon
.
setUseStatus
(
UserStatusEnum
.
USED
.
getCode
());
consumerCouponService
.
updateById
(
consumerCoupon
);
consumerCouponService
.
updateById
(
consumerCoupon
);
}
}
SConsumptionRecords
sConsumptionRecords
=
new
SConsumptionRecords
();
sConsumptionRecordsService
.
insertSConsumptionRecords
(
sOrder
);
sConsumptionRecords
.
setConsumerId
(
sOrder
.
getConsumerId
());
sConsumptionRecords
.
setOrderId
(
sOrder
.
getId
());
sConsumptionRecords
.
setName
(
ConsumeNameEnum
.
CONSUME
.
getValue
());
sConsumptionRecords
.
setPrice
(
sOrder
.
getPayPrice
());
sConsumptionRecords
.
setPayType
(
PayTypeEnum
.
WECHAT
.
getName
());
sConsumptionRecords
.
setSign
(
SignEnum
.
BURDEN
.
getValue
());
sConsumptionRecordsService
.
insertSConsumptionRecords
(
sConsumptionRecords
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"orderNo"
,
sOrder
.
getOrderNo
());
map
.
put
(
"orderNo"
,
sOrder
.
getOrderNo
());
map
.
put
(
"expirationTime"
,
sOrder
.
getPreStartDate
().
toString
());
map
.
put
(
"expirationTime"
,
sOrder
.
getPreStartDate
().
toString
());
JSONObject
jsonObject
=
new
JSONObject
(
map
);
JSONObject
jsonObject
=
new
JSONObject
(
map
);
redisUtils
.
set
(
ReceiptRdeisEnum
.
ORDER_NO
.
getValue
()
+
sOrder
.
getOrderNo
(),
jsonObject
.
toString
());
if
(
sOrder
.
getOrderType
().
equals
(
OrderTypeEnum
.
RESERVER
.
getCode
()))
{
redisUtils
.
set
(
ReceiptRdeisEnum
.
ORDER_NO
.
getValue
()
+
sOrder
.
getOrderNo
(),
jsonObject
.
toString
());
}
}
}
if
(
sOrder
.
getOrderType
().
equals
(
OrderTypeEnum
.
RENEW
.
getCode
()))
{
if
(
sOrder
.
getOrderType
().
equals
(
OrderTypeEnum
.
RENEW
.
getCode
()))
{
sOrder
.
setStartDate
(
sOrder
.
getPreStartDate
());
sOrder
.
setStartDate
(
sOrder
.
getPreStartDate
());
...
@@ -385,12 +374,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -385,12 +374,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
deviceOpService
.
actionExecute
(
sOrder
.
getRoomId
(),
sOrder
.
getConsumerPhone
(),
VoiceEnum
.
RENEWAL_SUCCESS
.
getCode
(),
deviceOpService
.
actionExecute
(
sOrder
.
getRoomId
(),
sOrder
.
getConsumerPhone
(),
VoiceEnum
.
RENEWAL_SUCCESS
.
getCode
(),
cn
.
hutool
.
core
.
date
.
DateUtil
.
format
(
new
Date
(),
DatePattern
.
NORM_DATETIME_PATTERN
),
cn
.
hutool
.
core
.
date
.
DateUtil
.
format
(
new
Date
(),
DatePattern
.
NORM_DATETIME_PATTERN
),
cn
.
hutool
.
core
.
date
.
DateUtil
.
format
(
cn
.
hutool
.
core
.
date
.
DateUtil
.
offsetMinute
(
new
Date
(),
1
),
DatePattern
.
NORM_DATETIME_PATTERN
),
"1"
);
cn
.
hutool
.
core
.
date
.
DateUtil
.
format
(
cn
.
hutool
.
core
.
date
.
DateUtil
.
offsetMinute
(
new
Date
(),
1
),
DatePattern
.
NORM_DATETIME_PATTERN
),
"1"
);
SRoom
sRoom
=
roomService
.
getById
(
sOrder
.
getRoomId
());
// //通知保洁人员
// sConsumerService.selectListByStoreId(sOrder.getStoreId()).stream().forEach(item -> {
// // 循环发送短信提示门店保洁打扫卫生
// smsService.sendSmsCleanRecordsStopRemind(item.getPhone(), sStore, sRoom);
// });
}
}
}
}
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
...
@@ -398,7 +381,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -398,7 +381,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
map
.
put
(
"expirationTime"
,
sOrder
.
getEndDate
().
toString
());
map
.
put
(
"expirationTime"
,
sOrder
.
getEndDate
().
toString
());
JSONObject
jsonObject
=
new
JSONObject
(
map
);
JSONObject
jsonObject
=
new
JSONObject
(
map
);
redisUtils
.
set
(
ReceiptRdeisEnum
.
ORDER_NO_KEY
.
getValue
()
+
sOrder
.
getOrderNo
(),
jsonObject
.
toString
());
redisUtils
.
set
(
ReceiptRdeisEnum
.
ORDER_NO_KEY
.
getValue
()
+
sOrder
.
getOrderNo
(),
jsonObject
.
toString
());
redisUtils
.
delete
(
ReceiptRdeisEnum
.
ORDER_NO
.
getValue
()
+
sOrder
.
getOrderNo
());
}
}
return
response
;
return
response
;
...
@@ -1128,6 +1110,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
...
@@ -1128,6 +1110,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
BigDecimal
duration
=
new
BigDecimal
(
consumerCoupon
.
getDuration
());
BigDecimal
duration
=
new
BigDecimal
(
consumerCoupon
.
getDuration
());
if
(
duration
.
compareTo
(
timeLong
)
>=
0
)
{
if
(
duration
.
compareTo
(
timeLong
)
>=
0
)
{
priceResponse
.
setPayFee
(
BigDecimal
.
ZERO
);
priceResponse
.
setPayFee
(
BigDecimal
.
ZERO
);
priceResponse
.
setCouponFee
(
priceResponse
.
getTotalFee
());
}
else
{
}
else
{
BigDecimal
unitPrice
=
priceResponse
.
getTotalFee
().
divide
(
timeLong
);
BigDecimal
unitPrice
=
priceResponse
.
getTotalFee
().
divide
(
timeLong
);
priceResponse
.
setPayFee
(
unitPrice
.
multiply
(
timeLong
.
subtract
(
duration
)));
priceResponse
.
setPayFee
(
unitPrice
.
multiply
(
timeLong
.
subtract
(
duration
)));
...
...
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