This commit is contained in:
杜建超 2020-12-11 10:02:16 +08:00
parent 8be3f01815
commit 47aff425d0
2 changed files with 18 additions and 8 deletions

View File

@ -6,14 +6,23 @@ package com.lz.modules.performance.enums;
* @Date: 2020/12/9 14:08 * @Date: 2020/12/9 14:08
*/ */
public enum ProcessRecordEnum { public enum ProcessRecordEnum {
NAME(1,"修改名称"), NAME(1,"更新了名称"),
PROCESS(2,"修改进度"), PROCESS(2,"更新了进度"),
ALL(3,"全部修改"), ALL(3,"更新了名称和进度"),
ADD(4,"增加"), ADD(4,"增加了任务"),
DELETE(5,"删除"), DELETE(5,"删除了任务"),
; ;
public static ProcessRecordEnum findByType(int type){
for(ProcessRecordEnum recordEnum:ProcessRecordEnum.values()){
if(type == recordEnum.getType()){
return recordEnum;
}
}
return null;
}
private int type; private int type;
private String desc; private String desc;

View File

@ -111,11 +111,12 @@ public class ResultTaskServiceImpl extends ServiceImpl<ResultTaskMapper, ResultT
resultTasks.forEach(resultTaskDto -> { resultTasks.forEach(resultTaskDto -> {
TaskProcessRecordDto taskProcessRecordDto = taskProcessRecordMapper.selectTaskProcessRecordLastByTaskId(resultTaskDto.getId()); TaskProcessRecordDto taskProcessRecordDto = taskProcessRecordMapper.selectTaskProcessRecordLastByTaskId(resultTaskDto.getId());
if(taskProcessRecordDto != null){ if(taskProcessRecordDto != null){
resultTaskDto.setStaffName(taskProcessRecordDto.getStaffName()); ProcessRecordEnum byType = ProcessRecordEnum.findByType(taskProcessRecordDto.getType());
resultTaskDto.setLabel(taskProcessRecordDto.getLabel()); Optional.ofNullable(byType).ifPresent(processRecordEnum -> resultTaskDto.setLabel(byType.getDesc()));
if(finalStaffEntity !=null){ if(finalStaffEntity !=null){
resultTaskDto.setAvatar(finalStaffEntity.getAvatar()); resultTaskDto.setAvatar(finalStaffEntity.getAvatar());
} resultTaskDto.setStaffName(finalStaffEntity.getName());
}
} }
}); });