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
08291522
Commit
08291522
authored
Oct 23, 2023
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页的用户信息添加优惠卷数量
parent
538f83d0
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
8 deletions
+41
-8
SConsumerCouponController.java
...hare/web/controller/system/SConsumerCouponController.java
+13
-7
SConsumer.java
...e-system/src/main/java/share/system/domain/SConsumer.java
+4
-1
SConsumerCouponMapper.java
.../main/java/share/system/mapper/SConsumerCouponMapper.java
+2
-0
ISConsumerCouponService.java
...in/java/share/system/service/ISConsumerCouponService.java
+2
-0
SConsumerCouponServiceImpl.java
...share/system/service/impl/SConsumerCouponServiceImpl.java
+5
-0
SConsumerServiceImpl.java
.../java/share/system/service/impl/SConsumerServiceImpl.java
+12
-0
SConsumerCouponMapper.xml
...rc/main/resources/mapper/system/SConsumerCouponMapper.xml
+3
-0
No files found.
share-front/src/main/java/share/web/controller/system/SConsumerCouponController.java
View file @
08291522
package
share
.
web
.
controller
.
system
;
package
share
.
web
.
controller
.
system
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
share.common.core.controller.BaseController
;
import
share.common.core.controller.BaseController
;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.domain.AjaxResult
;
...
@@ -28,9 +28,13 @@ public class SConsumerCouponController extends BaseController {
...
@@ -28,9 +28,13 @@ public class SConsumerCouponController extends BaseController {
/**
/**
* 查询优惠券领取记录列表
* 查询优惠券领取记录列表
*/
*/
@PreAuthorize
(
"@ss.hasPermi('system:coupon:list')"
)
//
@PreAuthorize("@ss.hasPermi('system:coupon:list')")
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
SConsumerCoupon
sConsumerCoupon
)
{
public
TableDataInfo
list
(
String
useStatus
)
{
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
if
(
StringUtils
.
isNotBlank
(
useStatus
)){
sConsumerCoupon
.
setUseStatus
(
useStatus
);
}
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
sConsumerCoupon
.
setConsumerId
(
user
.
getId
());
sConsumerCoupon
.
setConsumerId
(
user
.
getId
());
startPage
();
startPage
();
...
@@ -41,17 +45,19 @@ public class SConsumerCouponController extends BaseController {
...
@@ -41,17 +45,19 @@ public class SConsumerCouponController extends BaseController {
/**
/**
* 获取优惠券领取记录详细信息
* 获取优惠券领取记录详细信息
*/
*/
@PreAuthorize
(
"@ss.hasPermi('system:coupon:query')"
)
//
@PreAuthorize("@ss.hasPermi('system:coupon:query')")
@GetMapping
(
value
=
"/{id}"
)
@GetMapping
(
value
=
"/{id}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
return
success
(
sConsumerCouponService
.
selectSConsumerCouponById
(
id
));
return
success
(
sConsumerCouponService
.
selectSConsumerCouponById
(
id
));
}
}
@PreAuthorize
(
"@ss.hasPermi('system:coupon:list')"
)
// @PreAuthorize("@ss.hasPermi('system:coupon:list')")
@GetMapping
(
"/query"
)
@PostMapping
(
"/query"
)
public
List
<
SConsumerCoupon
>
query
(
SConsumerCoupon
sConsumerCoupon
)
{
public
List
<
SConsumerCoupon
>
query
(
@RequestBody
SConsumerCoupon
sConsumerCoupon
)
{
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
sConsumerCoupon
.
setUseStatus
(
"0"
);
sConsumerCoupon
.
setConsumerId
(
user
.
getId
());
sConsumerCoupon
.
setConsumerId
(
user
.
getId
());
return
sConsumerCouponService
.
selectSConsumerCouponList
(
sConsumerCoupon
);
return
sConsumerCouponService
.
selectSConsumerCouponList
(
sConsumerCoupon
);
}
}
...
...
share-system/src/main/java/share/system/domain/SConsumer.java
View file @
08291522
...
@@ -18,7 +18,7 @@ import share.common.core.domain.BaseEntity;
...
@@ -18,7 +18,7 @@ import share.common.core.domain.BaseEntity;
* @date 2023-09-27
* @date 2023-09-27
*/
*/
@Data
@Data
public
class
SConsumer
extends
BaseEntity
public
class
SConsumer
{
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
@@ -88,4 +88,7 @@ public class SConsumer extends BaseEntity
...
@@ -88,4 +88,7 @@ public class SConsumer extends BaseEntity
@ApiModelProperty
(
value
=
"最后一次登录时间"
)
@ApiModelProperty
(
value
=
"最后一次登录时间"
)
private
Date
lastLoginTime
;
private
Date
lastLoginTime
;
@ApiModelProperty
(
value
=
"优惠卷数量"
)
private
Integer
number
;
}
}
share-system/src/main/java/share/system/mapper/SConsumerCouponMapper.java
View file @
08291522
...
@@ -59,4 +59,6 @@ public interface SConsumerCouponMapper extends BaseMapper<SConsumerCoupon>
...
@@ -59,4 +59,6 @@ public interface SConsumerCouponMapper extends BaseMapper<SConsumerCoupon>
* @return 结果
* @return 结果
*/
*/
public
int
deleteSConsumerCouponByIds
(
Long
[]
ids
);
public
int
deleteSConsumerCouponByIds
(
Long
[]
ids
);
int
selectSConsumerCouponConut
(
SConsumerCoupon
sConsumerCoupon
);
}
}
share-system/src/main/java/share/system/service/ISConsumerCouponService.java
View file @
08291522
...
@@ -59,4 +59,6 @@ public interface ISConsumerCouponService extends IService<SConsumerCoupon>
...
@@ -59,4 +59,6 @@ public interface ISConsumerCouponService extends IService<SConsumerCoupon>
* @return 结果
* @return 结果
*/
*/
public
int
deleteSConsumerCouponById
(
Long
id
);
public
int
deleteSConsumerCouponById
(
Long
id
);
int
selectSConsumerCouponConut
(
SConsumerCoupon
sConsumerCoupon
);
}
}
share-system/src/main/java/share/system/service/impl/SConsumerCouponServiceImpl.java
View file @
08291522
...
@@ -94,4 +94,9 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
...
@@ -94,4 +94,9 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
{
{
return
sConsumerCouponMapper
.
deleteSConsumerCouponById
(
id
);
return
sConsumerCouponMapper
.
deleteSConsumerCouponById
(
id
);
}
}
@Override
public
int
selectSConsumerCouponConut
(
SConsumerCoupon
sConsumerCoupon
)
{
return
sConsumerCouponMapper
.
selectSConsumerCouponConut
(
sConsumerCoupon
);
}
}
}
share-system/src/main/java/share/system/service/impl/SConsumerServiceImpl.java
View file @
08291522
...
@@ -15,11 +15,13 @@ import share.common.constant.SmsConstants;
...
@@ -15,11 +15,13 @@ import share.common.constant.SmsConstants;
import
share.common.exception.base.BaseException
;
import
share.common.exception.base.BaseException
;
import
share.common.utils.BaseUtil
;
import
share.common.utils.BaseUtil
;
import
share.common.utils.DateUtil
;
import
share.common.utils.DateUtil
;
import
share.system.domain.SConsumerCoupon
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.SConsumerVo
;
import
share.system.domain.vo.SConsumerVo
;
import
share.system.mapper.SConsumerMapper
;
import
share.system.mapper.SConsumerMapper
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SConsumer
;
import
share.system.request.RegisterThirdSConsumerRequest
;
import
share.system.request.RegisterThirdSConsumerRequest
;
import
share.system.service.ISConsumerCouponService
;
import
share.system.service.SConsumerService
;
import
share.system.service.SConsumerService
;
/**
/**
...
@@ -37,6 +39,9 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
...
@@ -37,6 +39,9 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
@Autowired
@Autowired
private
FrontTokenComponent
tokenComponet
;
private
FrontTokenComponent
tokenComponet
;
@Autowired
private
ISConsumerCouponService
sConsumerCouponService
;
/**
/**
* 查询会员用户
* 查询会员用户
*
*
...
@@ -153,6 +158,13 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
...
@@ -153,6 +158,13 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
@Override
@Override
public
SConsumer
getSConsumer
()
{
public
SConsumer
getSConsumer
()
{
SConsumer
currentUser
=
getInfo
();
SConsumer
currentUser
=
getInfo
();
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
sConsumerCoupon
.
setConsumerId
(
currentUser
.
getId
());
sConsumerCoupon
.
setUseStatus
(
"0"
);
int
count
=
sConsumerCouponService
.
selectSConsumerCouponConut
(
sConsumerCoupon
);
if
(
count
>
0
){
currentUser
.
setNumber
(
count
);
}
if
(
ObjectUtil
.
isNull
(
currentUser
))
{
if
(
ObjectUtil
.
isNull
(
currentUser
))
{
throw
new
BaseException
(
"您的登录已过期,请先登录"
);
throw
new
BaseException
(
"您的登录已过期,请先登录"
);
}
}
...
...
share-system/src/main/resources/mapper/system/SConsumerCouponMapper.xml
View file @
08291522
...
@@ -67,6 +67,9 @@
...
@@ -67,6 +67,9 @@
<include
refid=
"selectSConsumerCouponVo"
/>
<include
refid=
"selectSConsumerCouponVo"
/>
where id = #{id}
where id = #{id}
</select>
</select>
<select
id=
"selectSConsumerCouponConut"
resultType=
"java.lang.Integer"
>
select count(1) from s_consumer_coupon where consumer_id = #{consumerId} and use_status = 0
</select>
<insert
id=
"insertSConsumerCoupon"
parameterType=
"SConsumerCoupon"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insertSConsumerCoupon"
parameterType=
"SConsumerCoupon"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into s_consumer_coupon
insert into s_consumer_coupon
...
...
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