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
6d26dbad
Commit
6d26dbad
authored
Mar 07, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优惠卷领取记录增加抖音加密劵码
parent
760c2c16
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
6 deletions
+22
-6
QPController.java
...c/main/java/share/web/controller/system/QPController.java
+1
-1
RedisTask.java
share-quartz/src/main/java/share/quartz/task/RedisTask.java
+1
-1
SConsumerCoupon.java
...em/src/main/java/share/system/domain/SConsumerCoupon.java
+5
-0
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+1
-1
TiktokServiceImpl.java
...ain/java/share/system/service/impl/TiktokServiceImpl.java
+8
-3
SConsumerCouponMapper.xml
...rc/main/resources/mapper/system/SConsumerCouponMapper.xml
+6
-0
No files found.
share-front/src/main/java/share/web/controller/system/QPController.java
View file @
6d26dbad
...
...
@@ -51,7 +51,7 @@ public class QPController {
public
R
<
String
>
consumeByUser
(
String
code
,
String
storeId
)
{
if
(
code
.
length
()
==
10
)
{
return
R
.
ok
(
qpService
.
consumeByUser
(
code
,
storeId
,
ConsumerCouponStatusEnum
.
CONTROLLER
.
getCode
()));
}
else
if
(
code
.
startsWith
(
"https://v.douyin.com/"
)
|
code
.
length
()
==
15
)
{
}
else
if
(
code
.
startsWith
(
"https://v.douyin.com/"
)
|
code
.
length
()
==
15
|
code
.
length
()
==
12
)
{
return
R
.
ok
(
tiktokService
.
consumeByUser
(
code
,
storeId
));
}
else
{
return
R
.
fail
(
"请输入正确的券码"
);
...
...
share-quartz/src/main/java/share/quartz/task/RedisTask.java
View file @
6d26dbad
...
...
@@ -118,7 +118,7 @@ public class RedisTask {
logger
.
info
(
"券码:{}->查询结束:{}"
,
coupon
.
getCouponCode
(),
getconsumed
);
}
else
if
(
StringUtils
.
isNoneEmpty
(
coupon
.
getTiktokSkuId
())
&&
coupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
TIKTOK
.
getCode
()))
{
//抖音复验券
JSONObject
object
=
tiktokService
.
certificateGet
(
coupon
.
get
Coupon
Code
());
JSONObject
object
=
tiktokService
.
certificateGet
(
coupon
.
get
Encrypted
Code
());
JSONObject
certificate
=
object
.
getJSONObject
(
"certificate"
);
Integer
status
=
certificate
.
getInt
(
"status"
);
if
(
status
.
equals
(
TiktokCouponStatusEnum
.
AVAILABLE
.
getCode
()))
{
...
...
share-system/src/main/java/share/system/domain/SConsumerCoupon.java
View file @
6d26dbad
...
...
@@ -65,6 +65,11 @@ public class SConsumerCoupon extends BaseEntity
@Excel
(
name
=
"优惠券编码"
)
private
String
couponCode
;
/**
* 优惠券加密编码
*/
private
String
encryptedCode
;
/** 优惠券名称 */
@Excel
(
name
=
"优惠券名称"
)
private
String
name
;
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
6d26dbad
...
...
@@ -545,7 +545,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
}
else
if
(
StringUtils
.
isNoneEmpty
(
byId
.
getTiktokSkuId
())
&&
byId
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
TIKTOK
.
getCode
()))
{
//抖音复验券
JSONObject
object
=
tiktokService
.
certificateGet
(
byId
.
get
Coupon
Code
());
JSONObject
object
=
tiktokService
.
certificateGet
(
byId
.
get
Encrypted
Code
());
JSONObject
certificate
=
object
.
getJSONObject
(
"certificate"
);
Integer
status
=
certificate
.
getInt
(
"status"
);
Boolean
isDelete
=
false
;
...
...
share-system/src/main/java/share/system/service/impl/TiktokServiceImpl.java
View file @
6d26dbad
...
...
@@ -338,7 +338,7 @@ public class TiktokServiceImpl implements TiktokService {
if
(
StringUtils
.
isEmpty
(
sStore
.
getTiktokPoiId
()))
{
throw
new
RuntimeException
(
"门店未授权,请联系管理员"
);
}
if
(
code
.
startsWith
(
"https://v.douyin.com/"
)
|
code
.
length
()
==
15
)
{
if
(
code
.
startsWith
(
"https://v.douyin.com/"
)
|
code
.
length
()
==
15
|
code
.
length
()
==
12
)
{
try
{
TiktokCouponDto
tiktokCouponDto
=
new
TiktokCouponDto
();
if
(
code
.
startsWith
(
"https://v.douyin.com/"
))
{
...
...
@@ -376,11 +376,16 @@ public class TiktokServiceImpl implements TiktokService {
codes
.
add
(
e
.
getStr
(
"encrypted_code"
));
});
couponDto
.
setEncryptedCodes
(
codes
);
verify
(
couponDto
);
JSONObject
verify
=
verify
(
couponDto
);
JSONArray
verifyResults
=
verify
.
getJSONArray
(
"verify_results"
);
Object
o1
=
verifyResults
.
get
(
0
);
JSONObject
verifyResult
=
new
JSONObject
(
o1
);
String
originCode
=
verifyResult
.
getStr
(
"origin_code"
);
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
sConsumerCoupon
.
setConsumerId
(
user
.
getId
());
sConsumerCoupon
.
setStoreId
(
sStore
.
getId
());
sConsumerCoupon
.
setCouponCode
(
entries
.
getStr
(
"encrypted_code"
));
sConsumerCoupon
.
setCouponCode
(
originCode
);
sConsumerCoupon
.
setEncryptedCode
(
entries
.
getStr
(
"encrypted_code"
));
sConsumerCoupon
.
setName
(
sku
.
getStr
(
"title"
));
sConsumerCoupon
.
setSourceType
(
SourceTypeEnum
.
CHECK
.
getCode
());
sConsumerCoupon
.
setPlatformType
(
PlatformTypeEnum
.
TIKTOK
.
getCode
());
...
...
share-system/src/main/resources/mapper/system/SConsumerCouponMapper.xml
View file @
6d26dbad
...
...
@@ -14,6 +14,7 @@
<result
property=
"tiktokSkuId"
column=
"tiktok_sku_id"
/>
<result
property=
"storeIds"
column=
"store_ids"
/>
<result
property=
"couponCode"
column=
"coupon_code"
/>
<result
property=
"encryptedCode"
column=
"encrypted_code"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"couponType"
column=
"coupon_type"
/>
<result
property=
"couponTimeStart"
column=
"coupon_time_start"
/>
...
...
@@ -54,6 +55,7 @@
tiktok_sku_id,
store_ids,
coupon_code,
encrypted_code,
name,
coupon_type,
coupon_time_start,
...
...
@@ -95,6 +97,7 @@
<if
test=
"storeId !=null"
>
and store_id = #{storeId}
</if>
<if
test=
"dealId !=null"
>
and deal_id=#{dealId}
</if>
<if
test=
"couponCode != null and couponCode != ''"
>
and coupon_code = #{couponCode}
</if>
<if
test=
"encryptedCode != null and encryptedCode != ''"
>
and encrypted_code = #{encryptedCode}
</if>
<if
test=
"name != null and name != ''"
>
and name like concat('%', #{name}, '%')
</if>
<if
test=
"couponType != null and couponType != ''"
>
and coupon_type = #{couponType}
</if>
<if
test=
"couponTimeStart != null "
>
and coupon_time_start = #{couponTimeStart}
</if>
...
...
@@ -149,6 +152,7 @@
<if
test=
"storeId != null"
>
store_id,
</if>
<if
test=
"dealId != null"
>
deal_id,
</if>
<if
test=
"couponCode != null and couponCode != ''"
>
coupon_code,
</if>
<if
test=
"encryptedCode != null and encryptedCode != ''"
>
encrypted_code,
</if>
<if
test=
"name != null and name != ''"
>
name,
</if>
<if
test=
"couponType != null"
>
coupon_type,
</if>
<if
test=
"couponTimeStart != null"
>
coupon_time_start,
</if>
...
...
@@ -187,6 +191,7 @@
<if
test=
"storeId != null"
>
#{storeId},
</if>
<if
test=
"dealId != null"
>
#{dealId},
</if>
<if
test=
"couponCode != null and couponCode != ''"
>
#{couponCode},
</if>
<if
test=
"encryptedCode != null and encryptedCode != ''"
>
#{encryptedCode},
</if>
<if
test=
"name != null and name != ''"
>
#{name},
</if>
<if
test=
"couponType != null"
>
#{couponType},
</if>
<if
test=
"couponTimeStart != null"
>
#{couponTimeStart},
</if>
...
...
@@ -229,6 +234,7 @@
<if
test=
"storeId != null"
>
store_id = #{storeId}
</if>
<if
test=
"dealId != null"
>
deal_id = #{dealId},
</if>
<if
test=
"couponCode != null and couponCode != ''"
>
coupon_code = #{couponCode},
</if>
<if
test=
"encryptedCode != null and encryptedCode != ''"
>
encrypted_code = #{encryptedCode},
</if>
<if
test=
"name != null and name != ''"
>
name = #{name},
</if>
<if
test=
"couponType != null"
>
coupon_type = #{couponType},
</if>
<if
test=
"couponTimeStart != null"
>
coupon_time_start = #{couponTimeStart},
</if>
...
...
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