|
|
|
@ -35,6 +35,8 @@ import org.jeecg.modules.demo.comp.entity.Comp; |
|
|
|
|
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.service.IProjectlevelService; |
|
|
|
|
import org.jeecg.modules.system.entity.SysDepart; |
|
|
|
|
import org.jeecg.modules.system.entity.SysUser; |
|
|
|
|
import org.jeecg.modules.system.service.ISysDepartService; |
|
|
|
@ -109,6 +111,9 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic |
|
|
|
|
@Autowired |
|
|
|
|
private IAnnualService iAnnualService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private IProjectlevelService iProjectlevelService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//二级部门id
|
|
|
|
|
private final String BASE_PARENT_ID = "1693446350597038081"; |
|
|
|
@ -325,9 +330,14 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic |
|
|
|
|
); |
|
|
|
|
if (ObjectUtils.isEmpty(managementList)) return; |
|
|
|
|
|
|
|
|
|
//3、计算积分 项目分值*项目奖项权重值/100
|
|
|
|
|
log.info("***************年度比赛项目-{},项目分值:{},奖项权重值:{}", annualCompPoint.getObjName(), compweight_val, weightVal); |
|
|
|
|
double baseScore = ComputeUtils.mul(compweight_val, ComputeUtils.div2(new Double(weightVal), ONE_HUNDRED)); |
|
|
|
|
//3、计算积分 项目分值*项目级别权得百分比*获奖奖项权重百分比
|
|
|
|
|
// log.info("***************年度比赛项目-{},项目分值:{},奖项权重值:{}", annualCompPoint.getObjName(), compweight_val, weightVal);
|
|
|
|
|
Projectlevel projectlevel = iProjectlevelService.getById(annualCompPoint.getObjLevel()); |
|
|
|
|
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); |
|
|
|
|
log.info("***************年度比赛项目-{},项目分值:{}", annualCompPoint.getObjName(), compweight_val); |
|
|
|
|
log.info("***************年度比赛项目-级别权重比值:{}", scale_ratio); |
|
|
|
|
log.info("***************获奖奖项权重比值:{}", weightVal); |
|
|
|
|
AtomicReference<Double> score = new AtomicReference<>((double) 0); |
|
|
|
|
if (StringUtils.equals("Y", entryForm)) { //团队赛
|
|
|
|
|
Optional.ofNullable(managementList).orElse(new ArrayList<>()).forEach(e -> { |
|
|
|
@ -594,26 +604,31 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic |
|
|
|
|
List<Integer> years = DateUtils.getLastxYear(5); |
|
|
|
|
List<Annual> annualList = iAnnualService.list(new LambdaQueryWrapper<Annual>() |
|
|
|
|
.in(Annual::getAnnualName, years) |
|
|
|
|
.eq(Annual::getSysOrgCode, sysDepart.getOrgCode()) |
|
|
|
|
// .eq(Annual::getSysOrgCode, sysDepart.getOrgCode())
|
|
|
|
|
.orderByAsc(Annual::getAnnualName)); |
|
|
|
|
List<Last5YearDataVo> last5YearDataVos = new LinkedList<>(); |
|
|
|
|
List<Comp> compList = iCompService.list(new LambdaQueryWrapper<Comp>().eq(Comp::getCompOrgan, departId)); |
|
|
|
|
Set<String> compIds = Optional.ofNullable(compList).orElse(new ArrayList<>()).stream().map(bo -> bo.getId()).collect(Collectors.toSet()); |
|
|
|
|
Optional.ofNullable(annualList).orElse(new LinkedList<>()).stream().forEach(annual -> { |
|
|
|
|
Last5YearDataVo last5YearDataVo = new Last5YearDataVo(); |
|
|
|
|
last5YearDataVo.setYear(annual.getAnnualName()); |
|
|
|
|
AtomicReference<BigDecimal> personCount4Comp = new AtomicReference<>(BigDecimal.ZERO); |
|
|
|
|
|
|
|
|
|
List<AnnualComp> annualCompList = iAnnualCompService.list(new LambdaQueryWrapper<AnnualComp>().eq(AnnualComp::getAnnualid, annual.getId())); |
|
|
|
|
//比赛数
|
|
|
|
|
last5YearDataVo.setCompCount(annualCompList.size()); |
|
|
|
|
if (!ObjectUtils.isEmpty(annualCompList)) { |
|
|
|
|
annualCompList.stream().forEach(ac -> { |
|
|
|
|
AnnualCompPoint annualCompPoint = iAnnualCompPointService.getOne(new LambdaQueryWrapper<AnnualCompPoint>().eq(AnnualCompPoint::getAnnualCompId, ac.getId())); |
|
|
|
|
if (!ObjectUtils.isEmpty(annualCompPoint)) { |
|
|
|
|
long personCount4CompTemp = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>(). |
|
|
|
|
eq(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPoint.getId())); |
|
|
|
|
personCount4Comp.getAndUpdate(val -> val.add(new BigDecimal(personCount4CompTemp))); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
if (ObjectUtils.isEmpty(compIds)) { |
|
|
|
|
List<AnnualComp> annualCompList = iAnnualCompService.list(new LambdaQueryWrapper<AnnualComp>() |
|
|
|
|
.eq(AnnualComp::getAnnualid, annual.getId()) |
|
|
|
|
.in(AnnualComp::getCompid, compIds)); |
|
|
|
|
//年度比赛数量
|
|
|
|
|
last5YearDataVo.setCompCount(annualCompList.size()); |
|
|
|
|
if (!ObjectUtils.isEmpty(annualCompList)) { |
|
|
|
|
annualCompList.stream().forEach(ac -> { |
|
|
|
|
AnnualCompPoint annualCompPoint = iAnnualCompPointService.getOne(new LambdaQueryWrapper<AnnualCompPoint>().eq(AnnualCompPoint::getAnnualCompId, ac.getId())); |
|
|
|
|
if (!ObjectUtils.isEmpty(annualCompPoint)) { |
|
|
|
|
long personCount4CompTemp = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>(). |
|
|
|
|
eq(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPoint.getId())); |
|
|
|
|
personCount4Comp.getAndUpdate(val -> val.add(new BigDecimal(personCount4CompTemp))); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
last5YearDataVo.setPersonCount(personCount4Comp.get().intValue()); |
|
|
|
|
last5YearDataVos.add(last5YearDataVo); |
|
|
|
|