Commit c6dff835 by tangzhaoqian Committed by chenzg

新建绩效考核、绩效详情列表、考核列表、考核详情

parent 26bd0b12
...@@ -50,10 +50,12 @@ public class JxglAppraisal extends Model<JxglAppraisal> { ...@@ -50,10 +50,12 @@ public class JxglAppraisal extends Model<JxglAppraisal> {
private String name; private String name;
@ApiModelProperty(value = "考核说明", example = "考核说明") @ApiModelProperty(value = "考核说明", example = "考核说明")
private String appraisalExplain; private String appraisalExplain;
@TableField(fill = FieldFill.INSERT) @TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间", example = "2020-10-10 10:10:10") @ApiModelProperty(value = "创建时间", example = "2020-10-10 10:10:10")
private Date createTime; private Date createTime;
@TableField(fill = FieldFill.UPDATE) @TableField(fill = FieldFill.UPDATE)
@ApiModelProperty(value = "更新时间", example = "2020-10-10 10:10:10") @ApiModelProperty(value = "更新时间", example = "2020-10-10 10:10:10")
private Date updateTime; private Date updateTime;
...@@ -61,4 +63,19 @@ public class JxglAppraisal extends Model<JxglAppraisal> { ...@@ -61,4 +63,19 @@ public class JxglAppraisal extends Model<JxglAppraisal> {
@ApiModelProperty(value = "状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7归档", example = "0") @ApiModelProperty(value = "状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7归档", example = "0")
private Integer sts; private Integer sts;
@TableField(exist = false)
private String userName;
@TableField(exist = false)
private String phone;
@TableField(exist = false)
private String bmName;
@TableField(exist = false)
private String executorName;
@TableField(exist = false)
private Double comprehensiveScore;
@TableField(exist = false)
private String level;
} }
\ No newline at end of file
package cn.timer.api.bean.jxgl; package cn.timer.api.bean.jxgl;
import java.util.Date; import java.util.Date;
import java.util.List;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
...@@ -67,4 +68,9 @@ public class JxglAppraisalIndicators extends Model<JxglAppraisalIndicators> { ...@@ -67,4 +68,9 @@ public class JxglAppraisalIndicators extends Model<JxglAppraisalIndicators> {
@ApiModelProperty(value = "类型 0 非固定 1 固定", example = "0") @ApiModelProperty(value = "类型 0 非固定 1 固定", example = "0")
private Integer type; private Integer type;
@TableField(exist = false)
private List<JxglAppraisalIndicatorsAssessment> appraisalIndicatorsAssessments;
@TableField(exist = false)
private List<JxglAppraisalItem> appraisalItems;
} }
\ No newline at end of file
...@@ -67,7 +67,7 @@ public class JxglAppraisalIndicatorsT extends Model<JxglAppraisalIndicatorsT> { ...@@ -67,7 +67,7 @@ public class JxglAppraisalIndicatorsT extends Model<JxglAppraisalIndicatorsT> {
private Date updateTime; private Date updateTime;
@ApiModelProperty(value = "类型", example = "0 非固定 1 固定") @ApiModelProperty(value = "类型", example = "0 非固定 1 固定")
private String type; private Integer type;
@TableField(exist = false) // 是否转换 @TableField(exist = false) // 是否转换
@ApiModelProperty(value = "考核项模板", example = "") @ApiModelProperty(value = "考核项模板", example = "")
......
...@@ -5,7 +5,9 @@ import java.util.Date; ...@@ -5,7 +5,9 @@ import java.util.Date;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model; import com.baomidou.mybatisplus.extension.activerecord.Model;
...@@ -74,4 +76,25 @@ public class JxglPerformanceAppraisal extends Model<JxglPerformanceAppraisal> { ...@@ -74,4 +76,25 @@ public class JxglPerformanceAppraisal extends Model<JxglPerformanceAppraisal> {
@ApiModelProperty(value="被考核人员",example="") @ApiModelProperty(value="被考核人员",example="")
private byte[] beingAppraisalPerson; private byte[] beingAppraisalPerson;
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间", example = "创建时间")
private Date createTime;
@TableField(fill = FieldFill.UPDATE)
@ApiModelProperty(value = "最近处理时间 ", example = "最近处理时间")
private Date updateTime;
@TableField(exist = false)
private Integer targetSeting;
@TableField(exist = false)
private Integer performanceScore;
@TableField(exist = false)
private Integer resultVerification;
@TableField(exist = false)
private Integer performanceArchive;
} }
\ No newline at end of file
...@@ -37,14 +37,13 @@ public class JxglProcessNode extends Model<JxglProcessNode> { ...@@ -37,14 +37,13 @@ public class JxglProcessNode extends Model<JxglProcessNode> {
@Id @Id
@GeneratedValue @GeneratedValue
@TableId(type = IdType.AUTO) @TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号", example = "10")
@ApiModelProperty(value = "编号 编号", example = "10")
private Integer id; private Integer id;
@ApiModelProperty(value = "考核id 考核id", example = "10") @ApiModelProperty(value = "考核id", example = "10")
private Integer appraisalId; private Integer appraisalId;
@ApiModelProperty(value = "执行人id(员工id) 执行人id(员工id)", example = "10") @ApiModelProperty(value = "执行人id(员工id)", example = "10")
private Integer executorId; private Integer executorId;
@ApiModelProperty(value = "执行人名称", example = "执行人名称") @ApiModelProperty(value = "执行人名称", example = "执行人名称")
...@@ -62,7 +61,7 @@ public class JxglProcessNode extends Model<JxglProcessNode> { ...@@ -62,7 +61,7 @@ public class JxglProcessNode extends Model<JxglProcessNode> {
@ApiModelProperty(value = "主管层级 0直属主管 1上上级主管", example = "10") @ApiModelProperty(value = "主管层级 0直属主管 1上上级主管", example = "10")
private Integer leaderTier; private Integer leaderTier;
@ApiModelProperty(value = "权重 权重", example = "10") @ApiModelProperty(value = "权重", example = "10")
private Integer weight; private Integer weight;
@ApiModelProperty(value = "状态 0未执行 1执行中 2 已执行", example = "10") @ApiModelProperty(value = "状态 0未执行 1执行中 2 已执行", example = "10")
......
...@@ -96,7 +96,7 @@ public interface JxglEnumInterface { ...@@ -96,7 +96,7 @@ public interface JxglEnumInterface {
} }
/** /**
*考核 状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7归档 *考核 状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7绩效归档
*/ */
@Getter @Getter
enum AppraisalSts implements JxglEnumInterface { enum AppraisalSts implements JxglEnumInterface {
...@@ -121,7 +121,18 @@ public interface JxglEnumInterface { ...@@ -121,7 +121,18 @@ public interface JxglEnumInterface {
*/ */
@Getter @Getter
enum ExecuteType implements JxglEnumInterface { enum ExecuteType implements JxglEnumInterface {
BEING_APPRAISAL_PERSON(0, "被考核人"), LEADER(1, "主管"), SPECIFIED_MEMBER(2, "指定成员"); /**
* 0被考核人
*/
BEING_APPRAISAL_PERSON(0, "被考核人"),
/**
* 1主管
*/
LEADER(1, "主管"),
/**
* 2指定成员
*/
SPECIFIED_MEMBER(2, "指定成员");
private Integer type; private Integer type;
...@@ -132,6 +143,15 @@ public interface JxglEnumInterface { ...@@ -132,6 +143,15 @@ public interface JxglEnumInterface {
this.name = name; this.name = name;
} }
public static String getName(int index) {
ExecuteType[] executeTypes = ExecuteType.values();
String res = "";
if (executeTypes.length > index) {
res = executeTypes[index].getName();
}
return res;
}
} }
/** /**
......
...@@ -8,4 +8,9 @@ public interface YgglService { ...@@ -8,4 +8,9 @@ public interface YgglService {
void applicationResignation(LzygQueryDto lzygQueryDto); void applicationResignation(LzygQueryDto lzygQueryDto);
void applicationRegularization(YgzzDto ygzzDto); void applicationRegularization(YgzzDto ygzzDto);
/*
* 根据 员工ID 和 主管层级 查询 主管
*/
Integer selectLeaderEmpNumById(Integer orgCode, Integer id, Integer leave);
} }
package cn.timer.api.controller.yggl.service; package cn.timer.api.controller.yggl.service;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.timer.api.bean.yggl.YgglMainEmp; import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.yggl.YgglMainLzb; import cn.timer.api.bean.yggl.YgglMainLzb;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.enuminterface.YgEnumInterface; import cn.timer.api.config.enuminterface.YgEnumInterface;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.yggl.LzygQueryDto; import cn.timer.api.dto.yggl.LzygQueryDto;
import cn.timer.api.dto.yggl.YgzzDto; import cn.timer.api.dto.yggl.YgzzDto;
@Service @Service
public class YgglServiceImpl implements YgglService { public class YgglServiceImpl implements YgglService {
@Autowired
private YgglMainEmpMapper ygglMainEmpMapper;
@Autowired
private ZzglBmgwMMapper zzglBmgwMMapper;
@Override @Override
public void applicationResignation(LzygQueryDto lzygQueryDto) { public void applicationResignation(LzygQueryDto lzygQueryDto) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
...@@ -50,4 +65,50 @@ public class YgglServiceImpl implements YgglService { ...@@ -50,4 +65,50 @@ public class YgglServiceImpl implements YgglService {
.build().update(new UpdateWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, ygzzDto.getEmpNum())); .build().update(new UpdateWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, ygzzDto.getEmpNum()));
} }
@Override
public Integer selectLeaderEmpNumById(Integer orgCode, Integer id, Integer leave) {
// TODO Auto-generated method stub
YgglMainEmp mainEmp = ygglMainEmpMapper.selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.select(YgglMainEmp::getBmgwId)
.eq(YgglMainEmp::getEmpNum, id));
Integer gWId = mainEmp != null ? mainEmp.getBmgwId() : null;
// 企业所有部门岗位
List<ZzglBmgwM> listBM = zzglBmgwMMapper.selectList(new QueryWrapper<ZzglBmgwM>().lambda()
.eq(ZzglBmgwM::getOrgCode, orgCode));
// 岗位
ZzglBmgwM gW = CollUtil.getFirst(listBM.stream().filter(bM -> bM.getId().equals(gWId)).collect(Collectors.toList()));
// 岗位id
Integer baseBmgwId = gW != null ? gW.getUpId() : null;
// 部门列表
// List<ZzglBmgwM> listbM = ListUtil.toList();
// 指定 主管id
Integer leaderId = null;
for (int i = 0,n = leave; i < n; i++) {
ZzglBmgwM bmgwM = getLeaderEmp(listBM, baseBmgwId);
baseBmgwId = bmgwM != null ? bmgwM.getId() : null;
if (i == n-1) {
// listbM.add(bmgwM);
leaderId = baseBmgwId;
}
}
return leaderId;
}
private ZzglBmgwM getLeaderEmp(List<ZzglBmgwM> listBM, Integer baseBmgwId) {
ZzglBmgwM zzglBmgwM = baseBmgwId != null ?
CollUtil.getFirst(listBM.stream()
.filter(bM -> bM.getId().equals(baseBmgwId)).collect(Collectors.toList()))
: null;
return zzglBmgwM;
}
} }
...@@ -2,6 +2,7 @@ package cn.timer.api.controller.zzgl.service; ...@@ -2,6 +2,7 @@ package cn.timer.api.controller.zzgl.service;
import java.util.List; import java.util.List;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.dto.zzgl.UpEmpDeptDto; import cn.timer.api.dto.zzgl.UpEmpDeptDto;
/** /**
...@@ -17,4 +18,6 @@ public interface ZzglBmgwMService { ...@@ -17,4 +18,6 @@ public interface ZzglBmgwMService {
List<Integer> selectMenuByPostId(Integer id); List<Integer> selectMenuByPostId(Integer id);
public List<YgglMainEmp> selectOtherlistent(Integer orgCode, Integer id);
} }
...@@ -9,6 +9,8 @@ import java.util.stream.Collectors; ...@@ -9,6 +9,8 @@ import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
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.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
...@@ -101,4 +103,26 @@ public class ZzglBmgwMServiceImpl implements ZzglBmgwMService { ...@@ -101,4 +103,26 @@ public class ZzglBmgwMServiceImpl implements ZzglBmgwMService {
return menuList; return menuList;
} }
@Override
public List<YgglMainEmp> selectOtherlistent(Integer orgCode, Integer id){
ArrayList<Integer> list = new ArrayList<Integer>();
List<ZzglBmgwM> zzglBmgwMs = ZzglBmgwM.builder().build().selectList(new QueryWrapper<ZzglBmgwM>().lambda()
.eq(ZzglBmgwM::getOrgCode, orgCode));
list.add(id);
ZzglBmgwM.getDepts(list, id, zzglBmgwMs);
if (list == null || list.size() == 0) {
return null;
} else {
LambdaQueryWrapper<YgglMainEmp> ygglMainEmpsLambdaQueryWrapper = new LambdaQueryWrapper<>();
ygglMainEmpsLambdaQueryWrapper
.select(YgglMainEmp::getId, YgglMainEmp::getEmpNum, YgglMainEmp::getName, YgglMainEmp::getPhone,
YgglMainEmp::getBmgwId)
.eq(YgglMainEmp::getOrgCode, orgCode).and(i -> i.in(YgglMainEmp::getBmgwId, list.toArray()));
List<YgglMainEmp> ygglMainEmps = YgglMainEmp.builder().build().selectList(ygglMainEmpsLambdaQueryWrapper);
return ygglMainEmps;
}
}
} }
package cn.timer.api.dao.jxgl; package cn.timer.api.dao.jxgl;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.timer.api.bean.jxgl.JxglAppraisal; import cn.timer.api.bean.jxgl.JxglAppraisal;
import cn.timer.api.dto.jxgl.AppraisalDetail;
import cn.timer.api.dto.jxgl.AppraisalQuery;
/** /**
* 考核 * 考核
...@@ -12,6 +16,8 @@ import cn.timer.api.bean.jxgl.JxglAppraisal; ...@@ -12,6 +16,8 @@ import cn.timer.api.bean.jxgl.JxglAppraisal;
@Repository @Repository
public interface JxglAppraisalMapper extends BaseMapper<JxglAppraisal> { public interface JxglAppraisalMapper extends BaseMapper<JxglAppraisal> {
IPage<JxglAppraisal> selectListByQuery(IPage<JxglAppraisal> page,@Param("param") AppraisalQuery query);
AppraisalDetail selectDetailById(Integer orgCode, Integer id);
} }
package cn.timer.api.dao.jxgl; package cn.timer.api.dao.jxgl;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.timer.api.bean.jxgl.JxglPerformanceAppraisal; import cn.timer.api.bean.jxgl.JxglPerformanceAppraisal;
import cn.timer.api.bean.spmk.SpmkApproveSummary;
import cn.timer.api.dto.jxgl.PerformanceAppraisalQuery;
/** /**
* 绩效考核 * 绩效考核
...@@ -12,6 +18,8 @@ import cn.timer.api.bean.jxgl.JxglPerformanceAppraisal; ...@@ -12,6 +18,8 @@ import cn.timer.api.bean.jxgl.JxglPerformanceAppraisal;
@Repository @Repository
public interface JxglPerformanceAppraisalMapper extends BaseMapper<JxglPerformanceAppraisal> { public interface JxglPerformanceAppraisalMapper extends BaseMapper<JxglPerformanceAppraisal> {
IPage<JxglPerformanceAppraisal> selectListByQuery(IPage<SpmkApproveSummary> page, @Param("param") PerformanceAppraisalQuery param);
} }
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 com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import cn.timer.api.bean.jxgl.JxglAppraisalAssessment;
import cn.timer.api.bean.jxgl.JxglAppraisalIndicators;
import cn.timer.api.bean.jxgl.JxglAppraisalLog;
import cn.timer.api.bean.jxgl.JxglProcessNode;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AppraisalDetail 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 performanceAppraisalId;
@ApiModelProperty(value = "员工id 员工id", example = "10")
private Integer empNum;
@ApiModelProperty(value = "名称", example = "名称")
private String name;
@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 = "0")
private Integer sts;
private List<JxglProcessNode> processNodes;
private List<JxglAppraisalAssessment> appraisalAssessments;
private List<JxglAppraisalLog> appraisalLogs;
private List<JxglAppraisalIndicators> appraisalIndicators;
}
package cn.timer.api.dto.jxgl;
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.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 AppraisalQuery extends Page{
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "绩效考核id", example = "")
private Integer id;
@ApiModelProperty(value = "企业id", example = "")
private Integer orgCode;
@ApiModelProperty(value = "姓名、手机号", example = "")
private String query;
@Max(value = 4,message = ValidationMsg.MAX+" 只能为 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7绩效归档")
@Min(value = 0,message = ValidationMsg.MIN+" 只能为 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7绩效归档")
@ApiModelProperty(value = "状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7绩效归档", example = "0")
private Integer sts;
@ApiModelProperty(value = "部门id", example = "")
private Integer bmId;
}
...@@ -8,6 +8,7 @@ import javax.validation.constraints.NotNull; ...@@ -8,6 +8,7 @@ import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg; import cn.timer.api.config.exception.ValidationMsg;
import cn.timer.api.dto.spmk.User; import cn.timer.api.dto.spmk.User;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
...@@ -25,6 +26,7 @@ public class BeingAppraisalPerson implements Serializable{ ...@@ -25,6 +26,7 @@ public class BeingAppraisalPerson implements Serializable{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@NotNull(message = ValidationMsg.NOTNULL) @NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "id", example = "10")
private Integer id; private Integer id;
/** /**
...@@ -33,6 +35,7 @@ public class BeingAppraisalPerson implements Serializable{ ...@@ -33,6 +35,7 @@ public class BeingAppraisalPerson implements Serializable{
@NotNull(message = ValidationMsg.NOTNULL) @NotNull(message = ValidationMsg.NOTNULL)
@Min(value = 0,message = ValidationMsg.MIN) @Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 1,message = ValidationMsg.MAX) @Max(value = 1,message = ValidationMsg.MAX)
@ApiModelProperty(value = "类型 0员工 1部门", example = "0")
private Integer type; private Integer type;
/** /**
...@@ -41,6 +44,7 @@ public class BeingAppraisalPerson implements Serializable{ ...@@ -41,6 +44,7 @@ public class BeingAppraisalPerson implements Serializable{
@NotNull(message = ValidationMsg.NOTNULL) @NotNull(message = ValidationMsg.NOTNULL)
@Min(value = 0,message = ValidationMsg.MIN) @Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 1,message = ValidationMsg.MAX) @Max(value = 1,message = ValidationMsg.MAX)
@ApiModelProperty(value = "状态 0被考核人 1无需考核人", example = "0")
private Integer sts; private Integer sts;
} }
...@@ -28,7 +28,7 @@ import lombok.NoArgsConstructor; ...@@ -28,7 +28,7 @@ import lombok.NoArgsConstructor;
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class PerformanceAppraisalDto implements Serializable{ public class PerformanceAppraisal implements Serializable{
/** /**
* *
...@@ -81,7 +81,7 @@ public class PerformanceAppraisalDto implements Serializable{ ...@@ -81,7 +81,7 @@ public class PerformanceAppraisalDto implements Serializable{
private String appraisalTName; private String appraisalTName;
@NotNull(message = ValidationMsg.NOTNULL) @NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="考核模板id",example="考核模板id") @ApiModelProperty(value="考核模板id",example="1")
private Integer appraisalTId; private Integer appraisalTId;
@ApiModelProperty(value="考核人数 考核人数",example="10") @ApiModelProperty(value="考核人数 考核人数",example="10")
......
package cn.timer.api.dto.jxgl;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
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.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 PerformanceAppraisalQuery extends Page{
@ApiModelProperty(value = "企业id", example = "")
private Integer orgCode;
@ApiModelProperty(value = "考核名称", example = "")
private String query;
@Max(value = 4,message = ValidationMsg.MAX+" 只能为 0目标制定 1绩效评分 2结果确认 3绩效归档 4终止考核")
@Min(value = 0,message = ValidationMsg.MIN+" 只能为 0目标制定 1绩效评分 2结果确认 3绩效归档 4终止考核")
@ApiModelProperty(value = "状态 0目标制定 1绩效评分 2结果确认 3绩效归档 4终止考核", example = "0")
private Integer sts;
@ApiModelProperty(value = "开始时间 ", example = "2000-10-10 10:10:10")
private String startTime;
@ApiModelProperty(value = "结束时间 ", example = "2020-10-10 10:10:10")
private String endTime;
}
...@@ -24,7 +24,7 @@ public class ProcessNode implements Serializable { ...@@ -24,7 +24,7 @@ public class ProcessNode implements Serializable {
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "执行人id(员工id) 执行人id(员工id)", example = "10") @ApiModelProperty(value = "执行人id(员工id)", example = "10")
private Integer executorId; private Integer executorId;
@NotNull(message = ValidationMsg.NOTNULL) @NotNull(message = ValidationMsg.NOTNULL)
...@@ -46,7 +46,7 @@ public class ProcessNode implements Serializable { ...@@ -46,7 +46,7 @@ public class ProcessNode implements Serializable {
@Min(value = 0,message = ValidationMsg.MIN) @Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 100,message = ValidationMsg.MAX) @Max(value = 100,message = ValidationMsg.MAX)
@ApiModelProperty(value = "权重 权重", example = "10") @ApiModelProperty(value = "权重", example = "10")
private Integer weight; private Integer weight;
} }
package cn.timer.api.dto.jxgl;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import cn.timer.api.bean.jxgl.JxglProcessNode;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProcessNodeUpdate implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "编号", example = "10")
private Integer id;
@ApiModelProperty(value = "考核id", example = "10")
private Integer appraisalId;
@ApiModelProperty(value = "执行人id(员工id)", example = "10")
private Integer executorId;
@ApiModelProperty(value = "执行人名称", example = "执行人名称")
private String executorName;
}
...@@ -7,10 +7,28 @@ import lombok.Data; ...@@ -7,10 +7,28 @@ import lombok.Data;
* *
*/ */
@Data
public class Page { public class Page {
//当前页 //当前页
private Integer currentPage; 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;
}
} }
package cn.timer.api.utils;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.function.Predicate;
public class StreamUtils {
public static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) {
Map<Object,Boolean> seen = new ConcurrentHashMap<>();
return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null;
}
}
...@@ -148,8 +148,6 @@ public class RouterUtils { ...@@ -148,8 +148,6 @@ public class RouterUtils {
List<YgglMainEmp> listYgglMainEmp = selectOtherlistent(Integer.parseInt(obj.get("orgCode",FromData.class).getValue().trim()), Integer.valueOf(listRelations.get(i).getDepartmentId().trim())); List<YgglMainEmp> listYgglMainEmp = selectOtherlistent(Integer.parseInt(obj.get("orgCode",FromData.class).getValue().trim()), Integer.valueOf(listRelations.get(i).getDepartmentId().trim()));
System.out.println(listYgglMainEmp);
if (listYgglMainEmp != null && listYgglMainEmp.size() > 0) { if (listYgglMainEmp != null && listYgglMainEmp.size() > 0) {
List<User> listUsers = new ArrayList<User>(); List<User> listUsers = new ArrayList<User>();
for (YgglMainEmp emp : listYgglMainEmp) { for (YgglMainEmp emp : listYgglMainEmp) {
......
...@@ -17,6 +17,31 @@ ...@@ -17,6 +17,31 @@
<result column="appraisal_person_num" property="appraisalPersonNum" /> <result column="appraisal_person_num" property="appraisalPersonNum" />
<result column="process_node" property="processNode" /> <result column="process_node" property="processNode" />
<result column="being_appraisal_person" property="beingAppraisalPerson" /> <result column="being_appraisal_person" property="beingAppraisalPerson" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
</resultMap>
<resultMap id="BaseResultMap_ALl" type="cn.timer.api.bean.jxgl.JxglPerformanceAppraisal" >
<id column="id" property="id" />
<result column="org_code" property="orgCode" />
<result column="name" property="name" />
<result column="period" property="period" />
<result column="appraisal_start_time" property="appraisalStartTime" />
<result column="appraisal_end_time" property="appraisalEndTime" />
<result column="is_visible" property="isVisible" />
<result column="sts" property="sts" />
<result column="scope" property="scope" />
<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" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="target_seting" property="targetSeting" />
<result column="performance_score" property="performanceScore" />
<result column="result_verification" property="resultVerification" />
<result column="performance_archive" property="performanceArchive" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -32,7 +57,27 @@ ...@@ -32,7 +57,27 @@
appraisal_t_name, appraisal_t_name,
appraisal_person_num, appraisal_person_num,
process_node, process_node,
being_appraisal_person being_appraisal_person,
create_time,
update_time
</sql>
<sql id="Base_Column_List_a">
a.id,
a.org_code,
a.name,
a.period,
a.appraisal_start_time,
a.appraisal_end_time,
a.is_visible,
a.sts,
a.scope,
a.appraisal_t_name,
a.appraisal_person_num,
<!-- a.process_node,
a.being_appraisal_person, -->
a.create_time,
a.update_time
</sql> </sql>
<sql id="Base_Column_List_Alias"> <sql id="Base_Column_List_Alias">
...@@ -48,9 +93,40 @@ ...@@ -48,9 +93,40 @@
appraisal_t_name JxglPerformanceAppraisal_appraisal_t_name, appraisal_t_name JxglPerformanceAppraisal_appraisal_t_name,
appraisal_person_num JxglPerformanceAppraisal_appraisal_person_num, appraisal_person_num JxglPerformanceAppraisal_appraisal_person_num,
process_node JxglPerformanceAppraisal_process_node, process_node JxglPerformanceAppraisal_process_node,
being_appraisal_person JxglPerformanceAppraisal_being_appraisal_person being_appraisal_person JxglPerformanceAppraisal_being_appraisal_person,
create_time JxglPerformanceAppraisal_create_time,
update_time JxglPerformanceAppraisal_update_time
</sql> </sql>
<select id="selectListByQuery" resultMap="BaseResultMap_ALl" >
SELECT
<include refid="Base_Column_List_a" />,
SUM((CASE WHEN b.sts in (0,1) THEN 1 ELSE 0 END)) AS target_seting,
SUM((CASE WHEN b.sts in (2,3) THEN 1 ELSE 0 END)) AS performance_score,
SUM((CASE WHEN b.sts in (4,5) THEN 1 ELSE 0 END)) AS result_verification,
SUM((CASE WHEN b.sts = 7 THEN 1 ELSE 0 END)) AS performance_archive
FROM jxgl_performance_appraisal a
LEFT JOIN jxgl_appraisal b ON a.id = b.performance_appraisal_id
WHERE a.org_code = #{param.orgCode}
<if test="param.query != null and param.query != ''">
and (
a.name like CONCAT('%',#{param.query},'%')
)
</if>
<if test="param.sts != null">
and a.sts = #{param.sts}
</if>
<if test="param.startTime != null and param.startTime != ''">
and a.create_time <![CDATA[ >= ]]> #{param.startTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
and a.create_time <![CDATA[ <= ]]> #{param.endTime}
</if>
GROUP BY a.id
ORDER BY a.id DESC
</select>
<!-- <!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.jxgl.JxglPerformanceAppraisal"> <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.jxgl.JxglPerformanceAppraisal">
...@@ -90,7 +166,13 @@ ...@@ -90,7 +166,13 @@
process_node, process_node,
</if> </if>
<if test ='null != beingAppraisalPerson'> <if test ='null != beingAppraisalPerson'>
being_appraisal_person being_appraisal_person,
</if>
<if test ='null != createTime'>
create_time,
</if>
<if test ='null != updateTime'>
update_time
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
...@@ -128,7 +210,13 @@ ...@@ -128,7 +210,13 @@
#{processNode}, #{processNode},
</if> </if>
<if test ='null != beingAppraisalPerson'> <if test ='null != beingAppraisalPerson'>
#{beingAppraisalPerson} #{beingAppraisalPerson},
</if>
<if test ='null != createTime'>
#{createTime},
</if>
<if test ='null != updateTime'>
#{updateTime}
</if> </if>
</trim> </trim>
</insert> </insert>
...@@ -152,7 +240,9 @@ ...@@ -152,7 +240,9 @@
<if test ='null != appraisalTName'>appraisal_t_name = #{appraisalTName},</if> <if test ='null != appraisalTName'>appraisal_t_name = #{appraisalTName},</if>
<if test ='null != appraisalPersonNum'>appraisal_person_num = #{appraisalPersonNum},</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> <if test ='null != beingAppraisalPerson'>being_appraisal_person = #{beingAppraisalPerson},</if>
<if test ='null != createTime'>create_time = #{createTime},</if>
<if test ='null != updateTime'>update_time = #{updateTime}</if>
</set> </set>
WHERE id = #{id} WHERE id = #{id}
</update> </update>
......
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