|
|
|
@ -16,6 +16,8 @@ import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.TeamMa |
|
|
|
|
import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.ITeamManagementService; |
|
|
|
|
import org.jeecg.modules.demo.awardpersion.entity.AwardPersion; |
|
|
|
|
import org.jeecg.modules.demo.awardpersion.service.IAwardPersionService; |
|
|
|
|
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.demo.scorepersion.entity.ScorePersion; |
|
|
|
@ -27,7 +29,6 @@ import org.jeecg.modules.system.service.ISysUserService; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
import org.springframework.util.Assert; |
|
|
|
|
import org.springframework.util.ObjectUtils; |
|
|
|
|
|
|
|
|
|
import java.util.LinkedList; |
|
|
|
@ -55,6 +56,9 @@ public class PersonalAbilityEvaluationServiceImpl extends ServiceImpl<PersonalAb |
|
|
|
|
@Autowired |
|
|
|
|
private ICompskillService iCompskillService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private IBasicsskillService iBasicsskillService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private ISysDepartService iSysDepartService; |
|
|
|
|
|
|
|
|
@ -72,80 +76,8 @@ public class PersonalAbilityEvaluationServiceImpl extends ServiceImpl<PersonalAb |
|
|
|
|
|
|
|
|
|
private static final Integer ONE_HUNDRED = 100; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @description: 只统计已获奖的个人能力,依赖获奖管理数据列表 |
|
|
|
|
* @param: [param] |
|
|
|
|
* @return: void |
|
|
|
|
* @author: z.h.c |
|
|
|
|
* @date: 23/11/8 16:02 |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public void personalAbilityEvaluation(PersonalAbilityEvaluation param) { |
|
|
|
|
|
|
|
|
|
// //年度比赛项目id
|
|
|
|
|
// String projectId = param.getAnnualCompP();
|
|
|
|
|
// String enrollCode = param.getEnrollCode();
|
|
|
|
|
// Assert.notNull(projectId, "年度比赛项目id为空");
|
|
|
|
|
// Assert.notNull(enrollCode, "报名编号为空");
|
|
|
|
|
//
|
|
|
|
|
// //年度比赛项目
|
|
|
|
|
// AnnualCompPoint annualCompPoint = iAnnualCompPointService.getById(projectId);
|
|
|
|
|
// Assert.notNull(annualCompPoint, "年度比赛项目不存在");
|
|
|
|
|
//
|
|
|
|
|
// //年度比赛
|
|
|
|
|
// AnnualComp annualComp = iAnnualCompService.getById(annualCompPoint.getAnnualCompId());
|
|
|
|
|
// if (ObjectUtils.isEmpty(annualComp)) return;
|
|
|
|
|
//
|
|
|
|
|
// TeamManagement management = iTeamManagementService.getOne(new LambdaQueryWrapper<TeamManagement>()
|
|
|
|
|
// .eq(TeamManagement::getEnrollCode, enrollCode));
|
|
|
|
|
// if (ObjectUtils.isEmpty(management)) return;
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// //根据年度比赛项目和报名编号查询 查询个人获奖表
|
|
|
|
|
// AwardPersion awardPersion = iAwardPersionService.getOne(new LambdaQueryWrapper<AwardPersion>()
|
|
|
|
|
// .eq(AwardPersion::getAnnualCompP, projectId)
|
|
|
|
|
// .eq(AwardPersion::getEnrollCode, enrollCode)
|
|
|
|
|
// .last("limit 1"));
|
|
|
|
|
//
|
|
|
|
|
// if (ObjectUtils.isEmpty(awardPersion)) return;
|
|
|
|
|
//
|
|
|
|
|
// //查询获奖个人对应的分数
|
|
|
|
|
// ScorePersion scorePersion = iScorePersionService.getOne(new LambdaQueryWrapper<ScorePersion>()
|
|
|
|
|
// .eq(ScorePersion::getEnrollCode, enrollCode)
|
|
|
|
|
// .eq(ScorePersion::getAnnualCompP, projectId)
|
|
|
|
|
// .last("limit 1"));
|
|
|
|
|
// if (ObjectUtils.isEmpty(scorePersion)) return;
|
|
|
|
|
//
|
|
|
|
|
// String score = scorePersion.getScore();
|
|
|
|
|
// if (StringUtils.isBlank(score)) return;
|
|
|
|
|
//
|
|
|
|
|
// Double score_d = Double.valueOf(score);
|
|
|
|
|
//
|
|
|
|
|
// PersonalAbilityEvaluation person = new PersonalAbilityEvaluation();
|
|
|
|
|
// person.setAnnualId(annualComp.getAnnualid());
|
|
|
|
|
// person.setAnnualCompId(annualCompPoint.getAnnualCompId());
|
|
|
|
|
// person.setAnnualCompP(projectId);
|
|
|
|
|
// SysUser sysUser = iSysUserService.getById(management.getUserId());
|
|
|
|
|
// person.setWorkOn(sysUser.getWorkNo());
|
|
|
|
|
// person.setName(sysUser.getRealname());
|
|
|
|
|
// SysDepart sysDepart = iSysDepartService.getById(sysUser.getOrgCode());
|
|
|
|
|
// person.setDepetId(sysDepart.getId());
|
|
|
|
|
//
|
|
|
|
|
// //查询项目各能力权值
|
|
|
|
|
// List<Compskill> compskillList = iCompskillService.list(new LambdaQueryWrapper<Compskill>().eq(Compskill::getAnnucompid, projectId));
|
|
|
|
|
// if (!ObjectUtils.isEmpty(compskillList)) {
|
|
|
|
|
// //计算能力量化各类指标 能力量化值 = 直接按项目的能力权值和项目奖项得分算
|
|
|
|
|
// //能力量化值 = 项目得分*项目的能力权值/100
|
|
|
|
|
// this.convertScore(compskillList, person, score_d);
|
|
|
|
|
// }
|
|
|
|
|
// this.save(person);
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @description: |
|
|
|
|
* 1、在年度项目管理操作列,添加“个人能力评价”操作, |
|
|
|
|
* @description: 1、在年度项目管理操作列,添加“个人能力评价”操作, |
|
|
|
|
* 2、个人能力评价可以重复操作 |
|
|
|
|
* 3、在个人能力评价中自动完成个人能力汇总功能, |
|
|
|
|
* 4、实现方法:每次操作个人能力评价都删除该项目下的个人能力评价数据和个人能力评价汇总数据,再重新增加 |
|
|
|
@ -171,6 +103,10 @@ public class PersonalAbilityEvaluationServiceImpl extends ServiceImpl<PersonalAb |
|
|
|
|
AnnualCompPoint annualCompPoint = iAnnualCompPointService.getById(projectId); |
|
|
|
|
if (ObjectUtils.isEmpty(annualCompPoint)) return; |
|
|
|
|
|
|
|
|
|
//查询项目各能力权值
|
|
|
|
|
List<Compskill> compskillList = iCompskillService.list(new LambdaQueryWrapper<Compskill>().eq(Compskill::getAnnucompid, projectId)); |
|
|
|
|
if (ObjectUtils.isEmpty(compskillList)) return; |
|
|
|
|
|
|
|
|
|
//根据年度比赛项目查询个人获奖表
|
|
|
|
|
List<AwardPersion> awardPersionList = iAwardPersionService.list(new LambdaQueryWrapper<AwardPersion>().eq(AwardPersion::getAnnualCompP, projectId)); |
|
|
|
|
|
|
|
|
@ -183,26 +119,31 @@ public class PersonalAbilityEvaluationServiceImpl extends ServiceImpl<PersonalAb |
|
|
|
|
.last("limit 1")); |
|
|
|
|
|
|
|
|
|
if (!ObjectUtils.isEmpty(scorePersion) && StringUtils.isNotBlank(scorePersion.getScore())) { |
|
|
|
|
|
|
|
|
|
TeamManagement management = iTeamManagementService.getOne(new LambdaQueryWrapper<TeamManagement>() |
|
|
|
|
.eq(TeamManagement::getEnrollCode, e.getEnrollCode())); |
|
|
|
|
SysUser sysUser = iSysUserService.getById(management.getUserId()); |
|
|
|
|
SysDepart sysDepart = iSysDepartService.getById(sysUser.getOrgCode()); |
|
|
|
|
|
|
|
|
|
//遍历每一类能力指标
|
|
|
|
|
compskillList.forEach(compskill -> { |
|
|
|
|
PersonalAbilityEvaluation person = new PersonalAbilityEvaluation(); |
|
|
|
|
person.setAnnualId(annualComp.getAnnualid()); |
|
|
|
|
person.setAnnualCompId(annualCompPoint.getAnnualCompId()); |
|
|
|
|
person.setAnnualCompP(projectId); |
|
|
|
|
TeamManagement management = iTeamManagementService.getOne(new LambdaQueryWrapper<TeamManagement>() |
|
|
|
|
.eq(TeamManagement::getEnrollCode, e.getEnrollCode())); |
|
|
|
|
SysUser sysUser = iSysUserService.getById(management.getUserId()); |
|
|
|
|
person.setWorkOn(sysUser.getWorkNo()); |
|
|
|
|
person.setName(sysUser.getRealname()); |
|
|
|
|
SysDepart sysDepart = iSysDepartService.getById(sysUser.getOrgCode()); |
|
|
|
|
person.setDepetId(sysDepart.getId()); |
|
|
|
|
|
|
|
|
|
//查询项目各能力权值
|
|
|
|
|
List<Compskill> compskillList = iCompskillService.list(new LambdaQueryWrapper<Compskill>().eq(Compskill::getAnnucompid, projectId)); |
|
|
|
|
if (!ObjectUtils.isEmpty(compskillList)) { |
|
|
|
|
Basicsskill basicsskill = iBasicsskillService.getById(compskill.getCapacityid()); |
|
|
|
|
person.setCapacityId(compskill.getCapacityid()); |
|
|
|
|
person.setCapacityName(basicsskill.getName()); |
|
|
|
|
|
|
|
|
|
//计算能力量化各类指标 能力量化值 = 直接按项目的能力权值和项目奖项得分算
|
|
|
|
|
//能力量化值 = 项目得分*项目的能力权值/100
|
|
|
|
|
this.convertScore(compskillList, person, Double.valueOf(scorePersion.getScore())); |
|
|
|
|
} |
|
|
|
|
this.convertScore(compskill.getWeight(), person, Double.valueOf(scorePersion.getScore())); |
|
|
|
|
saveList.add(person); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
@ -217,46 +158,8 @@ public class PersonalAbilityEvaluationServiceImpl extends ServiceImpl<PersonalAb |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PersonalAbilityEvaluation convertScore(List<Compskill> compskillList, PersonalAbilityEvaluation person, final double score_d) { |
|
|
|
|
|
|
|
|
|
for (int i = 1; i <= compskillList.size(); i++) { |
|
|
|
|
if (i == 1) { |
|
|
|
|
person.setSoc1(ComputeUtils.mul(score_d, ComputeUtils.div2(compskillList.get(i - 1).getWeight().doubleValue(), ONE_HUNDRED))); |
|
|
|
|
} |
|
|
|
|
if (i == 2) { |
|
|
|
|
person.setSoc2(ComputeUtils.mul(score_d, ComputeUtils.div2(compskillList.get(i - 1).getWeight().doubleValue(), ONE_HUNDRED))); |
|
|
|
|
} |
|
|
|
|
if (i == 3) { |
|
|
|
|
person.setSoc3(ComputeUtils.mul(score_d, ComputeUtils.div2(compskillList.get(i - 1).getWeight().doubleValue(), ONE_HUNDRED))); |
|
|
|
|
} |
|
|
|
|
if (i == 4) { |
|
|
|
|
person.setSoc4(ComputeUtils.mul(score_d, ComputeUtils.div2(compskillList.get(i - 1).getWeight().doubleValue(), ONE_HUNDRED))); |
|
|
|
|
} |
|
|
|
|
if (i == 5) { |
|
|
|
|
person.setSoc5(ComputeUtils.mul(score_d, ComputeUtils.div2(compskillList.get(i - 1).getWeight().doubleValue(), ONE_HUNDRED))); |
|
|
|
|
} |
|
|
|
|
if (i == 6) { |
|
|
|
|
person.setSoc6(ComputeUtils.mul(score_d, ComputeUtils.div2(compskillList.get(i - 1).getWeight().doubleValue(), ONE_HUNDRED))); |
|
|
|
|
} |
|
|
|
|
if (i == 7) { |
|
|
|
|
person.setSoc7(ComputeUtils.mul(score_d, ComputeUtils.div2(compskillList.get(i - 1).getWeight().doubleValue(), ONE_HUNDRED))); |
|
|
|
|
} |
|
|
|
|
if (i == 8) { |
|
|
|
|
person.setSoc8(ComputeUtils.mul(score_d, ComputeUtils.div2(compskillList.get(i - 1).getWeight().doubleValue(), ONE_HUNDRED))); |
|
|
|
|
} |
|
|
|
|
if (i == 9) { |
|
|
|
|
person.setSoc9(ComputeUtils.mul(score_d, ComputeUtils.div2(compskillList.get(i - 1).getWeight().doubleValue(), ONE_HUNDRED))); |
|
|
|
|
} |
|
|
|
|
if (i == 10) { |
|
|
|
|
person.setSoc10(ComputeUtils.mul(score_d, ComputeUtils.div2(compskillList.get(i - 1).getWeight().doubleValue(), ONE_HUNDRED))); |
|
|
|
|
} |
|
|
|
|
if (i == 11) { |
|
|
|
|
person.setSoc11(ComputeUtils.mul(score_d, ComputeUtils.div2(compskillList.get(i - 1).getWeight().doubleValue(), ONE_HUNDRED))); |
|
|
|
|
} |
|
|
|
|
if (i == 12) { |
|
|
|
|
person.setSoc12(ComputeUtils.mul(score_d, ComputeUtils.div2(compskillList.get(i - 1).getWeight().doubleValue(), ONE_HUNDRED))); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
PersonalAbilityEvaluation convertScore(double weight, PersonalAbilityEvaluation person, final double score_d) { |
|
|
|
|
person.setValue(ComputeUtils.mul(score_d, ComputeUtils.div2(weight, ONE_HUNDRED))); |
|
|
|
|
return person; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|