Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0
This commit is contained in:
commit
ecf2c05c87
@ -48,6 +48,7 @@ import com.lz.modules.sys.service.app.ResultRecordService;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@ -134,6 +135,8 @@ public class ResultRecordController extends AbstractController {
|
||||
private ResourceService resourceService;
|
||||
@Autowired
|
||||
private ChartResultService chartResultService;
|
||||
@Autowired
|
||||
private FlowStartService flowStartService;
|
||||
|
||||
@Autowired
|
||||
private ResultTaskService resultTaskService;
|
||||
@ -632,6 +635,38 @@ public class ResultRecordController extends AbstractController {
|
||||
resultRecordDetailDto.setWeight(weight);
|
||||
resultRecordDetailDto.setRecortModelDtos(resultRecortModelDtos);
|
||||
|
||||
//增加导出所需数据
|
||||
List<String> depIds = Lists.newArrayList(resultRecord.getDepartmentId());
|
||||
Map<Long, List<String>> map = departmentsService.selectDepartmentTreeByDepIds(depIds);
|
||||
|
||||
List<String> names = map.get(Long.valueOf(resultRecord.getDepartmentId()));
|
||||
if(CollectionUtils.isNotEmpty(names)){
|
||||
Collections.reverse(names);
|
||||
int size = names.size();
|
||||
if(size>0 && StringUtils.isNotBlank(names.get(0))){
|
||||
resultRecordDetailDto.setDepartmentOne(names.get(0));
|
||||
}
|
||||
if(size>1 && StringUtils.isNotBlank(names.get(1))){
|
||||
resultRecordDetailDto.setDepartmentTwo(names.get(1));
|
||||
}
|
||||
if(size>2 && StringUtils.isNotBlank(names.get(2))){
|
||||
resultRecordDetailDto.setDepartmentThree(names.get(2));
|
||||
}
|
||||
}
|
||||
|
||||
FlowStart flowStart = flowStartService.selectFlowStartById(resultRecord.getStartId());
|
||||
if(flowStart != null){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
||||
String startDate = sdf.format(flowStart.getStartTime());
|
||||
if(flowStart.getCycleType().intValue() != 0){
|
||||
String endDate = sdf.format(flowStart.getEndTime());
|
||||
resultRecordDetailDto.setAssessCycle(startDate + "至" + endDate );
|
||||
}else{
|
||||
resultRecordDetailDto.setAssessCycle(startDate);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return R.ok().put("data", resultRecordDetailDto);
|
||||
}
|
||||
|
||||
|
||||
@ -85,6 +85,20 @@ public class ResultRecordDetailDto {
|
||||
List<ResultRecortModelDto> recortModelDtos;
|
||||
@ApiModelProperty(value = "当前指标权重之和", name = "weight")
|
||||
BigDecimal weight;
|
||||
|
||||
//新增导出所需数据
|
||||
@ApiModelProperty(value = "考核周期", name = "assessCycle")
|
||||
private String assessCycle;
|
||||
//一级部门
|
||||
@ApiModelProperty(value = "一级部门", name = "departmentOne")
|
||||
private String departmentOne;
|
||||
//二级部门
|
||||
@ApiModelProperty(value = "二级部门", name = "departmentTwo")
|
||||
private String departmentTwo;
|
||||
//三级部门
|
||||
@ApiModelProperty(value = "三级部门", name = "departmentThree")
|
||||
private String departmentThree;
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
|
||||
@ -57,6 +57,9 @@ public class ResultTaskController extends AbstractController{
|
||||
@ApiOperation("任务变更记录")
|
||||
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = TaskProcessRecordDto.class)})
|
||||
public R changeTaskList(@RequestBody ChangeTaskListReq req){
|
||||
if(req.getStaffId()==null){
|
||||
req.setStaffId(getUserId());
|
||||
}
|
||||
PageUtils pageUtils = taskProcessRecordService.selectTaskProcessRecordsByTaskId(req);
|
||||
return R.ok().put("data",pageUtils);
|
||||
}
|
||||
|
||||
@ -44,6 +44,17 @@ public class TaskProcessRecordDto {
|
||||
@ApiModelProperty(value = "职位", name = "position")
|
||||
private String position;
|
||||
|
||||
@ApiModelProperty(value = "@员工id", name = "atStaffIds")
|
||||
private String atStaffIds;
|
||||
|
||||
@ApiModelProperty(value = "@员工姓名", name = "atStaffNames")
|
||||
private String atStaffNames;
|
||||
|
||||
@ApiModelProperty(value = "是不是自己的评论", name = "isSelf")
|
||||
private int isSelf;
|
||||
|
||||
private Long staffId;
|
||||
|
||||
private Long taskId;
|
||||
|
||||
private Long detailId;
|
||||
|
||||
@ -23,4 +23,7 @@ public class ChangeTaskListReq extends BasePage {
|
||||
|
||||
@ApiModelProperty(value="0:记录 不传全部",name = "useType")
|
||||
private Integer useType;
|
||||
|
||||
@ApiModelProperty(value="员工id",name = "staffId")
|
||||
private Long staffId;
|
||||
}
|
||||
|
||||
@ -110,12 +110,26 @@ public class ResultTaskServiceImpl extends ServiceImpl<ResultTaskMapper, ResultT
|
||||
TaskProcessRecordDto taskProcessRecordDto = taskProcessRecordMapper.selectTaskProcessRecordLastByTaskId(resultTaskDto.getId());
|
||||
if(taskProcessRecordDto != null){
|
||||
//resultTaskDto.setLabel(taskProcessRecordDto.getLabel());
|
||||
ProcessRecordEnum byType = ProcessRecordEnum.findByType(taskProcessRecordDto.getType());
|
||||
Optional.ofNullable(byType).ifPresent(processRecordEnum -> resultTaskDto.setTypeDesc(byType.getDesc()));
|
||||
if(finalStaffEntity !=null){
|
||||
resultTaskDto.setAvatar(finalStaffEntity.getAvatar());
|
||||
resultTaskDto.setStaffName(finalStaffEntity.getName());
|
||||
if(taskProcessRecordDto.getUseType()==0){
|
||||
ProcessRecordEnum byType = ProcessRecordEnum.findByType(taskProcessRecordDto.getType());
|
||||
Optional.ofNullable(byType).ifPresent(processRecordEnum -> resultTaskDto.setTypeDesc(byType.getDesc()));
|
||||
if(finalStaffEntity !=null){
|
||||
resultTaskDto.setAvatar(finalStaffEntity.getAvatar());
|
||||
resultTaskDto.setStaffName(finalStaffEntity.getName());
|
||||
}
|
||||
}
|
||||
if(taskProcessRecordDto.getUseType()==1){
|
||||
resultTaskDto.setTypeDesc(taskProcessRecordDto.getLabel());
|
||||
StaffEntity staffEntity1 = staffService.selectStaffById(taskProcessRecordDto.getStaffId());
|
||||
if(staffEntity1 !=null){
|
||||
resultTaskDto.setAvatar(staffEntity1.getAvatar());
|
||||
resultTaskDto.setStaffName(staffEntity1.getName());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@ -140,6 +140,19 @@ public class TaskProcessRecordServiceImpl extends ServiceImpl<TaskProcessRecordM
|
||||
});
|
||||
Optional.ofNullable(staffOccupationByStaffId).ifPresent(staffOccupationEntity -> dto.setPosition(staffOccupationEntity.getPosition()));
|
||||
|
||||
if (dto.getUseType()==1 ) {
|
||||
if(dto.getStaffId().equals(req.getStaffId())){
|
||||
dto.setIsSelf(1);
|
||||
}
|
||||
staffEntity = staffService.selectStaffById(dto.getStaffId());
|
||||
Optional.ofNullable(staffEntity).ifPresent(staffEntity12 -> {
|
||||
dto.setAvatar(staffEntity12.getAvatar());
|
||||
dto.setStaffName(staffEntity12.getName());
|
||||
StaffOccupationEntity staffOccupation= staffOccupationService.getStaffOccupationByStaffId(staffEntity12.getId());
|
||||
Optional.ofNullable(staffOccupation).ifPresent(staffOccupationEntity -> dto.setPosition(staffOccupationEntity.getPosition()));
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -131,7 +131,7 @@
|
||||
|
||||
|
||||
<select id="selectTaskProcessRecordsByTaskId" resultType="com.lz.modules.performance.dto.TaskProcessRecordDto">
|
||||
select gmt_create,remark,label,type,name,use_type,detail_id,task_id from lz_task_process_record where task_id=#{taskId}
|
||||
select gmt_create,remark,label,type,name,use_type,detail_id,task_id,staff_id,at_staff_ids,at_staff_names from lz_task_process_record where task_id=#{taskId}
|
||||
<if test="useType !=null">
|
||||
and use_type = #{useType}
|
||||
</if>
|
||||
@ -143,13 +143,13 @@
|
||||
</update>
|
||||
|
||||
<select id="selectTaskProcessRecordLastByTaskId" resultType="com.lz.modules.performance.dto.TaskProcessRecordDto">
|
||||
select gmt_create,remark,label,type from lz_task_process_record where task_id=#{taskId} and is_delete = 0
|
||||
select gmt_create,remark,label,type,use_type,task_id,detail_id,staff_id,at_staff_ids,at_staff_names from lz_task_process_record where task_id=#{taskId} and is_delete = 0
|
||||
order by id desc limit 1
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectTaskProcessRecordsByTaskIdsAndType" resultType="com.lz.modules.performance.dto.TaskProcessRecordDto">
|
||||
select gmt_create,remark,label,type,use_type,task_id,detail_id from lz_task_process_record where is_delete = 0
|
||||
select gmt_create,remark,label,type,use_type,task_id,detail_id,staff_id,at_staff_ids,at_staff_names from lz_task_process_record where is_delete = 0
|
||||
<if test="useType !=null">
|
||||
and use_type = #{useType}
|
||||
</if>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user