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
8587ce74fe
@ -2,6 +2,7 @@ package com.lz.modules.performance.controller;
|
|||||||
|
|
||||||
import com.lz.common.utils.PageUtils;
|
import com.lz.common.utils.PageUtils;
|
||||||
import com.lz.common.utils.R;
|
import com.lz.common.utils.R;
|
||||||
|
import com.lz.common.utils.StringUtil;
|
||||||
import com.lz.modules.flow.dao.FlowStartMapper;
|
import com.lz.modules.flow.dao.FlowStartMapper;
|
||||||
import com.lz.modules.flow.entity.FlowStart;
|
import com.lz.modules.flow.entity.FlowStart;
|
||||||
import com.lz.modules.performance.req.AssessChangeReq;
|
import com.lz.modules.performance.req.AssessChangeReq;
|
||||||
@ -86,12 +87,13 @@ public class AssessManagerController {
|
|||||||
if(req.getChangeType()==null){
|
if(req.getChangeType()==null){
|
||||||
return R.error("变动类型无效");
|
return R.error("变动类型无效");
|
||||||
}
|
}
|
||||||
FlowStart flowStart = flowStartMapper.selectFlowStartById(req.getStartId());
|
if(StringUtil.isBlank(req.getStaffIds())){
|
||||||
if(flowStart == null){
|
return R.error("变动人员不能为空");
|
||||||
return R.error("暂无此考核组信息");
|
}
|
||||||
|
String errorMsg = assessManagerService.assessChange(req);
|
||||||
|
if(StringUtil.isNotBlank(errorMsg)){
|
||||||
|
return R.error(errorMsg);
|
||||||
}
|
}
|
||||||
flowStart.getGroupIds();
|
|
||||||
assessManagerService.assessChange(req);
|
|
||||||
return R.ok();
|
return R.ok();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,7 +29,7 @@ public class UserTaskController extends AbstractController{
|
|||||||
@ApiOperation("获取待办/处理事项")
|
@ApiOperation("获取待办/处理事项")
|
||||||
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = TaskListRes.class)})
|
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = TaskListRes.class)})
|
||||||
public R list(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true) AssessTaskReq req){
|
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);
|
return R.ok().put("data",pageUtils);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,6 +21,6 @@ public class AssessChangeReq {
|
|||||||
private Integer changeType;
|
private Integer changeType;
|
||||||
|
|
||||||
@ApiModelProperty(value = "变动人员ids",name = "staffIds")
|
@ApiModelProperty(value = "变动人员ids",name = "staffIds")
|
||||||
private List<String> staffIds;
|
private String staffIds;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,6 @@ public class ChartResultReq extends BasePage{
|
|||||||
@ApiModelProperty(value = "考核id",name = "startId")
|
@ApiModelProperty(value = "考核id",name = "startId")
|
||||||
private Long startId;
|
private Long startId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "状态",name = "flowProcess")
|
@ApiModelProperty(value = "等级",name = "scoreLevel")
|
||||||
private Long flowProcess;
|
private Long scoreLevel;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.lz.modules.performance.res;
|
package com.lz.modules.performance.res;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
@ -11,15 +13,24 @@ import java.util.List;
|
|||||||
* @Date: 2020/10/21 11:35
|
* @Date: 2020/10/21 11:35
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@ApiModel("考核详情列表实体")
|
||||||
public class AssessManagerDetailRes {
|
public class AssessManagerDetailRes {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "姓名",name = "staffName")
|
||||||
private String staffName;
|
private String staffName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "部门名称",name = "departmentName")
|
||||||
private String departmentName;
|
private String departmentName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "考核组",name = "evaluationName")
|
||||||
private String evaluationName;
|
private String evaluationName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "考核结果",name = "allScore")
|
||||||
private String allScore;
|
private String allScore;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "绩效等级",name = "scoreLevel")
|
||||||
private String scoreLevel;
|
private String scoreLevel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "id",name = "id")
|
||||||
|
private Long id;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,10 +15,9 @@ public interface AssessManagerService {
|
|||||||
|
|
||||||
PageUtils assessList(AssessListReq req);
|
PageUtils assessList(AssessListReq req);
|
||||||
|
|
||||||
|
|
||||||
PageUtils assessDetail(AssessDetailReq req);
|
PageUtils assessDetail(AssessDetailReq req);
|
||||||
|
|
||||||
void accessDelete(FlowStart flowStart);
|
void accessDelete(FlowStart flowStart);
|
||||||
|
|
||||||
void assessChange(AssessChangeReq req);
|
String assessChange(AssessChangeReq req);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,8 @@ package com.lz.modules.performance.service.impl;
|
|||||||
import com.lz.common.utils.PageUtils;
|
import com.lz.common.utils.PageUtils;
|
||||||
import com.lz.common.utils.R;
|
import com.lz.common.utils.R;
|
||||||
import com.lz.common.utils.StringUtil;
|
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.dao.FlowStartMapper;
|
||||||
import com.lz.modules.flow.entity.EvaluationGroup;
|
import com.lz.modules.flow.entity.EvaluationGroup;
|
||||||
import com.lz.modules.flow.entity.FlowStart;
|
import com.lz.modules.flow.entity.FlowStart;
|
||||||
@ -22,9 +24,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.function.Consumer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static java.util.stream.Collectors.toList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: djc
|
* @Author: djc
|
||||||
* @Desc:
|
* @Desc:
|
||||||
@ -40,6 +45,8 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
|||||||
private EvaluationGroupService evaluationGroupService;
|
private EvaluationGroupService evaluationGroupService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private EvaluationStartStaffService evaluationStartStaffService;
|
private EvaluationStartStaffService evaluationStartStaffService;
|
||||||
|
@Autowired
|
||||||
|
private StaffService staffService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageUtils assessList(AssessListReq req) {
|
public PageUtils assessList(AssessListReq req) {
|
||||||
@ -89,7 +96,7 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
|||||||
if(StringUtil.isNotBlank(groupIds)){
|
if(StringUtil.isNotBlank(groupIds)){
|
||||||
String[] split = groupIds.split(",");
|
String[] split = groupIds.split(",");
|
||||||
List<String> ids = Arrays.asList(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);
|
evaluationGroupService.deleteByIds(collect);
|
||||||
}
|
}
|
||||||
resultRecordMapper.batchDeleteByStartId(flowStart.getId());
|
resultRecordMapper.batchDeleteByStartId(flowStart.getId());
|
||||||
@ -98,15 +105,47 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@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){
|
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){
|
if(req.getChangeType() == 1){
|
||||||
|
resultRecordMapper.batchDeleteByStartIdAndStaffId(req.getStartId(),change);
|
||||||
|
return ok;
|
||||||
}
|
}
|
||||||
|
return ok;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -138,7 +138,7 @@ public class ChartResultServiceImpl implements ChartResultService {
|
|||||||
List<String> allDeparmentIds = staffService.selectAllDeparmentIdsByDepartmentParentId(req.getDepartmentId());
|
List<String> allDeparmentIds = staffService.selectAllDeparmentIdsByDepartmentParentId(req.getDepartmentId());
|
||||||
List<String> ids = staffService.staffsByAllDeparmentIds(allDeparmentIds);
|
List<String> ids = staffService.staffsByAllDeparmentIds(allDeparmentIds);
|
||||||
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(), req.getPageSize()).doSelect(
|
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;
|
return pageUtils;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,7 +77,7 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
|
|||||||
|
|
||||||
List<ChartStatistical> countNumByScoreLevel(@Param("startId") Long startId);
|
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);
|
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<AssessManagerDetailRes> selectAssessListByStartId(@Param("page") IPage page, @Param("req")AssessDetailReq req);
|
||||||
|
|
||||||
List<ChartStatistical> countAssessNumByFlowProcess(@Param("req")AssessDetailReq req);
|
List<ChartStatistical> countAssessNumByFlowProcess(@Param("req")AssessDetailReq req);
|
||||||
|
|
||||||
|
void batchDeleteByStartIdAndStaffId(@Param("startId")Long startId,@Param("staffIds") List<String> staffIds);
|
||||||
}
|
}
|
||||||
@ -373,8 +373,8 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
<if test="flowProcess !=null">
|
<if test="scoreLevel !=null">
|
||||||
and r.flow_process = #{flowProcess}
|
and r.score_level = #{scoreLevel}
|
||||||
</if>
|
</if>
|
||||||
ORDER BY all_score desc
|
ORDER BY all_score desc
|
||||||
</select>
|
</select>
|
||||||
@ -395,7 +395,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAssessListByStartId" resultType="com.lz.modules.performance.res.AssessManagerDetailRes">
|
<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
|
LEFT JOIN lz_evaluation_start_staff s
|
||||||
ON r.start_id = s.start_id and r.staff_id = s.staff_id
|
ON r.start_id = s.start_id and r.staff_id = s.staff_id
|
||||||
where r.is_delete = 0 and s.is_delete = 0
|
where r.is_delete = 0 and s.is_delete = 0
|
||||||
@ -449,5 +449,17 @@
|
|||||||
GROUP BY flow_process
|
GROUP BY flow_process
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user