提交修改
This commit is contained in:
commit
d0c9169033
@ -45,7 +45,7 @@ public interface EvaluationGroupMapper extends BaseMapper<EvaluationGroup> {
|
||||
|
||||
void deleteByCopyIds(@Param("ids") List<Long> ids);
|
||||
|
||||
List<Long> selectIdsByCopyIds(@Param("copyIds")String copyIds);
|
||||
List<Long> selectIdsByCopyIds(@Param("copyIds")String copyIds,@Param("startId")Long startId);
|
||||
|
||||
EvaluationGroup selectEvaluationGroupByCopyId(@Param("copyId")Long copyId,@Param("startId")Long startId);
|
||||
|
||||
|
||||
@ -54,4 +54,7 @@ public interface EvaluationGroupService extends IService<EvaluationGroup> {
|
||||
void deleteByCopyIds(List<Long> ids);
|
||||
|
||||
R checkStaff(CheckStaffReq checkStaffReq);
|
||||
|
||||
String getEvaluationCopyIdsByEvaluationIds(String evaluationIds,Long startId);
|
||||
|
||||
}
|
||||
@ -349,4 +349,17 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getEvaluationCopyIdsByEvaluationIds(String evaluationIds,Long startId) {
|
||||
if(StringUtil.isBlank(evaluationIds)){
|
||||
return StringUtil.EMPTY;
|
||||
}
|
||||
List<Long> ids = evaluationGroupMapper.selectIdsByCopyIds(evaluationIds,startId);
|
||||
if(CollectionUtils.isEmpty(ids)){
|
||||
return StringUtil.EMPTY;
|
||||
}
|
||||
return StringUtils.join(ids,",");
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,6 +15,7 @@ import com.lz.modules.performance.res.ChartStatistical;
|
||||
import com.lz.modules.performance.res.ChartStatisticalRes;
|
||||
import com.lz.modules.performance.service.AssessManagerService;
|
||||
import com.lz.modules.performance.service.ChartResultService;
|
||||
import com.lz.modules.sys.controller.AbstractController;
|
||||
import com.lz.modules.sys.dao.app.ResultRecordMapper;
|
||||
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||
import io.swagger.annotations.*;
|
||||
@ -33,7 +34,7 @@ import java.util.List;
|
||||
@RequestMapping("/performance")
|
||||
@Slf4j
|
||||
@Api(value="考核管理接口", tags={"考核管理"})
|
||||
public class AssessManagerController {
|
||||
public class AssessManagerController extends AbstractController{
|
||||
|
||||
@Autowired
|
||||
private FlowStartMapper flowStartMapper;
|
||||
@ -49,8 +50,14 @@ public class AssessManagerController {
|
||||
@ApiOperation("获取考核列表")
|
||||
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = AssessManagerListRes.class)})
|
||||
public R assessList(@RequestBody AssessListReq req){
|
||||
PageUtils pageUtils = assessManagerService.assessList(req);
|
||||
return R.ok().put("data",pageUtils);
|
||||
try {
|
||||
Long userId = getUserId();
|
||||
req.setLoginUserId(userId);
|
||||
PageUtils pageUtils = assessManagerService.assessList(req);
|
||||
return R.ok().put("data",pageUtils);
|
||||
} catch (Exception e) {
|
||||
return R.error();
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("assess/manager/detail")
|
||||
@ -62,6 +69,8 @@ public class AssessManagerController {
|
||||
}
|
||||
PageUtils pageUtils = null;
|
||||
try {
|
||||
Long userId = getUserId();
|
||||
req.setLoginUserId(userId);
|
||||
pageUtils = assessManagerService.assessDetail(req);
|
||||
} catch (Exception e) {
|
||||
log.error("获取考核详情列表异常" ,e);
|
||||
@ -82,6 +91,8 @@ public class AssessManagerController {
|
||||
}
|
||||
List<ChartStatistical> process = null;
|
||||
try {
|
||||
Long userId = getUserId();
|
||||
req.setLoginUserId(userId);
|
||||
process = chartResultService.countAssessNumByFlowProcess(req);
|
||||
} catch (Exception e) {
|
||||
log.error("获取详情顶部人数统计异常" ,e);
|
||||
|
||||
@ -79,6 +79,8 @@ public class ChartController extends AbstractController{
|
||||
public R chartDetailList(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true) ChartResultReq req){
|
||||
PageUtils pageUtils = null;
|
||||
try {
|
||||
Long userId = getUserId();
|
||||
req.setLoginUserId(userId);
|
||||
pageUtils = chartResultService.selectChartDetailList(req);
|
||||
} catch (Exception e) {
|
||||
log.error("获取报表等级详情异常" ,e);
|
||||
|
||||
@ -134,8 +134,7 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
||||
public PageUtils assessDetail(AssessDetailReq req) {
|
||||
//拼接拷贝组
|
||||
if(StringUtil.isNotBlank(req.getEvaluationIds())){
|
||||
List<Long> evaluationIds = evaluationGroupMapper.selectIdsByCopyIds(req.getEvaluationIds());
|
||||
req.setCopyEvaluationIds(StringUtils.join(evaluationIds,","));
|
||||
req.setCopyEvaluationIds(evaluationGroupService.getEvaluationCopyIdsByEvaluationIds(req.getEvaluationIds(),req.getStartId()));
|
||||
}
|
||||
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(),req.getPageSize()).doSelect(
|
||||
page -> resultRecordMapper.selectAssessListByStartId(page,req)
|
||||
|
||||
@ -12,6 +12,7 @@ import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
||||
import com.lz.modules.app.service.DepartmentsService;
|
||||
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
||||
import com.lz.modules.app.service.StaffService;
|
||||
import com.lz.modules.flow.dao.EvaluationGroupMapper;
|
||||
import com.lz.modules.flow.dao.FlowChartMapper;
|
||||
import com.lz.modules.flow.dao.FlowStartMapper;
|
||||
import com.lz.modules.flow.entity.FlowChart;
|
||||
@ -67,6 +68,8 @@ public class ChartResultServiceImpl implements ChartResultService {
|
||||
private FlowChartService flowChartService;
|
||||
@Autowired
|
||||
private AssessService assessService;
|
||||
@Autowired
|
||||
private EvaluationGroupMapper evaluationGroupMapper;
|
||||
|
||||
private static final Long processId = 1L;
|
||||
|
||||
@ -97,7 +100,7 @@ public class ChartResultServiceImpl implements ChartResultService {
|
||||
|
||||
res = new ChartStatisticalRes();
|
||||
res.setType(0);
|
||||
res.setStatisticals(buildProcess(process,startId,mandepartmentIds));
|
||||
res.setStatisticals(buildProcess(process,startId,mandepartmentIds,null));
|
||||
res.setDefaultTime(defaultTime);
|
||||
if(StringUtil.isNotBlank(defaultTime)){
|
||||
res.setDefaultId(startId);
|
||||
@ -222,22 +225,29 @@ public class ChartResultServiceImpl implements ChartResultService {
|
||||
|
||||
@Override
|
||||
public List<ChartStatistical> countAssessNumByFlowProcess(AssessDetailReq req) {
|
||||
List<ChartStatistical> process = resultRecordMapper.countAssessNumByFlowProcess(req);
|
||||
req.setCopyEvaluationIds(evaluationGroupService.getEvaluationCopyIdsByEvaluationIds(req.getEvaluationIds(),req.getStartId()));
|
||||
//获取自己管理的部门
|
||||
List<String> mandepartmentIds = assessService.roleDepartments(req.getLoginUserId());
|
||||
List<ChartStatistical> data = buildProcess(process, req.getStartId(),mandepartmentIds);
|
||||
req.setDepartmentIds(mandepartmentIds);
|
||||
List<ChartStatistical> process = resultRecordMapper.countAssessNumByFlowProcess(req);
|
||||
List<ChartStatistical> data = buildProcess(process, req.getStartId(),mandepartmentIds,req);
|
||||
return data;
|
||||
}
|
||||
|
||||
//构建流程默认人数
|
||||
private List<ChartStatistical> buildProcess(List<ChartStatistical> process,Long startId,List<String> mandepartmentIds){
|
||||
private List<ChartStatistical> buildProcess(List<ChartStatistical> process,Long startId,List<String> mandepartmentIds,AssessDetailReq req){
|
||||
List<ChartStatistical> data = Lists.newArrayList();
|
||||
Map map = Maps.newHashMap();
|
||||
int count = resultRecordService.count(new QueryWrapper<ResultRecord>()
|
||||
.eq("is_delete", 0)
|
||||
.eq("start_id", startId)
|
||||
.in(CollectionUtils.isNotEmpty(mandepartmentIds),"department_id",mandepartmentIds));
|
||||
|
||||
int count;
|
||||
if(req == null){
|
||||
count = resultRecordService.count(new QueryWrapper<ResultRecord>()
|
||||
.eq("is_delete", 0)
|
||||
.eq("start_id", startId)
|
||||
.in(CollectionUtils.isNotEmpty(mandepartmentIds),"department_id",mandepartmentIds));
|
||||
}
|
||||
else {
|
||||
count = resultRecordMapper.countAssessNumJoin(req);
|
||||
}
|
||||
ChartStatistical all = new ChartStatistical();
|
||||
all.setDesc("参与人数");
|
||||
all.setNum(count);
|
||||
|
||||
@ -94,4 +94,6 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
|
||||
int batchDeleteByStartIdAndStaffId(@Param("startId")Long startId,@Param("staffIds") List<String> staffIds);
|
||||
|
||||
List<ToScoreDingTalkDto> selectToScoreList(@Param("startId")Long startId, @Param("evaluationId")Long evaluationId);
|
||||
|
||||
int countAssessNumJoin(@Param("req")AssessDetailReq req);
|
||||
}
|
||||
@ -476,37 +476,75 @@
|
||||
</select>
|
||||
|
||||
<select id="countAssessNumByFlowProcess" resultType="com.lz.modules.performance.res.ChartStatistical">
|
||||
SELECT count(flow_process) num,flow_process as 'desc' from lz_result_record
|
||||
where is_delete=0
|
||||
and start_id =#{req.startId}
|
||||
<if test="req.evaluationIds !=null and req.evaluationIds !=''">
|
||||
and evaluation_id in(
|
||||
<foreach collection="req.evaluationIds.split(',')" item="evaluation_id" open="(" separator="," close=")">
|
||||
SELECT count(flow_process) num,flow_process as 'desc' from lz_result_record r
|
||||
LEFT JOIN lz_evaluation_start_staff s
|
||||
ON r.start_id = s.start_id and r.staff_id = s.staff_id
|
||||
where r.is_delete = 0 and s.is_delete = 0
|
||||
and r.start_id =#{req.startId}
|
||||
<if test="req.copyEvaluationIds !=null and req.copyEvaluationIds !=''">
|
||||
and r.evaluation_id in(
|
||||
<foreach collection="req.copyEvaluationIds.split(',')" item="evaluation_id" open="(" separator="," close=")">
|
||||
#{evaluation_id}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="req.flowProcess !=null">
|
||||
and flow_process = #{req.flowProcess}
|
||||
and r.flow_process = #{req.flowProcess}
|
||||
</if>
|
||||
<if test="req.staffName !=null and req.staffName!=''">
|
||||
and staff_name LIKE CONCAT('%',#{req.staffName},'%')
|
||||
and r.staff_name LIKE CONCAT('%',#{req.staffName},'%')
|
||||
</if>
|
||||
<if test="req.staffIds !=null and req.staffIds !=''">
|
||||
and staff_id in(
|
||||
and r.staff_id in(
|
||||
<foreach collection="req.staffIds.split(',')" item="staff_id" open="(" separator="," close=")">
|
||||
#{staff_id}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="req.departmentIds !=null and req.departmentIds.size()!=0">
|
||||
and department_id in (
|
||||
and r.department_id in (
|
||||
<foreach collection="req.departmentIds" item="department_id" separator=",">
|
||||
#{department_id}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
GROUP BY r.flow_process
|
||||
</select>
|
||||
|
||||
|
||||
<select id="countAssessNumJoin" resultType="int">
|
||||
SELECT count(1) num from lz_result_record r
|
||||
LEFT JOIN lz_evaluation_start_staff s
|
||||
ON r.start_id = s.start_id and r.staff_id = s.staff_id
|
||||
where r.is_delete = 0 and s.is_delete = 0
|
||||
and r.start_id =#{req.startId}
|
||||
<if test="req.copyEvaluationIds !=null and req.copyEvaluationIds !=''">
|
||||
and r.evaluation_id in(
|
||||
<foreach collection="req.copyEvaluationIds.split(',')" item="evaluation_id" open="(" separator="," close=")">
|
||||
#{evaluation_id}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="req.flowProcess !=null">
|
||||
and r.flow_process = #{req.flowProcess}
|
||||
</if>
|
||||
<if test="req.staffName !=null and req.staffName!=''">
|
||||
and r.staff_name LIKE CONCAT('%',#{req.staffName},'%')
|
||||
</if>
|
||||
<if test="req.staffIds !=null and req.staffIds !=''">
|
||||
and r.staff_id in(
|
||||
<foreach collection="req.staffIds.split(',')" item="staff_id" open="(" separator="," close=")">
|
||||
#{staff_id}
|
||||
</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>
|
||||
GROUP BY flow_process
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
@ -155,6 +155,7 @@
|
||||
#{copy_id}
|
||||
</foreach>
|
||||
)
|
||||
and start_id = #{startId}
|
||||
</select>
|
||||
|
||||
<select id="selectEvaluationGroupByCopyId" resultType="EvaluationGroup" >
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user