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
251202cd
Commit
251202cd
authored
Feb 23, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自动任务增加判断
parent
b8c40ad0
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
39 additions
and
47 deletions
+39
-47
QPController.java
...c/main/java/share/web/controller/system/QPController.java
+0
-7
PlatformTypeEnum.java
...on/src/main/java/share/common/enums/PlatformTypeEnum.java
+7
-7
RedisTask.java
share-quartz/src/main/java/share/quartz/task/RedisTask.java
+2
-2
SConsumerCoupon.java
...em/src/main/java/share/system/domain/SConsumerCoupon.java
+7
-9
SCoupon.java
share-system/src/main/java/share/system/domain/SCoupon.java
+4
-6
SConsumerCouponServiceImpl.java
...share/system/service/impl/SConsumerCouponServiceImpl.java
+7
-8
SCouponServiceImpl.java
...in/java/share/system/service/impl/SCouponServiceImpl.java
+9
-5
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+2
-2
SCouponMapper.xml
...system/src/main/resources/mapper/system/SCouponMapper.xml
+1
-1
No files found.
share-admin/src/main/java/share/web/controller/system/QPController.java
View file @
251202cd
package
share
.
web
.
controller
.
system
;
import
cn.hutool.json.JSONObject
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
share.common.core.domain.R
;
import
share.common.enums.ReceiptRdeisEnum
;
import
share.system.domain.vo.SessionVo
;
import
share.system.service.QPService
;
import
java.text.SimpleDateFormat
;
@RestController
@RequestMapping
(
"/chessCards"
)
...
...
@@ -23,7 +17,6 @@ import java.text.SimpleDateFormat;
public
class
QPController
{
@Autowired
private
QPService
qpService
;
RedisTemplate
redisTemplate
=
new
RedisTemplate
();
//通过authCode,获取授权的session
@GetMapping
(
"/oauthToken"
)
...
...
share-common/src/main/java/share/common/enums/PlatformTypeEnum.java
View file @
251202cd
...
...
@@ -2,19 +2,19 @@ package share.common.enums;
public
enum
PlatformTypeEnum
{
//1:自营,2:美团
SELF
(
"1"
,
"自营"
),
MEITUAN
(
"2"
,
"美团"
),
TIKTOK
(
"3"
,
"抖音"
);
SELF
(
1
,
"自营"
),
MEITUAN
(
2
,
"美团"
),
TIKTOK
(
3
,
"抖音"
);
private
String
code
;
private
Integer
code
;
private
String
name
;
public
String
getCode
()
{
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
...
...
@@ -27,7 +27,7 @@ public enum PlatformTypeEnum {
}
PlatformTypeEnum
(
String
code
,
String
name
)
{
PlatformTypeEnum
(
Integer
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
...
...
share-quartz/src/main/java/share/quartz/task/RedisTask.java
View file @
251202cd
...
...
@@ -112,14 +112,14 @@ public class RedisTask {
if
(!
CollectionUtils
.
isEmpty
(
coupons
))
{
for
(
SConsumerCoupon
coupon
:
coupons
)
{
//美团复验券
if
(
ObjectUtil
.
isNotEmpty
(
coupon
.
getDealId
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
coupon
.
getDealId
())
&&
coupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
MEITUAN
.
getCode
())
)
{
TuangouReceiptGetConsumedReponseEntity
getconsumed
=
qpService
.
getconsumed
(
coupon
.
getCouponCode
(),
stores
.
stream
().
filter
(
store
->
store
.
getId
().
equals
(
coupon
.
getStoreId
())).
findFirst
().
get
().
getOpenShopUuid
());
if
(
getconsumed
==
null
)
{
expiredCoupons
.
add
(
coupon
.
getId
());
}
logger
.
info
(
"券码:{}->查询结束:{}"
,
coupon
.
getCouponCode
(),
getconsumed
);
}
else
if
(
StringUtils
.
isNoneEmpty
(
coupon
.
getSkuId
()))
{
}
else
if
(
StringUtils
.
isNoneEmpty
(
coupon
.
getSkuId
())
&&
coupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
MEITUAN
.
getCode
())
)
{
//抖音复验券
JSONObject
object
=
tiktokService
.
certificateGet
(
coupon
.
getCouponCode
());
JSONObject
certificate
=
object
.
getJSONObject
(
"certificate"
);
...
...
share-system/src/main/java/share/system/domain/SConsumerCoupon.java
View file @
251202cd
package
share
.
system
.
domain
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableLogic
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
lombok.Data
;
import
share.common.annotation.Excel
;
import
share.common.core.domain.BaseEntity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableLogic
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 优惠券领取记录对象 s_consumer_coupon
*
...
...
@@ -131,7 +129,7 @@ public class SConsumerCoupon extends BaseEntity
/** 平台类型(1:自营,2:美团) */
@Excel
(
name
=
"平台类型(1:自营,2:美团 3: 抖音)"
)
private
String
platformType
;
private
Integer
platformType
;
/** 有效期开始 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
...
...
share-system/src/main/java/share/system/domain/SCoupon.java
View file @
251202cd
package
share
.
system
.
domain
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
share.common.annotation.Excel
;
import
share.common.core.domain.BaseEntity
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 优惠券对象 s_coupon
*
...
...
@@ -126,7 +124,7 @@ public class SCoupon extends BaseEntity
/**
* 第三方平台类型(1:自营,2:美团)
*/
@Excel
(
name
=
"第三方平台类型(1:自营,2:美团)"
)
@Excel
(
name
=
"第三方平台类型(1:自营,2:美团
,3: 抖音
)"
)
private
Integer
platformType
;
/** 优惠券数量 */
...
...
share-system/src/main/java/share/system/service/impl/SConsumerCouponServiceImpl.java
View file @
251202cd
package
share
.
system
.
service
.
impl
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.Arrays
;
import
java.util.stream.Collectors
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.json.JSONArray
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
share.common.enums.*
;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
share.common.utils.StringUtils
;
import
share.system.domain.*
;
import
share.system.domain.vo.FrontTokenComponent
;
...
...
@@ -23,6 +18,10 @@ import share.system.mapper.SConsumerCouponMapper;
import
share.system.request.CouponRequest
;
import
share.system.service.*
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* 优惠券领取记录Service业务层处理
*
...
...
@@ -402,7 +401,7 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
newSConsumerCoupon
.
setOrderType
(
sCoupon
.
getOrderType
());
newSConsumerCoupon
.
setPackIds
(
sCoupon
.
getPackIds
());
newSConsumerCoupon
.
setSourceType
(
SourceTypeEnum
.
GIVE
.
getCode
());
newSConsumerCoupon
.
setPlatformType
(
String
.
valueOf
(
sCoupon
.
getPlatformType
()
));
newSConsumerCoupon
.
setPlatformType
(
sCoupon
.
getPlatformType
(
));
newSConsumerCoupon
.
setStartDate
(
sCoupon
.
getStartDate
());
newSConsumerCoupon
.
setEndDate
(
sCoupon
.
getEndDate
());
newSConsumerCoupon
.
setRemark
(
sCoupon
.
getRemark
());
...
...
share-system/src/main/java/share/system/service/impl/SCouponServiceImpl.java
View file @
251202cd
...
...
@@ -15,10 +15,7 @@ import org.springframework.util.ObjectUtils;
import
share.common.core.page.PageDomain
;
import
share.common.core.page.TableDataInfo
;
import
share.common.core.page.TableSupport
;
import
share.common.enums.CouponTypeEnum
;
import
share.common.enums.RoomType
;
import
share.common.enums.StoreType
;
import
share.common.enums.YesNoEnum
;
import
share.common.enums.*
;
import
share.common.utils.DateUtils
;
import
share.system.domain.SConsumerCoupon
;
import
share.system.domain.SCoupon
;
...
...
@@ -113,7 +110,14 @@ public class SCouponServiceImpl extends ServiceImpl<SCouponMapper, SCoupon> impl
sCoupon
.
setMaxDuration
(
DEFAULT_MAX_DURATION
);
sCoupon
.
setMinPrice
(
new
BigDecimal
(
"0.00"
));
sCoupon
.
setCreateTime
(
DateUtils
.
getNowDate
());
SCoupon
sCouponList
=
sCouponMapper
.
selectByDealgroupId
(
sCoupon
.
getDealgroupId
());
SCoupon
sCouponList
=
null
;
if
(
sCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
MEITUAN
.
getCode
()))
{
sCouponList
=
sCouponMapper
.
selectByDealgroupId
(
sCoupon
.
getDealgroupId
());
}
else
if
(
sCoupon
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
TIKTOK
.
getCode
()))
{
LambdaQueryWrapper
<
SCoupon
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
SCoupon:
:
getSkuId
,
sCoupon
.
getSkuId
());
sCouponList
=
sCouponMapper
.
selectOne
(
wrapper
);
}
if
(
ObjectUtils
.
isEmpty
(
sCouponList
))
{
return
sCouponMapper
.
insertSCoupon
(
sCoupon
);
}
else
{
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
251202cd
...
...
@@ -387,12 +387,12 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
byId
=
consumerCouponService
.
getById
(
request
.
getCouponId
());
if
(
Objects
.
nonNull
(
byId
))
{
if
(
byId
.
getUseStatus
().
equals
(
UserStatusEnum
.
UNUSED
.
getCode
()))
{
if
(
StringUtils
.
isNotEmpty
(
byId
.
getCouponCode
())
&&
ObjectUtil
.
isNotEmpty
(
byId
.
getDealId
()))
{
if
(
StringUtils
.
isNotEmpty
(
byId
.
getCouponCode
())
&&
ObjectUtil
.
isNotEmpty
(
byId
.
getDealId
())
&&
byId
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
MEITUAN
.
getCode
())
)
{
TuangouReceiptGetConsumedReponseEntity
getconsumed
=
qpService
.
getconsumed
(
byId
.
getCouponCode
(),
stores
.
stream
().
filter
(
store
->
store
.
getId
().
equals
(
byId
.
getStoreId
())).
findFirst
().
get
().
getOpenShopUuid
());
if
(
getconsumed
==
null
)
{
throw
new
RuntimeException
(
"优惠券异常,请稍后再试"
);
}
}
else
if
(
StringUtils
.
isNoneEmpty
(
byId
.
getSkuId
()))
{
}
else
if
(
StringUtils
.
isNoneEmpty
(
byId
.
getSkuId
())
&&
byId
.
getPlatformType
().
equals
(
PlatformTypeEnum
.
TIKTOK
.
getCode
())
)
{
//抖音复验券
JSONObject
object
=
tiktokService
.
certificateGet
(
byId
.
getCouponCode
());
JSONObject
certificate
=
object
.
getJSONObject
(
"certificate"
);
...
...
share-system/src/main/resources/mapper/system/SCouponMapper.xml
View file @
251202cd
...
...
@@ -170,7 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"orderType != null"
>
#{orderType},
</if>
<if
test=
"packIds != null"
>
#{packIds},
</if>
<if
test=
"dealgroupId != null"
>
#{dealgroupId},
</if>
<if
test=
"skuId != null"
>
#{skuId}
</if>
<if
test=
"skuId != null"
>
#{skuId}
,
</if>
<if
test=
"storeIds != null"
>
#{storeIds},
</if>
</trim>
</insert>
...
...
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