fix
This commit is contained in:
parent
3e51dbc961
commit
611c07cb01
@ -1,5 +1,6 @@
|
||||
package com.lz.modules.performance.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.lz.common.utils.PageUtils;
|
||||
import com.lz.common.utils.R;
|
||||
import com.lz.common.utils.StringUtil;
|
||||
@ -42,7 +43,8 @@ public class ChartController extends AbstractController{
|
||||
public R chartResult(@RequestParam(required = false) @ApiParam(name = "startId",value = "考核周期标识id") Long startId){
|
||||
List<ChartStatisticalRes> chartStatisticalRes = null;
|
||||
try {
|
||||
Long userId = getUserId();
|
||||
//Long userId = getUserId();
|
||||
Long userId = 313L;
|
||||
chartStatisticalRes = chartResultService.chartReport(startId,userId);
|
||||
} catch (Exception e) {
|
||||
log.error("获取绩效报表统计异常" ,e);
|
||||
@ -83,5 +85,12 @@ public class ChartController extends AbstractController{
|
||||
|
||||
|
||||
|
||||
@PostMapping("chart/test")
|
||||
public R chartTest(){
|
||||
List<FlowStart> starts = flowStartMapper.selectList(new QueryWrapper<FlowStart>().in("group_ids", Collections.EMPTY_LIST));
|
||||
System.out.println();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -33,4 +33,6 @@ public class AssessDetailReq extends BasePage{
|
||||
private Integer flowProcess;
|
||||
|
||||
private List<String> departmentIds;
|
||||
|
||||
private Long loginUserId;
|
||||
}
|
||||
|
||||
@ -21,6 +21,6 @@ public class AssessListReq extends BasePage {
|
||||
@ApiModelProperty(value = "考核名称",name = "name")
|
||||
private String name;
|
||||
|
||||
private Long staffId;
|
||||
private Long loginUserId;
|
||||
|
||||
}
|
||||
|
||||
@ -23,6 +23,6 @@ public class ChartResultReq extends BasePage{
|
||||
@ApiModelProperty(value = "等级",name = "scoreLevel")
|
||||
private Long scoreLevel;
|
||||
|
||||
private Long staffId;
|
||||
private Long loginUserId;
|
||||
|
||||
}
|
||||
|
||||
@ -88,7 +88,8 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
||||
log.info("未找到考核发起数据");
|
||||
return pageUtils;
|
||||
}
|
||||
List<String> mandepartmentIds = assessService.roleDepartments(req.getStaffId());
|
||||
//List<String> mandepartmentIds = assessService.roleDepartments(req.getLoginUserId());
|
||||
List<String> mandepartmentIds = Collections.EMPTY_LIST;
|
||||
list.forEach(flowStart -> {
|
||||
AssessManagerListRes res = new AssessManagerListRes();
|
||||
String name = flowStart.getName();
|
||||
|
||||
@ -86,7 +86,8 @@ public class ChartResultServiceImpl implements ChartResultService {
|
||||
}
|
||||
}
|
||||
//自己管理的部门
|
||||
List<String> mandepartmentIds = assessService.roleDepartments(staffId);
|
||||
//List<String> mandepartmentIds = assessService.roleDepartments(staffId);
|
||||
List<String> mandepartmentIds = Collections.EMPTY_LIST;
|
||||
List<ChartStatisticalRes> data = new ArrayList<>();
|
||||
ChartStatisticalRes res;
|
||||
|
||||
@ -94,7 +95,7 @@ public class ChartResultServiceImpl implements ChartResultService {
|
||||
|
||||
res = new ChartStatisticalRes();
|
||||
res.setType(0);
|
||||
res.setStatisticals(buildProcess(process,startId));
|
||||
res.setStatisticals(buildProcess(process,startId,mandepartmentIds));
|
||||
res.setDefaultTime(defaultTime);
|
||||
if(StringUtil.isNotBlank(defaultTime)){
|
||||
res.setDefaultId(startId);
|
||||
@ -180,7 +181,8 @@ public class ChartResultServiceImpl implements ChartResultService {
|
||||
List<String> allDeparmentIds = staffService.selectAllDeparmentIdsByDepartmentParentId(req.getDepartmentId());
|
||||
//自己管理的和所有的部门交集
|
||||
log.info("selectChartDetailList 管理部门:" + JSON.toJSONString(allDeparmentIds));
|
||||
List<String> mandepartmentIds = assessService.roleDepartments(req.getStaffId());
|
||||
//List<String> mandepartmentIds = assessService.roleDepartments(req.getLoginUserId());
|
||||
List<String> mandepartmentIds = Collections.EMPTY_LIST;
|
||||
log.info("selectChartDetailList 管理部门:" + JSON.toJSONString(mandepartmentIds));
|
||||
mandepartmentIds.retainAll(allDeparmentIds);
|
||||
log.info("selectChartDetailList 交集部门:" + JSON.toJSONString(mandepartmentIds));
|
||||
@ -220,17 +222,21 @@ public class ChartResultServiceImpl implements ChartResultService {
|
||||
@Override
|
||||
public List<ChartStatistical> countAssessNumByFlowProcess(AssessDetailReq req) {
|
||||
List<ChartStatistical> process = resultRecordMapper.countAssessNumByFlowProcess(req);
|
||||
List<ChartStatistical> data = buildProcess(process, req.getStartId());
|
||||
//获取自己管理的部门
|
||||
//List<String> mandepartmentIds = assessService.roleDepartments(req.getLoginUserId());
|
||||
List<String> mandepartmentIds = Collections.EMPTY_LIST;
|
||||
List<ChartStatistical> data = buildProcess(process, req.getStartId(),mandepartmentIds);
|
||||
return data;
|
||||
}
|
||||
|
||||
//构建流程默认人数
|
||||
private List<ChartStatistical> buildProcess(List<ChartStatistical> process,Long startId){
|
||||
private List<ChartStatistical> buildProcess(List<ChartStatistical> process,Long startId,List<String> mandepartmentIds){
|
||||
List<ChartStatistical> data = new ArrayList<>();
|
||||
Map map = Maps.newHashMap();
|
||||
int count = resultRecordService.count(new QueryWrapper<ResultRecord>()
|
||||
.eq("is_delete", 0)
|
||||
.eq("start_id", startId));
|
||||
.eq("start_id", startId)
|
||||
.in("department_id",mandepartmentIds));
|
||||
|
||||
ChartStatistical all = new ChartStatistical();
|
||||
all.setDesc("参与人数");
|
||||
|
||||
@ -459,6 +459,13 @@
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="req.departmentIds !=null and req.departmentIds.size()!=0">
|
||||
and r.department_id in (
|
||||
<foreach collection="req.departmentIds" item="department_id" separator=",">
|
||||
#{department_id}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="countAssessNumByFlowProcess" resultType="com.lz.modules.performance.res.ChartStatistical">
|
||||
@ -485,9 +492,9 @@
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="departmentIds !=null and departmentIds.size()!=0">
|
||||
<if test="req.departmentIds !=null and req.departmentIds.size()!=0">
|
||||
and department_id in (
|
||||
<foreach collection="departmentIds" item="department_id" separator=",">
|
||||
<foreach collection="req.departmentIds" item="department_id" separator=",">
|
||||
#{department_id}
|
||||
</foreach>
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user