Commit 210d3c10 by tangzhaoqian Committed by chenzg

绩效bug修复

parent 4dc2c8e8
......@@ -27,6 +27,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.timer.api.aspect.lang.annotation.Log;
......@@ -170,7 +171,7 @@ public class JxglController {
Integer orgCode = userBean.getOrgCode();
List<JxglPerformanceRating> listPr = basicSetting.getPerformanceRatings();
if (listPr != null) {
if (CollectionUtil.isNotEmpty(listPr)) {
for (JxglPerformanceRating pr : listPr) {
if (pr.getSectionMaxScore() > basicSetting.getMaxScore()) {
return ResultUtil.error("区间值不能超过最高分");
......@@ -192,7 +193,7 @@ public class JxglController {
basicSetting.setOrgCode(orgCode);
basicSetting.insert();
if (listPr != null && !listPr.isEmpty()) {
if (CollectionUtil.isNotEmpty(listPr)) {
listPr.stream().forEach(pr -> pr.setBasicSettingId(basicSetting.getId()));
int i = jxglPerformanceRatingMapper.insertList(listPr);
}
......@@ -242,21 +243,21 @@ public class JxglController {
List<JxglAppraisalIndicatorsT> listAIT = jxglAppraisalIndicatorsTMapper
.selectList(q.select(JxglAppraisalIndicatorsT::getId));
List<Integer> listAITId = listAIT != null && listAIT.size() > 0
List<Integer> listAITId = CollectionUtil.isNotEmpty(listAIT)
? listAIT.stream().map(JxglAppraisalIndicatorsT::getId).collect(Collectors.toList())
: null;
// 删除 原 考核指标模板
jxglAppraisalIndicatorsTMapper.delete(q);
// 删除 原 考核项模板
if (listAITId != null) {
if (CollectionUtil.isNotEmpty(listAITId)) {
jsxglAppraisalItemTMapper.delete(new QueryWrapper<JxglAppraisalItemT>().lambda()
.in(JxglAppraisalItemT::getAppraisalIndicatorsTId, listAITId));
}
List<JxglAppraisalIndicatorsT> aITs = jxglAppraisalT.getAppraisalIndicatorsTs();
if (aITs != null && aITs.size() > 0) {
if (CollectionUtil.isNotEmpty(aITs)) {
Integer weightSum = 0;
for (JxglAppraisalIndicatorsT aIT : aITs) {
......@@ -374,7 +375,7 @@ public class JxglController {
for (Integer deptId : listDeptId) {
CollUtil.addAll(listEmp2, zzglBmgwMService.selectOtherlistent(userBean.getOrgCode(), deptId));
}
if (!CollUtil.isEmpty(listEmp2)) {
if (CollectionUtil.isNotEmpty(listEmp2)) {
// 员工信息数据 去重
List<Integer> listEmp2Id = listEmp2.stream().filter(StreamUtils.distinctByKey(e -> e.getEmpNum()))
.map(YgglMainEmp::getEmpNum).collect(Collectors.toList());
......@@ -485,7 +486,7 @@ public class JxglController {
.selectList(new QueryWrapper<JxglAppraisalItemT>().lambda()
.eq(JxglAppraisalItemT::getAppraisalIndicatorsTId, aIT.getId()));
if (listAItemT != null && listAItemT.size() > 0) {
if (CollectionUtil.isNotEmpty(listAItemT)) {
listAItemT.stream().forEach(aItemT -> {
BeanUtil.copyProperties(aItemT, appraisalItem, "appraisalIndicatorsTId");
appraisalItem.setAppraisalIndicatorsId(appraisalIndicators.getId());
......@@ -534,7 +535,7 @@ public class JxglController {
List<JxglAppraisal> listA = jxglAppraisalMapper.selectList(new QueryWrapper<JxglAppraisal>().lambda()
.select(JxglAppraisal::getId).eq(JxglAppraisal::getPerformanceAppraisalId, pA.getId()));
aIds = listA != null && listA.size() > 0 ? listA.stream().map(JxglAppraisal::getId).collect(Collectors.toList())
aIds = CollectionUtil.isNotEmpty(listA) ? listA.stream().map(JxglAppraisal::getId).collect(Collectors.toList())
: aIds;
// 删除 绩效考核
......@@ -563,7 +564,7 @@ public class JxglController {
.eq(aIds.size() == 1, JxglAppraisalIndicators::getAppraisalId, aIds)
.in(aIds.size() > 1, JxglAppraisalIndicators::getAppraisalId, aIds));
aIIds = listAI != null && listAI.size() > 0
aIIds = CollectionUtil.isNotEmpty(listAI)
? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList())
: aIIds;
......@@ -624,7 +625,7 @@ public class JxglController {
listA = jxglAppraisalMapper.selectList(new QueryWrapper<JxglAppraisal>().lambda()
.select(JxglAppraisal::getId).eq(JxglAppraisal::getPerformanceAppraisalId, id));
if (listA != null && listA.size() > 0) {
if (CollectionUtil.isNotEmpty(listA)) {
aIds = listA.stream().map(JxglAppraisal::getId).collect(Collectors.toList());
listPN = jxglProcessNodeMapper.selectList(
......@@ -632,14 +633,14 @@ public class JxglController {
.eq(JxglProcessNode::getProcessType, ProcessType.TARGET_CONFIRMED.getType())
.eq(JxglProcessNode::getSts, ProcessNodeSts.EXECUTED.getType()));
if (listPN != null && listPN.size() > 0) {
if (CollectionUtil.isNotEmpty(listPN)) {
aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList());
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) {
if (CollectionUtil.isNotEmpty(listPN)) {
pNIds = listPN.stream().map(JxglProcessNode::getId).collect(Collectors.toList());
aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList());
......@@ -660,7 +661,7 @@ public class JxglController {
listA = jxglAppraisalMapper.selectList(new QueryWrapper<JxglAppraisal>().lambda()
.select(JxglAppraisal::getId).eq(JxglAppraisal::getPerformanceAppraisalId, id));
if (listA != null && listA.size() > 0) {
if (CollectionUtil.isNotEmpty(listA)) {
aIds = listA.stream().map(JxglAppraisal::getId).collect(Collectors.toList());
listPN = jxglProcessNodeMapper.selectList(
......@@ -668,14 +669,14 @@ public class JxglController {
.eq(JxglProcessNode::getProcessType, ProcessType.SUPERIOR_SCORE.getType())
.eq(JxglProcessNode::getSts, ProcessNodeSts.EXECUTED.getType()));
if (listPN != null && listPN.size() > 0) {
if (CollectionUtil.isNotEmpty(listPN)) {
aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList());
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) {
if (CollectionUtil.isNotEmpty(listPN)) {
pNIds = listPN.stream().map(JxglProcessNode::getId).collect(Collectors.toList());
aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList());
......@@ -695,7 +696,7 @@ public class JxglController {
listA = jxglAppraisalMapper.selectList(new QueryWrapper<JxglAppraisal>().lambda()
.select(JxglAppraisal::getId).eq(JxglAppraisal::getPerformanceAppraisalId, id));
if (listA != null && listA.size() > 0) {
if (CollectionUtil.isNotEmpty(listA)) {
aIds = listA.stream().map(JxglAppraisal::getId).collect(Collectors.toList());
listPN = jxglProcessNodeMapper.selectList(
......@@ -703,7 +704,7 @@ public class JxglController {
.eq(JxglProcessNode::getProcessType, ProcessType.RESULT_VERIFICATION.getType())
.in(JxglProcessNode::getSts, ProcessNodeSts.NON_EXECUTION.getType(),ProcessNodeSts.IN_EXECUTION.getType()));
if (listPN != null && listPN.size() > 0) {
if (CollectionUtil.isNotEmpty(listPN)) {
throw new CustomException("所有考核 确认结果后才能 归档");
}
}
......@@ -1112,7 +1113,7 @@ public class JxglController {
.eq(JxglAppraisalIndicators::getType, IndicatorsType.NOT_FIXATION.getType())
.eq(JxglAppraisalIndicators::getAppraisalId, id));
List<Integer> appraisalIndicatorIds = listAI != null
List<Integer> appraisalIndicatorIds = listAI != null && listAI.size() > 0
? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList())
: null;
......@@ -1130,7 +1131,7 @@ public class JxglController {
List<JxglAppraisalIndicators> listAI2 = appraisalUpdate.getAppraisalIndicators();
if (listAI2 != null) {
if (listAI2 != null && listAI2.size() > 0) {
listAI2.forEach(aI -> {
aI.setAppraisalId(id);
aI.setType(IndicatorsType.NOT_FIXATION.getType());
......@@ -1193,7 +1194,7 @@ public class JxglController {
.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda()
.eq(JxglAppraisalIndicators::getAppraisalId, appraisal.getId()));
if (listAI == null) {
if (CollectionUtil.isNotEmpty(listAI)) {
return ResultUtil.error("考核指标不能为空");
}
List<Integer> listWeight = listAI.stream().map(JxglAppraisalIndicators::getWeight)
......@@ -1428,7 +1429,7 @@ public class JxglController {
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
List<Integer> listAIId = CollectionUtil.isNotEmpty(listAI)
? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList())
: null;
// 删除 考核指标评定-自评
......@@ -1666,13 +1667,13 @@ public class JxglController {
Integer bWeights = 0;
Double total = 0D;
String level = null;
if (listProcessNode != null && listProcessNode.size() > 0) {
if (CollectionUtil.isNotEmpty(listProcessNode)) {
aWeights = listProcessNode.stream().filter(p -> p.getProcessType() == ProcessType.SELF_ASSESSMENT.getType()).map(JxglProcessNode::getWeight).findFirst().orElse(null);
bWeights = listProcessNode.stream().filter(p -> p.getProcessType() == ProcessType.SUPERIOR_SCORE.getType()).map(JxglProcessNode::getWeight).findFirst().orElse(null);
}
if (listAppraisalAssessment != null && listAppraisalAssessment.size() > 0) {
if (CollectionUtil.isNotEmpty(listAppraisalAssessment)) {
selfAssessment = listAppraisalAssessment.stream().filter(a -> a.getType() == AssessmentType.SELF_ASSESSMENT.getType()).map(JxglAppraisalAssessment::getComprehensiveScore).findFirst().orElse(null) ;
superiorAssessment = listAppraisalAssessment.stream().filter(a -> a.getType() == AssessmentType.SUPERIOR_SCORE.getType()).map(JxglAppraisalAssessment::getComprehensiveScore).findFirst().orElse(null);
......@@ -1863,13 +1864,13 @@ public class JxglController {
List<YgglMainEmp> users = zzglBmgwMService.selectOtherlistent(orgCode, ZzglBmgwM.getId());
List<Integer> empNums = CollUtil.toList();
if (users != null) {
if (CollectionUtil.isNotEmpty(empNums)) {
empNums = users.stream().map(YgglMainEmp::getEmpNum).collect(Collectors.toList());
}
if (query.getBmId() != null) {
List<YgglMainEmp> usersQuery = zzglBmgwMService.selectOtherlistent(orgCode, query.getBmId());
if (usersQuery != null) {
if (CollectionUtil.isNotEmpty(empNums)) {
List<Integer> empNumsQuery = usersQuery.stream().map(YgglMainEmp::getEmpNum).collect(Collectors.toList());
empNums = empNums.stream().filter(e -> empNumsQuery.contains(e)).collect(Collectors.toList());
}else {
......@@ -1877,7 +1878,7 @@ public class JxglController {
}
}
if (empNums == null || empNums.size() == 0) {
if (CollectionUtil.isNotEmpty(empNums)) {
return ResultUtil.data(null);
}
......
......@@ -306,7 +306,7 @@
LEFT JOIN jxgl_performance_appraisal c ON a.performance_appraisal_id = c.id
<where>
a.org_code = #{param.orgCode}
c.org_code = #{param.orgCode}
<if test="param.query != null and param.query != ''">
and (
b.name like CONCAT('%',#{param.query},'%') or
......
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