Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0

This commit is contained in:
wulin 2020-10-30 15:51:13 +08:00
commit fbc7e995b6
11 changed files with 106 additions and 37 deletions

View File

@ -41,6 +41,6 @@ public interface EvaluationGroupMapper extends BaseMapper<EvaluationGroup> {
EvaluationGroup selectEvaluationGroupByName(@Param("name") String name);
void deleteByIds(@Param("ids") List<Long> ids);
void deleteByCopyIds(@Param("ids") List<Long> ids);
}

View File

@ -48,7 +48,7 @@ public interface EvaluationGroupService extends IService<EvaluationGroup> {
//获取考核组里面所有参与的人员信息去除重复去除离职
List<StaffSimpleInfo> selectAllStaffSimpleInfoByGroupId(EvaluationGroup evaluationGroup);
void deleteByIds(List<Long> ids);
void deleteByCopyIds(List<Long> ids);
List<CheckStaffDto> checkStaff(EvaluationGroup evaluationGroup);
}

View File

@ -255,8 +255,8 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
@Override
public void deleteByIds(List<Long> ids) {
evaluationGroupMapper.deleteByIds(ids);
public void deleteByCopyIds(List<Long> ids) {
evaluationGroupMapper.deleteByCopyIds(ids);
}

View File

@ -8,6 +8,7 @@ import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.performance.req.AssessChangeReq;
import com.lz.modules.performance.req.AssessListReq;
import com.lz.modules.performance.req.AssessDetailReq;
import com.lz.modules.performance.req.AssessToScoreReq;
import com.lz.modules.performance.res.AssessManagerDetailRes;
import com.lz.modules.performance.res.AssessManagerListRes;
import com.lz.modules.performance.res.ChartStatistical;
@ -17,6 +18,7 @@ import com.lz.modules.performance.service.ChartResultService;
import com.lz.modules.sys.dao.app.ResultRecordMapper;
import com.lz.modules.sys.service.app.ResultRecordService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -29,6 +31,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("/performance")
@Slf4j
@Api(value="考核管理接口", tags={"考核管理"})
public class AssessManagerController {
@ -57,7 +60,13 @@ public class AssessManagerController {
if(req.getStartId()==null){
return R.error("考核id不能为空");
}
PageUtils pageUtils = assessManagerService.assessDetail(req);
PageUtils pageUtils = null;
try {
pageUtils = assessManagerService.assessDetail(req);
} catch (Exception e) {
log.error("获取考核详情列表异常" ,e);
return R.error();
}
return R.ok().put("data",pageUtils);
}
@ -71,7 +80,13 @@ public class AssessManagerController {
if(req.getStartId()==null){
return R.error("考核id不能为空");
}
List<ChartStatistical> process = chartResultService.countAssessNumByFlowProcess(req);
List<ChartStatistical> process = null;
try {
process = chartResultService.countAssessNumByFlowProcess(req);
} catch (Exception e) {
log.error("获取详情顶部人数统计异常" ,e);
return R.error();
}
return R.ok().put("data",process);
}
@ -90,9 +105,11 @@ public class AssessManagerController {
if(StringUtil.isBlank(req.getStaffIds())){
return R.error("变动人员不能为空");
}
String errorMsg = assessManagerService.assessChange(req);
if(StringUtil.isNotBlank(errorMsg)){
return R.error(errorMsg);
try {
assessManagerService.assessChange(req);
} catch (Exception e) {
log.error("考核管理变更异常" ,e);
return R.error(e.getMessage());
}
return R.ok();
@ -111,7 +128,25 @@ public class AssessManagerController {
if(flowStart == null){
return R.error("没有此条记录");
}
assessManagerService.accessDelete(flowStart);
try {
assessManagerService.accessDelete(flowStart);
} catch (Exception e) {
log.error("删除考核任务异常, id:" + assessId ,e);
return R.error();
}
return R.ok();
}
@PostMapping("assess/manager/toScore")
@ApiOperation("开始评分")
@ApiResponses({@ApiResponse(code = 200,message = "成功")})
public R assessToScore(@RequestBody @ApiParam AssessToScoreReq req){
try {
assessManagerService.toScore(req);
} catch (Exception e) {
log.error("开始评分异常" ,e);
return R.error();
}
return R.ok();
}
}

View File

@ -15,6 +15,7 @@ import com.lz.modules.performance.res.ResultRankListRes;
import com.lz.modules.performance.service.ChartResultService;
import com.lz.modules.sys.controller.AbstractController;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -28,6 +29,7 @@ import java.util.*;
@RestController
@RequestMapping("/performance")
@Api(value="报表接口", tags={"绩效报表"})
@Slf4j
public class ChartController extends AbstractController{
@Autowired
private ChartResultService chartResultService;
@ -38,7 +40,13 @@ public class ChartController extends AbstractController{
@ApiOperation("获取绩效报表统计")
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = ChartStatisticalRes.class)})
public R chartResult(@RequestParam(required = false) @ApiParam(name = "startId",value = "考核周期标识id") Long startId){
List<ChartStatisticalRes> chartStatisticalRes = chartResultService.chartReport(startId);
List<ChartStatisticalRes> chartStatisticalRes = null;
try {
chartStatisticalRes = chartResultService.chartReport(startId);
} catch (Exception e) {
log.error("获取绩效报表统计异常" ,e);
return R.error();
}
return R.ok().put("data",chartStatisticalRes);
}
@ -47,7 +55,13 @@ public class ChartController extends AbstractController{
@ApiOperation("获取考核类型列表")
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = ChartStartsRes.class)})
public R chartStarts(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true)ChartStartsReq req){
PageUtils pageUtils = chartResultService.chartStarts(req);
PageUtils pageUtils = null;
try {
pageUtils = chartResultService.chartStarts(req);
} catch (Exception e) {
log.error("获取考核类型列表异常" ,e);
return R.error();
}
return R.ok().put("data",pageUtils);
}
@ -56,7 +70,13 @@ public class ChartController extends AbstractController{
@ApiOperation("获取报表等级详情")
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = ResultRankListRes.class)})
public R chartDetailList(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true) ChartResultReq req){
PageUtils pageUtils = chartResultService.selectChartDetailList(req);
PageUtils pageUtils = null;
try {
pageUtils = chartResultService.selectChartDetailList(req);
} catch (Exception e) {
log.error("获取报表等级详情异常" ,e);
return R.error();
}
return R.ok().put("data",pageUtils);
}

