|
|
@ -21,10 +21,10 @@ import org.jeecg.modules.demo.awardpersion.entity.AwardPersion; |
|
|
|
import org.jeecg.modules.demo.awardpersion.service.IAwardPersionService; |
|
|
|
import org.jeecg.modules.demo.awardpersion.service.IAwardPersionService; |
|
|
|
import org.jeecg.modules.demo.comp.entity.Comp; |
|
|
|
import org.jeecg.modules.demo.comp.entity.Comp; |
|
|
|
import org.jeecg.modules.demo.comp.service.ICompService; |
|
|
|
import org.jeecg.modules.demo.comp.service.ICompService; |
|
|
|
import org.jeecg.modules.demo.comptype.entity.CompType; |
|
|
|
|
|
|
|
import org.jeecg.modules.demo.comptype.service.ICompTypeService; |
|
|
|
|
|
|
|
import org.jeecg.modules.demo.projectlevel.entity.Projectlevel; |
|
|
|
import org.jeecg.modules.demo.projectlevel.entity.Projectlevel; |
|
|
|
import org.jeecg.modules.demo.projectlevel.service.IProjectlevelService; |
|
|
|
import org.jeecg.modules.demo.projectlevel.service.IProjectlevelService; |
|
|
|
|
|
|
|
import org.jeecg.modules.demo.teamseq.entity.TeamSeq; |
|
|
|
|
|
|
|
import org.jeecg.modules.demo.teamseq.service.ITeamSeqService; |
|
|
|
import org.jeecg.modules.system.entity.SysDepart; |
|
|
|
import org.jeecg.modules.system.entity.SysDepart; |
|
|
|
import org.jeecg.modules.system.entity.SysUser; |
|
|
|
import org.jeecg.modules.system.entity.SysUser; |
|
|
|
import org.jeecg.modules.system.service.ISysDepartService; |
|
|
|
import org.jeecg.modules.system.service.ISysDepartService; |
|
|
@ -157,7 +157,7 @@ public class PersonalCompScoreServiceImpl extends ServiceImpl<PersonalCompScoreM |
|
|
|
// log.info("***************年度比赛项目-{},项目分值:{},奖项权重值:{}", annualCompPoint.getObjName(), compweight_val, weightVal);
|
|
|
|
// log.info("***************年度比赛项目-{},项目分值:{},奖项权重值:{}", annualCompPoint.getObjName(), compweight_val, weightVal);
|
|
|
|
Projectlevel projectlevel = iProjectlevelService.getById(annualCompPoint.getObjLevel()); |
|
|
|
Projectlevel projectlevel = iProjectlevelService.getById(annualCompPoint.getObjLevel()); |
|
|
|
double scale_ratio = ComputeUtils.div2(new Double(projectlevel.getScale()), ONE_HUNDRED); |
|
|
|
double scale_ratio = ComputeUtils.div2(new Double(projectlevel.getScale()), ONE_HUNDRED); |
|
|
|
double baseScore = ComputeUtils.mul2(ComputeUtils.mul2(compweight_val, ComputeUtils.div2(new Double(weightVal), ONE_HUNDRED)),scale_ratio); |
|
|
|
double baseScore = ComputeUtils.mul2(ComputeUtils.mul2(compweight_val, ComputeUtils.div2(new Double(weightVal), ONE_HUNDRED)), scale_ratio); |
|
|
|
log.info("***************年度比赛项目-{},项目分值:{}", annualCompPoint.getObjName(), compweight_val); |
|
|
|
log.info("***************年度比赛项目-{},项目分值:{}", annualCompPoint.getObjName(), compweight_val); |
|
|
|
log.info("***************年度比赛项目-层次权重比值:{}", scale_ratio); |
|
|
|
log.info("***************年度比赛项目-层次权重比值:{}", scale_ratio); |
|
|
|
log.info("***************获奖奖项权重百分比:{}", weightVal); |
|
|
|
log.info("***************获奖奖项权重百分比:{}", weightVal); |
|
|
@ -165,14 +165,16 @@ public class PersonalCompScoreServiceImpl extends ServiceImpl<PersonalCompScoreM |
|
|
|
AtomicReference<Double> score = new AtomicReference<>((double) 0); |
|
|
|
AtomicReference<Double> score = new AtomicReference<>((double) 0); |
|
|
|
if (StringUtils.equals("Y", entryForm)) { //团队赛
|
|
|
|
if (StringUtils.equals("Y", entryForm)) { //团队赛
|
|
|
|
Optional.ofNullable(managementList).orElse(new ArrayList<>()).forEach(e -> { |
|
|
|
Optional.ofNullable(managementList).orElse(new ArrayList<>()).forEach(e -> { |
|
|
|
// 参与形式是团队时,队长积分*0.5,职员积分*0.2
|
|
|
|
/*// 参与形式是团队时,队长积分*0.5,职员积分*0.2
|
|
|
|
//captain 是否队长
|
|
|
|
//captain 是否队长
|
|
|
|
if (StringUtils.equals("0", e.getCaptain())) { |
|
|
|
if (StringUtils.equals("0", e.getCaptain())) { |
|
|
|
score.set(ComputeUtils.mul2(baseScore, ZERO_POINT_FIVE)); |
|
|
|
score.set(ComputeUtils.mul2(baseScore, ZERO_POINT_FIVE)); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
score.set(ComputeUtils.mul2(baseScore, ZERO_POINT_TWO)); |
|
|
|
score.set(ComputeUtils.mul2(baseScore, ZERO_POINT_TWO)); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//modify by zhc 8.23
|
|
|
|
|
|
|
|
score.set(ComputeUtils.mul2(baseScore, this.covertVal(annualCompPoint, e))); |
|
|
|
PersonalCompScore bean = new PersonalCompScore(); |
|
|
|
PersonalCompScore bean = new PersonalCompScore(); |
|
|
|
bean.setAnnualCompId(annualCompId); |
|
|
|
bean.setAnnualCompId(annualCompId); |
|
|
|
bean.setAnnualCompP(annualCompPoint.getId()); |
|
|
|
bean.setAnnualCompP(annualCompPoint.getId()); |
|
|
@ -180,7 +182,7 @@ public class PersonalCompScoreServiceImpl extends ServiceImpl<PersonalCompScoreM |
|
|
|
SysUser sysUser = iSysUserService.getById(e.getUserId()); |
|
|
|
SysUser sysUser = iSysUserService.getById(e.getUserId()); |
|
|
|
bean.setWorkOn(sysUser.getWorkNo()); |
|
|
|
bean.setWorkOn(sysUser.getWorkNo()); |
|
|
|
bean.setName(sysUser.getRealname()); |
|
|
|
bean.setName(sysUser.getRealname()); |
|
|
|
SysDepart sysDepart = iSysDepartService.getOne(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getOrgCode,sysUser.getOrgCode())); |
|
|
|
SysDepart sysDepart = iSysDepartService.getOne(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getOrgCode, sysUser.getOrgCode())); |
|
|
|
bean.setDepet(sysDepart.getId()); |
|
|
|
bean.setDepet(sysDepart.getId()); |
|
|
|
bean.setScore(score.get()); |
|
|
|
bean.setScore(score.get()); |
|
|
|
saveList.add(bean); |
|
|
|
saveList.add(bean); |
|
|
@ -195,7 +197,7 @@ public class PersonalCompScoreServiceImpl extends ServiceImpl<PersonalCompScoreM |
|
|
|
SysUser sysUser = iSysUserService.getById(teamManagement.getUserId()); |
|
|
|
SysUser sysUser = iSysUserService.getById(teamManagement.getUserId()); |
|
|
|
bean.setWorkOn(sysUser.getWorkNo()); |
|
|
|
bean.setWorkOn(sysUser.getWorkNo()); |
|
|
|
bean.setName(sysUser.getRealname()); |
|
|
|
bean.setName(sysUser.getRealname()); |
|
|
|
SysDepart sysDepart = iSysDepartService.getOne(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getOrgCode,sysUser.getOrgCode())); |
|
|
|
SysDepart sysDepart = iSysDepartService.getOne(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getOrgCode, sysUser.getOrgCode())); |
|
|
|
bean.setDepet(sysDepart.getId()); |
|
|
|
bean.setDepet(sysDepart.getId()); |
|
|
|
bean.setScore(score.get()); |
|
|
|
bean.setScore(score.get()); |
|
|
|
saveList.add(bean); |
|
|
|
saveList.add(bean); |
|
|
@ -215,4 +217,40 @@ public class PersonalCompScoreServiceImpl extends ServiceImpl<PersonalCompScoreM |
|
|
|
.set(AnnualCompPoint::getAnnualCompState, 10) |
|
|
|
.set(AnnualCompPoint::getAnnualCompState, 10) |
|
|
|
.update(); |
|
|
|
.update(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private ITeamSeqService iTeamSeqService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* @description: 根据队员在团队中报名先后顺序计算比率 |
|
|
|
|
|
|
|
* @param: [annualCompPoint, en] |
|
|
|
|
|
|
|
* @return: double |
|
|
|
|
|
|
|
* @author: z.h.c |
|
|
|
|
|
|
|
* @date: 24/8/23 10:00 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
double covertVal(AnnualCompPoint annualCompPoint, TeamManagement en) { |
|
|
|
|
|
|
|
TeamSeq teamSeq = iTeamSeqService.getById(annualCompPoint.getId()); |
|
|
|
|
|
|
|
Integer weightVal = 100; |
|
|
|
|
|
|
|
if (!ObjectUtils.isEmpty(teamSeq)) { |
|
|
|
|
|
|
|
switch (en.getTeamSeq()) { |
|
|
|
|
|
|
|
case 1: |
|
|
|
|
|
|
|
weightVal = teamSeq.getTeamSeqFifthVal(); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 2: |
|
|
|
|
|
|
|
weightVal = teamSeq.getTeamSeqSecondVal(); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 3: |
|
|
|
|
|
|
|
weightVal = teamSeq.getTeamSeqThirdVal(); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 4: |
|
|
|
|
|
|
|
weightVal = teamSeq.getTeamSeqFourthVal(); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 5: |
|
|
|
|
|
|
|
weightVal = teamSeq.getTeamSeqFifthVal(); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
double val = ComputeUtils.div2(new Double(weightVal), ONE_HUNDRED); |
|
|
|
|
|
|
|
return val; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|