Commit b762f136 by tangzhaoqian

绩效管理

parent ff5e540c
......@@ -59,6 +59,9 @@ public class JxglAppraisal extends Model<JxglAppraisal> {
@TableField(fill = FieldFill.UPDATE)
@ApiModelProperty(value = "更新时间", example = "2020-10-10 10:10:10")
private Date updateTime;
@ApiModelProperty(value = "是否可编辑 限制员工的权限", example = "1")
private Integer isEdit;
@ApiModelProperty(value = "状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7归档", example = "0")
private Integer sts;
......
......@@ -50,12 +50,6 @@ public class JxglAppraisalIndicators extends Model<JxglAppraisalIndicators> {
@ApiModelProperty(value = "权重 整数,单位%", example = "10")
private Integer weight;
@ApiModelProperty(value = "是否可编辑 限制员工的权限", example = "10")
private Integer isEdit;
@ApiModelProperty(value = "是否可设置权重 限制员工的权限", example = "10")
private Integer isSetWeight;
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间", example = "2020-10-10 10:10:10")
......
......@@ -37,7 +37,6 @@ public class JxglAppraisalIndicatorsAssessment extends Model<JxglAppraisalIndica
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号 编号", example = "10")
private Integer id;
......
......@@ -51,12 +51,6 @@ public class JxglAppraisalIndicatorsT extends Model<JxglAppraisalIndicatorsT> {
@ApiModelProperty(value = "权重 整数,单位%", example = "10")
private Integer weight;
@ApiModelProperty(value = "是否可编辑 限制员工的权限", example = "10")
private Integer isEdit;
@ApiModelProperty(value = "是否可设置权重 限制员工的权限", example = "10")
private Integer isSetWeight;
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间", example = "2020-10-10 10:10:10")
......
......@@ -5,7 +5,6 @@ import java.util.List;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Transient;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
......@@ -51,15 +50,22 @@ public class JxglAppraisalT extends Model<JxglAppraisalT> {
@ApiModelProperty(value = "考核说明", example = "考核说明")
private String appraisalExplain;
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间", example = "2020-10-10 10:10:10")
private Date createTime;
@TableField(fill = FieldFill.UPDATE)
@ApiModelProperty(value = "更新时间", example = "2020-10-10 10:10:10")
private Date updateTime;
@ApiModelProperty(value = "是否可编辑 限制员工的权限", example = "10")
private Integer isEdit;
@ApiModelProperty(value = "是否使用固定", example = "10")
private Integer isUseFixd;
@ApiModelProperty(value = "是否使用非固定", example = "10")
private Integer isUseNotFixd;
@TableField(exist = false) // 是否转换
@ApiModelProperty(value = "考核指标模板", example = "")
private List<JxglAppraisalIndicatorsT> appraisalIndicatorsTs;
......
......@@ -22,7 +22,7 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
this.strictInsertFill(metaObject, "regTime", Date.class, date);
this.strictInsertFill(metaObject, "registerTime", Date.class, date);
this.strictInsertFill(metaObject, "addtime", Date.class, date);
this.strictInsertFill(metaObject, "sts", int.class, 0); // 起始版本 3.3.0(推荐使用)
this.strictInsertFill(metaObject, "sts", int.class, 0);
}
......
......@@ -232,8 +232,8 @@ public interface JxglEnumInterface {
@Getter
enum AppraisalLogType implements JxglEnumInterface {
START(0, "发起考核"), TARGET_FILL_IN(1, "目标填写"),
TARGET_CONFIRMED(2, "目标确认"), TARGET_DISMISS(3, "目标驳回"),
SELF_ASSESSMENT(4, "自评"), SCORE_DISMISS(5, "评分驳回"),
TARGET_CONFIRMED(2, "目标确认"), TARGET_DISMISS(3, "驳回目标"),
SELF_ASSESSMENT(4, "自评"), SCORE_DISMISS(5, "驳回评分"),
SUPERIOR_SCORE(6, "上级评分"), RESULT_VERIFICATION(7, "结果确认"),
UPDATE_SCORE(8, "修改评分"), ASSESSMENT_COMPLETE(9, "考核完成"),
TERMINATION_ASSESSMENT(10, "终止考核"),PERFORMANCE_ARCHIVE(11, "绩效归档");
......
......@@ -26,7 +26,6 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.timer.api.aspect.lang.annotation.Log;
......@@ -259,9 +258,10 @@ public class LoginController {
@ApiOperationSupport(order = 2)
public Result<String> authentication(@RequestBody EntRegisterDto entRegisterDto) {
String phone = entRegisterDto.getPhone();
String code = entRegisterDto.getCode().toString();
// String codeRedis = (String) redisTemplate.get(phone);
String codeRedis = BeanUtil.toBean(session.getAttribute(phone), String.class);
String codeRedis = session.getAttribute(phone) != null ? session.getAttribute(phone).toString() : "";
if (code == null || !code.equals(codeRedis)) {
return ResultUtil.error("验证码不符");
......@@ -323,7 +323,7 @@ public class LoginController {
return ResultUtil.error("新密码与原密码相同,请修改后重试!");
}
} else {
String codeRedis = BeanUtil.toBean(session.getAttribute(phone), String.class);
String codeRedis = session.getAttribute(phone) != null ? session.getAttribute(phone).toString() : "";
if (!code.equals(codeRedis)) {
return ResultUtil.error("短信验证码错误");
}
......@@ -351,7 +351,7 @@ public class LoginController {
String code = entRegisterDto.getCode();
if (entRegisterDto.getPwUpdateType() != 2) {
String codeRedis = BeanUtil.toBean(session.getAttribute(phone), String.class);
String codeRedis = session.getAttribute(phone) != null ? session.getAttribute(phone).toString() : "";
if (code == null) {
return ResultUtil.error("请填写验证码");
}
......@@ -411,7 +411,7 @@ public class LoginController {
String phone = entRegisterDto.getPhone();
String code = entRegisterDto.getCode();
// String codeRedis = redisTemplate.get(phone).toString();
String codeRedis = BeanUtil.toBean(session.getAttribute(phone), String.class);
String codeRedis = session.getAttribute(phone) != null ? session.getAttribute(phone).toString() : "";
if (code == null || !code.toString().equals(codeRedis)) {
return ResultUtil.error("验证码不符/失效");
......@@ -540,7 +540,7 @@ public class LoginController {
String code = entRegisterDto.getCode();
String phone = entRegisterDto.getPhone();
String codeRedis = BeanUtil.toBean(session.getAttribute(phone), String.class);
String codeRedis = session.getAttribute(phone) != null ? session.getAttribute(phone).toString() : "";
if (codeRedis == null || !code.equals(codeRedis))
return ResultUtil.error("验证码不符");
......
......@@ -3,6 +3,8 @@ package cn.timer.api.controller.jxgl;
import java.util.List;
import java.util.stream.Collectors;
import javax.validation.constraints.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
......@@ -13,12 +15,13 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
......@@ -30,6 +33,7 @@ import cn.timer.api.aspect.lang.annotation.Role;
import cn.timer.api.bean.jxgl.JxglAppraisal;
import cn.timer.api.bean.jxgl.JxglAppraisalAssessment;
import cn.timer.api.bean.jxgl.JxglAppraisalIndicators;
import cn.timer.api.bean.jxgl.JxglAppraisalIndicatorsAssessment;
import cn.timer.api.bean.jxgl.JxglAppraisalIndicatorsT;
import cn.timer.api.bean.jxgl.JxglAppraisalItem;
import cn.timer.api.bean.jxgl.JxglAppraisalItemT;
......@@ -39,23 +43,27 @@ import cn.timer.api.bean.jxgl.JxglBasicSetting;
import cn.timer.api.bean.jxgl.JxglPerformanceAppraisal;
import cn.timer.api.bean.jxgl.JxglPerformanceRating;
import cn.timer.api.bean.jxgl.JxglProcessNode;
import cn.timer.api.bean.qyzx.QyzxEmpEntAsso;
import cn.timer.api.bean.spmk.SpmkApproveSummary;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enuminterface.JxglEnumInterface.AppraisalLogType;
import cn.timer.api.config.enuminterface.JxglEnumInterface.AppraisalSts;
import cn.timer.api.config.enuminterface.JxglEnumInterface.AssessmentType;
import cn.timer.api.config.enuminterface.JxglEnumInterface.BeingAppraisalSts;
import cn.timer.api.config.enuminterface.JxglEnumInterface.BeingAppraisalType;
import cn.timer.api.config.enuminterface.JxglEnumInterface.ExecuteType;
import cn.timer.api.config.enuminterface.JxglEnumInterface.IndicatorsType;
import cn.timer.api.config.enuminterface.JxglEnumInterface.PerformanceAppraisalSts;
import cn.timer.api.config.enuminterface.JxglEnumInterface.ProcessNodeSts;
import cn.timer.api.config.enuminterface.JxglEnumInterface.ProcessType;
import cn.timer.api.config.enums.SysRoleType;
import cn.timer.api.config.exception.CustomException;
import cn.timer.api.config.validation.ValidList;
import cn.timer.api.controller.yggl.service.YgglService;
import cn.timer.api.controller.zzgl.service.ZzglBmgwMService;
import cn.timer.api.dao.jxgl.JxglAppraisalAssessmentMapper;
import cn.timer.api.dao.jxgl.JxglAppraisalIndicatorsAssessmentMapper;
import cn.timer.api.dao.jxgl.JxglAppraisalIndicatorsMapper;
import cn.timer.api.dao.jxgl.JxglAppraisalIndicatorsTMapper;
import cn.timer.api.dao.jxgl.JxglAppraisalItemMapper;
......@@ -69,11 +77,17 @@ import cn.timer.api.dao.jxgl.JxglPerformanceRatingMapper;
import cn.timer.api.dao.jxgl.JxglProcessNodeMapper;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.jxgl.AppraisalAssessment;
import cn.timer.api.dto.jxgl.AppraisalDetail;
import cn.timer.api.dto.jxgl.AppraisalQuery;
import cn.timer.api.dto.jxgl.AppraisalReject;
import cn.timer.api.dto.jxgl.AppraisalUpdate;
import cn.timer.api.dto.jxgl.AppraisalUpdateSts;
import cn.timer.api.dto.jxgl.BeingAppraisalPerson;
import cn.timer.api.dto.jxgl.EmpAppraisalQuery;
import cn.timer.api.dto.jxgl.EmpPerformanceQuery;
import cn.timer.api.dto.jxgl.MyPerformance;
import cn.timer.api.dto.jxgl.PerformanceAppraisal;
import cn.timer.api.dto.jxgl.PerformanceAppraisalQuery;
import cn.timer.api.dto.jxgl.ProcessNode;
......@@ -95,6 +109,9 @@ public class JxglController {
private QyzxEmpEntAssoMapper qyzxEmpEntAssoMapper;
@Autowired
private ZzglBmgwMMapper zzglBmgwMMapper;
@Autowired
private JxglBasicSettingMapper jxglBasicSettingMapper;
@Autowired
......@@ -109,6 +126,12 @@ public class JxglController {
@Autowired
private JxglAppraisalItemTMapper jsxglAppraisalItemTMapper;
@Autowired
private JxglAppraisalAssessmentMapper jxglAppraisalAssessmentMapper;
@Autowired
private JxglAppraisalIndicatorsAssessmentMapper jxglAppraisalIndicatorsAssessmentMapper;
//TODO 基础设置
/**
* 新增或编辑-基础设置
......@@ -119,15 +142,6 @@ public class JxglController {
@Role
public Result<Object> saveAtg(@CurrentUser UserBean userBean ,@Validated @RequestBody JxglBasicSetting basicSetting) throws Exception{
Integer orgCode = userBean.getOrgCode();
Integer count = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper)
.eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum())
.eq(QyzxEmpEntAsso::getOrgCode, orgCode)
.in(QyzxEmpEntAsso::getUserType, SysRoleType.U_TYPE_ADMIN.getType(),SysRoleType.U_TYPE_C_ADMIN.getType())
.count();
if (count <= 0) {
return ResultUtil.error("无权限编辑");
}
List<JxglPerformanceRating> listPr = basicSetting.getPerformanceRatings();
if (listPr != null) {
......@@ -235,11 +249,11 @@ public class JxglController {
/**
* 查询-考核模板-列表
*/
@GetMapping(value = "/selects_appraisal_t")
@ApiOperation(value = "4.查询-考核模板-列表", httpMethod = "GET", notes = "查询-考核模板-列表")
@PostMapping(value = "/selects_appraisal_t")
@ApiOperation(value = "4.查询-考核模板-列表", httpMethod = "POST", notes = "查询-考核模板-列表")
@ApiOperationSupport(order = 4)
@Role
public Result<Object> selectListAT(@CurrentUser UserBean userBean, cn.timer.api.utils.Page page){
public Result<Object> selectListAT(@CurrentUser UserBean userBean,@RequestBody cn.timer.api.utils.Page page){
IPage<JxglAppraisalT> p = new Page<JxglAppraisalT>(page.getCurrentPage(),page.getTotalPage());
......@@ -318,13 +332,14 @@ public class JxglController {
Integer orgCode = userBean.getOrgCode();
JxglPerformanceAppraisal pA = JxglPerformanceAppraisal.builder().build();
BeanUtil.copyProperties(performanceAppraisal, pA, "processNode","beingAppraisalPerson","appraisalTId");
pA.setProcessNode(ObjectUtil.serialize(performanceAppraisal.getProcessNode()));
pA.setBeingAppraisalPerson(ObjectUtil.serialize(performanceAppraisal.getBeingAppraisalPerson()));
System.out.println("新增 绩效考核 :" + pA);
List<ProcessNode> listPN = performanceAppraisal.getProcessNode();
List<BeingAppraisalPerson> listBAP = performanceAppraisal.getBeingAppraisalPerson();
pA.setOrgCode(orgCode);
pA.setProcessNode(ObjectUtil.serialize(listPN));
pA.setBeingAppraisalPerson(ObjectUtil.serialize(listBAP));
System.out.println("新增 绩效考核 :" + pA);
// 被考核人员
List<Integer> listEmpId = listBAP.stream()
......@@ -392,6 +407,20 @@ public class JxglController {
appraisal.insert();
System.out.println("新增 考核:" + appraisal);
// List<Integer> weights = listPN.stream()
// .filter(p -> ProcessType.SELF_ASSESSMENT.getType().equals(p.getProcessType()) ||
// ProcessType.SUPERIOR_SCORE.getType().equals(p.getProcessType()))
// .map(ProcessNode::getWeight)
// .collect(Collectors.toList());
// Integer weightSum = 0;
// if (weights != null && weights.size() > 0) {
// for (Integer i : weights) {
// weightSum += i;
// }
// if (!weightSum.equals(100))
// throw new CustomException("权重总和要等于 100%");
// }
listPN.stream().forEach(pN -> {
Integer executeType = pN.getExecuteType();
// 流程节点
......@@ -422,13 +451,18 @@ public class JxglController {
});
List<JxglAppraisalIndicatorsT> listAIT = jxglAppraisalIndicatorsTMapper.selectList(new QueryWrapper<JxglAppraisalIndicatorsT>().lambda()
.eq(JxglAppraisalIndicatorsT::getAppraisalTId, aT.getId()));
.eq(JxglAppraisalIndicatorsT::getAppraisalTId, aT.getId())
.ne(aT.getIsUseFixd() == 1 ,JxglAppraisalIndicatorsT::getType, IndicatorsType.FIXATION.getType())
.ne(aT.getIsUseNotFixd() == 1 ,JxglAppraisalIndicatorsT::getType, IndicatorsType.NOT_FIXATION.getType()));
if (listAIT == null || listAIT.size() <= 0) {
throw new CustomException("考核指标不存在");
}
listAIT.stream().forEach(aIT -> {
// 考核指标
BeanUtil.copyProperties(aIT, appraisalIndicators, "appraisalId", "createTime", "updateTime");
appraisalIndicators.setAppraisalId(appraisal.getId());
......@@ -474,10 +508,157 @@ public class JxglController {
}
/**
* 删除-绩效考核
*/
@DeleteMapping(value = "/delete_performance_appraisal/{id}")
@ApiOperation(value = "8.删除-绩效考核", httpMethod = "DELETE", notes = "删除-绩效考核")
@ApiOperationSupport(order = 8)
@Role
public Result<Object> deletePA(@CurrentUser UserBean userBean,@PathVariable Integer id){
JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper.selectOne(new QueryWrapper<JxglPerformanceAppraisal>().lambda()
.eq(JxglPerformanceAppraisal::getId, id)
.eq(JxglPerformanceAppraisal::getOrgCode, userBean.getOrgCode()));
if (pA == null) {
return ResultUtil.error("绩效考核不存在");
}
List<Integer> aIds = CollUtil.toList();
List<Integer> aIIds = CollUtil.toList();
List<JxglAppraisal> listA = jxglAppraisalMapper.selectList(new QueryWrapper<JxglAppraisal>().lambda()
.select(JxglAppraisal::getId)
.eq(JxglAppraisal::getPerformanceAppraisalId, pA.getId()));
aIds = listA != null && listA.size() > 0 ? listA.stream().map(JxglAppraisal::getId).collect(Collectors.toList()) : aIds;
// 删除 绩效考核
jxglPerformanceAppraisalMapper.deleteById(id);
if (aIds.size() > 0) {
// 批量删除 考核
jxglAppraisalMapper.deleteBatchIds(aIds);
// 批量删除 流程节点
jxglProcessNodeMapper.delete(new QueryWrapper<JxglProcessNode>().lambda()
.eq(aIds.size() == 1, JxglProcessNode::getAppraisalId, aIds)
.in(aIds.size() > 1, JxglProcessNode::getAppraisalId, aIds));
// 批量删除 考核评定
jxglAppraisalAssessmentMapper.delete(new QueryWrapper<JxglAppraisalAssessment>().lambda()
.eq(aIds.size() == 1, JxglAppraisalAssessment::getAppraisalId, aIds)
.in(aIds.size() > 1, JxglAppraisalAssessment::getAppraisalId, aIds));
// 批量删除 考核记录
jxglAppraisalLogMapper.delete(new QueryWrapper<JxglAppraisalLog>().lambda()
.eq(aIds.size() == 1, JxglAppraisalLog::getAppraisalId, aIds)
.in(aIds.size() > 1, JxglAppraisalLog::getAppraisalId, aIds));
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda()
.select(JxglAppraisalIndicators::getId)
.eq(aIds.size() == 1, JxglAppraisalIndicators::getAppraisalId, aIds)
.in(aIds.size() > 1, JxglAppraisalIndicators::getAppraisalId, aIds));
aIIds = listAI != null && listAI.size() > 0 ? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList()) : aIIds;
if (aIIds.size() > 0) {
jxglAppraisalIndicatorsMapper.deleteBatchIds(aIIds);
// 批量删除 考核指标评定
jxglAppraisalIndicatorsAssessmentMapper.delete(new QueryWrapper<JxglAppraisalIndicatorsAssessment>().lambda()
.eq(aIds.size() == 1, JxglAppraisalIndicatorsAssessment::getAppraisalIndicatorsId, aIIds)
.in(aIds.size() > 1, JxglAppraisalIndicatorsAssessment::getAppraisalIndicatorsId, aIIds));
// 批量删除 考核项
jxglAppraisalItemMapper.delete(new QueryWrapper<JxglAppraisalItem>().lambda()
.eq(aIds.size() == 1, JxglAppraisalItem::getAppraisalIndicatorsId, aIIds)
.in(aIds.size() > 1, JxglAppraisalItem::getAppraisalIndicatorsId, aIIds));
}
}
return ResultUtil.success();
}
/**
* 修改-绩效管理状态
*/
@PostMapping(value = "/update_performance_appraisal_sts")
@ApiOperation(value = "8.修改-绩效管理状态", httpMethod = "POST", notes = "修改-绩效管理状态")
@ApiOperationSupport(order = 8)
public Result<Object> updatePAS(@CurrentUser UserBean userBean,@RequestBody AppraisalUpdateSts appraisalUpdateSts){
JxglPerformanceAppraisal performanceAppraisal = jxglPerformanceAppraisalMapper.selectOne(new QueryWrapper<JxglPerformanceAppraisal>().lambda()
.eq(JxglPerformanceAppraisal::getId, appraisalUpdateSts.getId())
.eq(JxglPerformanceAppraisal::getSts, appraisalUpdateSts.getSts())
);
if (performanceAppraisal == null) {
return ResultUtil.error("绩效考核不存在");
}
if (performanceAppraisal.getSts() == PerformanceAppraisalSts.TERMINATION_ASSESSMENT.getType()) {
return ResultUtil.error("考核已终止");
}
Integer sts = null;
switch (performanceAppraisal.getSts()) {
case 0:
sts = PerformanceAppraisalSts.PERFORMANCE_SCORE.getType();
break;
case 1:
sts = PerformanceAppraisalSts.RESULT_VERIFICATION.getType();
break;
case 2:
sts = PerformanceAppraisalSts.PERFORMANCE_ARCHIVE.getType();
break;
default:
break;
}
// 修改 绩效考核状态
jxglPerformanceAppraisalMapper.updateById(JxglPerformanceAppraisal.builder()
.id(appraisalUpdateSts.getId())
.sts(sts)
.build());
jxglAppraisalMapper.update(JxglAppraisal.builder()
.performanceAppraisalId(appraisalUpdateSts.getId())
.sts(sts)
.build(), new UpdateWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getPerformanceAppraisalId, appraisalUpdateSts.getId())
.eq(JxglAppraisal::getSts, AppraisalSts.TARGET_CONFIRMED.getType())
);
return ResultUtil.success("删除-所有-绩效考核");
}
/**
* 删除-所有-绩效考核
*/
@DeleteMapping(value = "/delete_all_pa")
@ApiOperation(value = "8.删除-所有-绩效考核", httpMethod = "DELETE", notes = "删除-所有-绩效考核")
@ApiOperationSupport(order = 8)
public Result<Object> deleteAllPA(@CurrentUser UserBean userBean){
jxglPerformanceAppraisalMapper.delete(null);
jxglAppraisalMapper.delete(null);
jxglProcessNodeMapper.delete(null);
jxglAppraisalAssessmentMapper.delete(null);
jxglAppraisalLogMapper.delete(null);
jxglAppraisalIndicatorsMapper.delete(null);
jxglAppraisalIndicatorsAssessmentMapper.delete(null);
jxglAppraisalItemMapper.delete(null);
return ResultUtil.success("删除-所有-绩效考核");
}
/**
* 查询-绩效考核-列表-归档
*/
@PostMapping(value = "/selects_performance_appraisal_archive")
@ApiOperation(value = "8.查询-绩效考核-列表-非归档", httpMethod = "POST", notes = "查询-绩效考核-列表-非归档")
@ApiOperation(value = "8.查询-绩效考核-列表-归档", httpMethod = "POST", notes = "查询-绩效考核-列表-归档")
@ApiOperationSupport(order = 8)
@Role
public Result<Object> selectsPAArchive(@CurrentUser UserBean userBean,@RequestBody PerformanceAppraisalQuery query){
......@@ -498,7 +679,7 @@ public class JxglController {
* 查询-绩效考核-列表-非归档
*/
@PostMapping(value = "/selects_performance_appraisal")
@ApiOperation(value = "9.查询-绩效考核-列表-归档", httpMethod = "POST", notes = "查询-绩效考核-列表-归档")
@ApiOperation(value = "9.查询-绩效考核-列表-非归档", httpMethod = "POST", notes = "查询-绩效考核-列表-非归档")
@ApiOperationSupport(order = 9)
@Role
public Result<Object> selectsPA(@CurrentUser UserBean userBean,@RequestBody PerformanceAppraisalQuery query){
......@@ -546,6 +727,21 @@ public class JxglController {
AppraisalDetail aD = jxglAppraisalMapper.selectDetailById(userBean.getOrgCode(), id);
if (aD != null) {
JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper.selectOne(new QueryWrapper<JxglPerformanceAppraisal>().lambda()
.eq(JxglPerformanceAppraisal::getId, aD.getPerformanceAppraisalId()));
if (pA != null && pA.getIsVisible() == 0) {
return ResultUtil.data(aD);
}else {
List<JxglAppraisalAssessment> listAA = aD.getAppraisalAssessments();
if (listAA != null) {
listAA = listAA.stream().filter(a -> !userBean.getEmpNum().equals(a.getAssessorId())).collect(Collectors.toList());
aD.setAppraisalAssessments(listAA);
}
}
}
return ResultUtil.data(aD);
}
......@@ -557,18 +753,36 @@ public class JxglController {
@ApiOperation(value = "12.修改-流程执行人-转派", httpMethod = "PUT", notes = "修改-流程执行人-转派")
@ApiOperationSupport(order = 12)
@Role
public Result<Object> updatePN(@CurrentUser UserBean userBean,@RequestBody ProcessNodeUpdate processNodeUpdate){
public Result<Object> updatePN(@CurrentUser UserBean userBean,@Validated @RequestBody ProcessNodeUpdate processNodeUpdate){
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, processNodeUpdate.getAppraisalId())
.select(JxglAppraisal::getId));
if (appraisal == null) {
return ResultUtil.error("考核 不存在");
}
Integer count = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, processNodeUpdate.getAppraisalId())
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) {
if (count > 0) {
return ResultUtil.error("考核已结束");
}
count = jxglProcessNodeMapper.selectCount(new QueryWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, processNodeUpdate.getAppraisalId())
.ne(JxglProcessNode::getSts, ProcessNodeSts.EXECUTED.getType()));
if (count <= 0) {
return ResultUtil.error("流程已执行,无法更改");
}
JxglProcessNode pN = JxglProcessNode.builder().build();
BeanUtil.copyProperties(processNodeUpdate, pN);
......@@ -584,10 +798,21 @@ public class JxglController {
@ApiOperation(value = "13.终止-考核", httpMethod = "PUT", notes = "终止-考核")
@ApiOperationSupport(order = 13)
@Role
public Result<Object> terminationAssessment(@CurrentUser UserBean userBean,@PathVariable Integer id){
JxglAppraisal.builder().id(id).sts(AppraisalSts.TERMINATION_ASSESSMENT.getType()).build().updateById();
public Result<Object> terminationAssessment(@CurrentUser UserBean userBean,@NotNull @RequestParam Integer id){
JxglAppraisal appraisal = jxglAppraisalMapper.selectById(id);
if (appraisal == null) {
return ResultUtil.error("考核 不存在");
}else if (appraisal.getSts() <= AppraisalSts.RESULT_VERIFICATION.getType() ) {
JxglAppraisal.builder().id(id).sts(AppraisalSts.TERMINATION_ASSESSMENT.getType()).build().updateById();
}else if (appraisal.getSts() == AppraisalSts.ASSESSMENT_COMPLETE.getType()) {
return ResultUtil.error("考核已完成,无法终止");
}else if (appraisal.getSts() == AppraisalSts.TERMINATION_ASSESSMENT.getType()) {
return ResultUtil.error("考核已终止,无法重复终止");
}else if (appraisal.getSts() == AppraisalSts.PERFORMANCE_ARCHIVE.getType()) {
return ResultUtil.error("考核已归档,无法终止");
}
return ResultUtil.success();
}
......@@ -701,5 +926,840 @@ public class JxglController {
}
/**
* 查询-我的绩效-列表
*/
@PostMapping(value = "/selects_my_performance")
@ApiOperation(value = "17.查询-我的绩效-列表", httpMethod = "POST", notes = "查询-我的绩效-列表")
@ApiOperationSupport(order = 17)
public Result<Object> selects(@CurrentUser UserBean userBean,@RequestBody MyPerformance query){
IPage<JxglPerformanceAppraisal> page = new Page<JxglPerformanceAppraisal>(query.getCurrentPage(),query.getTotalPage());
query.setOrgCode(userBean.getOrgCode());
query.setId(userBean.getEmpNum());
IPage<JxglPerformanceAppraisal> pagePA = jxglPerformanceAppraisalMapper.selectMyByQuery(page, query);
List<JxglPerformanceAppraisal> listPA = pagePA.getRecords();
return ResultUtil.data(pagePA,listPA);
}
@Autowired
private JxglProcessNodeMapper jxglProcessNodeMapper;
@Autowired
private JxglAppraisalItemMapper jxglAppraisalItemMapper;
/**
* 目标填写-保存
*/
@PostMapping(value = "/save_target_fill")
@ApiOperation(value = "17.目标填写-保存", httpMethod = "POST", notes = "目标填写-保存")
@ApiOperationSupport(order = 17)
public Result<Object> saveTF(@CurrentUser UserBean userBean,@RequestBody AppraisalUpdate appraisalUpdate) throws Exception{
Integer id = appraisalUpdate.getId();
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id)
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) {
return ResultUtil.error("考核已结束");
}
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id)
.select(JxglAppraisal::getId));
if (appraisal == null) {
return ResultUtil.error("考核 不存在");
}
List<JxglAppraisalIndicators> listAI2 = appraisalUpdate.getAppraisalIndicators();
if (listAI2 == null) {
return ResultUtil.error("考核指标不能为空");
}
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) {
return ResultUtil.error("流程不存在");
}
if (ProcessType.TARGET_FILL_IN.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程");
}
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda()
.eq(JxglAppraisalIndicators::getAppraisalId, appraisal.getId()));
if (listAI == null) {
return ResultUtil.error("考核指标不能为空");
}
List<Integer> listWeight = listAI.stream().map(JxglAppraisalIndicators::getWeight).collect(Collectors.toList());
Integer weightSum = 0;
if (listWeight != null && listWeight.size() > 0) {
for (Integer i : listWeight) {
weightSum += i;
}
if (!weightSum.equals(100))
return ResultUtil.error("权重总和要等于 100%");
}
}else {
return ResultUtil.error("流程状态异常");
}
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda()
.select(JxglAppraisalIndicators::getId)
.eq(JxglAppraisalIndicators::getAppraisalId, id));
List<Integer> appraisalIndicatorIds = listAI != null ? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList()) : null;
// 删除 考核项
jxglAppraisalItemMapper.delete(new QueryWrapper<JxglAppraisalItem>().lambda()
.in(JxglAppraisalItem::getAppraisalIndicatorsId, appraisalIndicatorIds));
// 删除 考核指标
jxglAppraisalIndicatorsMapper.delete(new QueryWrapper<JxglAppraisalIndicators>().lambda()
.eq(JxglAppraisalIndicators::getAppraisalId, id));
listAI2.forEach(aI -> {
if (aI.insert()) {
List<JxglAppraisalItem> listAItem = aI.getAppraisalItems();
if (listAItem != null && listAItem.size() > 0) {
for (JxglAppraisalItem aItem : listAItem) {
aItem.setAppraisalIndicatorsId(aI.getId());
aItem.insert();
}
}
}else {
throw new CustomException("保存异常");
}
});
return ResultUtil.success();
}
/**
* 目标填写-提交
*/
@PostMapping(value = "/submit_target_fill")
@ApiOperation(value = "17.目标填写-提交", httpMethod = "POST", notes = "目标填写-提交")
@ApiOperationSupport(order = 17)
public Result<Object> submitTF(@CurrentUser UserBean userBean,@RequestParam Integer id){
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id)
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) {
return ResultUtil.error("考核已结束");
}
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id)
.select(JxglAppraisal::getId));
if (appraisal == null) {
return ResultUtil.error("考核不存在");
}
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) {
return ResultUtil.error("流程不存在");
}
if (ProcessType.TARGET_FILL_IN.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程");
}
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda()
.eq(JxglAppraisalIndicators::getAppraisalId, appraisal.getId()));
if (listAI == null) {
return ResultUtil.error("考核指标不能为空");
}
List<Integer> listWeight = listAI.stream().map(JxglAppraisalIndicators::getWeight).collect(Collectors.toList());
Integer weightSum = 0;
if (listWeight != null && listWeight.size() > 0) {
for (Integer i : listWeight) {
weightSum += i;
}
if (!weightSum.equals(100))
return ResultUtil.error("权重总和要等于 100%");
}
// 修改 目标填写 状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.EXECUTED.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
// 修改 下一个节点状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.IN_EXECUTION.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getProcessType, ProcessType.TARGET_CONFIRMED.getType()));
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(id).sts(AppraisalSts.TARGET_CONFIRMED.getType()).build());
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setAppraisalId(appraisal.getId());
appraisalLog.setExecutorId(userBean.getEmpNum());
appraisalLog.setExecutorName(userBean.getUserInfo().getName());
appraisalLog.setType(AppraisalLogType.TARGET_FILL_IN.getType());
appraisalLog.insert();
}else {
return ResultUtil.error("流程状态异常");
}
return ResultUtil.success();
}
/**
* 目标确认-同意
*/
@PostMapping(value = "/update_target_confirmed")
@ApiOperation(value = "18.目标确认-同意", httpMethod = "POST", notes = "目标确认-同意")
@ApiOperationSupport(order = 18)
public Result<Object> updateTC(@CurrentUser UserBean userBean,@RequestParam Integer id){
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id)
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) {
return ResultUtil.error("考核已结束");
}
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id)
.select(JxglAppraisal::getId));
if (appraisal == null) {
return ResultUtil.error("考核 不存在");
}
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) {
return ResultUtil.error("流程不存在");
}
if (ProcessType.TARGET_CONFIRMED.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程");
}
// 修改 目标确认 状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.EXECUTED.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper.selectById(appraisal.getPerformanceAppraisalId());
if (pA != null && pA.getSts() > PerformanceAppraisalSts.TARGET_SETING.getType()) {
// 修改 下一个节点状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.IN_EXECUTION.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getProcessType, ProcessType.SELF_ASSESSMENT.getType()));
}
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(id).sts(AppraisalSts.TARGET_CONFIRMED.getType()).build());
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setAppraisalId(appraisal.getId());
appraisalLog.setExecutorId(userBean.getEmpNum());
appraisalLog.setExecutorName(userBean.getUserInfo().getName());
appraisalLog.setType(AppraisalLogType.TARGET_CONFIRMED.getType());
appraisalLog.insert();
}else {
return ResultUtil.error("流程状态异常");
}
return ResultUtil.success();
}
/**
* 目标确认-驳回目标
*/
@PostMapping(value = "/update_target_confirmed_reject")
@ApiOperation(value = "18.目标确认-驳回目标", httpMethod = "POST", notes = "目标确认-驳回目标")
@ApiOperationSupport(order = 18)
public Result<Object> updateTCR(@CurrentUser UserBean userBean, @RequestBody AppraisalReject appraisalReject){
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalReject.getId())
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) {
return ResultUtil.error("考核已结束");
}
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalReject.getId())
.select(JxglAppraisal::getId));
if (appraisal == null) {
return ResultUtil.error("考核 不存在");
}
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) {
return ResultUtil.error("流程不存在");
}
if (ProcessType.TARGET_CONFIRMED.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程");
}
// 修改 目标确认 状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.NON_EXECUTION.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
// 修改 下一个节点状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.IN_EXECUTION.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getProcessType, ProcessType.TARGET_FILL_IN.getType()));
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.TARGET_FILL_IN.getType()).build());
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setRemarks(appraisalReject.getRejectReason());
appraisalLog.setAppraisalId(appraisal.getId());
appraisalLog.setExecutorId(userBean.getEmpNum());
appraisalLog.setExecutorName(userBean.getUserInfo().getName());
appraisalLog.setType(AppraisalLogType.TARGET_DISMISS.getType());
appraisalLog.insert();
}else {
return ResultUtil.error("流程状态异常");
}
return ResultUtil.success();
}
/**
* 上级评价 -驳回目标
*/
@PostMapping(value = "/update_superior_score_reject")
@ApiOperation(value = "19.上级评价 -驳回目标", httpMethod = "POST", notes = "上级评价 -驳回目标")
@ApiOperationSupport(order = 19)
public Result<Object> updateSSR(@CurrentUser UserBean userBean, @RequestBody AppraisalReject appraisalReject){
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalReject.getId())
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) {
return ResultUtil.error("考核已结束");
}
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalReject.getId())
.select(JxglAppraisal::getId));
if (appraisal == null) {
return ResultUtil.error("考核 不存在");
}
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) {
return ResultUtil.error("流程不存在");
}
if (ProcessType.SUPERIOR_SCORE.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程");
}
// 修改 目标确认 状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.NON_EXECUTION.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
// 修改 下一个节点状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.IN_EXECUTION.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getProcessType, ProcessType.TARGET_CONFIRMED.getType()));
// 删除 考核评定-自评
jxglAppraisalAssessmentMapper.delete(new QueryWrapper<JxglAppraisalAssessment>().lambda()
.eq(JxglAppraisalAssessment::getAppraisalId, appraisal.getId())
.eq(JxglAppraisalAssessment::getType, AssessmentType.SELF_ASSESSMENT.getType()));
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda()
.select(JxglAppraisalIndicators::getId)
.eq(JxglAppraisalIndicators::getAppraisalId, appraisal.getId()));
List<Integer> listAIId = listAI != null && listAI.size() > 0 ? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList()) : null;
// 删除 考核指标评定-自评
jxglAppraisalIndicatorsAssessmentMapper.delete(new QueryWrapper<JxglAppraisalIndicatorsAssessment>().lambda()
.in(JxglAppraisalIndicatorsAssessment::getAppraisalIndicatorsId, listAIId)
.eq(JxglAppraisalIndicatorsAssessment::getType, AssessmentType.SELF_ASSESSMENT.getType()));
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.TARGET_FILL_IN.getType()).build());
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setRemarks(appraisalReject.getRejectReason());
appraisalLog.setAppraisalId(appraisal.getId());
appraisalLog.setExecutorId(userBean.getEmpNum());
appraisalLog.setExecutorName(userBean.getUserInfo().getName());
appraisalLog.setType(AppraisalLogType.TARGET_DISMISS.getType());
appraisalLog.insert();
}else {
return ResultUtil.error("流程状态异常");
}
return ResultUtil.success();
}
/**
* 上级评价 -驳回评分
*/
@PostMapping(value = "/update_superior_reject_score")
@ApiOperation(value = "20.上级评价 -驳回评分", httpMethod = "POST", notes = "上级评价 -驳回评分")
@ApiOperationSupport(order = 20)
public Result<Object> updateSRS(@CurrentUser UserBean userBean, @RequestBody AppraisalReject appraisalReject){
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalReject.getId())
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) {
return ResultUtil.error("考核已结束");
}
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalReject.getId())
.select(JxglAppraisal::getId));
if (appraisal == null) {
return ResultUtil.error("考核 不存在");
}
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) {
return ResultUtil.error("流程不存在");
}
if (ProcessType.SUPERIOR_SCORE.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程");
}
// 修改 状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.NON_EXECUTION.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
// 修改 上一个节点状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.IN_EXECUTION.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getProcessType, ProcessType.SELF_ASSESSMENT.getType()));
// 删除 考核评定-自评
jxglAppraisalAssessmentMapper.delete(new QueryWrapper<JxglAppraisalAssessment>().lambda()
.eq(JxglAppraisalAssessment::getAppraisalId, appraisal.getId())
.eq(JxglAppraisalAssessment::getType, AssessmentType.SELF_ASSESSMENT.getType()));
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda()
.select(JxglAppraisalIndicators::getId)
.eq(JxglAppraisalIndicators::getAppraisalId, appraisal.getId()));
List<Integer> listAIId = listAI != null && listAI.size() > 0 ? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList()) : null;
// 删除 考核指标评定-自评
jxglAppraisalIndicatorsAssessmentMapper.delete(new QueryWrapper<JxglAppraisalIndicatorsAssessment>().lambda()
.in(JxglAppraisalIndicatorsAssessment::getAppraisalIndicatorsId, listAIId)
.eq(JxglAppraisalIndicatorsAssessment::getType, AssessmentType.SELF_ASSESSMENT.getType()));
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.SELF_ASSESSMENT.getType()).build());
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setRemarks(appraisalReject.getRejectReason());
appraisalLog.setAppraisalId(appraisal.getId());
appraisalLog.setExecutorId(userBean.getEmpNum());
appraisalLog.setExecutorName(userBean.getUserInfo().getName());
appraisalLog.setType(AppraisalLogType.SCORE_DISMISS.getType());
appraisalLog.insert();
}else {
return ResultUtil.error("流程状态异常");
}
return ResultUtil.success();
}
/**
* 评分提交-(缺-评分最大分数限制)
*/
@PostMapping(value = "/save_score")
@ApiOperation(value = "22.评分提交", httpMethod = "POST", notes = "评分提交")
@ApiOperationSupport(order = 22)
public Result<Object> saveScore(@CurrentUser UserBean userBean,@Validated @RequestBody ValidList<AppraisalAssessment> appraisalAssessments){
Integer appraisalId = appraisalAssessments.get(0).getAppraisalId();
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalId)
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) {
return ResultUtil.error("考核已结束");
}
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalId)
.select(JxglAppraisal::getId));
if (appraisal == null) {
return ResultUtil.error("考核 不存在");
}
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) {
return ResultUtil.error("流程不存在");
}
if (ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType() ||
ProcessType.SUPERIOR_SCORE.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程");
}
appraisalAssessments.stream().forEach(a -> {
Integer type = ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType() ? AssessmentType.SELF_ASSESSMENT.getType() : AssessmentType.SUPERIOR_SCORE.getType();
if (a.getAppraisalIndicatorsId() != null) {
JxglAppraisalIndicatorsAssessment.builder()
.appraisalIndicatorsId(a.getAppraisalIndicatorsId())
.assessorId(userBean.getEmpNum())
.assessorName(userBean.getUserInfo().getName())
.score(a.getScore())
.remarks(a.getRemarks())
.type(type)
.build()
.insert();
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.SUPERIOR_SCORE.getType()).build());
}else {
JxglAppraisalAssessment.builder()
.appraisalId(a.getAppraisalId())
.assessorId(userBean.getEmpNum())
.assessorName(userBean.getUserInfo().getName())
.comprehensiveScore(a.getScore())
.remarks(a.getRemarks())
.type(type)
.level(a.getLevel())
.build()
.insert();
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.RESULT_VERIFICATION.getType()).build());
}
});
// 修改 状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.NON_EXECUTION.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper.selectById(appraisal.getPerformanceAppraisalId());
if (pA != null && pA.getSts() > PerformanceAppraisalSts.PERFORMANCE_SCORE.getType()) {
// 修改 下一个节点状态
// 修改 下一个节点状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.IN_EXECUTION.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(ProcessType.SUPERIOR_SCORE.getType() == processNode.getProcessType(), JxglProcessNode::getProcessType, ProcessType.RESULT_VERIFICATION.getType())
.eq(ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType(), JxglProcessNode::getProcessType, ProcessType.SUPERIOR_SCORE.getType()));
}
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setAppraisalId(appraisal.getId());
appraisalLog.setExecutorId(userBean.getEmpNum());
appraisalLog.setExecutorName(userBean.getUserInfo().getName());
appraisalLog.setType(ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType() ? AppraisalLogType.SELF_ASSESSMENT.getType() : AppraisalLogType.SUPERIOR_SCORE.getType());
appraisalLog.insert();
}else {
return ResultUtil.error("流程状态异常");
}
return ResultUtil.success();
}
/**
* 结果确认-确认
*/
@PostMapping(value = "/result_verification")
@ApiOperation(value = "23.结果确认-确认", httpMethod = "POST", notes = "结果确认-确认")
@ApiOperationSupport(order = 23)
public Result<Object> resultVerification(@CurrentUser UserBean userBean,@RequestParam Integer id){
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id)
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) {
return ResultUtil.error("考核已结束");
}
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id)
.select(JxglAppraisal::getId));
if (appraisal == null) {
return ResultUtil.error("考核 不存在");
}
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) {
return ResultUtil.error("流程不存在");
}
if (ProcessType.RESULT_VERIFICATION.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程");
}
// 修改 状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.NON_EXECUTION.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper.selectById(appraisal.getPerformanceAppraisalId());
if (pA != null && pA.getSts() > PerformanceAppraisalSts.RESULT_VERIFICATION.getType()) {
// 修改 下一个节点状态
jxglAppraisalMapper.updateById(JxglAppraisal.builder()
.id(id)
.sts(AppraisalSts.ASSESSMENT_COMPLETE.getType()).build());
}
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setAppraisalId(appraisal.getId());
appraisalLog.setExecutorId(userBean.getEmpNum());
appraisalLog.setExecutorName(userBean.getUserInfo().getName());
appraisalLog.setType(AppraisalLogType.RESULT_VERIFICATION.getType());
appraisalLog.insert();
}else {
return ResultUtil.error("流程状态异常");
}
return ResultUtil.success();
}
/**
* 结果确认-改分
*/
@PostMapping(value = "/change_score")
@ApiOperation(value = "24.结果确认-改分", httpMethod = "POST", notes = "结果确认-改分")
@ApiOperationSupport(order = 24)
public Result<Object> changeScore(@CurrentUser UserBean userBean,@Validated @RequestBody AppraisalAssessment appraisalAssessment){
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalAssessment.getAppraisalId())
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) {
return ResultUtil.error("考核已结束");
}
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalAssessment.getAppraisalId())
.select(JxglAppraisal::getId));
if (appraisal == null) {
return ResultUtil.error("考核 不存在");
}
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) {
return ResultUtil.error("流程不存在");
}
if (ProcessType.RESULT_VERIFICATION.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程");
}
JxglAppraisalAssessment.builder()
.id(appraisalAssessment.getAppraisalAssessmentId())
.comprehensiveScore(appraisalAssessment.getScore())
.level(appraisalAssessment.getLevel())
.build()
.updateById();
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setRemarks(appraisalAssessment.getRemarks());
appraisalLog.setAppraisalId(appraisal.getId());
appraisalLog.setExecutorId(userBean.getEmpNum());
appraisalLog.setExecutorName(userBean.getUserInfo().getName());
appraisalLog.setType(AppraisalLogType.UPDATE_SCORE.getType());
appraisalLog.insert();
}else {
return ResultUtil.error("流程状态异常");
}
return ResultUtil.success();
}
/**
* 查询-我的绩效-员工绩效
*/
@PostMapping(value = "/selects_my_emp_performance")
@ApiOperation(value = "25.查询-我的绩效-员工绩效", httpMethod = "POST", notes = "查询-我的绩效-员工绩效")
@ApiOperationSupport(order = 25)
@Role
public Result<Object> selectsMEP(@CurrentUser UserBean userBean,@RequestBody EmpPerformanceQuery query){
Integer orgCode = userBean.getOrgCode();
Integer empNum = userBean.getEmpNum();
IPage<JxglAppraisal> page = new Page<JxglAppraisal>(query.getCurrentPage(),query.getTotalPage());
query.setOrgCode(orgCode);
List<ZzglBmgwM> listBM = zzglBmgwMMapper.selectList(new QueryWrapper<ZzglBmgwM>().lambda()
.select(ZzglBmgwM::getId)
.eq(ZzglBmgwM::getOrgCode, userBean.getOrgCode())
.eq(ZzglBmgwM::getLeader, empNum));
ZzglBmgwM ZzglBmgwM = CollUtil.getFirst(listBM);
if (ZzglBmgwM == null) {
return ResultUtil.success();
}
List<YgglMainEmp> users = zzglBmgwMService.selectOtherlistent(orgCode, ZzglBmgwM.getId());
List<Integer> empNums = null;
if (users != null ) {
empNums = users.stream().map(YgglMainEmp::getEmpNum).collect(Collectors.toList());
}
query.setEmpNums(empNums);
IPage<JxglAppraisal> pageA = jxglAppraisalMapper.selectMyEmpByQuery(page, query);
List<JxglAppraisal> listA = pageA.getRecords();
return ResultUtil.data(pageA,listA);
}
}
......@@ -462,7 +462,7 @@ public class SpmkController {
@ApiOperationSupport(order = 17)
@Transactional(rollbackFor = Exception.class)
@Log(title = "审批-发起审批", businessType = BusinessType.INSERT)
public Result<Object> saveCa(@CurrentUser UserBean userBean,@Validated @RequestBody SpmkApproveSummaryDto spmkApproveSummaryDto) throws Exception{
public Result<Object> saveA(@CurrentUser UserBean userBean,@Validated @RequestBody SpmkApproveSummaryDto spmkApproveSummaryDto) throws Exception{
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>()
.lambda()
.select(YgglMainEmp::getHeadUrl,YgglMainEmp::getName)
......@@ -540,7 +540,7 @@ public class SpmkController {
summaryQueryDto.setOrgCode(userBean.getOrgCode());
Integer deptId = summaryQueryDto.getDeptId();
List<YgglMainEmp> listYgglMainEmp = RouterUtils.selectOtherlistent(userBean.getOrgCode(), deptId);
List<YgglMainEmp> listYgglMainEmp = zzglBmgwMService.selectOtherlistent(userBean.getOrgCode(), deptId);
if (deptId != null && (listYgglMainEmp == null || listYgglMainEmp.size() == 0)) {
return ResultUtil.data(new ArrayList<SpmkApproveSummary>());
......@@ -663,7 +663,7 @@ public class SpmkController {
return ResultUtil.success();
}
//TODO 我审批的/抄送我的
//TODO 我发起的/我审批的/抄送我的
/**
* 查询列表-我发起的/我审批的/抄送我的-分页
*/
......
......@@ -299,6 +299,14 @@ public class ZzglController {
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build();
zzglLogDgjlMapper.insertbyaddemp(empNums, userBean.getEmpNum(), dpetId, userBean.getOrgCode(),
dpetId == null || dpetId == 0 ? "岗位删除员工" : upEmpDeptDto.getIsdg() == null ? "岗位添加员工" : "员工调岗");
// 清楚 leader 主管标记
if ((dpetId == null || dpetId == 0) || upEmpDeptDto.getIsdg() == null) {
ZzglBmgwM.builder().leader(null).build()
.update(new UpdateWrapper<ZzglBmgwM>().lambda()
.eq(ZzglBmgwM::getOrgCode, userBean.getOrgCode())
.in(ZzglBmgwM::getLeader, empNums));
}
ygglMainEmp.update(new UpdateWrapper<YgglMainEmp>().lambda()
.set(YgglMainEmp::getBmgwId, dpetId)
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).in(YgglMainEmp::getEmpNum, empNums));
......@@ -306,21 +314,6 @@ public class ZzglController {
return ResultUtil.success();
}
//修改/删除员工部门(供审批管理使用)
public void updatelistempdeptforspgl (Integer empNum,Integer orgCode, UpEmpDeptDto upEmpDeptDto) {
Integer dpetId = upEmpDeptDto.getDpetId();
List<Integer> empNums = new ArrayList<Integer>();
empNums.add(empNum);
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build();
zzglLogDgjlMapper.insertbyaddemp(empNums, empNum, dpetId, orgCode,
dpetId == null || dpetId == 0 ? "岗位删除员工" : upEmpDeptDto.getIsdg() == null ? "岗位添加员工" : "员工调岗");
ygglMainEmp.update(new UpdateWrapper<YgglMainEmp>().lambda()
.set(YgglMainEmp::getBmgwId, dpetId)
.eq(YgglMainEmp::getOrgCode, orgCode)
.in(YgglMainEmp::getEmpNum, empNum));
}
/**
* 岗位权限
*
......
......@@ -44,7 +44,9 @@ public class ZzglBmgwMServiceImpl implements ZzglBmgwMService {
@Autowired
private ZzglLogDgjlMapper zzglLogDgjlMapper;
//根据传来的empNum获取该人员的岗位,以及上面所有的部门id,返回integer数组
/**
* 根据 员工 的 岗位,以及上面所有的部门id,返回integer数组
*/
@Override
public List<Integer> empNumupGetDepts(Integer orgCode,Integer empNum) {
Set<Integer> lanzi = new HashSet<Integer>();
......
......@@ -23,4 +23,6 @@ public interface JxglAppraisalMapper extends BaseMapper<JxglAppraisal> {
IPage<JxglAppraisal> selectListEmpByQuery(IPage<JxglAppraisal> page,@Param("param") EmpPerformanceQuery query);
IPage<JxglAppraisal> selectMyEmpByQuery(IPage<JxglAppraisal> page,@Param("param") EmpPerformanceQuery query);
}
......@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.timer.api.bean.jxgl.JxglPerformanceAppraisal;
import cn.timer.api.bean.spmk.SpmkApproveSummary;
import cn.timer.api.dto.jxgl.EmpAppraisalQuery;
import cn.timer.api.dto.jxgl.MyPerformance;
import cn.timer.api.dto.jxgl.PerformanceAppraisalQuery;
/**
......@@ -26,6 +27,8 @@ public interface JxglPerformanceAppraisalMapper extends BaseMapper<JxglPerforman
IPage<JxglPerformanceAppraisal> selectArchiveListByQuery(IPage<SpmkApproveSummary> page,@Param("param")
PerformanceAppraisalQuery query);
IPage<JxglPerformanceAppraisal> selectMyByQuery(IPage<JxglPerformanceAppraisal> page,@Param("param") MyPerformance query);
}
package cn.timer.api.dto.jxgl;
import java.io.Serializable;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AppraisalAssessment implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "考核id", example = "1")
private Integer appraisalId;
@ApiModelProperty(value = "考核指标id", example = "1")
private Integer appraisalIndicatorsId;
@ApiModelProperty(value = "考核评定id", example = "1")
private Integer appraisalAssessmentId;
@ApiModelProperty(value = "评分", example = "86")
private String score;
@ApiModelProperty(value = "评语/备注", example = "评语/备注")
private String remarks;
@ApiModelProperty(value = "等级", example = "A")
private String level;
}
......@@ -62,6 +62,8 @@ public class AppraisalDetail implements Serializable{
@ApiModelProperty(value = "状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7归档", example = "0")
private Integer sts;
private String appraisalName;
private List<JxglProcessNode> processNodes;
private List<JxglAppraisalAssessment> appraisalAssessments;
......
package cn.timer.api.dto.jxgl;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AppraisalReject {
@ApiModelProperty(value = "考核id", example = "")
private Integer id;
@ApiModelProperty(value = "驳回原因", example = "")
private String rejectReason;
}
package cn.timer.api.dto.jxgl;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.annotation.TableField;
import cn.timer.api.bean.jxgl.JxglAppraisal;
import cn.timer.api.bean.jxgl.JxglAppraisalIndicators;
import cn.timer.api.bean.jxgl.JxglAppraisalItem;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AppraisalUpdate implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "考核id", example = "16")
private Integer id;
@TableField(exist = false)
private List<JxglAppraisalIndicators> appraisalIndicators;
}
package cn.timer.api.dto.jxgl;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AppraisalUpdateSts {
@ApiModelProperty(value = "绩效考核id", example = "")
private Integer id;
@ApiModelProperty(value = "状态", example = "")
private Integer sts;
}
package cn.timer.api.dto.jxgl;
import java.util.List;
import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg;
......@@ -28,5 +30,10 @@ public class EmpPerformanceQuery extends Page {
@ApiModelProperty(value = "部门id", example = "")
private Integer bmId;
@ApiModelProperty(value = "员工id", example = "")
private List<Integer> empNums;
}
package cn.timer.api.dto.jxgl;
import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg;
import cn.timer.api.utils.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MyPerformance extends Page {
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "员工id", example = "")
private Integer id;
@ApiModelProperty(value = "企业id", example = "")
private Integer orgCode;
@ApiModelProperty(value = "状态 0目标填写 1目标确认 2评分 3 结果确认", example = "")
private Integer sts;
}
package cn.timer.api.utils;
import lombok.Data;
/**
* 分页查询工具类
*
* @author Administrator
*
*/
public class Page {
//当前页
/**
* 当前页
*/
private Integer currentPage;
//当前页总条数
private Integer totalPage;
/**
* 每页总条数
*/
private Integer totalPage;
public Integer getCurrentPage() {
return currentPage == null || currentPage <= 0 ? 1 : currentPage;
}
public void setCurrentPage(Integer currentPage) {
this.currentPage = currentPage;
}
public Integer getTotalPage() {
return totalPage == null || totalPage <= 0 ? 10 : totalPage;
}
public void setTotalPage(Integer totalPage) {
this.totalPage = totalPage;
}
}
......@@ -8,8 +8,6 @@
<result column="appraisal_id" property="appraisalId" />
<result column="title" property="title" />
<result column="weight" property="weight" />
<result column="is_edit" property="isEdit" />
<result column="is_set_weight" property="isSetWeight" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="type" property="type" />
......@@ -20,8 +18,6 @@
appraisal_id,
title,
weight,
is_edit,
is_set_weight,
create_time,
update_time,
type
......@@ -32,8 +28,6 @@
appraisal_id JxglAppraisalIndicators_appraisal_id,
title JxglAppraisalIndicators_title,
weight JxglAppraisalIndicators_weight,
is_edit JxglAppraisalIndicators_is_edit,
is_set_weight JxglAppraisalIndicators_is_set_weight,
create_time JxglAppraisalIndicators_create_time,
update_time JxglAppraisalIndicators_update_time,
type JxglAppraisalIndicators_type
......@@ -53,12 +47,6 @@
<if test ='null != weight'>
weight,
</if>
<if test ='null != isEdit'>
is_edit,
</if>
<if test ='null != isSetWeight'>
is_set_weight,
</if>
<if test ='null != createTime'>
create_time,
</if>
......@@ -79,12 +67,6 @@
<if test ='null != weight'>
#{weight},
</if>
<if test ='null != isEdit'>
#{isEdit},
</if>
<if test ='null != isSetWeight'>
#{isSetWeight},
</if>
<if test ='null != createTime'>
#{createTime},
</if>
......@@ -108,8 +90,6 @@
<if test ='null != appraisalId'>appraisal_id = #{appraisalId},</if>
<if test ='null != title'>title = #{title},</if>
<if test ='null != weight'>weight = #{weight},</if>
<if test ='null != isEdit'>is_edit = #{isEdit},</if>
<if test ='null != isSetWeight'>is_set_weight = #{isSetWeight},</if>
<if test ='null != createTime'>create_time = #{createTime},</if>
<if test ='null != updateTime'>update_time = #{updateTime},</if>
<if test ='null != type'>type = #{type}</if>
......
......@@ -8,8 +8,6 @@
<result column="appraisal_t_id" property="appraisalTId" />
<result column="title" property="title" />
<result column="weight" property="weight" />
<result column="is_edit" property="isEdit" />
<result column="is_set_weight" property="isSetWeight" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="type" property="type" />
......@@ -20,8 +18,6 @@
appraisal_t_id,
title,
weight,
is_edit,
is_set_weight,
create_time,
update_time,
type
......@@ -32,8 +28,6 @@
appraisal_t_id JxglAppraisalIndicatorsT_appraisal_t_id,
title JxglAppraisalIndicatorsT_title,
weight JxglAppraisalIndicatorsT_weight,
is_edit JxglAppraisalIndicatorsT_is_edit,
is_set_weight JxglAppraisalIndicatorsT_is_set_weight,
create_time JxglAppraisalIndicatorsT_create_time,
update_time JxglAppraisalIndicatorsT_update_time,
type JxglAppraisalIndicatorsT_type
......@@ -53,12 +47,6 @@
<if test ='null != weight'>
weight,
</if>
<if test ='null != isEdit'>
is_edit,
</if>
<if test ='null != isSetWeight'>
is_set_weight,
</if>
<if test ='null != createTime'>
create_time,
</if>
......@@ -79,12 +67,6 @@
<if test ='null != weight'>
#{weight},
</if>
<if test ='null != isEdit'>
#{isEdit},
</if>
<if test ='null != isSetWeight'>
#{isSetWeight},
</if>
<if test ='null != createTime'>
#{createTime},
</if>
......@@ -108,8 +90,6 @@
<if test ='null != appraisalTId'>appraisal_t_id = #{appraisalTId},</if>
<if test ='null != title'>title = #{title},</if>
<if test ='null != weight'>weight = #{weight},</if>
<if test ='null != isEdit'>is_edit = #{isEdit},</if>
<if test ='null != isSetWeight'>is_set_weight = #{isSetWeight},</if>
<if test ='null != createTime'>create_time = #{createTime},</if>
<if test ='null != updateTime'>update_time = #{updateTime},</if>
<if test ='null != type'>type = #{type}</if>
......
......@@ -12,6 +12,20 @@
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="sts" property="sts" />
<result column="is_edit" property="isEdit" />
</resultMap>
<resultMap id="BaseResultMap_My" type="cn.timer.api.bean.jxgl.JxglAppraisal" >
<id column="id" property="id" />
<result column="performance_appraisal_id" property="performanceAppraisalId" />
<result column="emp_num" property="empNum" />
<result column="name" property="name" />
<result column="appraisal_explain" property="appraisalExplain" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="sts" property="sts" />
<result column="is_edit" property="isEdit" />
<result column="executor_name" property="executorName" />
</resultMap>
<resultMap id="BaseResultMap_All" type="cn.timer.api.bean.jxgl.JxglAppraisal" >
......@@ -40,6 +54,7 @@
<result column="appraisal_explain" property="appraisalExplain" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="is_edit" property="isEdit" />
<result column="sts" property="sts" />
<result column="user_name" property="userName" />
<result column="phone" property="phone" />
......@@ -58,8 +73,6 @@
<result column="appraisal_id" property="appraisalId" />
<result column="title" property="title" />
<result column="weight" property="weight" />
<result column="is_edit" property="isEdit" />
<result column="is_set_weight" property="isSetWeight" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="type" property="type" />
......@@ -80,6 +93,7 @@
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="sts" property="sts" />
<result column="appraisal_name" property="appraisalName" />
<collection column="JxglProcessNode_id" property="processNodes" ofType="cn.timer.api.bean.jxgl.JxglProcessNode"
resultMap="cn.timer.api.dao.jxgl.JxglProcessNodeMapper.BaseResultMap" columnPrefix="JxglProcessNode_">
</collection>
......@@ -104,7 +118,8 @@
appraisal_explain,
create_time,
update_time,
sts
sts,
is_edit
</sql>
<sql id="Base_Column_List_a">
......@@ -115,7 +130,8 @@
a.appraisal_explain,
a.create_time,
a.update_time,
a.sts
a.sts,
a.is_edit
</sql>
<sql id="Base_Column_List_Alias_b">
......@@ -160,8 +176,6 @@
e.appraisal_id e_id,
e.title e_title,
e.weight e_weight,
e.is_edit e_is_edit,
e.is_set_weight e_is_set_weight,
e.create_time e_create_time,
e.update_time e_update_time,
e.type e_type
......@@ -194,7 +208,8 @@
appraisal_explain JxglAppraisal_appraisal_explain,
create_time JxglAppraisal_create_time,
update_time JxglAppraisal_update_time,
sts JxglAppraisal_sts
sts JxglAppraisal_sts,
is_edit JxglAppraisal_is_edit
</sql>
<select id="selectListByQuery" resultMap="BaseResultMap_All" >
......@@ -203,7 +218,7 @@
b.name user_name, b.phone,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = b.bmgw_id limit 1) limit 1) as bm_name,
(SELECT name FROM yggl_main_emp WHERE emp_num = c.executor_id AND org_code = #{param.orgCode}) as executor_name,
(SELECT executor_name FROM jxgl_process_node WHERE process_type = 4 AND sts = 2 LIMIT 1) as confirmor,
<!-- (SELECT executor_name FROM jxgl_process_node WHERE sts = 1 LIMIT 1) as confirmor, -->
d.comprehensive_score ,d.level
FROM jxgl_appraisal a
LEFT JOIN yggl_main_emp b ON a.emp_num = b.emp_num AND b.org_code = #{param.orgCode}
......@@ -224,6 +239,49 @@
</select>
<select id="selectMyEmpByQuery" resultMap="BaseResultMap_All" >
SELECT
<include refid="Base_Column_List_a" />,
b.name user_name, b.phone,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = b.bmgw_id limit 1) limit 1) as bm_name,
(SELECT name FROM yggl_main_emp WHERE emp_num = c.executor_id AND org_code = #{param.orgCode}) as executor_name,
<!-- (SELECT executor_name FROM jxgl_process_node WHERE sts = 1 LIMIT 1) as confirmor, -->
d.comprehensive_score ,d.level
FROM jxgl_appraisal a
LEFT JOIN yggl_main_emp b ON a.emp_num = b.emp_num AND b.org_code = #{param.orgCode}
LEFT JOIN jxgl_process_node c ON a.id = c.appraisal_id AND c.sts = 1
LEFT JOIN jxgl_appraisal_assessment d ON a.id = d.appraisal_id AND d.type = 1
<!-- 缺部门 搜索 -->
WHERE a.performance_appraisal_id = #{param.id}
<if test="param.empNums != null and param.empNums.size() > 0">
<choose>
<when test="param.empNums.size() > 1">
AND b.emp_num IN
(
<foreach item="it" index="index" collection="param.empNums" separator="," close="" >
#{it}
</foreach>
)
</when>
<otherwise>
AND asso_id = #{param.empNums[0]}
</otherwise>
</choose>
</if>
<if test="param.query != null and param.query != ''">
AND (
b.name like CONCAT('%',#{param.query},'%') or
b.phone like CONCAT('%',#{param.query},'%')
)
</if>
<if test="param.sts != null">
AND a.sts = #{param.sts}
</if>
ORDER BY a.id DESC
</select>
<select id="selectListEmpByQuery" resultMap="BaseResultMap_Emp" >
SELECT
a.emp_num,
......@@ -260,7 +318,8 @@
<include refid="Base_Column_List_Alias_d" />,
<include refid="Base_Column_List_Alias_e" />,
<include refid="Base_Column_List_Alias_f" />,
<include refid="Base_Column_List_Alias_g" />
<include refid="Base_Column_List_Alias_g" />,
h.name appraisal_name
FROM
jxgl_appraisal a
LEFT JOIN jxgl_process_node b ON a.id = b.appraisal_id
......@@ -269,7 +328,9 @@
LEFT JOIN jxgl_appraisal_indicators e ON a.id = e.appraisal_id
LEFT JOIN jxgl_appraisal_indicators_assessment f ON e.id = f.appraisal_indicators_id
LEFT JOIN jxgl_appraisal_item g ON e.id = g.appraisal_indicators_id
LEFT JOIN jxgl_performance_appraisal h ON a.performance_appraisal_id = h.id
WHERE a.id = #{id}
ORDER BY c.id , d.id
</select>
<!--
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.timer.api.dao.jxgl.JxglAppraisalTMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.jxgl.JxglAppraisalT" >
<id column="id" property="id" />
<result column="org_code" property="orgCode" />
......@@ -10,6 +10,9 @@
<result column="appraisal_explain" property="appraisalExplain" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="is_edit" property="isEdit" />
<result column="is_use_fixd" property="isUseFixd" />
<result column="is_use_not_fixd" property="isUseNotFixd" />
</resultMap>
<resultMap id="BaseResultMap_b" type="cn.timer.api.bean.jxgl.JxglAppraisalIndicatorsT" >
......@@ -17,8 +20,6 @@
<result column="appraisal_t_id" property="appraisalTId" />
<result column="title" property="title" />
<result column="weight" property="weight" />
<result column="is_edit" property="isEdit" />
<result column="is_set_weight" property="isSetWeight" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="type" property="type" />
......@@ -34,6 +35,9 @@
<result column="appraisal_explain" property="appraisalExplain" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="is_edit" property="isEdit" />
<result column="is_use_fixd" property="isUseFixd" />
<result column="is_use_not_fixd" property="isUseNotFixd" />
<collection column="JxglAppraisalIndicatorsT_id" property="appraisalIndicatorsTs" ofType="cn.timer.api.bean.jxgl.JxglAppraisalIndicatorsT"
resultMap="cn.timer.api.dao.jxgl.JxglAppraisalTMapper.BaseResultMap_b" columnPrefix="JxglAppraisalIndicatorsT_">
</collection>
......@@ -45,7 +49,10 @@
name,
appraisal_explain,
create_time,
update_time
update_time,
is_edit,
is_use_fixd,
is_use_not_fixd
</sql>
<sql id="Base_Column_List_Alias">
......@@ -54,7 +61,10 @@
name JxglAppraisalT_name,
appraisal_explain JxglAppraisalT_appraisal_explain,
create_time JxglAppraisalT_create_time,
update_time JxglAppraisalT_update_time
update_time JxglAppraisalT_update_time,
is_edit JxglAppraisalT_is_edit,
is_use_fixd JxglAppraisalT_is_use_fixd,
is_use_not_fixd JxglAppraisalT_is_use_not_fixd
</sql>
<sql id="Base_Column_List_a">
......@@ -63,7 +73,10 @@
a.name,
a.appraisal_explain,
a.create_time,
a.update_time
a.update_time,
a.is_edit,
a.is_use_fixd,
a.is_use_not_fixd
</sql>
<sql id="Base_Column_List_Alias_b">
......@@ -71,8 +84,6 @@
b.appraisal_t_id JxglAppraisalIndicatorsT_appraisal_t_id,
b.title JxglAppraisalIndicatorsT_title,
b.weight JxglAppraisalIndicatorsT_weight,
b.is_edit JxglAppraisalIndicatorsT_is_edit,
b.is_set_weight JxglAppraisalIndicatorsT_is_set_weight,
b.create_time JxglAppraisalIndicatorsT_create_time,
b.update_time JxglAppraisalIndicatorsT_update_time,
b.type JxglAppraisalIndicatorsT_type
......
......@@ -43,7 +43,8 @@
<result column="result_verification" property="resultVerification" />
<result column="performance_archive" property="performanceArchive" />
<association property="appraisal" column="b_id" javaType="cn.timer.api.bean.jxgl.JxglAppraisal" columnPrefix="b_"
resultMap="cn.timer.api.dao.jxgl.JxglAppraisalMapper.BaseResultMap" />
resultMap="cn.timer.api.dao.jxgl.JxglAppraisalMapper.BaseResultMap_My">
</association>
<association property="appraisalAssessment" column="c_id" javaType="cn.timer.api.bean.jxgl.JxglAppraisalAssessment" columnPrefix="c_"
resultMap="cn.timer.api.dao.jxgl.JxglAppraisalAssessmentMapper.BaseResultMap" />
......@@ -185,14 +186,50 @@
SELECT
a.name,a.appraisal_start_time,a.appraisal_end_time,
b.sts b_sts,
(SELECT name FROM yggl_main_emp WHERE emp_num = d.executor_id AND org_code = a.org_code) as b_executor_name,
c.comprehensive_score c_comprehensive_score,
c.level c_level
FROM jxgl_performance_appraisal a
LEFT JOIN jxgl_appraisal b ON b.performance_appraisal_id = a.id
LEFT JOIN jxgl_appraisal_assessment c ON b.id = c.appraisal_id
LEFT JOIN jxgl_process_node d ON b.id = d.appraisal_id AND d.sts = 1
WHERE a.org_code = #{param.orgCode} AND b.emp_num = #{param.id} AND c.type = 1
</select>
<select id="selectMyByQuery" resultMap="BaseResultMap_ALl" >
SELECT
a.name,a.appraisal_start_time,a.appraisal_end_time,
b.sts b_sts,
(SELECT name FROM yggl_main_emp WHERE emp_num = d.executor_id AND org_code = a.org_code) as b_executor_name,
c.comprehensive_score c_comprehensive_score,
c.level c_level
FROM jxgl_performance_appraisal a
LEFT JOIN jxgl_appraisal b ON b.performance_appraisal_id = a.id
LEFT JOIN jxgl_appraisal_assessment c ON b.id = c.appraisal_id AND c.type = 1
LEFT JOIN jxgl_process_node d ON b.id = d.appraisal_id AND d.sts = 1
<where>
AND a.org_code = #{param.orgCode}
AND b.emp_num = #{param.id}
<if test="param.sts != null and param.sts == 0">
AND b.sts = 0
</if>
<if test="param.sts != null and param.sts == 1">
AND b.sts = 1
</if>
<if test="param.sts != null and param.sts == 2">
AND b.sts in (2,3)
</if>
<if test="param.sts != null and param.sts == 3">
AND b.sts = 4
</if>
</where>
</select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.jxgl.JxglPerformanceAppraisal">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment