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-28 11:24:24 +08:00
commit 8587ce74fe
10 changed files with 85 additions and 20 deletions

View File

@ -2,6 +2,7 @@ package com.lz.modules.performance.controller;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
import com.lz.modules.flow.dao.FlowStartMapper;
import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.performance.req.AssessChangeReq;
@ -86,12 +87,13 @@ public class AssessManagerController {
if(req.getChangeType()==null){
return R.error("变动类型无效");
}
FlowStart flowStart = flowStartMapper.selectFlowStartById(req.getStartId());
if(flowStart == null){
return R.error("暂无此考核组信息");
if(StringUtil.isBlank(req.getStaffIds())){
return R.error("变动人员不能为空");
}
String errorMsg = assessManagerService.assessChange(req);
if(StringUtil.isNotBlank(errorMsg)){
return R.error(errorMsg);
}
flowStart.getGroupIds();
assessManagerService.assessChange(req);
return R.ok();
}

View File

@ -29,7 +29,7 @@ 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, getUserId());
PageUtils pageUtils = assessService.userTaskList(req, 313L);
return R.ok().put("data",pageUtils);
}
}

View File

@ -21,6 +21,6 @@ public class AssessChangeReq {
private Integer changeType;
@ApiModelProperty(value = "变动人员ids",name = "staffIds")
private List<String> staffIds;
private String staffIds;
}

View File

@ -20,6 +20,6 @@ public class ChartResultReq extends BasePage{
@ApiModelProperty(value = "考核id",name = "startId")
private Long startId;
@ApiModelProperty(value = "状态",name = "flowProcess")
private Long flowProcess;
@ApiModelProperty(value = "等级",name = "scoreLevel")
private Long scoreLevel;
}

View File

@ -1,5 +1,7 @@
package com.lz.modules.performance.res;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
@ -11,15 +13,24 @@ import java.util.List;
* @Date: 2020/10/21 11:35
*/
@Data
@ApiModel("考核详情列表实体")
public class AssessManagerDetailRes {
@ApiModelProperty(value = "姓名",name = "staffName")
private String staffName;
@ApiModelProperty(value = "部门名称",name = "departmentName")
private String departmentName;
@ApiModelProperty(value = "考核组",name = "evaluationName")
private String evaluationName;
@ApiModelProperty(value = "考核结果",name = "allScore")
private String allScore;
@ApiModelProperty(value = "绩效等级",name = "scoreLevel")
private String scoreLevel;
@ApiModelProperty(value = "id",name = "id")
private Long id;
}

View File

@ -15,10 +15,9 @@ public interface AssessManagerService {
PageUtils assessList(AssessListReq req);
PageUtils assessDetail(AssessDetailReq req);
void accessDelete(FlowStart flowStart);
void assessChange(AssessChangeReq req);
String assessChange(AssessChangeReq req);
}

View File

