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
928c545a
Commit
928c545a
authored
Jan 15, 2021
by
liaoanyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户管理功能
parent
6b6a2439
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
308 additions
and
60 deletions
+308
-60
BannerMapper.java
...apper/src/main/java/cn/wisenergy/mapper/BannerMapper.java
+19
-2
RefillCardMapper.java
...r/src/main/java/cn/wisenergy/mapper/RefillCardMapper.java
+17
-0
BannerMapper.xml
wisenergy-mapper/src/main/resources/mapper/BannerMapper.xml
+21
-11
LoginRecordMapper.xml
...gy-mapper/src/main/resources/mapper/LoginRecordMapper.xml
+2
-2
UsersMapper.xml
wisenergy-mapper/src/main/resources/mapper/UsersMapper.xml
+13
-11
CardInfo.java
...-model/src/main/java/cn/wisenergy/model/app/CardInfo.java
+1
-1
AccountDto.java
...odel/src/main/java/cn/wisenergy/model/dto/AccountDto.java
+7
-0
BannerService.java
...src/main/java/cn/wisenergy/service/app/BannerService.java
+6
-4
BannerServiceImpl.java
...java/cn/wisenergy/service/app/impl/BannerServiceImpl.java
+109
-9
SchemeServiceImpl.java
...java/cn/wisenergy/service/app/impl/SchemeServiceImpl.java
+1
-1
UserServiceImpl.java
...n/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
+29
-16
BannerController.java
.../wisenergy/web/admin/controller/app/BannerController.java
+81
-2
UserController.java
...cn/wisenergy/web/admin/controller/app/UserController.java
+2
-1
No files found.
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/BannerMapper.java
View file @
928c545a
package
cn
.
wisenergy
.
mapper
;
package
cn
.
wisenergy
.
mapper
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.model.app.Banner
;
import
cn.wisenergy.model.app.Banner
;
import
cn.wisenergy.model.dto.BannerDto
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
...
@@ -14,7 +16,7 @@ public interface BannerMapper extends BaseMapper<Banner> {
...
@@ -14,7 +16,7 @@ public interface BannerMapper extends BaseMapper<Banner> {
* @param advertising 广告信息
* @param advertising 广告信息
* @return 广告信息
* @return 广告信息
*/
*/
Banner
add
(
Banner
advertising
);
int
add
(
Banner
advertising
);
/**
/**
* 编辑广告
* 编辑广告
...
@@ -37,11 +39,26 @@ public interface BannerMapper extends BaseMapper<Banner> {
...
@@ -37,11 +39,26 @@ public interface BannerMapper extends BaseMapper<Banner> {
* @param map 筛选参数
* @param map 筛选参数
* @return 广告列表
* @return 广告列表
*/
*/
List
<
Banner
>
getList
(
@Param
(
"map"
)
Map
<
String
,
Object
>
map
);
List
<
Banner
Dto
>
getList
(
Map
<
String
,
Object
>
map
);
/**
/**
* 统计广告条数
* 统计广告条数
* @return 广告条数
* @return 广告条数
*/
*/
int
count
();
int
count
();
/**
* 通过广告id查询广告信息
* @param id
* @return
*/
Banner
getById
(
@Param
(
"id"
)
Integer
id
);
/**
* 通过广告ID改变投放状态
* @param id
* @param status
* @return
*/
int
putIn
(
@Param
(
"id"
)
Integer
id
,
@Param
(
"status"
)
Integer
status
);
}
}
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/RefillCardMapper.java
View file @
928c545a
...
@@ -2,9 +2,13 @@ package cn.wisenergy.mapper;
...
@@ -2,9 +2,13 @@ package cn.wisenergy.mapper;
import
cn.wisenergy.model.app.PayRecord
;
import
cn.wisenergy.model.app.PayRecord
;
import
cn.wisenergy.model.app.RefillCard
;
import
cn.wisenergy.model.app.RefillCard
;
import
cn.wisenergy.model.app.UserInfo
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
public
interface
RefillCardMapper
extends
BaseMapper
<
RefillCardMapper
>
{
public
interface
RefillCardMapper
extends
BaseMapper
<
RefillCardMapper
>
{
/**
/**
...
@@ -20,4 +24,17 @@ public interface RefillCardMapper extends BaseMapper<RefillCardMapper> {
...
@@ -20,4 +24,17 @@ public interface RefillCardMapper extends BaseMapper<RefillCardMapper> {
* @return
* @return
*/
*/
int
update
(
@Param
(
"batchNumber"
)
String
batchNumber
);
int
update
(
@Param
(
"batchNumber"
)
String
batchNumber
);
/**
* 获取充值卡信息
* @param map
* @return
*/
List
<
RefillCard
>
getList
(
Map
<
String
,
Object
>
map
);
/**
* 获取充值卡数量
* @return
*/
Integer
getUserNumbers
();
}
}
wisenergy-mapper/src/main/resources/mapper/BannerMapper.xml
View file @
928c545a
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
</resultMap>
</resultMap>
<sql
id=
"table"
>
<sql
id=
"table"
>
advertising
banner
</sql>
</sql>
<sql
id=
"cols_all"
>
<sql
id=
"cols_all"
>
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
<if
test=
"updateTime != null"
>
and #{updateTime}
>
= update_time
</if>
<if
test=
"updateTime != null"
>
and #{updateTime}
>
= update_time
</if>
</sql>
</sql>
<insert
id=
"add"
parameterType=
"cn.wisenergy.model.app.Banner"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
<insert
id=
"add"
parameterType=
"cn.wisenergy.model.app.Banner"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
insert into
insert into
<include
refid=
"table"
/>
<include
refid=
"table"
/>
(
<include
refid=
"cols_exclude_id"
/>
)
(
<include
refid=
"cols_exclude_id"
/>
)
...
@@ -79,25 +79,35 @@
...
@@ -79,25 +79,35 @@
where id = #{id}
where id = #{id}
</delete>
</delete>
<select
id=
"getList"
resultType=
"cn.wisenergy.model.
app.Banner
"
>
<select
id=
"getList"
resultType=
"cn.wisenergy.model.
dto.BannerDto"
parameterType=
"map
"
>
select
select
<include
refid=
"cols_all"
/>
<include
refid=
"cols_all"
/>
from
from
<include
refid=
"table"
/>
<include
refid=
"table"
/>
<where>
order by create_time desc
is_delete=0
limit #{pageNo},#{pageSize}
limit #{startNum},#{endNum}
order by create_time desc
</where>
</select>
</select>
<select
id=
"count"
resultType=
"java.lang.Integer"
>
<select
id=
"count"
resultType=
"java.lang.Integer"
>
select count(1)
select count(1)
from
from
<include
refid=
"table"
/>
<include
refid=
"table"
/>
<where>
is_delete=0
</where>
</select>
</select>
<select
id=
"getById"
resultMap=
"advertisingMap"
>
select
<include
refid=
"cols_all"
/>
from
<include
refid=
"table"
/>
where id=#{id}
</select>
<update
id=
"putIn"
>
UPDATE
<include
refid=
"table"
/>
<set>
status=#{status}
</set>
<where>
id = #{id}
</where>
</update>
</mapper>
</mapper>
wisenergy-mapper/src/main/resources/mapper/LoginRecordMapper.xml
View file @
928c545a
...
@@ -22,11 +22,11 @@
...
@@ -22,11 +22,11 @@
</sql>
</sql>
<sql
id=
"cols_exclude_id"
>
<sql
id=
"cols_exclude_id"
>
user_id,type, operation
N
ame,ip, create_time,update_time
user_id,type, operation
_n
ame,ip, create_time,update_time
</sql>
</sql>
<sql
id=
"vals"
>
<sql
id=
"vals"
>
#{userId},#{type},#{operation
_n
ame},#{ip},now(),now()
#{userId},#{type},#{operation
N
ame},#{ip},now(),now()
</sql>
</sql>
<sql
id=
"updateCondition"
>
<sql
id=
"updateCondition"
>
...
...
wisenergy-mapper/src/main/resources/mapper/UsersMapper.xml
View file @
928c545a
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
</sql>
</sql>
<sql
id=
"cols_exclude_id"
>
<sql
id=
"cols_exclude_id"
>
user_name,password, phone,head_image,sex,school,
student
_type,is_delete,create_time,update_time
user_name,password, phone,head_image,sex,school,
exam
_type,is_delete,create_time,update_time
</sql>
</sql>
<sql
id=
"vals"
>
<sql
id=
"vals"
>
...
@@ -102,23 +102,25 @@
...
@@ -102,23 +102,25 @@
from
from
<include
refid=
"table"
/>
<include
refid=
"table"
/>
<where>
<where>
<if
test=
"userQueryVo.keyword != null"
>
(user_name LIKE CONCAT('%', #{keyword}, '%')) and
</if>
is_delete=0
is_delete=0
<if
test=
"
userQueryVo.
startTime != null"
>
<if
test=
"startTime != null"
>
and create_time
and create_time
between #{userQueryVo.startTime}
</if>
between #{startTime}
</if>
<if
test=
"workDayList != null"
>
and #{userQueryVo.endTime}
</if>
<if
test=
"endTime != null"
>
and #{endTime}
</if>
order by create_time desc
</where>
</where>
<if
test=
"
userQueryVo.pageNo!= null"
>
limit #{userQueryVo.
pageNo} ,
</if>
<if
test=
"
pageNo!= null"
>
limit #{
pageNo} ,
</if>
<if
test=
"
userQueryVo.pageSize!=null"
>
#{userQueryVo.
pageSize}
</if>
<if
test=
"
pageSize!=null"
>
#{
pageSize}
</if>
</select>
</select>
<select
id=
"getUserNumbers"
resultType=
"java.lang.Integer"
>
SELECT COUNT(id)
FROM
<include
refid=
"table"
/>
where is_delete=0
</select>
</mapper>
</mapper>
wisenergy-model/src/main/java/cn/wisenergy/model/app/CardInfo.java
View file @
928c545a
...
@@ -20,7 +20,7 @@ public class CardInfo implements Serializable {
...
@@ -20,7 +20,7 @@ public class CardInfo implements Serializable {
* 批次号
* 批次号
*/
*/
@ApiModelProperty
(
value
=
"批次号"
,
name
=
"batchNumber"
)
@ApiModelProperty
(
value
=
"批次号"
,
name
=
"batchNumber"
)
private
String
ba
tc
hNumber
;
private
String
ba
nt
hNumber
;
/**
/**
* 次数
* 次数
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/dto/AccountDto.java
View file @
928c545a
...
@@ -10,6 +10,13 @@ import java.io.Serializable;
...
@@ -10,6 +10,13 @@ import java.io.Serializable;
@ApiModel
(
value
=
"AccountDto"
)
@ApiModel
(
value
=
"AccountDto"
)
public
class
AccountDto
implements
Serializable
{
public
class
AccountDto
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
6722696621467423127L
;
private
static
final
long
serialVersionUID
=
-
6722696621467423127L
;
/**
* 管理员主键id
*/
@ApiModelProperty
(
name
=
"id"
,
value
=
"管理员主键id"
)
private
Integer
id
;
/**
/**
* 管理员账号
* 管理员账号
*/
*/
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/BannerService.java
View file @
928c545a
...
@@ -2,6 +2,7 @@ package cn.wisenergy.service.app;
...
@@ -2,6 +2,7 @@ package cn.wisenergy.service.app;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.model.app.Banner
;
import
cn.wisenergy.model.app.Banner
;
import
cn.wisenergy.model.dto.BannerDto
;
import
cn.wisenergy.model.vo.AdvertisingQueryVo
;
import
cn.wisenergy.model.vo.AdvertisingQueryVo
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
...
@@ -17,7 +18,7 @@ public interface BannerService {
...
@@ -17,7 +18,7 @@ public interface BannerService {
* @param advertising 广告信息
* @param advertising 广告信息
* @return 广告信息
* @return 广告信息
*/
*/
R
<
Banner
>
add
(
Banner
advertising
);
int
add
(
Banner
advertising
);
/**
/**
* 编辑广告
* 编辑广告
...
@@ -25,7 +26,7 @@ public interface BannerService {
...
@@ -25,7 +26,7 @@ public interface BannerService {
* @param advertising 广告信息
* @param advertising 广告信息
* @return true 成功 false 失败
* @return true 成功 false 失败
*/
*/
R
<
Boolean
>
edit
(
Banner
advertising
);
R
edit
(
Banner
advertising
);
/**
/**
* 获取详情
* 获取详情
...
@@ -33,7 +34,7 @@ public interface BannerService {
...
@@ -33,7 +34,7 @@ public interface BannerService {
* @param id 广告id
* @param id 广告id
* @return 详情
* @return 详情
*/
*/
R
<
Banner
>
getById
(
Integer
id
);
R
getById
(
Integer
id
);
/**
/**
* 获取广告分页列表
* 获取广告分页列表
...
@@ -41,7 +42,7 @@ public interface BannerService {
...
@@ -41,7 +42,7 @@ public interface BannerService {
* @param advertisingQueryVo 分页参数
* @param advertisingQueryVo 分页参数
* @return 分页结果集
* @return 分页结果集
*/
*/
R
<
PageInfo
<
Banner
>>
getList
(
AdvertisingQueryVo
advertisingQueryVo
);
R
<
PageInfo
<
Banner
Dto
>>
getList
(
AdvertisingQueryVo
advertisingQueryVo
);
/**
/**
* 开始/暂停投放广告
* 开始/暂停投放广告
...
@@ -51,4 +52,5 @@ public interface BannerService {
...
@@ -51,4 +52,5 @@ public interface BannerService {
* @return true 成功 false 失败
* @return true 成功 false 失败
*/
*/
R
<
Boolean
>
putIn
(
Integer
id
,
Integer
status
);
R
<
Boolean
>
putIn
(
Integer
id
,
Integer
status
);
}
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/BannerServiceImpl.java
View file @
928c545a
...
@@ -3,12 +3,19 @@ package cn.wisenergy.service.app.impl;
...
@@ -3,12 +3,19 @@ package cn.wisenergy.service.app.impl;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.mapper.BannerMapper
;
import
cn.wisenergy.mapper.BannerMapper
;
import
cn.wisenergy.model.app.Banner
;
import
cn.wisenergy.model.app.Banner
;
import
cn.wisenergy.model.dto.BannerDto
;
import
cn.wisenergy.model.vo.AdvertisingQueryVo
;
import
cn.wisenergy.model.vo.AdvertisingQueryVo
;
import
cn.wisenergy.service.app.BannerService
;
import
cn.wisenergy.service.app.BannerService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
java.util.HashMap
;
import
java.util.List
;
/**
/**
*@ Description: 广告接口是实现
*@ Description: 广告接口是实现
...
@@ -18,28 +25,121 @@ import org.springframework.stereotype.Service;
...
@@ -18,28 +25,121 @@ import org.springframework.stereotype.Service;
@Slf4j
@Slf4j
@Service
@Service
public
class
BannerServiceImpl
extends
ServiceImpl
<
BannerMapper
,
Banner
>
implements
BannerService
{
public
class
BannerServiceImpl
extends
ServiceImpl
<
BannerMapper
,
Banner
>
implements
BannerService
{
@Autowired
private
BannerMapper
bannerMapper
;
@Override
@Override
public
R
<
Banner
>
add
(
Banner
advertising
)
{
public
int
add
(
Banner
advertising
)
{
return
null
;
log
.
info
(
"BannerServiceImpl[].add[].input.param:advertising:{}"
+
advertising
);
//判断是否存在广告图片,给定初始值
if
(!
StringUtils
.
isEmpty
(
advertising
.
getImage
()))
{
advertising
.
setIsHaveImage
(
1
);
}
else
{
advertising
.
setIsHaveImage
(
0
);
}
advertising
.
setStatus
(
0
);
//数据添加
int
add
=
bannerMapper
.
add
(
advertising
);
return
add
;
}
}
@Override
@Override
public
R
<
Boolean
>
edit
(
Banner
advertising
)
{
public
R
edit
(
Banner
advertising
)
{
return
null
;
log
.
info
(
"BannerServiceImpl[].getById[].input.param:advertising"
+
advertising
);
if
(
null
==
advertising
){
return
R
.
error
(
"输入的参数有误"
);
}
if
(
advertising
.
getStatus
()<
0
||
advertising
.
getStatus
()>
1
){
return
R
.
error
(
"缺少重要数据"
);
}
int
edit
=
bannerMapper
.
edit
(
advertising
);
//判断数据是否修改成功
if
(
edit
==
0
)
{
return
R
.
error
(
"数据修改失败"
);
}
return
R
.
ok
();
}
}
@Override
@Override
public
R
<
Banner
>
getById
(
Integer
id
)
{
public
R
<
Banner
>
getById
(
Integer
id
)
{
return
null
;
log
.
info
(
"BannerServiceImpl[].getById[].input.param:id"
+
id
);
if
(
null
==
id
||
id
.
equals
(
""
))
{
return
R
.
error
(
"传入参数无效"
);
}
Banner
banner
=
bannerMapper
.
getById
(
id
);
if
(
null
==
banner
){
return
R
.
error
(
"数据获取失败"
);
}
return
R
.
ok
(
banner
);
}
}
@Override
@Override
public
R
<
PageInfo
<
Banner
>>
getList
(
AdvertisingQueryVo
advertisingQueryVo
)
{
public
R
<
PageInfo
<
BannerDto
>>
getList
(
AdvertisingQueryVo
advertisingQueryVo
)
{
return
null
;
log
.
info
(
"BannerServiceImpl[].getList[].input.param:advertisingQueryVo:{}"
+
advertisingQueryVo
);
if
(
null
==
advertisingQueryVo
)
{
return
R
.
error
(
"输入参数无效"
);
}
//数据验证
Integer
pageNo
=
advertisingQueryVo
.
getPageNo
();
Integer
pageSize
=
advertisingQueryVo
.
getPageSize
();
if
(
null
==
pageSize
||
pageSize
==
0
)
{
pageSize
=
10
;
}
if
(
null
==
pageNo
||
pageNo
==
0
)
{
pageNo
=
1
;
}
//封装参数
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>(
4
);
map
.
put
(
"pageNo"
,
pageNo
-
1
);
map
.
put
(
"pageSize"
,
pageSize
);
//查询数据;
List
<
BannerDto
>
list
=
bannerMapper
.
getList
(
map
);
//判断数据是否获取成功
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
R
.
error
(
"数据查询失败"
);
}
PageInfo
<
BannerDto
>
pageInfo
=
new
PageInfo
<>();
pageInfo
.
setTotal
(
bannerMapper
.
count
());
pageInfo
.
setPageNum
(
pageNo
);
pageInfo
.
setPageSize
(
pageSize
);
pageInfo
.
setList
(
list
);
return
R
.
ok
(
pageInfo
);
}
}
@Override
@Override
public
R
<
Boolean
>
putIn
(
Integer
id
,
Integer
status
)
{
public
R
putIn
(
Integer
id
,
Integer
status
)
{
return
null
;
log
.
info
(
"BannerServiceImpl[].putIn[].input.param,status,id"
+
status
,
id
);
//判断数据是否正确
if
(
id
==
null
||
id
.
equals
(
""
))
{
return
R
.
error
(
"缺少重要数据"
);
}
if
(
status
==
null
||
status
.
equals
(
""
))
{
return
R
.
error
(
"缺少重要数据"
);
}
if
(
status
<
0
||
status
>
1
){
return
R
.
error
(
"缺少重要数据"
);
}
//修改广告状态
int
i
=
bannerMapper
.
putIn
(
id
,
status
);
//判断数据是否修改成功
if
(
i
==
0
)
{
return
R
.
error
(
"数据修改失败"
);
}
return
R
.
ok
();
}
}
}
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/SchemeServiceImpl.java
View file @
928c545a
...
@@ -66,7 +66,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
...
@@ -66,7 +66,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
//3、保存方案查询记录
//3、保存方案查询记录
SchemeQueryRecord
schemeQueryRecord
=
new
SchemeQueryRecord
();
SchemeQueryRecord
schemeQueryRecord
=
new
SchemeQueryRecord
();
schemeQueryRecord
.
setMajorName
(
""
);
schemeQueryRecord
.
setMajorName
(
""
);
schemeQueryRecord
.
setStudentType
(
userInfo
.
get
Exam
Type
());
schemeQueryRecord
.
setStudentType
(
userInfo
.
get
Student
Type
());
schemeQueryRecord
.
setUserId
(
userInfo
.
getId
());
schemeQueryRecord
.
setUserId
(
userInfo
.
getId
());
schemeQueryRecord
.
setIsDelete
(
0
);
schemeQueryRecord
.
setIsDelete
(
0
);
double
score
=
Double
.
parseDouble
(
queryVo
.
getCultureGrade
())
+
Double
.
parseDouble
(
queryVo
.
getMajorGrade
());
double
score
=
Double
.
parseDouble
(
queryVo
.
getCultureGrade
())
+
Double
.
parseDouble
(
queryVo
.
getMajorGrade
());
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
View file @
928c545a
...
@@ -3,10 +3,8 @@ package cn.wisenergy.service.app.impl;
...
@@ -3,10 +3,8 @@ package cn.wisenergy.service.app.impl;
import
cn.wisenergy.common.constant.CommonAttributes
;
import
cn.wisenergy.common.constant.CommonAttributes
;
import
cn.wisenergy.common.utils.Md5Util
;
import
cn.wisenergy.common.utils.Md5Util
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.mapper.ScoreInfoMapper
;
import
cn.wisenergy.mapper.*
;
import
cn.wisenergy.mapper.UsersMapper
;
import
cn.wisenergy.model.app.*
;
import
cn.wisenergy.model.app.ScoreInfo
;
import
cn.wisenergy.model.app.UserInfo
;
import
cn.wisenergy.model.dto.UserCommitDto
;
import
cn.wisenergy.model.dto.UserCommitDto
;
import
cn.wisenergy.model.dto.UserInfoDto
;
import
cn.wisenergy.model.dto.UserInfoDto
;
import
cn.wisenergy.model.vo.UserInfoVo
;
import
cn.wisenergy.model.vo.UserInfoVo
;
...
@@ -42,42 +40,57 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, UserInfo> implemen
...
@@ -42,42 +40,57 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, UserInfo> implemen
@Autowired
@Autowired
private
ScoreInfoMapper
scoreInfoMapper
;
private
ScoreInfoMapper
scoreInfoMapper
;
@Autowired
private
LoginRecordMapper
loginRecordMapper
;
@Autowired
private
UserLimitMapper
userLimitMapper
;
@Autowired
private
PayRecordMapper
payRecordMapper
;
@Override
@Override
public
R
<
PageInfo
<
UserInfoDto
>>
getUserList
(
UserQueryVo
queryVo
)
{
public
R
<
PageInfo
<
UserInfoDto
>>
getUserList
(
UserQueryVo
queryVo
)
{
log
.
info
(
"volunteer_service[]UserServiceImpl[]getUserList[]input.param.queryVo:"
+
queryVo
);
log
.
info
(
"volunteer_service[]UserServiceImpl[]getUserList[]input.param.queryVo:"
+
queryVo
);
if
(
null
==
queryVo
)
{
return
R
.
error
(
"入参不能为空!"
);
}
pageHandle
(
queryVo
);
pageHandle
(
queryVo
);
//创建参数容器
//创建参数容器
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>(
4
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>(
4
);
//将参数放入容器中
//将参数放入容器中
map
.
put
(
"userQueryVo"
,
queryVo
);
map
.
put
(
"pageNo"
,
queryVo
.
getPageNo
());
map
.
put
(
"pageSize"
,
queryVo
.
getPageSize
());
map
.
put
(
"startTime"
,
queryVo
.
getStartTime
());
map
.
put
(
"endTime"
,
queryVo
.
getEndTime
());
//查询用户数据
//查询用户数据
List
<
UserInfo
>
list1
=
usersMapper
.
getList
(
map
);
List
<
UserInfo
>
list1
=
usersMapper
.
getList
(
map
);
int
total
=
0
;
List
<
UserInfoDto
>
list
=
new
ArrayList
<>();
List
<
UserInfoDto
>
list
=
new
ArrayList
<>();
//将集合遍历拿出用户id查询成绩信息
//将集合遍历拿出用户id查询成绩信息
for
(
UserInfo
userInfo
:
list1
)
{
for
(
UserInfo
userInfo
:
list1
)
{
//创建UserInfoDto返回对象
UserInfoDto
userInfoDto
=
new
UserInfoDto
();
UserInfoDto
userInfoDto
=
new
UserInfoDto
();
//查询成绩信息
//查询相关信息
ScoreInfo
scoreInfo
=
scoreInfoMapper
.
getById
(
userInfo
.
getId
());
ScoreInfo
scoreInfo
=
scoreInfoMapper
.
getById
(
userInfo
.
getId
());
LoginRecord
loginRecord
=
loginRecordMapper
.
getById
(
userInfo
.
getId
());
UserLimit
userLimit
=
userLimitMapper
.
getById
(
userInfo
.
getId
());
PayRecord
byId
=
payRecordMapper
.
getById
(
userInfo
.
getId
());
//将消息进行同步
//将消息进行同步
BeanUtils
.
copyProperties
(
userInfo
,
userInfoDto
);
BeanUtils
.
copyProperties
(
userInfo
,
userInfoDto
);
userInfoDto
.
setCultureGrade
(
scoreInfo
.
getCultureGrade
());
userInfoDto
.
setCultureGrade
(
scoreInfo
.
getCultureGrade
());
userInfoDto
.
setMajorGrade
(
scoreInfo
.
getMajorGrade
());
userInfoDto
.
setMajorGrade
(
scoreInfo
.
getMajorGrade
());
userInfoDto
.
setRegisterTime
(
userInfo
.
getCreateTime
());
userInfoDto
.
setRegisterTime
(
userInfo
.
getCreateTime
());
//将userInfoDto装入集合中
userInfoDto
.
setLastLoginTime
(
loginRecord
.
getUpdateTime
());
userInfoDto
.
setQueryLimit
(
userLimit
.
getUsableLimit
());
userInfoDto
.
setMoneyAmount
(
byId
.
getMoney
());
list
.
add
(
userInfoDto
);
list
.
add
(
userInfoDto
);
//统计数据总量
total
+=
1
;
}
}
System
.
out
.
println
(
total
+
" "
+
list1
);
PageInfo
<
UserInfoDto
>
info
=
new
PageInfo
<>();
PageInfo
<
UserInfoDto
>
info
=
new
PageInfo
<>();
info
.
setPageSize
(
queryVo
.
getPageSize
());
info
.
setPageSize
(
queryVo
.
getPageSize
());
info
.
setPageNum
(
queryVo
.
getPageNo
());
info
.
setPageNum
(
queryVo
.
getPageNo
());
info
.
setTotal
(
total
);
info
.
setTotal
(
usersMapper
.
getUserNumbers
()
);
info
.
setList
(
list
);
info
.
setList
(
list
);
return
R
.
ok
(
info
);
return
R
.
ok
(
info
);
}
}
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/BannerController.java
View file @
928c545a
package
cn
.
wisenergy
.
web
.
admin
.
controller
.
app
;
package
cn
.
wisenergy
.
web
.
admin
.
controller
.
app
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.model.app.Banner
;
import
cn.wisenergy.model.dto.BannerDto
;
import
cn.wisenergy.model.vo.AdvertisingQueryVo
;
import
cn.wisenergy.service.app.BannerService
;
import
com.github.pagehelper.PageInfo
;
import
io.swagger.annotations.Api
;
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
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.*
;
/**
/**
* @ Description: 管理端-广告管理
* @ Description: 管理端-广告管理
...
@@ -15,4 +25,73 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -15,4 +25,73 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping
(
"/banner"
)
@RequestMapping
(
"/banner"
)
@Slf4j
@Slf4j
public
class
BannerController
{
public
class
BannerController
{
@Autowired
private
BannerService
bannerService
;
@ApiOperation
(
value
=
"广告添加"
,
notes
=
"广告添加"
,
httpMethod
=
"POST"
)
@ApiImplicitParam
(
name
=
"advertising"
,
value
=
"广告数据"
,
dataType
=
"Banner"
)
@PostMapping
(
"/add"
)
public
R
add
(
@RequestBody
Banner
advertising
){
log
.
info
(
"BannerController[].add[].input.param:advertising{}"
+
advertising
);
if
(
StringUtils
.
isEmpty
(
advertising
))
{
return
R
.
error
(
"输入参数无效"
);
}
int
add
=
bannerService
.
add
(
advertising
);
if
(
add
==
0
)
{
return
R
.
error
(
"数据添加失败"
);
}
return
R
.
ok
();
}
@ApiOperation
(
value
=
"广告查询"
,
notes
=
"广告查询"
,
httpMethod
=
"POST"
)
@ApiImplicitParam
(
name
=
"advertisingQueryVo"
,
value
=
"分页数据"
,
dataType
=
"AdvertisingQueryVo"
)
@PostMapping
(
"/getList"
)
public
R
<
PageInfo
<
BannerDto
>>
add
(
@RequestBody
AdvertisingQueryVo
advertisingQueryVo
){
log
.
info
(
"BannerController[].add[].input.param:advertisingQueryVo{}"
+
advertisingQueryVo
);
R
<
PageInfo
<
BannerDto
>>
list
=
bannerService
.
getList
(
advertisingQueryVo
);
return
list
;
}
@ApiOperation
(
value
=
"查看详情"
,
notes
=
"查看详情"
,
httpMethod
=
"GET"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"广告id"
,
dataType
=
"int"
)
@GetMapping
(
"/getById"
)
public
R
<
Banner
>
getById
(
Integer
id
){
log
.
info
(
"BannerController[].getById[].input.param:id"
+
id
);
R
<
Banner
>
bannerR
=
bannerService
.
getById
(
id
);
return
bannerR
;
}
@ApiOperation
(
value
=
"广告投放"
,
notes
=
"广告投放"
,
httpMethod
=
"GET"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"广告id"
,
dataType
=
"int"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"广告状态:0:暂停中 1:投放中"
,
dataType
=
"int"
,
required
=
true
)
})
@GetMapping
(
"/putIn"
)
public
R
putIn
(
Integer
id
,
Integer
status
){
log
.
info
(
"BannerController[].putIn[].input.param:id,status"
+
id
,
status
);
R
booleanR
=
bannerService
.
putIn
(
id
,
status
);
//判断数据是否修改成功
if
(
booleanR
.
getCode
()==
0
)
{
return
booleanR
;
}
return
R
.
error
(
"数据修改失败"
);
}
@ApiOperation
(
value
=
"广告编辑"
,
notes
=
"广告编辑"
,
httpMethod
=
"POST"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"advertising"
,
value
=
"广告修改数据"
,
dataType
=
"Banner"
),
})
@PostMapping
(
"/edit"
)
public
R
edit
(
@RequestBody
Banner
advertising
){
log
.
info
(
"BannerController[].edit[].input.param:advertising:{}"
+
advertising
);
R
booleanR
=
bannerService
.
edit
(
advertising
);
//判断数据是否修改成功
if
(
booleanR
.
getCode
()==
0
)
{
return
booleanR
;
}
return
R
.
error
(
"数据修改失败"
);
}
}
}
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/UserController.java
View file @
928c545a
...
@@ -11,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -11,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -32,7 +33,7 @@ public class UserController {
...
@@ -32,7 +33,7 @@ public class UserController {
@ApiOperation
(
value
=
"用户管理"
,
notes
=
"用户管理"
,
httpMethod
=
"POST"
)
@ApiOperation
(
value
=
"用户管理"
,
notes
=
"用户管理"
,
httpMethod
=
"POST"
)
@ApiImplicitParam
(
name
=
"queryVo"
,
value
=
"用户信息"
,
dataType
=
"UserQueryVo"
)
@ApiImplicitParam
(
name
=
"queryVo"
,
value
=
"用户信息"
,
dataType
=
"UserQueryVo"
)
@PostMapping
(
"/manage"
)
@PostMapping
(
"/manage"
)
public
R
manageUser
(
UserQueryVo
queryVo
){
public
R
manageUser
(
@RequestBody
UserQueryVo
queryVo
){
log
.
info
(
"UserController[].manageUser[].input.param:queryV0:{}"
+
queryVo
);
log
.
info
(
"UserController[].manageUser[].input.param:queryV0:{}"
+
queryVo
);
//查询用户信息
//查询用户信息
R
<
PageInfo
<
UserInfoDto
>>
userList
=
userService
.
getUserList
(
queryVo
);
R
<
PageInfo
<
UserInfoDto
>>
userList
=
userService
.
getUserList
(
queryVo
);
...
...
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