部门积分、部门能力 部门为空时汇总所有部门, 不为空时汇总该部门

main
fhv 4 months ago
parent a9f89d25f0
commit 55b613ccc7
  1. 20
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/controller/DepartAbilityEvaluationController.java
  2. 2
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/IDepartAbilityEvaluationService.java
  3. 28
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/impl/DepartAbilityEvaluationServiceImpl.java
  4. 20
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/controller/DepartCompTotalScoreController.java
  5. 1
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/IDepartCompTotalScoreService.java
  6. 23
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/impl/DepartCompTotalScoreServiceImpl.java
  7. 6
      jeecgboot-vue3-master/src/views/abilityEvaluation/depart/DepartAbilityEvaluation.api.ts
  8. 10
      jeecgboot-vue3-master/src/views/abilityEvaluation/depart/DepartAbilityEvaluation.data.ts
  9. 6
      jeecgboot-vue3-master/src/views/annualScore/departCompTotalScore/DepartCompTotalScore.api.ts
  10. 10
      jeecgboot-vue3-master/src/views/annualScore/departCompTotalScore/DepartCompTotalScore.data.ts

@ -1,5 +1,6 @@
package org.jeecg.modules.demo.abilityEvaluation.controller; package org.jeecg.modules.demo.abilityEvaluation.controller;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -68,6 +69,25 @@ public class DepartAbilityEvaluationController extends JeecgController<DepartAbi
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
/**
* @Title: collectAllDepart
* @Description: 部门为空时汇总所有部门, 不为空时汇总该部门
* @Params: [departAbilityEvaluation]
* @Return: org.jeecg.common.api.vo.Result<java.lang.String>
* @Author: z.h.c
* @Date: 2024/7/30 23:03
*/
@ApiOperation(value = "院系年度能力评价-汇总所有部门", notes = "院系年度能力评价-汇总所有部门")
@PostMapping(value = "/collectAllDepart")
public Result<String> collectAllDepart(@RequestBody DepartAbilityEvaluation departAbilityEvaluation) {
if (StrUtil.isNotBlank(departAbilityEvaluation.getDepetId())) {//部门不为空时汇总该部门
departAbilityEvaluationService.collectAbilityEvaluation(departAbilityEvaluation);
} else {
departAbilityEvaluationService.collectAllDepart(departAbilityEvaluation);
}
return Result.OK("添加成功!");
}
@ApiOperation(value = "院系年度能力评价-重新汇算", notes = "院系年度能力评价-重新汇算") @ApiOperation(value = "院系年度能力评价-重新汇算", notes = "院系年度能力评价-重新汇算")
@PostMapping(value = "/reCollectAbilityEvaluation") @PostMapping(value = "/reCollectAbilityEvaluation")
public Result<String> reCollectAbilityEvaluation(@RequestBody DepartAbilityEvaluation departAbilityEvaluation) { public Result<String> reCollectAbilityEvaluation(@RequestBody DepartAbilityEvaluation departAbilityEvaluation) {

@ -12,4 +12,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
public interface IDepartAbilityEvaluationService extends IService<DepartAbilityEvaluation> { public interface IDepartAbilityEvaluationService extends IService<DepartAbilityEvaluation> {
void collectAbilityEvaluation(DepartAbilityEvaluation departAbilityEvaluation); void collectAbilityEvaluation(DepartAbilityEvaluation departAbilityEvaluation);
void collectAllDepart(DepartAbilityEvaluation departAbilityEvaluation);
} }

@ -8,14 +8,12 @@ import org.jeecg.modules.demo.abilityEvaluation.entity.PersonalAbilityEvaluation
import org.jeecg.modules.demo.abilityEvaluation.mapper.DepartAbilityEvaluationMapper; import org.jeecg.modules.demo.abilityEvaluation.mapper.DepartAbilityEvaluationMapper;
import org.jeecg.modules.demo.abilityEvaluation.service.IDepartAbilityEvaluationService; import org.jeecg.modules.demo.abilityEvaluation.service.IDepartAbilityEvaluationService;
import org.jeecg.modules.demo.abilityEvaluation.service.IPersonalAbilityEvaluationService; import org.jeecg.modules.demo.abilityEvaluation.service.IPersonalAbilityEvaluationService;
import org.jeecg.modules.demo.basicsskill.service.IBasicsskillService; import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.service.ISysDepartService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date; import java.util.*;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -30,6 +28,11 @@ public class DepartAbilityEvaluationServiceImpl extends ServiceImpl<DepartAbilit
@Autowired @Autowired
private IPersonalAbilityEvaluationService iPersonalAbilityEvaluationService; private IPersonalAbilityEvaluationService iPersonalAbilityEvaluationService;
@Autowired
private ISysDepartService iSysDepartService;
private final static String PARENT_ID = "1693446350597038081";
@Override @Override
public void collectAbilityEvaluation(DepartAbilityEvaluation departAbilityEvaluation) { public void collectAbilityEvaluation(DepartAbilityEvaluation departAbilityEvaluation) {
@ -51,7 +54,7 @@ public class DepartAbilityEvaluationServiceImpl extends ServiceImpl<DepartAbilit
.collect(Collectors.groupingBy(PersonalAbilityEvaluation::getCapacityId)); .collect(Collectors.groupingBy(PersonalAbilityEvaluation::getCapacityId));
List<DepartAbilityEvaluation> saveList = new LinkedList<>(); List<DepartAbilityEvaluation> saveList = new LinkedList<>();
depetListMap.keySet().stream().forEach(k -> { Optional.ofNullable(depetListMap).orElse(new LinkedHashMap<>()).keySet().stream().forEach(k -> {
List<PersonalAbilityEvaluation> evaluationList = depetListMap.get(k); List<PersonalAbilityEvaluation> evaluationList = depetListMap.get(k);
DepartAbilityEvaluation bean = new DepartAbilityEvaluation(); DepartAbilityEvaluation bean = new DepartAbilityEvaluation();
bean.setAnnualId(departAbilityEvaluation.getAnnualId()); bean.setAnnualId(departAbilityEvaluation.getAnnualId());
@ -64,4 +67,17 @@ public class DepartAbilityEvaluationServiceImpl extends ServiceImpl<DepartAbilit
}); });
this.saveBatch(saveList); this.saveBatch(saveList);
} }
@Override
public void collectAllDepart(DepartAbilityEvaluation param) {
this.remove(new LambdaQueryWrapper<DepartAbilityEvaluation>().eq(DepartAbilityEvaluation::getAnnualId, param.getAnnualId()));
List<SysDepart> departList = iSysDepartService.list(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getParentId, PARENT_ID));
Optional.ofNullable(departList).orElse(new LinkedList<>()).stream().forEach(e -> {
DepartAbilityEvaluation depart = new DepartAbilityEvaluation();
depart.setAnnualId(param.getAnnualId());
depart.setDepetId(e.getId());
this.collectAbilityEvaluation(depart);
});
}
} }