View File

@ -7,6 +7,7 @@ import com.lz.modules.performance.res.TaskListRes;
import com.lz.modules.performance.service.AssessService;
import com.lz.modules.sys.controller.AbstractController;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@RequestMapping("/performance")
@Slf4j
@Api(value="事项接口", tags={"用户任务"})
public class UserTaskController extends AbstractController{
@Autowired
@ -29,7 +31,14 @@ public class UserTaskController extends AbstractController{
@ApiOperation("获取待办/处理事项")
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = TaskListRes.class)})
public R list(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true) AssessTaskReq req){
PageUtils pageUtils = assessService.userTaskList(req, 313L);
PageUtils pageUtils = null;
try {
//Long userId = getUserId();
pageUtils = assessService.userTaskList(req, 313L);
} catch (Exception e) {
log.error("获取用户事项异常 userId:" ,e);
return R.error();
}
return R.ok().put("data",pageUtils);
}
}

View File

@ -1,6 +1,7 @@
package com.lz.modules.performance.service;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.performance.req.AssessChangeReq;
import com.lz.modules.performance.req.AssessDetailReq;
@ -20,7 +21,7 @@ public interface AssessManagerService {
void accessDelete(FlowStart flowStart);
String assessChange(AssessChangeReq req);
R assessChange(AssessChangeReq req);
void toScore(AssessToScoreReq req);
}

View File

