添加获取绩效详情

This commit is contained in:
wulin 2020-10-27 16:08:33 +08:00
parent c8c492e9ad
commit 0d33e10774
13 changed files with 97 additions and 45 deletions

View File

@ -8,6 +8,7 @@ import com.lz.modules.app.dto.RecordDetailDto;
import com.lz.modules.app.dto.StaffDepartmentDto; import com.lz.modules.app.dto.StaffDepartmentDto;
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity; import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
import com.lz.modules.app.entity.StaffEntity; import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.entity.StaffSimpleInfo;
import com.lz.modules.app.req.ResultRecordReq; import com.lz.modules.app.req.ResultRecordReq;
import com.lz.modules.app.resp.ResultDetailResp; import com.lz.modules.app.resp.ResultDetailResp;
import com.lz.modules.app.resp.Step; import com.lz.modules.app.resp.Step;
@ -16,7 +17,9 @@ import com.lz.modules.app.service.DepartmentsStaffRelateService;
import com.lz.modules.app.service.StaffService; import com.lz.modules.app.service.StaffService;
import com.lz.modules.flow.entity.*; import com.lz.modules.flow.entity.*;
import com.lz.modules.flow.model.Auth; import com.lz.modules.flow.model.Auth;
import com.lz.modules.flow.model.ResultDetailDto;
import com.lz.modules.flow.model.ResultRecordDetailDto; import com.lz.modules.flow.model.ResultRecordDetailDto;
import com.lz.modules.flow.model.ResultRecortModelDto;
import com.lz.modules.flow.req.ResultDetailReq; import com.lz.modules.flow.req.ResultDetailReq;
import com.lz.modules.flow.service.*; import com.lz.modules.flow.service.*;
import com.lz.modules.sys.controller.AbstractController; import com.lz.modules.sys.controller.AbstractController;
@ -51,7 +54,7 @@ import java.util.stream.Collectors;
@RestController @RestController
@RequestMapping("user/lzresultrecord") @RequestMapping("user/lzresultrecord")
@Slf4j @Slf4j
@Api("绩效相关-吴林") @Api(tags = "绩效相关")
public class ResultRecordController extends AbstractController { public class ResultRecordController extends AbstractController {
@Autowired @Autowired
private ResultRecordService lzResultRecordService; private ResultRecordService lzResultRecordService;
@ -319,12 +322,15 @@ public class ResultRecordController extends AbstractController {
* 信息 * 信息
*/ */
@GetMapping("/getDetail") @GetMapping("/getDetail")
@ApiOperation("获取绩效详情") @ApiOperation("获取绩效详情-吴林")
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = ResultRecordDetailDto.class)}) @ApiResponses({@ApiResponse(code = 200, message = "成功", response = ResultRecordDetailDto.class)})
public R getDetail(@RequestParam @ApiParam("绩效id") Long id) { public R getDetail(@RequestParam @ApiParam("绩效id") Long id) {
ResultRecord resultRecord = lzResultRecordService.selectResultRecordById(id); ResultRecord resultRecord = lzResultRecordService.selectResultRecordById(id);
SysUserEntity user = getUser(); if(resultRecord == null){
return R.error("绩效不存在");
}
/*SysUserEntity user = getUser();
if(resultRecord.getStaffId().longValue() != user.getUserId().longValue()){ if(resultRecord.getStaffId().longValue() != user.getUserId().longValue()){
//下面判断权限,是否可读 //下面判断权限,是否可读
EvaluationStartStaff evaluationStartStaff = EvaluationStartStaff evaluationStartStaff =
@ -332,10 +338,41 @@ public class ResultRecordController extends AbstractController {
if(evaluationStartStaff == null){//非考核组设置的绩效管理人员下面应在查询其他权限 if(evaluationStartStaff == null){//非考核组设置的绩效管理人员下面应在查询其他权限
return R.error("未被授权访问"); return R.error("未被授权访问");
} }
} }*/
//获取考核维度等信息 //获取考核维度等信息
ResultRecordDetailDto resultRecordDetailDto = new ResultRecordDetailDto();
BeanUtils.copyProperties(resultRecord, resultRecordDetailDto);
List<ResultModel> resultModels = resultModelService.selectResultModelByGroupId(resultRecord.getEvaluationId()); List<ResultModel> resultModels = resultModelService.selectResultModelByGroupId(resultRecord.getEvaluationId());
return R.ok().put("data", resultRecord); StaffEntity staffEntity = staffService.selectStaffById(resultRecord.getStaffId());
resultRecordDetailDto.setAvatar(staffEntity.getAvatar());
resultRecordDetailDto.setJobNumber(staffEntity.getJobNumber());
List<ResultRecortModelDto> resultRecortModelDtos = new ArrayList<>();
for (ResultModel model:resultModels
) {
resultRecordDetailDto.setCalculateId(model.getCalculateId());
resultRecordDetailDto.setGradeGroupId(model.getGradeGroupId());
ResultRecortModelDto resultRecortModelDto = new ResultRecortModelDto();
BeanUtils.copyProperties(model, resultRecortModelDto);
List<ResultDetailDto> detailDtos = resultDetailService.selectDtosByRecordId(resultRecord.getId(), model.getType());
resultRecortModelDto.setDetailDtos(detailDtos);
resultRecortModelDtos.add(resultRecortModelDto);
}
resultRecordDetailDto.setRecortModelDtos(resultRecortModelDtos);
return R.ok().put("data", resultRecordDetailDto);
}
@PostMapping("/saveDetail")
@ApiOperation("保存绩效详情-吴林")
public R saveDetail(@RequestParam @ApiParam("绩效id") ResultRecordDetailDto dto) {
return R.ok();
} }
/** /**

View File

@ -92,4 +92,6 @@ public interface StaffDao extends BaseMapper<StaffEntity> {
List<StaffSimpleInfo> selectStaffSimpleInfos(@Param("sIds") List<Long> sIds); List<StaffSimpleInfo> selectStaffSimpleInfos(@Param("sIds") List<Long> sIds);
List<StaffEntity> selectOnJobByIds(@Param("mIds") List<Long> mIds); List<StaffEntity> selectOnJobByIds(@Param("mIds") List<Long> mIds);
StaffSimpleInfo selectStaffSimpleInfo(@Param("staffId") Long staffId);
} }

View File

@ -44,6 +44,8 @@ public class StaffSimpleInfo implements Serializable {
private String departmentId; private String departmentId;
//钉钉飞书等第三方人员id //钉钉飞书等第三方人员id
private String employeeId; private String employeeId;
//头像
private String avatar;
} }

View File

@ -97,5 +97,7 @@ public interface StaffService extends IService<StaffEntity> {
DepartManagers findLeader(Long id, Integer type); DepartManagers findLeader(Long id, Integer type);
//查找在职的 //查找在职的
List<StaffEntity> selectOnJobByIds(List<Long> mIds); List<StaffEntity> selectOnJobByIds(List<Long> mIds);
StaffSimpleInfo selectStaffSimpleInfo(Long staffId);
} }

View File

@ -514,5 +514,10 @@ public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> impleme
return staffDao.selectOnJobByIds(mIds); return staffDao.selectOnJobByIds(mIds);
} }
@Override
public StaffSimpleInfo selectStaffSimpleInfo(Long staffId){
return staffDao.selectStaffSimpleInfo(staffId);
}
} }

View File

@ -37,18 +37,30 @@ public class ResultRecordDetailDto {
@ApiModelProperty(value = "员工id", name = "staffId") @ApiModelProperty(value = "员工id", name = "staffId")
private Long staffId; private Long staffId;
@ApiModelProperty(value = "lz_result_calculate 的id计算法方法id", name = "calculateId")
private Long calculateId;
//使用的哪个等级等级组idlz_result_grade的group_id
@ApiModelProperty(value = "使用的哪个等级。等级组idlz_result_grade的group_id", name = "gradeGroupId")
private Long gradeGroupId;
//当前审批流转所在员工 id //当前审批流转所在员工 id
@ApiModelProperty(value = "当前审批流转所在员工 id", name = "flowStaffIdRole") @ApiModelProperty(value = "当前审批流转所在员工 id", name = "flowStaffIdRole")
private Long flowStaffIdRole; private Long flowStaffIdRole;
//员工所在部门 id //员工所在部门 id
@ApiModelProperty(value = "员工所在部门 id", name = "departmentId") @ApiModelProperty(value = "员工所在部门 id", name = "departmentId")
private Long departmentId; private String departmentId;
//员工所在部门名称 //员工所在部门名称
@ApiModelProperty(value = "员工所在部门名称", name = "departmentName") @ApiModelProperty(value = "员工所在部门名称", name = "departmentName")
private String departmentName; private String departmentName;
//员工姓名 //员工姓名
@ApiModelProperty(value = "员工姓名", name = "staffName") @ApiModelProperty(value = "员工姓名", name = "staffName")
private String staffName; private String staffName;
//员工姓名
@ApiModelProperty(value = "员工头像", name = "avatar")
private String avatar;
//员工姓名
@ApiModelProperty(value = "员工工号", name = "jobNumber")
private String jobNumber;
//当前审批的员工 id //当前审批的员工 id
@ApiModelProperty(value = "当前审批的员工 id", name = "currentApprovalStaffId") @ApiModelProperty(value = "当前审批的员工 id", name = "currentApprovalStaffId")
private Long currentApprovalStaffId; private Long currentApprovalStaffId;
@ -175,14 +187,14 @@ public class ResultRecordDetailDto {
* 员工所在部门 id * 员工所在部门 id
* @return * @return
*/ */
public Long getDepartmentId() { public String getDepartmentId() {
return departmentId; return departmentId;
} }
/** /**
* 员工所在部门 id * 员工所在部门 id
* @param departmentId * @param departmentId
*/ */
public void setDepartmentId(Long departmentId) { public void setDepartmentId(String departmentId) {
this.departmentId = departmentId; this.departmentId = departmentId;
} }

