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
a849fb41
Commit
a849fb41
authored
Jan 06, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除无用代码2
parent
cab5cc54
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
263 additions
and
185 deletions
+263
-185
CameraMapper.java
...apper/src/main/java/cn/wisenergy/mapper/CameraMapper.java
+0
-52
UsersMapper.java
...mapper/src/main/java/cn/wisenergy/mapper/UsersMapper.java
+6
-6
UsersMapper.xml
wisenergy-mapper/src/main/resources/mapper/UsersMapper.xml
+5
-5
UserInfo.java
...-model/src/main/java/cn/wisenergy/model/app/UserInfo.java
+125
-0
BaseEntity.java
...l/src/main/java/cn/wisenergy/model/common/BaseEntity.java
+35
-0
Daosupport.java
...ce/src/main/java/cn/wisenergy/service/app/Daosupport.java
+26
-0
UserService.java
...e/src/main/java/cn/wisenergy/service/app/UserService.java
+17
-0
DaoSupportImpl.java
...in/java/cn/wisenergy/service/app/impl/DaoSupportImpl.java
+49
-0
CameraController.java
.../wisenergy/web/admin/controller/app/CameraController.java
+0
-78
FileUploadController.java
...energy/web/admin/controller/app/FileUploadController.java
+0
-44
No files found.
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/CameraMapper.java
deleted
100644 → 0
View file @
cab5cc54
package
cn
.
wisenergy
.
mapper
;
import
cn.wisenergy.model.app.Camera
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* @ Description : 摄像机dao
* @ Author : lcc
* @ CreateDate : 2020/11/3 10:33
*/
@Mapper
public
interface
CameraMapper
extends
BaseMapper
<
Camera
>
{
int
add
(
Camera
camera
);
int
modify
(
Camera
camera
);
int
delById
(
@Param
(
"id"
)
Integer
id
);
List
<
Camera
>
getList
(
Map
<
String
,
Object
>
map
);
int
countNumber
(
@Param
(
"cameraNumber"
)
String
cameraNumber
);
/**
* 检查编辑是否重复
* @param cameraNumber
* @return
*/
int
checkNumber
(
@Param
(
"id"
)
Integer
id
,
@Param
(
"cameraNumber"
)
String
cameraNumber
);
/**
* 根据垃圾站id,统计该垃圾站下的摄像头数量
* @param rubbishId 垃圾站id
* @return 摄像头数量
*/
int
countByRubbishId
(
@Param
(
"rubbishId"
)
Integer
rubbishId
);
List
<
Camera
>
getByRubbishId
(
@Param
(
"rubbishId"
)
Integer
rubbishId
);
/**
* 通过摄像机编号获取摄像机
* @param cameraNumber
* @return
*/
List
<
Camera
>
getByNumber
(
@Param
(
"list"
)
List
<
String
>
cameraNumber
);
int
count
();
}
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/
Account
UsersMapper.java
→
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/UsersMapper.java
View file @
a849fb41
package
cn
.
wisenergy
.
mapper
;
import
cn.wisenergy.model.app.
AccountUsers
;
import
cn.wisenergy.model.app.
UserInfo
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
@Mapper
public
interface
AccountUsersMapper
extends
BaseMapper
<
AccountUsers
>
{
public
interface
UsersMapper
extends
BaseMapper
<
UserInfo
>
{
/**
* 获取用户列表
* @return
*/
List
<
AccountUsers
>
getUserList
(
@Param
(
"keyword"
)
String
keyword
);
List
<
UserInfo
>
getUserList
(
@Param
(
"keyword"
)
String
keyword
);
List
<
AccountUserVo
>
getUserNameList
();
AccountUsers
getByName
(
@Param
(
"nickName"
)
String
nickName
);
UserInfo
getByName
(
@Param
(
"nickName"
)
String
nickName
);
AccountUsers
getById
(
@Param
(
"id"
)
Integer
id
);
UserInfo
getById
(
@Param
(
"id"
)
Integer
id
);
AccountUsers
getByAutoId
(
@Param
(
"autoId"
)
String
autoId
);
UserInfo
getByAutoId
(
@Param
(
"autoId"
)
String
autoId
);
int
count
();
...
...
wisenergy-mapper/src/main/resources/mapper/
Account
UsersMapper.xml
→
wisenergy-mapper/src/main/resources/mapper/UsersMapper.xml
View file @
a849fb41
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wisenergy.mapper.
Account
UsersMapper"
>
<mapper
namespace=
"cn.wisenergy.mapper.UsersMapper"
>
<select
id=
"getUserList"
resultType=
"cn.wisenergy.model.app.
AccountUsers
"
>
<select
id=
"getUserList"
resultType=
"cn.wisenergy.model.app.
UserInfo
"
>
select *
from account_users
<where>
...
...
@@ -17,19 +17,19 @@
select id,auto_id,nickname
from account_users
</select>
<select
id=
"getByName"
resultType=
"cn.wisenergy.model.app.
AccountUsers
"
parameterType=
"java.lang.String"
>
<select
id=
"getByName"
resultType=
"cn.wisenergy.model.app.
UserInfo
"
parameterType=
"java.lang.String"
>
select *
from account_users
where nickname=#{nickName}
</select>
<select
id=
"getById"
resultType=
"cn.wisenergy.model.app.
AccountUsers
"
parameterType=
"java.lang.Integer"
>
<select
id=
"getById"
resultType=
"cn.wisenergy.model.app.
UserInfo
"
parameterType=
"java.lang.Integer"
>
select *
from account_users
where id=#{id}
</select>
<select
id=
"getByAutoId"
resultType=
"cn.wisenergy.model.app.
AccountUsers
"
parameterType=
"java.lang.String"
>
<select
id=
"getByAutoId"
resultType=
"cn.wisenergy.model.app.
UserInfo
"
parameterType=
"java.lang.String"
>
select *
from account_users
where auto_id=#{autoId}
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/app/UserInfo.java
0 → 100644
View file @
a849fb41
package
cn
.
wisenergy
.
model
.
app
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @ Description : 用户
* @ Author : lcc
* @ CreateDate : 2020/11/8 19:59
*/
@Data
@ApiModel
(
value
=
"AccountUsers"
)
public
class
UserInfo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
2525339404301884673L
;
private
Integer
id
;
private
Date
createTime
;
private
String
createUserAutoId
;
private
Date
updateTime
;
private
String
updateUserAutoId
;
private
Integer
isDelete
;
private
Integer
sort
;
/**
* 有前后缀的自动编号
*/
private
String
autoId
;
/**
* oa的用户编号
*/
private
String
oaAutoId
;
/**
* 权限编号
*/
private
Integer
roleId
;
/**
* 权限2编号
*/
private
Integer
role2Id
;
/**
* 等级编号
*/
private
String
lvlId
;
/**
* 登录名
*/
private
String
userName
;
/**
* 真实姓名
*/
private
String
nickName
;
/**
* 组织架构部门编号
*/
private
String
organizationAutoId
;
/**
* 组织架构部门
*/
private
String
organizationName
;
/**
* 父级组织架构编号
*/
private
String
pOrganizationAutoId
;
/**
* 邮箱
*/
private
String
email
;
/**
* 电话
*/
private
String
mobile
;
/**
* 超级管理员
*/
private
Integer
isSupper
;
/**
* 激活
*/
private
Integer
isActive
;
/**
* 自助用户
*/
private
Integer
isSelf
;
/**
* 自助用户是否通过审核
*/
private
Integer
isReview
;
private
String
accessToken
;
private
Integer
tokenExpired
;
/**
* 微信openId
*/
private
String
wxOpenId
;
/**
* 微信公众号
*/
private
String
wxSubOpenId
;
}
wisenergy-model/src/main/java/cn/wisenergy/model/common/BaseEntity.java
0 → 100644
View file @
a849fb41
package
cn
.
wisenergy
.
model
.
common
;
import
java.io.Serializable
;
import
java.util.Date
;
import
com.fasterxml.jackson.annotation.JsonAutoDetect
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@JsonAutoDetect
(
creatorVisibility
=
JsonAutoDetect
.
Visibility
.
NONE
,
fieldVisibility
=
JsonAutoDetect
.
Visibility
.
NONE
,
getterVisibility
=
JsonAutoDetect
.
Visibility
.
NONE
,
isGetterVisibility
=
JsonAutoDetect
.
Visibility
.
NONE
,
setterVisibility
=
JsonAutoDetect
.
Visibility
.
NONE
)
public
abstract
class
BaseEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
7151370108706942192L
;
/**
* 创建时间
*/
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
;
/**
* 修改时间
*/
@ApiModelProperty
(
"修改时间"
)
private
Date
updateTime
;
/**
* 删除标记
*/
@ApiModelProperty
(
"是否删除 1,删除;0,未删除"
)
private
String
is_delete
;
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/Daosupport.java
0 → 100644
View file @
a849fb41
package
cn
.
wisenergy
.
service
.
app
;
import
java.util.List
;
public
interface
Daosupport
{
/**
* 查询单一结果集<br/>
* 并将结果转为<code>int</code>型返回
* @param sql 查询的sql语句,确定结果为一行一列,且为数字型
* @param args 对应sql语句中的参数值
* @return
*/
Integer
queryForInt
(
String
sql
,
Object
...
args
);
/**
* 查询多行结果集<br/>
* 并将结果转为<code>List<T></code>
* @param sql 查询的sql语句
* @param clazz <code><T></code>的Class对象
* @param args 对应sql语句中的参数值
* @return 列表中元素为<code>T</code>的<code>List</code>
*/
<
T
>
List
<
T
>
queryForList
(
String
sql
,
Class
<
T
>
clazz
,
Object
...
args
);
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/UserService.java
0 → 100644
View file @
a849fb41
package
cn
.
wisenergy
.
service
.
app
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.model.app.UserInfo
;
import
java.util.List
;
public
interface
UserService
{
/**
* 获取用户列表信息
* @return
*/
R
<
List
<
UserInfo
>>
getUserList
(
String
keyword
);
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/DaoSupportImpl.java
0 → 100644
View file @
a849fb41
package
cn
.
wisenergy
.
service
.
app
.
impl
;
import
cn.wisenergy.service.app.Daosupport
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.dao.EmptyResultDataAccessException
;
import
org.springframework.jdbc.core.BeanPropertyRowMapper
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
public
class
DaoSupportImpl
implements
Daosupport
{
private
JdbcTemplate
jdbcTemplate
;
/**
* 日志记录
*/
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
/**
* 实例化jdbcTemplate
*/
public
DaoSupportImpl
(
JdbcTemplate
jdbcTemplate
){
this
.
jdbcTemplate
=
jdbcTemplate
;
}
@Override
public
Integer
queryForInt
(
String
sql
,
Object
...
args
)
{
try
{
Integer
value
=
jdbcTemplate
.
queryForObject
(
sql
,
Integer
.
class
,
args
);
return
value
==
null
?
0
:
value
;
}
catch
(
EmptyResultDataAccessException
e
){
return
0
;
}
catch
(
RuntimeException
e
)
{
this
.
logger
.
error
(
e
.
getMessage
(),
e
);
throw
e
;
}
}
@Override
public
<
T
>
List
<
T
>
queryForList
(
String
sql
,
Class
<
T
>
clazz
,
Object
...
args
)
{
return
this
.
jdbcTemplate
.
query
(
sql
,
new
BeanPropertyRowMapper
<
T
>(
clazz
),
args
);
}
}
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/CameraController.java
deleted
100644 → 0
View file @
cab5cc54
package
cn
.
wisenergy
.
web
.
admin
.
controller
.
app
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.model.app.Camera
;
import
cn.wisenergy.service.app.CameraService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
/**
* @ Description : 摄像机控制层
* @ Author : lcc
* @ CreateDate : 2020/11/3 16:45
*/
@RestController
@Api
(
tags
=
"系统设置--摄像机管理"
)
@RequestMapping
(
value
=
"/camera"
)
@Slf4j
public
class
CameraController
{
@Autowired
private
CameraService
cameraService
;
@Autowired
private
ISiteWatchOverService
siteWatchOverService
;
@ApiOperation
(
value
=
"添加摄像机"
,
notes
=
"添加摄像机"
,
httpMethod
=
"POST"
)
@ApiImplicitParam
(
name
=
"camera"
,
value
=
"摄像机信息"
,
dataType
=
"Camera"
)
@PostMapping
(
"/add"
)
public
R
add
(
@RequestBody
Camera
camera
)
{
if
(
null
==
camera
)
{
return
R
.
error
(
"操作错误"
);
}
return
cameraService
.
add
(
camera
);
}
@ApiOperation
(
value
=
"编辑摄像机"
,
notes
=
"编辑摄像机"
,
httpMethod
=
"POST"
)
@ApiImplicitParam
(
name
=
"camera"
,
value
=
"编辑摄像机信息"
,
dataType
=
"Camera"
)
@PostMapping
(
"/edit"
)
public
R
edit
(
@RequestBody
Camera
camera
)
{
if
(
null
==
camera
)
{
return
R
.
error
(
"操作错误"
);
}
return
cameraService
.
edit
(
camera
);
}
@ApiOperation
(
value
=
"删除摄像机"
,
notes
=
"删除摄像机"
,
httpMethod
=
"DELETE"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"摄像机id"
,
dataType
=
"int"
,
required
=
true
)
@DeleteMapping
(
"/delete"
)
public
R
delete
(
Integer
id
)
{
if
(
null
==
id
)
{
return
R
.
error
(
"操作错误"
);
}
return
cameraService
.
delete
(
id
);
}
@ApiOperation
(
value
=
"获取摄像机列表"
,
notes
=
"获取摄像机列表"
,
httpMethod
=
"GET"
)
@ApiImplicitParam
(
name
=
"rubbishQueryVo"
,
value
=
"条件参数"
,
dataType
=
"RubbishQueryVo"
)
@GetMapping
(
"/getList"
)
public
R
getList
(
CameraQueryVo
cameraQueryVo
)
{
if
(
null
==
cameraQueryVo
)
{
return
R
.
error
(
"操作错误"
);
}
return
cameraService
.
getList
(
cameraQueryVo
);
}
@ApiOperation
(
value
=
"获取垃圾站名称列表"
,
notes
=
"获取垃圾站名称列表"
,
httpMethod
=
"GET"
)
@GetMapping
(
"/getRubbishNameList"
)
public
R
getRubbishNameList
()
{
return
cameraService
.
getRubbishNameList
();
}
}
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/FileUploadController.java
View file @
a849fb41
package
cn
.
wisenergy
.
web
.
admin
.
controller
.
app
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.service.util.ImageUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.http.entity.ContentType
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.mock.web.MockMultipartFile
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -80,44 +76,4 @@ public class FileUploadController {
}
return
R
.
error
(
"图片上传失败!"
);
}
@ApiOperation
(
value
=
"截图文件上传"
,
notes
=
"文件上传"
,
httpMethod
=
"POST"
)
@ApiImplicitParam
(
name
=
"uploadVo"
,
value
=
"入参"
,
dataType
=
"UploadVo"
)
@PostMapping
(
value
=
"/upload/image"
)
public
R
filePicture
(
@RequestBody
UploadVo
uploadVo
)
{
log
.
info
(
"截图文件上传url:"
+
uploadVo
);
if
(
null
==
uploadVo
||
StringUtils
.
isBlank
(
uploadVo
.
getUrl
()))
{
return
R
.
error
(
"入参为空"
);
}
//把图片转为base64字符串
String
str
=
ImageUtils
.
image2Base64
(
uploadVo
.
getUrl
());
log
.
info
(
"把图片转为base64字符串:"
+
str
);
//将base64转成字节数
byte
[]
image
=
ImageUtils
.
base64ToByte
(
str
);
log
.
info
(
"将base64转成字节数byte:"
+
image
.
length
);
MultipartFile
file
=
new
MockMultipartFile
(
"file"
,
"file"
,
ContentType
.
IMAGE_JPEG
.
toString
(),
image
);
boolean
isLegal
=
true
;
if
(
file
.
isEmpty
())
{
// 上传文件为空
return
R
.
error
(
"上传图片不能为空"
);
}
File
folder
=
new
File
(
uploadImagesLocation
);
if
(!
folder
.
exists
())
{
folder
.
mkdirs
();
}
String
oldName
=
file
.
getOriginalFilename
()
+
".jpeg"
;
String
newName
=
UUID
.
randomUUID
().
toString
()
+
oldName
.
substring
(
oldName
.
lastIndexOf
(
"."
));
try
{
file
.
transferTo
(
new
File
(
folder
,
newName
));
String
urlImage
=
"/upload_flowChart/"
+
newName
;
return
R
.
ok
(
200
,
urlImage
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
R
.
error
(
"图片上传失败!"
);
}
}
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