diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/controller/PersonalAbilityEvaluationController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/controller/PersonalAbilityEvaluationController.java index e316be6a..59474380 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/controller/PersonalAbilityEvaluationController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/controller/PersonalAbilityEvaluationController.java @@ -68,12 +68,12 @@ public class PersonalAbilityEvaluationController extends JeecgController personalAbilityEvaluation(@RequestBody PersonalAbilityEvaluation personalAbilityEvaluation) { - personalAbilityEvaluationService.personalAbilityEvaluation(personalAbilityEvaluation); - return Result.OK("操作成功!"); - } +// @ApiOperation(value = "个人能力评价", notes = "个人能力评价") +// @PostMapping(value = "/personalAbilityEvaluation") +// public Result personalAbilityEvaluation(@RequestBody PersonalAbilityEvaluation personalAbilityEvaluation) { +// personalAbilityEvaluationService.personalAbilityEvaluation(personalAbilityEvaluation); +// return Result.OK("操作成功!"); +// } @ApiOperation(value = "个人能力评价", notes = "个人能力评价") @PostMapping(value = "/personalAbilityEvaluation2") diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/entity/DepartAbilityEvaluation.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/entity/DepartAbilityEvaluation.java index a7de9d18..b898a0ed 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/entity/DepartAbilityEvaluation.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/entity/DepartAbilityEvaluation.java @@ -147,4 +147,26 @@ public class DepartAbilityEvaluation implements Serializable { @Excel(name = "能力12", width = 15) @ApiModelProperty(value = "能力12") private Double soc12; + + + /** + * 基础能力id + */ + @Excel(name = "基础能力id", width = 15) + @ApiModelProperty(value = "基础能力id") + private String capacityId; + + /** + * 基础能力名称 + */ + @Excel(name = "基础能力名称", width = 15) + @ApiModelProperty(value = "基础能力名称") + private String capacityName; + + /** + * 能力值 + */ + @Excel(name = "能力值", width = 15) + @ApiModelProperty(value = "能力值") + private Double value; } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/entity/PersonalAbilityEvaluation.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/entity/PersonalAbilityEvaluation.java index 02bf5686..1501cb35 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/entity/PersonalAbilityEvaluation.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/entity/PersonalAbilityEvaluation.java @@ -110,76 +110,97 @@ public class PersonalAbilityEvaluation implements Serializable { @Excel(name = "姓名", width = 15) @ApiModelProperty(value = "姓名") private String name; +// /** +// * 能力1 +// */ +// @Excel(name = "能力1", width = 15) +// @ApiModelProperty(value = "能力1") +// private Double soc1; +// /** +// * 能力2 +// */ +// @Excel(name = "能力2", width = 15) +// @ApiModelProperty(value = "能力2") +// private Double soc2; +// /** +// * 能力3 +// */ +// @Excel(name = "能力3", width = 15) +// @ApiModelProperty(value = "能力3") +// private Double soc3; +// /** +// * 能力4 +// */ +// @Excel(name = "能力4", width = 15) +// @ApiModelProperty(value = "能力4") +// private Double soc4; +// /** +// * 能力5 +// */ +// @Excel(name = "能力5", width = 15) +// @ApiModelProperty(value = "能力5") +// private Double soc5; +// /** +// * 能力6 +// */ +// @Excel(name = "能力6", width = 15) +// @ApiModelProperty(value = "能力6") +// private Double soc6; +// /** +// * 能力7 +// */ +// @Excel(name = "能力7", width = 15) +// @ApiModelProperty(value = "能力7") +// private Double soc7; +// /** +// * 能力8 +// */ +// @Excel(name = "能力8", width = 15) +// @ApiModelProperty(value = "能力8") +// private Double soc8; +// /** +// * 能力9 +// */ +// @Excel(name = "能力9", width = 15) +// @ApiModelProperty(value = "能力9") +// private Double soc9; +// /** +// * 能力10 +// */ +// @Excel(name = "能力10", width = 15) +// @ApiModelProperty(value = "能力10") +// private Double soc10; +// /** +// * 能力11 +// */ +// @Excel(name = "能力11", width = 15) +// @ApiModelProperty(value = "能力11") +// private Double soc11; +// /** +// * 能力12 +// */ +// @Excel(name = "能力12", width = 15) +// @ApiModelProperty(value = "能力12") +// private Double soc12; + /** - * 能力1 - */ - @Excel(name = "能力1", width = 15) - @ApiModelProperty(value = "能力1") - private Double soc1; - /** - * 能力2 - */ - @Excel(name = "能力2", width = 15) - @ApiModelProperty(value = "能力2") - private Double soc2; - /** - * 能力3 - */ - @Excel(name = "能力3", width = 15) - @ApiModelProperty(value = "能力3") - private Double soc3; - /** - * 能力4 - */ - @Excel(name = "能力4", width = 15) - @ApiModelProperty(value = "能力4") - private Double soc4; - /** - * 能力5 - */ - @Excel(name = "能力5", width = 15) - @ApiModelProperty(value = "能力5") - private Double soc5; - /** - * 能力6 - */ - @Excel(name = "能力6", width = 15) - @ApiModelProperty(value = "能力6") - private Double soc6; - /** - * 能力7 - */ - @Excel(name = "能力7", width = 15) - @ApiModelProperty(value = "能力7") - private Double soc7; - /** - * 能力8 - */ - @Excel(name = "能力8", width = 15) - @ApiModelProperty(value = "能力8") - private Double soc8; - /** - * 能力9 - */ - @Excel(name = "能力9", width = 15) - @ApiModelProperty(value = "能力9") - private Double soc9; - /** - * 能力10 + * 基础能力id */ - @Excel(name = "能力10", width = 15) - @ApiModelProperty(value = "能力10") - private Double soc10; + @Excel(name = "基础能力id", width = 15) + @ApiModelProperty(value = "基础能力id") + private String capacityId; + /** - * 能力11 + * 基础能力名称 */ - @Excel(name = "能力11", width = 15) - @ApiModelProperty(value = "能力11") - private Double soc11; + @Excel(name = "基础能力名称", width = 15) + @ApiModelProperty(value = "基础能力名称") + private String capacityName; + /** - * 能力12 + * 能力值 */ - @Excel(name = "能力12", width = 15) - @ApiModelProperty(value = "能力12") - private Double soc12; + @Excel(name = "能力值", width = 15) + @ApiModelProperty(value = "能力值") + private Double value; } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/entity/PersonalAbilityEvaluationCollect.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/entity/PersonalAbilityEvaluationCollect.java index ad215108..84616454 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/entity/PersonalAbilityEvaluationCollect.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/entity/PersonalAbilityEvaluationCollect.java @@ -159,4 +159,25 @@ public class PersonalAbilityEvaluationCollect implements Serializable { @Excel(name = "能力12", width = 15) @ApiModelProperty(value = "能力12") private Double soc12; + + /** + * 基础能力id + */ + @Excel(name = "基础能力id", width = 15) + @ApiModelProperty(value = "基础能力id") + private String capacityId; + + /** + * 基础能力名称 + */ + @Excel(name = "基础能力名称", width = 15) + @ApiModelProperty(value = "基础能力名称") + private String capacityName; + + /** + * 能力值 + */ + @Excel(name = "能力值", width = 15) + @ApiModelProperty(value = "能力值") + private Double value; } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/IPersonalAbilityEvaluationService.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/IPersonalAbilityEvaluationService.java index 2bce1279..5dcde5c7 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/IPersonalAbilityEvaluationService.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/IPersonalAbilityEvaluationService.java @@ -11,7 +11,5 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IPersonalAbilityEvaluationService extends IService { - void personalAbilityEvaluation(PersonalAbilityEvaluation personalAbilityEvaluation); - void personalAbilityEvaluation2(PersonalAbilityEvaluation personalAbilityEvaluation); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/impl/DepartAbilityEvaluationServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/impl/DepartAbilityEvaluationServiceImpl.java index 0517c515..896a1760 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/impl/DepartAbilityEvaluationServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/impl/DepartAbilityEvaluationServiceImpl.java @@ -8,11 +8,14 @@ import org.jeecg.modules.demo.abilityEvaluation.entity.PersonalAbilityEvaluation import org.jeecg.modules.demo.abilityEvaluation.mapper.DepartAbilityEvaluationMapper; import org.jeecg.modules.demo.abilityEvaluation.service.IDepartAbilityEvaluationService; import org.jeecg.modules.demo.abilityEvaluation.service.IPersonalAbilityEvaluationService; +import org.jeecg.modules.demo.basicsskill.entity.Basicsskill; +import org.jeecg.modules.demo.basicsskill.service.IBasicsskillService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.ObjectUtils; import java.util.Date; +import java.util.LinkedList; import java.util.List; /** @@ -27,63 +30,39 @@ public class DepartAbilityEvaluationServiceImpl extends ServiceImpl() + .eq(DepartAbilityEvaluation::getAnnualId, evaluation.getAnnualId()) + .eq(DepartAbilityEvaluation::getDepetId, evaluation.getDepetId()) + ); + } + List abilityEvaluationList = iPersonalAbilityEvaluationService.list(new LambdaQueryWrapper() .eq(PersonalAbilityEvaluation::getAnnualId, departAbilityEvaluation.getAnnualId()) .eq(PersonalAbilityEvaluation::getDepetId, departAbilityEvaluation.getDepetId()) + .groupBy(PersonalAbilityEvaluation::getCapacityId) ); - double sum4Soc1 = 0; - double sum4Soc2 = 0; - double sum4Soc3 = 0; - double sum4Soc4 = 0; - double sum4Soc5 = 0; - double sum4Soc6 = 0; - double sum4Soc7 = 0; - double sum4Soc8 = 0; - double sum4Soc9 = 0; - double sum4Soc10 = 0; - double sum4Soc11 = 0; - double sum4Soc12 = 0; + List saveList = new LinkedList<>(); if (!ObjectUtils.isEmpty(abilityEvaluationList)) { - sum4Soc1 = abilityEvaluationList.stream().mapToDouble(b -> b.getSoc1()).sum(); - sum4Soc2 = abilityEvaluationList.stream().mapToDouble(b -> b.getSoc2()).sum(); - sum4Soc3 = abilityEvaluationList.stream().mapToDouble(b -> b.getSoc3()).sum(); - sum4Soc4 = abilityEvaluationList.stream().mapToDouble(b -> b.getSoc4()).sum(); - sum4Soc5 = abilityEvaluationList.stream().mapToDouble(b -> b.getSoc5()).sum(); - sum4Soc6 = abilityEvaluationList.stream().mapToDouble(b -> b.getSoc6()).sum(); - sum4Soc7 = abilityEvaluationList.stream().mapToDouble(b -> b.getSoc7()).sum(); - sum4Soc8 = abilityEvaluationList.stream().mapToDouble(b -> b.getSoc8()).sum(); - sum4Soc9 = abilityEvaluationList.stream().mapToDouble(b -> b.getSoc9()).sum(); - sum4Soc10 = abilityEvaluationList.stream().mapToDouble(b -> b.getSoc10()).sum(); - sum4Soc11 = abilityEvaluationList.stream().mapToDouble(b -> b.getSoc11()).sum(); - sum4Soc12 = abilityEvaluationList.stream().mapToDouble(b -> b.getSoc12()).sum(); + abilityEvaluationList.stream().forEach(e -> { + DepartAbilityEvaluation bean = new DepartAbilityEvaluation(); + Basicsskill basicsskill = iBasicsskillService.getById(e.getCapacityId()); + bean.setCapacityId(e.getCapacityId()); + bean.setCapacityName(basicsskill.getName()); + bean.setValue(abilityEvaluationList.stream().mapToDouble(b -> b.getValue()).sum()); + bean.setCreateTime(new Date()); + saveList.add(bean); + }); } - - departAbilityEvaluation.setSoc1(sum4Soc1); - departAbilityEvaluation.setSoc2(sum4Soc2); - departAbilityEvaluation.setSoc3(sum4Soc3); - departAbilityEvaluation.setSoc4(sum4Soc4); - departAbilityEvaluation.setSoc5(sum4Soc5); - departAbilityEvaluation.setSoc6(sum4Soc6); - departAbilityEvaluation.setSoc7(sum4Soc7); - departAbilityEvaluation.setSoc8(sum4Soc8); - departAbilityEvaluation.setSoc9(sum4Soc9); - departAbilityEvaluation.setSoc10(sum4Soc10); - departAbilityEvaluation.setSoc11(sum4Soc11); - departAbilityEvaluation.setSoc12(sum4Soc12); - - //id不为空,院系的某一年度已汇总过,重新汇算 - if (StringUtils.isNotBlank(departAbilityEvaluation.getId())) { - departAbilityEvaluation.setUpdateTime(new Date()); - this.updateById(departAbilityEvaluation); - } else { - //首次汇总 - departAbilityEvaluation.setCreateTime(new Date()); - this.save(departAbilityEvaluation); - } - + this.saveBatch(saveList); } } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/impl/PersonalAbilityEvaluationCollectServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/impl/PersonalAbilityEvaluationCollectServiceImpl.java index 2834ecc1..357779dc 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/impl/PersonalAbilityEvaluationCollectServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/impl/PersonalAbilityEvaluationCollectServiceImpl.java @@ -18,8 +18,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.ObjectUtils; -import java.util.LinkedList; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; /** @@ -45,73 +44,56 @@ public class PersonalAbilityEvaluationCollectServiceImpl extends ServiceImpl() + List evaluationCollects = this.list(new LambdaQueryWrapper() .eq(PersonalAbilityEvaluationCollect::getAnnualCompP, projectId)); + //该项目下参赛者们学号列表 + Set workNoSet = evaluationCollects.stream().map(en -> en.getWorkOn()).collect(Collectors.toSet()); + + //删除该项目下参赛者们的能力量化汇总数据,用于重新汇总 + this.remove(new LambdaQueryWrapper() + .in(PersonalAbilityEvaluationCollect::getWorkOn, workNoSet)); + List saveList = new LinkedList<>(); - //该项目,本次新增的个人能力数据 - List evaluationList = iPersonalAbilityEvaluationService.list(new LambdaQueryWrapper() - .eq(PersonalAbilityEvaluation::getAnnualCompP, projectId)); - - // 报名编号列表,要重新汇总的个人能力 - List enrollCodeList = evaluationList.stream().map(b -> b.getEnrollCode()).collect(Collectors.toList()); - if (!ObjectUtils.isEmpty(enrollCodeList)) { - for (String enrollCode : enrollCodeList) { - //查询每个人的个人能力数据,用于重新汇总 - List list4UserAbilityEvaluation = iPersonalAbilityEvaluationService.list(new LambdaQueryWrapper() - .eq(PersonalAbilityEvaluation::getEnrollCode, enrollCode)); - - if (!ObjectUtils.isEmpty(list4UserAbilityEvaluation)) { - double sum4Soc1 = list4UserAbilityEvaluation.stream().mapToDouble(b -> b.getSoc1()).sum(); - double sum4Soc2 = list4UserAbilityEvaluation.stream().mapToDouble(b -> b.getSoc2()).sum(); - double sum4Soc3 = list4UserAbilityEvaluation.stream().mapToDouble(b -> b.getSoc3()).sum(); - double sum4Soc4 = list4UserAbilityEvaluation.stream().mapToDouble(b -> b.getSoc4()).sum(); - double sum4Soc5 = list4UserAbilityEvaluation.stream().mapToDouble(b -> b.getSoc5()).sum(); - double sum4Soc6 = list4UserAbilityEvaluation.stream().mapToDouble(b -> b.getSoc6()).sum(); - double sum4Soc7 = list4UserAbilityEvaluation.stream().mapToDouble(b -> b.getSoc7()).sum(); - double sum4Soc8 = list4UserAbilityEvaluation.stream().mapToDouble(b -> b.getSoc8()).sum(); - double sum4Soc9 = list4UserAbilityEvaluation.stream().mapToDouble(b -> b.getSoc9()).sum(); - double sum4Soc10 = list4UserAbilityEvaluation.stream().mapToDouble(b -> b.getSoc10()).sum(); - double sum4Soc11 = list4UserAbilityEvaluation.stream().mapToDouble(b -> b.getSoc11()).sum(); - double sum4Soc12 = list4UserAbilityEvaluation.stream().mapToDouble(b -> b.getSoc12()).sum(); - - PersonalAbilityEvaluationCollect person = new PersonalAbilityEvaluationCollect(); - person.setAnnualCompP(projectId); - TeamManagement management = iTeamManagementService.getOne(new LambdaQueryWrapper() - .eq(TeamManagement::getEnrollCode, enrollCode)); - SysUser sysUser = iSysUserService.getById(management.getUserId()); - person.setWorkOn(sysUser.getWorkNo()); - person.setName(sysUser.getRealname()); - SysDepart sysDepart = iSysDepartService.getById(sysUser.getOrgCode()); - person.setDepetId(sysDepart.getId()); - person.setSoc1(sum4Soc1); - person.setSoc2(sum4Soc2); - person.setSoc3(sum4Soc3); - person.setSoc4(sum4Soc4); - person.setSoc5(sum4Soc5); - person.setSoc6(sum4Soc6); - person.setSoc7(sum4Soc7); - person.setSoc8(sum4Soc8); - person.setSoc9(sum4Soc9); - person.setSoc10(sum4Soc10); - person.setSoc11(sum4Soc11); - person.setSoc12(sum4Soc12); - saveList.add(person); - } - } - this.saveBatch(saveList); - } + //根据学号重新汇总 + Optional.ofNullable(workNoSet).orElse(new LinkedHashSet<>()).stream().forEach(workNo -> { + +// TeamManagement management = iTeamManagementService.getOne(new LambdaQueryWrapper() +// .eq(TeamManagement::getEnrollCode, enrollCode)); + SysUser sysUser = iSysUserService.getOne(new LambdaQueryWrapper().eq(SysUser::getWorkNo, workNo)); + SysDepart sysDepart = iSysDepartService.getById(sysUser.getOrgCode()); + + //每个学生同一类型能力指标分组查询 + List evaluationList4User = iPersonalAbilityEvaluationService.list(new LambdaQueryWrapper() + .eq(PersonalAbilityEvaluation::getWorkOn, workNo) + .groupBy(PersonalAbilityEvaluation::getCapacityId)); + Optional.ofNullable(evaluationList4User).orElse(new LinkedList<>()).stream().forEach(en -> { + PersonalAbilityEvaluationCollect person = new PersonalAbilityEvaluationCollect(); + person.setAnnualCompP(projectId); + person.setDepetId(sysDepart.getId()); + person.setWorkOn(workNo); + person.setName(sysUser.getRealname()); + double sum = evaluationList4User.stream().mapToDouble(e -> e.getValue()).sum(); + person.setValue(sum); + person.setCapacityId(en.getCapacityId()); + person.setCapacityName(en.getCapacityName()); + saveList.add(person); + }); + }); + + this.saveBatch(saveList); } + } 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 0d5df837..9aae2635 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 @@ -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() -// .eq(TeamManagement::getEnrollCode, enrollCode)); -// if (ObjectUtils.isEmpty(management)) return; -// -// -// //根据年度比赛项目和报名编号查询 查询个人获奖表 -// AwardPersion awardPersion = iAwardPersionService.getOne(new LambdaQueryWrapper() -// .eq(AwardPersion::getAnnualCompP, projectId) -// .eq(AwardPersion::getEnrollCode, enrollCode) -// .last("limit 1")); -// -// if (ObjectUtils.isEmpty(awardPersion)) return; -// -// //查询获奖个人对应的分数 -// ScorePersion scorePersion = iScorePersionService.getOne(new LambdaQueryWrapper() -// .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 compskillList = iCompskillService.list(new LambdaQueryWrapper().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 compskillList = iCompskillService.list(new LambdaQueryWrapper().eq(Compskill::getAnnucompid, projectId)); + if (ObjectUtils.isEmpty(compskillList)) return; + //根据年度比赛项目查询个人获奖表 List awardPersionList = iAwardPersionService.list(new LambdaQueryWrapper().eq(AwardPersion::getAnnualCompP, projectId)); @@ -183,26 +119,31 @@ public class PersonalAbilityEvaluationServiceImpl extends ServiceImpl() .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 compskillList = iCompskillService.list(new LambdaQueryWrapper().eq(Compskill::getAnnucompid, projectId)); - if (!ObjectUtils.isEmpty(compskillList)) { + //遍历每一类能力指标 + compskillList.forEach(compskill -> { + PersonalAbilityEvaluation person = new PersonalAbilityEvaluation(); + person.setAnnualId(annualComp.getAnnualid()); + person.setAnnualCompId(annualCompPoint.getAnnualCompId()); + person.setAnnualCompP(projectId); + person.setWorkOn(sysUser.getWorkNo()); + person.setName(sysUser.getRealname()); + person.setDepetId(sysDepart.getId()); + + Basicsskill basicsskill = iBasicsskillService.getById(compskill.getCapacityid()); + person.setCapacityId(compskill.getCapacityid()); + person.setCapacityName(basicsskill.getName()); + //计算能力量化各类指标 能力量化值 = 直接按项目的能力权值和项目奖项得分算 //能力量化值 = 项目得分*项目的能力权值/100 - this.convertScore(compskillList, person, Double.valueOf(scorePersion.getScore())); - } - saveList.add(person); + this.convertScore(compskill.getWeight(), person, Double.valueOf(scorePersion.getScore())); + saveList.add(person); + }); } }); @@ -217,46 +158,8 @@ public class PersonalAbilityEvaluationServiceImpl extends ServiceImpl 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; } } diff --git a/jeecgboot-vue3-master/src/views/abilityEvaluation/depart/DepartAbilityEvaluation.data.ts b/jeecgboot-vue3-master/src/views/abilityEvaluation/depart/DepartAbilityEvaluation.data.ts index 56090e42..9a0df927 100644 --- a/jeecgboot-vue3-master/src/views/abilityEvaluation/depart/DepartAbilityEvaluation.data.ts +++ b/jeecgboot-vue3-master/src/views/abilityEvaluation/depart/DepartAbilityEvaluation.data.ts @@ -12,65 +12,75 @@ export const columns: BasicColumn[] = [ dataIndex: 'annualId_dictText' }, { - title: '能力1', - align: "center", - dataIndex: 'soc1' - }, - { - title: '能力2', - align: "center", - dataIndex: 'soc2' - }, - { - title: '能力3', - align: "center", - dataIndex: 'soc3' - }, - { - title: '能力4', - align: "center", - dataIndex: 'soc4' - }, - { - title: '能力5', - align: "center", - dataIndex: 'soc5' - }, - { - title: '能力6', - align: "center", - dataIndex: 'soc6' - }, - { - title: '能力7', - align: "center", - dataIndex: 'soc7' - }, - { - title: '能力8', - align: "center", - dataIndex: 'soc8' - }, - { - title: '能力9', - align: "center", - dataIndex: 'soc9' - }, - { - title: '能力10', - align: "center", - dataIndex: 'soc10' - }, - { - title: '能力11', - align: "center", - dataIndex: 'soc11' - }, - { - title: '能力12', - align: "center", - dataIndex: 'soc12' - }, + title: '能力名称', + align:"center", + dataIndex: 'capacityName' + }, + { + title: '能力值', + align:"center", + dataIndex: 'value' + }, + // { + // title: '能力1', + // align: "center", + // dataIndex: 'soc1' + // }, + // { + // title: '能力2', + // align: "center", + // dataIndex: 'soc2' + // }, + // { + // title: '能力3', + // align: "center", + // dataIndex: 'soc3' + // }, + // { + // title: '能力4', + // align: "center", + // dataIndex: 'soc4' + // }, + // { + // title: '能力5', + // align: "center", + // dataIndex: 'soc5' + // }, + // { + // title: '能力6', + // align: "center", + // dataIndex: 'soc6' + // }, + // { + // title: '能力7', + // align: "center", + // dataIndex: 'soc7' + // }, + // { + // title: '能力8', + // align: "center", + // dataIndex: 'soc8' + // }, + // { + // title: '能力9', + // align: "center", + // dataIndex: 'soc9' + // }, + // { + // title: '能力10', + // align: "center", + // dataIndex: 'soc10' + // }, + // { + // title: '能力11', + // align: "center", + // dataIndex: 'soc11' + // }, + // { + // title: '能力12', + // align: "center", + // dataIndex: 'soc12' + // }, ]; //查询数据 export const searchFormSchema: FormSchema[] = [ @@ -122,65 +132,81 @@ export const formSchema: FormSchema[] = [ }, }, { - label: '能力1', - field: 'soc1', - component: 'InputNumber', - }, - { - label: '能力2', - field: 'soc2', - component: 'InputNumber', - }, - { - label: '能力3', - field: 'soc3', - component: 'InputNumber', - }, - { - label: '能力4', - field: 'soc4', - component: 'InputNumber', - }, - { - label: '能力5', - field: 'soc5', - component: 'InputNumber', - }, - { - label: '能力6', - field: 'soc6', - component: 'InputNumber', - }, - { - label: '能力7', - field: 'soc7', - component: 'InputNumber', - }, - { - label: '能力8', - field: 'soc8', - component: 'InputNumber', - }, - { - label: '能力9', - field: 'soc9', - component: 'InputNumber', - }, - { - label: '能力10', - field: 'soc10', - component: 'InputNumber', - }, - { - label: '能力11', - field: 'soc11', - component: 'InputNumber', + label: '能力名称', + field: 'capacityName', + component: 'Input', + componentProps:{ + disabled: true, + } }, { - label: '能力12', - field: 'soc12', + label: '能力值', + field: 'value', component: 'InputNumber', - }, + componentProps:{ + disabled: true, + } + }, + // { + // label: '能力1', + // field: 'soc1', + // component: 'InputNumber', + // }, + // { + // label: '能力2', + // field: 'soc2', + // component: 'InputNumber', + // }, + // { + // label: '能力3', + // field: 'soc3', + // component: 'InputNumber', + // }, + // { + // label: '能力4', + // field: 'soc4', + // component: 'InputNumber', + // }, + // { + // label: '能力5', + // field: 'soc5', + // component: 'InputNumber', + // }, + // { + // label: '能力6', + // field: 'soc6', + // component: 'InputNumber', + // }, + // { + // label: '能力7', + // field: 'soc7', + // component: 'InputNumber', + // }, + // { + // label: '能力8', + // field: 'soc8', + // component: 'InputNumber', + // }, + // { + // label: '能力9', + // field: 'soc9', + // component: 'InputNumber', + // }, + // { + // label: '能力10', + // field: 'soc10', + // component: 'InputNumber', + // }, + // { + // label: '能力11', + // field: 'soc11', + // component: 'InputNumber', + // }, + // { + // label: '能力12', + // field: 'soc12', + // component: 'InputNumber', + // }, // TODO 主键隐藏字段,目前写死为ID { diff --git a/jeecgboot-vue3-master/src/views/abilityEvaluation/persanlCollect/PersonalAbilityEvaluationCollect.data.ts b/jeecgboot-vue3-master/src/views/abilityEvaluation/persanlCollect/PersonalAbilityEvaluationCollect.data.ts index 7221cf4b..29906e11 100644 --- a/jeecgboot-vue3-master/src/views/abilityEvaluation/persanlCollect/PersonalAbilityEvaluationCollect.data.ts +++ b/jeecgboot-vue3-master/src/views/abilityEvaluation/persanlCollect/PersonalAbilityEvaluationCollect.data.ts @@ -17,65 +17,75 @@ export const columns: BasicColumn[] = [ dataIndex: 'name' }, { - title: '能力1', - align: "center", - dataIndex: 'soc1' - }, - { - title: '能力2', - align: "center", - dataIndex: 'soc2' - }, - { - title: '能力3', - align: "center", - dataIndex: 'soc3' - }, - { - title: '能力4', - align: "center", - dataIndex: 'soc4' - }, - { - title: '能力5', - align: "center", - dataIndex: 'soc5' - }, - { - title: '能力6', - align: "center", - dataIndex: 'soc6' - }, - { - title: '能力7', - align: "center", - dataIndex: 'soc7' - }, - { - title: '能力8', - align: "center", - dataIndex: 'soc8' - }, - { - title: '能力9', - align: "center", - dataIndex: 'soc9' - }, - { - title: '能力10', - align: "center", - dataIndex: 'soc10' - }, - { - title: '能力11', - align: "center", - dataIndex: 'soc11' - }, - { - title: '能力12', - align: "center", - dataIndex: 'soc12' - }, + title: '能力名称', + align:"center", + dataIndex: 'capacityName' + }, + { + title: '能力值', + align:"center", + dataIndex: 'value' + }, + // { + // title: '能力1', + // align: "center", + // dataIndex: 'soc1' + // }, + // { + // title: '能力2', + // align: "center", + // dataIndex: 'soc2' + // }, + // { + // title: '能力3', + // align: "center", + // dataIndex: 'soc3' + // }, + // { + // title: '能力4', + // align: "center", + // dataIndex: 'soc4' + // }, + // { + // title: '能力5', + // align: "center", + // dataIndex: 'soc5' + // }, + // { + // title: '能力6', + // align: "center", + // dataIndex: 'soc6' + // }, + // { + // title: '能力7', + // align: "center", + // dataIndex: 'soc7' + // }, + // { + // title: '能力8', + // align: "center", + // dataIndex: 'soc8' + // }, + // { + // title: '能力9', + // align: "center", + // dataIndex: 'soc9' + // }, + // { + // title: '能力10', + // align: "center", + // dataIndex: 'soc10' + // }, + // { + // title: '能力11', + // align: "center", + // dataIndex: 'soc11' + // }, + // { + // title: '能力12', + // align: "center", + // dataIndex: 'soc12' + // }, ]; //查询数据 export const searchFormSchema: FormSchema[] = [ @@ -122,65 +132,75 @@ export const formSchema: FormSchema[] = [ component: 'Input', }, { - label: '能力1', - field: 'soc1', - component: 'InputNumber', - }, - { - label: '能力2', - field: 'soc2', - component: 'InputNumber', - }, - { - label: '能力3', - field: 'soc3', - component: 'InputNumber', - }, - { - label: '能力4', - field: 'soc4', - component: 'InputNumber', - }, - { - label: '能力5', - field: 'soc5', - component: 'InputNumber', - }, - { - label: '能力6', - field: 'soc6', - component: 'InputNumber', - }, - { - label: '能力7', - field: 'soc7', - component: 'InputNumber', - }, - { - label: '能力8', - field: 'soc8', - component: 'InputNumber', - }, - { - label: '能力9', - field: 'soc9', - component: 'InputNumber', - }, - { - label: '能力10', - field: 'soc10', - component: 'InputNumber', - }, - { - label: '能力11', - field: 'soc11', - component: 'InputNumber', + label: '能力名称', + field: 'capacityName', + component: 'Input', }, { - label: '能力12', - field: 'soc12', + label: '能力值', + field: 'value', component: 'InputNumber', }, + // { + // label: '能力1', + // field: 'soc1', + // component: 'InputNumber', + // }, + // { + // label: '能力2', + // field: 'soc2', + // component: 'InputNumber', + // }, + // { + // label: '能力3', + // field: 'soc3', + // component: 'InputNumber', + // }, + // { + // label: '能力4', + // field: 'soc4', + // component: 'InputNumber', + // }, + // { + // label: '能力5', + // field: 'soc5', + // component: 'InputNumber', + // }, + // { + // label: '能力6', + // field: 'soc6', + // component: 'InputNumber', + // }, + // { + // label: '能力7', + // field: 'soc7', + // component: 'InputNumber', + // }, + // { + // label: '能力8', + // field: 'soc8', + // component: 'InputNumber', + // }, + // { + // label: '能力9', + // field: 'soc9', + // component: 'InputNumber', + // }, + // { + // label: '能力10', + // field: 'soc10', + // component: 'InputNumber', + // }, + // { + // label: '能力11', + // field: 'soc11', + // component: 'InputNumber', + // }, + // { + // label: '能力12', + // field: 'soc12', + // component: 'InputNumber', + // }, // TODO 主键隐藏字段,目前写死为ID { diff --git a/jeecgboot-vue3-master/src/views/abilityEvaluation/persoanl/PersonalAbilityEvaluation.data.ts b/jeecgboot-vue3-master/src/views/abilityEvaluation/persoanl/PersonalAbilityEvaluation.data.ts index 943045d0..5d9ca270 100644 --- a/jeecgboot-vue3-master/src/views/abilityEvaluation/persoanl/PersonalAbilityEvaluation.data.ts +++ b/jeecgboot-vue3-master/src/views/abilityEvaluation/persoanl/PersonalAbilityEvaluation.data.ts @@ -35,65 +35,75 @@ export const columns: BasicColumn[] = [ dataIndex: 'name' }, { - title: '能力1', + title: '能力名称', align:"center", - dataIndex: 'soc1' + dataIndex: 'capacityName' }, { - title: '能力2', + title: '能力值', align:"center", - dataIndex: 'soc2' - }, - { - title: '能力3', - align:"center", - dataIndex: 'soc3' - }, - { - title: '能力4', - align:"center", - dataIndex: 'soc4' - }, - { - title: '能力5', - align:"center", - dataIndex: 'soc5' - }, - { - title: '能力6', - align:"center", - dataIndex: 'soc6' - }, - { - title: '能力7', - align:"center", - dataIndex: 'soc7' - }, - { - title: '能力8', - align:"center", - dataIndex: 'soc8' - }, - { - title: '能力9', - align:"center", - dataIndex: 'soc9' - }, - { - title: '能力10', - align:"center", - dataIndex: 'soc10' - }, - { - title: '能力11', - align:"center", - dataIndex: 'soc11' - }, - { - title: '能力12', - align:"center", - dataIndex: 'soc12' - }, + dataIndex: 'value' + }, + // { + // title: '能力1', + // align:"center", + // dataIndex: 'soc1' + // }, + // { + // title: '能力2', + // align:"center", + // dataIndex: 'soc2' + // }, + // { + // title: '能力3', + // align:"center", + // dataIndex: 'soc3' + // }, + // { + // title: '能力4', + // align:"center", + // dataIndex: 'soc4' + // }, + // { + // title: '能力5', + // align:"center", + // dataIndex: 'soc5' + // }, + // { + // title: '能力6', + // align:"center", + // dataIndex: 'soc6' + // }, + // { + // title: '能力7', + // align:"center", + // dataIndex: 'soc7' + // }, + // { + // title: '能力8', + // align:"center", + // dataIndex: 'soc8' + // }, + // { + // title: '能力9', + // align:"center", + // dataIndex: 'soc9' + // }, + // { + // title: '能力10', + // align:"center", + // dataIndex: 'soc10' + // }, + // { + // title: '能力11', + // align:"center", + // dataIndex: 'soc11' + // }, + // { + // title: '能力12', + // align:"center", + // dataIndex: 'soc12' + // }, ]; //查询数据 export const searchFormSchema: FormSchema[] = [ @@ -182,65 +192,65 @@ export const formSchema: FormSchema[] = [ component: 'Input', }, { - label: '能力1', - field: 'soc1', - component: 'InputNumber', - }, - { - label: '能力2', - field: 'soc2', - component: 'InputNumber', - }, - { - label: '能力3', - field: 'soc3', - component: 'InputNumber', - }, - { - label: '能力4', - field: 'soc4', - component: 'InputNumber', - }, - { - label: '能力5', - field: 'soc5', - component: 'InputNumber', - }, - { - label: '能力6', - field: 'soc6', - component: 'InputNumber', - }, - { - label: '能力7', - field: 'soc7', - component: 'InputNumber', - }, - { - label: '能力8', - field: 'soc8', - component: 'InputNumber', - }, - { - label: '能力9', - field: 'soc9', - component: 'InputNumber', - }, - { - label: '能力10', - field: 'soc10', - component: 'InputNumber', - }, - { - label: '能力11', - field: 'soc11', - component: 'InputNumber', + label: '能力名称', + field: 'capacityName', + component: 'Input', }, { - label: '能力12', - field: 'soc12', + label: '能力值', + field: 'value', component: 'InputNumber', }, + // { + // label: '能力3', + // field: 'soc3', + // component: 'InputNumber', + // }, + // { + // label: '能力4', + // field: 'soc4', + // component: 'InputNumber', + // }, + // { + // label: '能力5', + // field: 'soc5', + // component: 'InputNumber', + // }, + // { + // label: '能力6', + // field: 'soc6', + // component: 'InputNumber', + // }, + // { + // label: '能力7', + // field: 'soc7', + // component: 'InputNumber', + // }, + // { + // label: '能力8', + // field: 'soc8', + // component: 'InputNumber', + // }, + // { + // label: '能力9', + // field: 'soc9', + // component: 'InputNumber', + // }, + // { + // label: '能力10', + // field: 'soc10', + // component: 'InputNumber', + // }, + // { + // label: '能力11', + // field: 'soc11', + // component: 'InputNumber', + // }, + // { + // label: '能力12', + // field: 'soc12', + // component: 'InputNumber', + // }, // TODO 主键隐藏字段,目前写死为ID { label: '', diff --git a/jeecgboot-vue3-master/src/views/awardpersion/AwardPersion.api.ts b/jeecgboot-vue3-master/src/views/awardpersion/AwardPersion.api.ts index be5c1edb..4053a201 100644 --- a/jeecgboot-vue3-master/src/views/awardpersion/AwardPersion.api.ts +++ b/jeecgboot-vue3-master/src/views/awardpersion/AwardPersion.api.ts @@ -15,7 +15,7 @@ enum Api { exportXlsMb = '/awardpersion/awardPersion/exportXlsMb', queryCompId = '/annualcompgroup/annualCompGroup/queryCompId', queryOptions = '/awardpersion/awardPersion/queryOptions', - personalAbilityEvaluation = '/abilityEvaluation/personalAbilityEvaluation/personalAbilityEvaluation', + personalAbilityEvaluation = '/abilityEvaluation/personalAbilityEvaluation/personalAbilityEvaluation2', }