This commit is contained in:
杜建超 2020-10-16 16:35:19 +08:00
parent c62df55daf
commit 2a6d4444df
8 changed files with 31 additions and 19 deletions

View File

@ -36,10 +36,8 @@ public class ChartController extends AbstractController{
@ApiOperation("获取绩效报表统计")
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = ChartStatisticalRes.class)})
public R chartResult(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true) ChartResultReq req){
List<ChartStatisticalRes> data = new ArrayList<>();
chartResultService.chartReport(req);
return R.ok();
List<ChartStatisticalRes> chartStatisticalRes = chartResultService.chartReport(req);
return R.ok().put("data",chartStatisticalRes);
}

View File

@ -14,7 +14,7 @@ import java.util.List;
@Data
@ApiModel(value = "绩效报表统计实体")
public class ChartStatisticalRes {
@ApiModelProperty(value = "类型 0节点统计 1人数统计 2等级统计",name = "type")
@ApiModelProperty(value = "类型 0节点统计 1等级统计 2:人数统计 ",name = "type")
private int type;
private List<ChartStatistical> data;

View File

@ -14,7 +14,7 @@ import java.util.List;
*/
public interface ChartResultService {
void chartReport(ChartResultReq req);
List<ChartStatisticalRes> chartReport(ChartResultReq req);
List<ChartStatistical> countDepartmentAndStaffNum(List<String>staffIds);

View File

@ -37,14 +37,25 @@ public class ChartResultServiceImpl implements ChartResultService {
private EvaluationGroupService evaluationGroupService;
@Override
public void chartReport(ChartResultReq req) {
public List<ChartStatisticalRes> chartReport(ChartResultReq req) {
List<ChartStatisticalRes> data = new ArrayList<>();
AssessListReq query = new AssessListReq();
ChartStatisticalRes res = null;
BeanUtils.copyProperties(req,query);
List<ChartStatisticalRes> chartStatisticalRes = resultRecordService.countNumByFlowProcess(query);
List<ChartStatisticalRes> chartStatisticalRes1 = resultRecordService.countNumByScoreLevel(query);
List<ChartStatistical> process = resultRecordService.countNumByFlowProcess(query);
res = new ChartStatisticalRes();
res.setType(0);
res.setData(process);
List<ChartStatistical> scoreLevel = resultRecordService.countNumByScoreLevel(query);
res = new ChartStatisticalRes();
res.setType(1);
res.setData(scoreLevel);
List<String> strings = evaluationGroupService.selectAllStaffIdsByGroupId(1L);
List<ChartStatistical> chartStatisticals = this.countDepartmentAndStaffNum(strings);
List<ChartStatistical> depstaff = this.countDepartmentAndStaffNum(strings);
res = new ChartStatisticalRes();
res.setType(2);
res.setData(depstaff);
return data;
}

View File

@ -17,6 +17,7 @@ import com.lz.modules.app.req.ResultRecordReq;
import com.lz.modules.app.resp.OwnResultResp;
import com.lz.modules.flow.model.ResultRecordDto;
import com.lz.modules.performance.req.AssessListReq;
import com.lz.modules.performance.res.ChartStatistical;
import com.lz.modules.performance.res.ChartStatisticalRes;
import com.lz.modules.sys.entity.app.ResultRecord;
import org.apache.ibatis.annotations.Mapper;
@ -72,8 +73,8 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
List<ResultRecord> selectResultRecordAllByStaffId(@Param("staffId") Long staffId);
List<ChartStatisticalRes> countNumByFlowProcess(@Param("req") AssessListReq req);
List<ChartStatistical> countNumByFlowProcess(@Param("req") AssessListReq req);
List<ChartStatisticalRes> countNumByScoreLevel(@Param("req") AssessListReq req);
List<ChartStatistical> countNumByScoreLevel(@Param("req") AssessListReq req);
}

View File

@ -15,6 +15,7 @@ import com.lz.modules.app.utils.t.TwoTuple;
import com.lz.modules.flow.entity.Flow;
import com.lz.modules.flow.model.StaffRoleDto;
import com.lz.modules.performance.req.AssessListReq;
import com.lz.modules.performance.res.ChartStatistical;
import com.lz.modules.performance.res.ChartStatisticalRes;
import com.lz.modules.sys.entity.SysUserEntity;
import com.lz.modules.sys.entity.app.ResultRecord;
@ -103,7 +104,7 @@ public interface ResultRecordService extends IService<ResultRecord> {
List<ResultRecord> selectResultRecordAllByStaffId(Long staffId);
List<ChartStatisticalRes> countNumByFlowProcess(AssessListReq req);
List<ChartStatistical> countNumByFlowProcess(AssessListReq req);
List<ChartStatisticalRes> countNumByScoreLevel(AssessListReq req);
List<ChartStatistical> countNumByScoreLevel(AssessListReq req);
}

View File

@ -28,6 +28,7 @@ import com.lz.modules.flow.model.TypeRoleDto;
import com.lz.modules.flow.service.*;
import com.lz.modules.job.business.DingtalkBusiness;
import com.lz.modules.performance.req.AssessListReq;
import com.lz.modules.performance.res.ChartStatistical;
import com.lz.modules.performance.res.ChartStatisticalRes;
import com.lz.modules.sys.dao.app.ResultRecordMapper;
import com.lz.modules.sys.entity.SysUserEntity;
@ -733,12 +734,12 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
}
@Override
public List<ChartStatisticalRes> countNumByFlowProcess(AssessListReq req) {
public List<ChartStatistical> countNumByFlowProcess(AssessListReq req) {
return resultRecordMapper.countNumByFlowProcess(req);
}
@Override
public List<ChartStatisticalRes> countNumByScoreLevel(AssessListReq req) {
public List<ChartStatistical> countNumByScoreLevel(AssessListReq req) {
return resultRecordMapper.countNumByScoreLevel(req);
}
}

View File

@ -338,10 +338,10 @@
select * from lz_result_record where staff_id = #{staffId}
</select>
<select id="countNumByFlowProcess" resultType="com.lz.modules.performance.res.ChartStatisticalRes">
<select id="countNumByFlowProcess" resultType="com.lz.modules.performance.res.ChartStatistical">
SELECT count(flow_process) num,flow_process type from lz_result_record where is_delete=0 GROUP BY flow_process
</select>
<select id="countNumByScoreLevel" resultType="com.lz.modules.performance.res.ChartStatisticalRes">
<select id="countNumByScoreLevel" resultType="com.lz.modules.performance.res.ChartStatistical">
</select>