View File

@ -33,12 +33,7 @@ public class ResultRecortModelDto {
@ApiModelProperty(value = "考核子项目个数最大限制", name = "maxCount") @ApiModelProperty(value = "考核子项目个数最大限制", name = "maxCount")
private Integer maxCount; private Integer maxCount;
//lz_result_calculate 的id计算法方法id //lz_result_calculate 的id计算法方法id
@ApiModelProperty(value = "lz_result_calculate 的id计算法方法id", name = "calculateId")
private Long calculateId;
//使用的哪个等级等级组idlz_result_grade的group_id
@ApiModelProperty(value = "使用的哪个等级。等级组idlz_result_grade的group_id", name = "gradeGroupId")
private Long gradeGroupId;
//排序 //排序
@ApiModelProperty(value = "排序", name = "orderBy") @ApiModelProperty(value = "排序", name = "orderBy")
private Integer orderBy; private Integer orderBy;
@ -120,38 +115,8 @@ public class ResultRecortModelDto {
this.maxCount = maxCount; this.maxCount = maxCount;
} }
/**
* lz_result_calculate 的id计算法方法id
* @return
*/
public Long getCalculateId() {
return calculateId;
}
/**
* lz_result_calculate 的id计算法方法id
* @param calculateId
*/
public void setCalculateId(Long calculateId) {
this.calculateId = calculateId;
}
/**
* 使用的哪个等级等级组idlz_result_grade的group_id
* @return
*/
public Long getGradeGroupId() {
return gradeGroupId;
}
/**
* 使用的哪个等级等级组idlz_result_grade的group_id
* @param gradeGroupId
*/
public void setGradeGroupId(Long gradeGroupId) {
this.gradeGroupId = gradeGroupId;
}
/** /**
* 排序 * 排序
* @return * @return
@ -175,8 +140,6 @@ public class ResultRecortModelDto {
",type=" + type + ",type=" + type +
",weight=" + weight + ",weight=" + weight +
",maxCount=" + maxCount + ",maxCount=" + maxCount +
",calculateId=" + calculateId +
",gradeGroupId=" + gradeGroupId +
",orderBy=" + orderBy + ",orderBy=" + orderBy +
"}"; "}";
} }

View File

@ -121,6 +121,7 @@ public class EvaluationGroupController {
} }
@PostMapping("/update") @PostMapping("/update")
public R update(@RequestBody @ApiParam EvaluationGroup evaluationGroup) { public R update(@RequestBody @ApiParam EvaluationGroup evaluationGroup) {
evaluationGroupService.updateEvaluationGroupById(evaluationGroup); evaluationGroupService.updateEvaluationGroupById(evaluationGroup);

View File

@ -9,6 +9,7 @@ package com.lz.modules.sys.dao.app;
*/ */
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lz.common.utils.BigDecimalUtil; import com.lz.common.utils.BigDecimalUtil;
import com.lz.modules.flow.model.ResultDetailDto;
import com.lz.modules.sys.entity.app.ResultDetail; import com.lz.modules.sys.entity.app.ResultDetail;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -43,4 +44,6 @@ public interface ResultDetailMapper extends BaseMapper<ResultDetail> {
BigDecimal calculateScore(@Param("recordId") Long recordId, @Param("staffId") Long staffId,@Param("type") Integer type); BigDecimal calculateScore(@Param("recordId") Long recordId, @Param("staffId") Long staffId,@Param("type") Integer type);
Long insertResultDetails(@Param("list") List<ResultDetail> resultDetails); Long insertResultDetails(@Param("list") List<ResultDetail> resultDetails);
List<ResultDetailDto> selectDtosByRecordId(@Param("recordResultId") Long id, @Param("type") int type);
} }

