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. 131
      jeecgboot-vue3-master/src/views/awardpersion/components/AwardPersionModal.vue

@ -1,6 +1,7 @@
package org.jeecg.modules.demo.annualScore.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.modules.demo.annualScore.entity.DepartCompTotalScore;
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.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.util.ObjectUtils;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.Date;
import java.util.List;
@ -44,10 +45,14 @@ public class DepartCompTotalScoreServiceImpl extends ServiceImpl<DepartCompTotal
);
double totalScore = 0;
DecimalFormat decimalFormat = new DecimalFormat(totalScore + "");
decimalFormat.setMaximumFractionDigits(2); // 保留两位小数
decimalFormat.setRoundingMode(RoundingMode.HALF_UP); // 设置具体的进位机制
if (!ObjectUtils.isEmpty(personalCompScoreList)) {
totalScore = personalCompScoreList.stream().mapToDouble(PersonalCompScore::getScore).sum();
}
departCompTotalScore.setScore(totalScore);
departCompTotalScore.setScore(new Double(decimalFormat.format(totalScore)));
//id不为空,院系的某一年度已汇总过,重新汇算
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.util.oConvertUtils;
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.service.IAnnualCompPointService;
import org.jeecg.modules.demo.annualcomp.entity.AnnualComp;
@ -96,6 +97,8 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
private ISysRoleService sysRoleService;
@Autowired
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());
queryWrappertm.eq("enroll_code",list.get(i).getEnrollCode());
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 {
for (int l = 0 ; l < listtm.size() ; l++){
SysUser sysUser = sysUserService.getById(listtm.get(l).getUserId());
list.get(i).setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).getId());
if(listaca.get(0).getFirstPrize().equals(list.get(i).getAwardname())){
list.get(i).setAwardsort(1);
list.get(i).setAwardid(listaca.get(0).getId());

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

Loading…
Cancel
Save