Commit 5941939e by Administrator

Merge branch 'tzq' into 'develop'

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

See merge request 8timerv2/8timerapiv200!125
parents abcfb5e9 e23fdaef
......@@ -50,15 +50,32 @@ public class JxglAppraisal extends Model<JxglAppraisal> {
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;
@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;
import java.util.Date;
import java.util.List;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
......@@ -66,5 +67,10 @@ public class JxglAppraisalIndicators extends Model<JxglAppraisalIndicators> {
@ApiModelProperty(value = "类型 0 非固定 1 固定", example = "0")
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> {
private Date updateTime;
@ApiModelProperty(value = "类型", example = "0 非固定 1 固定")
private String type;
private Integer type;
@TableField(exist = false) // 是否转换
@ApiModelProperty(value = "考核项模板", example = "")
......
......@@ -5,7 +5,9 @@ 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 com.baomidou.mybatisplus.extension.activerecord.Model;
......@@ -74,4 +76,25 @@ public class JxglPerformanceAppraisal extends Model<JxglPerformanceAppraisal> {
@ApiModelProperty(value="被考核人员",example="")
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> {
@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 appraisalId;
@ApiModelProperty(value = "执行人id(员工id) 执行人id(员工id)", example = "10")
@ApiModelProperty(value = "执行人id(员工id)", example = "10")
private Integer executorId;
@ApiModelProperty(value = "执行人名称", example = "执行人名称")
......@@ -62,7 +61,7 @@ public class JxglProcessNode extends Model<JxglProcessNode> {
@ApiModelProperty(value = "主管层级 0直属主管 1上上级主管", example = "10")
private Integer leaderTier;
@ApiModelProperty(value = "权重 权重", example = "10")
@ApiModelProperty(value = "权重", example = "10")
private Integer weight;
@ApiModelProperty(value = "状态 0未执行 1执行中 2 已执行", example = "10")
......
......@@ -96,7 +96,7 @@ public interface JxglEnumInterface {
}
/**
*考核 状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7归档
*考核 状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7绩效归档
*/
@Getter
enum AppraisalSts implements JxglEnumInterface {
......@@ -121,7 +121,18 @@ public interface JxglEnumInterface {
*/
@Getter
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;
......@@ -132,6 +143,15 @@ public interface JxglEnumInterface {
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;
}
}
/**
......
package cn.timer.api.controller.jxgl;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -10,42 +14,77 @@ 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.PutMapping;
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.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;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.ObjectUtil;
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.JxglAppraisalIndicatorsT;
import cn.timer.api.bean.jxgl.JxglAppraisalItem;
import cn.timer.api.bean.jxgl.JxglAppraisalItemT;
import cn.timer.api.bean.jxgl.JxglAppraisalLog;
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.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.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.BeingAppraisalSts;
import cn.timer.api.config.enuminterface.JxglEnumInterface.BeingAppraisalType;
import cn.timer.api.config.enuminterface.JxglEnumInterface.ExecuteType;
import cn.timer.api.config.enuminterface.JxglEnumInterface.ProcessNodeSts;
import cn.timer.api.config.enuminterface.JxglEnumInterface.ProcessType;
import cn.timer.api.config.enums.CommonEnum;
import cn.timer.api.config.exception.CustomException;
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.JxglAppraisalIndicatorsMapper;
import cn.timer.api.dao.jxgl.JxglAppraisalIndicatorsTMapper;
import cn.timer.api.dao.jxgl.JxglAppraisalItemMapper;
import cn.timer.api.dao.jxgl.JxglAppraisalItemTMapper;
import cn.timer.api.dao.jxgl.JxglAppraisalLogMapper;
import cn.timer.api.dao.jxgl.JxglAppraisalMapper;
import cn.timer.api.dao.jxgl.JxglAppraisalTMapper;
import cn.timer.api.dao.jxgl.JxglBasicSettingMapper;
import cn.timer.api.dao.jxgl.JxglPerformanceAppraisalMapper;
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.AppraisalDetail;
import cn.timer.api.dto.jxgl.AppraisalQuery;
import cn.timer.api.dto.jxgl.BeingAppraisalPerson;
import cn.timer.api.dto.jxgl.PerformanceAppraisalDto;
import cn.timer.api.dto.jxgl.PerformanceAppraisal;
import cn.timer.api.dto.jxgl.PerformanceAppraisalQuery;
import cn.timer.api.dto.jxgl.ProcessNode;
import cn.timer.api.dto.jxgl.ProcessNodeUpdate;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import cn.timer.api.utils.StreamUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
@Api(tags = "3.1绩效管理")
@RestController
......@@ -83,6 +122,7 @@ public class JxglController {
Integer orgCode = userBean.getOrgCode();
Integer count = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper)
.eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum())
.eq(QyzxEmpEntAsso::getOrgCode, orgCode)
.in(QyzxEmpEntAsso::getUserType, CommonEnum.U_TYPE_ADMIN.getType(),CommonEnum.U_TYPE_C_ADMIN.getType())
.count();
......@@ -150,6 +190,7 @@ public class JxglController {
Integer orgCode = userBean.getOrgCode();
Integer count = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper)
.eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum())
.eq(QyzxEmpEntAsso::getOrgCode, orgCode)
.in(QyzxEmpEntAsso::getUserType, CommonEnum.U_TYPE_ADMIN.getType(),CommonEnum.U_TYPE_C_ADMIN.getType())
.count();
......@@ -206,12 +247,16 @@ public class JxglController {
@GetMapping(value = "/selects_appraisal_t")
@ApiOperation(value = "4.查询-考核模板-列表", httpMethod = "GET", notes = "查询-考核模板-列表")
@ApiOperationSupport(order = 4)
public Result<Object> selectListAT(@CurrentUser UserBean userBean){
public Result<Object> selectListAT(@CurrentUser UserBean userBean, cn.timer.api.utils.Page page){
List<JxglAppraisalT> listAT = jxglAppraisalTMapper.selectList(new QueryWrapper<JxglAppraisalT>().lambda()
IPage<JxglAppraisalT> p = new Page<JxglAppraisalT>(page.getCurrentPage(),page.getTotalPage());
IPage<JxglAppraisalT> pageAT = jxglAppraisalTMapper.selectPage(p, new QueryWrapper<JxglAppraisalT>().lambda()
.eq(JxglAppraisalT::getOrgCode, userBean.getOrgCode()));
return ResultUtil.data(listAT);
List<JxglAppraisalT> listAT = pageAT.getRecords();
return ResultUtil.data(pageAT, listAT);
}
......@@ -240,6 +285,7 @@ public class JxglController {
Integer orgCode = userBean.getOrgCode();
Integer count = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper)
.eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum())
.eq(QyzxEmpEntAsso::getOrgCode, orgCode)
.in(QyzxEmpEntAsso::getUserType, CommonEnum.U_TYPE_ADMIN.getType(),CommonEnum.U_TYPE_C_ADMIN.getType())
.count();
......@@ -255,44 +301,380 @@ public class JxglController {
}
@Autowired
private ZzglBmgwMService zzglBmgwMService;
@Autowired
private YgglService ygglService;
@Autowired
private JxglPerformanceAppraisalMapper jxglPerformanceAppraisalMapper;
@Autowired
private JxglAppraisalMapper jxglAppraisalMapper;
@Autowired
private JxglAppraisalIndicatorsMapper jxglAppraisalIndicatorsMapper;
@Autowired
private JxglAppraisalItemMapper jsxglAppraisalItemMapper;
@Autowired
private JxglAppraisalLogMapper jxglAppraisalLogMapper;
@Autowired
private YgglMainEmpMapper ygglMainEmpMapper;
/**
* 新增-绩效考核
*/
@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{
public Result<Object> savePA(@CurrentUser UserBean userBean,@Validated @RequestBody PerformanceAppraisal performanceAppraisal) throws Exception{
Integer orgCode = userBean.getOrgCode();
JxglPerformanceAppraisal pA = JxglPerformanceAppraisal.builder().build();
BeanUtil.copyProperties(performanceAppraisalDto, pA, "processNode","beingAppraisalPerson","appraisalTId");
pA.setProcessNode(ObjectUtil.serialize(performanceAppraisalDto.getProcessNode()));
pA.setBeingAppraisalPerson(ObjectUtil.serialize(performanceAppraisalDto.getBeingAppraisalPerson()));
BeanUtil.copyProperties(performanceAppraisal, pA, "processNode","beingAppraisalPerson","appraisalTId");
pA.setProcessNode(ObjectUtil.serialize(performanceAppraisal.getProcessNode()));
pA.setBeingAppraisalPerson(ObjectUtil.serialize(performanceAppraisal.getBeingAppraisalPerson()));
// 新增 绩效考核
pA.insert();
System.out.println("新增 绩效考核 :" + pA);
List<ProcessNode> listPN = performanceAppraisal.getProcessNode();
List<BeingAppraisalPerson> listBAP = performanceAppraisal.getBeingAppraisalPerson();
List<ProcessNode> listPN = performanceAppraisalDto.getProcessNode();
List<BeingAppraisalPerson> listBAP = performanceAppraisalDto.getBeingAppraisalPerson();
// 被考核人员
List<BeingAppraisalPerson> listEmp = listBAP.stream()
List<Integer> listEmpId = listBAP.stream()
.filter(bAP ->
BeingAppraisalType.EMPLOYEE.getType().equals(bAP.getType()) &&
BeingAppraisalSts.NEED.getType().equals(bAP.getType()))
BeingAppraisalSts.NEED.getType().equals(bAP.getSts()))
.map(BeingAppraisalPerson::getId)
.collect(Collectors.toList());
// 被考核部门
List<BeingAppraisalPerson> listDept = listBAP.stream()
// 被考核部门id
List<Integer> listDeptId = listBAP.stream()
.filter(bAP ->
BeingAppraisalType.DEPARTMENT.getType().equals(bAP.getType()) &&
!BeingAppraisalSts.NEED.getType().equals(bAP.getType()))
BeingAppraisalType.DEPARTMENT.getType().equals(bAP.getType()))
.map(BeingAppraisalPerson::getId)
.collect(Collectors.toList());
List<YgglMainEmp> listEmp2 = ListUtil.toList();
for (Integer deptId : listDeptId) {
CollUtil.addAll(listEmp2, zzglBmgwMService.selectOtherlistent(userBean.getOrgCode(), deptId));
}
if (!CollUtil.isEmpty(listEmp2)) {
// 员工信息数据 去重
List<Integer> listEmp2Id = listEmp2.stream()
.filter(StreamUtils.distinctByKey(e -> e.getEmpNum()))
.map(YgglMainEmp::getEmpNum)
.collect(Collectors.toList());
// 合并 集合
CollUtil.addAll(listEmpId, listEmp2Id);
}
// 无需被考核人
List<BeingAppraisalPerson> listNotEmp = listBAP.stream()
// 无需被考核人id
List<Integer> listNotEmpId = listBAP.stream()
.filter(bAP ->
BeingAppraisalType.EMPLOYEE.getType().equals(bAP.getType()) &&
!BeingAppraisalSts.NOT_NEED.getType().equals(bAP.getType()))
BeingAppraisalSts.NOT_NEED.getType().equals(bAP.getSts()))
.map(BeingAppraisalPerson::getId)
.collect(Collectors.toList());
// 过滤掉 无需被考核人id
listEmpId = listEmpId.stream().filter(e -> !listNotEmpId.contains(e)).collect(Collectors.toList());
// 考核模板
JxglAppraisalT aT = jxglAppraisalTMapper.selectById(performanceAppraisal.getAppraisalTId());
if (aT == null) {
throw new CustomException("考核模板不存在");
}
JxglProcessNode processNode = JxglProcessNode.builder().build();
JxglAppraisal appraisal = JxglAppraisal.builder().build();
JxglAppraisalIndicators appraisalIndicators = JxglAppraisalIndicators.builder().build();
JxglAppraisalItem appraisalItem = JxglAppraisalItem.builder().build();
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
System.out.println("listEmpId----"+listEmpId);
for (Integer bAP : listEmpId) {
// 考核
appraisal.setPerformanceAppraisalId(pA.getId());
appraisal.setEmpNum(bAP);
appraisal.setName(aT.getName());
appraisal.setAppraisalExplain(aT.getAppraisalExplain());
appraisal.setSts(AppraisalSts.TARGET_FILL_IN.getType());
// 新增 考核
appraisal.insert();
System.out.println("新增 考核:" + appraisal);
listPN.stream().forEach(pN -> {
Integer executeType = pN.getExecuteType();
// 流程节点
processNode.setAppraisalId(appraisal.getId());
processNode.setExecuteType(executeType);
processNode.setLeaderTier(pN.getLeaderTier());
processNode.setName(ExecuteType.getName(executeType));
Integer processType = pN.getProcessType();
processNode.setProcessType(processType);
if (ProcessType.TARGET_FILL_IN.getType().equals(processType)) {
processNode.setSts(ProcessNodeSts.IN_EXECUTION.getType());
}else {
processNode.setSts(ProcessNodeSts.NON_EXECUTION.getType());
}
processNode.setWeight(pN.getWeight());
if (ExecuteType.BEING_APPRAISAL_PERSON.getType().equals(executeType)) {
processNode.setExecutorId(bAP);
}else if (ExecuteType.LEADER.getType().equals(executeType)) {
processNode.setExecutorId(ygglService.selectLeaderEmpNumById(userBean.getOrgCode(), bAP, pN.getLeaderTier()));
}else if (ExecuteType.SPECIFIED_MEMBER.getType().equals(executeType)) {
processNode.setExecutorId(pN.getExecutorId());
}
// 新增 流程节点
processNode.insert();
System.out.println("新增 流程节点:" + processNode);
});
List<JxglAppraisalIndicatorsT> listAIT = jxglAppraisalIndicatorsTMapper.selectList(new QueryWrapper<JxglAppraisalIndicatorsT>().lambda()
.eq(JxglAppraisalIndicatorsT::getAppraisalTId, aT.getId()));
if (listAIT == null || listAIT.size() <= 0) {
throw new CustomException("考核指标不存在");
}
listAIT.stream().forEach(aIT -> {
// 考核指标
// appraisalIndicators.setIsEdit(aIT.getIsEdit());
// appraisalIndicators.setIsSetWeight(aIT.getIsSetWeight());
// appraisalIndicators.setTitle(aIT.getTitle());
// appraisalIndicators.setType(aIT.getType());
// appraisalIndicators.setWeight(aIT.getWeight());
BeanUtil.copyProperties(aIT, appraisalIndicators, "appraisalId", "createTime", "updateTime");
appraisalIndicators.setAppraisalId(appraisal.getId());
// 新增 考核指标
appraisalIndicators.insert();
System.out.println("新增 考核指标:" + appraisalIndicators);
List<JxglAppraisalItemT> listAItemT = jsxglAppraisalItemTMapper.selectList(new QueryWrapper<JxglAppraisalItemT>().lambda()
.eq(JxglAppraisalItemT::getAppraisalIndicatorsTId, aIT.getId()));
if (listAItemT != null && listAItemT.size() > 0) {
listAItemT.stream().forEach(aItemT -> {
BeanUtil.copyProperties(aItemT, appraisalItem, "appraisalIndicatorsTId");
appraisalItem.setAppraisalIndicatorsId(appraisalIndicators.getId());
// 新增 考核项
appraisalItem.insert();
System.out.println("新增 考核项:" + appraisalItem);
});
}
});
YgglMainEmp yME = ygglMainEmpMapper.selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.select(YgglMainEmp::getName)
.eq(YgglMainEmp::getOrgCode, orgCode)
.eq(YgglMainEmp::getEmpNum, bAP));
appraisalLog.setAppraisalId(appraisal.getId());
appraisalLog.setExecutorId(bAP);
appraisalLog.setExecutorName(yME.getName());
appraisalLog.setType(AppraisalLogType.START.getType());
appraisalLog.insert();
}
// System.out.println("listEmpId----"+listEmpId);
// System.out.println(listDeptId);
// System.out.println(listNotEmpId);
return ResultUtil.success();
}
/**
* 查询-绩效考核-列表
*/
@PostMapping(value = "/selects_performance_appraisal")
@ApiOperation(value = "8.查询-绩效考核-列表", httpMethod = "POST", notes = "查询-绩效考核-列表")
@ApiOperationSupport(order = 8)
public Result<Object> selectsPA(@CurrentUser UserBean userBean,@RequestBody PerformanceAppraisalQuery query){
Integer orgCode = userBean.getOrgCode();
Integer count = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper)
.eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum())
.eq(QyzxEmpEntAsso::getOrgCode, orgCode)
.in(QyzxEmpEntAsso::getUserType, CommonEnum.U_TYPE_ADMIN.getType(),CommonEnum.U_TYPE_C_ADMIN.getType())
.count();
if (count <= 0) {
return ResultUtil.error("无权限查看");
}
IPage<SpmkApproveSummary> page = new Page<SpmkApproveSummary>(query.getCurrentPage(),query.getTotalPage());
query.setOrgCode(userBean.getOrgCode());
IPage<JxglPerformanceAppraisal> pagePA = jxglPerformanceAppraisalMapper.selectListByQuery(page, query);
List<JxglPerformanceAppraisal> listPA = pagePA.getRecords();
return ResultUtil.data(pagePA,listPA);
}
/**
* 查询-考核-列表
*/
@PostMapping(value = "/selects_appraisal")
@ApiOperation(value = "10.查询-考核-列表", httpMethod = "POST", notes = "查询-考核-列表")
@ApiOperationSupport(order = 10)
public Result<Object> selectsA(@CurrentUser UserBean userBean,@RequestBody AppraisalQuery query){
Integer orgCode = userBean.getOrgCode();
Integer count = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper)
.eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum())
.eq(QyzxEmpEntAsso::getOrgCode, orgCode)
.in(QyzxEmpEntAsso::getUserType, CommonEnum.U_TYPE_ADMIN.getType(),CommonEnum.U_TYPE_C_ADMIN.getType())
.count();
if (count <= 0) {
return ResultUtil.error("无权限查看");
}
IPage<JxglAppraisal> page = new Page<JxglAppraisal>(query.getCurrentPage(),query.getTotalPage());
query.setOrgCode(userBean.getOrgCode());
IPage<JxglAppraisal> pageA = jxglAppraisalMapper.selectListByQuery(page, query);
List<JxglAppraisal> listPA = pageA.getRecords();
return ResultUtil.data(pageA,listPA);
}
/**
* 查询-考核-详情
*/
@GetMapping(value = "/select_appraisal/{id}")
@ApiOperation(value = "11.查询-考核-详情", httpMethod = "GET", notes = "查询-考核-详情")
@ApiOperationSupport(order = 11)
public Result<Object> selectA(@CurrentUser UserBean userBean,@PathVariable Integer id){
Integer orgCode = userBean.getOrgCode();
Integer count = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper)
.eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum())
.eq(QyzxEmpEntAsso::getOrgCode, orgCode)
.in(QyzxEmpEntAsso::getUserType, CommonEnum.U_TYPE_ADMIN.getType(),CommonEnum.U_TYPE_C_ADMIN.getType())
.count();
if (count <= 0) {
return ResultUtil.error("无权限查看");
}
AppraisalDetail aD = jxglAppraisalMapper.selectDetailById(userBean.getOrgCode(), id);
return ResultUtil.data(aD);
}
/**
* 修改-流程执行人-转派
*/
@PutMapping(value = "/update_process_node")
@ApiOperation(value = "12.修改-流程执行人-转派", httpMethod = "PUT", notes = "修改-流程执行人-转派")
@ApiOperationSupport(order = 12)
public Result<Object> updatePN(@CurrentUser UserBean userBean,@RequestBody ProcessNodeUpdate processNodeUpdate){
Integer orgCode = userBean.getOrgCode();
Integer count = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper)
.eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum())
.eq(QyzxEmpEntAsso::getOrgCode, orgCode)
.in(QyzxEmpEntAsso::getUserType, CommonEnum.U_TYPE_ADMIN.getType(),CommonEnum.U_TYPE_C_ADMIN.getType())
.count();
if (count <= 0) {
return ResultUtil.error("无权限查看");
}
Integer count2 = 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) {
return ResultUtil.error("考核已结束");
}
JxglProcessNode pN = JxglProcessNode.builder().build();
BeanUtil.copyProperties(processNodeUpdate, pN);
pN.updateById();
return ResultUtil.data(pN);
}
/**
* 终止-考核
*/
@PutMapping(value = "/termination_assessment")
@ApiOperation(value = "13.终止-考核", httpMethod = "PUT", notes = "终止-考核")
@ApiOperationSupport(order = 13)
public Result<Object> terminationAssessment(@CurrentUser UserBean userBean,@PathVariable Integer id){
Integer orgCode = userBean.getOrgCode();
Integer count = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper)
.eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum())
.eq(QyzxEmpEntAsso::getOrgCode, orgCode)
.in(QyzxEmpEntAsso::getUserType, CommonEnum.U_TYPE_ADMIN.getType(),CommonEnum.U_TYPE_C_ADMIN.getType())
.count();
if (count <= 0) {
return ResultUtil.error("无权限查看");
}
JxglAppraisal.builder().id(id).sts(AppraisalSts.TERMINATION_ASSESSMENT.getType()).build().updateById();
return ResultUtil.success();
}
@Autowired
JxglAppraisalAssessmentMapper appraisalAssessmentMapper;
/**
* 新增-考核评定
*/
@PutMapping(value = "/save_appraisal_assessment")
@ApiOperation(value = "13.新增-考核评定", httpMethod = "PUT", notes = "新增-考核评定")
@ApiOperationSupport(order = 13)
public Result<Object> saveAA(@CurrentUser UserBean userBean,@RequestBody JxglAppraisalAssessment appraisalAssessment){
Integer orgCode = userBean.getOrgCode();
Integer count = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper)
.eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum())
.eq(QyzxEmpEntAsso::getOrgCode, orgCode)
.in(QyzxEmpEntAsso::getUserType, CommonEnum.U_TYPE_ADMIN.getType(),CommonEnum.U_TYPE_C_ADMIN.getType())
.count();
if (count <= 0) {
return ResultUtil.error("无权限查看");
}
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("考核已结束");
}
appraisalAssessment.insert();
return ResultUtil.data(appraisalAssessment);
}
}
......@@ -8,4 +8,9 @@ public interface YgglService {
void applicationResignation(LzygQueryDto lzygQueryDto);
void applicationRegularization(YgzzDto ygzzDto);
/*
* 根据 员工ID 和 主管层级 查询 主管
*/
Integer selectLeaderEmpNumById(Integer orgCode, Integer id, Integer leave);
}
package cn.timer.api.controller.yggl.service;
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 com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
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.YgglMainLzb;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
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.YgzzDto;
@Service
public class YgglServiceImpl implements YgglService {
@Autowired
private YgglMainEmpMapper ygglMainEmpMapper;
@Autowired
private ZzglBmgwMMapper zzglBmgwMMapper;
@Override
public void applicationResignation(LzygQueryDto lzygQueryDto) {
// TODO Auto-generated method stub
......@@ -50,4 +65,50 @@ public class YgglServiceImpl implements YgglService {
.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;
import java.util.List;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.dto.zzgl.UpEmpDeptDto;
/**
......@@ -17,4 +18,6 @@ public interface ZzglBmgwMService {
List<Integer> selectMenuByPostId(Integer id);
public List<YgglMainEmp> selectOtherlistent(Integer orgCode, Integer id);
}
......@@ -9,6 +9,8 @@ import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
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.extension.conditions.query.LambdaQueryChainWrapper;
......@@ -101,4 +103,26 @@ public class ZzglBmgwMServiceImpl implements ZzglBmgwMService {
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;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
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.dto.jxgl.AppraisalDetail;
import cn.timer.api.dto.jxgl.AppraisalQuery;
/**
* 考核
......@@ -12,6 +16,8 @@ import cn.timer.api.bean.jxgl.JxglAppraisal;
@Repository
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;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
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.spmk.SpmkApproveSummary;
import cn.timer.api.dto.jxgl.PerformanceAppraisalQuery;
/**
* 绩效考核
......@@ -12,6 +18,8 @@ import cn.timer.api.bean.jxgl.JxglPerformanceAppraisal;
@Repository
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;
import cn.timer.api.config.exception.ValidationMsg;
import cn.timer.api.dto.spmk.User;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
......@@ -25,6 +26,7 @@ public class BeingAppraisalPerson implements Serializable{
private static final long serialVersionUID = 1L;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "id", example = "10")
private Integer id;
/**
......@@ -33,6 +35,7 @@ public class BeingAppraisalPerson implements Serializable{
@NotNull(message = ValidationMsg.NOTNULL)
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 1,message = ValidationMsg.MAX)
@ApiModelProperty(value = "类型 0员工 1部门", example = "0")
private Integer type;
/**
......@@ -41,6 +44,7 @@ public class BeingAppraisalPerson implements Serializable{
@NotNull(message = ValidationMsg.NOTNULL)
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 1,message = ValidationMsg.MAX)
@ApiModelProperty(value = "状态 0被考核人 1无需考核人", example = "0")
private Integer sts;
}
......@@ -28,7 +28,7 @@ import lombok.NoArgsConstructor;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PerformanceAppraisalDto implements Serializable{
public class PerformanceAppraisal implements Serializable{
/**
*
......@@ -81,7 +81,7 @@ public class PerformanceAppraisalDto implements Serializable{
private String appraisalTName;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="考核模板id",example="考核模板id")
@ApiModelProperty(value="考核模板id",example="1")
private Integer appraisalTId;
@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 {
*/
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "执行人id(员工id) 执行人id(员工id)", example = "10")
@ApiModelProperty(value = "执行人id(员工id)", example = "10")
private Integer executorId;
@NotNull(message = ValidationMsg.NOTNULL)
......@@ -46,7 +46,7 @@ public class ProcessNode implements Serializable {
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 100,message = ValidationMsg.MAX)
@ApiModelProperty(value = "权重 权重", example = "10")
@ApiModelProperty(value = "权重", example = "10")
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;
*
*/
@Data
public class Page {
//当前页
private Integer currentPage;
//当前页总条数
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 {
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) {
List<User> listUsers = new ArrayList<User>();
for (YgglMainEmp emp : listYgglMainEmp) {
......
......@@ -13,6 +13,66 @@
<result column="update_time" property="updateTime" />
<result column="sts" property="sts" />
</resultMap>
<resultMap id="BaseResultMap_All" 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="user_name" property="userName" />
<result column="phone" property="phone" />
<result column="bm_name" property="bmName" />
<result column="executor_name" property="executorName" />
<result column="comprehensive_score" property="comprehensiveScore" />
<result column="level" property="level" />
</resultMap>
<resultMap id="BaseResultMap_e" type="cn.timer.api.bean.jxgl.JxglAppraisalIndicators" >
<id column="id" property="id" />
<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" />
<collection column="JxglAppraisalIndicatorsAssessment_id" property="appraisalIndicatorsAssessments" ofType="cn.timer.api.bean.jxgl.JxglAppraisalIndicatorsAssessment"
resultMap="cn.timer.api.dao.jxgl.JxglAppraisalIndicatorsAssessmentMapper.BaseResultMap" columnPrefix="JxglAppraisalIndicatorsAssessment_">
</collection>
<collection column="JxglAppraisalItem_id" property="appraisalItems" ofType="cn.timer.api.bean.jxgl.JxglAppraisalItem"
resultMap="cn.timer.api.dao.jxgl.JxglAppraisalItemMapper.BaseResultMap" columnPrefix="JxglAppraisalItem_">
</collection>
</resultMap>
<resultMap id="BaseResultMap_Detail" type="cn.timer.api.dto.jxgl.AppraisalDetail" >
<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" />
<collection column="JxglProcessNode_id" property="processNodes" ofType="cn.timer.api.bean.jxgl.JxglProcessNode"
resultMap="cn.timer.api.dao.jxgl.JxglProcessNodeMapper.BaseResultMap" columnPrefix="JxglProcessNode_">
</collection>
<collection column="JxglAppraisalAssessment_id" property="appraisalAssessments" ofType="cn.timer.api.bean.jxgl.JxglAppraisalAssessment"
resultMap="cn.timer.api.dao.jxgl.JxglAppraisalAssessmentMapper.BaseResultMap" columnPrefix="JxglAppraisalAssessment_">
</collection>
<collection column="JxglAppraisalLog_id" property="appraisalLogs" ofType="cn.timer.api.bean.jxgl.JxglAppraisalLog"
resultMap="cn.timer.api.dao.jxgl.JxglAppraisalLogMapper.BaseResultMap" columnPrefix="JxglAppraisalLog_">
</collection>
<collection column="e_id" property="appraisalIndicators" ofType="cn.timer.api.bean.jxgl.JxglAppraisalIndicators"
resultMap="cn.timer.api.dao.jxgl.JxglAppraisalMapper.BaseResultMap_e" columnPrefix="e_">
</collection>
</resultMap>
<sql id="Base_Column_List">
id,
......@@ -25,6 +85,85 @@
sts
</sql>
<sql id="Base_Column_List_a">
a.id,
a.performance_appraisal_id,
a.emp_num,
a.name,
a.appraisal_explain,
a.create_time,
a.update_time,
a.sts
</sql>
<sql id="Base_Column_List_Alias_b">
b.id JxglProcessNode_id,
b.appraisal_id JxglProcessNode_appraisal_id,
b.executor_id JxglProcessNode_executor_id,
b.executor_name JxglProcessNode_executor_name,
b.execute_type JxglProcessNode_execute_type,
b.process_type JxglProcessNode_process_type,
b.name JxglProcessNode_name,
b.leader_tier JxglProcessNode_leader_tier,
b.weight JxglProcessNode_weight,
b.sts JxglProcessNode_sts,
b.update_time JxglProcessNode_update_time
</sql>
<sql id="Base_Column_List_Alias_c">
c.id JxglAppraisalAssessment_id,
c.appraisal_id JxglAppraisalAssessment_appraisal_id,
c.assessor_id JxglAppraisalAssessment_assessor_id,
c.assessor_name JxglAppraisalAssessment_assessor_name,
c.comprehensive_score JxglAppraisalAssessment_comprehensive_score,
c.remarks JxglAppraisalAssessment_remarks,
c.type JxglAppraisalAssessment_type,
c.create_time JxglAppraisalAssessment_create_time,
c.level JxglAppraisalAssessment_level
</sql>
<sql id="Base_Column_List_Alias_d">
d.id JxglAppraisalLog_id,
d.appraisal_id JxglAppraisalLog_appraisal_id,
d.executor_id JxglAppraisalLog_executor_id,
d.executor_name JxglAppraisalLog_executor_name,
d.title JxglAppraisalLog_title,
d.remarks JxglAppraisalLog_remarks,
d.create_time JxglAppraisalLog_create_time,
d.type JxglAppraisalLog_type
</sql>
<sql id="Base_Column_List_Alias_e">
e.id e_id,
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
</sql>
<sql id="Base_Column_List_Alias_f">
f.id e_JxglAppraisalIndicatorsAssessment_id,
f.appraisal_indicators_id e_JxglAppraisalIndicatorsAssessment_appraisal_indicators_id,
f.assessor_id e_JxglAppraisalIndicatorsAssessment_assessor_id,
f.assessor_name e_JxglAppraisalIndicatorsAssessment_assessor_name,
f.score e_JxglAppraisalIndicatorsAssessment_score,
f.remarks e_JxglAppraisalIndicatorsAssessment_remarks,
f.type e_JxglAppraisalIndicatorsAssessment_type,
f.create_time e_JxglAppraisalIndicatorsAssessment_create_time
</sql>
<sql id="Base_Column_List_Alias_g">
g.id e_JxglAppraisalItem_id,
g.appraisal_indicators_id e_JxglAppraisalItem_appraisal_indicators_id,
g.title e_JxglAppraisalItem_title,
g.content e_JxglAppraisalItem_content,
g.ranks e_JxglAppraisalItem_ranks
</sql>
<sql id="Base_Column_List_Alias">
id JxglAppraisal_id,
performance_appraisal_id JxglAppraisal_performance_appraisal_id,
......@@ -35,6 +174,52 @@
update_time JxglAppraisal_update_time,
sts JxglAppraisal_sts
</sql>
<select id="selectListByQuery" 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,
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.query != null and param.query != ''">
and (
a.name like CONCAT('%',#{param.query},'%') or
a.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="selectDetailById" resultMap="BaseResultMap_Detail">
SELECT
<include refid="Base_Column_List_a" />,
<include refid="Base_Column_List_Alias_b" />,
<include refid="Base_Column_List_Alias_c" />,
<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" />
FROM
jxgl_appraisal a
LEFT JOIN jxgl_process_node b ON a.id = b.appraisal_id
LEFT JOIN jxgl_appraisal_assessment c ON a.id = c.appraisal_id
LEFT JOIN jxgl_appraisal_log d ON a.id = d.appraisal_id
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
WHERE a.id = #{id}
</select>
<!--
......
......@@ -17,6 +17,31 @@
<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" />
</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>
<sql id="Base_Column_List">
......@@ -32,7 +57,27 @@
appraisal_t_name,
appraisal_person_num,
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 id="Base_Column_List_Alias">
......@@ -48,9 +93,40 @@
appraisal_t_name JxglPerformanceAppraisal_appraisal_t_name,
appraisal_person_num JxglPerformanceAppraisal_appraisal_person_num,
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>
<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">
......@@ -90,7 +166,13 @@
process_node,
</if>
<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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
......@@ -128,7 +210,13 @@
#{processNode},
</if>
<if test ='null != beingAppraisalPerson'>
#{beingAppraisalPerson}
#{beingAppraisalPerson},
</if>
<if test ='null != createTime'>
#{createTime},
</if>
<if test ='null != updateTime'>
#{updateTime}
</if>
</trim>
</insert>
......@@ -152,7 +240,9 @@
<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 != 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>
WHERE id = #{id}
</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