View File

@ -5,6 +5,7 @@ import com.lz.common.utils.BigDecimalUtil;
import com.lz.modules.app.resp.ResultDetailResp; import com.lz.modules.app.resp.ResultDetailResp;
import com.lz.modules.app.resp.Step; import com.lz.modules.app.resp.Step;
import com.lz.modules.flow.model.Auth; import com.lz.modules.flow.model.Auth;
import com.lz.modules.flow.model.ResultDetailDto;
import com.lz.modules.sys.entity.app.ResultDetail; import com.lz.modules.sys.entity.app.ResultDetail;
import com.lz.modules.sys.entity.app.ResultRecord; import com.lz.modules.sys.entity.app.ResultRecord;
@ -67,4 +68,6 @@ public interface ResultDetailService extends IService<ResultDetail> {
List<ResultDetail> selectByRecordIdAndType(Long id, int i); List<ResultDetail> selectByRecordIdAndType(Long id, int i);
Long insertResultDetails(List<ResultDetail> resultDetails); Long insertResultDetails(List<ResultDetail> resultDetails);
List<ResultDetailDto> selectDtosByRecordId(Long id, int type);
} }

View File

@ -12,6 +12,7 @@ import com.lz.modules.app.service.StaffService;
import com.lz.modules.app.utils.t.TwoTuple; import com.lz.modules.app.utils.t.TwoTuple;
import com.lz.modules.flow.entity.*; import com.lz.modules.flow.entity.*;
import com.lz.modules.flow.model.Auth; import com.lz.modules.flow.model.Auth;
import com.lz.modules.flow.model.ResultDetailDto;
import com.lz.modules.flow.model.StaffRoleDto; import com.lz.modules.flow.model.StaffRoleDto;
import com.lz.modules.flow.service.*; import com.lz.modules.flow.service.*;
import com.lz.modules.sys.dao.app.ResultDetailMapper; import com.lz.modules.sys.dao.app.ResultDetailMapper;
@ -334,4 +335,9 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
} }
@Override
public List<ResultDetailDto> selectDtosByRecordId(Long id, int type){
return resultDetailMapper.selectDtosByRecordId(id, type);
}
} }

