添加试卷导出功能并优化课程查询逻辑
parent
08f1def339
commit
15798a0704
|
|
@ -9,16 +9,14 @@ import com.jjb.saas.framework.auth.model.SSOUser;
|
|||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.edu.api.study.ClassExamPaperServiceI;
|
||||
import com.zcloud.edu.dto.clientobject.study.ClassExamPaperCO;
|
||||
import com.zcloud.edu.dto.study.ClassExamPaperAddCmd;
|
||||
import com.zcloud.edu.dto.study.ClassExamPaperAutoAddCmd;
|
||||
import com.zcloud.edu.dto.study.ClassExamPaperPageQry;
|
||||
import com.zcloud.edu.dto.study.ClassExamPaperUpdateCmd;
|
||||
import com.zcloud.edu.dto.study.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
|
|
@ -39,7 +37,19 @@ public class ClassExamPaperController {
|
|||
public SingleResponse<ClassExamPaperCO> add(@Validated @RequestBody ClassExamPaperAddCmd cmd) {
|
||||
return classExamPaperService.add(cmd);
|
||||
}
|
||||
// @ApiOperation("导出试卷")
|
||||
// @PostMapping("/exportClassExamPaper")
|
||||
// public void exportClassExamPaper(@Validated @RequestBody ClassExamPaperExportCmd cmd, HttpServletResponse httpServletResponse) {
|
||||
// classExamPaperService.exportClassExamPaper(cmd,httpServletResponse);
|
||||
// }
|
||||
|
||||
@ApiOperation("导出试卷")
|
||||
@GetMapping("/exportClassExamPaper")
|
||||
public void exportClassExamPaper(@RequestParam("classId") String classId,
|
||||
@RequestParam("answerFlag") Integer answerFlag,
|
||||
HttpServletResponse httpServletResponse) {
|
||||
classExamPaperService.exportClassExamPaper(classId, answerFlag, httpServletResponse);
|
||||
}
|
||||
@ApiOperation("自动生成试卷")
|
||||
@PostMapping("/autoSave")
|
||||
public SingleResponse<ClassExamPaperCO> autoSave(@Validated @RequestBody ClassExamPaperAutoAddCmd cmd) {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import com.jjb.saas.framework.auth.utils.AuthContext;
|
|||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
|
|
|||
|
|
@ -74,17 +74,22 @@ public class ClassCurriculumQueryExe {
|
|||
public MultiResponse<ClassCurriculumCO> executeListAll(ClassCurriculumQry qry) {
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||
List<ClassCurriculumDO> curList = classCurriculumRepository.listAll(params);
|
||||
List<String> classCurriculumIds = curList.stream().map(ClassCurriculumDO::getClassCurriculumId).collect(Collectors.toList());
|
||||
List<ClassCurriculumChapterDO> chapterList = classCurriculumChapterRepository.listByClassCurriculumIds(classCurriculumIds);
|
||||
List<ClassCurriculumChapterCO> chapterCoList = classCurriculumChapterCoConvertor.converDOsToCOs(chapterList);
|
||||
List<ClassCurriculumChapterCO> resultList = Tools.buildEntityTree(chapterCoList, "classCurriculumChapterId", "parentId", "childCurriculumChapterCOList", "0");
|
||||
if (curList != null && curList.size() > 0){
|
||||
List<String> classCurriculumIds = curList.stream().map(ClassCurriculumDO::getClassCurriculumId).collect(Collectors.toList());
|
||||
List<ClassCurriculumChapterDO> chapterList = classCurriculumChapterRepository.listByClassCurriculumIds(classCurriculumIds);
|
||||
List<ClassCurriculumChapterCO> chapterCoList = classCurriculumChapterCoConvertor.converDOsToCOs(chapterList);
|
||||
List<ClassCurriculumChapterCO> resultList = Tools.buildEntityTree(chapterCoList, "classCurriculumChapterId", "parentId", "childCurriculumChapterCOList", "0");
|
||||
|
||||
Map<String, List<ClassCurriculumChapterCO>> chapterMap = resultList.stream().collect(Collectors.groupingBy(ClassCurriculumChapterCO::getClassCurriculumId));
|
||||
List<ClassCurriculumCO> curriculumList = classCurriculumCoConvertor.converDOsToCOs(curList);
|
||||
curriculumList.stream().forEach(bean -> {
|
||||
bean.setCurriculumChapterCOList(chapterMap.get(bean.getClassCurriculumId()));
|
||||
});
|
||||
return MultiResponse.of(curriculumList);
|
||||
} else {
|
||||
return MultiResponse.buildFailure("班级内没有添加课程,请先添加课程");
|
||||
}
|
||||
|
||||
Map<String, List<ClassCurriculumChapterCO>> chapterMap = resultList.stream().collect(Collectors.groupingBy(ClassCurriculumChapterCO::getClassCurriculumId));
|
||||
List<ClassCurriculumCO> curriculumList = classCurriculumCoConvertor.converDOsToCOs(curList);
|
||||
curriculumList.stream().forEach(bean -> {
|
||||
bean.setCurriculumChapterCOList(chapterMap.get(bean.getClassCurriculumId()));
|
||||
});
|
||||
return MultiResponse.of(curriculumList);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,24 +1,37 @@
|
|||
package com.zcloud.edu.command.query.study;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.edu.command.convertor.study.ClassExamPaperCoConvertor;
|
||||
import com.zcloud.edu.dto.clientobject.resource.QuestionCO;
|
||||
import com.zcloud.edu.dto.clientobject.study.ClassExamPaperCO;
|
||||
import com.zcloud.edu.dto.data.archives.ClassArchivesDTO;
|
||||
import com.zcloud.edu.dto.study.ClassExamPaperExportCmd;
|
||||
import com.zcloud.edu.dto.study.ClassExamPaperPageQry;
|
||||
import com.zcloud.edu.persistence.dataobject.QuestionDO;
|
||||
import com.zcloud.edu.persistence.dataobject.study.ClassDO;
|
||||
import com.zcloud.edu.persistence.dataobject.study.ClassExamPaperDO;
|
||||
import com.zcloud.edu.persistence.repository.resource.QuestionRepository;
|
||||
import com.zcloud.edu.persistence.repository.study.ClassExamPaperRepository;
|
||||
import com.zcloud.edu.persistence.repository.study.ClassRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import com.zcloud.gbscommon.utils.WordToPdfUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.beanutils.PropertyUtils;
|
||||
import org.apache.commons.io.output.ByteArrayOutputStream;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -33,6 +46,7 @@ public class ClassExamPaperQueryExe {
|
|||
private final ClassExamPaperRepository classExamPaperRepository;
|
||||
private final ClassExamPaperCoConvertor classExamPaperCoConvertor;
|
||||
private final QuestionRepository questionRepository;
|
||||
private final ClassRepository classRepository;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
|
|
@ -72,5 +86,88 @@ public class ClassExamPaperQueryExe {
|
|||
classExamPaperCO.setQuestionList(questionCOList);
|
||||
return SingleResponse.of(classExamPaperCO);
|
||||
}
|
||||
|
||||
public void executeExportClassExamPaper(String classId, Integer answerFlag, HttpServletResponse response){
|
||||
ClassExamPaperCO classExamPaperCO = new ClassExamPaperCO();
|
||||
ClassExamPaperDO classExamPaperDO = classExamPaperRepository.findByClassId(classId);
|
||||
if(classExamPaperDO != null && classExamPaperDO.getExamPaperId() != null){
|
||||
ClassDO classDO = classRepository.getByClassId(classId);
|
||||
|
||||
List<QuestionDO> questionDOList = questionRepository.getInfoByExamPaperId(classExamPaperDO.getExamPaperId());
|
||||
List<QuestionCO> questionCOList = BeanUtil.copyToList(questionDOList, QuestionCO.class);
|
||||
|
||||
BeanUtils.copyProperties(classExamPaperDO, classExamPaperCO);
|
||||
classExamPaperCO.setQuestionList(questionCOList);
|
||||
try {
|
||||
byte[] word = execteClassPaper(classExamPaperCO, classDO.getName(), answerFlag);
|
||||
byte[] pdf = WordToPdfUtil.convertWordBytesToPdfBytes(word);
|
||||
String fileName = classExamPaperCO.getExamName()+".pdf";
|
||||
response.setContentType("application/pdf");
|
||||
response.setHeader("Content-Disposition", "attachment; filename*=UTF-8''" + URLEncoder.encode(fileName, "UTF-8").replace("+", "%20"));
|
||||
response.setContentLength(pdf.length);
|
||||
try (OutputStream out = response.getOutputStream()) {
|
||||
out.write(pdf);
|
||||
out.flush();
|
||||
}
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException("导出失败");
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException("班级未添加试卷,请先添加试卷");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public byte[] execteClassPaper(ClassExamPaperCO params, String className, Integer answerFlag){
|
||||
try {
|
||||
Map<String, Object> workItem = PropertyUtils.describe( params);
|
||||
ArrayList<Object> workList = CollUtil.newArrayList();
|
||||
AtomicInteger atomicIndex = new AtomicInteger(1);
|
||||
params.getQuestionList().forEach(item -> {
|
||||
try {
|
||||
Map<String, Object> itemMap = PropertyUtils.describe(item);
|
||||
int index = atomicIndex.getAndIncrement();
|
||||
itemMap.put("index", index);
|
||||
String optionsText = null;
|
||||
if(item.getQuestionType() == 1){
|
||||
itemMap.put("questionTypeName", "单选题");
|
||||
optionsText = "A:" + item.getOptionA() + "\n" +
|
||||
"B:" + item.getOptionB() + "\n" +
|
||||
"C:" + item.getOptionC() + "\n" +
|
||||
"D:" + item.getOptionD();
|
||||
} else if(item.getQuestionType() == 2){
|
||||
itemMap.put("questionTypeName", "多选题");
|
||||
optionsText = "A:" + item.getOptionA() + "\n" +
|
||||
"B:" + item.getOptionB() + "\n" +
|
||||
"C:" + item.getOptionC() + "\n" +
|
||||
"D:" + item.getOptionD();
|
||||
}else if(item.getQuestionType() == 3){
|
||||
itemMap.put("questionTypeName", "判断题");
|
||||
optionsText = "A:" + item.getOptionA() + " B:" + item.getOptionB();
|
||||
}
|
||||
itemMap.put("optionsText", optionsText);
|
||||
workList.add(itemMap);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
});
|
||||
workItem.put("question_list", workList);
|
||||
workItem.put("className", className);
|
||||
|
||||
String templatePath = null;
|
||||
if (answerFlag == 1){
|
||||
templatePath = "templates/template/class_paper_answer.docx";
|
||||
} else if (answerFlag == 0){
|
||||
templatePath = "templates/template/class_paper_no_answer.docx";
|
||||
}
|
||||
ByteArrayOutputStream outputStream = Tools.renderTemplate(templatePath, workItem);
|
||||
return outputStream.toByteArray();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -107,11 +107,9 @@ public class StudentQueryExe {
|
|||
List<ClassCurriculumE> classCurList = BeanUtil.copyToList(curEList, ClassCurriculumE.class);
|
||||
|
||||
PersonArchivesE personArchivesE = new PersonArchivesE();
|
||||
personArchivesE.init(studentE, classE, classCurList);
|
||||
|
||||
personArchivesE.init(studentE, classE, classCurList, studentUrl.getUserAvatarUrl());
|
||||
PersonArchivesDTO personArchivesDTO = new PersonArchivesDTO();
|
||||
BeanUtils.copyProperties(personArchivesE, personArchivesDTO);
|
||||
|
||||
return SingleResponse.of(personArchivesDTO);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -84,11 +84,17 @@ public class StudentSignQueryExe {
|
|||
params.put("studentId", studentDO.getStudentId());
|
||||
params.put("type", qry.getType());
|
||||
if (qry.getType() == 1){
|
||||
if (studentDO.getSignFlag() == 1){
|
||||
throw new BizException("您已签到");
|
||||
}
|
||||
List<StudentSignDO> list = studentSignRepository.listAllByStudentId(params);
|
||||
if (list != null && list.size() > 0){
|
||||
throw new BizException("您已签到");
|
||||
}
|
||||
} else if (qry.getType() == 2){
|
||||
if (studentDO.getSignFlag() == 0){
|
||||
throw new BizException("您还未进行签到,请先签到之后再进行考试。");
|
||||
}
|
||||
List<StudentExamRecordDO> list = studentExamRecordRepository.listAllByStudentId(studentDO.getStudentId());
|
||||
if (list != null && list.size() == classDO.getNumberofexams()){
|
||||
throw new BizException("您已经没有考试次数");
|
||||
|
|
|
|||
|
|
@ -1,19 +1,25 @@
|
|||
package com.zcloud.edu.command.query.training;
|
||||
|
||||
import com.zcloud.edu.command.convertor.training.TrainingApplyProcessCoConvertor;
|
||||
import com.zcloud.edu.command.convertor.training.TrainingApplyRecordCoConvertor;
|
||||
import com.zcloud.edu.command.convertor.training.TrainingApplyUserCoConvertor;
|
||||
import com.zcloud.edu.domain.model.training.ApproveDetailE;
|
||||
import com.zcloud.edu.domain.model.training.TrainingApplyRecordE;
|
||||
import com.zcloud.edu.domain.model.training.TrainingApplyUserE;
|
||||
import com.zcloud.edu.dto.clientobject.training.TrainingApplyProcessCO;
|
||||
import com.zcloud.edu.dto.clientobject.training.TrainingApplyUserCO;
|
||||
import com.zcloud.edu.dto.training.TrainingApplyRecordPageQry;
|
||||
import com.zcloud.edu.dto.clientobject.training.TrainingApplyRecordCO;
|
||||
import com.zcloud.edu.persistence.dataobject.TrainingApplyProcessDO;
|
||||
import com.zcloud.edu.persistence.dataobject.TrainingApplyRecordDO;
|
||||
import com.zcloud.edu.persistence.dataobject.TrainingApplyUserDO;
|
||||
import com.zcloud.edu.persistence.repository.training.TrainingApplyProcessRepository;
|
||||
import com.zcloud.edu.persistence.repository.training.TrainingApplyRecordRepository;
|
||||
import com.zcloud.edu.persistence.repository.training.TrainingApplyUserRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -31,6 +37,7 @@ import java.util.Map;
|
|||
public class TrainingApplyRecordQueryExe {
|
||||
private final TrainingApplyRecordRepository trainingApplyRecordRepository;
|
||||
private final TrainingApplyRecordCoConvertor trainingApplyRecordCoConvertor;
|
||||
private final TrainingApplyProcessCoConvertor trainingApplyProcessCoConvertor;
|
||||
|
||||
private final TrainingApplyUserRepository trainingApplyUserRepository;
|
||||
private final TrainingApplyUserCoConvertor trainingApplyUserCoConvertor;
|
||||
|
|
@ -64,19 +71,22 @@ public class TrainingApplyRecordQueryExe {
|
|||
* 培训申请记录详情(包含申请用户信息)
|
||||
*/
|
||||
public TrainingApplyRecordCO getInfoById(Long id) {
|
||||
com.zcloud.edu.domain.model.training.TrainingApplyRecordDetailE trainingApplyRecordDO = trainingApplyRecordRepository.getDetailById(id);
|
||||
TrainingApplyRecordDO trainingApplyRecordDO = trainingApplyRecordRepository.getDetailById(id);
|
||||
if (trainingApplyRecordDO == null) return null;
|
||||
TrainingApplyRecordE trainingApplyRecordE = trainingApplyRecordCoConvertor.converDetailDOToE(trainingApplyRecordDO);
|
||||
// TrainingApplyRecordE trainingApplyRecordE = trainingApplyRecordCoConvertor.converDetailDOToE(trainingApplyRecordDO);
|
||||
|
||||
// 获取申请用户信息
|
||||
List<TrainingApplyUserE> applyUser = trainingApplyUserCoConvertor.converDOsToEs(trainingApplyUserRepository.getByRecordId(trainingApplyRecordE.getTrainingApplyRecordId()));
|
||||
trainingApplyRecordE.addApplyUsers(applyUser);
|
||||
List<TrainingApplyUserDO> applyUserDOS = trainingApplyUserRepository.getByRecordId(trainingApplyRecordDO.getTrainingApplyRecordId());
|
||||
List<TrainingApplyUserCO> applyUser = trainingApplyUserCoConvertor.converDOsToCOs(applyUserDOS);
|
||||
|
||||
// 获取审批委托信息
|
||||
List<ApproveDetailE> approveDetails = trainingApplyProcessRepository.getApproveDetailList(trainingApplyRecordE.getTrainingApplyRecordId());
|
||||
trainingApplyRecordE.buildApproveDetails(approveDetails);
|
||||
|
||||
return trainingApplyRecordCoConvertor.converEToCO(trainingApplyRecordE);
|
||||
List<TrainingApplyProcessDO> trainingApplyProcessDOs = trainingApplyProcessRepository.getApproveDetailList(trainingApplyRecordDO.getTrainingApplyRecordId());
|
||||
List<TrainingApplyProcessCO> trainingApplyProcessCOList = trainingApplyProcessCoConvertor.converDOsToCOs(trainingApplyProcessDOs);
|
||||
TrainingApplyRecordCO trainingApplyRecordCO = new TrainingApplyRecordCO();
|
||||
BeanUtils.copyProperties(trainingApplyRecordDO, trainingApplyRecordCO);
|
||||
trainingApplyRecordCO.setApplyUsers(applyUser);
|
||||
trainingApplyRecordCO.setApproveDetails(trainingApplyProcessCOList);
|
||||
return trainingApplyRecordCO;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,13 +8,12 @@ import com.zcloud.edu.command.study.ClassExamPaperAddExe;
|
|||
import com.zcloud.edu.command.study.ClassExamPaperRemoveExe;
|
||||
import com.zcloud.edu.command.study.ClassExamPaperUpdateExe;
|
||||
import com.zcloud.edu.dto.clientobject.study.ClassExamPaperCO;
|
||||
import com.zcloud.edu.dto.study.ClassExamPaperAddCmd;
|
||||
import com.zcloud.edu.dto.study.ClassExamPaperAutoAddCmd;
|
||||
import com.zcloud.edu.dto.study.ClassExamPaperPageQry;
|
||||
import com.zcloud.edu.dto.study.ClassExamPaperUpdateCmd;
|
||||
import com.zcloud.edu.dto.study.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* web-app
|
||||
*
|
||||
|
|
@ -42,6 +41,11 @@ public class ClassExamPaperServiceImpl implements ClassExamPaperServiceI {
|
|||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportClassExamPaper(String classId, Integer answerFlag, HttpServletResponse httpServletResponse) {
|
||||
classExamPaperQueryExe.executeExportClassExamPaper( classId, answerFlag, httpServletResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse<ClassExamPaperCO> autoSave(ClassExamPaperAutoAddCmd cmd) {
|
||||
classExamPaperAddExe.executeAutoSave(cmd);
|
||||
|
|
|
|||
|
|
@ -3,10 +3,9 @@ package com.zcloud.edu.api.study;
|
|||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.edu.dto.clientobject.study.ClassExamPaperCO;
|
||||
import com.zcloud.edu.dto.study.ClassExamPaperAddCmd;
|
||||
import com.zcloud.edu.dto.study.ClassExamPaperAutoAddCmd;
|
||||
import com.zcloud.edu.dto.study.ClassExamPaperPageQry;
|
||||
import com.zcloud.edu.dto.study.ClassExamPaperUpdateCmd;
|
||||
import com.zcloud.edu.dto.study.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
|
|
@ -19,6 +18,8 @@ public interface ClassExamPaperServiceI {
|
|||
|
||||
SingleResponse<ClassExamPaperCO> add(ClassExamPaperAddCmd cmd);
|
||||
|
||||
void exportClassExamPaper(String classId, Integer answerFlag, HttpServletResponse httpServletResponse);
|
||||
|
||||
SingleResponse<ClassExamPaperCO> autoSave(ClassExamPaperAutoAddCmd cmd);
|
||||
|
||||
void edit(ClassExamPaperUpdateCmd cmd);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.zcloud.edu.dto.clientobject.study;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.zcloud.edu.dto.clientobject.resource.QuestionCO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -46,6 +47,10 @@ public class ClassExamPaperCO extends ClientObject {
|
|||
private Integer examTime;
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private String corpName;
|
||||
|
||||
@ApiModelProperty(value = "上架状态")
|
||||
@TableField(exist = false)
|
||||
private Integer sellFlag;
|
||||
@ApiModelProperty(value = "习题列表")
|
||||
private List<QuestionCO> questionList;
|
||||
//删除标识true false
|
||||
|
|
|
|||
|
|
@ -94,11 +94,11 @@ public class StudentSignCO extends ClientObject {
|
|||
private Integer version;
|
||||
//创建时间
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
//修改时间
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
//创建人id
|
||||
@ApiModelProperty(value = "创建人id")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.zcloud.edu.dto.clientobject.training;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -41,6 +42,23 @@ public class TrainingApplyProcessCO extends ClientObject {
|
|||
//用户id
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
|
||||
//审批企业名称
|
||||
@ApiModelProperty(value = "审批企业名称")
|
||||
@TableField(exist = false)
|
||||
private String approveCorpName;
|
||||
//审批部门名称
|
||||
@ApiModelProperty(value = "审批部门名称")
|
||||
@TableField(exist = false)
|
||||
private String approveDeptName;
|
||||
//审批用户名称
|
||||
@ApiModelProperty(value = "审批用户名称")
|
||||
@TableField(exist = false)
|
||||
private String approveUserName;
|
||||
//(value = "审批类型(1:发起,2:审批,3:委托)")
|
||||
@ApiModelProperty(value = "用户id")
|
||||
@TableField(exist = false)
|
||||
private Long approveType;
|
||||
//乐观锁
|
||||
@ApiModelProperty(value = "乐观锁")
|
||||
private Integer version;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.zcloud.edu.dto.clientobject.training;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.zcloud.edu.domain.model.training.ApproveDetailE;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -102,11 +103,16 @@ public class TrainingApplyRecordCO extends ClientObject {
|
|||
@ApiModelProperty(value = " 申请人名称")
|
||||
private String applyUserName;
|
||||
|
||||
|
||||
// 委托流程id
|
||||
@ApiModelProperty(value = "委托流程id,空则没有委托,非空则有委托")
|
||||
private String entrustProcessId;
|
||||
|
||||
@ApiModelProperty(value = "申请人列表")
|
||||
private List<TrainingApplyUserCO> applyUsers;
|
||||
|
||||
@ApiModelProperty(value = "审批委托信息")
|
||||
private List<ApproveDetailE> approveDetails;
|
||||
private List<TrainingApplyProcessCO> approveDetails;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ public class ClassPageQry extends PageQuery {
|
|||
private String isMyCorp;
|
||||
private Long eqCorpinfoId;
|
||||
private String phone;
|
||||
private String signFlag;
|
||||
private String examination;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,5 +34,7 @@ public class TrainingApplyRecordPageQry extends PageQuery {
|
|||
|
||||
@ApiModelProperty(value = "申请企业ID", name = "applyCorpinfoId", required = false)
|
||||
private Long eqApplyCorpinfoId;
|
||||
|
||||
private String menuPath;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,17 @@ import java.util.stream.Collectors;
|
|||
@Getter
|
||||
public enum MenuEnum {
|
||||
//股份端
|
||||
GFDPXSHGL("/edu/container/supervision/trainingAuditManage/trainingAuditManage/list","gfd-pxshgl"),
|
||||
|
||||
|
||||
GFDPXSHJL("/edu/container/supervision/trainingAuditManage/trainingAuditRecord/list","gfd-pxshjl"),
|
||||
GFDPXLXGL("/edu/container/supervision/trainingType/list","gfd-pxlxgl"),
|
||||
GFDPXBJGL("/edu/container/supervision/trainingClassManage/list","gfd-pxbjgl"),
|
||||
GFDYRYD("/edu/container/supervision/archivesManage/onePersonOneFile/list","gfd-yryd"),
|
||||
GFDYQYD("/edu/container/supervision/archivesManage/oneIssueOneFile/list","gfd-yqyd"),
|
||||
GFDDAXZ("/edu/container/supervision/archivesManage/fileDownload/list","gfd-daxz"),
|
||||
GFDPXJLGL("/edu/container/supervision/trainingRecord/list","gfd-pxjlgl"),
|
||||
|
||||
//教师管理
|
||||
GFDJSGL("/edu/container/supervision/resourceManage/teacherManage/list", "gfd-jsgl"),
|
||||
//课件管理
|
||||
|
|
@ -24,12 +35,31 @@ public enum MenuEnum {
|
|||
|
||||
|
||||
//企业端
|
||||
|
||||
QYDPXSHGL("/edu/container/branchCompany/trainingAuditManage/trainingAuditManage/list","qyd-pxshgl"),
|
||||
QYDPXSHJL("/edu/container/branchCompany/trainingAuditManage/trainingAuditRecord/list","qyd-pxshjl"),
|
||||
QYDPXBJGL("/edu/container/branchCompany/trainingClassManage/list","qyd-pxbjgl"),
|
||||
QYDYRYD("/edu/container/branchCompany/archivesManage/onePersonOneFile/list","qyd-yryd"),
|
||||
QYDYQYD("/edu/container/branchCompany/archivesManage/oneIssueOneFile/list","qyd-yqyd"),
|
||||
QYDDAXZ("/edu/container/branchCompany/archivesManage/fileDownload/list","qyd-daxz"),
|
||||
QYDPXJLGL("/edu/container/branchCompany/trainingRecordManage/list","qyd-pxjlgl"),
|
||||
//课件管理
|
||||
QYDKJGL("/edu/container/branchCompany/resourceManage/courseware/list", "qyd-kjgl"),
|
||||
//课程管理
|
||||
QYDKCGL("/edu/container/branchCompany/resourceManage/courseManage/list", "qyd-kcgl"),
|
||||
//试卷管理
|
||||
QYDSJGL("/edu/container/branchCompany/resourceManage/testPaperManage/list", "qyd-sjgl"),
|
||||
// 相关方
|
||||
|
||||
|
||||
|
||||
XGFDPXSQGL("/edu/container/stakeholder/applyManege/applyManege","xgfd-pxsqgl"),
|
||||
XGFDPXSQJL("/edu/container/stakeholder/applyManege/applyRecord/list","xgfd-pxsqjl"),
|
||||
XGFDYRYD("/edu/container/Stakeholder/ArchivesManage/OnePersonOneFile/list","xgfd-yryd"),
|
||||
|
||||
XGFDYQYD("/edu/container/stakeholder/archivesManage/oneIssueOneFile/list","xgfd-yqyd"),
|
||||
XGFDDAXZ("/edu/container/stakeholder/archivesManage/fileDownload/list","xgfd-daxz"),
|
||||
XGFDPXJLGL("/edu/container/stakeholder/trainingRecord/list","xgfd-pxjlgl"),
|
||||
|
||||
;
|
||||
;
|
||||
|
|
|
|||
|
|
@ -150,8 +150,10 @@ public class PersonArchivesE extends BaseE {
|
|||
@ApiModelProperty(value = "学员状态翻译")
|
||||
private String stateName;
|
||||
|
||||
public void init(StudentE studentE, ClassE classE, List<ClassCurriculumE> classCurList) {
|
||||
public void init(StudentE studentE, ClassE classE, List<ClassCurriculumE> classCurList, String userAvatarUrl) {
|
||||
|
||||
BeanUtils.copyProperties(studentE, this);
|
||||
setUserAvatarUrl(userAvatarUrl);
|
||||
setCorpName(classE.getCorpName());
|
||||
setStuId(studentE.getId());
|
||||
setClassName(classE.getName());
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ public class ClassCurriculumChapterE extends BaseE {
|
|||
private List<ClassCurriculumChapterE> curriculumChapterAddCmdList;
|
||||
|
||||
|
||||
private String curriculumChapterId;
|
||||
//课程id(批量新增使用)
|
||||
private String curriculumId;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import java.util.ArrayList;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* web-domain
|
||||
|
|
@ -62,6 +63,7 @@ public class ClassCurriculumE extends BaseE {
|
|||
//环境
|
||||
private String env;
|
||||
|
||||
|
||||
public List<ClassCurriculumChapterE> initCurList(List<ClassCurriculumE> curList){
|
||||
List<ClassCurriculumChapterE> classCurriculumChapterEList = new ArrayList<ClassCurriculumChapterE>();
|
||||
for (ClassCurriculumE cur : curList){
|
||||
|
|
@ -94,11 +96,14 @@ public class ClassCurriculumE extends BaseE {
|
|||
cur.setClassId(classId);
|
||||
map.put(cur.getCurriculumId(), cur.getClassCurriculumId());
|
||||
}
|
||||
Map<String, String> idMap = chapterList.stream().collect(Collectors.toMap(ClassCurriculumChapterE::getCurriculumChapterId, chapter -> Tools.get32UUID()));
|
||||
|
||||
chapterList.stream().forEach(chapter -> {
|
||||
chapter.setId(null);
|
||||
chapter.setClassCurriculumId(map.get(chapter.getCurriculumId()));
|
||||
chapter.setClassId(classId);
|
||||
chapter.setClassCurriculumChapterId(Tools.get32UUID());
|
||||
chapter.setClassCurriculumChapterId(idMap.get(chapter.getCurriculumChapterId()));
|
||||
chapter.setParentId(chapter.getParentId().equals("0")? "0" : idMap.get(chapter.getParentId()));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ public class TrainingApplyRecordE extends BaseE {
|
|||
return;
|
||||
}
|
||||
applyUsers.forEach(user -> {
|
||||
if (user != null && user.getApplyStatus().equals(ApplyStatusEnum.APPROVED.getCode())) {
|
||||
if (user != null) {
|
||||
TrainingUserE trainingUser = new TrainingUserE();
|
||||
trainingUser.setTrainingUserId(IdUtil.simpleUUID());
|
||||
trainingUser.setPhone(user.getPhone());
|
||||
|
|
@ -176,4 +176,4 @@ public class TrainingApplyRecordE extends BaseE {
|
|||
this.approveDetails = approveDetails;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class TrainingUserGatewayImpl implements TrainingUserGateway {
|
|||
}
|
||||
|
||||
List<TrainingUserDO> existingUsers = trainingUserRepository.lambdaQuery()
|
||||
.select(TrainingUserDO::getPhone, TrainingUserDO::getStartTime, TrainingUserDO::getEndTime)
|
||||
.select(TrainingUserDO::getPhone, TrainingUserDO::getStartTime, TrainingUserDO::getEndTime, TrainingUserDO::getApplyStatus)
|
||||
.in(TrainingUserDO::getPhone, phones)
|
||||
.list();
|
||||
Map<String, TrainingUserDO> existingUserMap = existingUsers.stream()
|
||||
|
|
@ -57,9 +57,11 @@ public class TrainingUserGatewayImpl implements TrainingUserGateway {
|
|||
.filter(existingPhones::contains)
|
||||
.filter(phone -> {
|
||||
TrainingUserDO user = existingUserMap.get(phone);
|
||||
return user != null
|
||||
&& user.getEndTime() != null
|
||||
&& submitTime.isAfter(user.getEndTime());
|
||||
return user != null &&
|
||||
(
|
||||
(user.getEndTime() != null && submitTime.isAfter(user.getEndTime()))
|
||||
|| user.getApplyStatus().equals(ApplyStatusEnum.REJECTED.getCode())
|
||||
);
|
||||
})
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
|
|
@ -95,7 +97,8 @@ public class TrainingUserGatewayImpl implements TrainingUserGateway {
|
|||
if (phones.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Map<String, Long> applyResultMap = trainingUserEList.stream()
|
||||
.collect(Collectors.toMap(TrainingUserE::getPhone, TrainingUserE::getApplyStatus));
|
||||
List<TrainingUserDO> existingUsers = trainingUserRepository.lambdaQuery()
|
||||
.select(TrainingUserDO::getId, TrainingUserDO::getPhone, TrainingUserDO::getApplyStatus)
|
||||
.in(TrainingUserDO::getPhone, phones)
|
||||
|
|
@ -105,11 +108,11 @@ public class TrainingUserGatewayImpl implements TrainingUserGateway {
|
|||
}
|
||||
|
||||
List<TrainingUserDO> needUpdateUsers = existingUsers.stream()
|
||||
.filter(u -> !ApplyStatusEnum.APPROVED.getCode().equals(u.getApplyStatus()))
|
||||
// .filter(u -> !ApplyStatusEnum.APPROVED.getCode().equals(u.getApplyStatus()))
|
||||
.map(u -> {
|
||||
TrainingUserDO d = new TrainingUserDO();
|
||||
d.setId(u.getId());
|
||||
d.setApplyStatus(ApplyStatusEnum.APPROVED.getCode());
|
||||
d.setApplyStatus(applyResultMap.get(u.getPhone()));
|
||||
return d;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
|
|
|||
|
|
@ -38,6 +38,22 @@ public class TrainingApplyProcessDO extends BaseDO {
|
|||
//用户id
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
//审批企业名称
|
||||
@ApiModelProperty(value = "审批企业名称")
|
||||
@TableField(exist = false)
|
||||
private String approveCorpName;
|
||||
//审批部门名称
|
||||
@ApiModelProperty(value = "审批部门名称")
|
||||
@TableField(exist = false)
|
||||
private String approveDeptName;
|
||||
//审批用户名称
|
||||
@ApiModelProperty(value = "审批用户名称")
|
||||
@TableField(exist = false)
|
||||
private String approveUserName;
|
||||
//(value = "审批类型(1:发起,2:审批,3:委托)")
|
||||
@ApiModelProperty(value = "用户id")
|
||||
@TableField(exist = false)
|
||||
private Long approveType;
|
||||
|
||||
public TrainingApplyProcessDO(String trainingApplyProcessId) {
|
||||
this.trainingApplyProcessId = trainingApplyProcessId;
|
||||
|
|
|
|||
|
|
@ -54,9 +54,33 @@ public class TrainingApplyRecordDO extends BaseDO {
|
|||
private Integer applyUserCount;
|
||||
|
||||
// 申请人姓名
|
||||
@ApiModelProperty(value = "申请人姓名")
|
||||
@TableField(exist = false)
|
||||
private String applyUserName;
|
||||
|
||||
// 审批人姓名
|
||||
@ApiModelProperty(value = "审批人姓名")
|
||||
@TableField(exist = false)
|
||||
private String approvalUserName;
|
||||
// 审批部门名称
|
||||
@ApiModelProperty(value = "审批部门名称")
|
||||
@TableField(exist = false)
|
||||
private String approvalDepartmentName;
|
||||
// 审批企业名称
|
||||
@ApiModelProperty(value = "审批企业名称")
|
||||
@TableField(exist = false)
|
||||
private String approvalCorpName;
|
||||
// 委托流程id
|
||||
@ApiModelProperty(value = "委托流程id,空则没有委托,非空则有委托")
|
||||
@TableField(exist = false)
|
||||
private String entrustProcessId;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public TrainingApplyRecordDO(String trainingApplyRecordId) {
|
||||
this.trainingApplyRecordId = trainingApplyRecordId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,5 +49,8 @@ public class ClassExamPaperDO extends BaseDO {
|
|||
@ApiModelProperty(value = "企业名称")
|
||||
@TableField(exist = false)
|
||||
private String corpName;
|
||||
@ApiModelProperty(value = "上架状态")
|
||||
@TableField(exist = false)
|
||||
private Integer sellFlag;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,6 @@ public interface TrainingApplyProcessMapper extends BaseMapper<TrainingApplyProc
|
|||
/**
|
||||
* 查询审批和微信信息
|
||||
*/
|
||||
List<ApproveDetailE> selectApproveDetailList(@Param("trainingApplyRecordId") String trainingApplyRecordId);
|
||||
List<TrainingApplyProcessDO> selectApproveDetailList(@Param("trainingApplyRecordId") String trainingApplyRecordId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public interface TrainingApplyRecordMapper extends BaseMapper<TrainingApplyRecor
|
|||
/**
|
||||
* 培训申请记录详情
|
||||
*/
|
||||
com.zcloud.edu.domain.model.training.TrainingApplyRecordDetailE selectByBusinessId(@Param("id") Long id);
|
||||
TrainingApplyRecordDO selectByBusinessId(@Param("id") Long id);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,5 +14,6 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
@Mapper
|
||||
public interface ClassExamPaperMapper extends BaseMapper<ClassExamPaperDO> {
|
||||
ClassExamPaperDO findById(Long id);
|
||||
ClassExamPaperDO findByClassId(String classId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class TrainingApplyProcessRepositoryImpl extends BaseRepositoryImpl<Train
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ApproveDetailE> getApproveDetailList(String trainingApplyRecordId) {
|
||||
public List<TrainingApplyProcessDO> getApproveDetailList(String trainingApplyRecordId) {
|
||||
return trainingApplyProcessMapper.selectApproveDetailList(trainingApplyRecordId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import com.zcloud.edu.domain.enums.MenuEnum;
|
||||
import com.zcloud.edu.persistence.dataobject.TrainingApplyRecordDO;
|
||||
import com.zcloud.edu.persistence.mapper.TrainingApplyRecordMapper;
|
||||
import com.zcloud.edu.persistence.repository.training.TrainingApplyRecordRepository;
|
||||
|
|
@ -15,6 +16,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -45,6 +47,10 @@ public class TrainingApplyRecordRepositoryImpl extends BaseRepositoryImpl<Traini
|
|||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
// SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
// queryWrapper.eq("approval_user_id", ssoUser.getUserId());
|
||||
String menuPerms = "";
|
||||
if (!ObjectUtils.isEmpty(params.get("menuPath"))) {
|
||||
menuPerms = MenuEnum.getMenuKeyByPath(params.get("menuPath").toString());
|
||||
}
|
||||
IPage<TrainingApplyRecordDO> result = trainingApplyRecordMapper.selectTrainingRecordPage(iPage, queryWrapper);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
|
@ -57,7 +63,7 @@ public class TrainingApplyRecordRepositoryImpl extends BaseRepositoryImpl<Traini
|
|||
}
|
||||
|
||||
@Override
|
||||
public com.zcloud.edu.domain.model.training.TrainingApplyRecordDetailE getDetailById(Long id) {
|
||||
public TrainingApplyRecordDO getDetailById(Long id) {
|
||||
return trainingApplyRecordMapper.selectByBusinessId(id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,10 +69,7 @@ public class ClassExamPaperRepositoryImpl extends BaseRepositoryImpl<ClassExamPa
|
|||
|
||||
@Override
|
||||
public ClassExamPaperDO findByClassId(String classId) {
|
||||
QueryWrapper<ClassExamPaperDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("class_id", classId);
|
||||
queryWrapper.eq("delete_enum", "FALSE");
|
||||
return classExamPaperMapper.selectOne(queryWrapper);
|
||||
return classExamPaperMapper.findByClassId(classId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public interface TrainingApplyProcessRepository extends BaseRepository<TrainingA
|
|||
/**
|
||||
* 查询审批和委托信息
|
||||
*/
|
||||
List<ApproveDetailE> getApproveDetailList(String trainingApplyRecordId);
|
||||
List<TrainingApplyProcessDO> getApproveDetailList(String trainingApplyRecordId);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,6 @@ public interface TrainingApplyRecordRepository extends BaseRepository<TrainingAp
|
|||
|
||||
TrainingApplyRecordDO getByTrainingRecordId(String id);
|
||||
|
||||
com.zcloud.edu.domain.model.training.TrainingApplyRecordDetailE getDetailById(Long id);
|
||||
TrainingApplyRecordDO getDetailById(Long id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,8 +32,10 @@
|
|||
ORDER BY tap.create_time ASC
|
||||
</select>
|
||||
|
||||
<select id="selectApproveDetailList" resultType="com.zcloud.edu.domain.model.training.ApproveDetailE">
|
||||
<select id="selectApproveDetailList" resultType="com.zcloud.edu.persistence.dataobject.TrainingApplyProcessDO">
|
||||
SELECT
|
||||
tap.id,
|
||||
tap.training_apply_process_id,
|
||||
tap.apply_type AS approveType,
|
||||
ci.corp_name AS approveCorpName,
|
||||
d.name AS approveDeptName,
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
<!-- 扩展字段 -->
|
||||
<result column="apply_user_count" property="applyUserCount"/>
|
||||
<result column="apply_user_name" property="applyUserName"/>
|
||||
<result column="entrust_process_id" property="entrustProcessId"/>
|
||||
</resultMap>
|
||||
|
||||
<!--培训申请记录分页-->
|
||||
|
|
@ -49,7 +50,8 @@
|
|||
r.approval_status,
|
||||
r.version,
|
||||
u.name AS apply_user_name,
|
||||
COALESCE(tau_cnt.apply_user_count, 0) AS apply_user_count
|
||||
COALESCE(tau_cnt.apply_user_count, 0) AS apply_user_count,
|
||||
tap.training_apply_process_id entrust_process_id
|
||||
FROM
|
||||
training_apply_record r
|
||||
LEFT JOIN
|
||||
|
|
@ -68,16 +70,17 @@
|
|||
GROUP BY training_apply_record_id
|
||||
) tau_cnt
|
||||
ON tau_cnt.training_apply_record_id = r.training_apply_record_id
|
||||
left join training_apply_process tap on tap.training_apply_record_id = r.training_apply_record_id and tap.delete_enum = 'false' and tap.apply_type = 3
|
||||
WHERE
|
||||
r.delete_enum = 'false'
|
||||
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
|
||||
group by r.training_apply_record_id
|
||||
</select>
|
||||
|
||||
<!--培训申请记录详情-->
|
||||
<select id="selectByBusinessId" resultType="com.zcloud.edu.domain.model.training.TrainingApplyRecordDetailE">
|
||||
<select id="selectByBusinessId" resultType="com.zcloud.edu.persistence.dataobject.TrainingApplyRecordDO">
|
||||
SELECT
|
||||
r.*,
|
||||
(SELECT name FROM user WHERE id = r.apply_user_id AND delete_enum = 'FALSE') AS applyUserName,
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
phone = #{params.phone}
|
||||
and ( end_time is null or end_time < #{params.endTime})
|
||||
</where>
|
||||
where phone = #{phone}
|
||||
</update>
|
||||
</mapper>
|
||||
|
||||
|
|
|
|||
|
|
@ -17,9 +17,30 @@
|
|||
cep.exam_time
|
||||
FROM
|
||||
class_exam_paper cep
|
||||
left join corp_info ci on ci.id = cep.corpinfo_id
|
||||
left join corp_info ci on ci.id = cep.corpinfo_id
|
||||
WHERE
|
||||
cep.id = #{id}
|
||||
</select>
|
||||
<select id="findByClassId" resultType="com.zcloud.edu.persistence.dataobject.study.ClassExamPaperDO">
|
||||
SELECT
|
||||
cep.id,
|
||||
cep.class_exam_paper_id,
|
||||
cep.class_id,
|
||||
cep.exam_paper_id,
|
||||
cep.corpinfo_id,
|
||||
ci.corp_name,
|
||||
cep.exam_name,
|
||||
cep.exam_score,
|
||||
cep.pass_score,
|
||||
cep.exam_time,
|
||||
ep.sell_flag
|
||||
FROM
|
||||
class_exam_paper cep
|
||||
left join corp_info ci on ci.id = cep.corpinfo_id
|
||||
left join exam_paper ep on ep.exam_paper_id = cep.exam_paper_id
|
||||
WHERE
|
||||
cep.class_id = #{classId}
|
||||
and cep.delete_enum = 'FALSE'
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
|||
|
|
@ -193,6 +193,26 @@
|
|||
<if test="params.eqCorpinfoId != null and params.eqCorpinfoId !='' ">
|
||||
and c.corpinfo_id = #{params.eqCorpinfoId}
|
||||
</if>
|
||||
<if test="params.signFlag != null and params.signFlag !='' ">
|
||||
and s.sign_flag = #{params.signFlag}
|
||||
</if>
|
||||
<if test="params.examination != null and params.examination !='' ">
|
||||
and s.exam_sign_flag = #{params.examination}
|
||||
</if>
|
||||
<if test="params.eqState != null and params.eqState !='' ">
|
||||
<if test = "params.eqState = 1">
|
||||
and c.state = 1
|
||||
</if>
|
||||
<if test = "params.eqState = 2">
|
||||
and c.state = 2 and c.start_time > now()
|
||||
</if>
|
||||
<if test = "params.eqState = 3">
|
||||
and c.state = 2 and c.end_time > now()
|
||||
</if>
|
||||
<if test = "params.eqState = 4">
|
||||
and c.state = 2 and c.end_time <= now()
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
order by
|
||||
c.state,
|
||||
|
|
|
|||
Loading…
Reference in New Issue