@ -3,6 +3,8 @@ package com.lz.modules.performance.service.impl;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
import com.lz.modules.app.dto.StaffSimpleDto;
import com.lz.modules.app.service.StaffService;
import com.lz.modules.flow.dao.FlowStartMapper;
import com.lz.modules.flow.entity.EvaluationGroup;
import com.lz.modules.flow.entity.FlowStart;
@ -22,9 +24,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import static java.util.stream.Collectors.toList;
/**
* @Author: djc
* @Desc:
@ -40,6 +45,8 @@ public class AssessManagerServiceImpl implements AssessManagerService {
private EvaluationGroupService evaluationGroupService;
@Autowired
private EvaluationStartStaffService evaluationStartStaffService;
@Autowired
private StaffService staffService;
@Override
public PageUtils assessList(AssessListReq req) {
@ -89,7 +96,7 @@ public class AssessManagerServiceImpl implements AssessManagerService {
if(StringUtil.isNotBlank(groupIds)){
String[] split = groupIds.split(",");
List<String> ids = Arrays.asList(split);
List<Long> collect = ids.stream().map(s -> Long.valueOf(s)).collect(Collectors.toList());
List<Long> collect = ids.stream().map(s -> Long.valueOf(s)).collect(toList());
evaluationGroupService.deleteByIds(collect);
}
resultRecordMapper.batchDeleteByStartId(flowStart.getId());
@ -98,15 +105,47 @@ public class AssessManagerServiceImpl implements AssessManagerService {
@Override
public void assessChange(AssessChangeReq req) {
public String assessChange(AssessChangeReq req) {
String ok = StringUtil.EMPTY;
FlowStart flowStart = flowStartMapper.selectFlowStartById(req.getStartId());
if(flowStart == null){
return "暂无此考核组信息";
}
String[] split = flowStart.getGroupIds().split(",");
String[] changeStaffIds = req.getStaffIds().split(",");
List<String> strings = Arrays.asList(split);
List<Long> ids = strings.stream().map(s -> Long.valueOf(s)).collect(toList());
List<EvaluationGroup> evaluationGroups = evaluationGroupService.selectEvaluationGroupByIds(ids);
Set<String> staffIds = new HashSet<>();
for(EvaluationGroup group:evaluationGroups){
List<String> staff = evaluationGroupService.selectAllStaffIdsByGroupId(group.getId());
staffIds.addAll(staff);
}
List<String> all = new ArrayList<>(staffIds);
List<String> change = Arrays.asList(changeStaffIds);
if(req.getChangeType() == 0){
//获取不在考评组的人员
List<String> notInGroup = change.stream().filter(item -> !all.contains(item)).collect(toList());
if(CollectionUtils.isNotEmpty(notInGroup)){
List<Long> collect = notInGroup.stream().map(s -> Long.valueOf(s)).collect(toList());
List<StaffSimpleDto> staffSimpleDtos = staffService.selectStaffSimpleInfoByIds(collect);
String notInGroupNames = StringUtil.EMPTY;
for(StaffSimpleDto dto:staffSimpleDtos){
notInGroupNames = notInGroupNames + dto.getName() + " ";
}
return notInGroupNames;
}
//初始化添加用户的数据 TODO
return ok;
}
if(req.getChangeType() == 1){
resultRecordMapper.batchDeleteByStartIdAndStaffId(req.getStartId(),change);
return ok;
}
return ok;
}
}

View File

@ -138,7 +138,7 @@ public class ChartResultServiceImpl implements ChartResultService {
List<String> allDeparmentIds = staffService.selectAllDeparmentIdsByDepartmentParentId(req.getDepartmentId());
List<String> ids = staffService.staffsByAllDeparmentIds(allDeparmentIds);
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(), req.getPageSize()).doSelect(
page -> resultRecordMapper.selectChartDetailList(page,ids,req.getStartId(),req.getFlowProcess())
page -> resultRecordMapper.selectChartDetailList(page,ids,req.getStartId(),req.getScoreLevel())
);
return pageUtils;
}

View File

@ -77,7 +77,7 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
List<ChartStatistical> countNumByScoreLevel(@Param("startId") Long startId);
List<ResultRecord> selectChartDetailList(@Param("page") IPage page, @Param("staffIds") List<String> staffIds, @Param("startId")Long startId,@Param("flowProcess")Long flowProcess);
List<ResultRecord> selectChartDetailList(@Param("page") IPage page, @Param("staffIds") List<String> staffIds, @Param("startId")Long startId,@Param("scoreLevel")Long scoreLevel);
void batchDeleteByStartId(@Param("startId")Long startId);
@ -88,4 +88,6 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
List<AssessManagerDetailRes> selectAssessListByStartId(@Param("page") IPage page, @Param("req")AssessDetailReq req);
List<ChartStatistical> countAssessNumByFlowProcess(@Param("req")AssessDetailReq req);
void batchDeleteByStartIdAndStaffId(@Param("startId")Long startId,@Param("staffIds") List<String> staffIds);
}

View File

@ -373,8 +373,8 @@
</foreach>
)
</if>
<if test="flowProcess !=null">
and r.flow_process = #{flowProcess}
<if test="scoreLevel !=null">
and r.score_level = #{scoreLevel}
</if>
ORDER BY all_score desc
</select>
@ -395,7 +395,7 @@
</select>
<select id="selectAssessListByStartId" resultType="com.lz.modules.performance.res.AssessManagerDetailRes">
select staff_name,department_name,all_score,score_level,evaluation_name from lz_result_record r
select r.id,staff_name,department_name,all_score,score_level,evaluation_name from lz_result_record r
LEFT JOIN lz_evaluation_start_staff s
ON r.start_id = s.start_id and r.staff_id = s.staff_id
where r.is_delete = 0 and s.is_delete = 0
@ -449,5 +449,17 @@
GROUP BY flow_process
</select>
<update id="batchDeleteByStartIdAndStaffId">
update lz_result_record set is_delete = 1 where
is_delete = 0
and start_id = #{startId}
and staff_id in (
<foreach collection="staffIds" item="staff_id" separator=",">
#{staff_id}
</foreach>
)
</update>
</mapper>