This commit is contained in:
杜建超 2020-10-27 15:56:03 +08:00
parent 45ec4229bf
commit 4f3a52596f
11 changed files with 137 additions and 20 deletions

View File

@ -40,4 +40,7 @@ public interface EvaluationGroupMapper extends BaseMapper<EvaluationGroup> {
List<EvaluationGroup> selectEvaluationGroupByIds(@Param("ids") List<Long> ids);
EvaluationGroup selectEvaluationGroupByName(@Param("name") String name);
void deleteByIds(@Param("ids") List<Long> ids);
}

View File

@ -46,4 +46,6 @@ public interface EvaluationGroupService extends IService<EvaluationGroup> {
EvaluationGroup selectEvaluationGroupByName(String name);
//获取考核组里面所有参与的人员信息去除重复去除离职
List<StaffSimpleInfo> selectAllStaffSimpleInfoByGroupId(EvaluationGroup evaluationGroup);
void deleteByIds(List<Long> ids);
}

View File

@ -213,4 +213,10 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
return staffSimpleInfos;
}
@Override
public void deleteByIds(List<Long> ids) {
evaluationGroupMapper.deleteByIds(ids);
}
}

View File

@ -4,6 +4,7 @@ import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.modules.flow.dao.FlowStartMapper;
import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.performance.req.AssessChangeReq;
import com.lz.modules.performance.req.AssessListReq;
import com.lz.modules.performance.req.AssessDetailReq;
import com.lz.modules.performance.res.AssessManagerDetailRes;
@ -75,6 +76,29 @@ public class AssessManagerController {
}
@PostMapping("assess/manager/change")
@ApiOperation("考核管理组管理变更")
@ApiResponses({@ApiResponse(code = 200,message = "成功")})
public R assessChange(@RequestBody AssessChangeReq req){
if(req.getStartId()==null){
return R.error("考核id不能为空");
}
if(req.getChangeType()==null){
return R.error("变动类型无效");
}
FlowStart flowStart = flowStartMapper.selectFlowStartById(req.getStartId());
if(flowStart == null){
return R.error("暂无此考核组信息");
}
flowStart.getGroupIds();
assessManagerService.assessChange(req);
return R.ok();
}
@GetMapping("assess/manager/delete")
@ApiOperation("删除考核任务")

View File

@ -0,0 +1,26 @@
package com.lz.modules.performance.req;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @Author: djc
* @Desc:
* @Date: 2020/10/27 14:49
*/
@Data
@ApiModel("考核管理变动实体")
public class AssessChangeReq {
@ApiModelProperty(value = "考核id",name = "startId")
private Long startId;
@ApiModelProperty(value = "变更类型 0 :添加 1删除",name = "changeType")
private Integer changeType;
@ApiModelProperty(value = "变动人员ids",name = "staffIds")
private List<String> staffIds;
}

View File

