Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
notes2.0
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zjm
notes2.0
Commits
52532a65
提交
52532a65
authored
4月 09, 2020
作者:
zjm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加系统自动考评
上级
bcf00ac4
流水线
#126
已失败 于阶段
变更
6
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
154 行增加
和
57 行删除
+154
-57
ScController.java
...a/com/zjty/tynotes/job/basic/controller/ScController.java
+7
-2
ScoreCoefficient.java
...y/tynotes/job/basic/entity/database/ScoreCoefficient.java
+18
-0
ScoreCoefficientRepository.java
...otes/job/basic/repository/ScoreCoefficientRepository.java
+5
-1
AttachmentService.java
...com/zjty/tynotes/job/basic/service/AttachmentService.java
+2
-1
AttachmentServiceImpl.java
...tynotes/job/basic/service/impl/AttachmentServiceImpl.java
+1
-0
Task.java
notes-job/src/main/java/com/zjty/tynotes/job/task/Task.java
+121
-53
没有找到文件。
notes-job/src/main/java/com/zjty/tynotes/job/basic/controller/ScController.java
浏览文件 @
52532a65
...
...
@@ -42,7 +42,9 @@ public class ScController {
@ApiOperation
(
value
=
"新增考评信息."
,
notes
=
"新增不可在数据中附带id.成功时返回新增数据保存的id."
)
public
ResponseEntity
<
JobResponse
>
add
(
@RequestBody
ScRo
scRo
)
{
String
saveId
=
scoreCoefficientService
.
add
(
scRo
.
toDb
());
ScoreCoefficient
scoreCoefficient
=
scRo
.
toDb
();
scoreCoefficient
.
setTime
(
new
Date
());
String
saveId
=
scoreCoefficientService
.
add
(
scoreCoefficient
);
businessTreeManagement
.
saveAction
(
scRo
.
getUserId
(),
scRo
.
getWorkId
(),
Action
.
APPRAISAL_WORD
,
new
Date
(),
"自我评价"
);
return
ok
(
new
JobResponse
(
saveId
));
}
...
...
@@ -60,9 +62,12 @@ public class ScController {
public
ResponseEntity
<
JobResponse
>
modify
(
@RequestBody
ScoreCoefficient
scoreCoefficient
,
@RequestParam
String
userId
,
@RequestParam
String
msg
)
{
if
(!
msg
.
equals
(
"修改考评"
)){
scoreCoefficient
.
setTime
(
new
Date
());
}
String
saveId
=
scoreCoefficientService
.
modify
(
scoreCoefficient
);
businessTreeManagement
.
saveAction
(
userId
,
scoreCoefficient
.
getWordId
(),
Action
.
APPRAISAL_WORD
,
new
Date
(),
msg
);
return
ok
(
new
JobResponse
(
saveId
));
return
ok
(
new
JobResponse
(
saveId
));
}
...
...
notes-job/src/main/java/com/zjty/tynotes/job/basic/entity/database/ScoreCoefficient.java
浏览文件 @
52532a65
...
...
@@ -7,6 +7,8 @@ import lombok.AllArgsConstructor;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
@Data
@AllArgsConstructor
@AutoDocument
...
...
@@ -57,4 +59,20 @@ public class ScoreCoefficient {
*/
@ApiModelProperty
(
value
=
"最终工作量"
,
example
=
"endWorkLoad"
)
private
Double
endWorkLoad
;
/**
* 考评的时间 每个阶段考评的时间 后一个阶段考评了 覆盖这个时间
*/
private
Date
time
;
public
ScoreCoefficient
(
String
id
,
String
wordId
,
String
score1
,
String
groupLeaderScore2
,
String
directorScore2
,
String
viceScore3
,
String
justScore4
,
Double
endWorkLoad
)
{
this
.
id
=
id
;
this
.
wordId
=
wordId
;
this
.
score1
=
score1
;
this
.
groupLeaderScore2
=
groupLeaderScore2
;
this
.
directorScore2
=
directorScore2
;
this
.
viceScore3
=
viceScore3
;
this
.
justScore4
=
justScore4
;
this
.
endWorkLoad
=
endWorkLoad
;
}
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/repository/ScoreCoefficientRepository.java
浏览文件 @
52532a65
...
...
@@ -10,6 +10,10 @@ import java.util.List;
public
interface
ScoreCoefficientRepository
extends
MongoRepository
<
ScoreCoefficient
,
String
>
{
List
<
ScoreCoefficient
>
findByWordId
(
String
workId
);
// List<ScoreCoefficient> findByScore2IsNot();
List
<
ScoreCoefficient
>
findAllByGroupLeaderScore2IsNullOrDirectorScore2IsNull
();
List
<
ScoreCoefficient
>
findAllByGroupLeaderScore2IsNotNullAndDirectorScore2IsNotNullAndViceScore3IsNull
();
List
<
ScoreCoefficient
>
findAllByViceScore3IsNotNullAndJustScore4IsNull
();
}
notes-job/src/main/java/com/zjty/tynotes/job/basic/service/AttachmentService.java
浏览文件 @
52532a65
...
...
@@ -58,7 +58,8 @@ public interface AttachmentService {
/**
* 查找指定id的Work
*
* @param workId 指定id
* @param
* workId 指定id
* @return Work对象
*/
Attachment
findById
(
String
attachmentId
);
...
...
notes-job/src/main/java/com/zjty/tynotes/job/basic/service/impl/AttachmentServiceImpl.java
浏览文件 @
52532a65
...
...
@@ -10,6 +10,7 @@ import com.zjty.tynotes.job.common.exception.BadRequestException;
import
com.zjty.tynotes.job.common.exception.NotFoundException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
...
...
notes-job/src/main/java/com/zjty/tynotes/job/task/Task.java
浏览文件 @
52532a65
//package com.zjty.tynotes.job.task;
//
//import com.zjty.tynotes.job.basic.entity.database.Work;
//import com.zjty.tynotes.job.basic.service.ScoreCoefficientService;
//import com.zjty.tynotes.job.basic.service.WorkService;
//import com.zjty.tynotes.job.common.Action;
//import com.zjty.tynotes.job.common.constant.WorkStatus;
//import com.zjty.tynotes.job.status.service.BusinessTreeManagement;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Service;
//
//import java.time.LocalDateTime;
//import java.time.ZoneOffset;
//import java.util.Date;
//
//@Slf4j
//@Service
//public class Task {
// @Autowired
// ScoreCoefficientService scoreCoefficientService;
// @Autowired
// WorkService workService;
// @Autowired
// BusinessTreeManagement businessTreeManagement;
//
// @Scheduled(cron ="0 0 0 * * ?")
// public void task() {
//
// long time=LocalDateTime.now().minusDays(7)
// .withHour(0)
// .withMinute(0)
// .withSecond(0)
// .withNano(0)
// .atOffset(ZoneOffset.ofHours(8))
// .toEpochSecond();
//
//
// scoreCoefficientService.selectSorct2IsNull()
// .forEach(
// sc->{
// Work work= workService.findById(sc.getWordId());
// if (work.getAuditTime().getTime()<time){
//// sc.setScore2(sc.getScore1());
// scoreCoefficientService.modify(sc);
// businessTreeManagement.saveAction(work.getPublisher(),sc.getWordId(),Action.APPRAISAL_WORD,new Date(),"");
package
com
.
zjty
.
tynotes
.
job
.
task
;
import
com.zjty.tynotes.job.basic.entity.database.Work
;
import
com.zjty.tynotes.job.basic.repository.ScoreCoefficientRepository
;
import
com.zjty.tynotes.job.basic.service.ScoreCoefficientService
;
import
com.zjty.tynotes.job.basic.service.WorkService
;
import
com.zjty.tynotes.job.common.Action
;
import
com.zjty.tynotes.job.common.constant.WorkStatus
;
import
com.zjty.tynotes.job.status.service.BusinessTreeManagement
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.time.ZoneOffset
;
import
java.util.Date
;
@Slf4j
@Service
public
class
Task
{
@Autowired
ScoreCoefficientRepository
scoreCoefficientRepository
;
@Autowired
WorkService
workService
;
@Autowired
BusinessTreeManagement
businessTreeManagement
;
@Scheduled
(
cron
=
"0 0 0 * * ?"
)
public
void
task
()
{
long
time
=
LocalDateTime
.
now
().
minusDays
(
1
)
.
withHour
(
0
)
.
withMinute
(
0
)
.
withSecond
(
0
)
.
withNano
(
0
)
.
atOffset
(
ZoneOffset
.
ofHours
(
8
))
.
toEpochSecond
();
long
finalTime2
=
time
;
scoreCoefficientRepository
.
findAllByGroupLeaderScore2IsNullOrDirectorScore2IsNull
()
.
forEach
(
sc
->{
Work
work
=
workService
.
findById
(
sc
.
getWordId
());
if
(
sc
.
getTime
().
getTime
()<
finalTime2
){
if
(
sc
.
getDirectorScore2
()==
null
&&
sc
.
getGroupLeaderScore2
()
!=
null
){
sc
.
setDirectorScore2
(
sc
.
getGroupLeaderScore2
());
sc
.
setTime
(
new
Date
());
businessTreeManagement
.
saveAction
(
work
.
getMajordomos
().
get
(
0
),
sc
.
getWordId
(),
Action
.
APPRAISAL_WORD
,
new
Date
(),
"总监评价"
);
}
else
if
(
sc
.
getGroupLeaderScore2
()==
null
&&
sc
.
getDirectorScore2
()
!=
null
){
sc
.
setGroupLeaderScore2
(
sc
.
getDirectorScore2
());
sc
.
setTime
(
new
Date
());
businessTreeManagement
.
saveAction
(
work
.
getAudit
(),
sc
.
getWordId
(),
Action
.
APPRAISAL_WORD
,
new
Date
(),
"组长评价"
);
}
else
{
sc
.
setTime
(
new
Date
());
sc
.
setGroupLeaderScore2
(
sc
.
getScore1
());
businessTreeManagement
.
saveAction
(
work
.
getAudit
(),
sc
.
getWordId
(),
Action
.
APPRAISAL_WORD
,
new
Date
(),
"组长评价"
);
sc
.
setDirectorScore2
(
sc
.
getScore1
());
businessTreeManagement
.
saveAction
(
work
.
getMajordomos
().
get
(
0
),
sc
.
getWordId
(),
Action
.
APPRAISAL_WORD
,
new
Date
(),
"总监评价"
);
}
scoreCoefficientRepository
.
save
(
sc
);
// workService.alterTaskStatus(sc.getWordId(),WorkStatus.FINISHED,work.getPublisher());
// businessTreeManagement.saveAction(work.getPublisher(), sc.getWordId(), Action.FINISHED_WORK, new Date(), "");
// }
//
// }
// );
// }
//}
}
}
);
time
=
LocalDateTime
.
now
().
minusDays
(
2
)
.
withHour
(
0
)
.
withMinute
(
0
)
.
withSecond
(
0
)
.
withNano
(
0
)
.
atOffset
(
ZoneOffset
.
ofHours
(
8
))
.
toEpochSecond
();
//副总经理
long
finalTime1
=
time
;
scoreCoefficientRepository
.
findAllByGroupLeaderScore2IsNotNullAndDirectorScore2IsNotNullAndViceScore3IsNull
()
.
forEach
(
sc
->{
Work
work
=
workService
.
findById
(
sc
.
getWordId
());
if
(
sc
.
getTime
().
getTime
()<
finalTime1
){
String
score3
=
String
.
valueOf
(
Integer
.
valueOf
(
sc
.
getDirectorScore2
())+
Integer
.
valueOf
(
sc
.
getGroupLeaderScore2
()));
sc
.
setViceScore3
(
score3
);
sc
.
setTime
(
new
Date
());
businessTreeManagement
.
saveAction
(
work
.
getAssistantManagers
().
get
(
0
),
sc
.
getWordId
(),
Action
.
APPRAISAL_WORD
,
new
Date
(),
"副总经理评价"
);
}
scoreCoefficientRepository
.
save
(
sc
);
// workService.alterTaskStatus(sc.getWordId(),WorkStatus.FINISHED,work.getPublisher());
// businessTreeManagement.saveAction(work.getPublisher(), sc.getWordId(), Action.FINISHED_WORK, new Date(), "");
}
);
time
=
LocalDateTime
.
now
().
minusDays
(
2
)
.
withHour
(
0
)
.
withMinute
(
0
)
.
withSecond
(
0
)
.
withNano
(
0
)
.
atOffset
(
ZoneOffset
.
ofHours
(
8
))
.
toEpochSecond
();
//总经理
long
finalTime
=
time
;
scoreCoefficientRepository
.
findAllByViceScore3IsNotNullAndJustScore4IsNull
()
.
forEach
(
sc
->{
Work
work
=
workService
.
findById
(
sc
.
getWordId
());
if
(
sc
.
getTime
().
getTime
()<
finalTime
){
sc
.
setJustScore4
(
sc
.
getViceScore3
());
sc
.
setTime
(
new
Date
());
businessTreeManagement
.
saveAction
(
work
.
getGeneralManagers
().
get
(
0
),
sc
.
getWordId
(),
Action
.
APPRAISAL_WORD
,
new
Date
(),
"总经理评价"
);
}
scoreCoefficientRepository
.
save
(
sc
);
workService
.
alterTaskStatus
(
sc
.
getWordId
(),
WorkStatus
.
FINISHED
,
work
.
getPublisher
());
businessTreeManagement
.
saveAction
(
work
.
getGeneralManagers
().
get
(
0
),
sc
.
getWordId
(),
Action
.
FINISHED_WORK
,
new
Date
(),
""
);
}
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论