This commit is contained in:
杜建超 2020-10-29 15:22:58 +08:00
parent 8dd1c6591a
commit 5ab95765bc
7 changed files with 35 additions and 30 deletions

View File

@ -38,6 +38,4 @@ public interface EvaluationStartStaffService extends IService<EvaluationStartSta
EvaluationStartStaff selectManagerEvaluationStartStaff(Long evaluationId, Long userId);
int existByStartIdAndEvaluationId(Long startId,Long evaluationId);
}

View File

@ -99,8 +99,4 @@ public class EvaluationStartStaffServiceImpl extends ServiceImpl<EvaluationStart
return evaluationStartStaffMapper.selectManagerEvaluationStartStaff(evaluationId,userId);
}
@Override
public int existByStartIdAndEvaluationId(Long startId, Long evaluationId) {
return evaluationStartStaffMapper.existByStartIdAndEvaluationId(startId, evaluationId);
}
}

View File

@ -38,18 +38,7 @@ 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){
String defaultTime = StringUtil.EMPTY;
if(startId==null){
//取最近一条记录
FlowStart flowStart = flowStartMapper.selectRecentlyLimt();
if(flowStart!=null){
startId = flowStart.getId();
defaultTime = flowStart.getName();
}else {
return R.ok("暂无记录");
}
}
List<ChartStatisticalRes> chartStatisticalRes = chartResultService.chartReport(startId,defaultTime);
List<ChartStatisticalRes> chartStatisticalRes = chartResultService.chartReport(startId);
return R.ok().put("data",chartStatisticalRes);
}

View File

@ -20,6 +20,9 @@ public class ChartStatisticalRes {
@ApiModelProperty(value = "默认时间 ",name = "defaultTime")
private String defaultTime;
@ApiModelProperty(value = "0 月度 1自定义 ",name = "defaultCycleType")
private Integer defaultCycleType;
@ApiModelProperty(value = "默认考核id ",name = "defaultId")
private Long defaultId;

View File

@ -18,7 +18,7 @@ import java.util.List;
*/
public interface ChartResultService {
List<ChartStatisticalRes> chartReport(Long startId,String defaultTime);
List<ChartStatisticalRes> chartReport(Long startId);
List<ChartStatistical> countDepartmentAndStaffNum(List<String>staffIds);

View File

@ -158,24 +158,26 @@ public class AssessManagerServiceImpl implements AssessManagerService {
@Override
public void toScore(AssessToScoreReq req) {
String[] split = req.getEvaluationIds().split(",");
for(String s:split){
int i = evaluationStartStaffService.existByStartIdAndEvaluationId(req.getStartId(), Long.valueOf(s));
if(i<1){
//发起评分
List<String> strings = evaluationGroupService.selectAllStaffIdsByGroupId(Long.valueOf(s));
Arrays.asList(split);
evaluationStartStaffService.insertEvaluationStartStaffs();
}
}
/* evaluationStartStaffService.updateBatchById()
evaluationStartStaffService.saveBatch()*/
}
private List<EvaluationStartStaff> buildList(List<String> staffIds){
private List<EvaluationStartStaff> buildStartStaffList(List<String> staffIds){
List<EvaluationStartStaff> evaluationStartStaffs = new ArrayList<>();
staffIds.forEach(new Consumer<String>() {
@Override
public void accept(String s) {
EvaluationStartStaff startStaff = new EvaluationStartStaff();
startStaff.setStaffId(Long.valueOf(s));
}
});
return evaluationStartStaffs;

View File

@ -3,6 +3,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.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
import com.lz.modules.app.entity.DepartmentsEntity;
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
@ -62,7 +63,20 @@ public class ChartResultServiceImpl implements ChartResultService {
@Override
public List<ChartStatisticalRes> chartReport(Long startId,String defaultTime) {
public List<ChartStatisticalRes> chartReport(Long startId) {
String defaultTime = StringUtil.EMPTY;
Integer defaultCycleType = null;
if(startId==null){
//取最近一条记录
FlowStart flowStart = flowStartMapper.selectRecentlyLimt();
if(flowStart!=null){
startId = flowStart.getId();
defaultTime = flowStart.getName();
defaultCycleType = flowStart.getCycleType();
}else {
return new ArrayList<>();
}
}
List<ChartStatisticalRes> data = new ArrayList<>();
ChartStatisticalRes res;
@ -74,6 +88,7 @@ public class ChartResultServiceImpl implements ChartResultService {
res.setDefaultTime(defaultTime);
if(StringUtil.isNotBlank(defaultTime)){
res.setDefaultId(startId);
res.setDefaultCycleType(defaultCycleType);
}
data.add(res);
@ -84,6 +99,7 @@ public class ChartResultServiceImpl implements ChartResultService {
res.setDefaultTime(defaultTime);
if(StringUtil.isNotBlank(defaultTime)){
res.setDefaultId(startId);
res.setDefaultCycleType(defaultCycleType);
}
data.add(res);
@ -102,6 +118,7 @@ public class ChartResultServiceImpl implements ChartResultService {
res.setDefaultTime(defaultTime);
if(StringUtil.isNotBlank(defaultTime)){
res.setDefaultId(startId);
res.setDefaultCycleType(defaultCycleType);
}
data.add(res);
return data;