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. 13
      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,19 +1,25 @@
<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 title = ref<string>('');
const width = ref<number>(800); const width = ref<number>(800);
const visible = ref<boolean>(false); const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false); const disableSubmit = ref<boolean>(false);
const registerForm = ref(); const registerForm = ref();
const emit = defineEmits(['register', 'success']); const emit = defineEmits(['register', 'success']);
watch(() => visible.value, newVal => {
if (!newVal) registerForm.value.setIsT(false);
})
/** /**
* 新增 * 新增
@ -23,7 +29,6 @@
visible.value = true; visible.value = true;
nextTick(() => { nextTick(() => {
registerForm.value.add(); registerForm.value.add();
registerForm.value.setIsT(false);
}); });
} }

Loading…
Cancel
Save