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
a80302d0
Commit
a80302d0
authored
Nov 09, 2023
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优惠卷只能领取一次
parent
21b3972c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
SOrderMapper.java
...ystem/src/main/java/share/system/mapper/SOrderMapper.java
+1
-1
QPServiceImpl.java
...rc/main/java/share/system/service/impl/QPServiceImpl.java
+10
-0
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+2
-2
No files found.
share-system/src/main/java/share/system/mapper/SOrderMapper.java
View file @
a80302d0
...
@@ -61,5 +61,5 @@ public interface SOrderMapper extends BaseMapper<SOrder>
...
@@ -61,5 +61,5 @@ public interface SOrderMapper extends BaseMapper<SOrder>
*/
*/
public
int
deleteSOrderByIds
(
Long
[]
ids
);
public
int
deleteSOrderByIds
(
Long
[]
ids
);
SOrder
selectSOrderByNo
();
SOrder
selectSOrderByNo
(
String
orderNo
);
}
}
share-system/src/main/java/share/system/service/impl/QPServiceImpl.java
View file @
a80302d0
package
share
.
system
.
service
.
impl
;
package
share
.
system
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.dianping.openapi.sdk.api.oauth.CustomerRefreshToken
;
import
com.dianping.openapi.sdk.api.oauth.CustomerRefreshToken
;
import
com.dianping.openapi.sdk.api.oauth.DynamicToken
;
import
com.dianping.openapi.sdk.api.oauth.DynamicToken
;
import
com.dianping.openapi.sdk.api.oauth.entity.CustomerRefreshTokenResponse
;
import
com.dianping.openapi.sdk.api.oauth.entity.CustomerRefreshTokenResponse
;
...
@@ -11,6 +12,7 @@ import com.dianping.openapi.sdk.api.oauth.enums.GrantType;
...
@@ -11,6 +12,7 @@ import com.dianping.openapi.sdk.api.oauth.enums.GrantType;
import
com.dianping.openapi.sdk.api.tuangou.*
;
import
com.dianping.openapi.sdk.api.tuangou.*
;
import
com.dianping.openapi.sdk.api.tuangou.entity.*
;
import
com.dianping.openapi.sdk.api.tuangou.entity.*
;
import
com.dianping.openapi.sdk.httpclient.DefaultOpenAPIClient
;
import
com.dianping.openapi.sdk.httpclient.DefaultOpenAPIClient
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -18,6 +20,7 @@ import org.springframework.beans.factory.annotation.Value;
...
@@ -18,6 +20,7 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
share.common.enums.PlatformTypeEnum
;
import
share.common.enums.PlatformTypeEnum
;
import
share.common.enums.SourceTypeEnum
;
import
share.common.enums.SourceTypeEnum
;
import
share.system.domain.Device
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SConsumerCoupon
;
import
share.system.domain.SConsumerCoupon
;
import
share.system.domain.SCoupon
;
import
share.system.domain.SCoupon
;
...
@@ -57,6 +60,13 @@ public class QPServiceImpl implements QPService {
...
@@ -57,6 +60,13 @@ public class QPServiceImpl implements QPService {
if
(
sCoupon
==
null
)
{
if
(
sCoupon
==
null
)
{
throw
new
RuntimeException
(
"未找到对应的优惠券"
);
throw
new
RuntimeException
(
"未找到对应的优惠券"
);
}
}
//查询领取记录表
LambdaQueryWrapper
<
SConsumerCoupon
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SConsumerCoupon:
:
getCouponId
,
prepare
.
getDeal_title
());
SConsumerCoupon
one
=
isConsumerCouponService
.
getOne
(
queryWrapper
);
if
(
ObjectUtils
.
isNotEmpty
(
one
))
{
throw
new
RuntimeException
(
"该优惠券以领取"
);
}
//执行验券
//执行验券
// List<TuangouReceiptConsumeResponseEntity> consume = consume(code, count);
// List<TuangouReceiptConsumeResponseEntity> consume = consume(code, count);
// consume.forEach(item -> {
// consume.forEach(item -> {
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
a80302d0
...
@@ -417,7 +417,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
...
@@ -417,7 +417,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
@Override
@Override
public
MqttxVo
openDoor
(
String
orderNo
)
{
public
MqttxVo
openDoor
(
String
orderNo
)
{
SOrder
sOrder
=
sOrderMapper
.
selectSOrderByNo
();
SOrder
sOrder
=
sOrderMapper
.
selectSOrderByNo
(
orderNo
);
if
(
Objects
.
isNull
(
sOrder
))
{
if
(
Objects
.
isNull
(
sOrder
))
{
throw
new
BaseException
(
"订单不存在!"
);
throw
new
BaseException
(
"订单不存在!"
);
}
}
...
@@ -433,7 +433,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
...
@@ -433,7 +433,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
}
}
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
MqttxVo
mqttxVo
=
mqttxService
.
openOrCloseDevice
(
one
.
getDevId
(),
user
.
getNickName
(),
"10"
);
MqttxVo
mqttxVo
=
mqttxService
.
openOrCloseDevice
(
one
.
getDevId
(),
user
.
getNickName
(),
"10"
);
if
(
sOrder
.
getStatus
().
equals
(
OrderStatusEnum
.
INUSE
.
getCode
()))
{
if
(
sOrder
.
getStatus
().
equals
(
OrderStatusEnum
.
UNUSED
.
getCode
()))
{
//更改订单状态,房间状态,开始时间,结束时间
//更改订单状态,房间状态,开始时间,结束时间
sOrder
.
setStatus
(
1
);
sOrder
.
setStatus
(
1
);
//计算预约开始和结束时间时长
//计算预约开始和结束时间时长
...
...
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