Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bpm
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
王厚康
bpm
Commits
8f8a0bb6
Commit
8f8a0bb6
authored
Apr 04, 2019
by
Java-曹文达
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注册接口开发
parent
12dda71c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
114 additions
and
5 deletions
+114
-5
UserApiController.java
src/main/java/com/bbd/bpm/controller/user/UserApiController.java
+15
-0
UserInfoMapper.java
src/main/java/com/bbd/bpm/dao/UserInfoMapper.java
+2
-0
UserInfoMapper.xml
src/main/java/com/bbd/bpm/dao/UserInfoMapper.xml
+13
-0
User.java
src/main/java/com/bbd/bpm/domain/User.java
+5
-0
UserInfoService.java
src/main/java/com/bbd/bpm/service/UserInfoService.java
+9
-0
UserInfoServiceImpl.java
src/main/java/com/bbd/bpm/serviceImpl/UserInfoServiceImpl.java
+49
-4
IdWorker.java
src/main/java/com/bbd/bpm/util/IdWorker.java
+20
-0
index.html
src/main/resources/templates/bpm/index.html
+1
-0
register.html
src/main/resources/templates/register.html
+0
-0
userList.html
src/main/resources/templates/user/userList.html
+0
-1
No files found.
src/main/java/com/bbd/bpm/controller/user/UserApiController.java
View file @
8f8a0bb6
package
com
.
bbd
.
bpm
.
controller
.
user
;
import
com.bbd.bpm.base.PageBean
;
import
com.bbd.bpm.domain.User
;
import
com.bbd.bpm.result.RespCode
;
import
com.bbd.bpm.result.Result
;
import
com.bbd.bpm.result.ResultUtil
;
...
...
@@ -184,6 +185,20 @@ public class UserApiController {
}
/**
* @Author:cwd
* 添加用户
* @Date: 2019.4.4
* @return
*/
@RequestMapping
(
value
=
"/addUser"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Result
addUser
(
User
user
){
Result
result
=
userInfoService
.
addUser
(
user
);
return
result
;
}
}
src/main/java/com/bbd/bpm/dao/UserInfoMapper.java
View file @
8f8a0bb6
...
...
@@ -33,4 +33,6 @@ public interface UserInfoMapper extends BaseMapper<BpmCompany>{
List
<
ActReModelEntity
>
getList
(
@Param
(
"modelName"
)
String
modelName
);
List
<
User
>
userList
(
@Param
(
"userName"
)
String
userName
);
void
addUser
(
User
user
);
}
src/main/java/com/bbd/bpm/dao/UserInfoMapper.xml
View file @
8f8a0bb6
...
...
@@ -114,4 +114,16 @@
</select>
<insert
id=
"addUser"
parameterType=
"com.bbd.bpm.domain.User"
>
INSERT INTO `user` (
user_Uuid,
username,
password,
email,
telephone
)
VALUES
(#{userUuid},#{username},#{password},#{email},#{telephone})
</insert>
</mapper>
\ No newline at end of file
src/main/java/com/bbd/bpm/domain/User.java
View file @
8f8a0bb6
package
com
.
bbd
.
bpm
.
domain
;
import
lombok.Data
;
import
javax.persistence.*
;
/**
...
...
@@ -9,6 +11,7 @@ import javax.persistence.*;
//用户信息表
@Entity
@Table
(
name
=
"user"
)
@Data
public
class
User
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
...
...
@@ -42,6 +45,8 @@ public class User {
@Column
(
name
=
"last_time"
)
private
String
lastTime
;
//上次登录时间
@Column
(
name
=
"content"
)
//角色描述
private
String
content
;
public
Integer
getId
()
{
return
id
;
...
...
src/main/java/com/bbd/bpm/service/UserInfoService.java
View file @
8f8a0bb6
package
com
.
bbd
.
bpm
.
service
;
import
com.bbd.bpm.base.PageBean
;
import
com.bbd.bpm.domain.User
;
import
com.bbd.bpm.result.Result
;
public
interface
UserInfoService
{
...
...
@@ -81,4 +82,12 @@ public interface UserInfoService {
* @return
*/
Result
userList
(
Integer
id
,
PageBean
pageBean
,
String
userName
);
/**
* @Author:cwd
* 添加用户
* @Date: 2019.4.4
* @return
* @param user
*/
Result
addUser
(
User
user
);
}
src/main/java/com/bbd/bpm/serviceImpl/UserInfoServiceImpl.java
View file @
8f8a0bb6
...
...
@@ -10,12 +10,14 @@ import com.bbd.bpm.result.RespCode;
import
com.bbd.bpm.result.Result
;
import
com.bbd.bpm.result.ResultUtil
;
import
com.bbd.bpm.service.UserInfoService
;
import
com.bbd.bpm.util.IdWorker
;
import
com.bbd.bpm.vo.BpmCompanyVo
;
import
com.bbd.bpm.vo.MenuVO
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
org.activiti.editor.language.json.converter.util.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
...
...
@@ -272,12 +274,55 @@ public class UserInfoServiceImpl implements UserInfoService{
}
}
/**
* @Author:cwd
* 获取用户列表
* @Date: 2019.3.7
* @return
*/
@Override
public
Result
userList
(
Integer
id
,
PageBean
pageBean
,
String
userName
)
{
PageHelper
.
startPage
(
pageBean
.
getPageNum
(),
pageBean
.
getPageSize
());
List
<
User
>
list
=
userInfoMapper
.
userList
(
userName
);
PageInfo
<
User
>
pageInfo
=
new
PageInfo
<>(
list
);
return
ResultUtil
.
getResult
(
RespCode
.
Code
.
SUCCESS
,
pageInfo
);
try
{
PageHelper
.
startPage
(
pageBean
.
getPageNum
(),
pageBean
.
getPageSize
());
List
<
User
>
list
=
userInfoMapper
.
userList
(
userName
);
PageInfo
<
User
>
pageInfo
=
new
PageInfo
<>(
list
);
return
ResultUtil
.
getResult
(
RespCode
.
Code
.
SUCCESS
,
pageInfo
);
}
catch
(
Exception
e
){
return
ResultUtil
.
getResult
(
RespCode
.
Code
.
INTERNAL_SERVER_ERROR
);
}
}
/**
* @Author:cwd
* 添加用户
* @Date: 2019.4.4
* @return
* @param user
*/
@Override
public
Result
addUser
(
User
user
)
{
Result
result
=
new
Result
();
try
{
user
.
setUserUuid
(
IdWorker
.
nextId
());
String
password
=
user
.
getPassword
();
//密码加密
BCryptPasswordEncoder
encoder
=
new
BCryptPasswordEncoder
(
4
);
String
enPassword
=
encoder
.
encode
(
password
);
user
.
setPassword
(
enPassword
);
userInfoMapper
.
addUser
(
user
);
result
.
setSuccess
(
true
);
result
.
setCode
(
"200"
);
result
.
setMessage
(
"添加用户成功"
);
return
result
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
result
.
setSuccess
(
false
);
result
.
setCode
(
"500"
);
result
.
setMessage
(
"添加用户失败"
);
return
result
;
}
}
/**
...
...
src/main/java/com/bbd/bpm/util/IdWorker.java
0 → 100644
View file @
8f8a0bb6
package
com
.
bbd
.
bpm
.
util
;
import
java.util.UUID
;
/**
* 说明
*
* @author Bob Ren(Copyright ©2018 Hong Kong Airlines Ltd.)
* @version v1.0
* @created 2019/3/10 11:52
*/
public
class
IdWorker
{
public
static
String
nextId
()
{
UUID
uuid
=
UUID
.
randomUUID
();
String
str
=
uuid
.
toString
();
// 去掉"-"符号
return
str
.
substring
(
0
,
8
)
+
str
.
substring
(
9
,
13
)
+
str
.
substring
(
14
,
18
)
+
str
.
substring
(
19
,
23
)
+
str
.
substring
(
24
);
}
}
src/main/resources/templates/bpm/index.html
View file @
8f8a0bb6
...
...
@@ -102,6 +102,7 @@
<li
class=
"s_menu_item"
><a
target=
"main_frame"
href=
"/web/bpm/user/toDeployment"
><span
class=
"nav-icon"
><i
class=
"fa fa-qrcode bg-gradient-red text-white"
></i></span>
查看流程
</a></li>
<li
class=
"s_menu_item"
><a
target=
"main_frame"
href=
"/model/createNew"
><span
class=
"nav-icon"
><i
class=
"fa fa-heart bg-gradient-orange text-white"
></i></span>
创建流程
</a></li>
<li
class=
"s_menu_item"
><a
target=
"main_frame"
href=
"/web/bpm/user/toOrganization"
><span
class=
"nav-icon"
><i
class=
"fa fa-table bg-gradient-green text-white"
></i></span>
组织结构
</a></li>
<li
class=
"s_menu_item"
><a
target=
"main_frame"
href=
"/web/bpm/user/toUserList"
><span
class=
"nav-icon"
><i
class=
"fa fa-map bg-gradient-blue text-white"
></i></span>
用户管理
</a></li>
<li
class=
"s_menu_item"
><a
target=
"main_frame"
href=
"/swagger-ui.html"
><span
class=
"nav-icon"
><i
class=
"fa fa-map bg-gradient-blue text-white"
></i></span>
API 文档
</a></li>
</ul>
...
...
src/main/resources/templates/register.html
View file @
8f8a0bb6
This diff is collapsed.
Click to expand it.
src/main/resources/templates/user/userList.html
View file @
8f8a0bb6
...
...
@@ -169,7 +169,6 @@
/*删除用户 */
function
deleteUser
(
id
)
{
alert
(
id
)
$
.
post
(
"/api/bpm/model/deleteModel"
,
{
modelId
:
id
...
...
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