View File

@ -178,5 +178,9 @@
</foreach> </foreach>
</insert> </insert>
<select id="selectDtosByRecordId" resultType="com.lz.modules.flow.model.ResultDetailDto">
select * from lz_result_detail where record_id=#{recordResultId} and type = #{type} and is_delete = 0 order by priority asc
</select>
</mapper> </mapper>

View File

@ -510,4 +510,16 @@
</foreach> </foreach>
) and occupation.staff_status=0 and staff.is_delete=0 and occupation.is_delete=0 ) and occupation.staff_status=0 and staff.is_delete=0 and occupation.is_delete=0
</select> </select>
<select id="selectStaffSimpleInfo" resultType="com.lz.modules.app.entity.StaffSimpleInfo">
select info.id as id, info.job_number as job_number, info.name as name, info.position,
info.department_id as department_id, info.employee_id as employee_id, dep.department_name as department_name from (
select staffinfo.id as id, staffinfo.job_number as job_number, staffinfo.name as name,
staffinfo.position, staffinfo.employee_id as employee_id, relate.department_id as department_id from (
select staff.id as id, staff.job_number as job_number, staff.name as name,staff.employee_id as employee_id, occupation.position as position
from lz_staff staff join lz_staff_occupation occupation on staff.id=occupation.staff_id where staff.id = #{staffId}
and occupation.staff_status=0 and occupation.is_delete=0 and staff.is_delete=0
) as staffinfo left join lz_departments_staff_relate relate on staffinfo.id = relate.staff_id
) as info left join lz_departments dep on info.department_id = dep.department_id GROUP BY info.id
</select>
</mapper> </mapper>