提交修改
This commit is contained in:
commit
55a147718e
@ -9,7 +9,7 @@ public enum WorkMsgTypeEnum {
|
||||
//绩效提交审核的通知(自己提交给领导,自己提交给人事,人事提交给老板)
|
||||
SUBMIT(0, "绩效提交", "去审核", "# 绩效提交\n ## @的绩效已经提交"),
|
||||
//绩效打回审核的通知
|
||||
REJECT(1, "绩效驳回", "去修改", "# 绩效驳回\n ## @的绩效已经驳回"),
|
||||
REJECT(1, "绩效驳回", "去修改", "# 绩效驳回\n ## @的绩效被驳回"),
|
||||
//绩效通过领导审核的通知,这一步提交到HR,提交的type
|
||||
LEADER_PASS(2, "绩效已打分", "去提交给人事", "# 绩效已打分\n ## 你的绩效已经打分"),
|
||||
//绩效通过人事,老板审核的最终审核通知
|
||||
|
||||
@ -387,9 +387,10 @@ public class ResultRecordController extends AbstractController {
|
||||
staffs.addAll(departManagers.getManagers());
|
||||
}
|
||||
}
|
||||
/*if(staffs.size() == 0){
|
||||
return R.error("找不到有效的评分人,设置的评分人不存在");
|
||||
}*/
|
||||
if(staffs.size() == 0){
|
||||
log.info("无法找到评分人员,开始找绩效管理人员");
|
||||
staffs = staffService.findManger(resultRecord.getId(), 4);
|
||||
}
|
||||
|
||||
for (StaffEntity staff:staffs
|
||||
) {
|
||||
|
||||
@ -98,4 +98,6 @@ public interface StaffDao extends BaseMapper<StaffEntity> {
|
||||
List<StaffEntity> selectNamesByIds(@Param("list") List<Long> sIds);
|
||||
|
||||
List<StaffEntity> selectStaffsByGroupId(@Param("copyId") Long copyId);
|
||||
|
||||
List<StaffEntity> findManger(@Param("recordId") Long recordId, @Param("flowProcess") int flowProcess);
|
||||
}
|
||||
|
||||
@ -103,5 +103,7 @@ public interface StaffService extends IService<StaffEntity> {
|
||||
List<StaffEntity> selectNamesByIds(List<Long> sIds);
|
||||
//获取绩效考核管理员
|
||||
List<StaffEntity> selectStaffsByGroupId(Long copyId);
|
||||
|
||||
List<StaffEntity> findManger(Long recordId, int flowProcess);
|
||||
}
|
||||
|
||||
|
||||
@ -529,5 +529,10 @@ public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> impleme
|
||||
return staffDao.selectStaffsByGroupId(copyId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StaffEntity> findManger(Long recordId, int flowProcess){
|
||||
return staffDao.findManger(recordId, flowProcess);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -58,4 +58,5 @@ public interface EvaluationGroupService extends IService<EvaluationGroup> {
|
||||
|
||||
String getEvaluationCopyIdsByEvaluationIds(String evaluationIds,Long startId);
|
||||
|
||||
EvaluationGroup selectEvaluationGroupByCopyId(Long copyId, Long startId);
|
||||
}
|
||||
@ -353,7 +353,8 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
|
||||
}
|
||||
|
||||
if(evaluationGroup.getConfirm()==0){
|
||||
return R.error(504,notInGroupNames + "已在其他类型为月度的考评组中,是否改为到此考评组中进行考核");
|
||||
|
||||
return R.error(504,notInGroupNames + "已在其他类型为月度的考评组中,是否改为到此考评组中进行考核").put("data",staffSimpleDtos);
|
||||
}
|
||||
|
||||
List<String> stringCollect = staffIdsByGroup.stream().distinct().collect(toList());
|
||||
@ -378,18 +379,28 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
|
||||
|
||||
private int removeStaffsToAssessGroup(List<String> ids,EvaluationGroup group) {
|
||||
String staffIds = group.getStaffIds();
|
||||
if(StringUtil.isNotBlank(staffIds)){
|
||||
String[] split = staffIds.split(",");
|
||||
Set<String> set = new HashSet(Arrays.asList(split));
|
||||
set.removeAll(new HashSet(ids)); //set.addAll(new HashSet(ids));
|
||||
String join = StringUtils.join(set, ",");
|
||||
group.setStaffIds(join);
|
||||
int i = evaluationGroupMapper.updateCoverEvaluationGroupById(group);
|
||||
return i;
|
||||
String outIds = group.getOutIds();
|
||||
//删除选中人员
|
||||
if(StringUtil.isNotBlank(staffIds)){
|
||||
String[] staffs = staffIds.split(",");
|
||||
Set<String> staffsSet = new HashSet(Arrays.asList(staffs));
|
||||
staffsSet.removeAll(ids);
|
||||
group.setStaffIds(StringUtils.join(staffsSet, ","));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//增加排除人员
|
||||
if(StringUtil.isBlank(outIds)){
|
||||
group.setOutIds(StringUtils.join(ids, ","));
|
||||
}
|
||||
else {
|
||||
String[] outs = outIds.split(",");
|
||||
Set<String> outsSet = new HashSet(Arrays.asList(outs));
|
||||
outsSet.addAll(ids);
|
||||
group.setOutIds(StringUtils.join(outsSet, ","));
|
||||
}
|
||||
|
||||
return evaluationGroupMapper.updateById(group);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEvaluationCopyIdsByEvaluationIds(String evaluationIds,Long startId) {
|
||||
@ -402,4 +413,9 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
|
||||
}
|
||||
return StringUtils.join(ids,",");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EvaluationGroup selectEvaluationGroupByCopyId(Long copyId, Long startId){
|
||||
return evaluationGroupMapper.selectEvaluationGroupByCopyId(copyId, startId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,7 +149,8 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
log.info("无有效考核人员");
|
||||
R.error(groupStaffs.getEvaluationGroup().getName() + "——无有效考核人员");
|
||||
}
|
||||
switch (start(groupStaffs.getEvaluationGroup(), flowStart, staffManages, staffSimpleInfos, mustRole, selfMustRole)){
|
||||
|
||||
switch (start(groupStaffs.getEvaluationGroup(), flowStart, staffManages, staffSimpleInfos, mustRole, selfMustRole, true)){
|
||||
|
||||
case 1:
|
||||
return R.error(groupStaffs.getEvaluationGroup().getName() + "——没有设置考核模板");
|
||||
@ -278,7 +279,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
|
||||
|
||||
|
||||
switch (start(evaluationGroup, flowStart, staffManages, staffIds, mustRole, selfMustRole)){
|
||||
switch (start(evaluationGroup, flowStart, staffManages, staffIds, mustRole, selfMustRole, false)){
|
||||
|
||||
case 1:
|
||||
return R.error(evaluationGroup.getName() + "——没有设置考核模板");
|
||||
@ -295,10 +296,10 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
}
|
||||
return R.ok("发起成功").put("data", flowStart);
|
||||
}
|
||||
|
||||
//isInsert表示是否中途加人
|
||||
private int start(EvaluationGroup evaluationGroup, FlowStart flowStart,
|
||||
Map<String, List<StaffEntity>> staffManages, List<StaffSimpleInfo> staffIds,
|
||||
Map<Long, List<FlowChartRole>> mustRole, Map<Long, List<FlowChartRole>> selfMustRole){
|
||||
Map<Long, List<FlowChartRole>> mustRole, Map<Long, List<FlowChartRole>> selfMustRole, boolean isInsert){
|
||||
|
||||
|
||||
List<ResultModelDto> resultModelDtos = resultModelService.selectResultDtoByGroupId(evaluationGroup.getId());
|
||||
@ -340,7 +341,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
}
|
||||
|
||||
//下面拷贝一份考评组信息发起后所使用的考评组id为复制后的id
|
||||
if(evaluationGroup.getCopyId() == null || evaluationGroup.getCopyId().longValue() == 0L){
|
||||
if(!isInsert){
|
||||
evaluationGroup.setCopyId(evaluationGroup.getId());
|
||||
evaluationGroup.setId(null);
|
||||
evaluationGroup.setGmtCreate(null);
|
||||
@ -378,6 +379,86 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
//插入备份的考评组指标信息
|
||||
resultTagetLibService.insertResultTagetLibs(resultTagetLibs);
|
||||
}
|
||||
}else{//流程流转中中途加人走的流程
|
||||
evaluationGroup =
|
||||
evaluationGroupService.selectEvaluationGroupByCopyId(evaluationGroup.getId(),flowStart.getId());
|
||||
if(evaluationGroup == null){
|
||||
log.info("无法assess/manager/detail找到拷贝组信息");
|
||||
return 5;
|
||||
}
|
||||
//以下代码没必要更新,因为这个拷贝分用不到。正确的对应关系清查看lz_evaluation_start_staff
|
||||
//evaluationGroup.setStaffIds(evaluationGroup.getStaffIds() + ",");
|
||||
|
||||
List<EvaluationStartStaff> evaluationStartStaffs = new ArrayList<>();
|
||||
List<ResultDetail> resultDetails = new ArrayList();
|
||||
//下面初始化参与人员
|
||||
for (StaffSimpleInfo staffInfo:staffIds
|
||||
) {
|
||||
staffInfo.setStartId(flowStart.getId());
|
||||
|
||||
EvaluationStartStaff evaluationStartStaff = new EvaluationStartStaff();
|
||||
evaluationStartStaff.setEvaluationId(evaluationGroup.getId());
|
||||
evaluationStartStaff.setEvaluationName(evaluationGroup.getName());
|
||||
evaluationStartStaff.setStaffId(staffInfo.getId());
|
||||
evaluationStartStaff.setStartId(flowStart.getId());
|
||||
evaluationStartStaff.setDepartmentId(staffInfo.getDepartmentId());
|
||||
evaluationStartStaff.setType(CheckStaffType.STAFF.getCode());
|
||||
evaluationStartStaffs.add(evaluationStartStaff);
|
||||
|
||||
|
||||
//初始化lz_result_records数据
|
||||
ResultRecord resultRecord = new ResultRecord();
|
||||
resultRecord.setDepartmentId(staffInfo.getDepartmentId());
|
||||
resultRecord.setDepartmentName(staffInfo.getDepartmentName());
|
||||
resultRecord.setStaffId(staffInfo.getId());
|
||||
resultRecord.setStaffName(staffInfo.getName());
|
||||
resultRecord.setType(1);//设置为提交目标
|
||||
resultRecord.setStatus(0);//设置为新建
|
||||
resultRecord.setStartId(flowStart.getId());
|
||||
resultRecord.setEvaluationId(evaluationGroup.getId());
|
||||
resultRecord.setFlowProcess(0);//设置为目标制定
|
||||
|
||||
//设置当前审批员工id current_approval_staff_id
|
||||
resultRecord.setCurrentApprovalStaffId(staffInfo.getId());
|
||||
//设置当前审批员工姓名 current_approval_staff_name
|
||||
resultRecord.setCurrentApprovalStaffName(staffInfo.getName());
|
||||
|
||||
resultRecordService.insertResultRecord(resultRecord);
|
||||
staffInfo.setRecordId(resultRecord.getId());
|
||||
|
||||
for (ResultModelDto modelDto:resultModelDtos
|
||||
) {
|
||||
|
||||
|
||||
if(modelDto.getTagetLibs() != null && modelDto.getTagetLibs().size() > 0){//模板里面有添加指标
|
||||
for (ResultTagetLibDto libDto:
|
||||
modelDto.getTagetLibs()) {
|
||||
|
||||
ResultDetail resultDetail = new ResultDetail();
|
||||
resultDetail.setRecordId(resultRecord.getId());
|
||||
resultDetail.setTarget(libDto.getName());
|
||||
resultDetail.setType(modelDto.getType());
|
||||
resultDetail.setKeyResult(libDto.getKeyResult());
|
||||
resultDetail.setCheckWeight(libDto.getWeight());
|
||||
resultDetail.setStaffId(staffInfo.getId());
|
||||
resultDetail.setPriority(libDto.getOrderBy());
|
||||
resultDetails.add(resultDetail);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//如果有数据插入lz_result_detail表
|
||||
if(resultDetails.size() > 0){
|
||||
//
|
||||
resultDetailService.insertResultDetails(resultDetails);
|
||||
|
||||
}
|
||||
|
||||
//下面生成实际的考核流程
|
||||
resultRecordService.initFlowRecord(resultRecord.getId());
|
||||
}
|
||||
evaluationStartStaffService.insertEvaluationStartStaffs(evaluationStartStaffs);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -13,10 +13,14 @@ import com.lz.modules.app.service.DepartmentsService;
|
||||
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
||||
import com.lz.modules.app.service.StaffOccupationService;
|
||||
import com.lz.modules.app.service.StaffService;
|
||||
import com.lz.modules.flow.entity.FlowRecord;
|
||||
import com.lz.modules.flow.service.FlowRecordService;
|
||||
import com.lz.modules.job.model.responseBo.DepartmentInfosBo;
|
||||
import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
|
||||
import com.lz.modules.sys.dao.SysUserTokenDao;
|
||||
import com.lz.modules.sys.entity.SysUserTokenEntity;
|
||||
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||
import com.lz.modules.third.entity.ThirdAppConfig;
|
||||
import com.lz.modules.third.service.ThirdAppConfigService;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -26,6 +30,7 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
@ -63,9 +68,16 @@ public class DingtalkBusiness {
|
||||
@Autowired
|
||||
private SysUserTokenDao sysUserTokenDao;
|
||||
|
||||
@Autowired
|
||||
private ResultRecordService resultRecordService;
|
||||
|
||||
@Autowired
|
||||
private FlowRecordService flowRecordService;
|
||||
|
||||
@Resource
|
||||
StaffDao staffDao;
|
||||
|
||||
|
||||
@Value("${dingtalk.appid}")
|
||||
private String appid;
|
||||
|
||||
@ -194,10 +206,33 @@ public class DingtalkBusiness {
|
||||
}
|
||||
|
||||
|
||||
|
||||
//流程流转发送消息
|
||||
public String sendWorkMSGWithAsyn(Long resultRecordId , int type) {
|
||||
ResultRecord resultRecord = resultRecordService.selectResultRecordById(resultRecordId);
|
||||
if(resultRecord != null){
|
||||
StaffSimpleInfo fromStaff = staffService.selectStaffSimpleInfo(resultRecord.getStaffId());
|
||||
List<StaffSimpleInfo> toStaffids;
|
||||
if(type == WorkMsgTypeEnum.REJECT.getType()){
|
||||
toStaffids = new ArrayList<>();
|
||||
toStaffids.add(fromStaff);
|
||||
sendWorkMSGWithAsyn(fromStaff, toStaffids, WorkMsgTypeEnum.REJECT.getType());
|
||||
}else{
|
||||
List<FlowRecord> flowRecords =
|
||||
flowRecordService.selectFlowRecordByRecordIdStatus(resultRecordId, 2);
|
||||
List<Long> ids = flowRecords.stream().map(new Function<FlowRecord, Long>() {
|
||||
@Override
|
||||
public Long apply(FlowRecord flowRecord) {
|
||||
return flowRecord.getApprovalStaffId();
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
toStaffids = staffService.selectStaffSimpleInfos(ids);
|
||||
sendWorkMSGWithAsyn(fromStaff, toStaffids, WorkMsgTypeEnum.PROCESS.getType());
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
|
||||
}
|
||||
return "error";
|
||||
}
|
||||
|
||||
|
||||
@ -337,7 +372,12 @@ public class DingtalkBusiness {
|
||||
if(fromStaff == null){
|
||||
content = workMsgTypeEnum.getContent().replace("@", info.getName());
|
||||
}else{
|
||||
content = workMsgTypeEnum.getContent().replace("@", fromStaff.getName());
|
||||
if(fromStaff.getId() == info.getId()){
|
||||
content = workMsgTypeEnum.getContent().replace("@", "您");
|
||||
}else{
|
||||
content = workMsgTypeEnum.getContent().replace("@", fromStaff.getName());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
StaffEntity entity = new StaffEntity();
|
||||
|
||||
@ -3,6 +3,7 @@ package com.lz.modules.performance.controller;
|
||||
import com.lz.common.utils.PageUtils;
|
||||
import com.lz.common.utils.R;
|
||||
import com.lz.common.utils.StringUtil;
|
||||
import com.lz.modules.app.dto.StaffSimpleDto;
|
||||
import com.lz.modules.flow.dao.FlowStartMapper;
|
||||
import com.lz.modules.flow.entity.FlowStart;
|
||||
import com.lz.modules.performance.req.AssessChangeReq;
|
||||
@ -56,7 +57,8 @@ public class AssessManagerController extends AbstractController{
|
||||
PageUtils pageUtils = assessManagerService.assessList(req);
|
||||
return R.ok().put("data",pageUtils);
|
||||
} catch (Exception e) {
|
||||
return R.error();
|
||||
log.error("获取考核列表异常,",e);
|
||||
return R.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,17 +66,14 @@ public class AssessManagerController extends AbstractController{
|
||||
@ApiOperation("获取考核详情列表")
|
||||
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = AssessManagerDetailRes.class)})
|
||||
public R assessDetail(@RequestBody AssessDetailReq req){
|
||||
if(req.getStartId()==null){
|
||||
return R.error("考核id不能为空");
|
||||
}
|
||||
PageUtils pageUtils = null;
|
||||
PageUtils pageUtils;
|
||||
try {
|
||||
Long userId = getUserId();
|
||||
req.setLoginUserId(userId);
|
||||
pageUtils = assessManagerService.assessDetail(req);
|
||||
} catch (Exception e) {
|
||||
log.error("获取考核详情列表异常" ,e);
|
||||
return R.error();
|
||||
return R.error(e.getMessage());
|
||||
}
|
||||
return R.ok().put("data",pageUtils);
|
||||
|
||||
@ -86,17 +85,14 @@ public class AssessManagerController extends AbstractController{
|
||||
@ApiOperation("获取考核详情列表人数统计")
|
||||
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = ChartStatistical.class)})
|
||||
public R assessChart(@RequestBody AssessDetailReq req){
|
||||
if(req.getStartId()==null){
|
||||
return R.error("考核id不能为空");
|
||||
}
|
||||
List<ChartStatistical> process = null;
|
||||
List<ChartStatistical> process;
|
||||
try {
|
||||
Long userId = getUserId();
|
||||
req.setLoginUserId(userId);
|
||||
process = chartResultService.countAssessNumByFlowProcess(req);
|
||||
} catch (Exception e) {
|
||||
log.error("获取详情顶部人数统计异常" ,e);
|
||||
return R.error();
|
||||
return R.error(e.getMessage());
|
||||
}
|
||||
return R.ok().put("data",process);
|
||||
|
||||
@ -105,17 +101,8 @@ public class AssessManagerController extends AbstractController{
|
||||
|
||||
@PostMapping("assess/manager/change")
|
||||
@ApiOperation("考核管理组管理变更")
|
||||
@ApiResponses({@ApiResponse(code = 200,message = "成功"),@ApiResponse(code = 503,message = "去设置")})
|
||||
@ApiResponses({@ApiResponse(code = 200,message = "成功"),@ApiResponse(code = 503,message = "去设置",response = StaffSimpleDto.class)})
|
||||
public R assessChange(@RequestBody AssessChangeReq req){
|
||||
if(req.getStartId()==null){
|
||||
return R.error("考核id不能为空");
|
||||
}
|
||||
if(req.getChangeType()==null){
|
||||
return R.error("变动类型无效");
|
||||
}
|
||||
if(StringUtil.isBlank(req.getStaffIds())){
|
||||
return R.error("变动人员不能为空");
|
||||
}
|
||||
try {
|
||||
return assessManagerService.assessChange(req);
|
||||
} catch (Exception e) {
|
||||
@ -141,7 +128,7 @@ public class AssessManagerController extends AbstractController{
|
||||
assessManagerService.accessDelete(flowStart);
|
||||
} catch (Exception e) {
|
||||
log.error("删除考核任务异常, id:" + assessId ,e);
|
||||
return R.error();
|
||||
return R.error(e.getMessage());
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
@ -154,7 +141,7 @@ public class AssessManagerController extends AbstractController{
|
||||
assessManagerService.toScore(req);
|
||||
} catch (Exception e) {
|
||||
log.error("开始评分异常" ,e);
|
||||
return R.error();
|
||||
return R.error(e.getMessage());
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ public class ChartController extends AbstractController{
|
||||
chartStatisticalRes = chartResultService.chartReport(startId,userId);
|
||||
} catch (Exception e) {
|
||||
log.error("获取绩效报表统计异常" ,e);
|
||||
return R.error();
|
||||
return R.error(e.getMessage());
|
||||
}
|
||||
return R.ok().put("data",chartStatisticalRes);
|
||||
}
|
||||
@ -62,12 +62,12 @@ public class ChartController extends AbstractController{
|
||||
@ApiOperation("获取考核类型列表")
|
||||
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = ChartStartsRes.class)})
|
||||
public R chartStarts(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true)ChartStartsReq req){
|
||||
PageUtils pageUtils = null;
|
||||
PageUtils pageUtils;
|
||||
try {
|
||||
pageUtils = chartResultService.chartStarts(req);
|
||||
} catch (Exception e) {
|
||||
log.error("获取考核类型列表异常" ,e);
|
||||
return R.error();
|
||||
return R.error(e.getMessage());
|
||||
}
|
||||
return R.ok().put("data",pageUtils);
|
||||
}
|
||||
@ -77,14 +77,14 @@ public class ChartController extends AbstractController{
|
||||
@ApiOperation("获取报表等级详情")
|
||||
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = ResultRankListRes.class)})
|
||||
public R chartDetailList(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true) ChartResultReq req){
|
||||
PageUtils pageUtils = null;
|
||||
PageUtils pageUtils;
|
||||
try {
|
||||
Long userId = getUserId();
|
||||
req.setLoginUserId(userId);
|
||||
pageUtils = chartResultService.selectChartDetailList(req);
|
||||
} catch (Exception e) {
|
||||
log.error("获取报表等级详情异常" ,e);
|
||||
return R.error();
|
||||
return R.error(e.getMessage());
|
||||
}
|
||||
return R.ok().put("data",pageUtils);
|
||||
}
|
||||
|
||||
@ -171,15 +171,17 @@ public class EvaluationGroupController extends AbstractController {
|
||||
return Long.parseLong(s);
|
||||
}
|
||||
}).collect(Collectors.toMap(Long::longValue, Function.identity(), (e, replace) -> e));
|
||||
if(staffRoles != null && staffRoles.size() > 0){
|
||||
for (StaffRole staffRole:staffRoles
|
||||
) {//去掉已经在管理本组的管理员
|
||||
if(mapIds.containsKey(staffRole.getStaffId())){
|
||||
mapIds.remove(staffRole.getStaffId());
|
||||
}else{//删除管理的组信息
|
||||
staffRoleEvaluationGroupService.deleteStaffRoleEvaluationGroupByRoleId(staffRole.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (StaffRole staffRole:staffRoles
|
||||
) {//去掉已经在管理本组的管理员
|
||||
if(mapIds.containsKey(staffRole.getStaffId())){
|
||||
mapIds.remove(staffRole.getStaffId());
|
||||
}else{//删除管理的组信息
|
||||
staffRoleEvaluationGroupService.deleteStaffRoleEvaluationGroupByRoleId(staffRole.getId());
|
||||
}
|
||||
}
|
||||
|
||||
//去掉管理全考评组
|
||||
staffRoles = staffRoleService.selectAllGroupManageRoles();
|
||||
@ -224,7 +226,7 @@ public class EvaluationGroupController extends AbstractController {
|
||||
|
||||
@PostMapping("/checkStaff")
|
||||
@ApiOperation("校验是否有跨组人员")
|
||||
@ApiResponses({@ApiResponse(code = 200,message = "成功"),@ApiResponse(code = 504,message = "已跨组")})
|
||||
@ApiResponses({@ApiResponse(code = 200,message = "成功"),@ApiResponse(code = 504,message = "已跨组",response = StaffSimpleDto.class)})
|
||||
public R checkStaff(@RequestBody @ApiParam(required = true,name = "body") CheckStaffReq checkStaffReq) {
|
||||
return evaluationGroupService.checkStaff(checkStaffReq);
|
||||
}
|
||||
|
||||
@ -31,13 +31,13 @@ public class UserTaskController extends AbstractController{
|
||||
@ApiOperation("获取待办/处理事项")
|
||||
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = TaskListRes.class)})
|
||||
public R list(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true) AssessTaskReq req){
|
||||
PageUtils pageUtils = null;
|
||||
PageUtils pageUtils;
|
||||
try {
|
||||
Long userId = getUserId();
|
||||
pageUtils = assessService.userTaskList(req, userId);
|
||||
} catch (Exception e) {
|
||||
log.error("获取用户事项异常 userId:" ,e);
|
||||
return R.error();
|
||||
return R.error(e.getMessage());
|
||||
}
|
||||
return R.ok().put("data",pageUtils);
|
||||
}
|
||||
|
||||
@ -138,6 +138,9 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
||||
|
||||
@Override
|
||||
public PageUtils assessDetail(AssessDetailReq req) {
|
||||
if(req.getStartId() == null ){
|
||||
throw new RRException("考核id不能为空");
|
||||
}
|
||||
//拼接拷贝组
|
||||
if(StringUtil.isNotBlank(req.getEvaluationIds())){
|
||||
req.setCopyEvaluationIds(evaluationGroupService.getEvaluationCopyIdsByEvaluationIds(req.getEvaluationIds(),req.getStartId()));
|
||||
@ -180,6 +183,15 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
||||
|
||||
@Override
|
||||
public R assessChange(AssessChangeReq req) {
|
||||
if(req.getStartId()==null){
|
||||
throw new RRException("考核id不能为空");
|
||||
}
|
||||
if(req.getChangeType()==null){
|
||||
throw new RRException("变动类型无效");
|
||||
}
|
||||
if(StringUtil.isBlank(req.getStaffIds())){
|
||||
throw new RRException("变动人员不能为空");
|
||||
}
|
||||
FlowStart flowStart = flowStartMapper.selectFlowStartById(req.getStartId());
|
||||
if(flowStart == null){
|
||||
throw new RRException("暂无此考核组信息");
|
||||
@ -218,7 +230,7 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
||||
notInGroupNames = notInGroupNames + dto.getName() + " ";
|
||||
}
|
||||
|
||||
return R.error(503,notInGroupNames + "未加入月度类型考评组,被考核人需要加入月度考评组后才能参与当前月度考核。");
|
||||
return R.error(503,notInGroupNames + "未加入月度类型考评组,被考核人需要加入月度考评组后才能参与当前月度考核。").put("data",staffSimpleDtos);
|
||||
}
|
||||
|
||||
//初始化添加用户的数据
|
||||
@ -322,9 +334,10 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
||||
|
||||
//通知评分
|
||||
try {
|
||||
dingtalkBusiness.sendWorkMSGWithAsyn(toStaffids, WorkMsgTypeEnum.START_SCORE.getType());
|
||||
String s = dingtalkBusiness.sendWorkMSGWithAsyn(toStaffids, WorkMsgTypeEnum.START_SCORE.getType());
|
||||
log.info("钉钉评分响应返回,res:" + s);
|
||||
} catch (Exception e) {
|
||||
log.error("通知评分异常:",e);
|
||||
log.error("通知评分异常:ids: " + JSON.toJSONString(toStaffids) + " ,e: " ,e);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.lz.common.exception.RRException;
|
||||
import com.lz.common.utils.PageUtils;
|
||||
import com.lz.common.utils.R;
|
||||
import com.lz.common.utils.StringUtil;
|
||||
@ -230,6 +231,9 @@ public class ChartResultServiceImpl implements ChartResultService {
|
||||
|
||||
@Override
|
||||
public List<ChartStatistical> countAssessNumByFlowProcess(AssessDetailReq req) {
|
||||
if(req.getStartId()==null){
|
||||
throw new RRException("考核id不能为空");
|
||||
}
|
||||
req.setCopyEvaluationIds(evaluationGroupService.getEvaluationCopyIdsByEvaluationIds(req.getEvaluationIds(),req.getStartId()));
|
||||
//获取自己管理的部门
|
||||
List<String> mandepartmentIds = assessService.roleDepartments(req.getLoginUserId());
|
||||
|
||||
@ -545,4 +545,11 @@
|
||||
) and is_delete=0) as staff join lz_staff_occupation as occupation on staff.id = occupation.staff_id where occupation.staff_status=0
|
||||
|
||||
</select>
|
||||
|
||||
<select id="findManger" resultType="com.lz.modules.app.entity.StaffEntity">
|
||||
select staff.* from lz_staff as staff join lz_flow_record as record
|
||||
on record.approval_staff_id = staff.id
|
||||
where record.record_id = #{recordId} and record.flow_process=#{flowProcess}
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user