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
09c78f5e
Commit
09c78f5e
authored
Apr 12, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优惠券查询适用门店增加是否已验券判断
parent
4b7ef484
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
7 deletions
+30
-7
SConsumerCouponController.java
...hare/web/controller/system/SConsumerCouponController.java
+5
-3
ISConsumerCouponService.java
...in/java/share/system/service/ISConsumerCouponService.java
+2
-0
QPServiceImpl.java
...rc/main/java/share/system/service/impl/QPServiceImpl.java
+13
-2
SConsumerCouponServiceImpl.java
...share/system/service/impl/SConsumerCouponServiceImpl.java
+5
-0
TiktokServiceImpl.java
...ain/java/share/system/service/impl/TiktokServiceImpl.java
+5
-2
No files found.
share-front/src/main/java/share/web/controller/system/SConsumerCouponController.java
View file @
09c78f5e
...
...
@@ -2,7 +2,6 @@ package share.web.controller.system;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -11,9 +10,7 @@ import share.common.core.controller.BaseController;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.domain.R
;
import
share.common.core.page.TableDataInfo
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SConsumerCoupon
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.request.CouponRequest
;
import
share.system.service.ISConsumerCouponService
;
...
...
@@ -52,6 +49,11 @@ public class SConsumerCouponController extends BaseController {
return
success
(
sConsumerCouponService
.
selectSConsumerCouponById
(
id
));
}
@GetMapping
(
value
=
"/queryCode"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"code"
)
String
code
)
{
return
success
(
sConsumerCouponService
.
selectSConsumerCouponByCode
(
code
));
}
// @PreAuthorize("@ss.hasPermi('system:coupon:list')")
@ApiOperation
(
value
=
"优惠券-查询可用优惠券"
)
...
...
share-system/src/main/java/share/system/service/ISConsumerCouponService.java
View file @
09c78f5e
...
...
@@ -86,4 +86,6 @@ public interface ISConsumerCouponService extends IService<SConsumerCoupon>
int
restoreCoupon
(
Long
id
);
int
removeByIdList
(
List
<
Long
>
expiredCoupons
);
SConsumerCoupon
selectSConsumerCouponByCode
(
String
code
);
}
share-system/src/main/java/share/system/service/impl/QPServiceImpl.java
View file @
09c78f5e
...
...
@@ -99,10 +99,10 @@ public class QPServiceImpl implements QPService {
sStoreLambdaQueryWrapper
.
eq
(
SStore:
:
getId
,
storeId
);
SStore
sStore
=
storeService
.
getOne
(
sStoreLambdaQueryWrapper
);
if
(
ObjectUtils
.
isEmpty
(
sStore
)
||
StoreStatusEnum
.
STOP
.
getIndex
().
equals
(
sStore
.
getStatus
()))
{
throw
new
RuntimeException
(
"门店
状态异常,请联系管理员
"
);
throw
new
RuntimeException
(
"门店
维护中,请联系客服
"
);
}
if
(
StringUtils
.
isEmpty
(
sStore
.
getOpenShopUuid
()))
{
throw
new
RuntimeException
(
"门店未授权,请联系
管理员
"
);
throw
new
RuntimeException
(
"门店未授权,请联系
客服
"
);
}
//验券准备
TuangouReceiptPrepareResponseEntity
prepare
=
prepare
(
code
.
trim
(),
sStore
.
getOpenShopUuid
(),
status
);
...
...
@@ -433,6 +433,17 @@ public class QPServiceImpl implements QPService {
List
<
SStore
>
sStoreList
=
storeService
.
list
(
sStoreLambdaQueryWrapper
);
//验券准备
TuangouReceiptPrepareResponseEntity
prepare
=
prepare
(
code
.
trim
(),
sStoreList
.
get
(
0
).
getOpenShopUuid
(),
""
);
//获取用户信息
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
//查询领取记录表
LambdaQueryWrapper
<
SConsumerCoupon
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SConsumerCoupon:
:
getCouponCode
,
code
);
queryWrapper
.
eq
(
SConsumerCoupon:
:
getUseStatus
,
UserStatusEnum
.
UNUSED
.
getCode
());
queryWrapper
.
eq
(
SConsumerCoupon:
:
getIsDelete
,
YesNoEnum
.
no
.
getIndex
());
SConsumerCoupon
unUsedCoupon
=
isConsumerCouponService
.
getOne
(
queryWrapper
);
if
(
ObjectUtils
.
isNotEmpty
(
unUsedCoupon
))
{
throw
new
RuntimeException
(
"该券已被领取"
);
}
sStoreList
=
storeService
.
list
(
new
LambdaQueryWrapper
<>(
SStore
.
class
).
isNotNull
(
SStore:
:
getOpenShopUuid
));
SCoupon
sCoupon
=
isCouponService
.
getOne
(
new
LambdaQueryWrapper
<>(
SCoupon
.
class
).
eq
(
SCoupon:
:
getCouponType
,
CouponTypeEnum
.
CASH
.
getCode
()).
...
...
share-system/src/main/java/share/system/service/impl/SConsumerCouponServiceImpl.java
View file @
09c78f5e
...
...
@@ -454,6 +454,11 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
return
baseMapper
.
removeByIdList
(
expiredCoupons
);
}
@Override
public
SConsumerCoupon
selectSConsumerCouponByCode
(
String
code
)
{
return
baseMapper
.
selectOne
(
new
LambdaQueryWrapper
<>(
SConsumerCoupon
.
class
).
eq
(
SConsumerCoupon:
:
getCouponCode
,
code
));
}
private
void
extracted
(
SConsumerCoupon
item
,
BigDecimal
bigDecimal
,
SRoom
byId
,
BigDecimal
subtract
,
SStore
sStore
)
{
//计算价格
BigDecimal
multiply
=
bigDecimal
.
multiply
(
byId
.
getPrice
());
...
...
share-system/src/main/java/share/system/service/impl/TiktokServiceImpl.java
View file @
09c78f5e
...
...
@@ -335,10 +335,10 @@ public class TiktokServiceImpl implements TiktokService {
sStoreLambdaQueryWrapper
.
eq
(
SStore:
:
getId
,
storeId
);
SStore
sStore
=
storeService
.
getOne
(
sStoreLambdaQueryWrapper
);
if
(
ObjectUtils
.
isEmpty
(
sStore
)
||
StoreStatusEnum
.
STOP
.
getIndex
().
equals
(
sStore
.
getStatus
()))
{
throw
new
RuntimeException
(
"门店
状态异常,请联系管理员
"
);
throw
new
RuntimeException
(
"门店
维护中,请联系客服
"
);
}
if
(
StringUtils
.
isEmpty
(
sStore
.
getTiktokPoiId
()))
{
throw
new
RuntimeException
(
"门店未授权,请联系
管理员
"
);
throw
new
RuntimeException
(
"门店未授权,请联系
客服
"
);
}
if
(
code
.
startsWith
(
"https://v.douyin.com/"
)
|
code
.
length
()
==
15
|
code
.
length
()
==
12
)
{
try
{
...
...
@@ -489,6 +489,9 @@ public class TiktokServiceImpl implements TiktokService {
tiktokCouponDto
.
setPoiId
(
sStoreList
.
get
(
0
).
getTiktokPoiId
());
JSONObject
prepare
=
prepare
(
tiktokCouponDto
);
JSONArray
certificates
=
prepare
.
getJSONArray
(
"certificates"
);
if
(
CollectionUtils
.
isEmpty
(
certificates
))
{
throw
new
RuntimeException
(
"该券码已被使用"
);
}
Object
o
=
certificates
.
get
(
0
);
JSONObject
entries
=
new
JSONObject
(
o
);
JSONObject
sku
=
entries
.
getJSONObject
(
"sku"
);
...
...
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