From e8fd957c604e716844c97aa522ccdaba741378b8 Mon Sep 17 00:00:00 2001 From: Gitea Date: Thu, 21 Nov 2024 15:27:54 +0800 Subject: [PATCH] =?UTF-8?q?GST002=E7=B2=BE=E7=AE=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PersonalAbilityEvaluationServiceImpl.java | 67 ------------------- 1 file changed, 67 deletions(-) diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/impl/PersonalAbilityEvaluationServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/impl/PersonalAbilityEvaluationServiceImpl.java index 58ec2db4..ffbfbe54 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/impl/PersonalAbilityEvaluationServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/impl/PersonalAbilityEvaluationServiceImpl.java @@ -13,10 +13,6 @@ import org.jeecg.modules.demo.annualScore.entity.PersonalCompScore; import org.jeecg.modules.demo.annualScore.service.IPersonalCompScoreService; import org.jeecg.modules.demo.annualcomp.entity.AnnualComp; import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService; -import org.jeecg.modules.demo.basicsskill.entity.Basicsskill; -import org.jeecg.modules.demo.basicsskill.service.IBasicsskillService; -import org.jeecg.modules.demo.compskill.entity.Compskill; -import org.jeecg.modules.demo.compskill.service.ICompskillService; import org.jeecg.modules.system.entity.SysUser; import org.jeecg.modules.system.service.ISysUserService; import org.springframework.beans.factory.annotation.Autowired; @@ -48,11 +44,6 @@ public class PersonalAbilityEvaluationServiceImpl extends ServiceImpl compskillList = iCompskillService.list(new LambdaQueryWrapper().eq(Compskill::getAnnucompid, projectId)); - if (ObjectUtils.isEmpty(compskillList)) return; - - List personalCompScoreList = iPersonalCompScoreService.list(new LambdaQueryWrapper().eq(PersonalCompScore::getAnnualCompP, projectId)); - - List saveList = new LinkedList<>(); - Optional.ofNullable(personalCompScoreList).orElse(new LinkedList<>()).stream().forEach(en -> { - - //在lambda中,使用return时并不会直接返回,而是进行相当于普通for里的continue操作。所以直接使用return即可。 - //分数为空时,继续下一条 - if (ObjectUtils.isEmpty(en.getScore())) return; - - SysUser sysUser = iSysUserService.getOne(new LambdaQueryWrapper().eq(SysUser::getWorkNo, en.getWorkOn())); - //遍历每一类能力指标 - compskillList.forEach(compskill -> { - PersonalAbilityEvaluation person = new PersonalAbilityEvaluation(); - person.setAnnualId(annualComp.getAnnualid()); - person.setAnnualCompId(annualCompPoint.getAnnualCompId()); - person.setAnnualCompP(projectId); - person.setWorkOn(en.getWorkOn()); - person.setName(sysUser.getRealname()); - person.setDepetId(en.getDepet()); - - Basicsskill basicsskill = iBasicsskillService.getById(compskill.getCapacityid()); - person.setCapacityId(compskill.getCapacityid()); - person.setCapacityName(basicsskill.getName()); - - //计算能力量化各类指标 能力量化值 = 直接按项目的能力权值和项目奖项得分算 - //能力量化值 = 个人积分*项目的能力权值/100 - this.convertScore(compskill.getWeight(), person, en.getScore()); - saveList.add(person); - }); - - }); - - //删除该项目下所有人的能力量化数据 - this.remove(new LambdaQueryWrapper() - .eq(PersonalAbilityEvaluation::getAnnualCompP, projectId)); - - //新增个人能力量化 - this.saveBatch(saveList); - - //新增个人能力量化汇总 - iPersonalAbilityEvaluationCollectService.batchSave(projectId); }