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
941000a0
Commit
941000a0
authored
Feb 23, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改用户验劵接口,团购绑定的id改为门店id
parent
82880f41
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
28 additions
and
45 deletions
+28
-45
QPController.java
...c/main/java/share/web/controller/system/QPController.java
+9
-8
TiktokController.java
...in/java/share/web/controller/system/TiktokController.java
+2
-2
SStore.java
share-system/src/main/java/share/system/domain/SStore.java
+1
-0
TuangouReceiptPrepareResponseEntityVo.java
...stem/domain/vo/TuangouReceiptPrepareResponseEntityVo.java
+0
-10
QPService.java
...-system/src/main/java/share/system/service/QPService.java
+1
-2
TiktokService.java
...tem/src/main/java/share/system/service/TiktokService.java
+1
-1
QPServiceImpl.java
...rc/main/java/share/system/service/impl/QPServiceImpl.java
+10
-18
TiktokServiceImpl.java
...ain/java/share/system/service/impl/TiktokServiceImpl.java
+4
-4
No files found.
share-front/src/main/java/share/web/controller/system/QPController.java
View file @
941000a0
...
@@ -3,15 +3,13 @@ package share.web.controller.system;
...
@@ -3,15 +3,13 @@ package share.web.controller.system;
import
com.dianping.openapi.sdk.api.tuangou.entity.*
;
import
com.dianping.openapi.sdk.api.tuangou.entity.*
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
share.common.core.domain.R
;
import
share.common.core.domain.R
;
import
share.common.enums.ConsumerCouponStatusEnum
;
import
share.common.enums.ConsumerCouponStatusEnum
;
import
share.system.domain.vo.TuangouReceiptPrepareResponseEntityVo
;
import
share.system.service.QPService
;
import
share.system.service.QPService
;
import
share.system.service.TiktokService
;
import
java.util.List
;
import
java.util.List
;
...
@@ -21,6 +19,8 @@ import java.util.List;
...
@@ -21,6 +19,8 @@ import java.util.List;
public
class
QPController
{
public
class
QPController
{
@Autowired
@Autowired
private
QPService
qpService
;
private
QPService
qpService
;
@Autowired
private
TiktokService
tiktokService
;
//输码验券校验接口
//输码验券校验接口
@GetMapping
(
"/prepare"
)
@GetMapping
(
"/prepare"
)
...
@@ -48,12 +48,13 @@ public class QPController {
...
@@ -48,12 +48,13 @@ public class QPController {
//用户验券接口
//用户验券接口
@GetMapping
(
"/consumeByUser"
)
@GetMapping
(
"/consumeByUser"
)
public
R
<
TuangouReceiptPrepareResponseEntityVo
>
consumeByUser
(
String
code
,
String
openShopUuid
)
{
public
R
<
String
>
consumeByUser
(
String
code
,
String
storeId
)
{
TuangouReceiptPrepareResponseEntityVo
tuangouReceiptPrepareResponseEntityVo
=
qpService
.
consumeByUser
(
code
,
openShopUuid
,
ConsumerCouponStatusEnum
.
CONTROLLER
.
getCode
());
if
(
code
.
length
()
==
10
)
{
if
(
ObjectUtils
.
isEmpty
(
tuangouReceiptPrepareResponseEntityVo
))
{
return
R
.
ok
(
qpService
.
consumeByUser
(
code
,
storeId
,
ConsumerCouponStatusEnum
.
CONTROLLER
.
getCode
()));
return
R
.
fail
(
tuangouReceiptPrepareResponseEntityVo
,
"该券码已被使用"
);
}
else
if
(
code
.
startsWith
(
"https://v.douyin.com/"
)
|
code
.
length
()
==
15
)
{
return
R
.
ok
(
tiktokService
.
consumeByUser
(
code
,
storeId
));
}
else
{
}
else
{
return
R
.
ok
(
tuangouReceiptPrepareResponseEntityVo
);
return
R
.
fail
(
"请输入正确的券码"
);
}
}
}
}
...
...
share-front/src/main/java/share/web/controller/system/TiktokController.java
View file @
941000a0
...
@@ -64,7 +64,7 @@ public class TiktokController {
...
@@ -64,7 +64,7 @@ public class TiktokController {
//用户验券接口
//用户验券接口
@GetMapping
(
"/consumeByUser"
)
@GetMapping
(
"/consumeByUser"
)
public
AjaxResult
consumeByUser
(
String
code
,
String
poi
Id
)
{
public
AjaxResult
consumeByUser
(
String
code
,
String
store
Id
)
{
return
success
(
tiktokService
.
consumeByUser
(
code
,
poi
Id
));
return
success
(
tiktokService
.
consumeByUser
(
code
,
store
Id
));
}
}
}
}
share-system/src/main/java/share/system/domain/SStore.java
View file @
941000a0
...
@@ -22,6 +22,7 @@ public class SStore extends BaseEntity
...
@@ -22,6 +22,7 @@ public class SStore extends BaseEntity
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** 门店ID */
/** 门店ID */
@Excel
(
name
=
"门店ID"
)
@TableId
(
type
=
IdType
.
AUTO
)
@TableId
(
type
=
IdType
.
AUTO
)
private
Long
id
;
private
Long
id
;
...
...
share-system/src/main/java/share/system/domain/vo/TuangouReceiptPrepareResponseEntityVo.java
deleted
100644 → 0
View file @
82880f41
package
share
.
system
.
domain
.
vo
;
import
com.dianping.openapi.sdk.api.tuangou.entity.TuangouReceiptPrepareResponseEntity
;
import
lombok.Data
;
@Data
public
class
TuangouReceiptPrepareResponseEntityVo
extends
TuangouReceiptPrepareResponseEntity
{
private
String
expirationTime
;
private
Long
consumerCouponId
;
}
share-system/src/main/java/share/system/service/QPService.java
View file @
941000a0
...
@@ -4,7 +4,6 @@ import com.dianping.openapi.sdk.api.customerauth.session.entity.CustomerKeyShopS
...
@@ -4,7 +4,6 @@ import com.dianping.openapi.sdk.api.customerauth.session.entity.CustomerKeyShopS
import
com.dianping.openapi.sdk.api.oauth.entity.CustomerRefreshTokenResponse
;
import
com.dianping.openapi.sdk.api.oauth.entity.CustomerRefreshTokenResponse
;
import
com.dianping.openapi.sdk.api.tuangou.entity.*
;
import
com.dianping.openapi.sdk.api.tuangou.entity.*
;
import
share.system.domain.vo.SessionVo
;
import
share.system.domain.vo.SessionVo
;
import
share.system.domain.vo.TuangouReceiptPrepareResponseEntityVo
;
import
java.util.List
;
import
java.util.List
;
...
@@ -17,7 +16,7 @@ public interface QPService {
...
@@ -17,7 +16,7 @@ public interface QPService {
TuangouReceiptGetConsumedReponseEntity
getconsumed
(
String
code
,
String
openShopUuid
);
TuangouReceiptGetConsumedReponseEntity
getconsumed
(
String
code
,
String
openShopUuid
);
TuangouReceiptPrepareResponseEntityVo
consumeByUser
(
String
code
,
String
openShopUui
d
,
String
status
);
String
consumeByUser
(
String
code
,
String
storeI
d
,
String
status
);
List
<
TuangouReceiptReverseConsumeResponseEntity
>
reverseconsumeByUser
(
Long
id
);
List
<
TuangouReceiptReverseConsumeResponseEntity
>
reverseconsumeByUser
(
Long
id
);
...
...
share-system/src/main/java/share/system/service/TiktokService.java
View file @
941000a0
...
@@ -24,7 +24,7 @@ public interface TiktokService {
...
@@ -24,7 +24,7 @@ public interface TiktokService {
JSONObject
onlineGet
(
String
productIds
,
String
accountId
);
JSONObject
onlineGet
(
String
productIds
,
String
accountId
);
String
consumeByUser
(
String
code
,
String
poi
Id
);
String
consumeByUser
(
String
code
,
String
store
Id
);
List
<
TiktokPoi
>
poiList
();
List
<
TiktokPoi
>
poiList
();
}
}
share-system/src/main/java/share/system/service/impl/QPServiceImpl.java
View file @
941000a0
...
@@ -23,11 +23,8 @@ import org.apache.commons.lang3.ObjectUtils;
...
@@ -23,11 +23,8 @@ import org.apache.commons.lang3.ObjectUtils;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
share.common.core.redis.RedisUtil
;
import
share.common.core.redis.RedisUtil
;
...
@@ -39,7 +36,6 @@ import share.system.domain.SCoupon;
...
@@ -39,7 +36,6 @@ import share.system.domain.SCoupon;
import
share.system.domain.SStore
;
import
share.system.domain.SStore
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.SessionVo
;
import
share.system.domain.vo.SessionVo
;
import
share.system.domain.vo.TuangouReceiptPrepareResponseEntityVo
;
import
share.system.service.ISConsumerCouponService
;
import
share.system.service.ISConsumerCouponService
;
import
share.system.service.ISCouponService
;
import
share.system.service.ISCouponService
;
import
share.system.service.ISStoreService
;
import
share.system.service.ISStoreService
;
...
@@ -47,7 +43,10 @@ import share.system.service.QPService;
...
@@ -47,7 +43,10 @@ import share.system.service.QPService;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.UUID
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
@Service
@Service
...
@@ -91,16 +90,15 @@ public class QPServiceImpl implements QPService {
...
@@ -91,16 +90,15 @@ public class QPServiceImpl implements QPService {
* 用户验卷接口
* 用户验卷接口
*/
*/
@Override
@Override
public
TuangouReceiptPrepareResponseEntityVo
consumeByUser
(
String
code
,
String
openShopUui
d
,
String
status
)
{
public
String
consumeByUser
(
String
code
,
String
storeI
d
,
String
status
)
{
LambdaQueryWrapper
<
SStore
>
sStoreLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
SStore
>
sStoreLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
sStoreLambdaQueryWrapper
.
eq
(
SStore:
:
get
OpenShopUuid
,
openShopUui
d
);
sStoreLambdaQueryWrapper
.
eq
(
SStore:
:
get
Id
,
storeI
d
);
SStore
sStore
=
storeService
.
getOne
(
sStoreLambdaQueryWrapper
);
SStore
sStore
=
storeService
.
getOne
(
sStoreLambdaQueryWrapper
);
if
(
ObjectUtils
.
isEmpty
(
sStore
)
||
StoreStatusEnum
.
STOP
.
getIndex
().
equals
(
sStore
.
getStatus
()))
{
if
(
ObjectUtils
.
isEmpty
(
sStore
)
||
StoreStatusEnum
.
STOP
.
getIndex
().
equals
(
sStore
.
getStatus
()))
{
throw
new
RuntimeException
(
"门店状态异常,请联系管理员"
);
throw
new
RuntimeException
(
"门店状态异常,请联系管理员"
);
}
}
//验券准备
//验券准备
TuangouReceiptPrepareResponseEntity
prepare
=
prepare
(
code
.
trim
(),
openShopUuid
,
status
);
TuangouReceiptPrepareResponseEntity
prepare
=
prepare
(
code
.
trim
(),
sStore
.
getOpenShopUuid
()
,
status
);
//获取用户信息
//获取用户信息
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
//查询领取记录表
//查询领取记录表
...
@@ -113,7 +111,6 @@ public class QPServiceImpl implements QPService {
...
@@ -113,7 +111,6 @@ public class QPServiceImpl implements QPService {
throw
new
RuntimeException
(
"该券已被领取"
);
throw
new
RuntimeException
(
"该券已被领取"
);
}
}
//根据优惠卷名称查询优惠劵配置 查询list,取第一个
//根据优惠卷名称查询优惠劵配置 查询list,取第一个
TuangouReceiptPrepareResponseEntityVo
response
=
new
TuangouReceiptPrepareResponseEntityVo
();
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
sConsumerCoupon
.
setConsumerId
(
user
.
getId
());
sConsumerCoupon
.
setConsumerId
(
user
.
getId
());
sConsumerCoupon
.
setDealId
(
prepare
.
getDeal_id
());
sConsumerCoupon
.
setDealId
(
prepare
.
getDeal_id
());
...
@@ -127,7 +124,7 @@ public class QPServiceImpl implements QPService {
...
@@ -127,7 +124,7 @@ public class QPServiceImpl implements QPService {
sConsumerCoupon
.
setCreateTime
(
new
Date
());
sConsumerCoupon
.
setCreateTime
(
new
Date
());
sConsumerCoupon
.
setSubPrice
(
BigDecimal
.
valueOf
(
prepare
.
getDeal_marketprice
()));
sConsumerCoupon
.
setSubPrice
(
BigDecimal
.
valueOf
(
prepare
.
getDeal_marketprice
()));
//查询美团团购信息
//查询美团团购信息
List
<
TuangouDealQueryShopDealResponseEntity
>
groupActivities
=
queryshopdeal
(
openShopUuid
);
List
<
TuangouDealQueryShopDealResponseEntity
>
groupActivities
=
queryshopdeal
(
sStore
.
getOpenShopUuid
()
);
groupActivities
.
forEach
(
o
->
{
groupActivities
.
forEach
(
o
->
{
//套餐名称相同并且在售卖中
//套餐名称相同并且在售卖中
if
(
prepare
.
getDealgroup_id
().
equals
(
o
.
getDealgroup_id
())
&&
saleStatusEnum
.
SELLING
.
getCode
().
equals
(
o
.
getSale_status
()))
{
if
(
prepare
.
getDealgroup_id
().
equals
(
o
.
getDealgroup_id
())
&&
saleStatusEnum
.
SELLING
.
getCode
().
equals
(
o
.
getSale_status
()))
{
...
@@ -173,14 +170,9 @@ public class QPServiceImpl implements QPService {
...
@@ -173,14 +170,9 @@ public class QPServiceImpl implements QPService {
sConsumerCoupon
.
setRemark
(
sCoupon
.
getRemark
());
sConsumerCoupon
.
setRemark
(
sCoupon
.
getRemark
());
}
}
isConsumerCouponService
.
insertSConsumerCoupon
(
sConsumerCoupon
);
isConsumerCouponService
.
insertSConsumerCoupon
(
sConsumerCoupon
);
response
.
setConsumerCouponId
(
sConsumerCoupon
.
getId
());
String
output1
=
DateUtil
.
format
(
prepare
.
getReceiptEndDate
(),
DatePattern
.
NORM_DATETIME_PATTERN
);
BeanUtils
.
copyProperties
(
prepare
,
response
);
response
.
setExpirationTime
(
output1
);
//核销美团券
//核销美团券
consume
(
code
.
trim
(),
1
,
openShopUuid
,
ConsumerCouponStatusEnum
.
ORDER
.
getCode
()
);
consume
(
code
.
trim
(),
1
,
sStore
.
getOpenShopUuid
(),
status
);
return
response
;
return
"验劵成功"
;
}
}
@Override
@Override
...
...
share-system/src/main/java/share/system/service/impl/TiktokServiceImpl.java
View file @
941000a0
...
@@ -302,9 +302,9 @@ public class TiktokServiceImpl implements TiktokService {
...
@@ -302,9 +302,9 @@ public class TiktokServiceImpl implements TiktokService {
}
}
@Override
@Override
public
String
consumeByUser
(
String
code
,
String
poi
Id
)
{
public
String
consumeByUser
(
String
code
,
String
store
Id
)
{
LambdaQueryWrapper
<
SStore
>
sStoreLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
SStore
>
sStoreLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
sStoreLambdaQueryWrapper
.
eq
(
SStore:
:
get
TiktokPoiId
,
poi
Id
);
sStoreLambdaQueryWrapper
.
eq
(
SStore:
:
get
Id
,
store
Id
);
SStore
sStore
=
storeService
.
getOne
(
sStoreLambdaQueryWrapper
);
SStore
sStore
=
storeService
.
getOne
(
sStoreLambdaQueryWrapper
);
if
(
ObjectUtils
.
isEmpty
(
sStore
)
||
StoreStatusEnum
.
STOP
.
getIndex
().
equals
(
sStore
.
getStatus
()))
{
if
(
ObjectUtils
.
isEmpty
(
sStore
)
||
StoreStatusEnum
.
STOP
.
getIndex
().
equals
(
sStore
.
getStatus
()))
{
throw
new
RuntimeException
(
"门店状态异常,请联系管理员"
);
throw
new
RuntimeException
(
"门店状态异常,请联系管理员"
);
...
@@ -317,7 +317,7 @@ public class TiktokServiceImpl implements TiktokService {
...
@@ -317,7 +317,7 @@ public class TiktokServiceImpl implements TiktokService {
}
else
{
}
else
{
tiktokCouponDto
.
setCode
(
code
);
tiktokCouponDto
.
setCode
(
code
);
}
}
tiktokCouponDto
.
setPoiId
(
poiId
);
tiktokCouponDto
.
setPoiId
(
sStore
.
getTiktokPoiId
()
);
JSONObject
prepare
=
prepare
(
tiktokCouponDto
);
JSONObject
prepare
=
prepare
(
tiktokCouponDto
);
JSONArray
certificates
=
prepare
.
getJSONArray
(
"certificates"
);
JSONArray
certificates
=
prepare
.
getJSONArray
(
"certificates"
);
Object
o
=
certificates
.
get
(
0
);
Object
o
=
certificates
.
get
(
0
);
...
@@ -388,7 +388,7 @@ public class TiktokServiceImpl implements TiktokService {
...
@@ -388,7 +388,7 @@ public class TiktokServiceImpl implements TiktokService {
isConsumerCouponService
.
insertSConsumerCoupon
(
sConsumerCoupon
);
isConsumerCouponService
.
insertSConsumerCoupon
(
sConsumerCoupon
);
TiktokCouponDto
couponDto
=
new
TiktokCouponDto
();
TiktokCouponDto
couponDto
=
new
TiktokCouponDto
();
couponDto
.
setVerifyToken
(
prepare
.
getStr
(
"verify_token"
));
couponDto
.
setVerifyToken
(
prepare
.
getStr
(
"verify_token"
));
couponDto
.
setPoiId
(
poiId
);
couponDto
.
setPoiId
(
sStore
.
getTiktokPoiId
()
);
List
<
String
>
codes
=
new
ArrayList
<>();
List
<
String
>
codes
=
new
ArrayList
<>();
List
<
JSONObject
>
list
=
certificates
.
toList
(
JSONObject
.
class
);
List
<
JSONObject
>
list
=
certificates
.
toList
(
JSONObject
.
class
);
//获取List中的encrypted_code
//获取List中的encrypted_code
...
...
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