@ -1,5 +1,6 @@
package org.jeecg.modules.demo.annualScore.controller; package org.jeecg.modules.demo.annualScore.controller;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -55,6 +56,25 @@ public class DepartCompTotalScoreController extends JeecgController<DepartCompTo
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
/**
* @Title: add
* @Description: 部门为空时汇总所有部门, 不为空时汇总该部门
* @Params: [departCompTotalScore]
* @Return: org.jeecg.common.api.vo.Result<java.lang.String>
* @Author: z.h.c
* @Date: 2024/7/30 22:26
*/
@ApiOperation(value = "院系总积分-汇总所有部门", notes = "院系总积分-汇总所有部门")
@PostMapping(value = "/collectAllDepart")
public Result<String> collectAllDepart(@RequestBody DepartCompTotalScore departCompTotalScore) {
if (StrUtil.isNotBlank(departCompTotalScore.getDepet())) {//部门不为空时汇总该部门
departCompTotalScoreService.collectScore(departCompTotalScore);
} else {
departCompTotalScoreService.collectAllDepart(departCompTotalScore);
}
return Result.OK("添加成功!");
}
/** /**
* 分页列表查询 * 分页列表查询
* *

@ -13,4 +13,5 @@ public interface IDepartCompTotalScoreService extends IService<DepartCompTotalSc
void collectScore(DepartCompTotalScore departCompTotalScore); void collectScore(DepartCompTotalScore departCompTotalScore);
void collectAllDepart(DepartCompTotalScore departCompTotalScore);
} }

@ -8,6 +8,8 @@ import org.jeecg.modules.demo.annualScore.entity.PersonalCompScore;
import org.jeecg.modules.demo.annualScore.mapper.DepartCompTotalScoreMapper; import org.jeecg.modules.demo.annualScore.mapper.DepartCompTotalScoreMapper;
import org.jeecg.modules.demo.annualScore.service.IDepartCompTotalScoreService; import org.jeecg.modules.demo.annualScore.service.IDepartCompTotalScoreService;
import org.jeecg.modules.demo.annualScore.service.IPersonalCompScoreService; import org.jeecg.modules.demo.annualScore.service.IPersonalCompScoreService;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.service.ISysDepartService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
@ -15,7 +17,9 @@ import org.springframework.util.ObjectUtils;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.Date; import java.util.Date;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Optional;
/** /**
* @Description: 院系总积分 * @Description: 院系总积分
@ -29,6 +33,12 @@ public class DepartCompTotalScoreServiceImpl extends ServiceImpl<DepartCompTotal
@Autowired @Autowired
private IPersonalCompScoreService iPersonalCompScoreService; private IPersonalCompScoreService iPersonalCompScoreService;
@Autowired
private ISysDepartService iSysDepartService;
private final static String PARENT_ID = "1693446350597038081";
/** /**
* @description: 根据院系和年度统计个人比赛积分表数据 * @description: 根据院系和年度统计个人比赛积分表数据
* @param: [departCompTotalScore] * @param: [departCompTotalScore]
@ -65,4 +75,17 @@ public class DepartCompTotalScoreServiceImpl extends ServiceImpl<DepartCompTotal
} }
} }
@Override
public void collectAllDepart(DepartCompTotalScore param) {
this.remove(new LambdaQueryWrapper<DepartCompTotalScore>().eq(DepartCompTotalScore::getAnnualId, param.getAnnualId()));
List<SysDepart> departList = iSysDepartService.list(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getParentId, PARENT_ID));
Optional.ofNullable(departList).orElse(new LinkedList<>()).stream().forEach(e -> {
DepartCompTotalScore depart = new DepartCompTotalScore();
depart.setAnnualId(param.getAnnualId());
depart.setDepet(e.getId());
this.collectScore(depart);
});
}
} }

@ -5,7 +5,8 @@ const { createConfirm } = useMessage();
enum Api { enum Api {
list = '/abilityEvaluation/departAbilityEvaluation/list', list = '/abilityEvaluation/departAbilityEvaluation/list',
save='/abilityEvaluation/departAbilityEvaluation/add', // save='/abilityEvaluation/departAbilityEvaluation/add',
collectAllDepart='/abilityEvaluation/departAbilityEvaluation/collectAllDepart',
edit='/abilityEvaluation/departAbilityEvaluation/edit', edit='/abilityEvaluation/departAbilityEvaluation/edit',
deleteOne = '/abilityEvaluation/departAbilityEvaluation/delete', deleteOne = '/abilityEvaluation/departAbilityEvaluation/delete',
deleteBatch = '/abilityEvaluation/departAbilityEvaluation/deleteBatch', deleteBatch = '/abilityEvaluation/departAbilityEvaluation/deleteBatch',
@ -60,7 +61,8 @@ export const batchDelete = (params, handleSuccess) => {
* @param params * @param params
*/ */
export const saveOrUpdate = (params, isUpdate) => { export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save; // let url = isUpdate ? Api.edit : Api.save;
let url = isUpdate ? Api.edit : Api.collectAllDepart;
return defHttp.post({url: url, params}); return defHttp.post({url: url, params});
} }

