Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
V
volunteer_service
Project
Project
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
licc
volunteer_service
Commits
7e58c1b2
Commit
7e58c1b2
authored
Jan 27, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码fix
parent
deb83406
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
21 deletions
+25
-21
R.java
...rgy-common/src/main/java/cn/wisenergy/common/utils/R.java
+17
-1
RefillCardServiceImpl.java
.../cn/wisenergy/service/app/impl/RefillCardServiceImpl.java
+2
-2
UserLimitServiceImpl.java
...a/cn/wisenergy/service/app/impl/UserLimitServiceImpl.java
+4
-0
UserServiceImpl.java
...n/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
+2
-2
SchemeController.java
.../wisenergy/web/admin/controller/app/SchemeController.java
+0
-11
UserLimitController.java
...senergy/web/admin/controller/app/UserLimitController.java
+0
-5
No files found.
wisenergy-common/src/main/java/cn/wisenergy/common/utils/R.java
View file @
7e58c1b2
...
...
@@ -46,7 +46,12 @@ public class R<T> implements Serializable {
public
R
(
T
data
,
String
msg
)
{
this
.
code
=
0
;
this
.
message
=
"success"
;
this
.
data
=
data
;
this
.
message
=
msg
;
}
public
R
(
int
code
,
String
msg
,
T
data
)
{
this
.
code
=
code
;
this
.
data
=
data
;
this
.
message
=
msg
;
}
...
...
@@ -119,4 +124,15 @@ public class R<T> implements Serializable {
return
new
R
<>(
code
,
msg
);
}
/**
* 请求失败,返回前台信息
*
* @param code 错误码
* @param msg 描述
* @return R
*/
public
static
<
T
>
R
<
T
>
error
(
int
code
,
String
msg
,
T
data
)
{
return
new
R
<>(
code
,
msg
,
data
);
}
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/RefillCardServiceImpl.java
View file @
7e58c1b2
...
...
@@ -120,9 +120,9 @@ public class RefillCardServiceImpl implements RefillCardService {
//子卡添加
for
(
int
i
=
0
;
i
<
byId
.
getCardNumber
();
i
++)
{
CardInfo
cardInfo
=
new
CardInfo
();
cardInfo
.
setBa
nt
hNumber
(
byId
.
getBatchNumber
());
cardInfo
.
setBa
tc
hNumber
(
byId
.
getBatchNumber
());
cardInfo
.
setIsDelete
(
0
);
cardInfo
.
setMoney
(
"10"
);
cardInfo
.
setMoney
(
498
);
cardInfo
.
setStatus
(
0
);
cardInfo
.
setLimit
(
3
);
cardInfo
.
setSecretKey
(
SecretkeyUtil
.
getSecretkey
());
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UserLimitServiceImpl.java
View file @
7e58c1b2
...
...
@@ -126,6 +126,10 @@ public class UserLimitServiceImpl extends ServiceImpl<UserLimitMapper, UserLimit
return
R
.
error
(
"用户查询信息不存在!"
);
}
if
(
userLimit
.
getUsableLimit
()
==
0
)
{
return
R
.
error
(
1
,
"您的查询次数已使用完了,请充值!"
,
false
);
}
//扣减用户可用查询次数
int
usableLimit
=
userLimit
.
getUsableLimit
()
-
1
;
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
View file @
7e58c1b2
...
...
@@ -73,13 +73,13 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
//查询相关信息
ScoreInfo
scoreInfo
=
scoreInfoMapper
.
getById
(
user
.
getId
());
LoginRecord
loginRecord
=
loginRecordMapper
.
getById
(
user
.
getId
());
UserLimit
userLimit
=
userLimitMapper
.
getById
(
user
.
getId
());
UserLimit
userLimit
=
userLimitMapper
.
getBy
User
Id
(
user
.
getId
());
List
<
PayRecord
>
byId
=
payRecordMapper
.
getById
(
user
.
getId
());
//计算累计充值金额
Integer
sumMoney
=
0
;
for
(
PayRecord
payRecord
:
byId
)
{
sumMoney
+=
Integer
.
valueOf
(
payRecord
.
getMoney
()
);
sumMoney
+=
payRecord
.
getMoney
(
);
}
//将消息进行同步
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/SchemeController.java
View file @
7e58c1b2
...
...
@@ -76,17 +76,6 @@ public class SchemeController {
return
R
.
ok
(
"添加成功"
);
}
@ApiOperation
(
value
=
"测试主键自增"
,
notes
=
"测试主键自增"
)
@ApiImplicitParam
(
name
=
"schemeInfo"
,
value
=
"信息"
,
dataType
=
"SchemeInfo"
)
@PostMapping
(
"/add"
)
public
R
<
SchemeInfo
>
add
(
@RequestBody
SchemeInfo
schemeInfo
)
{
R
<
SchemeInfo
>
scheme
=
volunteerService
.
add
(
schemeInfo
);
log
.
info
(
"scheme:"
+
scheme
);
return
scheme
;
}
@ApiOperation
(
value
=
"获取方案列表"
,
notes
=
"获取方案列表"
,
httpMethod
=
"GET"
)
@ApiImplicitParam
(
name
=
"queryVo"
,
value
=
"查询参数"
,
dataType
=
"SchemeQueryVo"
)
@GetMapping
(
"/getSchemeList"
)
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/UserLimitController.java
View file @
7e58c1b2
package
cn
.
wisenergy
.
web
.
admin
.
controller
.
app
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.model.app.Banner
;
import
cn.wisenergy.model.app.UserLimit
;
import
cn.wisenergy.model.app.Volunteer
;
import
cn.wisenergy.model.vo.AddLimitVo
;
import
cn.wisenergy.service.app.UserLimitService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* @author 86187
* @ Description: PC-用户查询次数
...
...
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