From 55b613ccc7e60ab5e5eaed5973ed16c88215e46c Mon Sep 17 00:00:00 2001 From: fhv Date: Tue, 30 Jul 2024 23:30:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8=E7=A7=AF=E5=88=86=E3=80=81?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E8=83=BD=E5=8A=9B=20=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=97=B6=E6=B1=87=E6=80=BB=E6=89=80=E6=9C=89?= =?UTF-8?q?=E9=83=A8=E9=97=A8,=20=E4=B8=8D=E4=B8=BA=E7=A9=BA=E6=97=B6?= =?UTF-8?q?=E6=B1=87=E6=80=BB=E8=AF=A5=E9=83=A8=E9=97=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DepartAbilityEvaluationController.java | 20 +++++++++++++ .../IDepartAbilityEvaluationService.java | 2 ++ .../DepartAbilityEvaluationServiceImpl.java | 28 +++++++++++++++---- .../DepartCompTotalScoreController.java | 20 +++++++++++++ .../service/IDepartCompTotalScoreService.java | 1 + .../impl/DepartCompTotalScoreServiceImpl.java | 23 +++++++++++++++ .../depart/DepartAbilityEvaluation.api.ts | 6 ++-- .../depart/DepartAbilityEvaluation.data.ts | 10 +++---- .../DepartCompTotalScore.api.ts | 6 ++-- .../DepartCompTotalScore.data.ts | 10 +++---- 10 files changed, 106 insertions(+), 20 deletions(-) diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/controller/DepartAbilityEvaluationController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/controller/DepartAbilityEvaluationController.java index 3a92f324..01d32acf 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/controller/DepartAbilityEvaluationController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/controller/DepartAbilityEvaluationController.java @@ -1,5 +1,6 @@ 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.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -68,6 +69,25 @@ public class DepartAbilityEvaluationController extends JeecgController + * @Author: z.h.c + * @Date: 2024/7/30 23:03 + */ + @ApiOperation(value = "院系年度能力评价-汇总所有部门", notes = "院系年度能力评价-汇总所有部门") + @PostMapping(value = "/collectAllDepart") + public Result collectAllDepart(@RequestBody DepartAbilityEvaluation departAbilityEvaluation) { + if (StrUtil.isNotBlank(departAbilityEvaluation.getDepetId())) {//部门不为空时汇总该部门 + departAbilityEvaluationService.collectAbilityEvaluation(departAbilityEvaluation); + } else { + departAbilityEvaluationService.collectAllDepart(departAbilityEvaluation); + } + return Result.OK("添加成功!"); + } + @ApiOperation(value = "院系年度能力评价-重新汇算", notes = "院系年度能力评价-重新汇算") @PostMapping(value = "/reCollectAbilityEvaluation") public Result reCollectAbilityEvaluation(@RequestBody DepartAbilityEvaluation departAbilityEvaluation) { diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/IDepartAbilityEvaluationService.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/IDepartAbilityEvaluationService.java index feafabef..4fe739d8 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/IDepartAbilityEvaluationService.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/abilityEvaluation/service/IDepartAbilityEvaluationService.java @@ -12,4 +12,6 @@ import com.baomidou.mybatisplus.extension.service.IService; public interface IDepartAbilityEvaluationService extends IService { void collectAbilityEvaluation(DepartAbilityEvaluation departAbilityEvaluation); + + void collectAllDepart(DepartAbilityEvaluation departAbilityEvaluation); } 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 f2d20a61..4d62b2bf 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,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.service.IDepartAbilityEvaluationService; 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.stereotype.Service; -import java.util.Date; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -30,6 +28,11 @@ public class DepartAbilityEvaluationServiceImpl extends ServiceImpl saveList = new LinkedList<>(); - depetListMap.keySet().stream().forEach(k -> { + Optional.ofNullable(depetListMap).orElse(new LinkedHashMap<>()).keySet().stream().forEach(k -> { List evaluationList = depetListMap.get(k); DepartAbilityEvaluation bean = new DepartAbilityEvaluation(); bean.setAnnualId(departAbilityEvaluation.getAnnualId()); @@ -64,4 +67,17 @@ public class DepartAbilityEvaluationServiceImpl extends ServiceImpl().eq(DepartAbilityEvaluation::getAnnualId, param.getAnnualId())); + List departList = iSysDepartService.list(new LambdaQueryWrapper().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); + }); + } } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/controller/DepartCompTotalScoreController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/controller/DepartCompTotalScoreController.java index 620bded2..4d2fcc5c 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/controller/DepartCompTotalScoreController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/controller/DepartCompTotalScoreController.java @@ -1,5 +1,6 @@ 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.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -55,6 +56,25 @@ public class DepartCompTotalScoreController extends JeecgController + * @Author: z.h.c + * @Date: 2024/7/30 22:26 + */ + @ApiOperation(value = "院系总积分-汇总所有部门", notes = "院系总积分-汇总所有部门") + @PostMapping(value = "/collectAllDepart") + public Result collectAllDepart(@RequestBody DepartCompTotalScore departCompTotalScore) { + if (StrUtil.isNotBlank(departCompTotalScore.getDepet())) {//部门不为空时汇总该部门 + departCompTotalScoreService.collectScore(departCompTotalScore); + } else { + departCompTotalScoreService.collectAllDepart(departCompTotalScore); + } + return Result.OK("添加成功!"); + } + /** * 分页列表查询 * diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/IDepartCompTotalScoreService.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/IDepartCompTotalScoreService.java index ab1f1273..32302cee 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/IDepartCompTotalScoreService.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/IDepartCompTotalScoreService.java @@ -13,4 +13,5 @@ public interface IDepartCompTotalScoreService extends IService().eq(DepartCompTotalScore::getAnnualId, param.getAnnualId())); + List departList = iSysDepartService.list(new LambdaQueryWrapper().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); + }); + } } diff --git a/jeecgboot-vue3-master/src/views/abilityEvaluation/depart/DepartAbilityEvaluation.api.ts b/jeecgboot-vue3-master/src/views/abilityEvaluation/depart/DepartAbilityEvaluation.api.ts index 217517ae..62855d6e 100644 --- a/jeecgboot-vue3-master/src/views/abilityEvaluation/depart/DepartAbilityEvaluation.api.ts +++ b/jeecgboot-vue3-master/src/views/abilityEvaluation/depart/DepartAbilityEvaluation.api.ts @@ -5,7 +5,8 @@ const { createConfirm } = useMessage(); enum Api { list = '/abilityEvaluation/departAbilityEvaluation/list', - save='/abilityEvaluation/departAbilityEvaluation/add', + // save='/abilityEvaluation/departAbilityEvaluation/add', + collectAllDepart='/abilityEvaluation/departAbilityEvaluation/collectAllDepart', edit='/abilityEvaluation/departAbilityEvaluation/edit', deleteOne = '/abilityEvaluation/departAbilityEvaluation/delete', deleteBatch = '/abilityEvaluation/departAbilityEvaluation/deleteBatch', @@ -60,7 +61,8 @@ export const batchDelete = (params, handleSuccess) => { * @param params */ 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}); } 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 9e10be25..580d8f93 100644 --- a/jeecgboot-vue3-master/src/views/abilityEvaluation/depart/DepartAbilityEvaluation.data.ts +++ b/jeecgboot-vue3-master/src/views/abilityEvaluation/depart/DepartAbilityEvaluation.data.ts @@ -61,11 +61,11 @@ export const formSchema: FormSchema[] = [ componentProps: { dictCode:"sys_depart,depart_name,id,parent_id='1693446350597038081'" }, - dynamicRules: ({model, schema}) => { - return [ - {required: true, message: '请输入所属部门!'}, - ]; - }, + // dynamicRules: ({model, schema}) => { + // return [ + // {required: true, message: '请输入所属部门!'}, + // ]; + // }, }, { label: '年度', diff --git a/jeecgboot-vue3-master/src/views/annualScore/departCompTotalScore/DepartCompTotalScore.api.ts b/jeecgboot-vue3-master/src/views/annualScore/departCompTotalScore/DepartCompTotalScore.api.ts index 8af1e96d..98e6a08c 100644 --- a/jeecgboot-vue3-master/src/views/annualScore/departCompTotalScore/DepartCompTotalScore.api.ts +++ b/jeecgboot-vue3-master/src/views/annualScore/departCompTotalScore/DepartCompTotalScore.api.ts @@ -5,7 +5,8 @@ const { createConfirm } = useMessage(); enum Api { list = '/annualScore/departCompTotalScore/list', - save='/annualScore/departCompTotalScore/add', + // save='/annualScore/departCompTotalScore/add', + collectAllDepart='/annualScore/departCompTotalScore/collectAllDepart', edit='/annualScore/departCompTotalScore/edit', deleteOne = '/annualScore/departCompTotalScore/delete', deleteBatch = '/annualScore/departCompTotalScore/deleteBatch', @@ -60,7 +61,8 @@ export const batchDelete = (params, handleSuccess) => { * @param params */ 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}); } diff --git a/jeecgboot-vue3-master/src/views/annualScore/departCompTotalScore/DepartCompTotalScore.data.ts b/jeecgboot-vue3-master/src/views/annualScore/departCompTotalScore/DepartCompTotalScore.data.ts index eeda545d..f754f2ef 100644 --- a/jeecgboot-vue3-master/src/views/annualScore/departCompTotalScore/DepartCompTotalScore.data.ts +++ b/jeecgboot-vue3-master/src/views/annualScore/departCompTotalScore/DepartCompTotalScore.data.ts @@ -67,11 +67,11 @@ export const formSchema: FormSchema[] = [ // dictCode: "sys_user,realname,id,username!='admin' order by create_time", }, - dynamicRules: ({model,schema}) => { - return [ - { required: true, message: '请输入所属部门!'}, - ]; - }, + // dynamicRules: ({model,schema}) => { + // return [ + // { required: true, message: '请输入所属部门!'}, + // ]; + // }, }, { label: '年度',