@ -61,11 +61,11 @@ export const formSchema: FormSchema[] = [
componentProps: { componentProps: {
dictCode:"sys_depart,depart_name,id,parent_id='1693446350597038081'" dictCode:"sys_depart,depart_name,id,parent_id='1693446350597038081'"
}, },
dynamicRules: ({model, schema}) => { // dynamicRules: ({model, schema}) => {
return [ // return [
{required: true, message: '请输入所属部门!'}, // {required: true, message: '请输入所属部门!'},
]; // ];
}, // },
}, },
{ {
label: '年度', label: '年度',

@ -5,7 +5,8 @@ const { createConfirm } = useMessage();
enum Api { enum Api {
list = '/annualScore/departCompTotalScore/list', list = '/annualScore/departCompTotalScore/list',
save='/annualScore/departCompTotalScore/add', // save='/annualScore/departCompTotalScore/add',
collectAllDepart='/annualScore/departCompTotalScore/collectAllDepart',
edit='/annualScore/departCompTotalScore/edit', edit='/annualScore/departCompTotalScore/edit',
deleteOne = '/annualScore/departCompTotalScore/delete', deleteOne = '/annualScore/departCompTotalScore/delete',
deleteBatch = '/annualScore/departCompTotalScore/deleteBatch', deleteBatch = '/annualScore/departCompTotalScore/deleteBatch',
@ -60,7 +61,8 @@ export const batchDelete = (params, handleSuccess) => {
* @param params * @param params
*/ */
export const saveOrUpdate = (params, isUpdate) => { export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save; // let url = isUpdate ? Api.edit : Api.save;
let url = isUpdate ? Api.edit : Api.collectAllDepart;
return defHttp.post({url: url, params}); return defHttp.post({url: url, params});
} }

@ -67,11 +67,11 @@ export const formSchema: FormSchema[] = [
// dictCode: "sys_user,realname,id,username!='admin' order by create_time", // dictCode: "sys_user,realname,id,username!='admin' order by create_time",
}, },
dynamicRules: ({model,schema}) => { // dynamicRules: ({model,schema}) => {
return [ // return [
{ required: true, message: '请输入所属部门!'}, // { required: true, message: '请输入所属部门!'},
]; // ];
}, // },
}, },
{ {
label: '年度', label: '年度',

Loading…
Cancel
Save