@ -17,8 +17,8 @@ import java.util.List;
@ApiModel("获取考核详情实体")
public class AssessDetailReq extends BasePage{
//考勤组id
@ApiModelProperty(value = "考勤组ids",name = "evaluationIds")
private List<Long> evaluationIds;
@ApiModelProperty(value = "考勤组ids ,逗号隔开",name = "evaluationIds")
private String evaluationIds;
//发起考核的id
@ApiModelProperty(value = "发起考核的id",name = "startId")
private Long startId;
@ -26,8 +26,8 @@ public class AssessDetailReq extends BasePage{
@ApiModelProperty(value = "员工名称",name = "staffName")
private String staffName;
//人员id数组
@ApiModelProperty(value = "人员id数组",name = "staffIds")
private List<Long> staffIds;
@ApiModelProperty(value = "人员ids,逗号隔开",name = "staffIds")
private String staffIds;
//状态 确认 执行 结果录入
@ApiModelProperty(value = "状态 确认 执行 结果录入。。。",name = "flowProcess")
private Integer flowProcess;

View File

@ -2,6 +2,7 @@ package com.lz.modules.performance.service;
import com.lz.common.utils.PageUtils;
import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.performance.req.AssessChangeReq;
import com.lz.modules.performance.req.AssessDetailReq;
import com.lz.modules.performance.req.AssessListReq;
@ -18,4 +19,6 @@ public interface AssessManagerService {
PageUtils assessDetail(AssessDetailReq req);
void accessDelete(FlowStart flowStart);
void assessChange(AssessChangeReq req);
}

View File

@ -8,6 +8,7 @@ import com.lz.modules.flow.entity.EvaluationGroup;
import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.flow.service.EvaluationGroupService;
import com.lz.modules.flow.service.EvaluationStartStaffService;
import com.lz.modules.performance.req.AssessChangeReq;
import com.lz.modules.performance.req.AssessDetailReq;
import com.lz.modules.performance.req.AssessListReq;
import com.lz.modules.performance.res.AssessManagerDetailRes;
@ -21,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@ -83,7 +85,28 @@ public class AssessManagerServiceImpl implements AssessManagerService {
public void accessDelete(FlowStart flowStart) {
flowStart.setIsDelete(1);
flowStartMapper.updateFlowStartById(flowStart);
String groupIds = flowStart.getGroupIds();
if(StringUtil.isNotBlank(groupIds)){
String[] split = groupIds.split(",");
List<String> ids = Arrays.asList(split);
List<Long> collect = ids.stream().map(s -> Long.valueOf(s)).collect(Collectors.toList());
evaluationGroupService.deleteByIds(collect);
}
resultRecordMapper.batchDeleteByStartId(flowStart.getId());
return ;
}
@Override
public void assessChange(AssessChangeReq req) {
if(req.getChangeType() == 0){
}
if(req.getChangeType() == 1){
}
}
}

View File

@ -4,7 +4,9 @@ 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.StringUtil;
import com.lz.modules.app.entity.DepartmentsEntity;
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.FlowStartMapper;
@ -50,6 +52,8 @@ public class ChartResultServiceImpl implements ChartResultService {
private FlowStartService flowStartService;
@Autowired
private FlowStartMapper flowStartMapper;
@Autowired
private DepartmentsService departmentsService;
@Override
@ -78,11 +82,18 @@ public class ChartResultServiceImpl implements ChartResultService {
}
data.add(res);
List<String> strings = evaluationGroupService.selectAllStaffIdsByGroupId(3L);
List<ChartStatistical> depstaff = this.countDepartmentAndStaffNum(strings);
FlowStart flowStart = flowStartMapper.selectFlowStartById(startId);
String[] split = flowStart.getGroupIds().split(",");
Set<String> staffIds = new HashSet<>();
for(String s:split){
List<String> strings = evaluationGroupService.selectAllStaffIdsByGroupId(Long.valueOf(s));
staffIds.addAll(strings);
}
List<String> all = new ArrayList<>(staffIds);
List<ChartStatistical> depstaff = this.countDepartmentAndStaffNum(all);
res = new ChartStatisticalRes();
res.setType(2);
res.setStatisticals(depstaff);
res.setStatisticals(buildDepStaffs(depstaff));
res.setDefaultTime(defaultTime);
if(StringUtil.isNotBlank(defaultTime)){
res.setDefaultId(startId);
@ -191,4 +202,15 @@ public class ChartResultServiceImpl implements ChartResultService {
}
return data;
}
private List<ChartStatistical> buildDepStaffs(List<ChartStatistical> depStaffs){
depStaffs.stream().forEach(chartStatistical -> {
String desc = chartStatistical.getDesc();
DepartmentsEntity departmentsEntity = departmentsService.selectByDepartmentId(desc);
if(departmentsEntity!=null && StringUtil.isNotBlank(departmentsEntity.getDepartmentName())){
chartStatistical.setDesc(departmentsEntity.getDepartmentName());
}
});
return depStaffs;
}
}

View File

@ -388,9 +388,9 @@
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.evaluationIds !=null and req.evaluationIds.size()!=0">
<if test="req.evaluationIds !=null and req.evaluationIds.size()!=''">
and r.evaluation_id in(
<foreach collection="req.evaluationIds" item="evaluation_id" separator=",">
<foreach collection="req.evaluationIds.split(',')" item="evaluation_id" open="(" separator="," close=")">
#{evaluation_id}
</foreach>
)
@ -399,11 +399,11 @@
and r.flow_process = #{req.flowProcess}
</if>
<if test="req.staffName !=null and req.staffName!=''">
and r.staff_name = #{req.staffName}
and r.staff_name LIKE CONCAT('%',#{req.staffName},'%')
</if>
<if test="req.staffIds !=null and req.staffIds.size() !=0">
<if test="req.staffIds !=null and req.staffIds.size() !=''">
and r.staff_id in(
<foreach collection="req.staffIds" item="staff_id" separator=",">
<foreach collection="req.staffIds.split(',')" item="staff_id" open="(" separator="," close=")">
#{staff_id}
</foreach>
)
@ -414,22 +414,22 @@
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.size()!=0">
and evaluation_id in(
<foreach collection="req.evaluationIds" item="evaluation_id" separator=",">
<if test="req.evaluationIds !=null and req.evaluationIds.size()!=''">
and r.evaluation_id in(
<foreach collection="req.evaluationIds.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 = #{req.staffName}
and r.staff_name LIKE CONCAT('%',#{req.staffName},'%')
</if>
<if test="req.staffIds !=null and req.staffIds.size() !=0">
and staff_id in(
<foreach collection="req.staffIds" item="staff_id" separator=",">
<if test="req.staffIds !=null and req.staffIds.size() !=''">
and r.staff_id in(
<foreach collection="req.staffIds.split(',')" item="staff_id" open="(" separator="," close=")">
#{staff_id}
</foreach>
)

View File

@ -113,5 +113,13 @@
select * from lz_evaluation_group where name=#{name} and is_delete = 0 limit 1
</select>
<update id="deleteByIds">
update lz_evaluation_group set is_delete = 1 where is_delete=0
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
</mapper>