docs(teacher): 更新教师KPI填写控制器注释
- 在SysTeacherKpiFillingBonusPointsController中添加省略号注释 - 在SysTeacherKpiFillingGraduationGuidanceController中添加省略号注释 - 为查询详细信息方法补充文档注释 - 为导出就业指导工作列表方法补充文档注释
This commit is contained in:
@@ -159,7 +159,7 @@ public class RtStuDisciplinaryApplicationController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "学生处分申请", businessType = BusinessType.IMPORT)
|
||||
// @PreAuthorize("@ss.hasPermi('routine:disciplinaryApplication:import')")
|
||||
@PreAuthorize("@ss.hasPermi('routine:disciplinaryApplication:import')")
|
||||
@PostMapping("/importData")
|
||||
@ApiOperation("导入学生处分申请")
|
||||
public AjaxResult importData(org.springframework.web.multipart.MultipartFile file, boolean updateSupport) throws Exception {
|
||||
|
||||
@@ -121,6 +121,24 @@ public class RtStuDisciplinaryRelieveController extends BaseController {
|
||||
util.exportExcel(response, list, "学生解除处分申请数据");
|
||||
}
|
||||
|
||||
@PostMapping("/importTemplate")
|
||||
@ApiOperation("下载学生解除处分导入模板")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil<RtStuDisciplinaryRelieve> util = new ExcelUtil<RtStuDisciplinaryRelieve>(RtStuDisciplinaryRelieve.class);
|
||||
util.importTemplateExcel(response, "学生解除处分申请数据导入");
|
||||
}
|
||||
|
||||
@Log(title = "学生解除处分申请", businessType = BusinessType.IMPORT)
|
||||
@PreAuthorize("@ss.hasPermi('routine:relieve:import')")
|
||||
@PostMapping("/importData")
|
||||
@ApiOperation("导入学生解除处分申请")
|
||||
public AjaxResult importData(org.springframework.web.multipart.MultipartFile file, boolean updateSupport) throws Exception {
|
||||
ExcelUtil<RtStuDisciplinaryRelieve> util = new ExcelUtil<RtStuDisciplinaryRelieve>(RtStuDisciplinaryRelieve.class);
|
||||
List<RtStuDisciplinaryRelieve> list = util.importExcel(file.getInputStream());
|
||||
String message = rtStuDisciplinaryRelieveService.importDisciplinaryRelieve(list, updateSupport);
|
||||
return success(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学生解除处分申请详细信息
|
||||
*/
|
||||
|
||||
@@ -95,4 +95,12 @@ public interface IRtStuDisciplinaryRelieveService extends IService<RtStuDiscipli
|
||||
* @return
|
||||
*/
|
||||
List<RtStuDisciplinaryRelieve> selectRtStuDisciplinaryRelieveListByXW(RtStuDisciplinaryRelieve rtStuDisciplinaryRelieve);
|
||||
|
||||
/**
|
||||
* 导入解除处分数据
|
||||
* @param list 解除处分数据列表
|
||||
* @param updateSupport 是否更新已经存在的数据
|
||||
* @return 导入结果信息
|
||||
*/
|
||||
String importDisciplinaryRelieve(List<RtStuDisciplinaryRelieve> list, boolean updateSupport);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.flowable.task.api.Task;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.srs.common.utils.StringUtils;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
@@ -209,7 +209,18 @@ public class RtStuDisciplinaryApplicationServiceImpl extends ServiceImpl<RtStuDi
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
|
||||
for (RtStuDisciplinaryApplication rtStuDisciplinaryApplication : list) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
RtStuDisciplinaryApplication rtStuDisciplinaryApplication = list.get(i);
|
||||
// 跳过 null 元素
|
||||
if (rtStuDisciplinaryApplication == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 跳过必填字段为空的行(学号为空则跳过)
|
||||
if (StringUtils.isEmpty(rtStuDisciplinaryApplication.getStuNo())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
// 验证数据是否存在,或者补充必要信息
|
||||
if (com.srs.common.utils.StringUtils.isNotNull(rtStuDisciplinaryApplication.getStuNo())) {
|
||||
|
||||
@@ -6,31 +6,32 @@ import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.srs.common.core.domain.AjaxResult;
|
||||
import com.srs.common.core.domain.entity.SysUser;
|
||||
import com.srs.common.doman.dto.ProcessResultDto;
|
||||
import com.srs.common.exception.ServiceException;
|
||||
import com.srs.common.utils.DateUtils;
|
||||
import com.srs.common.utils.SecurityUtils;
|
||||
import com.srs.common.utils.StringUtils;
|
||||
import com.srs.common.utils.WeChatUtil;
|
||||
import com.srs.flowable.service.IFlowDefinitionService;
|
||||
import com.srs.routine.domain.RtStuDisciplinaryApplication;
|
||||
import com.srs.routine.domain.RtStuDisciplinaryRelieve;
|
||||
import com.srs.routine.mapper.RtStuDisciplinaryApplicationMapper;
|
||||
import com.srs.routine.mapper.RtStuDisciplinaryRelieveMapper;
|
||||
import com.srs.routine.service.IRtStuDisciplinaryRelieveService;
|
||||
import com.srs.system.mapper.SysUserMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.flowable.engine.IdentityService;
|
||||
import org.flowable.engine.TaskService;
|
||||
import org.flowable.task.api.Task;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.srs.routine.mapper.RtStuDisciplinaryRelieveMapper;
|
||||
import com.srs.routine.domain.RtStuDisciplinaryRelieve;
|
||||
import com.srs.routine.service.IRtStuDisciplinaryRelieveService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 学生解除处分申请Service业务层处理
|
||||
* 学生解除处分申请 Service 业务层处理
|
||||
*
|
||||
* @author LSD
|
||||
* @date 2024-04-29
|
||||
@@ -300,4 +301,66 @@ public class RtStuDisciplinaryRelieveServiceImpl extends ServiceImpl<RtStuDiscip
|
||||
return rtStuDisciplinaryRelieve;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String importDisciplinaryRelieve(List<RtStuDisciplinaryRelieve> list, boolean updateSupport) {
|
||||
if (com.srs.common.utils.StringUtils.isNull(list) || list.size() == 0) {
|
||||
throw new ServiceException("导入数据不能为空!");
|
||||
}
|
||||
int successNum = 0;
|
||||
int failureNum = 0;
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
RtStuDisciplinaryRelieve rtStuDisciplinaryRelieve = list.get(i);
|
||||
// 跳过 null 元素
|
||||
if (rtStuDisciplinaryRelieve == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 跳过必填字段为空的行(学号为空则跳过)
|
||||
if (StringUtils.isEmpty(rtStuDisciplinaryRelieve.getStuNo())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
if (com.srs.common.utils.StringUtils.isNotNull(rtStuDisciplinaryRelieve.getStuNo())) {
|
||||
SysUser sysUser = sysUserMapper.selectUserByUserName(rtStuDisciplinaryRelieve.getStuNo());
|
||||
if (sysUser != null) {
|
||||
rtStuDisciplinaryRelieve.setStuId(sysUser.getUserId());
|
||||
rtStuDisciplinaryRelieve.setStuName(sysUser.getNickName());
|
||||
}
|
||||
}
|
||||
|
||||
rtStuDisciplinaryRelieve.setCreateBy(SecurityUtils.getUsername());
|
||||
rtStuDisciplinaryRelieve.setCreateTime(DateUtils.getNowDate());
|
||||
rtStuDisciplinaryRelieve.setApplicantName(SecurityUtils.getLoginUser().getUser().getNickName());
|
||||
|
||||
if (rtStuDisciplinaryRelieve.getSubmissionStatus() == null) {
|
||||
rtStuDisciplinaryRelieve.setSubmissionStatus(0L);
|
||||
}
|
||||
|
||||
if (rtStuDisciplinaryRelieve.getPenaltyStatus() == null) {
|
||||
rtStuDisciplinaryRelieve.setPenaltyStatus(1L);
|
||||
}
|
||||
|
||||
rtStuDisciplinaryRelieveMapper.insertRtStuDisciplinaryRelieve(rtStuDisciplinaryRelieve);
|
||||
successNum++;
|
||||
successMsg.append("<br/>" + successNum + "、学号 " + rtStuDisciplinaryRelieve.getStuNo() + " 导入成功");
|
||||
} catch (Exception e) {
|
||||
failureNum++;
|
||||
String msg = "<br/>" + failureNum + "、学号 " + rtStuDisciplinaryRelieve.getStuNo() + " 导入失败:";
|
||||
failureMsg.append(msg + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
if (failureNum > 0) {
|
||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
||||
throw new ServiceException(failureMsg.toString());
|
||||
} else {
|
||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||
}
|
||||
return successMsg.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user