Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust-api
Project
Project
Details
Activity
Releases
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
李伟
cust-api
Commits
9a5783bb
Commit
9a5783bb
authored
Feb 08, 2025
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询当前用户金币余额以及充值金币
parent
e6b32a19
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
62 additions
and
4 deletions
+62
-4
AppMemGoldCoinFlowController.java
...GoldCoinFlow/controller/AppMemGoldCoinFlowController.java
+10
-0
AppMemInfoController.java
...isoft/app/appMemInfo/controller/AppMemInfoController.java
+0
-1
MemGoldCoinFlowRepository.java
...siness/memGoldCoinFlow/dao/MemGoldCoinFlowRepository.java
+6
-0
MemGoldCoinFlow.java
...soft/business/memGoldCoinFlow/entity/MemGoldCoinFlow.java
+7
-0
MemGoldCoinFlowService.java
...iness/memGoldCoinFlow/service/MemGoldCoinFlowService.java
+4
-0
MemGoldCoinFlowServiceImpl.java
...GoldCoinFlow/service/impl/MemGoldCoinFlowServiceImpl.java
+23
-3
MemInfo.java
...ain/java/org/rcisoft/business/memInfo/entity/MemInfo.java
+7
-0
MemGoldCoinFlowMapper.xml
...business/memGoldCoinFlow.mapper/MemGoldCoinFlowMapper.xml
+5
-0
No files found.
src/main/java/org/rcisoft/app/appMemGoldCoinFlow/controller/AppMemGoldCoinFlowController.java
View file @
9a5783bb
...
...
@@ -50,4 +50,14 @@ public class AppMemGoldCoinFlowController extends CyPaginationController<MemGold
memGoldCoinFlow
);
}
@CyOpeLogAnno
(
title
=
"system-goldCoinFlow管理-查询goldCoinFlow管理"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@Operation
(
summary
=
"查询当前用户金币余额"
,
description
=
"查询当前用户金币余额"
)
@Parameters
({
@Parameter
(
name
=
"businessId"
,
description
=
"businessId"
,
required
=
true
)})
@GetMapping
(
"/memGoldCoinFlow/balance"
)
public
CyResult
balance
()
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
memGoldCoinFlowServiceImpl
.
balance
());
}
}
src/main/java/org/rcisoft/app/appMemInfo/controller/AppMemInfoController.java
View file @
9a5783bb
...
...
@@ -366,7 +366,6 @@ public class AppMemInfoController extends CyPaginationController<MemInfo> {
@CyOpeLogAnno
(
title
=
"system-会员表管理-留言"
,
businessType
=
CyLogTypeEnum
.
INSERT
)
@Operation
(
summary
=
"留言"
,
description
=
"留言"
)
@PostMapping
(
value
=
"/memInfo/leaveMessage"
)
// @CyEncryptSm4Anno
public
CyResult
leaveMessage
(
@Valid
@RequestBody
UserLeaveMessageDTO
dto
,
BindingResult
bindingResult
)
{
CyPersistModel
data
=
memInfoServiceImpl
.
leaveMessage
(
dto
);
return
CyResultGenUtil
.
builder
(
data
,
...
...
src/main/java/org/rcisoft/business/memGoldCoinFlow/dao/MemGoldCoinFlowRepository.java
View file @
9a5783bb
...
...
@@ -6,6 +6,7 @@ import org.rcisoft.core.model.CyPageInfo;
import
org.apache.ibatis.annotations.Param
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
java.util.List
;
/**
...
...
@@ -22,5 +23,10 @@ public interface MemGoldCoinFlowRepository extends CyBaseMapper<MemGoldCoinFlow>
*
*/
IPage
<
MemGoldCoinFlow
>
queryMemGoldCoinFlowsPaged
(
CyPageInfo
cyPageInfo
,
@Param
(
"entity"
)
MemGoldCoinFlow
memGoldCoinFlow
);
/**
* 查询当前用户金币余额
*/
Integer
balance
(
Integer
userId
);
}
src/main/java/org/rcisoft/business/memGoldCoinFlow/entity/MemGoldCoinFlow.java
View file @
9a5783bb
package
org
.
rcisoft
.
business
.
memGoldCoinFlow
.
entity
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.*
;
...
...
@@ -62,6 +63,12 @@ public class MemGoldCoinFlow extends CyIdIncreEntity<MemGoldCoinFlow> {
@Excel
(
name
=
"目标id,用户id"
,
orderNum
=
"5"
,
width
=
20
)
private
BigInteger
targetId
;
//现在的余额
@TableField
(
exist
=
false
)
private
Integer
balance
;
//现在的余额
@TableField
(
exist
=
false
)
private
Integer
memberId
;
}
src/main/java/org/rcisoft/business/memGoldCoinFlow/service/MemGoldCoinFlowService.java
View file @
9a5783bb
...
...
@@ -70,4 +70,8 @@ public interface MemGoldCoinFlowService {
*/
List
<
MemGoldCoinFlow
>
export
(
MemGoldCoinFlow
memGoldCoinFlow
);
/**
* 查询当前用户金币余额
*/
Integer
balance
();
}
src/main/java/org/rcisoft/business/memGoldCoinFlow/service/impl/MemGoldCoinFlowServiceImpl.java
View file @
9a5783bb
...
...
@@ -5,8 +5,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
org.rcisoft.business.memGoldCoinFlow.dao.MemGoldCoinFlowRepository
;
import
org.rcisoft.business.memGoldCoinFlow.entity.MemGoldCoinFlow
;
import
org.rcisoft.business.memGoldCoinFlow.service.MemGoldCoinFlowService
;
import
org.rcisoft.business.memInfo.dao.MemInfoRepository
;
import
org.rcisoft.business.memInfo.entity.MemInfo
;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Isolation
;
import
org.springframework.transaction.annotation.Propagation
;
...
...
@@ -24,6 +27,8 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public
class
MemGoldCoinFlowServiceImpl
extends
ServiceImpl
<
MemGoldCoinFlowRepository
,
MemGoldCoinFlow
>
implements
MemGoldCoinFlowService
{
@Autowired
private
MemInfoRepository
memInfoRepository
;
/**
* 保存 金币流水表
...
...
@@ -33,10 +38,15 @@ public class MemGoldCoinFlowServiceImpl extends ServiceImpl<MemGoldCoinFlowRepos
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
CyPersistModel
persist
(
MemGoldCoinFlow
memGoldCoinFlow
){
//增加操作
//增加到金币流水表
memGoldCoinFlow
.
setEndCount
(
memGoldCoinFlow
.
getCount
()
+
memGoldCoinFlow
.
getBalance
());
int
line
=
baseMapper
.
insert
(
memGoldCoinFlow
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()+
"新增了ID为"
+
memGoldCoinFlow
.
getBusinessId
()+
"的金币流水表信息"
);
//修改会员表的金币余额
MemInfo
memInfo
=
new
MemInfo
();
memInfo
.
setBusinessId
(
memGoldCoinFlow
.
getMemberId
());
memInfo
.
setGoldCoinsCount
(
memGoldCoinFlow
.
getCount
()
+
memGoldCoinFlow
.
getBalance
());
memInfoRepository
.
updateById
(
memInfo
);
//增加订单信息
return
new
CyPersistModel
(
line
);
}
...
...
@@ -125,4 +135,14 @@ public class MemGoldCoinFlowServiceImpl extends ServiceImpl<MemGoldCoinFlowRepos
return
memGoldCoinFlowList
;
}
/**
* 查询当前用户金币余额
*/
@Override
public
Integer
balance
()
{
Integer
userId
=
Integer
.
valueOf
(
CyUserUtil
.
getAuthenBusinessId
());
Integer
balance
=
baseMapper
.
balance
(
userId
);
return
balance
;
}
}
src/main/java/org/rcisoft/business/memInfo/entity/MemInfo.java
View file @
9a5783bb
...
...
@@ -377,6 +377,13 @@ public class MemInfo extends CyIdIncreEntity<MemInfo> {
*/
private
Integer
memLikedCount
;
/**
* @desc 金币数
* @column gold_coins_count
* @default
*/
private
Integer
goldCoinsCount
;
/**
* 开始时间
*/
...
...
src/main/resources/mapper/business/memGoldCoinFlow.mapper/MemGoldCoinFlowMapper.xml
View file @
9a5783bb
...
...
@@ -73,4 +73,9 @@
</if>
ORDER BY business_id DESC
</select>
<select
id=
"balance"
resultType=
"java.lang.Integer"
>
select mi.gold_coins_count
from mem_info mi
where user_id = #{userId}
</select>
</mapper>
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