diff --git a/src/main/java/com/lz/modules/performance/controller/AssessManagerController.java b/src/main/java/com/lz/modules/performance/controller/AssessManagerController.java index 929a95c8..35028f44 100644 --- a/src/main/java/com/lz/modules/performance/controller/AssessManagerController.java +++ b/src/main/java/com/lz/modules/performance/controller/AssessManagerController.java @@ -43,6 +43,7 @@ public class AssessManagerController { } @PostMapping("assess/manager/detail") + @ApiOperation("获取考核详情列表") @ApiResponses({@ApiResponse(code = 200,message = "成功",response = AssessManagerDetailRes.class)}) public R assessDetail(@RequestBody AssessDetailReq req){ PageUtils pageUtils = assessManagerService.assessDetail(req); diff --git a/src/main/java/com/lz/modules/performance/controller/FlowChartController.java b/src/main/java/com/lz/modules/performance/controller/FlowChartController.java index 2fc31be5..88d7e406 100644 --- a/src/main/java/com/lz/modules/performance/controller/FlowChartController.java +++ b/src/main/java/com/lz/modules/performance/controller/FlowChartController.java @@ -67,7 +67,7 @@ public class FlowChartController { for (FlowChartDetailRecord record:flowChartDetailRecords ) { - flowChartDetailRecordListDto.setStatus(dto.getStatus()); + flowChartDetailRecordListDto.setStatus(record.getStatus()); FlowChartDetailRecordSimpleDto detailRecordSimpleDto = new FlowChartDetailRecordSimpleDto(); BeanUtils.copyProperties(record, detailRecordSimpleDto); @@ -150,12 +150,14 @@ public class FlowChartController { flowChartDetailRecord.setChartId(flowChartDetailRecordListReq.getId()); flowChartDetailRecord.setEvaluationGroupId(flowChartDetailRecordListReq.getEvaluationGroupId()); flowChartDetailRecord.setStepIndex(index); + flowChartDetailRecord.setStatus(flowChartDetailRecordListReq.getStatus()); if(flowChartDetailRecord.getId() != null && flowChartDetailRecord.getId().intValue() > 0){ updaes.add(flowChartDetailRecord); }else{ inserts.add(flowChartDetailRecord); } if(flowChartDetailRecord.getIsDelete() == null || flowChartDetailRecord.getIsDelete().intValue() == 0){ + //本节点没有删除,那么顺序++ index++; } diff --git a/src/main/java/com/lz/modules/performance/controller/FlowStartController.java b/src/main/java/com/lz/modules/performance/controller/FlowStartController.java index 9d08eac4..59ea40bb 100644 --- a/src/main/java/com/lz/modules/performance/controller/FlowStartController.java +++ b/src/main/java/com/lz/modules/performance/controller/FlowStartController.java @@ -125,13 +125,15 @@ public class FlowStartController { if(flowStart1 == null){ flowStartService.insertFlowStart(flowStart); }else{ - flowStart = flowStart1; + + flowStart.setId(flowStart1.getId()); } Map chartNameMaps = new HashedMap();//流程节点与流程名称对应map,下面多次循环,减少数据库查找 Map> staffManages = new HashedMap();//部门(id+几级)和部门几级管理对应关系,减少数据库查找 //下面开始初始化流程 + String[] gids = flowStart.getGroupIds().split(","); List ids = Arrays.stream(flowStart.getGroupIds().split(",")).map(new Function() { @Override public Long apply(String s) { @@ -191,14 +193,6 @@ public class FlowStartController { return R.error(evaluationGroup.getName() + "——没有设置绩效管理人员"); } - for (ResultModelDto dto:resultModelDtos - ) { - - - List libDtos = resultTagetLibService.selectResultTagetLibDtoByModelId(dto.getId()); - dto.setTagetLibs(libDtos); - } - //下面拷贝一份考评组信息发起后所使用的考评组id为复制后的id evaluationGroup.setCopyId(evaluationGroup.getId()); evaluationGroup.setId(null); @@ -206,6 +200,40 @@ public class FlowStartController { evaluationGroup.setGmtModified(null); evaluationGroupService.insertEvaluationGroup(evaluationGroup); + //拷贝考评组的指标信息 + List resultTagetLibs = new ArrayList<>(); + + for (ResultModelDto dto:resultModelDtos + ) { + + + dto.setEvaluationGroupId(evaluationGroup.getId());//设置拷贝组的id + //下面拷贝一份考评组信息的维度信息 + ResultModel resultModel = new ResultModel(); + BeanUtils.copyProperties(dto, resultModel); + resultModel.setId(null); + resultModelService.insertResultModel(resultModel); + + List libDtos = resultTagetLibService.selectResultTagetLibDtoByModelId(dto.getId()); + dto.setTagetLibs(libDtos); + for (ResultTagetLibDto libDto: libDtos + ) { + //下面拷贝考评组里面的指标信息 + ResultTagetLib resultTagetLib = new ResultTagetLib(); + BeanUtils.copyProperties(libDto, resultTagetLib); + resultTagetLib.setModelId(resultModel.getId());//设置新的维度id + resultTagetLib.setId(null); + resultTagetLibs.add(resultTagetLib); + } + } + if(resultTagetLibs.size() > 0){ + //插入备份的考评组指标信息 + resultTagetLibService.insertResultTagetLibs(resultTagetLibs); + } + + + + //下面初始化lz_flow流程表 lz_flow_approval_role流程审批表 List flowApprovalRoles = new ArrayList<>(); int stepIndex = 0; @@ -224,7 +252,7 @@ public class FlowStartController { chartNameMaps.put(flowChart.getId(), flowChart.getName()); optName = flowChart.getName(); } - flow.setOpt(optName); + flow.setOptDesc(optName); flowService.insertFlow(flow); if(flowChartDetailRecord.getOptType().intValue() == ChartOptType.APPOINT.getCode()){//指定人员的 @@ -238,13 +266,13 @@ public class FlowStartController { flowApprovalRole.setFlowId(flow.getId()); flowApprovalRole.setApprovalId(Long.parseLong(id)); flowApprovalRole.setStepType(flowChartDetailRecord.getStepType()); - flowApprovalRole.setRoleId(Long.parseLong(roleId)); + flowApprovalRole.setRoleId(roleId); flowApprovalRole.setType(flowChartDetailRecord.getOptType()); flowApprovalRoles.add(flowApprovalRole); flowApprovalRole.setStepIndex(stepIndex); } - stepIndex++; } + stepIndex++; }else{ String[] roleIds = flowChartDetailRecord.getRoleIds().split(","); for (String roleId:roleIds @@ -252,7 +280,7 @@ public class FlowStartController { FlowApprovalRole flowApprovalRole = new FlowApprovalRole(); flowApprovalRole.setFlowId(flow.getId()); flowApprovalRole.setStepType(flowChartDetailRecord.getStepType()); - flowApprovalRole.setRoleId(Long.parseLong(roleId)); + flowApprovalRole.setRoleId(roleId); flowApprovalRole.setType(flowChartDetailRecord.getOptType()); flowApprovalRoles.add(flowApprovalRole); flowApprovalRole.setStepIndex(stepIndex); @@ -269,8 +297,7 @@ public class FlowStartController { //初始化lz_result_details数据 List resultDetails = new ArrayList<>(); - //拷贝考评组的指标信息 - List resultTagetLibs = new ArrayList<>(); + List evaluationStartStaffs = new ArrayList<>(); @@ -281,7 +308,7 @@ public class FlowStartController { evaluationStartStaff.setEvaluationId(evaluationGroup.getId()); evaluationStartStaff.setEvaluationName(evaluationGroup.getName()); evaluationStartStaff.setStaffId(entity.getId()); - evaluationStartStaff.setStaffId(flowStart.getId()); + evaluationStartStaff.setStartId(flowStart.getId()); evaluationStartStaff.setType(CheckStaffType.MANAGER.getCode()); evaluationStartStaffs.add(evaluationStartStaff); @@ -295,7 +322,7 @@ public class FlowStartController { evaluationStartStaff.setEvaluationId(evaluationGroup.getId()); evaluationStartStaff.setEvaluationName(evaluationGroup.getName()); evaluationStartStaff.setStaffId(staffInfo.getId()); - evaluationStartStaff.setStaffId(flowStart.getId()); + evaluationStartStaff.setStartId(flowStart.getId()); evaluationStartStaff.setType(CheckStaffType.STAFF.getCode()); evaluationStartStaffs.add(evaluationStartStaff); @@ -395,22 +422,12 @@ public class FlowStartController { //下面生成ResultDetail对象 for (ResultModelDto modelDto:resultModelDtos ) { - ////下面拷贝一份考评组信息的维度信息 - ResultModel resultModel = new ResultModel(); - BeanUtils.copyProperties(modelDto, resultModel); - modelDto.setEvaluationGroupId(evaluationGroup.getId());//设置拷贝组的id - resultModel.setId(null); - resultModelService.insertResultModel(resultModel); + if(modelDto.getTagetLibs() != null && modelDto.getTagetLibs().size() > 0){//模板里面有添加指标 for (ResultTagetLibDto libDto: modelDto.getTagetLibs()) { - //下面拷贝考评组里面的指标信息 - ResultTagetLib resultTagetLib = new ResultTagetLib(); - BeanUtils.copyProperties(libDto, resultTagetLib); - resultTagetLib.setModelId(resultModel.getId());//设置新的维度id - resultTagetLib.setId(null); - resultTagetLibs.add(resultTagetLib); + ResultDetail resultDetail = new ResultDetail(); resultDetail.setRecordId(resultRecord.getId()); @@ -429,8 +446,7 @@ public class FlowStartController { if(resultDetails.size() > 0){ // resultDetailService.insertResultDetails(resultDetails); - //插入备份的考评组指标信息 - resultTagetLibService.insertResultTagetLibs(resultTagetLibs); + } diff --git a/src/main/java/com/lz/modules/performance/req/AssessDetailReq.java b/src/main/java/com/lz/modules/performance/req/AssessDetailReq.java index 054977b0..3653ec1b 100644 --- a/src/main/java/com/lz/modules/performance/req/AssessDetailReq.java +++ b/src/main/java/com/lz/modules/performance/req/AssessDetailReq.java @@ -1,6 +1,7 @@ package com.lz.modules.performance.req; import com.lz.modules.equipment.entity.model.BasePage; +import io.swagger.models.auth.In; import lombok.Data; import java.util.List; @@ -13,15 +14,9 @@ import java.util.List; @Data public class AssessDetailReq extends BasePage{ //考勤组id - private Long groupId; - - private String month; - - private String startTime; - - private String endTime; - //周期类型 - private int type; + private Long evaluationId; + //发起考核的id + private int startId; //员工名称 private String staffName; //部门ids数组 @@ -29,5 +24,5 @@ public class AssessDetailReq extends BasePage{ //人员id数组 private List staffIds; //状态 确认 执行 结果录入。。。 - private int status; + private Integer flowProcess; } diff --git a/src/main/java/com/lz/modules/sys/dao/app/ResultRecordMapper.java b/src/main/java/com/lz/modules/sys/dao/app/ResultRecordMapper.java index d83f3e3c..dd49703e 100644 --- a/src/main/java/com/lz/modules/sys/dao/app/ResultRecordMapper.java +++ b/src/main/java/com/lz/modules/sys/dao/app/ResultRecordMapper.java @@ -18,6 +18,7 @@ import com.lz.modules.app.resp.OwnResultResp; import com.lz.modules.flow.model.ResultRecordDto; import com.lz.modules.performance.req.AssessDetailReq; import com.lz.modules.performance.req.ChartResultReq; +import com.lz.modules.performance.res.AssessManagerDetailRes; import com.lz.modules.performance.res.ChartStatistical; import com.lz.modules.sys.entity.app.ResultRecord; import org.apache.ibatis.annotations.Mapper; @@ -85,5 +86,5 @@ public interface ResultRecordMapper extends BaseMapper { ResultRecord selectOneByStartId(@Param("startId")Long startId); - List selectAssessListByStartId(@Param("page") IPage page,@Param("startId")Long startId); + List selectAssessListByStartId(@Param("page") IPage page, @Param("startId")Long startId); } \ No newline at end of file diff --git a/src/main/resources/mapper/app/ResultRecordMapper.xml b/src/main/resources/mapper/app/ResultRecordMapper.xml index c66b9b39..50d4b090 100644 --- a/src/main/resources/mapper/app/ResultRecordMapper.xml +++ b/src/main/resources/mapper/app/ResultRecordMapper.xml @@ -388,6 +388,19 @@ 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 = #{startId} + + and r.evaluation_id = #{evaluationId} + + + and r.flow_process = #{flowProcess} + + + and staff_id in( + + #{staff_id} + + ) + diff --git a/src/main/resources/mapper/flow/FlowChartDetailRecordMapper.xml b/src/main/resources/mapper/flow/FlowChartDetailRecordMapper.xml index 499d9267..0206b2a5 100644 --- a/src/main/resources/mapper/flow/FlowChartDetailRecordMapper.xml +++ b/src/main/resources/mapper/flow/FlowChartDetailRecordMapper.xml @@ -110,7 +110,7 @@