fix
This commit is contained in:
parent
17b6952507
commit
cc8269b31f
@ -31,5 +31,8 @@ public interface EvaluationGroupService extends IService<EvaluationGroup> {
|
||||
|
||||
int deleteEvaluationGroupById(Long id);
|
||||
|
||||
//获取参与考核的所有人员
|
||||
List<String> selectAllStaffIdsById(Long id);
|
||||
|
||||
|
||||
}
|
||||
@ -1,13 +1,15 @@
|
||||
package com.lz.modules.flow.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.lz.modules.app.service.StaffService;
|
||||
import com.lz.modules.flow.dao.EvaluationGroupMapper;
|
||||
import com.lz.modules.flow.entity.EvaluationGroup;
|
||||
import com.lz.modules.flow.service.EvaluationGroupService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -24,6 +26,8 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
|
||||
|
||||
@Autowired
|
||||
private EvaluationGroupMapper evaluationGroupMapper;
|
||||
@Autowired
|
||||
private StaffService staffService;
|
||||
|
||||
|
||||
|
||||
@ -61,6 +65,31 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<String> selectAllStaffIdsById(Long id) {
|
||||
EvaluationGroup evaluationGroup = this.selectEvaluationGroupById(id);
|
||||
String depIds = evaluationGroup.getDepIds();
|
||||
Set<String> allDeparmentIds = new HashSet<>();
|
||||
if(StringUtils.isNotBlank(depIds)){
|
||||
String[] split = depIds.split(",");
|
||||
for(String s:split){
|
||||
List<String> strings = staffService.selectAllDeparmentIdsByDepartmentParentId(s);
|
||||
allDeparmentIds.addAll(strings);
|
||||
}
|
||||
}
|
||||
List<String> depStaffIds = staffService.staffsByAllDeparmentIds(new ArrayList<>(allDeparmentIds));
|
||||
|
||||
|
||||
String staffIds = evaluationGroup.getStaffIds();
|
||||
if(StringUtils.isNotBlank(staffIds)){
|
||||
String[] split = staffIds.split(",");
|
||||
depStaffIds.addAll(Arrays.asList(split));
|
||||
}
|
||||
String outIds = evaluationGroup.getOutIds();
|
||||
if(StringUtils.isNotBlank(outIds)){
|
||||
String[] split = outIds.split(",");
|
||||
depStaffIds.removeAll(Arrays.asList(split));
|
||||
}
|
||||
//去重
|
||||
return new ArrayList<>(new HashSet(depStaffIds));
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ import com.lz.modules.performance.res.TaskListRes;
|
||||
import com.lz.modules.performance.service.ChartResultService;
|
||||
import com.lz.modules.sys.controller.AbstractController;
|
||||
import io.swagger.annotations.*;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @Author: djc
|
||||
@ -39,9 +41,7 @@ public class ChartController extends AbstractController{
|
||||
List<ChartStatisticalRes> data = new ArrayList<>();
|
||||
chartResultService.chartReport(req);
|
||||
EvaluationGroup evaluationGroup = evaluationGroupService.selectEvaluationGroupById(1L);
|
||||
String depIds = evaluationGroup.getDepIds();
|
||||
String staffIds = evaluationGroup.getStaffIds();
|
||||
String outIds = evaluationGroup.getOutIds();
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user