Merge remote-tracking branch 'origin/main'

main
王家东 4 months ago
commit fd4166882e
  1. 11
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/impl/DepartCompTotalScoreServiceImpl.java
  2. 9
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java
  3. 127
      jeecgboot-vue3-master/src/views/awardpersion/components/AwardPersionModal.vue

@ -1,6 +1,7 @@
package org.jeecg.modules.demo.annualScore.service.impl; package org.jeecg.modules.demo.annualScore.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.jeecg.modules.demo.annualScore.entity.DepartCompTotalScore; import org.jeecg.modules.demo.annualScore.entity.DepartCompTotalScore;
import org.jeecg.modules.demo.annualScore.entity.PersonalCompScore; import org.jeecg.modules.demo.annualScore.entity.PersonalCompScore;
@ -9,10 +10,10 @@ 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.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -44,10 +45,14 @@ public class DepartCompTotalScoreServiceImpl extends ServiceImpl<DepartCompTotal
); );
double totalScore = 0; double totalScore = 0;
DecimalFormat decimalFormat = new DecimalFormat(totalScore + "");
decimalFormat.setMaximumFractionDigits(2); // 保留两位小数
decimalFormat.setRoundingMode(RoundingMode.HALF_UP); // 设置具体的进位机制
if (!ObjectUtils.isEmpty(personalCompScoreList)) { if (!ObjectUtils.isEmpty(personalCompScoreList)) {
totalScore = personalCompScoreList.stream().mapToDouble(PersonalCompScore::getScore).sum(); totalScore = personalCompScoreList.stream().mapToDouble(PersonalCompScore::getScore).sum();
} }
departCompTotalScore.setScore(totalScore); departCompTotalScore.setScore(new Double(decimalFormat.format(totalScore)));
//id不为空,院系的某一年度已汇总过,重新汇算 //id不为空,院系的某一年度已汇总过,重新汇算
if (StringUtils.isNotEmpty(departCompTotalScore.getId())) { if (StringUtils.isNotEmpty(departCompTotalScore.getId())) {

@ -18,6 +18,7 @@ import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;
import org.jeecg.config.JeecgBaseConfig; import org.jeecg.config.JeecgBaseConfig;
import org.jeecg.modules.demo.annual.service.IAnnualService;
import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint; import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint;
import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService; import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService;
import org.jeecg.modules.demo.annualcomp.entity.AnnualComp; import org.jeecg.modules.demo.annualcomp.entity.AnnualComp;
@ -96,6 +97,8 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
private ISysRoleService sysRoleService; private ISysRoleService sysRoleService;
@Autowired @Autowired
private ISysUserRoleService sysUserRoleService; private ISysUserRoleService sysUserRoleService;
@Autowired
private IAnnualService annualService;
/** /**
* 分页列表查询 * 分页列表查询
@ -536,10 +539,16 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
QueryWrapper<TeamManagement> queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, request.getParameterMap()); QueryWrapper<TeamManagement> queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, request.getParameterMap());
queryWrappertm.eq("enroll_code",list.get(i).getEnrollCode()); queryWrappertm.eq("enroll_code",list.get(i).getEnrollCode());
List<TeamManagement> listtm = teamManagementService.list(queryWrappertm); List<TeamManagement> listtm = teamManagementService.list(queryWrappertm);
if(annualService.getannualthisid(list.get(i).getAnnualid())==null){
return Result.error("文件导入失败:第"+(i+1)+"行年度不存在");
}else{
list.get(i).setAnnualid(annualService.getannualthisid(list.get(i).getAnnualid()));
}
try { try {
for (int l = 0 ; l < listtm.size() ; l++){ for (int l = 0 ; l < listtm.size() ; l++){
SysUser sysUser = sysUserService.getById(listtm.get(l).getUserId()); SysUser sysUser = sysUserService.getById(listtm.get(l).getUserId());
list.get(i).setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).getId()); list.get(i).setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).getId());
if(listaca.get(0).getFirstPrize().equals(list.get(i).getAwardname())){ if(listaca.get(0).getFirstPrize().equals(list.get(i).getAwardname())){
list.get(i).setAwardsort(1); list.get(i).setAwardsort(1);
list.get(i).setAwardid(listaca.get(0).getId()); list.get(i).setAwardid(listaca.get(0).getId());

@ -1,77 +1,82 @@
<template> <template>
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭"> <a-modal :title="title" :width="width" :visible="visible" @ok="handleOk"
<AwardPersionForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></AwardPersionForm> :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<AwardPersionForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false">
</AwardPersionForm>
</a-modal> </a-modal>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue'; import { ref, nextTick, defineExpose, watch } from 'vue';
import AwardPersionForm from './AwardPersionForm.vue' import AwardPersionForm from './AwardPersionForm.vue'
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/** const title = ref<string>('');
* 新增 const width = ref<number>(800);
*/ const visible = ref<boolean>(false);
function add() { const disableSubmit = ref<boolean>(false);
title.value = '新增'; const registerForm = ref();
visible.value = true; const emit = defineEmits(['register', 'success']);
nextTick(() => { watch(() => visible.value, newVal => {
registerForm.value.add(); if (!newVal) registerForm.value.setIsT(false);
registerForm.value.setIsT(false); })
});
}
/** /**
* 编辑 * 新增
* @param record */
*/ function add() {
function edit(record) { title.value = '新增';
title.value = disableSubmit.value ? '详情' : '编辑'; visible.value = true;
visible.value = true; nextTick(() => {
nextTick(() => { registerForm.value.add();
registerForm.value.edit(record); });
registerForm.value.setIsT(true); }
});
} /**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
registerForm.value.setIsT(true);
});
}
/** /**
* 确定按钮点击事件 * 确定按钮点击事件
*/ */
function handleOk() { function handleOk() {
registerForm.value.submitForm(); registerForm.value.submitForm();
} }
/** /**
* form保存回调事件 * form保存回调事件
*/ */
function submitCallback() { function submitCallback() {
handleCancel(); handleCancel();
emit('success'); emit('success');
} }
/** /**
* 取消按钮回调事件 * 取消按钮回调事件
*/ */
function handleCancel() { function handleCancel() {
visible.value = false; visible.value = false;
} }
defineExpose({ defineExpose({
add, add,
edit, edit,
disableSubmit, disableSubmit,
}); });
</script> </script>
<style> <style>
/**隐藏样式-modal确定按钮 */ /**隐藏样式-modal确定按钮 */
.jee-hidden { .jee-hidden {
display: none !important; display: none !important;
} }
</style> </style>

Loading…
Cancel
Save