Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0

This commit is contained in:
wulin 2020-11-03 16:25:24 +08:00
commit 1aad5129ec
19 changed files with 175 additions and 41 deletions

View File

@ -254,6 +254,7 @@ public class ResultRecordController extends AbstractController {
list.add(resultDetailService.getWenHuaJiaZhiGuaResult2());
list.add(resultDetailService.getLastResult(resultRecord.getLastScore()));
List<ResultComment> comments = resultCommentService.selectByRecordId(resultRecord.getId());
if (CollectionUtils.isNotEmpty(comments)) {
ResultDetailResp header = new ResultDetailResp();
header.setCheckRange("领导");
@ -966,13 +967,10 @@ public class ResultRecordController extends AbstractController {
}
/**
* 删除
*/
// 审批http://localhost:8080/lz_management/user/lzresultrecord/new/approval?resultRecordId=267&status=1&comment=xxx&menuName=bbb
// 审批http://localhost:8080/lz_management/user/lzresultrecord/new/approval?resultRecordId=215&status=1&comment=xxx&menuName=bbb
// 跳过http://localhost:8080/lz_management/user/lzresultrecord/new/approval?resultRecordId=215&status=4&menuName=bbb&flowRecordId=360
// 转交http://localhost:8080/lz_management/user/lzresultrecord/new/approval?resultRecordId=215&status=8&menuName=bbb&flowRecordId=360&transferStaffId=294
@RequestMapping("/new/approval")
@ -990,7 +988,7 @@ public class ResultRecordController extends AbstractController {
/**
* 删除
*/
// http://localhost:8080/lz_management/user/lzresultrecord/new/resultRecordDetail?resultRecordId=322&loginUserId=313
// http://localhost:8080/lz_management/user/lzresultrecord/new/resultRecordDetail?resultRecordId=331&loginUserId=825
@RequestMapping("/new/resultRecordDetail")
public R newResultRecordList(RecordDetailDto recordDetailDto) {
if(recordDetailDto.getLoginUserId() ==null && getUser() !=null ){

View File

@ -8,5 +8,6 @@ public class FlowDetailResp {
private String staffName;
private Long flowRecordId;
private String departName;
private String avatar;
}

View File

@ -68,6 +68,9 @@ public class FlowRecord implements java.io.Serializable {
//flow_manager表中id
@ApiModelProperty(value = "flow_manager表中id", name = "processId")
private Long processId;
//当前是目标确认还是评分0目标制定1目标确认2执行中3结果值录入4评分5考核结束
@ApiModelProperty(value = "当前是目标确认还是评分0目标制定1目标确认2执行中3结果值录入4评分5考核结束", name = "flowProcess")
private Integer flowProcess;
/**
*
* @return
@ -323,6 +326,21 @@ public class FlowRecord implements java.io.Serializable {
this.processId = processId;
}
/**
* 当前是目标确认还是评分0目标制定1目标确认2执行中3结果值录入4评分5考核结束
* @return
*/
public Integer getFlowProcess() {
return flowProcess;
}
/**
* 当前是目标确认还是评分0目标制定1目标确认2执行中3结果值录入4评分5考核结束
* @param flowProcess
*/
public void setFlowProcess(Integer flowProcess) {
this.flowProcess = flowProcess;
}
@Override
public String toString() {
return "FlowRecord{" +
@ -343,6 +361,7 @@ public class FlowRecord implements java.io.Serializable {
",statusName=" + statusName +
",type=" + type +
",processId=" + processId +
",flowProcess=" + flowProcess +
"}";
}
}

View File

@ -1,5 +1,6 @@
package com.lz.modules.performance.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
@ -42,7 +43,9 @@ public class ChartController extends AbstractController{
public R chartResult(@RequestParam(required = false) @ApiParam(name = "startId",value = "考核周期标识id") Long startId){
List<ChartStatisticalRes> chartStatisticalRes = null;
try {
chartStatisticalRes = chartResultService.chartReport(startId);
//Long userId = getUserId();
Long userId = 313L;
chartStatisticalRes = chartResultService.chartReport(startId,userId);
} catch (Exception e) {
log.error("获取绩效报表统计异常" ,e);
return R.error();
@ -82,5 +85,12 @@ public class ChartController extends AbstractController{
@PostMapping("chart/test")
public R chartTest(){
List<FlowStart> starts = flowStartMapper.selectList(new QueryWrapper<FlowStart>().in("group_ids", Collections.EMPTY_LIST));
System.out.println();
return null;
}
}

View File

@ -31,4 +31,8 @@ public class AssessDetailReq extends BasePage{
//状态 确认 执行 结果录入
@ApiModelProperty(value = "状态 确认 执行 结果录入。。。",name = "flowProcess")
private Integer flowProcess;
private List<String> departmentIds;
private Long loginUserId;
}

View File

@ -4,6 +4,7 @@ import com.lz.modules.equipment.entity.model.BasePage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @Author: djc
@ -19,4 +20,7 @@ public class AssessListReq extends BasePage {
//组名称
@ApiModelProperty(value = "考核名称",name = "name")
private String name;
private Long loginUserId;
}

View File

@ -22,4 +22,7 @@ public class ChartResultReq extends BasePage{
@ApiModelProperty(value = "等级",name = "scoreLevel")
private Long scoreLevel;
private Long loginUserId;
}

View File

@ -15,6 +15,9 @@ import java.util.List;
@Data
@ApiModel("考核详情列表实体")
public class AssessManagerDetailRes {
//头像
@ApiModelProperty(value = "头像", name = "avatar")
private String avatar;
@ApiModelProperty(value = "姓名",name = "staffName")
private String staffName;

View File

@ -17,9 +17,9 @@ public interface AssessService {
/**
*
* @param staffRole
* @param staffId
* @return null 为全部部门 size = 0 为没有部门
*/
List<Long> roleDepartment(StaffRole staffRole);
List<String> roleDepartments(Long staffId);
}

View File

@ -18,7 +18,7 @@ import java.util.List;
*/
public interface ChartResultService {
List<ChartStatisticalRes> chartReport(Long startId);
List<ChartStatisticalRes> chartReport(Long startId,Long staffId);
List<ChartStatistical> countDepartmentAndStaffNum(List<String>staffIds);

View File

@ -1,5 +1,6 @@
package com.lz.modules.performance.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Maps;
import com.lz.common.exception.RRException;
@ -8,6 +9,7 @@ import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
import com.lz.modules.app.dto.ApprovalDto;
import com.lz.modules.app.dto.StaffSimpleDto;
import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.service.StaffService;
import com.lz.modules.flow.dao.EvaluationStartStaffMapper;
import com.lz.modules.flow.dao.FlowStartMapper;
@ -27,6 +29,7 @@ import com.lz.modules.performance.req.AssessToScoreReq;
import com.lz.modules.performance.res.AssessManagerDetailRes;
import com.lz.modules.performance.res.AssessManagerListRes;
import com.lz.modules.performance.service.AssessManagerService;
import com.lz.modules.performance.service.AssessService;
import com.lz.modules.sys.dao.app.ResultRecordMapper;
import com.lz.modules.sys.entity.app.ResultRecord;
import com.lz.modules.sys.service.app.ResultRecordService;
@ -71,6 +74,8 @@ public class AssessManagerServiceImpl implements AssessManagerService {
private EvaluationStartStaffMapper evaluationStartStaffMapper;
@Autowired
private FlowStartService flowStartService;
@Autowired
private AssessService assessService;
@Override
public PageUtils assessList(AssessListReq req) {
@ -80,8 +85,11 @@ public class AssessManagerServiceImpl implements AssessManagerService {
);
List<FlowStart> list = pageUtils.getList();
if(CollectionUtils.isEmpty(list)){
log.info("未找到考核发起数据");
return pageUtils;
}
//List<String> mandepartmentIds = assessService.roleDepartments(req.getLoginUserId());
List<String> mandepartmentIds = Collections.EMPTY_LIST;
list.forEach(flowStart -> {
AssessManagerListRes res = new AssessManagerListRes();
String name = flowStart.getName();
@ -90,7 +98,8 @@ public class AssessManagerServiceImpl implements AssessManagerService {
if(name.contains("绩效考核")){
res.setCycleTime(name.substring(0,name.lastIndexOf("绩效考核")));
}
int i = resultRecordMapper.countStartAndGroupNum(flowStart.getId());
//过滤非自己管理的人员
int i = resultRecordMapper.countStartAndGroupNum(flowStart.getId(),mandepartmentIds);
ResultRecord resultRecord = resultRecordMapper.selectOneByStartId(flowStart.getId());
res.setJoinNum(resultRecord == null? StringUtil.EMPTY : resultRecord.getStaffName() + i + "等人");
data.add(res);
@ -109,6 +118,12 @@ public class AssessManagerServiceImpl implements AssessManagerService {
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(),req.getPageSize()).doSelect(
page -> resultRecordMapper.selectAssessListByStartId(page,req)
);
List<AssessManagerDetailRes> list = pageUtils.getList();
list.forEach(assessManagerDetailRes -> {
StaffEntity staffEntity = staffService.selectStaffById(assessManagerDetailRes.getStaffId());
assessManagerDetailRes.setAvatar(Optional.ofNullable(staffEntity.getAvatar()).orElse(StringUtil.EMPTY));
});
return pageUtils;
}
@ -227,8 +242,10 @@ public class AssessManagerServiceImpl implements AssessManagerService {
List<Long> recordIds = resultRecordMapper.selectToScoreList(req.getStartId(), evaluation);
if(CollectionUtils.isEmpty(recordIds)){
log.info("该考评组无数据 evaluationId:" + evaluation);
continue;
}
log.info("本次评分更新操作 num: " + recordIds.size());
recordIds.forEach(aLong -> {
//更新流程绩效
ApprovalDto approvalDto = new ApprovalDto();
@ -236,7 +253,8 @@ public class AssessManagerServiceImpl implements AssessManagerService {
approvalDto.setResultRecordId(aLong);
approvalDto.setMenuName("开始评分");
try {
resultRecordService.newApproval(approvalDto);
R r = resultRecordService.newApproval(approvalDto);
log.info("绩效id aLong :" + aLong + " ,res" + JSON.toJSONString(r));
} catch (Exception e) {
log.error("执行中状态跳过失败 recorId:" + aLong,e);
}
@ -248,7 +266,7 @@ public class AssessManagerServiceImpl implements AssessManagerService {
}
public static void main(String[] args) {
/* public static void main(String[] args) {
ExecutorService executorService = Executors.newFixedThreadPool(10);
CompletableFuture<List<Long>> future = CompletableFuture.supplyAsync(()-> Arrays.asList(1L,2L),executorService);
try {
@ -259,6 +277,6 @@ public class AssessManagerServiceImpl implements AssessManagerService {
} catch (ExecutionException e) {
e.printStackTrace();
}
}
}*/
}

View File

@ -8,10 +8,7 @@ import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.service.StaffService;
import com.lz.modules.flow.entity.StaffRole;
import com.lz.modules.flow.entity.StaffRoleDepartment;
import com.lz.modules.flow.service.FlowChangeService;
import com.lz.modules.flow.service.FlowRecordService;
import com.lz.modules.flow.service.StaffRoleDepartmentService;
import com.lz.modules.flow.service.StaffRoleEvaluationGroupService;
import com.lz.modules.flow.service.*;
import com.lz.modules.performance.dto.TaskListDto;
import com.lz.modules.performance.req.AssessTaskReq;
import com.lz.modules.performance.res.ChartStatisticalRes;
@ -49,6 +46,8 @@ public class AssessServiceImpl implements AssessService {
private StaffRoleDepartmentService staffRoleDepartmentService;
@Autowired
private StaffRoleEvaluationGroupService staffRoleEvaluationGroupService;
@Autowired
private StaffRoleService staffRoleService;
@Override
public PageUtils userTaskList(AssessTaskReq req,Long userId) {
@ -68,7 +67,7 @@ public class AssessServiceImpl implements AssessService {
name = "";
}
//根据状态拼接文案
res.setTitle(name + "" + taskListDto.getMonthTime() + "");
res.setTitle(name + "" + taskListDto.getMonthTime() + "绩效考核 ");
res.setTime(DateUtils.format(taskListDto.getGmtModified(),DateUtils.DATE_TIME_PATTERN));
//跳转绩效详情页
res.setRecordId(taskListDto.getRecordId());
@ -84,7 +83,8 @@ public class AssessServiceImpl implements AssessService {
@Override
public List<Long> roleDepartment(StaffRole staffRole) {
public List<String> roleDepartments(Long staffId) {
StaffRole staffRole = staffRoleService.selectByStaffId(staffId);
if(staffRole == null){
log.info("staffRole 为空");
return Collections.EMPTY_LIST;
@ -103,7 +103,8 @@ public class AssessServiceImpl implements AssessService {
allDepart.addAll(strings);
});
List<Long> collect = allDepart.stream().distinct().map(s -> Long.valueOf(s)).collect(Collectors.toList());
List<String> collect = allDepart.stream().distinct().collect(Collectors.toList());
log.info("获取到权限对应的部门 " + JSON.toJSONString(collect));
return collect;
}
log.info("未获取到用户权限对应的部门 roleID: " + staffRole.getId());

View File

@ -1,5 +1,6 @@
package com.lz.modules.performance.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Maps;
import com.lz.common.utils.PageUtils;
@ -24,6 +25,7 @@ import com.lz.modules.performance.req.ChartStartsReq;
import com.lz.modules.performance.res.ChartStartsRes;
import com.lz.modules.performance.res.ChartStatistical;
import com.lz.modules.performance.res.ChartStatisticalRes;
import com.lz.modules.performance.service.AssessService;
import com.lz.modules.performance.service.ChartResultService;
import com.lz.modules.sys.dao.app.ResultRecordMapper;
import com.lz.modules.sys.entity.app.ResultRecord;
@ -62,15 +64,18 @@ public class ChartResultServiceImpl implements ChartResultService {
private DepartmentsService departmentsService;
@Autowired
private FlowChartService flowChartService;
@Autowired
private AssessService assessService;
@Override
public List<ChartStatisticalRes> chartReport(Long startId) {
public List<ChartStatisticalRes> chartReport(Long startId,Long staffId) {
String defaultTime = StringUtil.EMPTY;
Integer defaultCycleType = null;
FlowStart flowStart = null;
if(startId==null){
//取最近一条记录
FlowStart flowStart = flowStartMapper.selectRecentlyLimt();
flowStart = flowStartMapper.selectRecentlyLimt();
if(flowStart!=null){
log.info("首次进入,默认返回最新记录 flowStartId:" + flowStart.getId());
startId = flowStart.getId();
@ -80,14 +85,17 @@ public class ChartResultServiceImpl implements ChartResultService {
return new ArrayList<>();
}
}
//自己管理的部门
//List<String> mandepartmentIds = assessService.roleDepartments(staffId);
List<String> mandepartmentIds = Collections.EMPTY_LIST;
List<ChartStatisticalRes> data = new ArrayList<>();
ChartStatisticalRes res;
List<ChartStatistical> process = resultRecordService.countNumByFlowProcess(startId,null,null);
List<ChartStatistical> process = resultRecordService.countNumByFlowProcess(startId,null,mandepartmentIds);
res = new ChartStatisticalRes();
res.setType(0);
res.setStatisticals(buildProcess(process,startId));
res.setStatisticals(buildProcess(process,startId,mandepartmentIds));
res.setDefaultTime(defaultTime);
if(StringUtil.isNotBlank(defaultTime)){
res.setDefaultId(startId);
@ -95,7 +103,7 @@ public class ChartResultServiceImpl implements ChartResultService {
}
data.add(res);
List<ChartStatistical> scoreLevel = resultRecordService.countNumByScoreLevel(startId,null,null);
List<ChartStatistical> scoreLevel = resultRecordService.countNumByScoreLevel(startId,null,mandepartmentIds);
res = new ChartStatisticalRes();
res.setType(1);
res.setStatisticals(scoreLevel);
@ -106,14 +114,24 @@ public class ChartResultServiceImpl implements ChartResultService {
}
data.add(res);
FlowStart flowStart = flowStartMapper.selectFlowStartById(startId);
//如果不是默认获得发起考核信息
if(flowStart == null){
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);
log.info("chartReport 所有人员:" + JSON.toJSONString(staffIds));
//自己管理的和发起的人员交集
List<String> manstaffIds = staffService.staffsByAllDeparmentIds(mandepartmentIds);
log.info("chartReport 管理人员:" + JSON.toJSONString(manstaffIds));
manstaffIds.retainAll(staffIds);
log.info("chartReport 交集人员:" + JSON.toJSONString(manstaffIds));
List<String> all = new ArrayList<>(manstaffIds);
List<ChartStatistical> depstaff = this.countDepartmentAndStaffNum(all);
res = new ChartStatisticalRes();
res.setType(2);
@ -161,7 +179,14 @@ public class ChartResultServiceImpl implements ChartResultService {
@Override
public PageUtils selectChartDetailList(ChartResultReq req) {
List<String> allDeparmentIds = staffService.selectAllDeparmentIdsByDepartmentParentId(req.getDepartmentId());
List<String> ids = staffService.staffsByAllDeparmentIds(allDeparmentIds);
//自己管理的和所有的部门交集
log.info("selectChartDetailList 管理部门:" + JSON.toJSONString(allDeparmentIds));
//List<String> mandepartmentIds = assessService.roleDepartments(req.getLoginUserId());
List<String> mandepartmentIds = Collections.EMPTY_LIST;
log.info("selectChartDetailList 管理部门:" + JSON.toJSONString(mandepartmentIds));
mandepartmentIds.retainAll(allDeparmentIds);
log.info("selectChartDetailList 交集部门:" + JSON.toJSONString(mandepartmentIds));
List<String> ids = staffService.staffsByAllDeparmentIds(mandepartmentIds);
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(), req.getPageSize()).doSelect(
page -> resultRecordMapper.selectChartDetailList(page,ids,req.getStartId(),req.getScoreLevel())
);
@ -197,17 +222,21 @@ public class ChartResultServiceImpl implements ChartResultService {
@Override
public List<ChartStatistical> countAssessNumByFlowProcess(AssessDetailReq req) {
List<ChartStatistical> process = resultRecordMapper.countAssessNumByFlowProcess(req);
List<ChartStatistical> data = buildProcess(process, req.getStartId());
//获取自己管理的部门
//List<String> mandepartmentIds = assessService.roleDepartments(req.getLoginUserId());
List<String> mandepartmentIds = Collections.EMPTY_LIST;
List<ChartStatistical> data = buildProcess(process, req.getStartId(),mandepartmentIds);
return data;
}
//构建流程默认人数
private List<ChartStatistical> buildProcess(List<ChartStatistical> process,Long startId){
private List<ChartStatistical> buildProcess(List<ChartStatistical> process,Long startId,List<String> mandepartmentIds){
List<ChartStatistical> data = new ArrayList<>();
Map map = Maps.newHashMap();
int count = resultRecordService.count(new QueryWrapper<ResultRecord>()
.eq("is_delete", 0)
.eq("start_id", startId));
.eq("start_id", startId)
.in("department_id",mandepartmentIds));
ChartStatistical all = new ChartStatistical();
all.setDesc("参与人数");

View File

@ -73,15 +73,15 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
List<ResultRecord> selectResultRecordAllByStaffId(@Param("staffId") Long staffId);
List<ChartStatistical> countNumByFlowProcess(@Param("startId") Long startId,@Param("evaluationIds")List<Long> evaluationIds,@Param("departmentIds")List<Long> departmentIds);
List<ChartStatistical> countNumByFlowProcess(@Param("startId") Long startId,@Param("evaluationIds")List<Long> evaluationIds,@Param("departmentIds")List<String> departmentIds);
List<ChartStatistical> countNumByScoreLevel(@Param("startId") Long startId,@Param("evaluationIds")List<Long> evaluationIds,@Param("departmentIds")List<Long> departmentIds);
List<ChartStatistical> countNumByScoreLevel(@Param("startId") Long startId,@Param("evaluationIds")List<Long> evaluationIds,@Param("departmentIds")List<String> departmentIds);
List<ResultRecord> selectChartDetailList(@Param("page") IPage page, @Param("staffIds") List<String> staffIds, @Param("startId")Long startId,@Param("scoreLevel")Long scoreLevel);
int batchDeleteByStartId(@Param("startId")Long startId);
int countStartAndGroupNum(@Param("startId")Long startId);
int countStartAndGroupNum(@Param("startId")Long startId,@Param("departmentIds")List<String> departmentIds);
ResultRecord selectOneByStartId(@Param("startId")Long startId);

View File

@ -1,4 +1,5 @@
package com.lz.modules.sys.entity.app;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
@ -6,6 +7,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* <p>
* </p>*业绩评论表
@ -50,6 +53,10 @@ public class ResultComment implements java.io.Serializable {
//操作名称
@ApiModelProperty(value = "操作名称", name = "optDesc")
private String optDesc;
@TableField(exist=false)
private String avatar;
/**
*
* @return

View File

@ -103,9 +103,9 @@ public interface ResultRecordService extends IService<ResultRecord> {
List<ResultRecord> selectResultRecordAllByStaffId(Long staffId);
List<ChartStatistical> countNumByFlowProcess(Long startId,List<Long> evaluationIds,List<Long> departmentIds);
List<ChartStatistical> countNumByFlowProcess(Long startId,List<Long> evaluationIds,List<String> departmentIds);
List<ChartStatistical> countNumByScoreLevel(Long startId,List<Long> evaluationIds,List<Long> departmentIds);
List<ChartStatistical> countNumByScoreLevel(Long startId,List<Long> evaluationIds,List<String> departmentIds);
void batchDeleteByStaffIds(List<String> staffIds);

View File

@ -3,7 +3,6 @@ package com.lz.modules.sys.service.app.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dingtalk.api.response.OapiDepartmentListResponse;
import com.lz.common.emun.WorkMsgTypeEnum;
import com.lz.common.exception.RRException;
import com.lz.common.utils.*;
@ -750,12 +749,12 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
}
@Override
public List<ChartStatistical> countNumByFlowProcess(Long startId,List<Long> evaluationIds,List<Long> departmentIds) {
public List<ChartStatistical> countNumByFlowProcess(Long startId,List<Long> evaluationIds,List<String> departmentIds) {
return resultRecordMapper.countNumByFlowProcess(startId,evaluationIds,departmentIds);
}
@Override
public List<ChartStatistical> countNumByScoreLevel(Long startId,List<Long> evaluationIds,List<Long> departmentIds) {
public List<ChartStatistical> countNumByScoreLevel(Long startId,List<Long> evaluationIds,List<String> departmentIds) {
return resultRecordMapper.countNumByScoreLevel(startId,evaluationIds,departmentIds);
}
@ -802,6 +801,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
flowRecord.setFlowId(flowApprovalRole.getFlowId());
FlowChart flowChart = flowService.selectFlowChartByChartId(flowApprovalRole.getFlowId());
flowRecord.setProcessId(flowChart.getProcessId());
flowRecord.setFlowProcess(flowChart.getFlowProcess());
String staffRole = StaffRoles.getStaffRole(staffEntity.getId(), StringUtil.strToLongs(flowApprovalRole.getRoleId()));
if (i == 0) {
flowRecord.setStatus(FlowRecordStatusEnums.CURRENT_FLOW_STATUS.getStatus());
@ -986,6 +986,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
}
FlowChart currentFlowChart = flowService.selectFlowChartByChartId(currentFlowRecord.getFlowId());
resultRecord.setFlowProcess(currentFlowChart.getFlowProcess());
resultRecord.setFlowStaffIdRole(nextFlowRecords.size() == 1 ? currentFlowRecord.getFlowStaffIdRole() : null);
resultRecord.setCurrentApprovalStaffId(nextFlowRecords.size() == 1 ? currentFlowRecord.getApprovalStaffId() : null);
resultRecord.setCurrentApprovalStaffName(nextFlowRecords.size() == 1 ? currentFlowRecord.getApprovalStaffName() : null);
@ -1107,17 +1108,30 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
List<FlowDetailResp> flowDetailRespList = new ArrayList<>();
mySetFlowDetailRespList(flowDetailRespList,flowRecord);
resp.setFlowDetailRespList(flowDetailRespList);
flowRecordList.add(resp);
flowIndex = flowRecord.getFlowIndex();
}
boolean flag = true;
for(FlowRecordResp flowRecordResp : flowRecordList) {
if (flowRecordResp.getStatus() == 0) {
flag = false;
break;
}
}
FlowRecordResp end = new FlowRecordResp();
end.setFlowName("结束");
end.setStatus(flag ? 1 : 0);
flowRecordList.add(end);
List<ResultComment> resultCommentList = resultCommentService.selectByRecordId(recordDetailDto.getResultRecordId());
for(ResultComment resultComment:resultCommentList){
StaffEntity staffEntity = staffService.selectStaffById(resultComment.getStaffId());
resultComment.setAvatar(staffEntity.getAvatar());
}
Map<String,Integer> auth = new HashMap<>();
auth.put("showScore",1);
auth.put("showResult",1);
List<FlowRecord> currentResultRecords = flowRecordService.selectFlowRecordByRecordIdStatus(recordDetailDto.getResultRecordId(),2);
if(currentResultRecords !=null && currentResultRecords.size() > 0 ){
FlowRecord currentResultRecord = null;
@ -1159,7 +1173,9 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
flowDetailResp.setCurrentStaffId(flowRecord.getApprovalStaffId());
flowDetailResp.setStaffName(flowRecord.getApprovalStaffName());
flowDetailResp.setFlowRecordId(flowRecord.getId());
StaffEntity staffEntity = staffService.selectStaffById(flowRecord.getApprovalStaffId());
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(flowRecord.getApprovalStaffId());
flowDetailResp.setAvatar(staffEntity.getAvatar());
if(departmentsStaffRelateEntity !=null){
DepartmentsEntity departmentsEntity = departmentsDao.selectByDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
flowDetailResp.setDepartName(departmentsEntity.getDepartmentName());

View File

@ -102,7 +102,7 @@
<select id="selectByRecordId" resultType="com.lz.modules.sys.entity.app.ResultComment">
select * from lz_result_comment where record_id=#{recordId} and is_delete = 0
select * from lz_result_comment where record_id=#{recordId} and is_delete = 0 order by id desc
</select>
<select id="selectLastComment" resultType="com.lz.modules.sys.entity.app.ResultComment">

View File

@ -420,6 +420,13 @@
<select id="countStartAndGroupNum" resultType="int">
select COUNT(1) from lz_result_record where is_delete = 0 and start_id = #{startId}
<if test="departmentIds !=null and departmentIds.size()!=0">
and department_id in (
<foreach collection="departmentIds" item="department_id" separator=",">
#{department_id}
</foreach>
)
</if>
</select>
<select id="selectOneByStartId" resultType="com.lz.modules.sys.entity.app.ResultRecord">
@ -452,6 +459,13 @@
</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>
</select>
<select id="countAssessNumByFlowProcess" resultType="com.lz.modules.performance.res.ChartStatistical">
@ -478,6 +492,13 @@
</foreach>
)
</if>
<if test="req.departmentIds !=null and req.departmentIds.size()!=0">
and department_id in (
<foreach collection="req.departmentIds" item="department_id" separator=",">
#{department_id}
</foreach>
)
</if>
GROUP BY flow_process
</select>