Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
notes2.0
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zjm
notes2.0
Commits
ca8078b9
提交
ca8078b9
authored
3月 12, 2020
作者:
zjm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改接口参数
上级
2c9e9d62
流水线
#81
已失败 于阶段
变更
5
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
127 行增加
和
111 行删除
+127
-111
WorkController.java
...com/zjty/tynotes/job/basic/controller/WorkController.java
+6
-16
UpdateWorkload.java
...zjty/tynotes/job/basic/entity/request/UpdateWorkload.java
+25
-0
WorkService.java
.../java/com/zjty/tynotes/job/basic/service/WorkService.java
+1
-1
WorkServiceImpl.java
.../zjty/tynotes/job/basic/service/impl/WorkServiceImpl.java
+1
-1
Init.java
notes-pas/src/main/java/com/zjty/tynotes/pas/task/Init.java
+94
-93
没有找到文件。
notes-job/src/main/java/com/zjty/tynotes/job/basic/controller/WorkController.java
浏览文件 @
ca8078b9
...
...
@@ -2,6 +2,7 @@ package com.zjty.tynotes.job.basic.controller;
import
com.zjty.tynotes.job.basic.entity.database.Work
;
import
com.zjty.tynotes.job.basic.entity.request.UpdateCrew
;
import
com.zjty.tynotes.job.basic.entity.request.UpdateWorkload
;
import
com.zjty.tynotes.job.basic.entity.request.WorkRo
;
import
com.zjty.tynotes.job.basic.entity.response.JobResponse
;
import
com.zjty.tynotes.job.basic.entity.response.WorkIsNotCommit
;
...
...
@@ -118,22 +119,11 @@ public class WorkController {
@PutMapping
(
value
=
"/upDate/Workload"
)
@ApiOperation
(
value
=
"修改任务的工作量、考评系数."
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"workId"
,
value
=
"任务id"
,
dataType
=
"String"
,
paramType
=
"query"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"workload"
,
value
=
"工作量"
,
dataType
=
"int"
,
paramType
=
"query"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"人员id"
,
dataType
=
"String"
,
paramType
=
"query"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"workCoefficient"
,
value
=
"考评系数"
,
dataType
=
"int"
,
paramType
=
"query"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"msg"
,
value
=
"消息"
,
dataType
=
"String"
,
paramType
=
"query"
,
required
=
true
)
})
public
ResponseEntity
<
JobResponse
>
updateWorkload
(
@RequestParam
String
workId
,
@RequestParam
String
userId
,
@RequestParam
int
workCoefficient
,
@RequestParam
int
workload
,
@RequestParam
String
msg
)
{
businessTreeManagement
.
saveAction
(
userId
,
workId
,
Action
.
UPDATE_WORKLOAD
,
new
Date
(),
msg
);
workService
.
updateWorkload
(
workId
,
workload
,
workCoefficient
);
return
ok
(
new
JobResponse
(
workId
));
public
ResponseEntity
<
JobResponse
>
updateWorkload
(
@RequestBody
UpdateWorkload
updateWorkload
)
{
businessTreeManagement
.
saveAction
(
updateWorkload
.
getUserId
(),
updateWorkload
.
getWorkId
(),
Action
.
UPDATE_WORKLOAD
,
new
Date
(),
updateWorkload
.
getMsg
());
workService
.
updateWorkload
(
updateWorkload
.
getWorkId
(),
updateWorkload
.
getWorkload
(),
updateWorkload
.
getWorkCoefficient
());
return
ok
(
new
JobResponse
(
updateWorkload
.
getWorkId
()));
}
...
...
notes-job/src/main/java/com/zjty/tynotes/job/basic/entity/request/UpdateWorkload.java
0 → 100644
浏览文件 @
ca8078b9
package
com
.
zjty
.
tynotes
.
job
.
basic
.
entity
.
request
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.web.bind.annotation.RequestParam
;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"修改任务考评以及工作量"
,
description
=
"修改任务考评以及工作量数据对象"
)
public
class
UpdateWorkload
{
@ApiModelProperty
(
value
=
"任务id"
,
example
=
"workId"
)
private
String
workId
;
@ApiModelProperty
(
value
=
"修改人的id"
,
example
=
"userId"
)
private
String
userId
;
@ApiModelProperty
(
value
=
"考评系数"
,
example
=
"workCoefficient"
)
private
float
workCoefficient
;
@ApiModelProperty
(
value
=
"工作量"
,
example
=
"workload"
)
private
int
workload
;
@ApiModelProperty
(
value
=
"描述"
,
example
=
"msg"
)
private
String
msg
;
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/service/WorkService.java
浏览文件 @
ca8078b9
...
...
@@ -111,7 +111,7 @@ public interface WorkService {
* @param workload 工作量
* @param workCoefficient 考评系数 只能修改0.1-0.2
*/
void
updateWorkload
(
String
taskId
,
int
workload
,
in
t
workCoefficient
);
void
updateWorkload
(
String
taskId
,
int
workload
,
floa
t
workCoefficient
);
/**
...
...
notes-job/src/main/java/com/zjty/tynotes/job/basic/service/impl/WorkServiceImpl.java
浏览文件 @
ca8078b9
...
...
@@ -223,7 +223,7 @@ return null;
}
@Override
public
void
updateWorkload
(
String
taskId
,
int
workload
,
in
t
workCoefficient
)
{
public
void
updateWorkload
(
String
taskId
,
int
workload
,
floa
t
workCoefficient
)
{
Work
ob
=
workRepository
.
findById
(
taskId
).
get
();
ob
.
setWorkload
(
workload
);
ob
.
setWorkCoefficient
(
workCoefficient
);
...
...
notes-pas/src/main/java/com/zjty/tynotes/pas/task/Init.java
浏览文件 @
ca8078b9
...
...
@@ -42,103 +42,103 @@ public class Init implements CommandLineRunner {
@Override
public
void
run
(
String
...
args
)
throws
Exception
{
//
List<Authority> authorities1 = new ArrayList<>();
//
List<Authority> authorityList = authorityDao.findAll();
//
List<String> authorityName = new ArrayList<>();
// if(authorityList!=null)
{
//
for (Authority authority : authorityList) {
//
authorityName.add(authority.getName());
//
}
//
}
// if(!authorityName.contains("查看任务"))
{
// authorities1.add(new Authority(null,"查看任务",
"能够查看员工的任务"));
//
}
// if(!authorityName.contains("发布任务"))
{
// authorities1.add(new Authority(null,"发布任务",
"能够发布任务给其他用户"));
//
}
// if(!authorityName.contains("分解任务"))
{
// authorities1.add(new Authority(null,"分解任务",
"对任务具有分解的功能"));
//
}
// if(!authorityName.contains("删除任务"))
{
// authorities1.add(new Authority(null,"删除任务",
"能够对任务进行删除"));
//
}
// if(!authorityName.contains("修改任务"))
{
// authorities1.add(new Authority(null,"修改任务",
"能够对任务进行修改"));
//
}
// if(!authorityName.contains("查看人员"))
{
// authorities1.add(new Authority(null,"查看人员",
"能够查看人员"));
//
}
// if(authorities1!=null)
{
//
authorityDao.saveAll(authorities1);
//
}
//
List
<
Authority
>
authorities1
=
new
ArrayList
<>();
List
<
Authority
>
authorityList
=
authorityDao
.
findAll
();
List
<
String
>
authorityName
=
new
ArrayList
<>();
if
(
authorityList
!=
null
)
{
for
(
Authority
authority
:
authorityList
)
{
authorityName
.
add
(
authority
.
getName
());
}
}
if
(!
authorityName
.
contains
(
"查看任务"
))
{
authorities1
.
add
(
new
Authority
(
null
,
"查看任务"
,
"能够查看员工的任务"
));
}
if
(!
authorityName
.
contains
(
"发布任务"
))
{
authorities1
.
add
(
new
Authority
(
null
,
"发布任务"
,
"能够发布任务给其他用户"
));
}
if
(!
authorityName
.
contains
(
"分解任务"
))
{
authorities1
.
add
(
new
Authority
(
null
,
"分解任务"
,
"对任务具有分解的功能"
));
}
if
(!
authorityName
.
contains
(
"删除任务"
))
{
authorities1
.
add
(
new
Authority
(
null
,
"删除任务"
,
"能够对任务进行删除"
));
}
if
(!
authorityName
.
contains
(
"修改任务"
))
{
authorities1
.
add
(
new
Authority
(
null
,
"修改任务"
,
"能够对任务进行修改"
));
}
if
(!
authorityName
.
contains
(
"查看人员"
))
{
authorities1
.
add
(
new
Authority
(
null
,
"查看人员"
,
"能够查看人员"
));
}
if
(
authorities1
!=
null
)
{
authorityDao
.
saveAll
(
authorities1
);
}
//
//// iRoleService.deleteAll();
//
User user = pasUserDao.findByUsername("root");
//
//
System.out.println(user);
// if(user!=null)
{
//
List<UserRole> userRoles = userRoleDao.findAllByUserId(user.getId());
//
List<String> roleIds = new ArrayList<>();
//
for (UserRole userRole : userRoles) {
//
roleIds.add(userRole.getRoleId());
//
}
//
List<Role> roleList = roleDao.findAllByIdIn(roleIds);
//
for (Role role : roleList) {
//
List<RoleAuthority> roleAuthorities = roleAuthorityDao.findAllByRoleId(role.getId());
//
List<String> authorityIds = new ArrayList<>();
//
for (RoleAuthority roleAuthority : roleAuthorities) {
//
authorityIds.add(roleAuthority.getAuthorityId());
//
}
//
List<Authority> authorities = authorityDao.findAllByIdIn(authorityIds);
//
role.setAuthorities(authorities);
//
}
//
user.setRoles(roleList);
//
root = user;
// }else
{
//
System.out.println("77777777777777777");
//
this.root = new User();
// Role role = new Role(null,"管理员","管理系统的人员",null,null,
null);
//
List<Authority> authorities = new ArrayList<>();
// Authority authority2 = new Authority(null,"用户管理",
"无");
// Authority authority1 = new Authority(null,"权限管理",
"无");
// Authority authority3 = new Authority(null,"角色管理",
"无");
// Authority authority4 = new Authority(null,"考勤管理",
"无");
// Authority authority5 = new Authority(null,"部门管理",
"无");
//
//
authorities.add(authority2);
//
authorities.add(authority1);
//
authorities.add(authority3);
//
authorities.add(authority4);
//
authorities.add(authority5);
//
role.setAuthorities(authorities);
//
//
this.root.createUser();
//
this.root.setUsername("root");
//
//
String encode = bCryptPasswordEncoder.encode("root");
//
this.root.setPassword(encode);
//
List<Role> roles = new ArrayList<>();
//
roles.add(role);
//
this.root.setRoles(roles);
//
List<Authority> authorities2 = authorityDao.saveAll(authorities);
//
//
List<Role> roles1 = roleDao.saveAll(roles);
//
Role role1 = roles1.get(0);
//
String id = role1.getId();
//
List<RoleAuthority> roleAuthorities = new ArrayList<>();
//
for (Authority authority : authorities2) {
// roleAuthorities.add(new RoleAuthority(null,id,
authority.getId()));
//
}
//
roleAuthorityDao.saveAll(roleAuthorities);
//
User save = pasUserDao.save(this.root);
// UserRole userRole = new UserRole(null,save.getId(),
id);
//
userRoleDao.save(userRole);
//
this.root.setPassword("root");
User
user
=
pasUserDao
.
findByUsername
(
"root"
);
System
.
out
.
println
(
user
);
if
(
user
!=
null
)
{
List
<
UserRole
>
userRoles
=
userRoleDao
.
findAllByUserId
(
user
.
getId
());
List
<
String
>
roleIds
=
new
ArrayList
<>();
for
(
UserRole
userRole
:
userRoles
)
{
roleIds
.
add
(
userRole
.
getRoleId
());
}
List
<
Role
>
roleList
=
roleDao
.
findAllByIdIn
(
roleIds
);
for
(
Role
role
:
roleList
)
{
List
<
RoleAuthority
>
roleAuthorities
=
roleAuthorityDao
.
findAllByRoleId
(
role
.
getId
());
List
<
String
>
authorityIds
=
new
ArrayList
<>();
for
(
RoleAuthority
roleAuthority
:
roleAuthorities
)
{
authorityIds
.
add
(
roleAuthority
.
getAuthorityId
());
}
List
<
Authority
>
authorities
=
authorityDao
.
findAllByIdIn
(
authorityIds
);
role
.
setAuthorities
(
authorities
);
}
user
.
setRoles
(
roleList
);
root
=
user
;
}
else
{
System
.
out
.
println
(
"77777777777777777"
);
this
.
root
=
new
User
();
Role
role
=
new
Role
(
null
,
"管理员"
,
"管理系统的人员"
,
null
,
null
,
null
);
List
<
Authority
>
authorities
=
new
ArrayList
<>();
Authority
authority2
=
new
Authority
(
null
,
"用户管理"
,
"无"
);
Authority
authority1
=
new
Authority
(
null
,
"权限管理"
,
"无"
);
Authority
authority3
=
new
Authority
(
null
,
"角色管理"
,
"无"
);
Authority
authority4
=
new
Authority
(
null
,
"考勤管理"
,
"无"
);
Authority
authority5
=
new
Authority
(
null
,
"部门管理"
,
"无"
);
authorities
.
add
(
authority2
);
authorities
.
add
(
authority1
);
authorities
.
add
(
authority3
);
authorities
.
add
(
authority4
);
authorities
.
add
(
authority5
);
role
.
setAuthorities
(
authorities
);
this
.
root
.
createUser
();
this
.
root
.
setUsername
(
"root"
);
String
encode
=
bCryptPasswordEncoder
.
encode
(
"root"
);
this
.
root
.
setPassword
(
encode
);
List
<
Role
>
roles
=
new
ArrayList
<>();
roles
.
add
(
role
);
this
.
root
.
setRoles
(
roles
);
List
<
Authority
>
authorities2
=
authorityDao
.
saveAll
(
authorities
);
List
<
Role
>
roles1
=
roleDao
.
saveAll
(
roles
);
Role
role1
=
roles1
.
get
(
0
);
String
id
=
role1
.
getId
();
List
<
RoleAuthority
>
roleAuthorities
=
new
ArrayList
<>();
for
(
Authority
authority
:
authorities2
)
{
roleAuthorities
.
add
(
new
RoleAuthority
(
null
,
id
,
authority
.
getId
()));
}
roleAuthorityDao
.
saveAll
(
roleAuthorities
);
User
save
=
pasUserDao
.
save
(
this
.
root
);
UserRole
userRole
=
new
UserRole
(
null
,
save
.
getId
(),
id
);
userRoleDao
.
save
(
userRole
);
this
.
root
.
setPassword
(
"root"
);
}
;
;
// User user1 = new User();
// user1.createUser();
...
...
@@ -200,4 +200,5 @@ public class Init implements CommandLineRunner {
//
// iJobService.addJob(job);
// }
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论