提交修改
This commit is contained in:
commit
ca52289161
@ -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);
|
||||
|
||||
@ -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++;
|
||||
}
|
||||
|
||||
|
||||
@ -125,13 +125,15 @@ public class FlowStartController {
|
||||
if(flowStart1 == null){
|
||||
flowStartService.insertFlowStart(flowStart);
|
||||
}else{
|
||||
flowStart = flowStart1;
|
||||
|
||||
flowStart.setId(flowStart1.getId());
|
||||
}
|
||||
|
||||
|
||||
Map<Long, String> chartNameMaps = new HashedMap();//流程节点与流程名称对应map,下面多次循环,减少数据库查找
|
||||
Map<String, List<StaffEntity>> staffManages = new HashedMap();//部门(id+几级)和部门几级管理对应关系,减少数据库查找
|
||||
//下面开始初始化流程
|
||||
String[] gids = flowStart.getGroupIds().split(",");
|
||||
List<Long> ids = Arrays.stream(flowStart.getGroupIds().split(",")).map(new Function<String, Long>() {
|
||||
@Override
|
||||
public Long apply(String s) {
|
||||
@ -191,14 +193,6 @@ public class FlowStartController {
|
||||
return R.error(evaluationGroup.getName() + "——没有设置绩效管理人员");
|
||||
}
|
||||
|
||||
for (ResultModelDto dto:resultModelDtos
|
||||
) {
|
||||
|
||||
|
||||
List<ResultTagetLibDto> 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<ResultTagetLib> 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<ResultTagetLibDto> 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<FlowApprovalRole> 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<ResultDetail> resultDetails = new ArrayList<>();
|
||||
//拷贝考评组的指标信息
|
||||
List<ResultTagetLib> resultTagetLibs = new ArrayList<>();
|
||||
|
||||
|
||||
List<EvaluationStartStaff> 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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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<Long> staffIds;
|
||||
//状态 确认 执行 结果录入。。。
|
||||
private int status;
|
||||
private Integer flowProcess;
|
||||
}
|
||||
|
||||
@ -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> {
|
||||
|
||||
ResultRecord selectOneByStartId(@Param("startId")Long startId);
|
||||
|
||||
List<ResultRecord> selectAssessListByStartId(@Param("page") IPage page,@Param("startId")Long startId);
|
||||
List<AssessManagerDetailRes> selectAssessListByStartId(@Param("page") IPage page, @Param("startId")Long startId);
|
||||
}
|
||||
@ -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}
|
||||
<if test="evaluationId !=null">
|
||||
and r.evaluation_id = #{evaluationId}
|
||||
</if>
|
||||
<if test="flowProcess !=null">
|
||||
and r.flow_process = #{flowProcess}
|
||||
</if>
|
||||
<if test="staffIds !=null and staffIds.size() !=0">
|
||||
and staff_id in(
|
||||
<foreach collection="staffIds" item="staff_id" separator=",">
|
||||
#{staff_id}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -110,7 +110,7 @@
|
||||
</update>
|
||||
|
||||
<select id="selectFlowChartDetailRecordByGroupIdAndChartId" resultType="FlowChartDetailRecord" >
|
||||
select * from lz_flow_chart_detail_record where evaluation_group_id=#{groupId} and chart_id = #{chartId} and is_delete = 0 order by step_index desc
|
||||
select * from lz_flow_chart_detail_record where evaluation_group_id=#{groupId} and chart_id = #{chartId} and is_delete = 0 order by step_index asc
|
||||
</select>
|
||||
|
||||
<select id="selectFlowChartDetailRecordByGroupId" resultType="FlowChartDetailRecord" >
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user