Commit f734ec31 by lal

Merge branch 'develop' of develop-gitlab.youlingrc.com:8timerv2/8timerapiv200 into lal

parents 1ef45a18 bce50eb0
......@@ -62,6 +62,9 @@ public class JxglAppraisalIndicators extends Model<JxglAppraisalIndicators> {
@ApiModelProperty(value = "类型 0 非固定 1 固定", example = "0")
private Integer type;
@ApiModelProperty(value = "是否可编辑权重", example = "0 是 1否")
private Integer isEditWeight;
@TableField(exist = false)
private List<JxglAppraisalIndicatorsAssessment> appraisalIndicatorsAssessments;
......
......@@ -63,8 +63,10 @@ public class JxglAppraisalIndicatorsT extends Model<JxglAppraisalIndicatorsT> {
@ApiModelProperty(value = "类型", example = "0 非固定 1 固定")
private Integer type;
@ApiModelProperty(value = "是否可编辑权重", example = "0 是 1否")
private Integer isEditWeight;
@TableField(exist = false) // 是否转换
@ApiModelProperty(value = "考核项模板", example = "")
private List<JxglAppraisalItemT> appraisalItemTs;
}
\ No newline at end of file
......@@ -5,6 +5,10 @@ import java.util.List;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Null;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
......@@ -12,6 +16,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.exception.ValidationMsg;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -38,35 +43,44 @@ public class JxglAppraisalT extends Model<JxglAppraisalT> {
@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 orgCode;
@NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value = "名称", example = "名称")
private String name;
@ApiModelProperty(value = "考核说明", example = "考核说明")
private String appraisalExplain;
@Null(message = ValidationMsg.NULL)
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间", example = "2020-10-10 10:10:10")
private Date createTime;
@Null(message = ValidationMsg.NULL)
@TableField(fill = FieldFill.UPDATE)
@ApiModelProperty(value = "更新时间", example = "2020-10-10 10:10:10")
private Date updateTime;
@ApiModelProperty(value = "是否可编辑 限制员工的权限", example = "10")
@ApiModelProperty(value = "是否可编辑 限制员工的权限", example = "0")
private Integer isEdit;
@ApiModelProperty(value = "是否使用固定", example = "10")
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 1,message = ValidationMsg.MAX)
@ApiModelProperty(value = "是否使用固定", example = "0")
private Integer isUseFixd;
@ApiModelProperty(value = "是否使用非固定", example = "10")
@Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 1,message = ValidationMsg.MAX)
@ApiModelProperty(value = "是否使用非固定", example = "0")
private Integer isUseNotFixd;
@TableField(exist = false) // 是否转换
@ApiModelProperty(value = "考核指标模板", example = "")
private List<JxglAppraisalIndicatorsT> appraisalIndicatorsTs;
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import java.util.Date;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.validation.Valid;
import javax.validation.constraints.Min;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
......@@ -12,6 +13,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.exception.ValidationMsg;
import cn.timer.api.config.validation.ValidList;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -39,13 +41,14 @@ public class JxglBasicSetting extends Model<JxglBasicSetting> {
@Id
@GeneratedValue
@TableId (type = IdType.AUTO)
@ApiModelProperty(value="编号 编号",example="101")
@ApiModelProperty(value="编号",example="101")
private Integer id;
@ApiModelProperty(value="企业id 企业id",example="101")
private Integer orgCode;
@ApiModelProperty(value="最高分 最高分",example="101")
@Min(value = 0,message = ValidationMsg.MIN)
@ApiModelProperty(value="最高分",example="101")
private Integer maxScore;
@TableField(fill = FieldFill.INSERT)
......
......@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -41,19 +42,19 @@ public class JxglPerformanceRating extends Model<JxglPerformanceRating> {
@ApiModelProperty(value = "绩效基础设置id", example = "10")
private Integer basicSettingId;
@NotBlank(message = "等级名称 不能为空")
@NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value = "等级名称", example = "等级名称")
private String name;
@NotNull(message = "区间最小分数 不能为空")
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "区间最小分数", example = "10")
private Integer sectionMinScore;
@NotNull(message = "区间最大分数 不能为空")
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "区间最大分数", example = "10")
private Integer sectionMaxScore;
@NotNull(message = "排序 不能为空")
// @NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "排序", example = "10")
private Integer ranks;
......
......@@ -75,7 +75,6 @@ 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.jxgl.JxglProcessNodeMapper;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.jxgl.AppraisalAssessment;
......@@ -101,14 +100,10 @@ import io.swagger.annotations.ApiOperation;
@Api(tags = "3.1绩效管理")
@RestController
@Transactional(rollbackFor = Exception.class)
@RequestMapping(value = "/jxgl",
produces = { "application/json","multipart/form-data" })
@RequestMapping(value = "/jxgl", produces = { "application/json", "multipart/form-data" })
public class JxglController {
@Autowired
private QyzxEmpEntAssoMapper qyzxEmpEntAssoMapper;
@Autowired
private ZzglBmgwMMapper zzglBmgwMMapper;
@Autowired
......@@ -132,7 +127,34 @@ public class JxglController {
@Autowired
private JxglAppraisalIndicatorsAssessmentMapper jxglAppraisalIndicatorsAssessmentMapper;
//TODO 基础设置
@Autowired
private ZzglBmgwMService zzglBmgwMService;
@Autowired
private YgglService ygglService;
@Autowired
private JxglPerformanceAppraisalMapper jxglPerformanceAppraisalMapper;
@Autowired
private JxglAppraisalMapper jxglAppraisalMapper;
@Autowired
private JxglAppraisalIndicatorsMapper jxglAppraisalIndicatorsMapper;
@Autowired
private JxglAppraisalLogMapper jxglAppraisalLogMapper;
@Autowired
private YgglMainEmpMapper ygglMainEmpMapper;
@Autowired
private JxglProcessNodeMapper jxglProcessNodeMapper;
@Autowired
private JxglAppraisalItemMapper jxglAppraisalItemMapper;
// TODO 基础设置
/**
* 新增或编辑-基础设置
*/
......@@ -140,29 +162,29 @@ public class JxglController {
@ApiOperation(value = "1.新增或编辑-基础设置", httpMethod = "POST", notes = "新增或编辑-审批模板组")
@ApiOperationSupport(order = 1)
@Role
public Result<Object> saveAtg(@CurrentUser UserBean userBean ,@Validated @RequestBody JxglBasicSetting basicSetting) throws Exception{
public Result<Object> saveAtg(@CurrentUser UserBean userBean, @Validated @RequestBody JxglBasicSetting basicSetting)
throws Exception {
Integer orgCode = userBean.getOrgCode();
List<JxglPerformanceRating> listPr = basicSetting.getPerformanceRatings();
if (listPr != null) {
for (JxglPerformanceRating pr : listPr) {
if (pr.getSectionMaxScore() > basicSetting.getMaxScore()) {
return ResultUtil.error("区间值不能超过 最高分");
}else if (pr.getSectionMinScore() >= pr.getSectionMaxScore()) {
return ResultUtil.error("区间值 设置不正确");
return ResultUtil.error("区间值不能超过最高分");
} else if (pr.getSectionMinScore() >= pr.getSectionMaxScore()) {
return ResultUtil.error("区间值设置不正确");
}
}
}
JxglBasicSetting bS = jxglBasicSettingMapper.selectOne(new QueryWrapper<JxglBasicSetting>().lambda()
.select(JxglBasicSetting::getId)
.eq(JxglBasicSetting::getOrgCode, orgCode));
.select(JxglBasicSetting::getId).eq(JxglBasicSetting::getOrgCode, orgCode));
if (bS != null) {
// 删除 绩效等级
jxglPerformanceRatingMapper.delete(new QueryWrapper<JxglPerformanceRating>().lambda()
.eq(JxglPerformanceRating::getBasicSettingId, bS.getId()));
// 删除 基础设置
jxglBasicSettingMapper.delete(new QueryWrapper<JxglBasicSetting>().lambda()
.eq(JxglBasicSetting::getOrgCode, orgCode));
jxglBasicSettingMapper
.delete(new QueryWrapper<JxglBasicSetting>().lambda().eq(JxglBasicSetting::getOrgCode, orgCode));
}
basicSetting.setOrgCode(orgCode);
......@@ -183,7 +205,7 @@ public class JxglController {
@ApiOperation(value = "2.查询-基础设置", httpMethod = "GET", notes = "查询-基础设置")
@ApiOperationSupport(order = 2)
@Role
public Result<Object> selectAT(@CurrentUser UserBean userBean){
public Result<Object> selectAT(@CurrentUser UserBean userBean) {
JxglBasicSetting bS = jxglBasicSettingMapper.selectAll(userBean.getOrgCode());
......@@ -191,9 +213,7 @@ public class JxglController {
}
//TODO 考核模板
// TODO 考核模板
/**
* 新增或编辑-考核模板
*/
......@@ -201,21 +221,25 @@ public class JxglController {
@ApiOperation(value = "3.新增或编辑-考核模板", httpMethod = "POST", notes = "新增或编辑-考核模板")
@ApiOperationSupport(order = 3)
@Role
public Result<Object> saveAtg(@CurrentUser UserBean userBean ,@Validated @RequestBody JxglAppraisalT jxglAppraisalT) throws Exception{
public Result<Object> saveAtg(@CurrentUser UserBean userBean, @Validated @RequestBody JxglAppraisalT jxglAppraisalT)
throws Exception {
if (jxglAppraisalT.getId() != null && jxglAppraisalT.selectCount(new QueryWrapper<JxglAppraisalT>().lambda()
.eq(JxglAppraisalT::getId, jxglAppraisalT.getId())) > 0) {
if (jxglAppraisalT.getId() != null && jxglAppraisalT.selectCount(
new QueryWrapper<JxglAppraisalT>().lambda().eq(JxglAppraisalT::getId, jxglAppraisalT.getId())) > 0) {
jxglAppraisalT.updateById();
}else {
} else {
jxglAppraisalT.setOrgCode(userBean.getOrgCode());
jxglAppraisalT.insert();
}
LambdaQueryWrapper<JxglAppraisalIndicatorsT> q = new QueryWrapper<JxglAppraisalIndicatorsT>().lambda()
.eq(JxglAppraisalIndicatorsT::getAppraisalTId, jxglAppraisalT.getId());
List<JxglAppraisalIndicatorsT> listAIT = jxglAppraisalIndicatorsTMapper.selectList(q.select(JxglAppraisalIndicatorsT::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;
List<Integer> listAITId = listAIT != null && listAIT.size() > 0
? listAIT.stream().map(JxglAppraisalIndicatorsT::getId).collect(Collectors.toList())
: null;
// 删除 原 考核指标模板
jxglAppraisalIndicatorsTMapper.delete(q);
......@@ -226,7 +250,16 @@ public class JxglController {
}
List<JxglAppraisalIndicatorsT> aITs = jxglAppraisalT.getAppraisalIndicatorsTs();
if (aITs != null && aITs.size() > 0) {
for (JxglAppraisalIndicatorsT aIT : aITs) {
if (aIT.getIsEditWeight() == null) {
throw new CustomException("权重编辑权限未设置");
}
if (aIT.getType() == null) {
throw new CustomException("指标类型未设置");
}
aIT.setAppraisalTId(jxglAppraisalT.getId());
// 新增 考核指标模板
if (aIT.insert()) {
......@@ -236,16 +269,15 @@ public class JxglController {
aItemTs.stream().forEach(aItemT -> aItemT.setAppraisalIndicatorsTId(aIT.getId()));
int c = jsxglAppraisalItemTMapper.insertList(aItemTs);
}
}else {
} else {
throw new Exception();
}
}
}
return ResultUtil.success();
}
/**
* 查询-考核模板-列表
*/
......@@ -253,12 +285,12 @@ public class JxglController {
@ApiOperation(value = "4.查询-考核模板-列表", httpMethod = "POST", notes = "查询-考核模板-列表")
@ApiOperationSupport(order = 4)
@Role
public Result<Object> selectListAT(@CurrentUser UserBean userBean,@RequestBody cn.timer.api.utils.Page page){
public Result<Object> selectListAT(@CurrentUser UserBean userBean, @RequestBody cn.timer.api.utils.Page page) {
IPage<JxglAppraisalT> p = new Page<JxglAppraisalT>(page.getCurrentPage(),page.getTotalPage());
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()));
IPage<JxglAppraisalT> pageAT = jxglAppraisalTMapper.selectPage(p,
new QueryWrapper<JxglAppraisalT>().lambda().eq(JxglAppraisalT::getOrgCode, userBean.getOrgCode()));
List<JxglAppraisalT> listAT = pageAT.getRecords();
......@@ -273,7 +305,7 @@ public class JxglController {
@ApiOperation(value = "5.查询-考核模板-详情", httpMethod = "GET", notes = "查询-考核模板-详情")
@ApiOperationSupport(order = 5)
@Role
public Result<Object> selectAT(@CurrentUser UserBean userBean,@PathVariable Integer id){
public Result<Object> selectAT(@CurrentUser UserBean userBean, @PathVariable Integer id) {
JxglAppraisalT aT = jxglAppraisalTMapper.selectDetailById(id);
......@@ -288,50 +320,26 @@ public class JxglController {
@ApiOperation(value = "6.删除-考核模板", httpMethod = "DELETE", notes = "删除-考核模板")
@ApiOperationSupport(order = 6)
@Role
public Result<Object> delAT(@CurrentUser UserBean userBean,@PathVariable Integer id) throws Exception{
public Result<Object> delAT(@CurrentUser UserBean userBean, @PathVariable Integer id) throws Exception {
jxglAppraisalTMapper.delete(new QueryWrapper<JxglAppraisalT>().lambda()
.eq(JxglAppraisalT::getId, id)
jxglAppraisalTMapper.delete(new QueryWrapper<JxglAppraisalT>().lambda().eq(JxglAppraisalT::getId, id)
.eq(JxglAppraisalT::getOrgCode, userBean.getOrgCode()));
return ResultUtil.success();
}
@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 PerformanceAppraisal performanceAppraisal) 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(performanceAppraisal, pA, "processNode","beingAppraisalPerson","appraisalTId");
BeanUtil.copyProperties(performanceAppraisal, pA, "processNode", "beingAppraisalPerson", "appraisalTId");
List<ProcessNode> listPN = performanceAppraisal.getProcessNode();
List<BeingAppraisalPerson> listBAP = performanceAppraisal.getBeingAppraisalPerson();
......@@ -341,39 +349,32 @@ public class JxglController {
// 被考核人员
List<Integer> listEmpId = listBAP.stream()
.filter(bAP ->
BeingAppraisalType.EMPLOYEE.getType().equals(bAP.getType()) &&
BeingAppraisalSts.NEED.getType().equals(bAP.getSts()))
.map(BeingAppraisalPerson::getId)
.collect(Collectors.toList());
.filter(bAP -> BeingAppraisalType.EMPLOYEE.getType().equals(bAP.getType())
&& BeingAppraisalSts.NEED.getType().equals(bAP.getSts()))
.map(BeingAppraisalPerson::getId).collect(Collectors.toList());
// 被考核部门id
List<Integer> listDeptId = listBAP.stream()
.filter(bAP ->
BeingAppraisalType.DEPARTMENT.getType().equals(bAP.getType()))
.map(BeingAppraisalPerson::getId)
.collect(Collectors.toList());
.filter(bAP -> 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());
List<Integer> listEmp2Id = listEmp2.stream().filter(StreamUtils.distinctByKey(e -> e.getEmpNum()))
.map(YgglMainEmp::getEmpNum).collect(Collectors.toList());
// 合并 集合
CollUtil.addAll(listEmpId, listEmp2Id);
}
// 无需被考核人id
List<Integer> listNotEmpId = listBAP.stream()
.filter(bAP ->
BeingAppraisalType.EMPLOYEE.getType().equals(bAP.getType()) &&
BeingAppraisalSts.NOT_NEED.getType().equals(bAP.getSts()))
.map(BeingAppraisalPerson::getId)
.collect(Collectors.toList());
.filter(bAP -> BeingAppraisalType.EMPLOYEE.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)).distinct().collect(Collectors.toList());
......@@ -392,7 +393,7 @@ public class JxglController {
JxglAppraisalItem appraisalItem = JxglAppraisalItem.builder().build();
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
System.out.println("listEmpId----"+listEmpId);
System.out.println("listEmpId----" + listEmpId);
for (Integer bAP : listEmpId) {
// 考核
appraisal.setPerformanceAppraisalId(pA.getId());
......@@ -404,20 +405,6 @@ public class JxglController {
appraisal.insert();
System.out.println("新增 考核:" + appraisal);
// List<Integer> weights = listPN.stream()
// .filter(p -> ProcessType.SELF_ASSESSMENT.getType().equals(p.getProcessType()) ||
// ProcessType.SUPERIOR_SCORE.getType().equals(p.getProcessType()))
// .map(ProcessNode::getWeight)
// .collect(Collectors.toList());
// Integer weightSum = 0;
// if (weights != null && weights.size() > 0) {
// for (Integer i : weights) {
// weightSum += i;
// }
// if (!weightSum.equals(100))
// throw new CustomException("权重总和要等于 100%");
// }
listPN.stream().forEach(pN -> {
Integer executeType = pN.getExecuteType();
// 流程节点
......@@ -429,16 +416,17 @@ public class JxglController {
processNode.setProcessType(processType);
if (ProcessType.TARGET_FILL_IN.getType().equals(processType)) {
processNode.setSts(ProcessNodeSts.IN_EXECUTION.getType());
}else {
} 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)) {
} 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());
}
// 新增 流程节点
......@@ -447,10 +435,13 @@ public class JxglController {
});
List<JxglAppraisalIndicatorsT> listAIT = jxglAppraisalIndicatorsTMapper.selectList(new QueryWrapper<JxglAppraisalIndicatorsT>().lambda()
List<JxglAppraisalIndicatorsT> listAIT = jxglAppraisalIndicatorsTMapper
.selectList(new QueryWrapper<JxglAppraisalIndicatorsT>().lambda()
.eq(JxglAppraisalIndicatorsT::getAppraisalTId, aT.getId())
.ne(aT.getIsUseFixd() == 1 ,JxglAppraisalIndicatorsT::getType, IndicatorsType.FIXATION.getType())
.ne(aT.getIsUseNotFixd() == 1 ,JxglAppraisalIndicatorsT::getType, IndicatorsType.NOT_FIXATION.getType()));
.ne(aT.getIsUseFixd() == 1, JxglAppraisalIndicatorsT::getType,
IndicatorsType.FIXATION.getType())
.ne(aT.getIsUseNotFixd() == 1, JxglAppraisalIndicatorsT::getType,
IndicatorsType.NOT_FIXATION.getType()));
if (listAIT == null || listAIT.size() <= 0) {
throw new CustomException("考核指标不存在");
......@@ -464,7 +455,8 @@ public class JxglController {
appraisalIndicators.insert();
// System.out.println("新增 考核指标:" + appraisalIndicators);
List<JxglAppraisalItemT> listAItemT = jsxglAppraisalItemTMapper.selectList(new QueryWrapper<JxglAppraisalItemT>().lambda()
List<JxglAppraisalItemT> listAItemT = jsxglAppraisalItemTMapper
.selectList(new QueryWrapper<JxglAppraisalItemT>().lambda()
.eq(JxglAppraisalItemT::getAppraisalIndicatorsTId, aIT.getId()));
if (listAItemT != null && listAItemT.size() > 0) {
......@@ -481,9 +473,7 @@ public class JxglController {
});
YgglMainEmp yME = ygglMainEmpMapper.selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.select(YgglMainEmp::getName)
.eq(YgglMainEmp::getOrgCode, orgCode)
.eq(YgglMainEmp::getEmpNum, bAP));
.select(YgglMainEmp::getName).eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, bAP));
appraisalLog.setAppraisalId(appraisal.getId());
appraisalLog.setExecutorId(bAP);
......@@ -502,10 +492,10 @@ public class JxglController {
@ApiOperation(value = "8.删除-绩效考核", httpMethod = "DELETE", notes = "删除-绩效考核")
@ApiOperationSupport(order = 8)
@Role
public Result<Object> deletePA(@CurrentUser UserBean userBean,@PathVariable Integer id){
public Result<Object> deletePA(@CurrentUser UserBean userBean, @PathVariable Integer id) {
JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper.selectOne(new QueryWrapper<JxglPerformanceAppraisal>().lambda()
.eq(JxglPerformanceAppraisal::getId, id)
JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper
.selectOne(new QueryWrapper<JxglPerformanceAppraisal>().lambda().eq(JxglPerformanceAppraisal::getId, id)
.eq(JxglPerformanceAppraisal::getOrgCode, userBean.getOrgCode()));
if (pA == null) {
......@@ -516,10 +506,10 @@ public class JxglController {
List<Integer> aIIds = CollUtil.toList();
List<JxglAppraisal> listA = jxglAppraisalMapper.selectList(new QueryWrapper<JxglAppraisal>().lambda()
.select(JxglAppraisal::getId)
.eq(JxglAppraisal::getPerformanceAppraisalId, pA.getId()));
.select(JxglAppraisal::getId).eq(JxglAppraisal::getPerformanceAppraisalId, pA.getId()));
aIds = listA != null && listA.size() > 0 ? listA.stream().map(JxglAppraisal::getId).collect(Collectors.toList()) : aIds;
aIds = listA != null && listA.size() > 0 ? listA.stream().map(JxglAppraisal::getId).collect(Collectors.toList())
: aIds;
// 删除 绩效考核
jxglPerformanceAppraisalMapper.deleteById(id);
......@@ -542,19 +532,22 @@ public class JxglController {
.eq(aIds.size() == 1, JxglAppraisalLog::getAppraisalId, aIds)
.in(aIds.size() > 1, JxglAppraisalLog::getAppraisalId, aIds));
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda()
.select(JxglAppraisalIndicators::getId)
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(
new QueryWrapper<JxglAppraisalIndicators>().lambda().select(JxglAppraisalIndicators::getId)
.eq(aIds.size() == 1, JxglAppraisalIndicators::getAppraisalId, aIds)
.in(aIds.size() > 1, JxglAppraisalIndicators::getAppraisalId, aIds));
aIIds = listAI != null && listAI.size() > 0 ? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList()) : aIIds;
aIIds = listAI != null && listAI.size() > 0
? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList())
: aIIds;
if (aIIds.size() > 0) {
jxglAppraisalIndicatorsMapper.deleteBatchIds(aIIds);
// 批量删除 考核指标评定
jxglAppraisalIndicatorsAssessmentMapper.delete(new QueryWrapper<JxglAppraisalIndicatorsAssessment>().lambda()
jxglAppraisalIndicatorsAssessmentMapper.delete(new QueryWrapper<JxglAppraisalIndicatorsAssessment>()
.lambda()
.eq(aIds.size() == 1, JxglAppraisalIndicatorsAssessment::getAppraisalIndicatorsId, aIIds)
.in(aIds.size() > 1, JxglAppraisalIndicatorsAssessment::getAppraisalIndicatorsId, aIIds));
......@@ -575,12 +568,13 @@ public class JxglController {
@PostMapping(value = "/update_performance_appraisal_sts")
@ApiOperation(value = "8.修改-绩效管理状态", httpMethod = "POST", notes = "修改-绩效管理状态")
@ApiOperationSupport(order = 8)
public Result<Object> updatePAS(@CurrentUser UserBean userBean,@RequestBody AppraisalUpdateSts appraisalUpdateSts){
public Result<Object> updatePAS(@CurrentUser UserBean userBean,
@Validated @RequestBody AppraisalUpdateSts appraisalUpdateSts) {
JxglPerformanceAppraisal performanceAppraisal = jxglPerformanceAppraisalMapper.selectOne(new QueryWrapper<JxglPerformanceAppraisal>().lambda()
JxglPerformanceAppraisal performanceAppraisal = jxglPerformanceAppraisalMapper
.selectOne(new QueryWrapper<JxglPerformanceAppraisal>().lambda()
.eq(JxglPerformanceAppraisal::getId, appraisalUpdateSts.getId())
.eq(JxglPerformanceAppraisal::getSts, appraisalUpdateSts.getSts())
);
.eq(JxglPerformanceAppraisal::getSts, appraisalUpdateSts.getSts()));
if (performanceAppraisal == null) {
return ResultUtil.error("绩效考核不存在");
......@@ -597,45 +591,40 @@ public class JxglController {
List<JxglProcessNode> listPN = CollUtil.toList();
List<Integer> pNIds = CollUtil.toList();
switch (performanceAppraisal.getSts()) {
case 0:
sts = PerformanceAppraisalSts.PERFORMANCE_SCORE.getType();
listA = jxglAppraisalMapper.selectList(new QueryWrapper<JxglAppraisal>().lambda()
.select(JxglAppraisal::getId)
.eq(JxglAppraisal::getPerformanceAppraisalId, id));
.select(JxglAppraisal::getId).eq(JxglAppraisal::getPerformanceAppraisalId, id));
if (listA != null && listA.size() > 0) {
aIds = listA.stream().map(JxglAppraisal::getId).collect(Collectors.toList());
listPN = jxglProcessNodeMapper.selectList(new QueryWrapper<JxglProcessNode>().lambda()
.in(JxglProcessNode::getAppraisalId, aIds)
listPN = jxglProcessNodeMapper.selectList(
new QueryWrapper<JxglProcessNode>().lambda().in(JxglProcessNode::getAppraisalId, aIds)
.eq(JxglProcessNode::getProcessType, ProcessType.TARGET_CONFIRMED.getType())
.eq(JxglProcessNode::getSts, ProcessNodeSts.EXECUTED.getType()));
if (listPN != null && listPN.size() > 0) {
aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList());
System.out.println("1------"+ aIds);
listPN = jxglProcessNodeMapper.selectList(new QueryWrapper<JxglProcessNode>().lambda()
.in(JxglProcessNode::getAppraisalId, aIds)
listPN = jxglProcessNodeMapper.selectList(
new QueryWrapper<JxglProcessNode>().lambda().in(JxglProcessNode::getAppraisalId, aIds)
.eq(JxglProcessNode::getProcessType, ProcessType.SELF_ASSESSMENT.getType())
.eq(JxglProcessNode::getSts, ProcessNodeSts.NON_EXECUTION.getType()));
if (listPN != null && listPN.size() > 0) {
pNIds = listPN.stream().map(JxglProcessNode::getId).collect(Collectors.toList());
aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList());
System.out.println("2------"+ pNIds);
System.out.println("3------"+ aIds);
JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build().update(new UpdateWrapper<JxglProcessNode>().lambda()
.in(JxglProcessNode::getId, pNIds));
JxglAppraisal.builder().sts(AppraisalSts.SELF_ASSESSMENT.getType()).build().update(new UpdateWrapper<JxglAppraisal>().lambda()
.in(JxglAppraisal::getId, aIds));
JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build().update(
new UpdateWrapper<JxglProcessNode>().lambda().in(JxglProcessNode::getId, pNIds));
}
JxglAppraisal.builder().sts(AppraisalSts.SELF_ASSESSMENT.getType()).build()
.update(new UpdateWrapper<JxglAppraisal>().lambda().in(JxglAppraisal::getId, aIds));
}
}
}
break;
......@@ -643,76 +632,70 @@ public class JxglController {
sts = PerformanceAppraisalSts.RESULT_VERIFICATION.getType();
listA = jxglAppraisalMapper.selectList(new QueryWrapper<JxglAppraisal>().lambda()
.select(JxglAppraisal::getId)
.eq(JxglAppraisal::getPerformanceAppraisalId, id));
.select(JxglAppraisal::getId).eq(JxglAppraisal::getPerformanceAppraisalId, id));
if (listA != null && listA.size() > 0) {
aIds = listA.stream().map(JxglAppraisal::getId).collect(Collectors.toList());
listPN = jxglProcessNodeMapper.selectList(new QueryWrapper<JxglProcessNode>().lambda()
.in(JxglProcessNode::getAppraisalId, aIds)
listPN = jxglProcessNodeMapper.selectList(
new QueryWrapper<JxglProcessNode>().lambda().in(JxglProcessNode::getAppraisalId, aIds)
.eq(JxglProcessNode::getProcessType, ProcessType.SUPERIOR_SCORE.getType())
.eq(JxglProcessNode::getSts, ProcessNodeSts.EXECUTED.getType()));
if (listPN != null && listPN.size() > 0) {
aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList());
listPN = jxglProcessNodeMapper.selectList(new QueryWrapper<JxglProcessNode>().lambda()
.in(JxglProcessNode::getAppraisalId, aIds)
listPN = jxglProcessNodeMapper.selectList(
new QueryWrapper<JxglProcessNode>().lambda().in(JxglProcessNode::getAppraisalId, aIds)
.eq(JxglProcessNode::getProcessType, ProcessType.RESULT_VERIFICATION.getType())
.eq(JxglProcessNode::getSts, ProcessNodeSts.NON_EXECUTION.getType()));
if (listPN != null && listPN.size() > 0) {
pNIds = listPN.stream().map(JxglProcessNode::getId).collect(Collectors.toList());
aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList());
JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build().update(new UpdateWrapper<JxglProcessNode>().lambda()
.in(JxglProcessNode::getId, pNIds));
JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build().update(
new UpdateWrapper<JxglProcessNode>().lambda().in(JxglProcessNode::getId, pNIds));
JxglAppraisal.builder().sts(AppraisalSts.RESULT_VERIFICATION.getType()).build().update(new UpdateWrapper<JxglAppraisal>().lambda()
.in(JxglAppraisal::getId, aIds));
JxglAppraisal.builder().sts(AppraisalSts.RESULT_VERIFICATION.getType()).build()
.update(new UpdateWrapper<JxglAppraisal>().lambda().in(JxglAppraisal::getId, aIds));
}
}
}
break;
case 2:
sts = PerformanceAppraisalSts.PERFORMANCE_ARCHIVE.getType();
listA = jxglAppraisalMapper.selectList(new QueryWrapper<JxglAppraisal>().lambda()
.select(JxglAppraisal::getId)
.eq(JxglAppraisal::getPerformanceAppraisalId, id));
.select(JxglAppraisal::getId).eq(JxglAppraisal::getPerformanceAppraisalId, id));
if (listA != null && listA.size() > 0) {
aIds = listA.stream().map(JxglAppraisal::getId).collect(Collectors.toList());
listPN = jxglProcessNodeMapper.selectList(new QueryWrapper<JxglProcessNode>().lambda()
.in(JxglProcessNode::getAppraisalId, aIds)
listPN = jxglProcessNodeMapper.selectList(
new QueryWrapper<JxglProcessNode>().lambda().in(JxglProcessNode::getAppraisalId, aIds)
.eq(JxglProcessNode::getProcessType, ProcessType.RESULT_VERIFICATION.getType())
.eq(JxglProcessNode::getSts, ProcessNodeSts.EXECUTED.getType()));
if (listPN != null && listPN.size() > 0) {
aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList());
listPN = jxglProcessNodeMapper.selectList(new QueryWrapper<JxglProcessNode>().lambda()
.in(JxglProcessNode::getAppraisalId, aIds)
listPN = jxglProcessNodeMapper.selectList(
new QueryWrapper<JxglProcessNode>().lambda().in(JxglProcessNode::getAppraisalId, aIds)
.eq(JxglProcessNode::getProcessType, ProcessType.TARGET_CONFIRMED.getType())
.eq(JxglProcessNode::getSts, ProcessNodeSts.NON_EXECUTION.getType()));
if (listPN != null && listPN.size() > 0) {
pNIds = listPN.stream().map(JxglProcessNode::getId).collect(Collectors.toList());
aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList());
JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build().update(new UpdateWrapper<JxglProcessNode>().lambda()
.in(JxglProcessNode::getId, pNIds));
JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build().update(
new UpdateWrapper<JxglProcessNode>().lambda().in(JxglProcessNode::getId, pNIds));
JxglAppraisal.builder().sts(AppraisalSts.SELF_ASSESSMENT.getType()).build().update(new UpdateWrapper<JxglAppraisal>().lambda()
.in(JxglAppraisal::getId, aIds));
JxglAppraisal.builder().sts(AppraisalSts.SELF_ASSESSMENT.getType()).build()
.update(new UpdateWrapper<JxglAppraisal>().lambda().in(JxglAppraisal::getId, aIds));
}
}
}
break;
default:
......@@ -720,19 +703,15 @@ public class JxglController {
}
// 修改 绩效考核状态
jxglPerformanceAppraisalMapper.updateById(JxglPerformanceAppraisal.builder()
.id(appraisalUpdateSts.getId())
.sts(sts)
.build());
jxglPerformanceAppraisalMapper
.updateById(JxglPerformanceAppraisal.builder().id(appraisalUpdateSts.getId()).sts(sts).build());
// 修改 考核状态
jxglAppraisalMapper.update(JxglAppraisal.builder()
.performanceAppraisalId(appraisalUpdateSts.getId())
.sts(sts)
.build(), new UpdateWrapper<JxglAppraisal>().lambda()
jxglAppraisalMapper.update(
JxglAppraisal.builder().performanceAppraisalId(appraisalUpdateSts.getId()).sts(sts).build(),
new UpdateWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getPerformanceAppraisalId, appraisalUpdateSts.getId())
.eq(JxglAppraisal::getSts, AppraisalSts.TARGET_CONFIRMED.getType())
);
.eq(JxglAppraisal::getSts, AppraisalSts.TARGET_CONFIRMED.getType()));
return ResultUtil.success();
}
......@@ -744,7 +723,7 @@ public class JxglController {
@ApiOperation(value = "99.删除-所有-绩效考核", httpMethod = "DELETE", notes = "删除-所有-绩效考核")
@ApiOperationSupport(order = 99)
@Role
public Result<Object> deleteAllPA(@CurrentUser UserBean userBean){
public Result<Object> deleteAllPA(@CurrentUser UserBean userBean) {
jxglPerformanceAppraisalMapper.delete(null);
jxglAppraisalMapper.delete(null);
......@@ -765,9 +744,10 @@ public class JxglController {
@ApiOperation(value = "8.查询-绩效考核-列表-归档", httpMethod = "POST", notes = "查询-绩效考核-列表-归档")
@ApiOperationSupport(order = 8)
@Role
public Result<Object> selectsPAArchive(@CurrentUser UserBean userBean,@RequestBody PerformanceAppraisalQuery query){
public Result<Object> selectsPAArchive(@CurrentUser UserBean userBean,
@RequestBody PerformanceAppraisalQuery query) {
IPage<SpmkApproveSummary> page = new Page<SpmkApproveSummary>(query.getCurrentPage(),query.getTotalPage());
IPage<SpmkApproveSummary> page = new Page<SpmkApproveSummary>(query.getCurrentPage(), query.getTotalPage());
query.setOrgCode(userBean.getOrgCode());
......@@ -775,8 +755,7 @@ public class JxglController {
List<JxglPerformanceAppraisal> listPA = pagePA.getRecords();
return ResultUtil.data(pagePA,listPA);
return ResultUtil.data(pagePA, listPA);
}
/**
......@@ -786,9 +765,9 @@ public class JxglController {
@ApiOperation(value = "9.查询-绩效考核-列表-非归档", httpMethod = "POST", notes = "查询-绩效考核-列表-非归档")
@ApiOperationSupport(order = 9)
@Role
public Result<Object> selectsPA(@CurrentUser UserBean userBean,@RequestBody PerformanceAppraisalQuery query){
public Result<Object> selectsPA(@CurrentUser UserBean userBean, @RequestBody PerformanceAppraisalQuery query) {
IPage<SpmkApproveSummary> page = new Page<SpmkApproveSummary>(query.getCurrentPage(),query.getTotalPage());
IPage<SpmkApproveSummary> page = new Page<SpmkApproveSummary>(query.getCurrentPage(), query.getTotalPage());
query.setOrgCode(userBean.getOrgCode());
......@@ -796,8 +775,7 @@ public class JxglController {
List<JxglPerformanceAppraisal> listPA = pagePA.getRecords();
return ResultUtil.data(pagePA,listPA);
return ResultUtil.data(pagePA, listPA);
}
/**
......@@ -807,16 +785,16 @@ public class JxglController {
@ApiOperation(value = "10.查询-考核-列表", httpMethod = "POST", notes = "查询-考核-列表")
@ApiOperationSupport(order = 10)
@Role
public Result<Object> selectsA(@CurrentUser UserBean userBean,@RequestBody AppraisalQuery query){
public Result<Object> selectsA(@CurrentUser UserBean userBean, @RequestBody AppraisalQuery query) {
IPage<JxglAppraisal> page = new Page<JxglAppraisal>(query.getCurrentPage(),query.getTotalPage());
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);
return ResultUtil.data(pageA, listPA);
}
......@@ -827,20 +805,22 @@ public class JxglController {
@ApiOperation(value = "11.查询-考核-详情", httpMethod = "GET", notes = "查询-考核-详情")
@ApiOperationSupport(order = 11)
@Role
public Result<Object> selectA(@CurrentUser UserBean userBean,@PathVariable Integer id){
public Result<Object> selectA(@CurrentUser UserBean userBean, @PathVariable Integer id) {
AppraisalDetail aD = jxglAppraisalMapper.selectDetailById(userBean.getOrgCode(), id);
if (aD != null) {
JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper.selectOne(new QueryWrapper<JxglPerformanceAppraisal>().lambda()
.eq(JxglPerformanceAppraisal::getId, aD.getPerformanceAppraisalId()));
JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper
.selectOne(new QueryWrapper<JxglPerformanceAppraisal>().lambda().eq(JxglPerformanceAppraisal::getId,
aD.getPerformanceAppraisalId()));
if (pA != null && pA.getIsVisible() == 0) {
return ResultUtil.data(aD);
}else {
} else {
List<JxglAppraisalAssessment> listAA = aD.getAppraisalAssessments();
if (listAA != null) {
listAA = listAA.stream().filter(a -> !userBean.getEmpNum().equals(a.getAssessorId())).collect(Collectors.toList());
listAA = listAA.stream().filter(a -> !userBean.getEmpNum().equals(a.getAssessorId()))
.collect(Collectors.toList());
aD.setAppraisalAssessments(listAA);
}
}
......@@ -857,20 +837,19 @@ public class JxglController {
@ApiOperation(value = "12.修改-流程执行人-转派", httpMethod = "PUT", notes = "修改-流程执行人-转派")
@ApiOperationSupport(order = 12)
@Role
public Result<Object> updatePN(@CurrentUser UserBean userBean,@Validated @RequestBody ProcessNodeUpdate processNodeUpdate){
public Result<Object> updatePN(@CurrentUser UserBean userBean,
@Validated @RequestBody ProcessNodeUpdate processNodeUpdate) {
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, processNodeUpdate.getAppraisalId())
.select(JxglAppraisal::getId));
.eq(JxglAppraisal::getId, processNodeUpdate.getAppraisalId()).select(JxglAppraisal::getId));
if (appraisal == null) {
return ResultUtil.error("考核 不存在");
return ResultUtil.error("考核不存在");
}
Integer count = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, processNodeUpdate.getAppraisalId())
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
.eq(JxglAppraisal::getId, processNodeUpdate.getAppraisalId()).in(JxglAppraisal::getSts,
AppraisalSts.ASSESSMENT_COMPLETE.getType(), AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count > 0) {
......@@ -900,65 +879,24 @@ public class JxglController {
@ApiOperation(value = "13.终止-考核", httpMethod = "PUT", notes = "终止-考核")
@ApiOperationSupport(order = 13)
@Role
public Result<Object> terminationAssessment(@CurrentUser UserBean userBean,@NotNull @RequestParam Integer id){
public Result<Object> terminationAssessment(@CurrentUser UserBean userBean, @NotNull @RequestParam Integer id) {
JxglAppraisal appraisal = jxglAppraisalMapper.selectById(id);
if (appraisal == null) {
return ResultUtil.error("考核 不存在");
}else if (appraisal.getSts() <= AppraisalSts.RESULT_VERIFICATION.getType() ) {
return ResultUtil.error("考核不存在");
} else if (appraisal.getSts() <= AppraisalSts.RESULT_VERIFICATION.getType()) {
JxglAppraisal.builder().id(id).sts(AppraisalSts.TERMINATION_ASSESSMENT.getType()).build().updateById();
}else if (appraisal.getSts() == AppraisalSts.ASSESSMENT_COMPLETE.getType()) {
} else if (appraisal.getSts() == AppraisalSts.ASSESSMENT_COMPLETE.getType()) {
return ResultUtil.error("考核已完成,无法终止");
}else if (appraisal.getSts() == AppraisalSts.TERMINATION_ASSESSMENT.getType()) {
} else if (appraisal.getSts() == AppraisalSts.TERMINATION_ASSESSMENT.getType()) {
return ResultUtil.error("考核已终止,无法重复终止");
}else if (appraisal.getSts() == AppraisalSts.PERFORMANCE_ARCHIVE.getType()) {
} else if (appraisal.getSts() == AppraisalSts.PERFORMANCE_ARCHIVE.getType()) {
return ResultUtil.error("考核已归档,无法终止");
}
return ResultUtil.success();
}
@Autowired
private JxglAppraisalAssessmentMapper appraisalAssessmentMapper;
@Autowired
private JxglProcessNodeMapper processNodeMapper;
/**
* 新增-考核评定
*/
@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 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("考核已结束");
}
Integer empNum = userBean.getEmpNum();
JxglProcessNode pN = processNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.in(JxglProcessNode::getProcessType, ProcessType.SELF_ASSESSMENT,ProcessType.SUPERIOR_SCORE));
if (pN == null) {
return ResultUtil.error("在该流程状态 无法评价");
}else if (!empNum.equals(pN.getExecutorId())) {
return ResultUtil.error("无权限 评价");
}
appraisalAssessment.setAssessorName(userBean.getUserInfo().getName());
appraisalAssessment.setAssessorId(userBean.getEmpNum());
appraisalAssessment.insert();
return ResultUtil.data(appraisalAssessment);
}
/**
* 查询-所有员工绩效-汇总
*/
......@@ -966,16 +904,16 @@ public class JxglController {
@ApiOperation(value = "14.查询-所有员工绩效-汇总", httpMethod = "POST", notes = "查询-所有员工绩效-汇总")
@ApiOperationSupport(order = 14)
@Role
public Result<Object> selectsEP(@CurrentUser UserBean userBean,@RequestBody EmpPerformanceQuery query){
public Result<Object> selectsEP(@CurrentUser UserBean userBean, @RequestBody EmpPerformanceQuery query) {
IPage<JxglAppraisal> page = new Page<JxglAppraisal>(query.getCurrentPage(),query.getTotalPage());
IPage<JxglAppraisal> page = new Page<JxglAppraisal>(query.getCurrentPage(), query.getTotalPage());
query.setOrgCode(userBean.getOrgCode());
IPage<JxglAppraisal> pageA = jxglAppraisalMapper.selectListEmpByQuery(page, query);
List<JxglAppraisal> listA = pageA.getRecords();
return ResultUtil.data(pageA,listA);
return ResultUtil.data(pageA, listA);
}
......@@ -986,16 +924,17 @@ public class JxglController {
@ApiOperation(value = "15.查询-某员工考核-列表", httpMethod = "POST", notes = "查询-某员工考核-列表")
@ApiOperationSupport(order = 15)
@Role
public Result<Object> selectsEA(@CurrentUser UserBean userBean,@RequestBody EmpAppraisalQuery query){
public Result<Object> selectsEA(@CurrentUser UserBean userBean,@Validated @RequestBody EmpAppraisalQuery query) {
IPage<JxglPerformanceAppraisal> page = new Page<JxglPerformanceAppraisal>(query.getCurrentPage(),query.getTotalPage());
IPage<JxglPerformanceAppraisal> page = new Page<JxglPerformanceAppraisal>(query.getCurrentPage(),
query.getTotalPage());
query.setOrgCode(userBean.getOrgCode());
IPage<JxglPerformanceAppraisal> pagePA = jxglPerformanceAppraisalMapper.selectListEmpByQuery(page, query);
List<JxglPerformanceAppraisal> listPA = pagePA.getRecords();
return ResultUtil.data(pagePA,listPA);
return ResultUtil.data(pagePA, listPA);
}
......@@ -1006,23 +945,17 @@ public class JxglController {
@ApiOperation(value = "16.查询-绩效考核-方案", httpMethod = "GET", notes = "查询-绩效考核-方案")
@ApiOperationSupport(order = 16)
@Role
public Result<Object> selectPA(@CurrentUser UserBean userBean,@PathVariable Integer id){
public Result<Object> selectPA(@CurrentUser UserBean userBean, @PathVariable Integer id) {
JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper.selectById(id);
if (pA == null) {
return ResultUtil.error("方案不存在");
}
PerformanceAppraisal paDto = PerformanceAppraisal.builder()
.name(pA.getName())
.period(pA.getPeriod())
.appraisalStartTime(pA.getAppraisalStartTime())
.appraisalEndTime(pA.getAppraisalEndTime())
.isVisible(pA.getIsVisible())
.scope(pA.getScope())
.appraisalTName(pA.getAppraisalTName())
PerformanceAppraisal paDto = PerformanceAppraisal.builder().name(pA.getName()).period(pA.getPeriod())
.appraisalStartTime(pA.getAppraisalStartTime()).appraisalEndTime(pA.getAppraisalEndTime())
.isVisible(pA.getIsVisible()).scope(pA.getScope()).appraisalTName(pA.getAppraisalTName())
.processNode(ObjectUtil.deserialize(pA.getProcessNode()))
.beingAppraisalPerson(ObjectUtil.deserialize(pA.getBeingAppraisalPerson()))
.build();
.beingAppraisalPerson(ObjectUtil.deserialize(pA.getBeingAppraisalPerson())).build();
return ResultUtil.data(paDto);
......@@ -1034,7 +967,7 @@ public class JxglController {
@PostMapping(value = "/selects_my_performance")
@ApiOperation(value = "17.查询-我的绩效-列表", httpMethod = "POST", notes = "查询-我的绩效-列表")
@ApiOperationSupport(order = 17)
public Result<Object> selects(@CurrentUser UserBean userBean,@RequestBody MyPerformance query){
public Result<Object> selects(@CurrentUser UserBean userBean,@Validated @RequestBody MyPerformance query) {
IPage<JxglPerformanceAppraisal> page = new Page<JxglPerformanceAppraisal>(query.getCurrentPage(),query.getTotalPage());
query.setOrgCode(userBean.getOrgCode());
......@@ -1043,53 +976,38 @@ public class JxglController {
List<JxglPerformanceAppraisal> listPA = pagePA.getRecords();
return ResultUtil.data(pagePA,listPA);
return ResultUtil.data(pagePA, listPA);
}
@Autowired
private JxglProcessNodeMapper jxglProcessNodeMapper;
@Autowired
private JxglAppraisalItemMapper jxglAppraisalItemMapper;
/**
* 目标填写-保存
*/
@PostMapping(value = "/save_target_fill")
@ApiOperation(value = "17.目标填写-保存", httpMethod = "POST", notes = "目标填写-保存")
@ApiOperationSupport(order = 17)
public Result<Object> saveTF(@CurrentUser UserBean userBean,@RequestBody AppraisalUpdate appraisalUpdate) throws Exception{
public Result<Object> saveTF(@CurrentUser UserBean userBean, @RequestBody AppraisalUpdate appraisalUpdate)
throws Exception {
Integer id = appraisalUpdate.getId();
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id)
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
.eq(JxglAppraisal::getId, id).in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(), AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) {
return ResultUtil.error("考核已结束");
}
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id)
.select(JxglAppraisal::getId));
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(
new QueryWrapper<JxglAppraisal>().lambda().eq(JxglAppraisal::getId, id).select(JxglAppraisal::getId));
if (appraisal == null) {
return ResultUtil.error("考核不存在");
}
List<JxglAppraisalIndicators> listAI2 = appraisalUpdate.getAppraisalIndicators();
if (listAI2 == null) {
return ResultUtil.error("考核指标不能为空");
}
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(
new QueryWrapper<JxglProcessNode>().lambda().eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) {
return ResultUtil.error("流程不存在");
......@@ -1098,20 +1016,22 @@ public class JxglController {
if (ProcessType.TARGET_FILL_IN.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程");
return ResultUtil.error("无权限操作该流程");
}
}else {
} else {
return ResultUtil.error("流程状态异常");
}
// 查找 非固定 考核指标
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda()
.select(JxglAppraisalIndicators::getId)
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper
.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda().select(JxglAppraisalIndicators::getId)
.eq(JxglAppraisalIndicators::getType, IndicatorsType.NOT_FIXATION.getType())
.eq(JxglAppraisalIndicators::getAppraisalId, id));
List<Integer> appraisalIndicatorIds = listAI != null ? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList()) : null;
List<Integer> appraisalIndicatorIds = listAI != null
? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList())
: null;
if (appraisalIndicatorIds != null) {
......@@ -1125,6 +1045,9 @@ public class JxglController {
.eq(JxglAppraisalIndicators::getType, IndicatorsType.NOT_FIXATION.getType())
.eq(JxglAppraisalIndicators::getAppraisalId, id));
List<JxglAppraisalIndicators> listAI2 = appraisalUpdate.getAppraisalIndicators();
if (listAI2 != null) {
listAI2.forEach(aI -> {
aI.setAppraisalId(id);
aI.setType(IndicatorsType.NOT_FIXATION.getType());
......@@ -1136,27 +1059,14 @@ public class JxglController {
aItem.insert();
}
}
}else {
} else {
throw new CustomException("保存异常");
}
});
listAI = jxglAppraisalIndicatorsMapper.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda()
.select(JxglAppraisalIndicators::getWeight)
.eq(JxglAppraisalIndicators::getAppraisalId, id));
List<Integer> listWeight = listAI.stream().map(JxglAppraisalIndicators::getWeight).collect(Collectors.toList());
Integer weightSum = 0;
if (listWeight != null && listWeight.size() > 0) {
for (Integer i : listWeight) {
weightSum += i;
System.out.println("权重:"+ i);
}
if (!weightSum.equals(100))
return ResultUtil.error("权重总和要等于 100%");
}
return ResultUtil.success();
}
......@@ -1166,28 +1076,25 @@ public class JxglController {
@PostMapping(value = "/submit_target_fill")
@ApiOperation(value = "17.目标填写-提交", httpMethod = "POST", notes = "目标填写-提交")
@ApiOperationSupport(order = 17)
public Result<Object> submitTF(@CurrentUser UserBean userBean,@RequestParam Integer id){
public Result<Object> submitTF(@CurrentUser UserBean userBean, @RequestParam Integer id) {
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id)
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
.eq(JxglAppraisal::getId, id).in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(), AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) {
return ResultUtil.error("考核已结束");
}
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id)
.select(JxglAppraisal::getId));
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(
new QueryWrapper<JxglAppraisal>().lambda().eq(JxglAppraisal::getId, id).select(JxglAppraisal::getId));
if (appraisal == null) {
return ResultUtil.error("考核不存在");
}
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(
new QueryWrapper<JxglProcessNode>().lambda().eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) {
return ResultUtil.error("流程不存在");
......@@ -1196,16 +1103,18 @@ public class JxglController {
if (ProcessType.TARGET_FILL_IN.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程");
return ResultUtil.error("无权限操作该流程");
}
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda()
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper
.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda()
.eq(JxglAppraisalIndicators::getAppraisalId, appraisal.getId()));
if (listAI == null) {
return ResultUtil.error("考核指标不能为空");
}
List<Integer> listWeight = listAI.stream().map(JxglAppraisalIndicators::getWeight).collect(Collectors.toList());
List<Integer> listWeight = listAI.stream().map(JxglAppraisalIndicators::getWeight)
.collect(Collectors.toList());
Integer weightSum = 0;
if (listWeight != null && listWeight.size() > 0) {
for (Integer i : listWeight) {
......@@ -1215,24 +1124,19 @@ public class JxglController {
return ResultUtil.error("权重总和要等于 100%");
}
// 修改 目标填写 状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.EXECUTED.getType())
.build()
JxglProcessNode.builder().sts(ProcessNodeSts.EXECUTED.getType()).build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
// 修改 下一个节点状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.IN_EXECUTION.getType())
.build()
JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getProcessType, ProcessType.TARGET_CONFIRMED.getType()));
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(id).sts(AppraisalSts.TARGET_CONFIRMED.getType()).build());
jxglAppraisalMapper
.updateById(JxglAppraisal.builder().id(id).sts(AppraisalSts.TARGET_CONFIRMED.getType()).build());
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setAppraisalId(appraisal.getId());
......@@ -1241,12 +1145,11 @@ public class JxglController {
appraisalLog.setType(AppraisalLogType.TARGET_FILL_IN.getType());
appraisalLog.insert();
}else {
} else {
return ResultUtil.error("流程状态异常");
}
return ResultUtil.success();
}
/**
......@@ -1255,28 +1158,25 @@ public class JxglController {
@PostMapping(value = "/update_target_confirmed")
@ApiOperation(value = "18.目标确认-同意", httpMethod = "POST", notes = "目标确认-同意")
@ApiOperationSupport(order = 18)
public Result<Object> updateTC(@CurrentUser UserBean userBean,@RequestParam Integer id){
public Result<Object> updateTC(@CurrentUser UserBean userBean, @RequestParam Integer id) {
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id)
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
.eq(JxglAppraisal::getId, id).in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(), AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) {
return ResultUtil.error("考核已结束");
}
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id)
.select(JxglAppraisal::getId));
.eq(JxglAppraisal::getId, id).select(JxglAppraisal::getId, JxglAppraisal::getPerformanceAppraisalId));
if (appraisal == null) {
return ResultUtil.error("考核不存在");
}
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(
new QueryWrapper<JxglProcessNode>().lambda().eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) {
return ResultUtil.error("流程不存在");
......@@ -1285,41 +1185,34 @@ public class JxglController {
if (ProcessType.TARGET_CONFIRMED.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程");
return ResultUtil.error("无权限操作该流程");
}
// 修改 目标确认 状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.EXECUTED.getType())
.build()
JxglProcessNode.builder().sts(ProcessNodeSts.EXECUTED.getType()).build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper.selectById(appraisal.getPerformanceAppraisalId());
JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper
.selectById(appraisal.getPerformanceAppraisalId());
if (pA != null && pA.getSts() > PerformanceAppraisalSts.TARGET_SETING.getType()) {
// 修改 下一个节点状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.IN_EXECUTION.getType())
.build()
JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getProcessType, ProcessType.SELF_ASSESSMENT.getType()));
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.SELF_ASSESSMENT.getType()).build());
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId())
.sts(AppraisalSts.SELF_ASSESSMENT.getType()).build());
}
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setAppraisalId(appraisal.getId());
appraisalLog.setExecutorId(userBean.getEmpNum());
appraisalLog.setExecutorName(userBean.getUserInfo().getName());
appraisalLog.setType(AppraisalLogType.TARGET_CONFIRMED.getType());
appraisalLog.insert();
}else {
} else {
return ResultUtil.error("流程状态异常");
}
......@@ -1333,28 +1226,26 @@ public class JxglController {
@PostMapping(value = "/update_target_confirmed_reject")
@ApiOperation(value = "18.目标确认-驳回目标", httpMethod = "POST", notes = "目标确认-驳回目标")
@ApiOperationSupport(order = 18)
public Result<Object> updateTCR(@CurrentUser UserBean userBean, @RequestBody AppraisalReject appraisalReject){
public Result<Object> updateTCR(@CurrentUser UserBean userBean, @RequestBody AppraisalReject appraisalReject) {
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalReject.getId())
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
Integer count2 = jxglAppraisalMapper.selectCount(
new QueryWrapper<JxglAppraisal>().lambda().eq(JxglAppraisal::getId, appraisalReject.getId()).in(
JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(), AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) {
return ResultUtil.error("考核已结束");
}
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalReject.getId())
.select(JxglAppraisal::getId));
.eq(JxglAppraisal::getId, appraisalReject.getId()).select(JxglAppraisal::getId));
if (appraisal == null) {
return ResultUtil.error("考核 不存在");
return ResultUtil.error("考核不存在");
}
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(
new QueryWrapper<JxglProcessNode>().lambda().eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) {
......@@ -1364,29 +1255,22 @@ public class JxglController {
if (ProcessType.TARGET_CONFIRMED.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程");
return ResultUtil.error("无权限操作该流程");
}
// 修改 目标确认 状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.NON_EXECUTION.getType())
.build()
JxglProcessNode.builder().sts(ProcessNodeSts.NON_EXECUTION.getType()).build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.in(JxglProcessNode::getProcessType, ProcessType.TARGET_CONFIRMED.getType())
);
.in(JxglProcessNode::getProcessType, ProcessType.TARGET_CONFIRMED.getType()));
JxglProcessNode
.builder()
.sts(ProcessNodeSts.IN_EXECUTION.getType())
.build()
JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getProcessType, ProcessType.TARGET_FILL_IN.getType()));
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.TARGET_FILL_IN.getType()).build());
jxglAppraisalMapper.updateById(
JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.TARGET_FILL_IN.getType()).build());
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setRemarks(appraisalReject.getRejectReason());
......@@ -1396,7 +1280,7 @@ public class JxglController {
appraisalLog.setType(AppraisalLogType.TARGET_DISMISS.getType());
appraisalLog.insert();
}else {
} else {
return ResultUtil.error("流程状态异常");
}
......@@ -1410,28 +1294,26 @@ public class JxglController {
@PostMapping(value = "/update_superior_score_reject")
@ApiOperation(value = "19.上级评价 -驳回目标", httpMethod = "POST", notes = "上级评价 -驳回目标")
@ApiOperationSupport(order = 19)
public Result<Object> updateSSR(@CurrentUser UserBean userBean, @RequestBody AppraisalReject appraisalReject){
public Result<Object> updateSSR(@CurrentUser UserBean userBean, @RequestBody AppraisalReject appraisalReject) {
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalReject.getId())
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
Integer count2 = jxglAppraisalMapper.selectCount(
new QueryWrapper<JxglAppraisal>().lambda().eq(JxglAppraisal::getId, appraisalReject.getId()).in(
JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(), AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) {
return ResultUtil.error("考核已结束");
}
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalReject.getId())
.select(JxglAppraisal::getId));
.eq(JxglAppraisal::getId, appraisalReject.getId()).select(JxglAppraisal::getId));
if (appraisal == null) {
return ResultUtil.error("考核 不存在");
return ResultUtil.error("考核不存在");
}
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(
new QueryWrapper<JxglProcessNode>().lambda().eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) {
return ResultUtil.error("流程不存在");
......@@ -1440,25 +1322,16 @@ public class JxglController {
if (ProcessType.SUPERIOR_SCORE.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程");
return ResultUtil.error("无权限操作该流程");
}
// 修改 目标确认 状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.NON_EXECUTION.getType())
.build()
JxglProcessNode.builder().sts(ProcessNodeSts.NON_EXECUTION.getType()).build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.in(JxglProcessNode::getProcessType, ProcessType.TARGET_CONFIRMED.getType(),
ProcessType.SELF_ASSESSMENT.getType())
);
JxglProcessNode
.builder()
.sts(ProcessNodeSts.IN_EXECUTION.getType())
.build()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()).in(JxglProcessNode::getProcessType,
ProcessType.TARGET_CONFIRMED.getType(), ProcessType.SELF_ASSESSMENT.getType()));
JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getProcessType, ProcessType.TARGET_FILL_IN.getType()));
......@@ -1468,16 +1341,19 @@ public class JxglController {
.eq(JxglAppraisalAssessment::getAppraisalId, appraisal.getId())
.eq(JxglAppraisalAssessment::getType, AssessmentType.SELF_ASSESSMENT.getType()));
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda()
.select(JxglAppraisalIndicators::getId)
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(
new QueryWrapper<JxglAppraisalIndicators>().lambda().select(JxglAppraisalIndicators::getId)
.eq(JxglAppraisalIndicators::getAppraisalId, appraisal.getId()));
List<Integer> listAIId = listAI != null && listAI.size() > 0 ? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList()) : null;
List<Integer> listAIId = listAI != null && listAI.size() > 0
? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList())
: null;
// 删除 考核指标评定-自评
jxglAppraisalIndicatorsAssessmentMapper.delete(new QueryWrapper<JxglAppraisalIndicatorsAssessment>().lambda()
.in(JxglAppraisalIndicatorsAssessment::getAppraisalIndicatorsId, listAIId)
jxglAppraisalIndicatorsAssessmentMapper.delete(new QueryWrapper<JxglAppraisalIndicatorsAssessment>()
.lambda().in(JxglAppraisalIndicatorsAssessment::getAppraisalIndicatorsId, listAIId)
.eq(JxglAppraisalIndicatorsAssessment::getType, AssessmentType.SELF_ASSESSMENT.getType()));
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.TARGET_FILL_IN.getType()).build());
jxglAppraisalMapper.updateById(
JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.TARGET_FILL_IN.getType()).build());
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setRemarks(appraisalReject.getRejectReason());
......@@ -1487,7 +1363,7 @@ public class JxglController {
appraisalLog.setType(AppraisalLogType.TARGET_DISMISS.getType());
appraisalLog.insert();
}else {
} else {
return ResultUtil.error("流程状态异常");
}
......@@ -1501,28 +1377,26 @@ public class JxglController {
@PostMapping(value = "/update_superior_reject_score")
@ApiOperation(value = "20.上级评价 -驳回评分", httpMethod = "POST", notes = "上级评价 -驳回评分")
@ApiOperationSupport(order = 20)
public Result<Object> updateSRS(@CurrentUser UserBean userBean, @RequestBody AppraisalReject appraisalReject){
public Result<Object> updateSRS(@CurrentUser UserBean userBean,@Validated @RequestBody AppraisalReject appraisalReject) {
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalReject.getId())
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
Integer count2 = jxglAppraisalMapper.selectCount(
new QueryWrapper<JxglAppraisal>().lambda().eq(JxglAppraisal::getId, appraisalReject.getId()).in(
JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(), AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) {
return ResultUtil.error("考核已结束");
}
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalReject.getId())
.select(JxglAppraisal::getId));
.eq(JxglAppraisal::getId, appraisalReject.getId()).select(JxglAppraisal::getId));
if (appraisal == null) {
return ResultUtil.error("考核不存在");
}
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(
new QueryWrapper<JxglProcessNode>().lambda().eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) {
return ResultUtil.error("流程不存在");
......@@ -1535,20 +1409,13 @@ public class JxglController {
}
// 修改 状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.NON_EXECUTION.getType())
.build()
JxglProcessNode.builder().sts(ProcessNodeSts.NON_EXECUTION.getType()).build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getProcessType, ProcessType.SUPERIOR_SCORE.getType())
);
.eq(JxglProcessNode::getProcessType, ProcessType.SUPERIOR_SCORE.getType()));
// 修改 上一个节点状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.IN_EXECUTION.getType())
.build()
JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getProcessType, ProcessType.SELF_ASSESSMENT.getType()));
......@@ -1558,16 +1425,19 @@ public class JxglController {
.eq(JxglAppraisalAssessment::getAppraisalId, appraisal.getId())
.eq(JxglAppraisalAssessment::getType, AssessmentType.SELF_ASSESSMENT.getType()));
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda()
.select(JxglAppraisalIndicators::getId)
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(
new QueryWrapper<JxglAppraisalIndicators>().lambda().select(JxglAppraisalIndicators::getId)
.eq(JxglAppraisalIndicators::getAppraisalId, appraisal.getId()));
List<Integer> listAIId = listAI != null && listAI.size() > 0 ? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList()) : null;
List<Integer> listAIId = listAI != null && listAI.size() > 0
? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList())
: null;
// 删除 考核指标评定-自评
jxglAppraisalIndicatorsAssessmentMapper.delete(new QueryWrapper<JxglAppraisalIndicatorsAssessment>().lambda()
.in(JxglAppraisalIndicatorsAssessment::getAppraisalIndicatorsId, listAIId)
jxglAppraisalIndicatorsAssessmentMapper.delete(new QueryWrapper<JxglAppraisalIndicatorsAssessment>()
.lambda().in(JxglAppraisalIndicatorsAssessment::getAppraisalIndicatorsId, listAIId)
.eq(JxglAppraisalIndicatorsAssessment::getType, AssessmentType.SELF_ASSESSMENT.getType()));
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.SELF_ASSESSMENT.getType()).build());
jxglAppraisalMapper.updateById(
JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.SELF_ASSESSMENT.getType()).build());
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setRemarks(appraisalReject.getRejectReason());
......@@ -1577,7 +1447,7 @@ public class JxglController {
appraisalLog.setType(AppraisalLogType.SCORE_DISMISS.getType());
appraisalLog.insert();
}else {
} else {
return ResultUtil.error("流程状态异常");
}
......@@ -1591,101 +1461,86 @@ public class JxglController {
@PostMapping(value = "/save_score")
@ApiOperation(value = "22.评分提交", httpMethod = "POST", notes = "评分提交")
@ApiOperationSupport(order = 22)
public Result<Object> saveScore(@CurrentUser UserBean userBean,@Validated @RequestBody ValidList<AppraisalAssessment> appraisalAssessments){
public Result<Object> saveScore(@CurrentUser UserBean userBean,
@Validated @RequestBody ValidList<AppraisalAssessment> appraisalAssessments) {
Integer appraisalId = appraisalAssessments.get(0).getAppraisalId();
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalId)
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
Integer count = jxglAppraisalMapper
.selectCount(new QueryWrapper<JxglAppraisal>().lambda().eq(JxglAppraisal::getId, appraisalId).in(
JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(), AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) {
if (count > 0) {
return ResultUtil.error("考核已结束");
}
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalId)
.select(JxglAppraisal::getId));
JxglAppraisal appraisal = jxglAppraisalMapper
.selectOne(new QueryWrapper<JxglAppraisal>().lambda().eq(JxglAppraisal::getId, appraisalId)
.select(JxglAppraisal::getId, JxglAppraisal::getPerformanceAppraisalId));
if (appraisal == null) {
return ResultUtil.error("考核不存在");
}
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(
new QueryWrapper<JxglProcessNode>().lambda().eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) {
return ResultUtil.error("流程不存在");
}
if (ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType() ||
ProcessType.SUPERIOR_SCORE.getType() == processNode.getProcessType()) {
if (ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType()
|| ProcessType.SUPERIOR_SCORE.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程");
return ResultUtil.error("无权限操作该流程");
}
appraisalAssessments.stream().forEach(a -> {
Integer type = ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType() ? AssessmentType.SELF_ASSESSMENT.getType() : AssessmentType.SUPERIOR_SCORE.getType();
Integer type = ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType()
? AssessmentType.SELF_ASSESSMENT.getType()
: AssessmentType.SUPERIOR_SCORE.getType();
if (a.getAppraisalIndicatorsId() != null) {
JxglAppraisalIndicatorsAssessment.builder()
.appraisalIndicatorsId(a.getAppraisalIndicatorsId())
.assessorId(userBean.getEmpNum())
.assessorName(userBean.getUserInfo().getName())
.score(a.getScore())
.remarks(a.getRemarks())
.type(type)
.build()
.insert();
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.SUPERIOR_SCORE.getType()).build());
}else {
JxglAppraisalAssessment.builder()
.appraisalId(a.getAppraisalId())
.assessorId(userBean.getEmpNum())
.assessorName(userBean.getUserInfo().getName())
.comprehensiveScore(a.getScore())
.remarks(a.getRemarks())
.type(type)
.level(a.getLevel())
.build()
.insert();
JxglAppraisalIndicatorsAssessment.builder().appraisalIndicatorsId(a.getAppraisalIndicatorsId())
.assessorId(userBean.getEmpNum()).assessorName(userBean.getUserInfo().getName())
.score(a.getScore()).remarks(a.getRemarks()).type(type).build().insert();
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId())
.sts(AppraisalSts.SUPERIOR_SCORE.getType()).build());
} else {
JxglAppraisalAssessment.builder().appraisalId(a.getAppraisalId()).assessorId(userBean.getEmpNum())
.assessorName(userBean.getUserInfo().getName()).comprehensiveScore(a.getScore())
.remarks(a.getRemarks()).type(type).level(a.getLevel()).build().insert();
// jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.RESULT_VERIFICATION.getType()).build());
}
});
// 修改 状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.EXECUTED.getType())
.build()
JxglProcessNode.builder().sts(ProcessNodeSts.EXECUTED.getType()).build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
JxglProcessNode
.builder()
.sts(ProcessNodeSts.IN_EXECUTION.getType())
.build()
JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(ProcessType.SUPERIOR_SCORE.getType() == processNode.getProcessType(), JxglProcessNode::getProcessType, ProcessType.RESULT_VERIFICATION.getType())
.eq(ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType(), JxglProcessNode::getProcessType, ProcessType.SUPERIOR_SCORE.getType()));
.eq(ProcessType.SUPERIOR_SCORE.getType() == processNode.getProcessType(),
JxglProcessNode::getProcessType, ProcessType.RESULT_VERIFICATION.getType())
.eq(ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType(),
JxglProcessNode::getProcessType, ProcessType.SUPERIOR_SCORE.getType()));
JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper.selectById(appraisal.getPerformanceAppraisalId());
JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper
.selectById(appraisal.getPerformanceAppraisalId());
if (pA != null && pA.getSts() > PerformanceAppraisalSts.PERFORMANCE_SCORE.getType()) {
if (ProcessType.SUPERIOR_SCORE.getType() == processNode.getProcessType()) {
jxglAppraisalMapper.updateById(JxglAppraisal.builder()
.id(appraisal.getId())
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId())
.sts(AppraisalSts.RESULT_VERIFICATION.getType()).build());
}
......@@ -1695,10 +1550,12 @@ public class JxglController {
appraisalLog.setAppraisalId(appraisal.getId());
appraisalLog.setExecutorId(userBean.getEmpNum());
appraisalLog.setExecutorName(userBean.getUserInfo().getName());
appraisalLog.setType(ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType() ? AppraisalLogType.SELF_ASSESSMENT.getType() : AppraisalLogType.SUPERIOR_SCORE.getType());
appraisalLog.setType(ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType()
? AppraisalLogType.SELF_ASSESSMENT.getType()
: AppraisalLogType.SUPERIOR_SCORE.getType());
appraisalLog.insert();
}else {
} else {
return ResultUtil.error("流程状态异常");
}
......@@ -1711,28 +1568,25 @@ public class JxglController {
@PostMapping(value = "/result_verification")
@ApiOperation(value = "23.结果确认-确认", httpMethod = "POST", notes = "结果确认-确认")
@ApiOperationSupport(order = 23)
public Result<Object> resultVerification(@CurrentUser UserBean userBean,@RequestParam Integer id){
public Result<Object> resultVerification(@CurrentUser UserBean userBean, @RequestParam Integer id) {
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id)
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
Integer count = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id).in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(), AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) {
if (count > 0) {
return ResultUtil.error("考核已结束");
}
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id)
.select(JxglAppraisal::getId));
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(
new QueryWrapper<JxglAppraisal>().lambda().eq(JxglAppraisal::getId, id).select(JxglAppraisal::getId));
if (appraisal == null) {
return ResultUtil.error("考核 不存在");
return ResultUtil.error("考核不存在");
}
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(
new QueryWrapper<JxglProcessNode>().lambda().eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) {
return ResultUtil.error("流程不存在");
......@@ -1741,21 +1595,17 @@ public class JxglController {
if (ProcessType.RESULT_VERIFICATION.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程");
return ResultUtil.error("无权限操作该流程");
}
// 修改 状态
JxglProcessNode
.builder()
.sts(ProcessNodeSts.EXECUTED.getType())
.build()
JxglProcessNode.builder().sts(ProcessNodeSts.EXECUTED.getType()).build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
jxglAppraisalMapper.updateById(JxglAppraisal.builder()
.id(id)
.sts(AppraisalSts.ASSESSMENT_COMPLETE.getType()).build());
jxglAppraisalMapper
.updateById(JxglAppraisal.builder().id(id).sts(AppraisalSts.ASSESSMENT_COMPLETE.getType()).build());
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setAppraisalId(appraisal.getId());
......@@ -1764,7 +1614,7 @@ public class JxglController {
appraisalLog.setType(AppraisalLogType.RESULT_VERIFICATION.getType());
appraisalLog.insert();
}else {
} else {
return ResultUtil.error("流程状态异常");
}
......@@ -1777,12 +1627,12 @@ public class JxglController {
@PostMapping(value = "/change_score")
@ApiOperation(value = "24.结果确认-改分", httpMethod = "POST", notes = "结果确认-改分")
@ApiOperationSupport(order = 24)
public Result<Object> changeScore(@CurrentUser UserBean userBean,@Validated @RequestBody AppraisalAssessment appraisalAssessment){
public Result<Object> changeScore(@CurrentUser UserBean userBean,
@Validated @RequestBody AppraisalAssessment appraisalAssessment) {
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalAssessment.getAppraisalId())
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
.eq(JxglAppraisal::getId, appraisalAssessment.getAppraisalId()).in(JxglAppraisal::getSts,
AppraisalSts.ASSESSMENT_COMPLETE.getType(), AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) {
......@@ -1790,15 +1640,14 @@ public class JxglController {
}
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalAssessment.getAppraisalId())
.select(JxglAppraisal::getId));
.eq(JxglAppraisal::getId, appraisalAssessment.getAppraisalId()).select(JxglAppraisal::getId));
if (appraisal == null) {
return ResultUtil.error("考核 不存在");
return ResultUtil.error("考核不存在");
}
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(
new QueryWrapper<JxglProcessNode>().lambda().eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) {
return ResultUtil.error("流程不存在");
......@@ -1807,14 +1656,11 @@ public class JxglController {
if (ProcessType.RESULT_VERIFICATION.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程");
return ResultUtil.error("无权限操作该流程");
}
JxglAppraisalAssessment.builder()
.id(appraisalAssessment.getAppraisalAssessmentId())
.comprehensiveScore(appraisalAssessment.getScore())
.level(appraisalAssessment.getLevel())
.build()
JxglAppraisalAssessment.builder().id(appraisalAssessment.getAppraisalAssessmentId())
.comprehensiveScore(appraisalAssessment.getScore()).level(appraisalAssessment.getLevel()).build()
.updateById();
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
......@@ -1825,7 +1671,7 @@ public class JxglController {
appraisalLog.setType(AppraisalLogType.UPDATE_SCORE.getType());
appraisalLog.insert();
}else {
} else {
return ResultUtil.error("流程状态异常");
}
......@@ -1839,16 +1685,14 @@ public class JxglController {
@ApiOperation(value = "25.查询-我的绩效-员工绩效", httpMethod = "POST", notes = "查询-我的绩效-员工绩效")
@ApiOperationSupport(order = 25)
@Role
public Result<Object> selectsMEP(@CurrentUser UserBean userBean,@RequestBody EmpPerformanceQuery query){
public Result<Object> selectsMEP(@CurrentUser UserBean userBean, @RequestBody EmpPerformanceQuery query) {
Integer orgCode = userBean.getOrgCode();
Integer empNum = userBean.getEmpNum();
IPage<JxglAppraisal> page = new Page<JxglAppraisal>(query.getCurrentPage(),query.getTotalPage());
IPage<JxglAppraisal> page = new Page<JxglAppraisal>(query.getCurrentPage(), query.getTotalPage());
query.setOrgCode(orgCode);
List<ZzglBmgwM> listBM = zzglBmgwMMapper.selectList(new QueryWrapper<ZzglBmgwM>().lambda()
.select(ZzglBmgwM::getId)
.eq(ZzglBmgwM::getOrgCode, userBean.getOrgCode())
.eq(ZzglBmgwM::getLeader, empNum));
List<ZzglBmgwM> listBM = zzglBmgwMMapper.selectList(new QueryWrapper<ZzglBmgwM>().lambda().select(ZzglBmgwM::getId)
.eq(ZzglBmgwM::getOrgCode, userBean.getOrgCode()).eq(ZzglBmgwM::getLeader, empNum));
ZzglBmgwM ZzglBmgwM = CollUtil.getFirst(listBM);
if (ZzglBmgwM == null) {
return ResultUtil.success();
......@@ -1856,7 +1700,7 @@ public class JxglController {
List<YgglMainEmp> users = zzglBmgwMService.selectOtherlistent(orgCode, ZzglBmgwM.getId());
List<Integer> empNums = null;
if (users != null ) {
if (users != null) {
empNums = users.stream().map(YgglMainEmp::getEmpNum).collect(Collectors.toList());
}
query.setEmpNums(empNums);
......@@ -1864,11 +1708,8 @@ public class JxglController {
List<JxglAppraisal> listA = pageA.getRecords();
return ResultUtil.data(pageA,listA);
return ResultUtil.data(pageA, listA);
}
}
......@@ -2,6 +2,9 @@ package cn.timer.api.dto.jxgl;
import java.io.Serializable;
import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
......@@ -19,6 +22,7 @@ public class AppraisalAssessment implements Serializable{
*/
private static final long serialVersionUID = 1L;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "考核id", example = "1")
private Integer appraisalId;
......@@ -28,6 +32,7 @@ public class AppraisalAssessment implements Serializable{
@ApiModelProperty(value = "考核评定id", example = "1")
private Integer appraisalAssessmentId;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "评分", example = "86")
private String score;
......
......@@ -28,7 +28,7 @@ public class AppraisalQuery extends Page{
@ApiModelProperty(value = "姓名、手机号", example = "")
private String query;
@Max(value = 4,message = ValidationMsg.MAX+" 只能为 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7绩效归档")
@Max(value = 7,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;
......
package cn.timer.api.dto.jxgl;
import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
......@@ -12,6 +15,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public class AppraisalReject {
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "考核id", example = "")
private Integer id;
......
......@@ -4,11 +4,14 @@ import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.validation.constraints.NotNull;
import com.baomidou.mybatisplus.annotation.TableField;
import cn.timer.api.bean.jxgl.JxglAppraisal;
import cn.timer.api.bean.jxgl.JxglAppraisalIndicators;
import cn.timer.api.bean.jxgl.JxglAppraisalItem;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
......@@ -26,6 +29,7 @@ public class AppraisalUpdate implements Serializable{
*/
private static final long serialVersionUID = 1L;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "考核id", example = "16")
private Integer id;
......
package cn.timer.api.dto.jxgl;
import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
......@@ -12,9 +15,11 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public class AppraisalUpdateSts {
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "绩效考核id", example = "")
private Integer id;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "状态", example = "")
private Integer sts;
......
package cn.timer.api.dto.jxgl;
import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg;
import cn.timer.api.utils.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -16,7 +13,6 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public class MyPerformance extends Page {
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "员工id", example = "")
private Integer id;
......
......@@ -5,6 +5,7 @@ import java.util.Date;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.validation.constraints.NotNull;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
......@@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import cn.timer.api.bean.jxgl.JxglProcessNode;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
......@@ -29,12 +31,15 @@ public class ProcessNodeUpdate implements Serializable{
*/
private static final long serialVersionUID = 1L;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "编号", example = "10")
private Integer id;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "考核id", example = "10")
private Integer appraisalId;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "执行人id(员工id)", example = "10")
private Integer executorId;
......
......@@ -11,6 +11,7 @@
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="type" property="type" />
<result column="is_edit_weight" property="isEditWeight" />
</resultMap>
<sql id="Base_Column_List">
......@@ -20,7 +21,8 @@
weight,
create_time,
update_time,
type
type,
is_edit_weight
</sql>
<sql id="Base_Column_List_Alias">
......@@ -30,7 +32,8 @@
weight JxglAppraisalIndicators_weight,
create_time JxglAppraisalIndicators_create_time,
update_time JxglAppraisalIndicators_update_time,
type JxglAppraisalIndicators_type
type JxglAppraisalIndicators_type,
is_edit_weight JxglAppraisalIndicators_is_edit_weight
</sql>
<!--
......@@ -54,7 +57,10 @@
update_time,
</if>
<if test ='null != type'>
type
type,
</if>
<if test ='null != isEditWeight'>
is_edit_weight
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
......@@ -74,7 +80,10 @@
#{updateTime},
</if>
<if test ='null != type'>
#{type}
#{type},
</if>
<if test ='null != isEditWeight'>
#{isEditWeight}
</if>
</trim>
</insert>
......@@ -92,7 +101,8 @@
<if test ='null != weight'>weight = #{weight},</if>
<if test ='null != createTime'>create_time = #{createTime},</if>
<if test ='null != updateTime'>update_time = #{updateTime},</if>
<if test ='null != type'>type = #{type}</if>
<if test ='null != type'>type = #{type},</if>
<if test ='null != isEditWeight'>is_edit_weight = #{isEditWeight}</if>
</set>
WHERE id = #{id}
</update>
......
......@@ -11,6 +11,7 @@
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="type" property="type" />
<result column="is_edit_weight" property="isEditWeight" />
</resultMap>
<sql id="Base_Column_List">
......@@ -20,7 +21,8 @@
weight,
create_time,
update_time,
type
type,
is_edit_weight
</sql>
<sql id="Base_Column_List_Alias">
......@@ -30,7 +32,8 @@
weight JxglAppraisalIndicatorsT_weight,
create_time JxglAppraisalIndicatorsT_create_time,
update_time JxglAppraisalIndicatorsT_update_time,
type JxglAppraisalIndicatorsT_type
type JxglAppraisalIndicatorsT_type,
is_edit_weight JxglAppraisalIndicatorsT_is_edit_weight
</sql>
<!--
......@@ -54,7 +57,10 @@
update_time,
</if>
<if test ='null != type'>
type
type,
</if>
<if test ='null != isEditWeight'>
is_edit_weight
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
......@@ -74,7 +80,10 @@
#{updateTime},
</if>
<if test ='null != type'>
#{type}
#{type},
</if>
<if test ='null != isEditWeight'>
#{isEditWeight}
</if>
</trim>
</insert>
......@@ -92,7 +101,8 @@
<if test ='null != weight'>weight = #{weight},</if>
<if test ='null != createTime'>create_time = #{createTime},</if>
<if test ='null != updateTime'>update_time = #{updateTime},</if>
<if test ='null != type'>type = #{type}</if>
<if test ='null != type'>type = #{type},</if>
<if test ='null != isEditWeight'>is_edit_weight = #{isEditWeight}</if>
</set>
WHERE id = #{id}
</update>
......
......@@ -26,6 +26,8 @@
<result column="sts" property="sts" />
<result column="is_edit" property="isEdit" />
<result column="executor_name" property="executorName" />
<result column="phone" property="phone" />
<result column="bm_name" property="bmName" />
</resultMap>
<resultMap id="BaseResultMap_All" type="cn.timer.api.bean.jxgl.JxglAppraisal" >
......@@ -76,6 +78,7 @@
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="type" property="type" />
<result column="is_edit_weight" property="isEditWeight" />
<collection column="JxglAppraisalIndicatorsAssessment_id" property="appraisalIndicatorsAssessments" ofType="cn.timer.api.bean.jxgl.JxglAppraisalIndicatorsAssessment"
resultMap="cn.timer.api.dao.jxgl.JxglAppraisalIndicatorsAssessmentMapper.BaseResultMap" columnPrefix="JxglAppraisalIndicatorsAssessment_">
</collection>
......@@ -178,7 +181,8 @@
e.weight e_weight,
e.create_time e_create_time,
e.update_time e_update_time,
e.type e_type
e.type e_type,
e.is_edit_weight e_is_edit_weight
</sql>
<sql id="Base_Column_List_Alias_f">
......@@ -332,7 +336,7 @@
LEFT JOIN jxgl_performance_appraisal h ON a.performance_appraisal_id = h.id
LEFT JOIN yggl_main_emp i ON b.executor_id = i.emp_num AND i.org_code = #{orgCode}
WHERE a.id = #{id}
ORDER BY c.id , d.id
ORDER BY c.id , d.id , b.process_type
</select>
<!--
......
......@@ -23,6 +23,7 @@
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="type" property="type" />
<result column="is_edit_weight" property="isEditWeight" />
<collection column="JxglAppraisalItemT_id" property="appraisalItemTs" ofType="cn.timer.api.bean.jxgl.JxglAppraisalItemT"
resultMap="cn.timer.api.dao.jxgl.JxglAppraisalItemTMapper.BaseResultMap" columnPrefix="JxglAppraisalItemT_">
</collection>
......@@ -86,7 +87,8 @@
b.weight JxglAppraisalIndicatorsT_weight,
b.create_time JxglAppraisalIndicatorsT_create_time,
b.update_time JxglAppraisalIndicatorsT_update_time,
b.type JxglAppraisalIndicatorsT_type
b.type JxglAppraisalIndicatorsT_type,
b.is_edit_weight JxglAppraisalIndicatorsT_is_edit_weight
</sql>
<sql id="Base_Column_List_Alias_c">
......@@ -108,10 +110,7 @@
WHERE a.id = #{id}
</select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.jxgl.JxglAppraisalT">
INSERT INTO jxgl_appraisal_t
<trim prefix="(" suffix=")" suffixOverrides=",">
......
......@@ -62,6 +62,7 @@
FROM jxgl_basic_setting a
LEFT JOIN jxgl_performance_rating b ON a.id = b.basic_setting_id
WHERE a.org_code = #{orgCode}
ORDER BY b.ranks
</select>
<!--
......
......@@ -200,17 +200,19 @@
<select id="selectMyByQuery" resultMap="BaseResultMap_ALl" >
SELECT
a.name,a.appraisal_start_time,a.appraisal_end_time,
b.sts b_sts,
(SELECT name FROM yggl_main_emp WHERE emp_num = d.executor_id AND org_code = a.org_code) as b_executor_name,
b.id b_id,b.sts b_sts,
c.comprehensive_score c_comprehensive_score,
c.level c_level
c.level c_level,
e.name b_executor_name, e.phone b_phone,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = e.bmgw_id limit 1) limit 1) as b_bm_name
FROM jxgl_performance_appraisal a
LEFT JOIN jxgl_appraisal b ON b.performance_appraisal_id = a.id
LEFT JOIN jxgl_appraisal_assessment c ON b.id = c.appraisal_id AND c.type = 1
LEFT JOIN jxgl_process_node d ON b.id = d.appraisal_id AND d.sts = 1
LEFT JOIN yggl_main_emp e ON b.emp_num = e.emp_num AND a.org_code = e.org_code
<where>
AND a.org_code = #{param.orgCode}
AND b.emp_num = #{param.id}
AND d.executor_id = #{param.id}
<if test="param.sts != null and param.sts == 0">
AND b.sts = 0
</if>
......@@ -223,10 +225,8 @@
<if test="param.sts != null and param.sts == 3">
AND b.sts = 4
</if>
</where>
</select>
......
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