Commit 26bd0b12 by tangzhaoqian Committed by chenzg

绩效管理-常量配置,考核模板列表、考核模板详情、修改、删除Api,

parent b9193eb7
......@@ -19,7 +19,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Tang 2020-05-26
* @author Tang 2020-05-27
*/
@Data
......@@ -37,10 +37,12 @@ public class JxglAppraisal extends Model<JxglAppraisal> {
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号 编号", example = "10")
private Integer id;
@ApiModelProperty(value = "绩效考核id 绩效考核id", example = "10")
private Integer performanceAppraisalId;
@ApiModelProperty(value = "员工id 员工id", example = "10")
private Integer empNum;
......@@ -49,16 +51,14 @@ public class JxglAppraisal extends Model<JxglAppraisal> {
@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 = "状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7归档", example = "10")
@ApiModelProperty(value = "状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7归档", example = "0")
private Integer sts;
}
\ No newline at end of file
package cn.timer.api.bean.jxgl;
import java.util.Date;
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;
......@@ -66,5 +68,9 @@ public class JxglAppraisalIndicatorsT extends Model<JxglAppraisalIndicatorsT> {
@ApiModelProperty(value = "类型", example = "0 非固定 1 固定")
private String type;
@TableField(exist = false) // 是否转换
@ApiModelProperty(value = "考核项模板", example = "")
private List<JxglAppraisalItemT> appraisalItemTs;
}
\ No newline at end of file
......@@ -34,10 +34,10 @@ public class JxglAppraisalItemT extends Model<JxglAppraisalItemT> {
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号 编号", example = "10")
@ApiModelProperty(value = "编号", example = "10")
private Integer id;
@ApiModelProperty(value = "考核指标id 考核指标id", example = "10")
@ApiModelProperty(value = "考核指标模板id", example = "10")
private Integer appraisalIndicatorsTId;
@ApiModelProperty(value = "标题", example = "标题")
......@@ -46,7 +46,7 @@ public class JxglAppraisalItemT extends Model<JxglAppraisalItemT> {
@ApiModelProperty(value = "内容", example = "内容")
private String content;
@ApiModelProperty(value = "排序 排序", example = "10")
@ApiModelProperty(value = "排序", example = "10")
private Integer ranks;
}
\ No newline at end of file
package cn.timer.api.bean.jxgl;
import java.util.Date;
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;
......@@ -57,5 +59,8 @@ public class JxglAppraisalT extends Model<JxglAppraisalT> {
@TableField(fill = FieldFill.UPDATE)
@ApiModelProperty(value = "更新时间", example = "2020-10-10 10:10:10")
private Date updateTime;
@TableField(exist = false) // 是否转换
@ApiModelProperty(value = "考核指标模板", example = "")
private List<JxglAppraisalIndicatorsT> appraisalIndicatorsTs;
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import java.util.Date;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.validation.Valid;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
......@@ -11,6 +12,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import cn.timer.api.config.validation.ValidList;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -54,5 +56,9 @@ public class JxglBasicSetting extends Model<JxglBasicSetting> {
@ApiModelProperty(value="更新时间 ",example="2020-10-10 10:10:10")
private Date updateTime;
@Valid
@TableField(exist = false) // 是否转换
@ApiModelProperty(value="绩效等级",example="1")
private ValidList<JxglPerformanceRating> performanceRatings;
}
\ No newline at end of file
......@@ -72,4 +72,6 @@ public class JxglPerformanceAppraisal extends Model<JxglPerformanceAppraisal> {
@ApiModelProperty(value="流程节点",example="")
private byte[] processNode;
@ApiModelProperty(value="被考核人员",example="")
private byte[] beingAppraisalPerson;
}
\ No newline at end of file
......@@ -35,26 +35,26 @@ public class JxglPerformanceRating extends Model<JxglPerformanceRating> {
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号 编号", example = "10")
@ApiModelProperty(value = "编号", example = "10")
private Integer id;
@ApiModelProperty(value = "绩效基础设置id 绩效基础设置id", example = "10")
@ApiModelProperty(value = "绩效基础设置id", example = "10")
private Integer basicSettingId;
@NotBlank(message = "等级名称不能为空")
@NotBlank(message = "等级名称 不能为空")
@ApiModelProperty(value = "等级名称", example = "等级名称")
private String name;
@NotNull(message = "区间最小分数不能为空")
@ApiModelProperty(value = "区间最小分数 区间最小分数", example = "10")
@NotNull(message = "区间最小分数 不能为空")
@ApiModelProperty(value = "区间最小分数", example = "10")
private Integer sectionMinScore;
@NotNull(message = "区间最大分数不能为空")
@ApiModelProperty(value = "区间最大分数 区间最大分数", example = "10")
@NotNull(message = "区间最大分数 不能为空")
@ApiModelProperty(value = "区间最大分数", example = "10")
private Integer sectionMaxScore;
@ApiModelProperty(value = "排序 排序", example = "10")
@NotNull(message = "排序 不能为空")
@ApiModelProperty(value = "排序", example = "10")
private Integer ranks;
}
\ No newline at end of file
package cn.timer.api.config.enuminterface;
import lombok.Getter;
public interface JxglEnumInterface {
/**
* 考核指标 类型 0员工 1部门
*/
@Getter
enum BeingAppraisalType implements JxglEnumInterface {
EMPLOYEE(0, "员工 "), DEPARTMENT(1, "部门");
private Integer type;
private String name;
BeingAppraisalType(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
* 考核指标 状态 0被考核人 1无需被考核人
*/
@Getter
enum BeingAppraisalSts implements JxglEnumInterface {
NEED(0, "被考核人"), NOT_NEED(1, "无需被考核人");
private Integer type;
private String name;
BeingAppraisalSts(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
* 考核指标 类型 0 非固定 1 固定
*/
@Getter
enum IndicatorsType implements JxglEnumInterface {
NOT_FIXATION(0, "非固定 "), FIXATION(1, "固定");
private Integer type;
private String name;
IndicatorsType(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
* 是否可见 0是 1否。评分及评分结果能否被员工看见
*/
@Getter
enum IsVisible implements JxglEnumInterface {
TRUE(0, "是"), FALSE(1, "否");
private Integer type;
private String name;
IsVisible(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
*绩效考核 状态 0目标制定 1绩效评分 2结果确认 3绩效归档 4终止考核
*/
@Getter
enum PerformanceAppraisalSts implements JxglEnumInterface {
TARGET_SETING(0, "目标制定"), PERFORMANCE_SCORE(1, "绩效评分"), RESULT_VERIFICATION(2, "结果确认"), PERFORMANCE_ARCHIVE(3, "绩效归档"), TERMINATION_ASSESSMENT(4, "终止考核");
private Integer type;
private String name;
PerformanceAppraisalSts(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
*考核 状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7归档
*/
@Getter
enum AppraisalSts implements JxglEnumInterface {
TARGET_FILL_IN(0, "目标填写"), TARGET_CONFIRMED(1, "目标确认"),
SELF_ASSESSMENT(2, "自评"), SUPERIOR_SCORE(3, "上级评分"),
RESULT_VERIFICATION(4, "结果确认"), ASSESSMENT_COMPLETE(5, "考核完成"),
TERMINATION_ASSESSMENT(6, "终止考核"), PERFORMANCE_ARCHIVE(7, "绩效归档");
private Integer type;
private String name;
AppraisalSts(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
*执行人类型 0被考核人 1主管 2指定成员
*/
@Getter
enum ExecuteType implements JxglEnumInterface {
BEING_APPRAISAL_PERSON(0, "被考核人"), LEADER(1, "主管"), SPECIFIED_MEMBER(2, "指定成员");
private Integer type;
private String name;
ExecuteType(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
*流程类型 0目标填写 1目标确认 2自评 3上级评分 4 结果确认
*/
@Getter
enum ProcessType implements JxglEnumInterface {
TARGET_FILL_IN(0, "目标填写"), TARGET_CONFIRMED(1, "目标确认"), SELF_ASSESSMENT(2, "自评"), SUPERIOR_SCORE(3, "上级评分"), RESULT_VERIFICATION(4, "结果确认");
private Integer type;
private String name;
ProcessType(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
*主管层级 0直属主管 1上上级主管
*/
@Getter
enum LeaderTier implements JxglEnumInterface {
FIRST(0, "直属主管"), SECOND(1, "上上级主管");
private Integer type;
private String name;
LeaderTier(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
* 节点状态 0未执行 1执行中 2 已执行
*/
@Getter
enum ProcessNodeSts implements JxglEnumInterface {
NON_EXECUTION(0, "未执行"), IN_EXECUTION(1, "执行中"), EXECUTED(2, "已执行 ");
private Integer type;
private String name;
ProcessNodeSts(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
* 评定类型 0自评 1上级评价
*/
@Getter
enum AssessmentType implements JxglEnumInterface {
SELF_ASSESSMENT(0, "自评"), SUPERIOR_SCORE(1, "上级评价");
private Integer type;
private String name;
AssessmentType(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
*考核记录 类型 0发起考核 1目标填写 2目标确认 3目标驳回 4自评 5评分驳回 6上级评分 7结果确认 8修改评分 9 考核完成 10 终止考核 11绩效归档
*/
@Getter
enum AppraisalLogType implements JxglEnumInterface {
START(0, "发起考核"), TARGET_FILL_IN(1, "目标填写"),
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, "绩效归档");
private Integer type;
private String name;
AppraisalLogType(Integer type, String name) {
this.type = type;
this.name = name;
}
}
}
package cn.timer.api.controller.jxgl;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
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.extension.conditions.query.LambdaQueryChainWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.timer.api.bean.jxgl.JxglAppraisalIndicatorsT;
import cn.timer.api.bean.jxgl.JxglAppraisalItemT;
import cn.timer.api.bean.jxgl.JxglAppraisalT;
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.qyzx.QyzxEmpEntAsso;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enuminterface.JxglEnumInterface.BeingAppraisalSts;
import cn.timer.api.config.enuminterface.JxglEnumInterface.BeingAppraisalType;
import cn.timer.api.config.enums.CommonEnum;
import cn.timer.api.dao.jxgl.JxglAppraisalIndicatorsTMapper;
import cn.timer.api.dao.jxgl.JxglAppraisalItemTMapper;
import cn.timer.api.dao.jxgl.JxglAppraisalTMapper;
import cn.timer.api.dao.jxgl.JxglBasicSettingMapper;
import cn.timer.api.dao.jxgl.JxglPerformanceRatingMapper;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dto.jxgl.BasicSettingDto;
import cn.timer.api.dto.jxgl.BeingAppraisalPerson;
import cn.timer.api.dto.jxgl.PerformanceAppraisalDto;
import cn.timer.api.dto.jxgl.ProcessNode;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import io.swagger.annotations.Api;
......@@ -47,6 +63,15 @@ public class JxglController {
@Autowired
private JxglPerformanceRatingMapper jxglPerformanceRatingMapper;
@Autowired
private JxglAppraisalTMapper jxglAppraisalTMapper;
@Autowired
private JxglAppraisalIndicatorsTMapper jxglAppraisalIndicatorsTMapper;
@Autowired
private JxglAppraisalItemTMapper jsxglAppraisalItemTMapper;
//TODO 基础设置
/**
* 新增或编辑-基础设置
......@@ -54,7 +79,7 @@ public class JxglController {
@PostMapping(value = "/save_basic_setting")
@ApiOperation(value = "1.新增或编辑-基础设置", httpMethod = "POST", notes = "新增或编辑-审批模板组")
@ApiOperationSupport(order = 1)
public Result<Object> saveAtg(@CurrentUser UserBean userBean ,@Validated @RequestBody BasicSettingDto basicSettingDto) throws Exception{
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())
......@@ -65,10 +90,10 @@ public class JxglController {
return ResultUtil.error("无权限编辑");
}
List<JxglPerformanceRating> listPr = basicSettingDto.getPerformanceRatings();
List<JxglPerformanceRating> listPr = basicSetting.getPerformanceRatings();
if (listPr != null) {
for (JxglPerformanceRating pr : listPr) {
if (pr.getSectionMaxScore() > basicSettingDto.getMaxScore()) {
if (pr.getSectionMaxScore() > basicSetting.getMaxScore()) {
return ResultUtil.error("区间值不能超过 最高分");
}else if (pr.getSectionMinScore() >= pr.getSectionMaxScore()) {
return ResultUtil.error("区间值 设置不正确");
......@@ -87,20 +112,187 @@ public class JxglController {
.eq(JxglBasicSetting::getOrgCode, orgCode));
}
basicSetting.setOrgCode(orgCode);
basicSetting.insert();
if (listPr != null && listPr.size() > 0) {
listPr.stream().forEach(pr -> pr.setBasicSettingId(basicSetting.getId()));
int i = jxglPerformanceRatingMapper.insertList(listPr);
}
return ResultUtil.success();
}
/**
* 查询-基础设置
*/
@GetMapping(value = "/select_basic_setting")
@ApiOperation(value = "2.查询-基础设置", httpMethod = "GET", notes = "查询-基础设置")
@ApiOperationSupport(order = 2)
public Result<Object> selectAT(@CurrentUser UserBean userBean){
JxglBasicSetting bS2 = JxglBasicSetting.builder().build();
BeanUtil.copyProperties(basicSettingDto, bS2, "performanceRatings");
bS2.setOrgCode(orgCode);
bS2.insert();
if (listPr != null) {
for (JxglPerformanceRating pr : listPr) {
pr.setBasicSettingId(bS2.getId());
jxglPerformanceRatingMapper.insert(pr);
JxglBasicSetting bS = jxglBasicSettingMapper.selectAll(userBean.getOrgCode());
return ResultUtil.data(bS);
}
//TODO 考核模板
/**
* 新增或编辑-考核模板
*/
@PostMapping(value = "/save_appraisal_t")
@ApiOperation(value = "3.新增或编辑-考核模板", httpMethod = "POST", notes = "新增或编辑-考核模板")
@ApiOperationSupport(order = 3)
public Result<Object> saveAtg(@CurrentUser UserBean userBean ,@Validated @RequestBody JxglAppraisalT jxglAppraisalT) throws Exception{
Integer orgCode = userBean.getOrgCode();
Integer count = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper)
.eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum())
.in(QyzxEmpEntAsso::getUserType, CommonEnum.U_TYPE_ADMIN.getType(),CommonEnum.U_TYPE_C_ADMIN.getType())
.count();
if (count <= 0) {
return ResultUtil.error("无权限编辑");
}
if (jxglAppraisalT.getId() != null && jxglAppraisalT.selectCount(new QueryWrapper<JxglAppraisalT>().lambda()
.eq(JxglAppraisalT::getId, jxglAppraisalT.getId())) > 0) {
jxglAppraisalT.updateById();
}else {
jxglAppraisalT.setOrgCode(orgCode);
jxglAppraisalT.insert();
}
LambdaQueryWrapper<JxglAppraisalIndicatorsT> q = new QueryWrapper<JxglAppraisalIndicatorsT>().lambda()
.eq(JxglAppraisalIndicatorsT::getAppraisalTId, jxglAppraisalT.getId());
List<JxglAppraisalIndicatorsT> listAIT = jxglAppraisalIndicatorsTMapper.selectList(q.select(JxglAppraisalIndicatorsT::getId));
List<Integer> listAITId = listAIT != null && listAIT.size() > 0 ? listAIT.stream().map(JxglAppraisalIndicatorsT::getId).collect(Collectors.toList()) : null;
// 删除 原 考核指标模板
jxglAppraisalIndicatorsTMapper.delete(q);
// 删除 原 考核项模板
if (listAITId != null) {
jsxglAppraisalItemTMapper.delete(new QueryWrapper<JxglAppraisalItemT>().lambda()
.in(JxglAppraisalItemT::getAppraisalIndicatorsTId, listAITId));
}
List<JxglAppraisalIndicatorsT> aITs = jxglAppraisalT.getAppraisalIndicatorsTs();
for (JxglAppraisalIndicatorsT aIT : aITs) {
aIT.setAppraisalTId(jxglAppraisalT.getId());
// 新增 考核指标模板
if (aIT.insert()) {
List<JxglAppraisalItemT> aItemTs = aIT.getAppraisalItemTs();
if (aItemTs != null && aItemTs.size() > 0) {
// 批量新增 考核项模板
aItemTs.stream().forEach(aItemT -> aItemT.setAppraisalIndicatorsTId(aIT.getId()));
int c = jsxglAppraisalItemTMapper.insertList(aItemTs);
}
}else {
throw new Exception();
}
}
return ResultUtil.success();
}
/**
* 查询-考核模板-列表
*/
@GetMapping(value = "/selects_appraisal_t")
@ApiOperation(value = "4.查询-考核模板-列表", httpMethod = "GET", notes = "查询-考核模板-列表")
@ApiOperationSupport(order = 4)
public Result<Object> selectListAT(@CurrentUser UserBean userBean){
List<JxglAppraisalT> listAT = jxglAppraisalTMapper.selectList(new QueryWrapper<JxglAppraisalT>().lambda()
.eq(JxglAppraisalT::getOrgCode, userBean.getOrgCode()));
return ResultUtil.data(listAT);
}
/**
* 查询-考核模板-详情
*/
@GetMapping(value = "/selects_appraisal_t/{id}")
@ApiOperation(value = "5.查询-考核模板-详情", httpMethod = "GET", notes = "查询-考核模板-详情")
@ApiOperationSupport(order = 5)
public Result<Object> selectAT(@CurrentUser UserBean userBean,@PathVariable Integer id){
JxglAppraisalT aT = jxglAppraisalTMapper.selectDetailById(id);
return ResultUtil.data(aT);
}
/**
* 删除-考核模板
*/
@DeleteMapping(value = "/del_appraisal_t/{id}")
@ApiOperation(value = "6.删除-考核模板", httpMethod = "DELETE", notes = "删除-考核模板")
@ApiOperationSupport(order = 6)
public Result<Object> delAT(@CurrentUser UserBean userBean,@PathVariable Integer id) throws Exception{
Integer orgCode = userBean.getOrgCode();
Integer count = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper)
.eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum())
.in(QyzxEmpEntAsso::getUserType, CommonEnum.U_TYPE_ADMIN.getType(),CommonEnum.U_TYPE_C_ADMIN.getType())
.count();
if (count <= 0) {
return ResultUtil.error("无权限编辑");
}
jxglAppraisalTMapper.delete(new QueryWrapper<JxglAppraisalT>().lambda()
.eq(JxglAppraisalT::getId, id)
.eq(JxglAppraisalT::getOrgCode, orgCode));
return ResultUtil.success();
}
/**
* 新增-绩效考核
*/
@PostMapping(value = "/save_performance_appraisal")
@ApiOperation(value = "7.新增-绩效考核", httpMethod = "POST", notes = "新增-绩效考核")
@ApiOperationSupport(order = 7)
public Result<Object> savePA(@CurrentUser UserBean userBean,@Validated @RequestBody PerformanceAppraisalDto performanceAppraisalDto) throws Exception{
JxglPerformanceAppraisal pA = JxglPerformanceAppraisal.builder().build();
BeanUtil.copyProperties(performanceAppraisalDto, pA, "processNode","beingAppraisalPerson","appraisalTId");
pA.setProcessNode(ObjectUtil.serialize(performanceAppraisalDto.getProcessNode()));
pA.setBeingAppraisalPerson(ObjectUtil.serialize(performanceAppraisalDto.getBeingAppraisalPerson()));
pA.insert();
List<ProcessNode> listPN = performanceAppraisalDto.getProcessNode();
List<BeingAppraisalPerson> listBAP = performanceAppraisalDto.getBeingAppraisalPerson();
// 被考核人员
List<BeingAppraisalPerson> listEmp = listBAP.stream()
.filter(bAP ->
BeingAppraisalType.EMPLOYEE.getType().equals(bAP.getType()) &&
BeingAppraisalSts.NEED.getType().equals(bAP.getType()))
.collect(Collectors.toList());
// 被考核部门
List<BeingAppraisalPerson> listDept = listBAP.stream()
.filter(bAP ->
BeingAppraisalType.DEPARTMENT.getType().equals(bAP.getType()) &&
!BeingAppraisalSts.NEED.getType().equals(bAP.getType()))
.collect(Collectors.toList());
// 无需被考核人
List<BeingAppraisalPerson> listNotEmp = listBAP.stream()
.filter(bAP ->
BeingAppraisalType.EMPLOYEE.getType().equals(bAP.getType()) &&
!BeingAppraisalSts.NOT_NEED.getType().equals(bAP.getType()))
.collect(Collectors.toList());
return ResultUtil.success();
}
}
package cn.timer.api.dao.jxgl;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -12,6 +14,4 @@ import cn.timer.api.bean.jxgl.JxglAppraisalIndicatorsT;
@Repository
public interface JxglAppraisalIndicatorsTMapper extends BaseMapper<JxglAppraisalIndicatorsT> {
}
package cn.timer.api.dao.jxgl;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -12,6 +14,8 @@ import cn.timer.api.bean.jxgl.JxglAppraisalItemT;
@Repository
public interface JxglAppraisalItemTMapper extends BaseMapper<JxglAppraisalItemT> {
int insertList(List<JxglAppraisalItemT> aItemTs);
}
......@@ -12,6 +12,8 @@ import cn.timer.api.bean.jxgl.JxglAppraisalT;
@Repository
public interface JxglAppraisalTMapper extends BaseMapper<JxglAppraisalT> {
JxglAppraisalT selectDetailById(Integer id);
}
......@@ -12,6 +12,8 @@ import cn.timer.api.bean.jxgl.JxglBasicSetting;
@Repository
public interface JxglBasicSettingMapper extends BaseMapper<JxglBasicSetting> {
JxglBasicSetting selectAll(Integer orgCode);
}
package cn.timer.api.dao.jxgl;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -12,6 +14,6 @@ import cn.timer.api.bean.jxgl.JxglPerformanceRating;
@Repository
public interface JxglPerformanceRatingMapper extends BaseMapper<JxglPerformanceRating> {
int insertList(List<JxglPerformanceRating> list);
}
package cn.timer.api.dto.jxgl;
import java.util.Date;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import cn.timer.api.bean.jxgl.JxglPerformanceRating;
import cn.timer.api.config.exception.ValidationMsg;
import cn.timer.api.config.validation.ValidList;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BasicSettingDto {
@ApiModelProperty(value="编号",example="10")
private Integer id;
@ApiModelProperty(value="企业id",example="10")
private Integer orgCode;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="最高分",example="100")
private Integer maxScore;
@ApiModelProperty(value="创建时间",example="2020-10-10 10:10:10")
private Date createTime;
@ApiModelProperty(value="更新时间",example="2020-10-10 10:10:10")
private Date updateTime;
@Valid
@ApiModelProperty(value="绩效等级",example="1")
private ValidList<JxglPerformanceRating> performanceRatings;
}
package cn.timer.api.dto.jxgl;
import java.io.Serializable;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg;
import cn.timer.api.dto.spmk.User;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BeingAppraisalPerson implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
@NotNull(message = ValidationMsg.NOTNULL)
private Integer id;
/**
* 0员工 1部门
*/
@NotNull(message = ValidationMsg.NOTNULL)
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 1,message = ValidationMsg.MAX)
private Integer type;
/**
* 0被考核人 1无需考核人
*/
@NotNull(message = ValidationMsg.NOTNULL)
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 1,message = ValidationMsg.MAX)
private Integer sts;
}
package cn.timer.api.dto.jxgl;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.google.gson.JsonObject;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PerformanceAppraisalDto implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@TableId (type = IdType.AUTO)
@ApiModelProperty(value="编号 编号",example="10")
private Integer id;
@ApiModelProperty(value="企业id 企业id",example="10")
private Integer orgCode;
@NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value="名称",example="名称")
private String name;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="周期 0月 1季 2年 3半年",example="10")
private Integer period;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="开始时间",example="2020-10-10 10:10:10")
private Date appraisalStartTime;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="结束时间",example="2020-10-10 10:10:10")
private Date appraisalEndTime;
@NotNull(message = ValidationMsg.NOTNULL)
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 1,message = ValidationMsg.MAX)
@ApiModelProperty(value="是否可见 0是 1否。评分及评分结果能否被员工看见",example="1")
private Integer isVisible;
@NotNull(message = ValidationMsg.NOTNULL)
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 4,message = ValidationMsg.MAX)
@ApiModelProperty(value="状态 0目标制定 1绩效评分 2结果确认 3绩效归档 4终止考核",example="10")
private Integer sts;
@ApiModelProperty(value="范围",example="部门名称、被考核人名称")
private String scope;
@NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value="考核模板名称",example="考核模板名称")
private String appraisalTName;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="考核模板id",example="考核模板id")
private Integer appraisalTId;
@ApiModelProperty(value="考核人数 考核人数",example="10")
private Integer appraisalPersonNum;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="流程节点",example="")
private List<ProcessNode> processNode;
@Valid
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="被考核人员",example="")
private List<BeingAppraisalPerson> beingAppraisalPerson;
}
package cn.timer.api.dto.jxgl;
import java.io.Serializable;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProcessNode implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "执行人id(员工id) 执行人id(员工id)", example = "10")
private Integer executorId;
@NotNull(message = ValidationMsg.NOTNULL)
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 2,message = ValidationMsg.MAX)
@ApiModelProperty(value = "执行人类型 0被考核人 1主管 2指定成员", example = "10")
private Integer executeType;
@NotNull(message = ValidationMsg.NOTNULL)
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 4,message = ValidationMsg.MAX)
@ApiModelProperty(value = "类型 0目标填写 1目标确认 2自评 3上级评分 4 结果确认", example = "10")
private Integer processType;
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 1,message = ValidationMsg.MAX)
@ApiModelProperty(value = "主管层级 0直属主管 1上上级主管", example = "10")
private Integer leaderTier;
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 100,message = ValidationMsg.MAX)
@ApiModelProperty(value = "权重 权重", example = "10")
private Integer weight;
}
......@@ -26,6 +26,17 @@
content JxglAppraisalItemT_content,
ranks JxglAppraisalItemT_ranks
</sql>
<insert id="insertList" useGeneratedKeys="true" keyColumn="id" parameterType="list">
INSERT INTO jxgl_appraisal_item_t
(appraisal_indicators_t_id,title,content,ranks)
values
<foreach item="item" index="index" collection="list" open="" separator="," close="">
(
#{item.appraisalIndicatorsTId},#{item.title},#{item.content},#{item.ranks}
)
</foreach>
</insert>
<!--
......
......@@ -5,6 +5,7 @@
<resultMap id="BaseResultMap" 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" />
......@@ -15,6 +16,7 @@
<sql id="Base_Column_List">
id,
performance_appraisal_id,
emp_num,
name,
appraisal_explain,
......@@ -25,6 +27,7 @@
<sql id="Base_Column_List_Alias">
id JxglAppraisal_id,
performance_appraisal_id JxglAppraisal_performance_appraisal_id,
emp_num JxglAppraisal_emp_num,
name JxglAppraisal_name,
appraisal_explain JxglAppraisal_appraisal_explain,
......@@ -38,6 +41,9 @@
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.jxgl.JxglAppraisal">
INSERT INTO jxgl_appraisal
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != performanceAppraisalId'>
performance_appraisal_id,
</if>
<if test ='null != empNum'>
emp_num,
</if>
......@@ -58,6 +64,9 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != performanceAppraisalId'>
#{performanceAppraisalId},
</if>
<if test ='null != empNum'>
#{empNum},
</if>
......@@ -87,6 +96,7 @@
<update id="update" parameterType="cn.timer.api.bean.jxgl.JxglAppraisal">
UPDATE jxgl_appraisal
<set>
<if test ='null != performanceAppraisalId'>performance_appraisal_id = #{performanceAppraisalId},</if>
<if test ='null != empNum'>emp_num = #{empNum},</if>
<if test ='null != name'>name = #{name},</if>
<if test ='null != appraisalExplain'>appraisal_explain = #{appraisalExplain},</if>
......
......@@ -11,6 +11,33 @@
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
</resultMap>
<resultMap id="BaseResultMap_b" type="cn.timer.api.bean.jxgl.JxglAppraisalIndicatorsT" >
<id column="id" property="id" />
<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" />
<collection column="JxglAppraisalItemT_id" property="appraisalItemTs" ofType="cn.timer.api.bean.jxgl.JxglAppraisalItemT"
resultMap="cn.timer.api.dao.jxgl.JxglAppraisalItemTMapper.BaseResultMap" columnPrefix="JxglAppraisalItemT_">
</collection>
</resultMap>
<resultMap id="BaseResultMap_All" type="cn.timer.api.bean.jxgl.JxglAppraisalT" >
<id column="id" property="id" />
<result column="org_code" property="orgCode" />
<result column="name" property="name" />
<result column="appraisal_explain" property="appraisalExplain" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<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>
</resultMap>
<sql id="Base_Column_List">
id,
......@@ -29,6 +56,48 @@
create_time JxglAppraisalT_create_time,
update_time JxglAppraisalT_update_time
</sql>
<sql id="Base_Column_List_a">
a.id,
a.org_code,
a.name,
a.appraisal_explain,
a.create_time,
a.update_time
</sql>
<sql id="Base_Column_List_Alias_b">
b.id JxglAppraisalIndicatorsT_id,
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
</sql>
<sql id="Base_Column_List_Alias_c">
c.id JxglAppraisalIndicatorsT_JxglAppraisalItemT_id,
c.appraisal_indicators_t_id JxglAppraisalIndicatorsT_JxglAppraisalItemT_appraisal_indicators_t_id,
c.title JxglAppraisalIndicatorsT_JxglAppraisalItemT_title,
c.content JxglAppraisalIndicatorsT_JxglAppraisalItemT_content,
c.ranks JxglAppraisalIndicatorsT_JxglAppraisalItemT_ranks
</sql>
<select id="selectDetailById" resultMap="BaseResultMap_All">
SELECT
<include refid="Base_Column_List_a" />,
<include refid="Base_Column_List_Alias_b" />,
<include refid="Base_Column_List_Alias_c" />
FROM jxgl_appraisal_t a
LEFT JOIN jxgl_appraisal_indicators_t b ON a.id = b.appraisal_t_id
LEFT JOIN jxgl_appraisal_item_t c ON b.id = c.appraisal_indicators_t_id
WHERE a.id = #{id}
</select>
<!--
......
......@@ -10,6 +10,17 @@
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
</resultMap>
<resultMap id="BaseResultMap_All" type="cn.timer.api.bean.jxgl.JxglBasicSetting" >
<id column="id" property="id" />
<result column="org_code" property="orgCode" />
<result column="max_score" property="maxScore" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<collection column="JxglPerformanceRating_id" property="performanceRatings" ofType="cn.timer.api.bean.jxgl.JxglPerformanceRating"
resultMap="cn.timer.api.dao.jxgl.JxglPerformanceRatingMapper.BaseResultMap" columnPrefix="JxglPerformanceRating_">
</collection>
</resultMap>
<sql id="Base_Column_List">
id,
......@@ -26,7 +37,33 @@
create_time JxglBasicSetting_create_time,
update_time JxglBasicSetting_update_time
</sql>
<sql id="Base_Column_List_a">
a.id,
a.org_code,
a.max_score,
a.create_time,
a.update_time
</sql>
<sql id="Base_Column_List_Alias_b">
b.id JxglPerformanceRating_id,
b.basic_setting_id JxglPerformanceRating_basic_setting_id,
b.name JxglPerformanceRating_name,
b.section_min_score JxglPerformanceRating_section_min_score,
b.section_max_score JxglPerformanceRating_section_max_score,
b.ranks JxglPerformanceRating_ranks
</sql>
<select id="selectAll" resultMap="BaseResultMap_All">
SELECT
<include refid="Base_Column_List_a" />,
<include refid="Base_Column_List_Alias_b" />
FROM jxgl_basic_setting a
LEFT JOIN jxgl_performance_rating b ON a.id = b.basic_setting_id
WHERE a.org_code = #{orgCode}
</select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.jxgl.JxglBasicSetting">
......
......@@ -16,6 +16,7 @@
<result column="appraisal_t_name" property="appraisalTName" />
<result column="appraisal_person_num" property="appraisalPersonNum" />
<result column="process_node" property="processNode" />
<result column="being_appraisal_person" property="beingAppraisalPerson" />
</resultMap>
<sql id="Base_Column_List">
......@@ -30,7 +31,8 @@
scope,
appraisal_t_name,
appraisal_person_num,
process_node
process_node,
being_appraisal_person
</sql>
<sql id="Base_Column_List_Alias">
......@@ -45,7 +47,8 @@
scope JxglPerformanceAppraisal_scope,
appraisal_t_name JxglPerformanceAppraisal_appraisal_t_name,
appraisal_person_num JxglPerformanceAppraisal_appraisal_person_num,
process_node JxglPerformanceAppraisal_process_node
process_node JxglPerformanceAppraisal_process_node,
being_appraisal_person JxglPerformanceAppraisal_being_appraisal_person
</sql>
<!--
......@@ -84,7 +87,10 @@
appraisal_person_num,
</if>
<if test ='null != processNode'>
process_node
process_node,
</if>
<if test ='null != beingAppraisalPerson'>
being_appraisal_person
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
......@@ -119,7 +125,10 @@
#{appraisalPersonNum},
</if>
<if test ='null != processNode'>
#{processNode}
#{processNode},
</if>
<if test ='null != beingAppraisalPerson'>
#{beingAppraisalPerson}
</if>
</trim>
</insert>
......@@ -142,7 +151,8 @@
<if test ='null != scope'>scope = #{scope},</if>
<if test ='null != appraisalTName'>appraisal_t_name = #{appraisalTName},</if>
<if test ='null != appraisalPersonNum'>appraisal_person_num = #{appraisalPersonNum},</if>
<if test ='null != processNode'>process_node = #{processNode}</if>
<if test ='null != processNode'>process_node = #{processNode},</if>
<if test ='null != beingAppraisalPerson'>being_appraisal_person = #{beingAppraisalPerson}</if>
</set>
WHERE id = #{id}
</update>
......
......@@ -29,6 +29,17 @@
section_max_score JxglPerformanceRating_section_max_score,
ranks JxglPerformanceRating_ranks
</sql>
<insert id="insertList" useGeneratedKeys="true" keyColumn="id" parameterType="list">
INSERT INTO jxgl_performance_rating
(basic_setting_id,name,section_min_score,section_max_score,ranks)
values
<foreach item="item" index="index" collection="list" open="" separator="," close="">
(
#{item.basicSettingId},#{item.name},#{item.sectionMinScore},#{item.sectionMaxScore},#{item.ranks}
)
</foreach>
</insert>
<!--
......
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