@ -2,6 +2,7 @@ package com.lz.modules.performance.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Maps;
import com.lz.common.exception.RRException;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
@ -114,7 +115,8 @@ public class AssessManagerServiceImpl implements AssessManagerService {
String[] split = groupIds.split(",");
List<String> ids = Arrays.asList(split);
List<Long> collect = ids.stream().map(s -> Long.valueOf(s)).collect(toList());
evaluationGroupService.deleteByIds(collect);
//删除副本组
evaluationGroupService.deleteByCopyIds(collect);
}
resultRecordMapper.batchDeleteByStartId(flowStart.getId());
return ;
@ -122,11 +124,10 @@ public class AssessManagerServiceImpl implements AssessManagerService {
@Override
public String assessChange(AssessChangeReq req) {
String ok = StringUtil.EMPTY;
public R assessChange(AssessChangeReq req) {
FlowStart flowStart = flowStartMapper.selectFlowStartById(req.getStartId());
if(flowStart == null){
return "暂无此考核组信息";
throw new RRException("暂无此考核组信息");
}
//获取本次考的所有考评组信息
String[] split = flowStart.getGroupIds().split(",");
@ -161,7 +162,7 @@ public class AssessManagerServiceImpl implements AssessManagerService {
for(StaffSimpleDto dto:staffSimpleDtos){
notInGroupNames = notInGroupNames + dto.getName() + " ";
}
return notInGroupNames + "已在其他类型为月度的考评组中,是否改为到此考评组中进行考核";
throw new RRException(notInGroupNames + "已在其他类型为月度的考评组中,是否改为到此考评组中进行考核");
}
//初始化添加用户的数据
@ -175,7 +176,7 @@ public class AssessManagerServiceImpl implements AssessManagerService {
groupStaffs.setEvaluationGroup(group);
List<String> staffs = map.get(group.getId());
staffs.retainAll(notInGroup);
staffs.retainAll(change);
List<Long> collect = staffs.stream().map(s -> Long.valueOf(s)).collect(toList());
collect.removeAll(longs);
@ -187,7 +188,7 @@ public class AssessManagerServiceImpl implements AssessManagerService {
startGroups.setStartId(req.getStartId());
startGroups.setGroups(groupS);
flowStartService.startStaffs(startGroups);
return ok;
return R.ok();
}
@ -195,9 +196,9 @@ public class AssessManagerServiceImpl implements AssessManagerService {
//删除本次考核任务
resultRecordMapper.batchDeleteByStartIdAndStaffId(req.getStartId(),change);
evaluationStartStaffMapper.deleteEvaluationStartStaffChangeAssess(req.getStartId(),change);
return ok;
return R.ok();
}
return ok;
return R.ok();
}
@ -211,16 +212,16 @@ public class AssessManagerServiceImpl implements AssessManagerService {
int i = evaluationStartStaffService.updateBatchToScore(req.getStartId(), evaluation);
List<Long> longs = resultRecordMapper.selectToScoreList(req.getStartId(), evaluation);
}
List<String> strings = Arrays.asList(split);
//更新流程绩效
ApprovalDto approvalDto = new ApprovalDto();
try {
resultRecordService.newApproval(approvalDto);
} catch (Exception e) {
e.printStackTrace();
//更新流程绩效
ApprovalDto approvalDto = new ApprovalDto();
approvalDto.setStatus(1);
approvalDto.setResultRecordId(1L);
approvalDto.setMenuName("开始评分");
try {
resultRecordService.newApproval(approvalDto);
} catch (Exception e) {
e.printStackTrace();
}
}

View File

@ -28,6 +28,7 @@ import com.lz.modules.performance.service.ChartResultService;
import com.lz.modules.sys.dao.app.ResultRecordMapper;
import com.lz.modules.sys.entity.app.ResultRecord;
import com.lz.modules.sys.service.app.ResultRecordService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -40,6 +41,7 @@ import java.util.*;
* @Date: 2020/10/14 16:53
*/
@Service("chartResultService")
@Slf4j
public class ChartResultServiceImpl implements ChartResultService {
@Autowired
@ -70,6 +72,7 @@ public class ChartResultServiceImpl implements ChartResultService {
//取最近一条记录
FlowStart flowStart = flowStartMapper.selectRecentlyLimt();
if(flowStart!=null){
log.info("首次进入,默认返回最新记录 flowStartId:" + flowStart.getId());
startId = flowStart.getId();
defaultTime = flowStart.getName();
defaultCycleType = flowStart.getCycleType();

View File

@ -89,7 +89,7 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
List<ChartStatistical> countAssessNumByFlowProcess(@Param("req")AssessDetailReq req);
void batchDeleteByStartIdAndStaffId(@Param("startId")Long startId,@Param("staffIds") List<String> staffIds);
int batchDeleteByStartIdAndStaffId(@Param("startId")Long startId,@Param("staffIds") List<String> staffIds);
List<Long> selectToScoreList(@Param("startId")Long startId,@Param("evaluationId")Long evaluationId);
}

View File

@ -122,9 +122,9 @@
select * from lz_evaluation_group where name=#{name} and is_delete = 0 limit 1
</select>
<update id="deleteByIds">
<update id="deleteByCopyIds">
update lz_evaluation_group set is_delete = 1 where is_delete=0
and id in (
and copy_id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>