1、人个能力评价

dev
zhc077 1 year ago
parent b58cbeeba8
commit 2ec98d5157
  1. 7
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/controller/PersonalAbilityEvaluationController.java
  2. 12
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/entity/PersonalAbilityEvaluation.java
  3. 2
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/IPersonalAbilityEvaluationService.java
  4. 165
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/impl/PersonalAbilityEvaluationServiceImpl.java
  5. 2
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/impl/PersonalCompTotalScoreServiceImpl.java
  6. 17
      jeecgboot-vue3-master/src/views/awardpersion/AwardPersion.api.ts
  7. 24
      jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList.vue

@ -68,6 +68,13 @@ public class PersonalAbilityEvaluationController extends JeecgController<Persona
return Result.OK("添加成功!");
}
@ApiOperation(value = "个人能力评价", notes = "个人能力评价")
@PostMapping(value = "/personalAbilityEvaluation")
public Result<String> personalAbilityEvaluation(@RequestBody PersonalAbilityEvaluation personalAbilityEvaluation) {
personalAbilityEvaluationService.personalAbilityEvaluation(personalAbilityEvaluation);
return Result.OK("操作成功!");
}
/**
* 编辑
*

@ -1,6 +1,7 @@
package org.jeecg.modules.demo.abilityEvaluation.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
@ -79,7 +80,7 @@ public class PersonalAbilityEvaluation implements Serializable {
*/
@Excel(name = "年度比赛", width = 15)
@ApiModelProperty(value = "年度比赛")
@Dict(dictTable = "annual_comp",dicCode = "id",dicText = "name")
@Dict(dictTable = "annual_comp", dicCode = "id", dicText = "name")
private String annualCompId;
/**
* 年度比赛项目
@ -88,6 +89,15 @@ public class PersonalAbilityEvaluation implements Serializable {
@Dict(dictTable = "annual_comp_point", dicText = "obj_name", dicCode = "id")
@ApiModelProperty(value = "年度比赛项目")
private String annualCompP;
/**
* 报名编号
*/
@TableField(exist = false)
private String enrollCode;
/**
* 学号
*/

@ -11,4 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IPersonalAbilityEvaluationService extends IService<PersonalAbilityEvaluation> {
void personalAbilityEvaluation(PersonalAbilityEvaluation personalAbilityEvaluation);
}

@ -1,19 +1,180 @@
package org.jeecg.modules.demo.abilityEvaluation.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.util.ComputeUtils;
import org.jeecg.modules.demo.abilityEvaluation.entity.PersonalAbilityEvaluation;
import org.jeecg.modules.demo.abilityEvaluation.mapper.PersonalAbilityEvaluationMapper;
import org.jeecg.modules.demo.abilityEvaluation.service.IPersonalAbilityEvaluationService;
import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint;
import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService;
import org.jeecg.modules.demo.annualcomp.entity.AnnualComp;
import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService;
import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.TeamManagement;
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.compskill.entity.Compskill;
import org.jeecg.modules.demo.compskill.service.ICompskillService;
import org.jeecg.modules.demo.scorepersion.entity.ScorePersion;
import org.jeecg.modules.demo.scorepersion.service.IScorePersionService;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysDepartService;
import org.jeecg.modules.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
/**
* @Description: 个人能力评价
* @Author: jeecg-boot
* @Date: 2023-11-07
* @Date: 2023-11-07
* @Version: V1.0
*/
@Service
public class PersonalAbilityEvaluationServiceImpl extends ServiceImpl<PersonalAbilityEvaluationMapper, PersonalAbilityEvaluation> implements IPersonalAbilityEvaluationService {
@Autowired
private IAnnualCompPointService iAnnualCompPointService;
@Autowired
private IAwardPersionService iAwardPersionService;
@Autowired
private IScorePersionService iScorePersionService;
@Autowired
private ICompskillService iCompskillService;
@Autowired
private ISysDepartService iSysDepartService;
@Autowired
private ISysUserService iSysUserService;
@Autowired
private ITeamManagementService iTeamManagementService;
@Autowired
private IAnnualCompService iAnnualCompService;
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);
}
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)));
}
}
return person;
}
}

@ -34,7 +34,7 @@ public class PersonalCompTotalScoreServiceImpl extends ServiceImpl<PersonalCompT
Optional.ofNullable(list).orElse(new LinkedList<>()).forEach(e -> {
PersonalCompTotalScore p = this.getOne(new LambdaQueryWrapper<PersonalCompTotalScore>()
.eq(PersonalCompTotalScore::getWorkOn, e.getWorkOn())
.apply("limit 1"));
.last("limit 1"));
//为空则为首次累计,新增操作
if ((ObjectUtils.isEmpty(p))) {
PersonalCompTotalScore p2 = new PersonalCompTotalScore();

@ -15,6 +15,7 @@ enum Api {
exportXlsMb = '/awardpersion/awardPersion/exportXlsMb',
queryCompId = '/annualcompgroup/annualCompGroup/queryCompId',
queryOptions = '/awardpersion/awardPersion/queryOptions',
personalAbilityEvaluation = '/abilityEvaluation/personalAbilityEvaluation/personalAbilityEvaluation',
}
@ -88,3 +89,19 @@ export const saveOrUpdate1 = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save1;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}
// 个人能力量化
export const personalAbilityEvaluation = (params,handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认操作',
content: '确认发送请求吗',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.post({url: Api.personalAbilityEvaluation,params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}

@ -80,12 +80,21 @@
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './AwardPersion.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl,getExportUrlMb } from './AwardPersion.api';
import {
list,
deleteOne,
batchDelete,
getImportUrl,
getExportUrl,
getExportUrlMb,
personalAbilityEvaluation
} from './AwardPersion.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import AwardPersionModal from './components/AwardPersionModal.vue'
import AwardPersionModal1 from './components/AwardPersionModal1.vue'
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
import {collectScore} from "/@/views/annualCompPoint/committee/AnnualCompPoint.api";
const formRef = ref();
const queryParam = reactive<any>({});
@ -101,7 +110,7 @@
canResize:false,
useSearchForm: false,
actionColumn: {
width: 120,
width: 230,
fixed: 'right',
},
beforeFetch: (params) => {
@ -186,6 +195,13 @@
(selectedRowKeys.value = []) && reload();
}
/**
* 个人能力量化
*/
function handlePersonalAbilityEvaluation(record: Recordable) {
personalAbilityEvaluation({annualCompP: record.annualCompP, enrollCode: record.enrollCode}, handleSuccess);
}
/**
* 操作栏
*/
@ -195,6 +211,10 @@
label: '编辑',
onClick: handleEdit.bind(null, record),
},
{
label: '个人能力量化',
onClick: handlePersonalAbilityEvaluation.bind(null, record),
},
];
}

Loading…
Cancel
Save