Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
notes2.0
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zjm
notes2.0
Commits
2c9e9d62
提交
2c9e9d62
authored
3月 12, 2020
作者:
zjm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改job
上级
f47088e5
流水线
#80
已取消 于阶段
变更
8
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
133 行增加
和
114 行删除
+133
-114
ScoreCoefficient.java
...y/tynotes/job/basic/entity/database/ScoreCoefficient.java
+1
-1
Work.java
...java/com/zjty/tynotes/job/basic/entity/database/Work.java
+1
-1
ScRo.java
.../java/com/zjty/tynotes/job/basic/entity/request/ScRo.java
+1
-1
WorkVo.java
...va/com/zjty/tynotes/job/basic/entity/response/WorkVo.java
+1
-1
ScoreCoefficientService.java
...ty/tynotes/job/basic/service/ScoreCoefficientService.java
+2
-2
WorkServiceImpl.java
.../zjty/tynotes/job/basic/service/impl/WorkServiceImpl.java
+24
-3
Init.java
notes-pas/src/main/java/com/zjty/tynotes/pas/task/Init.java
+93
-93
UnionApplication.java
...rc/main/java/com/zjty/tynotes/union/UnionApplication.java
+10
-12
没有找到文件。
notes-job/src/main/java/com/zjty/tynotes/job/basic/entity/database/ScoreCoefficient.java
浏览文件 @
2c9e9d62
...
...
@@ -50,5 +50,5 @@ public class ScoreCoefficient {
* 最终工作量
*/
@ApiModelProperty
(
value
=
"最终工作量"
,
example
=
"endWorkLoad"
)
private
int
endWorkLoad
;
private
Double
endWorkLoad
;
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/entity/database/Work.java
浏览文件 @
2c9e9d62
...
...
@@ -136,7 +136,7 @@ public class Work {
* 考评系数
*/
@ApiModelProperty
(
value
=
"考评系数"
,
example
=
"0.8"
)
private
in
t
workCoefficient
=
0
;
private
floa
t
workCoefficient
=
0
;
/**
* 是否记录个人工作量
...
...
notes-job/src/main/java/com/zjty/tynotes/job/basic/entity/request/ScRo.java
浏览文件 @
2c9e9d62
...
...
@@ -49,7 +49,7 @@ public class ScRo {
* 最终工作量
*/
@ApiModelProperty
(
value
=
"最终工作量"
,
example
=
"endWorkLoad"
)
private
int
endWorkLoad
;
private
Double
endWorkLoad
;
@ApiModelProperty
(
value
=
"用户id"
,
example
=
"userId"
)
private
String
userId
;
...
...
notes-job/src/main/java/com/zjty/tynotes/job/basic/entity/response/WorkVo.java
浏览文件 @
2c9e9d62
...
...
@@ -117,7 +117,7 @@ public class WorkVo {
* 考评系数
*/
@ApiModelProperty
(
value
=
"考评系数"
,
example
=
"0.8"
)
private
in
t
workCoefficient
=
0
;
private
floa
t
workCoefficient
=
0
;
/**
* 是否记录个人工作量
...
...
notes-job/src/main/java/com/zjty/tynotes/job/basic/service/ScoreCoefficientService.java
浏览文件 @
2c9e9d62
...
...
@@ -33,9 +33,9 @@ public interface ScoreCoefficientService {
/**
* 查找指定id的考评信息
* 查找指定
work
id的考评信息
*
* @param id
指定
id
* @param id
work
id
* @return ScoreCoefficient 对象
*/
ScoreCoefficient
findById
(
String
id
);
...
...
notes-job/src/main/java/com/zjty/tynotes/job/basic/service/impl/WorkServiceImpl.java
浏览文件 @
2c9e9d62
package
com
.
zjty
.
tynotes
.
job
.
basic
.
service
.
impl
;
import
com.google.common.collect.Lists
;
import
com.zjty.tynotes.job.basic.entity.database.ScoreCoefficient
;
import
com.zjty.tynotes.job.basic.entity.database.Work
;
import
com.zjty.tynotes.job.basic.entity.response.WorkIsNotCommit
;
import
com.zjty.tynotes.job.basic.entity.response.WorkVo
;
import
com.zjty.tynotes.job.basic.repository.WorkRepository
;
import
com.zjty.tynotes.job.basic.service.ConversionService
;
import
com.zjty.tynotes.job.basic.service.ScoreCoefficientService
;
import
com.zjty.tynotes.job.basic.service.WorkService
;
import
com.zjty.tynotes.job.basic.utils.WorkingTime
;
import
com.zjty.tynotes.job.common.constant.WorkStatus
;
...
...
@@ -19,6 +21,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.text.DecimalFormat
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.Date
;
...
...
@@ -49,6 +52,10 @@ public class WorkServiceImpl implements WorkService {
@Autowired
ConversionService
conversionService
;
@Autowired
ScoreCoefficientService
scoreCoefficientService
;
@Autowired
public
WorkServiceImpl
(
WorkRepository
workRepository
)
{
this
.
workRepository
=
workRepository
;
...
...
@@ -132,20 +139,34 @@ public class WorkServiceImpl implements WorkService {
Float
practical
=
score
(
ob
.
getStateTime
(),
ob
.
getEndTime
());
if
(
expect
<
practical
){
float
time
=
practical
-
expect
;
beyond
(
1
,
1.0f
,
time
);
ob
.
setWorkCoefficient
(
beyond
(
1
,
1.0f
,
time
)
);
//添加
}
else
if
(
expect
.
equals
(
practical
)){
ob
.
setWorkCoefficient
(
1
f
);
//添加
}
else
{
float
time
=
expect
-
practical
;
advance
(
1
,
1.0f
,
time
);
ob
.
setWorkCoefficient
(
advance
(
1
,
1.0f
,
time
)
);
}
}
if
(
status
.
equals
(
WorkStatus
.
FINISHED
)){
pWorkload
(
taskId
);
}
workRepository
.
save
(
ob
);
}
private
void
pWorkload
(
String
workId
){
ScoreCoefficient
scoreCoefficient
=
scoreCoefficientService
.
findById
(
workId
);
int
workLoad
=
findBySuperoirIdCount
(
workId
);
DecimalFormat
df
=
new
DecimalFormat
(
"#.##"
);
double
coefficient
=
(
Double
.
parseDouble
(
scoreCoefficient
.
getScore1
())+
Double
.
parseDouble
(
scoreCoefficient
.
getScore2
()))/
2.0
/
100.0
;
double
getWorkLoad
=
workLoad
*
coefficient
;
scoreCoefficient
.
setEndWorkLoad
(
Double
.
valueOf
(
df
.
format
(
getWorkLoad
)));
scoreCoefficientService
.
modify
(
scoreCoefficient
);
}
private
float
beyond
(
float
count
,
float
coefficient
,
Float
time
){
if
(
coefficient
<
0.5f
){
return
0.5f
;
...
...
notes-pas/src/main/java/com/zjty/tynotes/pas/task/Init.java
浏览文件 @
2c9e9d62
...
...
@@ -42,98 +42,98 @@ 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
);
}
// 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
);
//
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");
}
...
...
@@ -199,5 +199,5 @@ public class Init implements CommandLineRunner {
// job.setName("岗位1");
//
// iJobService.addJob(job);
}
//
}
}
notes-union/src/main/java/com/zjty/tynotes/union/UnionApplication.java
浏览文件 @
2c9e9d62
...
...
@@ -27,9 +27,7 @@ public class UnionApplication {
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
UnionApplication
.
class
,
args
);
}
// 开始支持http
// 开始支持http
@Bean
public
ServletWebServerFactory
servletContainer
()
{
TomcatServletWebServerFactory
tomcat
=
new
TomcatServletWebServerFactory
();
...
...
@@ -37,14 +35,14 @@ public class UnionApplication {
return
tomcat
;
}
private
Connector
createHTTPConnector
()
{
Connector
connector
=
new
Connector
(
"org.apache.coyote.http11.Http11NioProtocol"
);
//同时启用http(8080)、https(8443)两个端口
connector
.
setScheme
(
"http"
);
connector
.
setSecure
(
false
);
connector
.
setPort
(
8084
);
connector
.
setRedirectPort
(
8289
);
return
connector
;
}
private
Connector
createHTTPConnector
()
{
Connector
connector
=
new
Connector
(
"org.apache.coyote.http11.Http11NioProtocol"
);
//同时启用http(8080)、https(8443)两个端口
connector
.
setScheme
(
"http"
);
connector
.
setSecure
(
false
);
connector
.
setPort
(
8084
);
connector
.
setRedirectPort
(
8289
);
return
connector
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论