Compare commits
4 Commits
c8a542a40b
...
35edc5633c
| Author | SHA1 | Date |
|---|---|---|
|
|
35edc5633c | |
|
|
123df8e6f4 | |
|
|
1d8565f97e | |
|
|
50da0e47ea |
|
|
@ -0,0 +1,91 @@
|
||||||
|
package com.zcloud.edu.web;
|
||||||
|
|
||||||
|
|
||||||
|
import com.zcloud.edu.api.QuestionServiceI;
|
||||||
|
import com.zcloud.edu.dto.QuestionAddCmd;
|
||||||
|
import com.zcloud.edu.dto.QuestionPageQry;
|
||||||
|
import com.zcloud.edu.dto.QuestionListQry;
|
||||||
|
import com.zcloud.edu.dto.QuestionUpdateCmd;
|
||||||
|
import com.zcloud.edu.dto.QuestionRemoveCmd;
|
||||||
|
import com.zcloud.edu.dto.clientobject.QuestionCO;
|
||||||
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.alibaba.cola.dto.Response;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||||
|
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||||
|
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 org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-adapter
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:10
|
||||||
|
*/
|
||||||
|
@Api(tags = "课件习题信息")
|
||||||
|
@RequestMapping("/${application.gateway}/question")
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class QuestionController {
|
||||||
|
private final QuestionServiceI questionService;
|
||||||
|
|
||||||
|
@ApiOperation("新增")
|
||||||
|
@PostMapping("/save")
|
||||||
|
public SingleResponse<QuestionCO> add(@Validated @RequestBody QuestionAddCmd cmd) {
|
||||||
|
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||||
|
return questionService.add(cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改")
|
||||||
|
@PutMapping("/edit")
|
||||||
|
public SingleResponse edit(@Validated @RequestBody QuestionUpdateCmd cmd) {
|
||||||
|
questionService.edit(cmd);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("分页")
|
||||||
|
@PostMapping("/list")
|
||||||
|
public PageResponse<QuestionCO> page(@RequestBody QuestionPageQry qry) {
|
||||||
|
return questionService.listPage(qry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("所有数据")
|
||||||
|
@PostMapping("/listAll")
|
||||||
|
public MultiResponse<QuestionCO> listAll(@RequestBody QuestionListQry qry) {
|
||||||
|
return questionService.list(qry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("详情")
|
||||||
|
@GetMapping("/getInfoById")
|
||||||
|
public SingleResponse<QuestionCO> getInfoById(@RequestParam(value = "id") Long id) {
|
||||||
|
return questionService.getInfoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除")
|
||||||
|
@PutMapping("/remove")
|
||||||
|
public Response remove(@RequestParam(value = "id") Long id) {
|
||||||
|
questionService.remove(id);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除多个")
|
||||||
|
@PutMapping("/removeBatch")
|
||||||
|
public Response removeBatch(@Validated @RequestBody QuestionRemoveCmd cmd) {
|
||||||
|
questionService.removeBatch(cmd.getIds());
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("导入题目-视频课件")
|
||||||
|
@PostMapping("/importQuestionVideoTable")
|
||||||
|
public Response importQuestionVideoTable(@RequestPart(value = "file") MultipartFile file, @RequestParam(value = "videoCoursewareId") String videoCoursewareId) {
|
||||||
|
questionService.importQuestionVideoTable(file, videoCoursewareId);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -2,11 +2,7 @@ package com.zcloud.edu.web;
|
||||||
|
|
||||||
|
|
||||||
import com.zcloud.edu.api.TeacherServiceI;
|
import com.zcloud.edu.api.TeacherServiceI;
|
||||||
import com.zcloud.edu.dto.TeacherAddCmd;
|
import com.zcloud.edu.dto.*;
|
||||||
import com.zcloud.edu.dto.TeacherPageQry;
|
|
||||||
import com.zcloud.edu.dto.TeacherListQry;
|
|
||||||
import com.zcloud.edu.dto.TeacherUpdateCmd;
|
|
||||||
import com.zcloud.edu.dto.TeacherRemoveCmd;
|
|
||||||
import com.alibaba.cola.dto.MultiResponse;
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
import com.alibaba.cola.dto.Response;
|
import com.alibaba.cola.dto.Response;
|
||||||
|
|
@ -33,7 +29,7 @@ import org.springframework.web.bind.annotation.*;
|
||||||
public class TeacherController {
|
public class TeacherController {
|
||||||
private final TeacherServiceI teacherService;
|
private final TeacherServiceI teacherService;
|
||||||
|
|
||||||
@ApiOperation("新增")
|
@ApiOperation("新增(从人员列表选择)")
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
public SingleResponse<TeacherCO> add(@Validated @RequestBody TeacherAddCmd cmd) {
|
public SingleResponse<TeacherCO> add(@Validated @RequestBody TeacherAddCmd cmd) {
|
||||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||||
|
|
@ -47,6 +43,13 @@ public class TeacherController {
|
||||||
return SingleResponse.buildSuccess();
|
return SingleResponse.buildSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("启用/禁用")
|
||||||
|
@PutMapping("/editState")
|
||||||
|
public SingleResponse editState(@Validated @RequestBody TeacherUpdateStateCmd cmd) {
|
||||||
|
teacherService.editState(cmd);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("分页")
|
@ApiOperation("分页")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
public PageResponse<TeacherCO> page(@RequestBody TeacherPageQry qry) {
|
public PageResponse<TeacherCO> page(@RequestBody TeacherPageQry qry) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,88 @@
|
||||||
|
package com.zcloud.edu.web;
|
||||||
|
|
||||||
|
|
||||||
|
import com.zcloud.edu.api.VideoCoursewareServiceI;
|
||||||
|
import com.zcloud.edu.dto.*;
|
||||||
|
import com.zcloud.edu.dto.clientobject.VideoCoursewareCO;
|
||||||
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.alibaba.cola.dto.Response;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||||
|
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||||
|
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 java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-adapter
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:32
|
||||||
|
*/
|
||||||
|
@Api(tags = "视频课件信息")
|
||||||
|
@RequestMapping("/${application.gateway}/videoCourseware")
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class VideoCoursewareController {
|
||||||
|
private final VideoCoursewareServiceI videoCoursewareService;
|
||||||
|
|
||||||
|
@ApiOperation("新增")
|
||||||
|
@PostMapping("/save")
|
||||||
|
public SingleResponse<VideoCoursewareCO> add(@Validated @RequestBody VideoCoursewareAddCmd cmd) {
|
||||||
|
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||||
|
return videoCoursewareService.add(cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改")
|
||||||
|
@PutMapping("/edit")
|
||||||
|
public SingleResponse edit(@Validated @RequestBody VideoCoursewareUpdateCmd cmd) {
|
||||||
|
videoCoursewareService.edit(cmd);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("启用/禁用")
|
||||||
|
@PutMapping("/editState")
|
||||||
|
public SingleResponse editState(@Validated @RequestBody VideoCoursewareUpdateStateCmd cmd) {
|
||||||
|
videoCoursewareService.editState(cmd);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("分页")
|
||||||
|
@PostMapping("/list")
|
||||||
|
public PageResponse<VideoCoursewareCO> page(@RequestBody VideoCoursewarePageQry qry) {
|
||||||
|
return videoCoursewareService.listPage(qry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("所有数据")
|
||||||
|
@PostMapping("/listAll")
|
||||||
|
public MultiResponse<VideoCoursewareCO> listAll(@RequestBody VideoCoursewareListQry qry) {
|
||||||
|
return videoCoursewareService.list(qry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("详情")
|
||||||
|
@GetMapping("/getInfoById")
|
||||||
|
public SingleResponse<VideoCoursewareCO> getInfoById(@RequestParam(value = "id") Long id) {
|
||||||
|
return videoCoursewareService.getInfoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除")
|
||||||
|
@PutMapping("/remove")
|
||||||
|
public Response remove(@RequestParam(value = "id") Long id) {
|
||||||
|
videoCoursewareService.remove(id);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除多个")
|
||||||
|
@PutMapping("/removeBatch")
|
||||||
|
public Response removeBatch(@Validated @RequestBody VideoCoursewareRemoveCmd cmd) {
|
||||||
|
videoCoursewareService.removeBatch(cmd.getIds());
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,67 @@
|
||||||
|
package com.zcloud.edu.command;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.zcloud.edu.domain.gateway.QuestionGateway;
|
||||||
|
import com.zcloud.edu.domain.model.QuestionE;
|
||||||
|
import com.zcloud.edu.dto.QuestionAddCmd;
|
||||||
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import com.zcloud.edu.persistence.dataobject.QuestionDO;
|
||||||
|
import com.zcloud.edu.persistence.repository.QuestionRepository;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:10
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class QuestionAddExe {
|
||||||
|
private final QuestionGateway questionGateway;
|
||||||
|
private final QuestionRepository questionRepository;
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean execute(QuestionAddCmd cmd) {
|
||||||
|
QuestionE questionE = new QuestionE();
|
||||||
|
BeanUtils.copyProperties(cmd, questionE);
|
||||||
|
questionE.checkQuestion(questionE);
|
||||||
|
|
||||||
|
boolean res = false;
|
||||||
|
try {
|
||||||
|
res = questionGateway.add(questionE);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
if (!res) {
|
||||||
|
throw new BizException("保存失败");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void importQuestionVideoTable(MultipartFile file, String videoCoursewareId){
|
||||||
|
QuestionE questionE = new QuestionE();
|
||||||
|
Integer maxQuestionNumber = questionRepository.getMaxQuestionNumber(videoCoursewareId);
|
||||||
|
List<QuestionE> questionES = questionE.parseImportTemplateData(file, videoCoursewareId, maxQuestionNumber);
|
||||||
|
|
||||||
|
// 批量插入
|
||||||
|
boolean res = false;
|
||||||
|
try {
|
||||||
|
res = questionRepository.saveBatch(BeanUtil.copyToList(questionES, QuestionDO.class));
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
if (!res) {
|
||||||
|
throw new BizException("导入失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.zcloud.edu.command;
|
||||||
|
|
||||||
|
import com.zcloud.edu.domain.gateway.QuestionGateway;
|
||||||
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:11
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class QuestionRemoveExe {
|
||||||
|
private final QuestionGateway questionGateway;
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean execute(Long id) {
|
||||||
|
boolean res = questionGateway.deletedQuestionById(id);
|
||||||
|
if (!res) {
|
||||||
|
throw new BizException("删除失败");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean execute(Long[] ids) {
|
||||||
|
boolean res = questionGateway.deletedQuestionByIds(ids);
|
||||||
|
if (!res) {
|
||||||
|
throw new BizException("删除失败");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.zcloud.edu.command;
|
||||||
|
|
||||||
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import com.zcloud.edu.domain.gateway.QuestionGateway;
|
||||||
|
import com.zcloud.edu.domain.model.QuestionE;
|
||||||
|
import com.zcloud.edu.dto.QuestionUpdateCmd;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:11
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class QuestionUpdateExe {
|
||||||
|
private final QuestionGateway questionGateway;
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void execute(QuestionUpdateCmd cmd) {
|
||||||
|
QuestionE questionE = new QuestionE();
|
||||||
|
BeanUtils.copyProperties(cmd, questionE);
|
||||||
|
questionE.checkQuestion(questionE);
|
||||||
|
boolean res = questionGateway.update(questionE);
|
||||||
|
if (!res) {
|
||||||
|
throw new BizException("修改失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,14 +1,21 @@
|
||||||
package com.zcloud.edu.command;
|
package com.zcloud.edu.command;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.zcloud.edu.domain.gateway.TeacherGateway;
|
import com.zcloud.edu.domain.gateway.TeacherGateway;
|
||||||
import com.zcloud.edu.domain.model.TeacherE;
|
import com.zcloud.edu.domain.model.TeacherE;
|
||||||
|
import com.zcloud.edu.domain.model.UserAddE;
|
||||||
import com.zcloud.edu.dto.TeacherAddCmd;
|
import com.zcloud.edu.dto.TeacherAddCmd;
|
||||||
import com.alibaba.cola.exception.BizException;
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import com.zcloud.edu.persistence.dataobject.TeacherDO;
|
||||||
|
import com.zcloud.edu.persistence.repository.TeacherRepository;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-app
|
* web-app
|
||||||
|
|
@ -20,14 +27,18 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class TeacherAddExe {
|
public class TeacherAddExe {
|
||||||
private final TeacherGateway teacherGateway;
|
private final TeacherGateway teacherGateway;
|
||||||
|
private final TeacherRepository teacherRepository;
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean execute(TeacherAddCmd cmd) {
|
public boolean execute(TeacherAddCmd cmd) {
|
||||||
TeacherE teacherE = new TeacherE();
|
TeacherE teacherE = new TeacherE();
|
||||||
BeanUtils.copyProperties(cmd, teacherE);
|
List<TeacherE> teacherEList = teacherE.convertFromUserList(BeanUtil.copyToList(cmd.getUserList(), UserAddE.class));
|
||||||
|
|
||||||
boolean res = false;
|
boolean res = false;
|
||||||
try {
|
try {
|
||||||
res = teacherGateway.add(teacherE);
|
if(CollUtil.isNotEmpty(teacherEList)){
|
||||||
|
res = teacherRepository.saveBatch(BeanUtil.copyToList(teacherEList, TeacherDO.class));
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,23 @@
|
||||||
package com.zcloud.edu.command;
|
package com.zcloud.edu.command;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
import com.zcloud.edu.domain.gateway.TeacherGateway;
|
import com.zcloud.edu.domain.gateway.TeacherGateway;
|
||||||
import com.alibaba.cola.exception.BizException;
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import com.zcloud.edu.domain.model.TeacherE;
|
||||||
|
import com.zcloud.edu.persistence.dataobject.TeacherDO;
|
||||||
|
import com.zcloud.edu.persistence.dataobject.VideoCoursewareDO;
|
||||||
|
import com.zcloud.edu.persistence.repository.TeacherCertificateRepository;
|
||||||
|
import com.zcloud.edu.persistence.repository.TeacherRepository;
|
||||||
|
import com.zcloud.edu.persistence.repository.VideoCoursewareRepository;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-app
|
* web-app
|
||||||
|
|
@ -17,10 +29,27 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class TeacherRemoveExe {
|
public class TeacherRemoveExe {
|
||||||
private final TeacherGateway teacherGateway;
|
private final TeacherGateway teacherGateway;
|
||||||
|
private final TeacherRepository teacherRepository;
|
||||||
|
private final TeacherCertificateRepository teacherCertificateRepository;
|
||||||
|
private final VideoCoursewareRepository videoCoursewareRepository;
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean execute(Long id) {
|
public boolean execute(Long id) {
|
||||||
|
SingleResponse<TeacherDO> teacherDO = teacherRepository.getInfoById(id);
|
||||||
|
|
||||||
|
if(teacherDO.getData() == null || teacherDO.getData() == null){
|
||||||
|
throw new BizException("数据不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
TeacherE teacherE = new TeacherE();
|
||||||
|
List<VideoCoursewareDO> videoCoursewareDOS = videoCoursewareRepository.listByTeacherId(teacherDO.getData().getTeacherId());
|
||||||
|
teacherE.checkList(videoCoursewareDOS == null ? 0 : videoCoursewareDOS.size());
|
||||||
|
|
||||||
boolean res = teacherGateway.deletedTeacherById(id);
|
boolean res = teacherGateway.deletedTeacherById(id);
|
||||||
|
if(res){
|
||||||
|
String teacherId = teacherDO.getData().getTeacherId();
|
||||||
|
teacherCertificateRepository.removeByTeacherId(teacherId);
|
||||||
|
}
|
||||||
if (!res) {
|
if (!res) {
|
||||||
throw new BizException("删除失败");
|
throw new BizException("删除失败");
|
||||||
}
|
}
|
||||||
|
|
@ -29,7 +58,21 @@ public class TeacherRemoveExe {
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean execute(Long[] ids) {
|
public boolean execute(Long[] ids) {
|
||||||
|
List<TeacherDO> teacherDOS = teacherRepository.listByIds(Arrays.asList(ids));
|
||||||
|
if(CollUtil.isEmpty(teacherDOS)){
|
||||||
|
throw new BizException("数据不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<String> teacherIds = teacherDOS.stream().map(TeacherDO::getTeacherId).collect(Collectors.toList());
|
||||||
|
List<VideoCoursewareDO> videoCoursewareDOS = videoCoursewareRepository.listByTeacherIds(teacherIds);
|
||||||
|
TeacherE teacherE = new TeacherE();
|
||||||
|
teacherE.checkList(videoCoursewareDOS == null ? 0 : videoCoursewareDOS.size());
|
||||||
|
|
||||||
boolean res = teacherGateway.deletedTeacherByIds(ids);
|
boolean res = teacherGateway.deletedTeacherByIds(ids);
|
||||||
|
|
||||||
|
if(res){
|
||||||
|
teacherCertificateRepository.removeByTeacherIds(teacherIds);
|
||||||
|
}
|
||||||
if (!res) {
|
if (!res) {
|
||||||
throw new BizException("删除失败");
|
throw new BizException("删除失败");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.alibaba.cola.exception.BizException;
|
||||||
import com.zcloud.edu.domain.gateway.TeacherGateway;
|
import com.zcloud.edu.domain.gateway.TeacherGateway;
|
||||||
import com.zcloud.edu.domain.model.TeacherE;
|
import com.zcloud.edu.domain.model.TeacherE;
|
||||||
import com.zcloud.edu.dto.TeacherUpdateCmd;
|
import com.zcloud.edu.dto.TeacherUpdateCmd;
|
||||||
|
import com.zcloud.edu.dto.TeacherUpdateStateCmd;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
@ -30,5 +31,15 @@ public class TeacherUpdateExe {
|
||||||
throw new BizException("修改失败");
|
throw new BizException("修改失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void execute(TeacherUpdateStateCmd cmd) {
|
||||||
|
TeacherE teacherE = new TeacherE();
|
||||||
|
BeanUtils.copyProperties(cmd, teacherE);
|
||||||
|
boolean res = teacherGateway.update(teacherE);
|
||||||
|
if (!res) {
|
||||||
|
throw new BizException("修改失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.zcloud.edu.command;
|
||||||
|
|
||||||
|
import com.zcloud.edu.domain.gateway.VideoCoursewareGateway;
|
||||||
|
import com.zcloud.edu.domain.model.VideoCoursewareE;
|
||||||
|
import com.zcloud.edu.dto.VideoCoursewareAddCmd;
|
||||||
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:31
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class VideoCoursewareAddExe {
|
||||||
|
private final VideoCoursewareGateway videoCoursewareGateway;
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean execute(VideoCoursewareAddCmd cmd) {
|
||||||
|
VideoCoursewareE videoCoursewareE = new VideoCoursewareE();
|
||||||
|
BeanUtils.copyProperties(cmd, videoCoursewareE);
|
||||||
|
boolean res = false;
|
||||||
|
try {
|
||||||
|
res = videoCoursewareGateway.add(videoCoursewareE);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
if (!res) {
|
||||||
|
throw new BizException("保存失败");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.zcloud.edu.command;
|
||||||
|
|
||||||
|
import com.zcloud.edu.domain.gateway.VideoCoursewareGateway;
|
||||||
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:32
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class VideoCoursewareRemoveExe {
|
||||||
|
private final VideoCoursewareGateway videoCoursewareGateway;
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean execute(Long id) {
|
||||||
|
boolean res = videoCoursewareGateway.deletedVideoCoursewareById(id);
|
||||||
|
if (!res) {
|
||||||
|
throw new BizException("删除失败");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean execute(Long[] ids) {
|
||||||
|
boolean res = videoCoursewareGateway.deletedVideoCoursewareByIds(ids);
|
||||||
|
if (!res) {
|
||||||
|
throw new BizException("删除失败");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.zcloud.edu.command;
|
||||||
|
|
||||||
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import com.zcloud.edu.domain.gateway.VideoCoursewareGateway;
|
||||||
|
import com.zcloud.edu.domain.model.VideoCoursewareE;
|
||||||
|
import com.zcloud.edu.dto.VideoCoursewareUpdateCmd;
|
||||||
|
import com.zcloud.edu.dto.VideoCoursewareUpdateStateCmd;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:33
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class VideoCoursewareUpdateExe {
|
||||||
|
private final VideoCoursewareGateway videoCoursewareGateway;
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void execute(VideoCoursewareUpdateCmd cmd) {
|
||||||
|
VideoCoursewareE videoCoursewareE = new VideoCoursewareE();
|
||||||
|
BeanUtils.copyProperties(cmd, videoCoursewareE);
|
||||||
|
boolean res = videoCoursewareGateway.update(videoCoursewareE);
|
||||||
|
if (!res) {
|
||||||
|
throw new BizException("修改失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void execute(VideoCoursewareUpdateStateCmd cmd) {
|
||||||
|
VideoCoursewareE videoCoursewareE = new VideoCoursewareE();
|
||||||
|
BeanUtils.copyProperties(cmd, videoCoursewareE);
|
||||||
|
boolean res = videoCoursewareGateway.update(videoCoursewareE);
|
||||||
|
if (!res) {
|
||||||
|
throw new BizException("修改失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.zcloud.edu.command.convertor;
|
||||||
|
|
||||||
|
import com.zcloud.edu.dto.clientobject.QuestionCO;
|
||||||
|
import com.zcloud.edu.persistence.dataobject.QuestionDO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:10
|
||||||
|
*/
|
||||||
|
@Mapper(componentModel = "spring")
|
||||||
|
public interface QuestionCoConvertor {
|
||||||
|
/**
|
||||||
|
* @param questionDOs
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<QuestionCO> converDOsToCOs(List<QuestionDO> questionDOs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.zcloud.edu.command.convertor;
|
||||||
|
|
||||||
|
import com.zcloud.edu.dto.clientobject.VideoCoursewareCO;
|
||||||
|
import com.zcloud.edu.persistence.dataobject.VideoCoursewareDO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:32
|
||||||
|
*/
|
||||||
|
@Mapper(componentModel = "spring")
|
||||||
|
public interface VideoCoursewareCoConvertor {
|
||||||
|
/**
|
||||||
|
* @param videoCoursewareDOs
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<VideoCoursewareCO> converDOsToCOs(List<VideoCoursewareDO> videoCoursewareDOs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
package com.zcloud.edu.command.query;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
|
import com.zcloud.edu.command.convertor.QuestionCoConvertor;
|
||||||
|
import com.zcloud.edu.dto.QuestionPageQry;
|
||||||
|
import com.zcloud.edu.dto.QuestionListQry;
|
||||||
|
import com.zcloud.edu.dto.clientobject.QuestionCO;
|
||||||
|
import com.zcloud.edu.persistence.dataobject.QuestionDO;
|
||||||
|
import com.zcloud.edu.persistence.repository.QuestionRepository;
|
||||||
|
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:11
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class QuestionQueryExe {
|
||||||
|
private final QuestionRepository questionRepository;
|
||||||
|
private final QuestionCoConvertor questionCoConvertor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public PageResponse<QuestionCO> execute(QuestionPageQry qry) {
|
||||||
|
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||||
|
PageResponse<QuestionDO> pageResponse = questionRepository.listPage(params);
|
||||||
|
List<QuestionCO> examCenterCOS = questionCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||||
|
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||||
|
}
|
||||||
|
|
||||||
|
public MultiResponse<QuestionCO> execute(QuestionListQry qry) {
|
||||||
|
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||||
|
List<QuestionDO> list = questionRepository.list(params);
|
||||||
|
List<QuestionCO> examCenterCOS = questionCoConvertor.converDOsToCOs(list);
|
||||||
|
return MultiResponse.of(examCenterCOS);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SingleResponse<QuestionCO> execute(Long id) {
|
||||||
|
SingleResponse<QuestionDO> questionDO = questionRepository.getInfoById(id);
|
||||||
|
QuestionCO co = new QuestionCO();
|
||||||
|
BeanUtils.copyProperties(questionDO.getData(), co);
|
||||||
|
return SingleResponse.of(co);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
package com.zcloud.edu.command.query;
|
package com.zcloud.edu.command.query;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.alibaba.cola.dto.MultiResponse;
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
import com.zcloud.edu.command.convertor.TeacherCoConvertor;
|
import com.zcloud.edu.command.convertor.TeacherCoConvertor;
|
||||||
import com.zcloud.edu.dto.TeacherListQry;
|
import com.zcloud.edu.dto.TeacherListQry;
|
||||||
import com.zcloud.edu.dto.TeacherPageQry;
|
import com.zcloud.edu.dto.TeacherPageQry;
|
||||||
import com.zcloud.edu.dto.clientobject.TeacherCO;
|
import com.zcloud.edu.dto.clientobject.TeacherCO;
|
||||||
|
import com.zcloud.edu.dto.clientobject.TeacherCertificateCO;
|
||||||
|
import com.zcloud.edu.persistence.dataobject.TeacherCertificateDO;
|
||||||
import com.zcloud.edu.persistence.dataobject.TeacherDO;
|
import com.zcloud.edu.persistence.dataobject.TeacherDO;
|
||||||
|
import com.zcloud.edu.persistence.repository.TeacherCertificateRepository;
|
||||||
import com.zcloud.edu.persistence.repository.TeacherRepository;
|
import com.zcloud.edu.persistence.repository.TeacherRepository;
|
||||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
|
@ -29,6 +33,7 @@ import java.util.Map;
|
||||||
public class TeacherQueryExe {
|
public class TeacherQueryExe {
|
||||||
private final TeacherRepository teacherRepository;
|
private final TeacherRepository teacherRepository;
|
||||||
private final TeacherCoConvertor teacherCoConvertor;
|
private final TeacherCoConvertor teacherCoConvertor;
|
||||||
|
private final TeacherCertificateRepository teacherCertificateRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页
|
* 分页
|
||||||
|
|
@ -53,6 +58,12 @@ public class TeacherQueryExe {
|
||||||
SingleResponse<TeacherDO> teacherDO = teacherRepository.getInfoById(id);
|
SingleResponse<TeacherDO> teacherDO = teacherRepository.getInfoById(id);
|
||||||
TeacherCO co = new TeacherCO();
|
TeacherCO co = new TeacherCO();
|
||||||
BeanUtils.copyProperties(teacherDO.getData(), co);
|
BeanUtils.copyProperties(teacherDO.getData(), co);
|
||||||
|
|
||||||
|
if(co != null){
|
||||||
|
List<TeacherCertificateDO> teacherCertificateDOS = teacherCertificateRepository.listByTeacherId(co.getTeacherId());
|
||||||
|
co.setTeacherCertificateList(BeanUtil.copyToList(teacherCertificateDOS, TeacherCertificateCO.class));
|
||||||
|
}
|
||||||
|
|
||||||
return SingleResponse.of(co);
|
return SingleResponse.of(co);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
package com.zcloud.edu.command.query;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
|
import com.zcloud.edu.command.convertor.VideoCoursewareCoConvertor;
|
||||||
|
import com.zcloud.edu.dto.VideoCoursewarePageQry;
|
||||||
|
import com.zcloud.edu.dto.VideoCoursewareListQry;
|
||||||
|
import com.zcloud.edu.dto.clientobject.VideoCoursewareCO;
|
||||||
|
import com.zcloud.edu.persistence.dataobject.VideoCoursewareDO;
|
||||||
|
import com.zcloud.edu.persistence.repository.VideoCoursewareRepository;
|
||||||
|
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:32
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class VideoCoursewareQueryExe {
|
||||||
|
private final VideoCoursewareRepository videoCoursewareRepository;
|
||||||
|
private final VideoCoursewareCoConvertor videoCoursewareCoConvertor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public PageResponse<VideoCoursewareCO> execute(VideoCoursewarePageQry qry) {
|
||||||
|
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||||
|
PageResponse<VideoCoursewareDO> pageResponse = videoCoursewareRepository.listPage(params);
|
||||||
|
List<VideoCoursewareCO> examCenterCOS = videoCoursewareCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||||
|
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||||
|
}
|
||||||
|
|
||||||
|
public MultiResponse<VideoCoursewareCO> execute(VideoCoursewareListQry qry) {
|
||||||
|
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||||
|
List<VideoCoursewareDO> list = videoCoursewareRepository.list(params);
|
||||||
|
List<VideoCoursewareCO> examCenterCOS = videoCoursewareCoConvertor.converDOsToCOs(list);
|
||||||
|
return MultiResponse.of(examCenterCOS);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SingleResponse<VideoCoursewareCO> execute(Long id) {
|
||||||
|
SingleResponse<VideoCoursewareDO> videoCoursewareDO = videoCoursewareRepository.getInfoById(id);
|
||||||
|
VideoCoursewareCO co = new VideoCoursewareCO();
|
||||||
|
BeanUtils.copyProperties(videoCoursewareDO.getData(), co);
|
||||||
|
return SingleResponse.of(co);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
package com.zcloud.edu.service;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
|
import com.zcloud.edu.api.QuestionServiceI;
|
||||||
|
import com.zcloud.edu.command.QuestionAddExe;
|
||||||
|
import com.zcloud.edu.command.QuestionRemoveExe;
|
||||||
|
import com.zcloud.edu.command.QuestionUpdateExe;
|
||||||
|
import com.zcloud.edu.command.query.QuestionQueryExe;
|
||||||
|
import com.zcloud.edu.dto.QuestionAddCmd;
|
||||||
|
import com.zcloud.edu.dto.QuestionPageQry;
|
||||||
|
import com.zcloud.edu.dto.QuestionListQry;
|
||||||
|
import com.zcloud.edu.dto.QuestionUpdateCmd;
|
||||||
|
import com.zcloud.edu.dto.clientobject.QuestionCO;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:11
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class QuestionServiceImpl implements QuestionServiceI {
|
||||||
|
private final QuestionAddExe questionAddExe;
|
||||||
|
private final QuestionUpdateExe questionUpdateExe;
|
||||||
|
private final QuestionRemoveExe questionRemoveExe;
|
||||||
|
private final QuestionQueryExe questionQueryExe;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResponse<QuestionCO> listPage(QuestionPageQry qry) {
|
||||||
|
return questionQueryExe.execute(qry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MultiResponse<QuestionCO> list(QuestionListQry qry) {
|
||||||
|
return questionQueryExe.execute(qry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResponse<QuestionCO> getInfoById(Long id) {
|
||||||
|
return questionQueryExe.execute(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResponse add(QuestionAddCmd cmd) {
|
||||||
|
questionAddExe.execute(cmd);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void edit(QuestionUpdateCmd cmd) {
|
||||||
|
questionUpdateExe.execute(cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void remove(Long id) {
|
||||||
|
questionRemoveExe.execute(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeBatch(Long[] ids) {
|
||||||
|
questionRemoveExe.execute(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void importQuestionVideoTable(MultipartFile file, String videoCoursewareId) {
|
||||||
|
questionAddExe.importQuestionVideoTable(file, videoCoursewareId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -6,10 +6,7 @@ import com.zcloud.edu.command.TeacherAddExe;
|
||||||
import com.zcloud.edu.command.TeacherRemoveExe;
|
import com.zcloud.edu.command.TeacherRemoveExe;
|
||||||
import com.zcloud.edu.command.TeacherUpdateExe;
|
import com.zcloud.edu.command.TeacherUpdateExe;
|
||||||
import com.zcloud.edu.command.query.TeacherQueryExe;
|
import com.zcloud.edu.command.query.TeacherQueryExe;
|
||||||
import com.zcloud.edu.dto.TeacherAddCmd;
|
import com.zcloud.edu.dto.*;
|
||||||
import com.zcloud.edu.dto.TeacherPageQry;
|
|
||||||
import com.zcloud.edu.dto.TeacherListQry;
|
|
||||||
import com.zcloud.edu.dto.TeacherUpdateCmd;
|
|
||||||
|
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
import com.alibaba.cola.dto.SingleResponse;
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
|
@ -57,6 +54,11 @@ public class TeacherServiceImpl implements TeacherServiceI {
|
||||||
teacherUpdateExe.execute(cmd);
|
teacherUpdateExe.execute(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void editState(TeacherUpdateStateCmd cmd) {
|
||||||
|
teacherUpdateExe.execute(cmd);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void remove(Long id) {
|
public void remove(Long id) {
|
||||||
teacherRemoveExe.execute(id);
|
teacherRemoveExe.execute(id);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
package com.zcloud.edu.service;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
|
import com.zcloud.edu.api.VideoCoursewareServiceI;
|
||||||
|
import com.zcloud.edu.command.VideoCoursewareAddExe;
|
||||||
|
import com.zcloud.edu.command.VideoCoursewareRemoveExe;
|
||||||
|
import com.zcloud.edu.command.VideoCoursewareUpdateExe;
|
||||||
|
import com.zcloud.edu.command.query.VideoCoursewareQueryExe;
|
||||||
|
import com.zcloud.edu.dto.*;
|
||||||
|
import com.zcloud.edu.dto.clientobject.VideoCoursewareCO;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:32
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class VideoCoursewareServiceImpl implements VideoCoursewareServiceI {
|
||||||
|
private final VideoCoursewareAddExe videoCoursewareAddExe;
|
||||||
|
private final VideoCoursewareUpdateExe videoCoursewareUpdateExe;
|
||||||
|
private final VideoCoursewareRemoveExe videoCoursewareRemoveExe;
|
||||||
|
private final VideoCoursewareQueryExe videoCoursewareQueryExe;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResponse<VideoCoursewareCO> listPage(VideoCoursewarePageQry qry) {
|
||||||
|
return videoCoursewareQueryExe.execute(qry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MultiResponse<VideoCoursewareCO> list(VideoCoursewareListQry qry) {
|
||||||
|
return videoCoursewareQueryExe.execute(qry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResponse<VideoCoursewareCO> getInfoById(Long id) {
|
||||||
|
return videoCoursewareQueryExe.execute(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResponse add(VideoCoursewareAddCmd cmd) {
|
||||||
|
videoCoursewareAddExe.execute(cmd);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void edit(VideoCoursewareUpdateCmd cmd) {
|
||||||
|
videoCoursewareUpdateExe.execute(cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void editState(VideoCoursewareUpdateStateCmd cmd) {
|
||||||
|
videoCoursewareUpdateExe.execute(cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void remove(Long id) {
|
||||||
|
videoCoursewareRemoveExe.execute(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeBatch(Long[] ids) {
|
||||||
|
videoCoursewareRemoveExe.execute(ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.zcloud.edu.api;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
|
import com.zcloud.edu.dto.QuestionAddCmd;
|
||||||
|
import com.zcloud.edu.dto.QuestionPageQry;
|
||||||
|
import com.zcloud.edu.dto.QuestionListQry;
|
||||||
|
import com.zcloud.edu.dto.QuestionUpdateCmd;
|
||||||
|
import com.zcloud.edu.dto.clientobject.QuestionCO;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:11
|
||||||
|
*/
|
||||||
|
public interface QuestionServiceI {
|
||||||
|
PageResponse<QuestionCO> listPage(QuestionPageQry qry);
|
||||||
|
|
||||||
|
MultiResponse<QuestionCO> list(QuestionListQry qry);
|
||||||
|
|
||||||
|
SingleResponse<QuestionCO> getInfoById(Long id);
|
||||||
|
|
||||||
|
SingleResponse<QuestionCO> add(QuestionAddCmd cmd);
|
||||||
|
|
||||||
|
void edit(QuestionUpdateCmd cmd);
|
||||||
|
|
||||||
|
void remove(Long id);
|
||||||
|
|
||||||
|
void removeBatch(Long[] ids);
|
||||||
|
|
||||||
|
void importQuestionVideoTable(MultipartFile file, String videoCoursewareId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
package com.zcloud.edu.api;
|
package com.zcloud.edu.api;
|
||||||
|
|
||||||
import com.alibaba.cola.dto.MultiResponse;
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
import com.zcloud.edu.dto.TeacherAddCmd;
|
import com.zcloud.edu.dto.*;
|
||||||
import com.zcloud.edu.dto.TeacherPageQry;
|
|
||||||
import com.zcloud.edu.dto.TeacherListQry;
|
|
||||||
import com.zcloud.edu.dto.TeacherUpdateCmd;
|
|
||||||
|
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
import com.alibaba.cola.dto.SingleResponse;
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
|
@ -27,6 +24,8 @@ public interface TeacherServiceI {
|
||||||
|
|
||||||
void edit(TeacherUpdateCmd cmd);
|
void edit(TeacherUpdateCmd cmd);
|
||||||
|
|
||||||
|
void editState(TeacherUpdateStateCmd cmd);
|
||||||
|
|
||||||
void remove(Long id);
|
void remove(Long id);
|
||||||
|
|
||||||
void removeBatch(Long[] ids);
|
void removeBatch(Long[] ids);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.zcloud.edu.api;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
|
import com.zcloud.edu.dto.*;
|
||||||
|
import com.zcloud.edu.dto.clientobject.VideoCoursewareCO;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:32
|
||||||
|
*/
|
||||||
|
public interface VideoCoursewareServiceI {
|
||||||
|
PageResponse<VideoCoursewareCO> listPage(VideoCoursewarePageQry qry);
|
||||||
|
|
||||||
|
MultiResponse<VideoCoursewareCO> list(VideoCoursewareListQry qry);
|
||||||
|
|
||||||
|
SingleResponse<VideoCoursewareCO> getInfoById(Long id);
|
||||||
|
|
||||||
|
SingleResponse<VideoCoursewareCO> add(VideoCoursewareAddCmd cmd);
|
||||||
|
|
||||||
|
void edit(VideoCoursewareUpdateCmd cmd);
|
||||||
|
|
||||||
|
void editState(VideoCoursewareUpdateStateCmd cmd);
|
||||||
|
|
||||||
|
void remove(Long id);
|
||||||
|
|
||||||
|
void removeBatch(Long[] ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
package com.zcloud.edu.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.Command;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:10
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class QuestionAddCmd extends Command {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "课件id", name = "videoCoursewareId")
|
||||||
|
private String videoCoursewareId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "试卷id", name = "examPaperId")
|
||||||
|
private String examPaperId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "试题类型(1单选题、2多选题、3判断题)", name = "questionType", required = true)
|
||||||
|
@NotEmpty(message = "试题类型(单选题、多选题、判断题)不能为空")
|
||||||
|
private String questionType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "题干", name = "questionDry", required = true)
|
||||||
|
@NotEmpty(message = "题干不能为空")
|
||||||
|
private String questionDry;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "选项A", name = "optionA", required = true)
|
||||||
|
private String optionA;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "选项B", name = "optionB", required = true)
|
||||||
|
private String optionB;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "选项C", name = "optionC", required = true)
|
||||||
|
private String optionC;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "选项D", name = "optionD", required = true)
|
||||||
|
private String optionD;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "答案", name = "answer", required = true)
|
||||||
|
@NotEmpty(message = "答案不能为空")
|
||||||
|
private String answer;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "课件类型(1:视频课件、2:试卷习题)", name = "coursewareType", required = true)
|
||||||
|
@NotNull(message = "课件类型(1:视频课件、2:试卷习题)不能为空")
|
||||||
|
private Integer coursewareType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "答案解析", name = "descr")
|
||||||
|
private String descr;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分值", name = "score")
|
||||||
|
private String score;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.zcloud.edu.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.PageQuery;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class QuestionListQry extends PageQuery {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询条件操作前缀,支持以下几种数据库查询操作:
|
||||||
|
* - `like`: 模糊匹配查询,对应SQL的LIKE操作符
|
||||||
|
* - `eq`: 等值查询,对应SQL的=操作符
|
||||||
|
* - `gt`: 大于比较查询
|
||||||
|
* - `lt`: 小于比较查询
|
||||||
|
* - `ge`: 大于等于比较查询
|
||||||
|
* - `le`: 小于等于比较查询
|
||||||
|
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||||
|
*/
|
||||||
|
private String likeQuestionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.zcloud.edu.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.PageQuery;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class QuestionPageQry extends PageQuery {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询条件操作前缀,支持以下几种数据库查询操作:
|
||||||
|
* - `like`: 模糊匹配查询,对应SQL的LIKE操作符
|
||||||
|
* - `eq`: 等值查询,对应SQL的=操作符
|
||||||
|
* - `gt`: 大于比较查询
|
||||||
|
* - `lt`: 小于比较查询
|
||||||
|
* - `ge`: 大于等于比较查询
|
||||||
|
* - `le`: 小于等于比较查询
|
||||||
|
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||||
|
*/
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "视频课件id、2:试卷习题)", name = "eqVideoCoursewareId", required = true)
|
||||||
|
private String eqVideoCoursewareId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "试卷id", name = "eqExamPaperId", required = true)
|
||||||
|
private String eqExamPaperId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.zcloud.edu.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.Command;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:11
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class QuestionRemoveCmd extends Command {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", name = "ids", required = true)
|
||||||
|
@NotNull(message = "主键不能为空")
|
||||||
|
@Size(min = 1, message = "请选择数据")
|
||||||
|
private Long[] ids;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,71 @@
|
||||||
|
package com.zcloud.edu.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.Command;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:11
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class QuestionUpdateCmd extends Command {
|
||||||
|
@ApiModelProperty(value = "id", name = "id", required = true)
|
||||||
|
@NotNull(message = "id不能为空")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键id", name = "questionNumber", required = true)
|
||||||
|
@NotEmpty(message = "主键id不能为空")
|
||||||
|
private String questionId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "课件id", name = "videoCoursewareId")
|
||||||
|
private String videoCoursewareId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "试卷id", name = "examPaperId")
|
||||||
|
private String examPaperId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "试题类型(1单选题、2多选题、3判断题)", name = "questionType", required = true)
|
||||||
|
@NotEmpty(message = "试题类型(单选题、多选题、判断题)不能为空")
|
||||||
|
private String questionType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "题干", name = "questionDry", required = true)
|
||||||
|
@NotEmpty(message = "题干不能为空")
|
||||||
|
private String questionDry;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "选项A", name = "optionA", required = true)
|
||||||
|
private String optionA;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "选项B", name = "optionB", required = true)
|
||||||
|
private String optionB;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "选项C", name = "optionC", required = true)
|
||||||
|
private String optionC;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "选项D", name = "optionD", required = true)
|
||||||
|
private String optionD;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "答案", name = "answer", required = true)
|
||||||
|
@NotEmpty(message = "答案不能为空")
|
||||||
|
private String answer;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "课件类型(1:视频课件、2:试卷习题)", name = "coursewareType", required = true)
|
||||||
|
@NotNull(message = "课件类型(1:视频课件、2:试卷习题)不能为空")
|
||||||
|
private Integer coursewareType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "答案解析", name = "descr")
|
||||||
|
private String descr;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分值", name = "score")
|
||||||
|
private String score;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -11,6 +11,7 @@ import lombok.NoArgsConstructor;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-client
|
* web-client
|
||||||
|
|
@ -23,58 +24,10 @@ import java.util.Date;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class TeacherAddCmd extends Command {
|
public class TeacherAddCmd extends Command {
|
||||||
@ApiModelProperty(value = "用户id", name = "userId", required = true)
|
|
||||||
@NotNull(message = "用户id不能为空")
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "企业ID", name = "corpinfoId", required = true)
|
@ApiModelProperty(value = "用户列表",name = "userList", required = true)
|
||||||
@NotNull(message = "企业ID不能为空")
|
@NotEmpty(message = "用户列表不能为空")
|
||||||
private Long corpinfoId;
|
private List<UserAddCmd> userList;
|
||||||
|
|
||||||
@ApiModelProperty(value = "教师姓名", name = "teacherName", required = true)
|
|
||||||
@NotEmpty(message = "教师姓名不能为空")
|
|
||||||
private String teacherName;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "手机号", name = "phone", required = true)
|
|
||||||
@NotEmpty(message = "手机号不能为空")
|
|
||||||
private String phone;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "身份证号", name = "identityNumber", required = true)
|
|
||||||
@NotEmpty(message = "身份证号不能为空")
|
|
||||||
private String identityNumber;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "文化程度", name = "educationLevel", required = true)
|
|
||||||
@NotEmpty(message = "文化程度不能为空")
|
|
||||||
private String educationLevel;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "文化程度名称", name = "educationLevelName", required = true)
|
|
||||||
@NotEmpty(message = "文化程度名称不能为空")
|
|
||||||
private String educationLevelName;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "专业", name = "profession", required = true)
|
|
||||||
@NotEmpty(message = "专业不能为空")
|
|
||||||
private String profession;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "工作年限", name = "workyear", required = true)
|
|
||||||
@NotNull(message = "工作年限不能为空")
|
|
||||||
private Integer workyear;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "考核部门", name = "assessmentDepartment", required = true)
|
|
||||||
@NotEmpty(message = "考核部门不能为空")
|
|
||||||
private String assessmentDepartment;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "考核时间", name = "assessmentTime", required = true)
|
|
||||||
@NotNull(message = "考核时间不能为空")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
|
||||||
private Date assessmentTime;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "考核结果", name = "assessmentResult", required = true)
|
|
||||||
@NotEmpty(message = "考核结果不能为空")
|
|
||||||
private String assessmentResult;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "状态(0-禁用 1-启用)(老项目0启用,1禁用)", name = "state", required = true)
|
|
||||||
@NotEmpty(message = "状态(0-禁用 1-启用)(老项目0启用,1禁用)不能为空")
|
|
||||||
private String state;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,8 +47,7 @@ public class TeacherCertificateAddCmd extends Command {
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date certificateDateStart;
|
private Date certificateDateStart;
|
||||||
|
|
||||||
@ApiModelProperty(value = "证书有效期(结束)", name = "certificateDateEnd", required = true)
|
@ApiModelProperty(value = "证书有效期(结束)", name = "certificateDateEnd")
|
||||||
@NotNull(message = "证书有效期(结束)不能为空")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date certificateDateEnd;
|
private Date certificateDateEnd;
|
||||||
|
|
||||||
|
|
@ -56,8 +55,7 @@ public class TeacherCertificateAddCmd extends Command {
|
||||||
@NotEmpty(message = "证书照片不能为空")
|
@NotEmpty(message = "证书照片不能为空")
|
||||||
private String certificateFilepath;
|
private String certificateFilepath;
|
||||||
|
|
||||||
@ApiModelProperty(value = "企业ID", name = "corpinfoId", required = true)
|
@ApiModelProperty(value = "企业ID", name = "corpinfoId")
|
||||||
@NotNull(message = "企业ID不能为空")
|
|
||||||
private Long corpinfoId;
|
private Long corpinfoId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
package com.zcloud.edu.dto;
|
package com.zcloud.edu.dto;
|
||||||
|
|
||||||
import com.alibaba.cola.dto.PageQuery;
|
import com.alibaba.cola.dto.PageQuery;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-client
|
* web-client
|
||||||
|
|
@ -23,6 +26,9 @@ public class TeacherCertificatePageQry extends PageQuery {
|
||||||
* - `le`: 小于等于比较查询
|
* - `le`: 小于等于比较查询
|
||||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||||
*/
|
*/
|
||||||
private String likeTeacherCertificateId;
|
|
||||||
|
@ApiModelProperty(name = "eqTeacherId", value = "教师id", required = true)
|
||||||
|
@NotEmpty(message = "教师id不能为空")
|
||||||
|
private String eqTeacherId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ public class TeacherCertificateRemoveCmd extends Command {
|
||||||
|
|
||||||
@ApiModelProperty(value = "主键", name = "ids", required = true)
|
@ApiModelProperty(value = "主键", name = "ids", required = true)
|
||||||
@NotNull(message = "主键不能为空")
|
@NotNull(message = "主键不能为空")
|
||||||
|
@Size(min = 1, message = "请选择数据")
|
||||||
private Long[] ids;
|
private Long[] ids;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,8 @@ import java.util.Date;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class TeacherCertificateUpdateCmd extends Command {
|
public class TeacherCertificateUpdateCmd extends Command {
|
||||||
@ApiModelProperty(value = "${column.comment}", name = "id", required = true)
|
@ApiModelProperty(value = "id", name = "id", required = true)
|
||||||
@NotNull(message = "${column.comment}不能为空")
|
@NotNull(message = "id不能为空")
|
||||||
private Long id;
|
private Long id;
|
||||||
@ApiModelProperty(value = "业务主键id", name = "teacherCertificateId", required = true)
|
@ApiModelProperty(value = "业务主键id", name = "teacherCertificateId", required = true)
|
||||||
@NotEmpty(message = "业务主键id不能为空")
|
@NotEmpty(message = "业务主键id不能为空")
|
||||||
|
|
@ -47,8 +47,7 @@ public class TeacherCertificateUpdateCmd extends Command {
|
||||||
@NotNull(message = "证书有效期(开始)不能为空")
|
@NotNull(message = "证书有效期(开始)不能为空")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date certificateDateStart;
|
private Date certificateDateStart;
|
||||||
@ApiModelProperty(value = "证书有效期(结束)", name = "certificateDateEnd", required = true)
|
@ApiModelProperty(value = "证书有效期(结束)", name = "certificateDateEnd")
|
||||||
@NotNull(message = "证书有效期(结束)不能为空")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date certificateDateEnd;
|
private Date certificateDateEnd;
|
||||||
@ApiModelProperty(value = "证书照片", name = "certificateFilepath", required = true)
|
@ApiModelProperty(value = "证书照片", name = "certificateFilepath", required = true)
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
package com.zcloud.edu.dto;
|
package com.zcloud.edu.dto;
|
||||||
|
|
||||||
import com.alibaba.cola.dto.PageQuery;
|
import com.alibaba.cola.dto.PageQuery;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-client
|
* web-client
|
||||||
|
|
@ -23,6 +26,10 @@ public class TeacherListQry extends PageQuery {
|
||||||
* - `le`: 小于等于比较查询
|
* - `le`: 小于等于比较查询
|
||||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||||
*/
|
*/
|
||||||
private String likeTeacherId;
|
private String eqCorpinfoId;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "corpFlag 监管端1,企业端2", value = "corpFlag", required = true)
|
||||||
|
@NotNull(message = "监管/企业标识不能为空")
|
||||||
|
private Integer corpFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,12 @@
|
||||||
package com.zcloud.edu.dto;
|
package com.zcloud.edu.dto;
|
||||||
|
|
||||||
import com.alibaba.cola.dto.PageQuery;
|
import com.alibaba.cola.dto.PageQuery;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-client
|
* web-client
|
||||||
|
|
@ -23,6 +27,17 @@ public class TeacherPageQry extends PageQuery {
|
||||||
* - `le`: 小于等于比较查询
|
* - `le`: 小于等于比较查询
|
||||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||||
*/
|
*/
|
||||||
private String likeTeacherId;
|
@ApiModelProperty(name = "likeTeacherName", value = "教师名称")
|
||||||
|
private String likeTeacherName;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "eqCorpinfoId", value = "企业ID")
|
||||||
|
private Long eqCorpinfoId;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "qualificationType", value = "资格类型")
|
||||||
|
private String qualificationType;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "corpFlag 监管端1,企业端2", value = "corpFlag", required = true)
|
||||||
|
@NotNull(message = "监管/企业标识不能为空")
|
||||||
|
private Integer corpFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ public class TeacherRemoveCmd extends Command {
|
||||||
|
|
||||||
@ApiModelProperty(value = "主键", name = "ids", required = true)
|
@ApiModelProperty(value = "主键", name = "ids", required = true)
|
||||||
@NotNull(message = "主键不能为空")
|
@NotNull(message = "主键不能为空")
|
||||||
|
@Size(min = 1, message = "请选择数据")
|
||||||
private Long[] ids;
|
private Long[] ids;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,48 +26,49 @@ public class TeacherUpdateCmd extends Command {
|
||||||
@ApiModelProperty(value = "教师id", name = "id", required = true)
|
@ApiModelProperty(value = "教师id", name = "id", required = true)
|
||||||
@NotNull(message = "教师id不能为空")
|
@NotNull(message = "教师id不能为空")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@ApiModelProperty(value = "业务主键id", name = "teacherId", required = true)
|
@ApiModelProperty(value = "业务主键id", name = "teacherId", required = true)
|
||||||
@NotEmpty(message = "业务主键id不能为空")
|
@NotEmpty(message = "业务主键id不能为空")
|
||||||
private String teacherId;
|
private String teacherId;
|
||||||
@ApiModelProperty(value = "用户id", name = "userId", required = true)
|
|
||||||
@NotNull(message = "用户id不能为空")
|
|
||||||
private Long userId;
|
|
||||||
@ApiModelProperty(value = "企业ID", name = "corpinfoId", required = true)
|
|
||||||
@NotNull(message = "企业ID不能为空")
|
|
||||||
private Long corpinfoId;
|
|
||||||
@ApiModelProperty(value = "教师姓名", name = "teacherName", required = true)
|
@ApiModelProperty(value = "教师姓名", name = "teacherName", required = true)
|
||||||
@NotEmpty(message = "教师姓名不能为空")
|
@NotEmpty(message = "教师姓名不能为空")
|
||||||
private String teacherName;
|
private String teacherName;
|
||||||
@ApiModelProperty(value = "手机号", name = "phone", required = true)
|
|
||||||
@NotEmpty(message = "手机号不能为空")
|
|
||||||
private String phone;
|
|
||||||
@ApiModelProperty(value = "身份证号", name = "identityNumber", required = true)
|
@ApiModelProperty(value = "身份证号", name = "identityNumber", required = true)
|
||||||
@NotEmpty(message = "身份证号不能为空")
|
@NotEmpty(message = "身份证号不能为空")
|
||||||
private String identityNumber;
|
private String identityNumber;
|
||||||
|
|
||||||
@ApiModelProperty(value = "文化程度", name = "educationLevel", required = true)
|
@ApiModelProperty(value = "文化程度", name = "educationLevel", required = true)
|
||||||
@NotEmpty(message = "文化程度不能为空")
|
@NotEmpty(message = "文化程度不能为空")
|
||||||
private String educationLevel;
|
private String educationLevel;
|
||||||
|
|
||||||
@ApiModelProperty(value = "文化程度名称", name = "educationLevelName", required = true)
|
@ApiModelProperty(value = "文化程度名称", name = "educationLevelName", required = true)
|
||||||
@NotEmpty(message = "文化程度名称不能为空")
|
@NotEmpty(message = "文化程度名称不能为空")
|
||||||
private String educationLevelName;
|
private String educationLevelName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "专业", name = "profession", required = true)
|
@ApiModelProperty(value = "专业", name = "profession", required = true)
|
||||||
@NotEmpty(message = "专业不能为空")
|
@NotEmpty(message = "专业不能为空")
|
||||||
private String profession;
|
private String profession;
|
||||||
|
|
||||||
@ApiModelProperty(value = "工作年限", name = "workyear", required = true)
|
@ApiModelProperty(value = "工作年限", name = "workyear", required = true)
|
||||||
@NotNull(message = "工作年限不能为空")
|
@NotNull(message = "工作年限不能为空")
|
||||||
private Integer workyear;
|
private Integer workyear;
|
||||||
|
|
||||||
@ApiModelProperty(value = "考核部门", name = "assessmentDepartment", required = true)
|
@ApiModelProperty(value = "考核部门", name = "assessmentDepartment", required = true)
|
||||||
@NotEmpty(message = "考核部门不能为空")
|
@NotEmpty(message = "考核部门不能为空")
|
||||||
private String assessmentDepartment;
|
private String assessmentDepartment;
|
||||||
|
|
||||||
@ApiModelProperty(value = "考核时间", name = "assessmentTime", required = true)
|
@ApiModelProperty(value = "考核时间", name = "assessmentTime", required = true)
|
||||||
@NotNull(message = "考核时间不能为空")
|
@NotNull(message = "考核时间不能为空")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date assessmentTime;
|
private Date assessmentTime;
|
||||||
|
|
||||||
@ApiModelProperty(value = "考核结果", name = "assessmentResult", required = true)
|
@ApiModelProperty(value = "考核结果", name = "assessmentResult", required = true)
|
||||||
@NotEmpty(message = "考核结果不能为空")
|
@NotEmpty(message = "考核结果不能为空")
|
||||||
private String assessmentResult;
|
private String assessmentResult;
|
||||||
@ApiModelProperty(value = "状态(0-禁用 1-启用)(老项目0启用,1禁用)", name = "state", required = true)
|
|
||||||
@NotEmpty(message = "状态(0-禁用 1-启用)(老项目0启用,1禁用)不能为空")
|
|
||||||
private String state;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.zcloud.edu.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.Command;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-26 17:04:44
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TeacherUpdateStateCmd extends Command {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "教师id", name = "id", required = true)
|
||||||
|
@NotNull(message = "教师id不能为空")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "教师状态, 启用传1, 禁用传0", name = "state", required = true)
|
||||||
|
@NotNull(message = "教师状态不能为空")
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -21,6 +21,7 @@ public class TrainingTypeRemoveCmd extends Command {
|
||||||
|
|
||||||
@ApiModelProperty(value = "主键", name = "ids", required = true)
|
@ApiModelProperty(value = "主键", name = "ids", required = true)
|
||||||
@NotNull(message = "主键不能为空")
|
@NotNull(message = "主键不能为空")
|
||||||
|
@Size(min = 1, message = "请选择数据")
|
||||||
private Long[] ids;
|
private Long[] ids;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,181 @@
|
||||||
|
package com.zcloud.edu.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.ClientObject;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.zcloud.gbscommon.translateaop.TranslateEunm;
|
||||||
|
import com.zcloud.gbscommon.translateaop.ZCloudTranslate;
|
||||||
|
import com.zcloud.gbscommon.translateaop.ZCloudTranslates;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
*
|
||||||
|
* @Author zhangyue
|
||||||
|
* @Date 2025-11-04 14:07:33
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserAddCmd extends ClientObject {
|
||||||
|
|
||||||
|
//GBS用户id
|
||||||
|
@ApiModelProperty(value = "GBS用户id")
|
||||||
|
private Long id;
|
||||||
|
//业务主键id老系统id
|
||||||
|
@ApiModelProperty(value = "业务主键id老系统id")
|
||||||
|
private String userId;
|
||||||
|
//登录账号
|
||||||
|
@ApiModelProperty(value = "登录账号")
|
||||||
|
private String username;
|
||||||
|
//姓名
|
||||||
|
@ApiModelProperty(value = "姓名")
|
||||||
|
private String name;
|
||||||
|
//企业id
|
||||||
|
@ApiModelProperty(value = "企业id")
|
||||||
|
private Long corpinfoId;
|
||||||
|
@ApiModelProperty(value = "企业名称")
|
||||||
|
private String corpinfoName;
|
||||||
|
//是否主账号1是0否
|
||||||
|
@ApiModelProperty(value = "是否主账号1是0否")
|
||||||
|
private Integer mainCorpFlag;
|
||||||
|
//用户类型,1监管2企业3相关方
|
||||||
|
@ApiModelProperty(value = "用户类型,1监管2企业3相关方")
|
||||||
|
private Integer userType;
|
||||||
|
//部门id
|
||||||
|
@ApiModelProperty(value = "部门id")
|
||||||
|
private Long departmentId;
|
||||||
|
//部门id
|
||||||
|
@ApiModelProperty(value = "部门名称")
|
||||||
|
private String departmentName;
|
||||||
|
//岗位id
|
||||||
|
@ApiModelProperty(value = "岗位id")
|
||||||
|
private Long postId;
|
||||||
|
//岗位id
|
||||||
|
@ApiModelProperty(value = "岗位名称")
|
||||||
|
private String postName;
|
||||||
|
//角色id
|
||||||
|
@ApiModelProperty(value = "角色id")
|
||||||
|
private Long roleId;
|
||||||
|
//邮箱
|
||||||
|
@ApiModelProperty(value = "邮箱")
|
||||||
|
private String email;
|
||||||
|
//人员类型编码(主要负责人等)
|
||||||
|
@ApiModelProperty(value = "人员类型编码(主要负责人等)")
|
||||||
|
private String personnelType;
|
||||||
|
//人员类型翻译
|
||||||
|
@ApiModelProperty(value = "人员类型翻译")
|
||||||
|
private String personnelTypeName;
|
||||||
|
//民族编码问一下有没有组件
|
||||||
|
@ApiModelProperty(value = "民族编码问一下有没有组件")
|
||||||
|
private String nation;
|
||||||
|
//民族名称
|
||||||
|
@ApiModelProperty(value = "民族名称")
|
||||||
|
private String nationName;
|
||||||
|
//身份证号
|
||||||
|
@ApiModelProperty(value = "身份证号")
|
||||||
|
private String userIdCard;
|
||||||
|
//人脸头像url
|
||||||
|
@ApiModelProperty(value = "人脸头像url")
|
||||||
|
private String userAvatarUrl;
|
||||||
|
//现住址
|
||||||
|
@ApiModelProperty(value = "现住址")
|
||||||
|
private String currentAddress;
|
||||||
|
//户口所在地
|
||||||
|
@ApiModelProperty(value = "户口所在地")
|
||||||
|
private String locationAddress;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "职级")
|
||||||
|
private String rankLevel;
|
||||||
|
@ApiModelProperty(value = "职级名称")
|
||||||
|
private String rankLevelName;
|
||||||
|
@ApiModelProperty(value = "手机号")
|
||||||
|
private String phone;
|
||||||
|
//人员在部门中的排序
|
||||||
|
@ApiModelProperty(value = "人员在部门中的排序")
|
||||||
|
private Integer sort;
|
||||||
|
//乐观锁
|
||||||
|
@ApiModelProperty(value = "乐观锁")
|
||||||
|
private Integer version;
|
||||||
|
//创建人
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private Long createId;
|
||||||
|
//创建人姓名
|
||||||
|
@ApiModelProperty(value = "创建人姓名")
|
||||||
|
private String createName;
|
||||||
|
//创建时间
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date createTime;
|
||||||
|
//更新人
|
||||||
|
@ApiModelProperty(value = "更新人")
|
||||||
|
private Long updateId;
|
||||||
|
//修改人名称
|
||||||
|
@ApiModelProperty(value = "修改人名称")
|
||||||
|
private String updateName;
|
||||||
|
//更新时间
|
||||||
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date updateTime;
|
||||||
|
//描述
|
||||||
|
@ApiModelProperty(value = "描述")
|
||||||
|
private String remarks;
|
||||||
|
//是否删除
|
||||||
|
@ApiModelProperty(value = "是否删除")
|
||||||
|
private String deleteEnum;
|
||||||
|
//租户ID
|
||||||
|
@ApiModelProperty(value = "租户ID")
|
||||||
|
private Long tenantId;
|
||||||
|
//机构ID
|
||||||
|
@ApiModelProperty(value = "机构ID")
|
||||||
|
private Long orgId;
|
||||||
|
//环境
|
||||||
|
@ApiModelProperty(value = "环境")
|
||||||
|
private String env;
|
||||||
|
//是否部门领导0否1是
|
||||||
|
@ApiModelProperty(value = "是否部门领导0否1是")
|
||||||
|
private Integer departmentLeaderFlag;
|
||||||
|
//是否分管领导0否1是
|
||||||
|
@ApiModelProperty(value = "是否分管领导0否1是")
|
||||||
|
private Integer deputyLeaderFlag;
|
||||||
|
//文化程度 数据字典
|
||||||
|
@ApiModelProperty(value = "文化程度 数据字典")
|
||||||
|
private String culturalLevel;
|
||||||
|
//文化程度名称
|
||||||
|
@ApiModelProperty(value = "文化程度名称")
|
||||||
|
private String culturalLevelName;
|
||||||
|
//婚姻状态
|
||||||
|
@ApiModelProperty(value = "婚姻状态")
|
||||||
|
private String maritalStatus;
|
||||||
|
//婚姻状态名称
|
||||||
|
@ApiModelProperty(value = "婚姻状态名称")
|
||||||
|
private String maritalStatusName;
|
||||||
|
//政治面貌
|
||||||
|
@ApiModelProperty(value = "政治面貌")
|
||||||
|
private String politicalAffiliation;
|
||||||
|
//政治面貌名称
|
||||||
|
@ApiModelProperty(value = "政治面貌名称")
|
||||||
|
private String politicalAffiliationName;
|
||||||
|
private String mappingName;
|
||||||
|
private String mappingUserName;
|
||||||
|
private String mappingPostName;
|
||||||
|
private String mappingDeptName;
|
||||||
|
// 入职状态
|
||||||
|
@ApiModelProperty(value = "入职状态")
|
||||||
|
private Integer employmentFlag;
|
||||||
|
|
||||||
|
|
||||||
|
// 年龄
|
||||||
|
@ApiModelProperty(value = "年龄")
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
//生日
|
||||||
|
@ApiModelProperty(value = "生日")
|
||||||
|
private String birthday;
|
||||||
|
|
||||||
|
// 性别
|
||||||
|
@ApiModelProperty(value = "性别")
|
||||||
|
private String sex;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.zcloud.edu.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.Command;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:31
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class VideoCoursewareAddCmd extends Command {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "课件id", name = "videoCoursewareId")
|
||||||
|
private String videoCoursewareId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业ID", name = "corpinfoId")
|
||||||
|
private Long corpinfoId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "课件名称", name = "coursewareName", required = true)
|
||||||
|
@NotEmpty(message = "课件名称不能为空")
|
||||||
|
private String coursewareName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "培训类型id", name = "trainingTypeId", required = true)
|
||||||
|
@NotEmpty(message = "培训类型id不能为空")
|
||||||
|
private String trainingTypeId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "教师id", name = "teacherId", required = true)
|
||||||
|
@NotEmpty(message = "教师id不能为空")
|
||||||
|
private String teacherId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "课件文件路径", name = "videoFiles", required = true)
|
||||||
|
@NotEmpty(message = "课件文件路径不能为空")
|
||||||
|
private String videoFiles;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "课件描述", name = "coursewareIntroduce", required = true)
|
||||||
|
@NotEmpty(message = "课件描述不能为空")
|
||||||
|
private String coursewareIntroduce;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "课件时长(视频时间)-分钟", name = "videoTime", required = true)
|
||||||
|
@NotEmpty(message = "课件时长(视频时间)-分钟不能为空")
|
||||||
|
private String videoTime;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.zcloud.edu.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.PageQuery;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:32
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class VideoCoursewareListQry extends PageQuery {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询条件操作前缀,支持以下几种数据库查询操作:
|
||||||
|
* - `like`: 模糊匹配查询,对应SQL的LIKE操作符
|
||||||
|
* - `eq`: 等值查询,对应SQL的=操作符
|
||||||
|
* - `gt`: 大于比较查询
|
||||||
|
* - `lt`: 小于比较查询
|
||||||
|
* - `ge`: 大于等于比较查询
|
||||||
|
* - `le`: 小于等于比较查询
|
||||||
|
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||||
|
*/
|
||||||
|
private String eqCorpinfoId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.zcloud.edu.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.PageQuery;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:32
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class VideoCoursewarePageQry extends PageQuery {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询条件操作前缀,支持以下几种数据库查询操作:
|
||||||
|
* - `like`: 模糊匹配查询,对应SQL的LIKE操作符
|
||||||
|
* - `eq`: 等值查询,对应SQL的=操作符
|
||||||
|
* - `gt`: 大于比较查询
|
||||||
|
* - `lt`: 小于比较查询
|
||||||
|
* - `ge`: 大于等于比较查询
|
||||||
|
* - `le`: 小于等于比较查询
|
||||||
|
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||||
|
*/
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "课件名称")
|
||||||
|
private String likeCoursewareName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "培训类型")
|
||||||
|
private String eqTrainingTypeId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "启用:1, 禁用:0")
|
||||||
|
private Integer eqState;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.zcloud.edu.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.Command;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:33
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class VideoCoursewareRemoveCmd extends Command {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", name = "ids", required = true)
|
||||||
|
@NotNull(message = "主键不能为空")
|
||||||
|
@Size(min = 1, message = "请选择数据")
|
||||||
|
private Long[] ids;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.zcloud.edu.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.Command;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:32
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class VideoCoursewareUpdateCmd extends Command {
|
||||||
|
@ApiModelProperty(value = "id", name = "id", required = true)
|
||||||
|
@NotNull(message = "id不能为空")
|
||||||
|
private Long id;
|
||||||
|
@ApiModelProperty(value = "业务主键id", name = "videoCoursewareId", required = true)
|
||||||
|
@NotEmpty(message = "业务主键id不能为空")
|
||||||
|
private String videoCoursewareId;
|
||||||
|
@ApiModelProperty(value = "企业ID", name = "corpinfoId", required = true)
|
||||||
|
@NotNull(message = "企业ID不能为空")
|
||||||
|
private Long corpinfoId;
|
||||||
|
@ApiModelProperty(value = "课件名称", name = "coursewareName", required = true)
|
||||||
|
@NotEmpty(message = "课件名称不能为空")
|
||||||
|
private String coursewareName;
|
||||||
|
@ApiModelProperty(value = "培训类型id", name = "trainingTypeId", required = true)
|
||||||
|
@NotEmpty(message = "培训类型id不能为空")
|
||||||
|
private String trainingTypeId;
|
||||||
|
@ApiModelProperty(value = "教师id", name = "teacherId", required = true)
|
||||||
|
@NotEmpty(message = "教师id不能为空")
|
||||||
|
private String teacherId;
|
||||||
|
@ApiModelProperty(value = "课件文件路径", name = "videoFiles", required = true)
|
||||||
|
@NotEmpty(message = "课件文件路径不能为空")
|
||||||
|
private String videoFiles;
|
||||||
|
@ApiModelProperty(value = "课件描述", name = "coursewareIntroduce", required = true)
|
||||||
|
@NotEmpty(message = "课件描述不能为空")
|
||||||
|
private String coursewareIntroduce;
|
||||||
|
@ApiModelProperty(value = "课件状态 0未启用, 1-启用", name = "state", required = true)
|
||||||
|
@NotNull(message = "课件状态 0未启用, 1-启用不能为空")
|
||||||
|
private Integer state;
|
||||||
|
@ApiModelProperty(value = "学时,单位分钟", name = "classHour", required = true)
|
||||||
|
@NotEmpty(message = "学时,单位分钟不能为空")
|
||||||
|
private String classHour;
|
||||||
|
@ApiModelProperty(value = "课件时长(视频时间)-分钟", name = "videoTime", required = true)
|
||||||
|
@NotEmpty(message = "课件时长(视频时间)-分钟不能为空")
|
||||||
|
private String videoTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.zcloud.edu.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.Command;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:32
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class VideoCoursewareUpdateStateCmd extends Command {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "id", name = "id", required = true)
|
||||||
|
@NotNull(message = "id不能为空")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "课件状态:启用传1,禁用传0", name = "state", required = true)
|
||||||
|
@NotNull(message = "课件状态不能为空")
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
package com.zcloud.edu.dto.clientobject;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.ClientObject;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class QuestionCO extends ClientObject {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
//业务主键id
|
||||||
|
@ApiModelProperty(value = "业务主键id")
|
||||||
|
|
||||||
|
private String questionId;
|
||||||
|
//课件id
|
||||||
|
@ApiModelProperty(value = "课件id")
|
||||||
|
|
||||||
|
private String videoCoursewareId;
|
||||||
|
//试卷id
|
||||||
|
@ApiModelProperty(value = "试卷id")
|
||||||
|
|
||||||
|
private String examPaperId;
|
||||||
|
//题号
|
||||||
|
@ApiModelProperty(value = "题号")
|
||||||
|
|
||||||
|
private Integer questionNumber;
|
||||||
|
//试题类型(单选题、多选题、判断题、填空题)
|
||||||
|
@ApiModelProperty(value = "试题类型(1单选题、2多选题、3判断题)")
|
||||||
|
|
||||||
|
private String questionType;
|
||||||
|
//题干
|
||||||
|
@ApiModelProperty(value = "题干")
|
||||||
|
|
||||||
|
private String questionDry;
|
||||||
|
//选项A
|
||||||
|
@ApiModelProperty(value = "选项A")
|
||||||
|
|
||||||
|
private String optionA;
|
||||||
|
//选项B
|
||||||
|
@ApiModelProperty(value = "选项B")
|
||||||
|
|
||||||
|
private String optionB;
|
||||||
|
//选项C
|
||||||
|
@ApiModelProperty(value = "选项C")
|
||||||
|
|
||||||
|
private String optionC;
|
||||||
|
//选项D
|
||||||
|
@ApiModelProperty(value = "选项D")
|
||||||
|
|
||||||
|
private String optionD;
|
||||||
|
//答案
|
||||||
|
@ApiModelProperty(value = "答案")
|
||||||
|
|
||||||
|
private String answer;
|
||||||
|
//课件类型(1:视频课件、2:试卷习题)
|
||||||
|
@ApiModelProperty(value = "课件类型(1:视频课件、2:试卷习题)")
|
||||||
|
|
||||||
|
private Integer coursewareType;
|
||||||
|
//答案解析
|
||||||
|
@ApiModelProperty(value = "答案解析")
|
||||||
|
|
||||||
|
private String descr;
|
||||||
|
//分值
|
||||||
|
@ApiModelProperty(value = "分值")
|
||||||
|
|
||||||
|
private String score;
|
||||||
|
}
|
||||||
|
|
@ -1,12 +1,14 @@
|
||||||
package com.zcloud.edu.dto.clientobject;
|
package com.zcloud.edu.dto.clientobject;
|
||||||
|
|
||||||
import com.alibaba.cola.dto.ClientObject;
|
import com.alibaba.cola.dto.ClientObject;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-client
|
* web-client
|
||||||
|
|
@ -74,7 +76,20 @@ public class TeacherCO extends ClientObject {
|
||||||
|
|
||||||
private String assessmentResult;
|
private String assessmentResult;
|
||||||
//状态(0-禁用 1-启用)(老项目0启用,1禁用)
|
//状态(0-禁用 1-启用)(老项目0启用,1禁用)
|
||||||
@ApiModelProperty(value = "状态(0-禁用 1-启用)(老项目0启用,1禁用)")
|
@ApiModelProperty(value = "状态(0-禁用 1-启用)")
|
||||||
|
|
||||||
private String state;
|
private Integer state;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "资质类型名称")
|
||||||
|
private String qualificationTypeNames;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "单位名称")
|
||||||
|
private String corpinfoName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "教师资格证书列表")
|
||||||
|
private List<TeacherCertificateCO> teacherCertificateList;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,73 @@
|
||||||
|
package com.zcloud.edu.dto.clientobject;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.ClientObject;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:31
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class VideoCoursewareCO extends ClientObject {
|
||||||
|
//id
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
//业务主键id
|
||||||
|
@ApiModelProperty(value = "业务主键id")
|
||||||
|
private String videoCoursewareId;
|
||||||
|
|
||||||
|
//企业ID
|
||||||
|
@ApiModelProperty(value = "企业ID")
|
||||||
|
private Long corpinfoId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业名称")
|
||||||
|
private String corpName;
|
||||||
|
|
||||||
|
//课件名称
|
||||||
|
@ApiModelProperty(value = "课件名称")
|
||||||
|
private String coursewareName;
|
||||||
|
|
||||||
|
//培训类型id
|
||||||
|
@ApiModelProperty(value = "培训类型id")
|
||||||
|
private String trainingTypeId;
|
||||||
|
|
||||||
|
//培训类型名称
|
||||||
|
@ApiModelProperty(value = "培训类型名称")
|
||||||
|
private String trainingTypeName;
|
||||||
|
|
||||||
|
//教师id
|
||||||
|
@ApiModelProperty(value = "教师id")
|
||||||
|
private String teacherId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "教师名称")
|
||||||
|
private String teacherName;
|
||||||
|
|
||||||
|
//课件文件路径
|
||||||
|
@ApiModelProperty(value = "课件文件路径")
|
||||||
|
private String videoFiles;
|
||||||
|
|
||||||
|
//课件描述
|
||||||
|
@ApiModelProperty(value = "课件描述")
|
||||||
|
private String coursewareIntroduce;
|
||||||
|
|
||||||
|
//课件状态 0未启用, 1-启用
|
||||||
|
@ApiModelProperty(value = "课件状态 0未启用, 1-启用")
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
|
//学时,单位分钟
|
||||||
|
@ApiModelProperty(value = "学时,单位分钟")
|
||||||
|
private String classHour;
|
||||||
|
|
||||||
|
//课件时长(视频时间)-分钟
|
||||||
|
@ApiModelProperty(value = "课件时长(视频时间)-分钟")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime videoTime;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.zcloud.edu.domain.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试题类型(1单选题、2多选题、3判断题)
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum QuestionTypeEnum {
|
||||||
|
|
||||||
|
CHOICE("1","单选题"),
|
||||||
|
MULTIPLE("2","多选题"),
|
||||||
|
JUDGE("3","判断题"),
|
||||||
|
;
|
||||||
|
private final String code;
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
QuestionTypeEnum(String code, String name) {
|
||||||
|
this.code = code;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.zcloud.edu.domain.gateway;
|
||||||
|
|
||||||
|
import com.zcloud.edu.domain.model.QuestionE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-domain
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:10
|
||||||
|
*/
|
||||||
|
public interface QuestionGateway {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
Boolean add(QuestionE questionE);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
Boolean update(QuestionE questionE);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
Boolean deletedQuestionById(Long id);
|
||||||
|
|
||||||
|
Boolean deletedQuestionByIds(Long[] id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.zcloud.edu.domain.gateway;
|
||||||
|
|
||||||
|
import com.zcloud.edu.domain.model.VideoCoursewareE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-domain
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:32
|
||||||
|
*/
|
||||||
|
public interface VideoCoursewareGateway {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
Boolean add(VideoCoursewareE videoCoursewareE);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
Boolean update(VideoCoursewareE videoCoursewareE);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
Boolean deletedVideoCoursewareById(Long id);
|
||||||
|
|
||||||
|
Boolean deletedVideoCoursewareByIds(Long[] id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,250 @@
|
||||||
|
package com.zcloud.edu.domain.model;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.alibaba.cloud.commons.lang.StringUtils;
|
||||||
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import com.jjb.saas.framework.domain.model.BaseE;
|
||||||
|
import com.zcloud.edu.domain.enums.QuestionTypeEnum;
|
||||||
|
import com.zcloud.gbscommon.excelEntity.QuestionVideoChoiceExcelImportEntity;
|
||||||
|
import com.zcloud.gbscommon.excelEntity.QuestionVideoJudgeExcelImportEntity;
|
||||||
|
import com.zcloud.gbscommon.excelEntity.QuestionVideoMultiselectExcelImportEntity;
|
||||||
|
import com.zcloud.gbscommon.excelEntity.RiskPointExcelImportEntity;
|
||||||
|
import com.zcloud.gbscommon.utils.ExcelUtils;
|
||||||
|
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-domain
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class QuestionE extends BaseE {
|
||||||
|
private Long id;
|
||||||
|
//业务主键id
|
||||||
|
private String questionId;
|
||||||
|
//课件id
|
||||||
|
private String videoCoursewareId;
|
||||||
|
//试卷id
|
||||||
|
private String examPaperId;
|
||||||
|
//题号
|
||||||
|
private Integer questionNumber;
|
||||||
|
//试题类型(单选题、多选题、判断题、填空题)
|
||||||
|
private String questionType;
|
||||||
|
//题干
|
||||||
|
private String questionDry;
|
||||||
|
//选项A
|
||||||
|
private String optionA;
|
||||||
|
//选项B
|
||||||
|
private String optionB;
|
||||||
|
//选项C
|
||||||
|
private String optionC;
|
||||||
|
//选项D
|
||||||
|
private String optionD;
|
||||||
|
//答案
|
||||||
|
private String answer;
|
||||||
|
//课件类型(1:视频课件、2:试卷习题)
|
||||||
|
private Integer coursewareType;
|
||||||
|
//答案解析
|
||||||
|
private String descr;
|
||||||
|
//分值
|
||||||
|
private String score;
|
||||||
|
|
||||||
|
public void checkQuestion(QuestionE questionE) {
|
||||||
|
if (questionE.getCoursewareType() == 1) {
|
||||||
|
// 视频课件
|
||||||
|
if (questionE.getVideoCoursewareId() == null) {
|
||||||
|
throw new RuntimeException("请选择正确的视频课件");
|
||||||
|
}
|
||||||
|
} else if (questionE.getCoursewareType() == 2) {
|
||||||
|
// 试卷习题
|
||||||
|
if (questionE.getExamPaperId() == null) {
|
||||||
|
throw new RuntimeException("请选择正确的试卷");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(questionE.getScore())) {
|
||||||
|
throw new RuntimeException("请填写正确的分值");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException("请选择正确的课件类型");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (questionE.getQuestionType().equals("1")) {
|
||||||
|
// 单选题
|
||||||
|
if (questionE.getOptionA() == null || questionE.getOptionB() == null || questionE.getOptionC() == null || questionE.getOptionD() == null) {
|
||||||
|
throw new RuntimeException("单选题选项不能为空");
|
||||||
|
}
|
||||||
|
} else if (questionE.getQuestionType().equals("2")) {
|
||||||
|
// 多选题
|
||||||
|
if (questionE.getOptionA() == null || questionE.getOptionB() == null || questionE.getOptionC() == null || questionE.getOptionD() == null) {
|
||||||
|
throw new RuntimeException("多选题选项不能为空");
|
||||||
|
}
|
||||||
|
} else if (questionE.getQuestionType().equals("3")) {
|
||||||
|
// 判断题
|
||||||
|
if (questionE.getOptionA() == null || questionE.getOptionB() == null) {
|
||||||
|
throw new RuntimeException("判断题选项不能为空");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<QuestionE> parseImportTemplateData(MultipartFile file, String videoCoursewareId, Integer maxQuestionNumber) {
|
||||||
|
List<QuestionVideoChoiceExcelImportEntity> videoChoiceList = new ArrayList<>();
|
||||||
|
List<QuestionVideoMultiselectExcelImportEntity> videoMultiselectList = new ArrayList<>();
|
||||||
|
List<QuestionVideoJudgeExcelImportEntity> videoJudgeList = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
ExcelUtils.readBatchBySheetAndRow(file, QuestionVideoChoiceExcelImportEntity.class, videoChoiceList, 0, 1);
|
||||||
|
ExcelUtils.readBatchBySheetAndRow(file, QuestionVideoMultiselectExcelImportEntity.class, videoMultiselectList, 1, 1);
|
||||||
|
ExcelUtils.readBatchBySheetAndRow(file, QuestionVideoJudgeExcelImportEntity.class, videoJudgeList, 2, 1);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BizException("文件解析失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 错误消息集合
|
||||||
|
List<String> errList = new ArrayList<>();
|
||||||
|
// 校验
|
||||||
|
if (CollUtil.isNotEmpty(videoChoiceList)) {
|
||||||
|
for (int i = 0; i < videoChoiceList.size(); i++) {
|
||||||
|
QuestionVideoChoiceExcelImportEntity entity = videoChoiceList.get(i);
|
||||||
|
if (entity == null) {
|
||||||
|
errList.add("单选题第" + (i + 2) + "行数据为空");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(entity.getQuestionDry())) {
|
||||||
|
errList.add("单选题第" + (i + 2) + "行单选题目不能为空");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(entity.getOptionA())) {
|
||||||
|
errList.add("单选题第" + (i + 2) + "行单选选项A不能为空");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(entity.getOptionB())) {
|
||||||
|
errList.add("单选题第" + (i + 2) + "行单选选项B不能为空");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(entity.getOptionC())) {
|
||||||
|
errList.add("单选题第" + (i + 2) + "行单选选项C不能为空");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(entity.getOptionD())) {
|
||||||
|
errList.add("单选题第" + (i + 2) + "行单选选项D不能为空");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(entity.getAnswer())) {
|
||||||
|
errList.add("单选题第" + (i + 2) + "行单选答案不能为空");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(entity.getDescr())) {
|
||||||
|
errList.add("单选题第" + (i + 2) + "行答案解析不能为空");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(videoMultiselectList)) {
|
||||||
|
for (int i = 0; i < videoMultiselectList.size(); i++) {
|
||||||
|
QuestionVideoMultiselectExcelImportEntity entity = videoMultiselectList.get(i);
|
||||||
|
if (entity == null) {
|
||||||
|
errList.add("多选题第" + (i + 2) + "行数据为空");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(entity.getQuestionDry())) {
|
||||||
|
errList.add("多选题第" + (i + 2) + "行多选题目不能为空");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(entity.getOptionA())) {
|
||||||
|
errList.add("多选题第" + (i + 2) + "行多选选项A不能为空");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(entity.getOptionB())) {
|
||||||
|
errList.add("多选题第" + (i + 2) + "行多选选项B不能为空");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(entity.getOptionC())) {
|
||||||
|
errList.add("多选题第" + (i + 2) + "行多选选项C不能为空");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(entity.getOptionD())) {
|
||||||
|
errList.add("多选题第" + (i + 2) + "行多选选项D不能为空");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(entity.getAnswer())) {
|
||||||
|
errList.add("多选题第" + (i + 2) + "行多选答案不能为空");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(entity.getDescr())) {
|
||||||
|
errList.add("多选题第" + (i + 2) + "行答案解析不能为空");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(videoJudgeList)) {
|
||||||
|
for (int i = 0; i < videoJudgeList.size(); i++) {
|
||||||
|
QuestionVideoJudgeExcelImportEntity entity = videoJudgeList.get(i);
|
||||||
|
if (entity == null) {
|
||||||
|
errList.add("判断题第" + (i + 2) + "行数据为空");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(entity.getQuestionDry())) {
|
||||||
|
errList.add("判断题第" + (i + 2) + "行判断题目不能为空");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(entity.getAnswer())) {
|
||||||
|
errList.add("判断题第" + (i + 2) + "行判断答案不能为空");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(entity.getDescr())) {
|
||||||
|
errList.add("判断题第" + (i + 2) + "行答案解析不能为空");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CollUtil.isNotEmpty(errList)) {
|
||||||
|
throw new BizException("导入信息有误,请检查后重新导入。错误信息:" + String.join("", errList));
|
||||||
|
}
|
||||||
|
|
||||||
|
Integer questionNumber = maxQuestionNumber + 1;
|
||||||
|
// 赋值
|
||||||
|
List<QuestionE> questionEList = new ArrayList<>();
|
||||||
|
if (CollUtil.isNotEmpty(videoChoiceList)) {
|
||||||
|
for (QuestionVideoChoiceExcelImportEntity entity : videoChoiceList) {
|
||||||
|
QuestionE questionE = new QuestionE();
|
||||||
|
questionE.setQuestionId(UuidUtil.get32UUID());
|
||||||
|
questionE.setVideoCoursewareId(videoCoursewareId);
|
||||||
|
questionE.setQuestionNumber(questionNumber++);
|
||||||
|
questionE.setQuestionType(QuestionTypeEnum.CHOICE.getCode());
|
||||||
|
questionE.setQuestionDry(entity.getQuestionDry());
|
||||||
|
questionE.setOptionA(entity.getOptionA());
|
||||||
|
questionE.setOptionB(entity.getOptionB());
|
||||||
|
questionE.setOptionC(entity.getOptionC());
|
||||||
|
questionE.setOptionD(entity.getOptionD());
|
||||||
|
questionE.setAnswer(entity.getAnswer());
|
||||||
|
questionE.setDescr(entity.getDescr());
|
||||||
|
questionE.setCoursewareType(1);
|
||||||
|
questionEList.add(questionE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(videoMultiselectList)) {
|
||||||
|
for (QuestionVideoMultiselectExcelImportEntity entity : videoMultiselectList) {
|
||||||
|
QuestionE questionE = new QuestionE();
|
||||||
|
questionE.setQuestionId(UuidUtil.get32UUID());
|
||||||
|
questionE.setVideoCoursewareId(videoCoursewareId);
|
||||||
|
questionE.setQuestionNumber(questionNumber++);
|
||||||
|
questionE.setQuestionType(QuestionTypeEnum.MULTIPLE.getCode());
|
||||||
|
questionE.setQuestionDry(entity.getQuestionDry());
|
||||||
|
questionE.setOptionA(entity.getOptionA());
|
||||||
|
questionE.setOptionB(entity.getOptionB());
|
||||||
|
questionE.setOptionC(entity.getOptionC());
|
||||||
|
questionE.setOptionD(entity.getOptionD());
|
||||||
|
questionE.setAnswer(entity.getAnswer());
|
||||||
|
questionE.setDescr(entity.getDescr());
|
||||||
|
questionE.setCoursewareType(1);
|
||||||
|
questionEList.add(questionE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(videoJudgeList)) {
|
||||||
|
for (QuestionVideoJudgeExcelImportEntity entity : videoJudgeList) {
|
||||||
|
QuestionE questionE = new QuestionE();
|
||||||
|
questionE.setQuestionId(UuidUtil.get32UUID());
|
||||||
|
questionE.setVideoCoursewareId(videoCoursewareId);
|
||||||
|
questionE.setQuestionNumber(questionNumber++);
|
||||||
|
questionE.setQuestionType(QuestionTypeEnum.JUDGE.getCode());
|
||||||
|
questionE.setQuestionDry(entity.getQuestionDry());
|
||||||
|
questionE.setAnswer(entity.getAnswer());
|
||||||
|
questionE.setDescr(entity.getDescr());
|
||||||
|
questionE.setCoursewareType(1);
|
||||||
|
questionEList.add(questionE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return questionEList;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,14 @@
|
||||||
package com.zcloud.edu.domain.model;
|
package com.zcloud.edu.domain.model;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.alibaba.cola.exception.BizException;
|
||||||
import com.jjb.saas.framework.domain.model.BaseE;
|
import com.jjb.saas.framework.domain.model.BaseE;
|
||||||
|
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-domain
|
* web-domain
|
||||||
|
|
@ -42,6 +47,44 @@ public class TeacherE extends BaseE {
|
||||||
//考核结果
|
//考核结果
|
||||||
private String assessmentResult;
|
private String assessmentResult;
|
||||||
//状态(0-禁用 1-启用)(老项目0启用,1禁用)
|
//状态(0-禁用 1-启用)(老项目0启用,1禁用)
|
||||||
private String state;
|
private Integer state;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户数据转换成教师数据
|
||||||
|
*/
|
||||||
|
public List<TeacherE> convertFromUserList(List<UserAddE> userList) {
|
||||||
|
|
||||||
|
if (CollUtil.isEmpty(userList)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<TeacherE> teacherList = new ArrayList<>();
|
||||||
|
for (UserAddE userAddE : userList) {
|
||||||
|
TeacherE teacher = new TeacherE();
|
||||||
|
teacher.setTeacherId(UuidUtil.get32UUID());
|
||||||
|
teacher.setUserId(userAddE.getId());
|
||||||
|
teacher.setCorpinfoId(userAddE.getCorpinfoId());
|
||||||
|
teacher.setTeacherName(userAddE.getName());
|
||||||
|
teacher.setPhone(userAddE.getPhone());
|
||||||
|
teacher.setIdentityNumber(userAddE.getUserIdCard());
|
||||||
|
teacher.setEducationLevel(userAddE.getCulturalLevel());
|
||||||
|
teacher.setEducationLevelName(userAddE.getCulturalLevelName());
|
||||||
|
// 默认启用
|
||||||
|
teacher.setState(1);
|
||||||
|
teacherList.add(teacher);
|
||||||
|
}
|
||||||
|
|
||||||
|
return teacherList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 教师是否被使用
|
||||||
|
*/
|
||||||
|
public void checkList(int size){
|
||||||
|
if(size > 0){
|
||||||
|
throw new BizException("该教师有负责的课件,无法删除。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,178 @@
|
||||||
|
package com.zcloud.edu.domain.model;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.ClientObject;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
*
|
||||||
|
* @Author zhangyue
|
||||||
|
* @Date 2025-11-04 14:07:33
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class UserAddE extends ClientObject {
|
||||||
|
|
||||||
|
//GBS用户id
|
||||||
|
@ApiModelProperty(value = "GBS用户id")
|
||||||
|
private Long id;
|
||||||
|
//业务主键id老系统id
|
||||||
|
@ApiModelProperty(value = "业务主键id老系统id")
|
||||||
|
private String userId;
|
||||||
|
//登录账号
|
||||||
|
@ApiModelProperty(value = "登录账号")
|
||||||
|
private String username;
|
||||||
|
//姓名
|
||||||
|
@ApiModelProperty(value = "姓名")
|
||||||
|
private String name;
|
||||||
|
//企业id
|
||||||
|
@ApiModelProperty(value = "企业id")
|
||||||
|
private Long corpinfoId;
|
||||||
|
@ApiModelProperty(value = "企业名称")
|
||||||
|
private String corpinfoName;
|
||||||
|
//是否主账号1是0否
|
||||||
|
@ApiModelProperty(value = "是否主账号1是0否")
|
||||||
|
private Integer mainCorpFlag;
|
||||||
|
//用户类型,1监管2企业3相关方
|
||||||
|
@ApiModelProperty(value = "用户类型,1监管2企业3相关方")
|
||||||
|
private Integer userType;
|
||||||
|
//部门id
|
||||||
|
@ApiModelProperty(value = "部门id")
|
||||||
|
private Long departmentId;
|
||||||
|
//部门id
|
||||||
|
@ApiModelProperty(value = "部门名称")
|
||||||
|
private String departmentName;
|
||||||
|
//岗位id
|
||||||
|
@ApiModelProperty(value = "岗位id")
|
||||||
|
private Long postId;
|
||||||
|
//岗位id
|
||||||
|
@ApiModelProperty(value = "岗位名称")
|
||||||
|
private String postName;
|
||||||
|
//角色id
|
||||||
|
@ApiModelProperty(value = "角色id")
|
||||||
|
private Long roleId;
|
||||||
|
//邮箱
|
||||||
|
@ApiModelProperty(value = "邮箱")
|
||||||
|
private String email;
|
||||||
|
//人员类型编码(主要负责人等)
|
||||||
|
@ApiModelProperty(value = "人员类型编码(主要负责人等)")
|
||||||
|
private String personnelType;
|
||||||
|
//人员类型翻译
|
||||||
|
@ApiModelProperty(value = "人员类型翻译")
|
||||||
|
private String personnelTypeName;
|
||||||
|
//民族编码问一下有没有组件
|
||||||
|
@ApiModelProperty(value = "民族编码问一下有没有组件")
|
||||||
|
private String nation;
|
||||||
|
//民族名称
|
||||||
|
@ApiModelProperty(value = "民族名称")
|
||||||
|
private String nationName;
|
||||||
|
//身份证号
|
||||||
|
@ApiModelProperty(value = "身份证号")
|
||||||
|
private String userIdCard;
|
||||||
|
//人脸头像url
|
||||||
|
@ApiModelProperty(value = "人脸头像url")
|
||||||
|
private String userAvatarUrl;
|
||||||
|
//现住址
|
||||||
|
@ApiModelProperty(value = "现住址")
|
||||||
|
private String currentAddress;
|
||||||
|
//户口所在地
|
||||||
|
@ApiModelProperty(value = "户口所在地")
|
||||||
|
private String locationAddress;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "职级")
|
||||||
|
private String rankLevel;
|
||||||
|
@ApiModelProperty(value = "职级名称")
|
||||||
|
private String rankLevelName;
|
||||||
|
@ApiModelProperty(value = "手机号")
|
||||||
|
private String phone;
|
||||||
|
//人员在部门中的排序
|
||||||
|
@ApiModelProperty(value = "人员在部门中的排序")
|
||||||
|
private Integer sort;
|
||||||
|
//乐观锁
|
||||||
|
@ApiModelProperty(value = "乐观锁")
|
||||||
|
private Integer version;
|
||||||
|
//创建人
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private Long createId;
|
||||||
|
//创建人姓名
|
||||||
|
@ApiModelProperty(value = "创建人姓名")
|
||||||
|
private String createName;
|
||||||
|
//创建时间
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date createTime;
|
||||||
|
//更新人
|
||||||
|
@ApiModelProperty(value = "更新人")
|
||||||
|
private Long updateId;
|
||||||
|
//修改人名称
|
||||||
|
@ApiModelProperty(value = "修改人名称")
|
||||||
|
private String updateName;
|
||||||
|
//更新时间
|
||||||
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date updateTime;
|
||||||
|
//描述
|
||||||
|
@ApiModelProperty(value = "描述")
|
||||||
|
private String remarks;
|
||||||
|
//是否删除
|
||||||
|
@ApiModelProperty(value = "是否删除")
|
||||||
|
private String deleteEnum;
|
||||||
|
//租户ID
|
||||||
|
@ApiModelProperty(value = "租户ID")
|
||||||
|
private Long tenantId;
|
||||||
|
//机构ID
|
||||||
|
@ApiModelProperty(value = "机构ID")
|
||||||
|
private Long orgId;
|
||||||
|
//环境
|
||||||
|
@ApiModelProperty(value = "环境")
|
||||||
|
private String env;
|
||||||
|
//是否部门领导0否1是
|
||||||
|
@ApiModelProperty(value = "是否部门领导0否1是")
|
||||||
|
private Integer departmentLeaderFlag;
|
||||||
|
//是否分管领导0否1是
|
||||||
|
@ApiModelProperty(value = "是否分管领导0否1是")
|
||||||
|
private Integer deputyLeaderFlag;
|
||||||
|
//文化程度 数据字典
|
||||||
|
@ApiModelProperty(value = "文化程度 数据字典")
|
||||||
|
private String culturalLevel;
|
||||||
|
//文化程度名称
|
||||||
|
@ApiModelProperty(value = "文化程度名称")
|
||||||
|
private String culturalLevelName;
|
||||||
|
//婚姻状态
|
||||||
|
@ApiModelProperty(value = "婚姻状态")
|
||||||
|
private String maritalStatus;
|
||||||
|
//婚姻状态名称
|
||||||
|
@ApiModelProperty(value = "婚姻状态名称")
|
||||||
|
private String maritalStatusName;
|
||||||
|
//政治面貌
|
||||||
|
@ApiModelProperty(value = "政治面貌")
|
||||||
|
private String politicalAffiliation;
|
||||||
|
//政治面貌名称
|
||||||
|
@ApiModelProperty(value = "政治面貌名称")
|
||||||
|
private String politicalAffiliationName;
|
||||||
|
private String mappingName;
|
||||||
|
private String mappingUserName;
|
||||||
|
private String mappingPostName;
|
||||||
|
private String mappingDeptName;
|
||||||
|
// 入职状态
|
||||||
|
@ApiModelProperty(value = "入职状态")
|
||||||
|
private Integer employmentFlag;
|
||||||
|
|
||||||
|
|
||||||
|
// 年龄
|
||||||
|
@ApiModelProperty(value = "年龄")
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
//生日
|
||||||
|
@ApiModelProperty(value = "生日")
|
||||||
|
private String birthday;
|
||||||
|
|
||||||
|
// 性别
|
||||||
|
@ApiModelProperty(value = "性别")
|
||||||
|
private String sex;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.zcloud.edu.domain.model;
|
||||||
|
|
||||||
|
import com.jjb.saas.framework.domain.model.BaseE;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-domain
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:32
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class VideoCoursewareE extends BaseE {
|
||||||
|
//id
|
||||||
|
private Long id;
|
||||||
|
//业务主键id
|
||||||
|
private String videoCoursewareId;
|
||||||
|
//企业ID
|
||||||
|
private Long corpinfoId;
|
||||||
|
//课件名称
|
||||||
|
private String coursewareName;
|
||||||
|
//培训类型id
|
||||||
|
private String trainingTypeId;
|
||||||
|
//教师id
|
||||||
|
private String teacherId;
|
||||||
|
//课件文件路径
|
||||||
|
private String videoFiles;
|
||||||
|
//课件描述
|
||||||
|
private String coursewareIntroduce;
|
||||||
|
//课件状态 0未启用, 1-启用
|
||||||
|
private Integer state;
|
||||||
|
//学时,单位分钟
|
||||||
|
private String classHour;
|
||||||
|
//课件时长(视频时间)-分钟
|
||||||
|
private String videoTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,67 @@
|
||||||
|
package com.zcloud.edu.gatewayimpl;
|
||||||
|
|
||||||
|
import com.alibaba.cloud.commons.lang.StringUtils;
|
||||||
|
import com.zcloud.edu.domain.gateway.QuestionGateway;
|
||||||
|
import com.zcloud.edu.domain.model.QuestionE;
|
||||||
|
import com.zcloud.edu.persistence.dataobject.QuestionDO;
|
||||||
|
import com.zcloud.edu.persistence.repository.QuestionRepository;
|
||||||
|
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class QuestionGatewayImpl implements QuestionGateway {
|
||||||
|
private final QuestionRepository questionRepository;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean add(QuestionE questionE) {
|
||||||
|
QuestionDO d = new QuestionDO();
|
||||||
|
BeanUtils.copyProperties(questionE, d);
|
||||||
|
|
||||||
|
if(StringUtils.isEmpty(d.getQuestionId())){
|
||||||
|
d.setQuestionId(UuidUtil.get32UUID());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 题号
|
||||||
|
Integer maxQuestionNumber = 0;
|
||||||
|
if(d.getCoursewareType() == 1){
|
||||||
|
maxQuestionNumber = questionRepository.getMaxQuestionNumber(d.getVideoCoursewareId());
|
||||||
|
}else if(d.getCoursewareType() == 2){
|
||||||
|
// TODO 试卷类型
|
||||||
|
}
|
||||||
|
d.setQuestionNumber(maxQuestionNumber + 1);
|
||||||
|
questionRepository.save(d);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean update(QuestionE questionE) {
|
||||||
|
QuestionDO d = new QuestionDO();
|
||||||
|
BeanUtils.copyProperties(questionE, d);
|
||||||
|
questionRepository.updateById(d);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deletedQuestionById(Long id) {
|
||||||
|
return questionRepository.removeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deletedQuestionByIds(Long[] ids) {
|
||||||
|
return questionRepository.removeByIds(Arrays.asList(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,13 +1,17 @@
|
||||||
package com.zcloud.edu.gatewayimpl;
|
package com.zcloud.edu.gatewayimpl;
|
||||||
|
|
||||||
|
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||||
import com.zcloud.edu.domain.gateway.TeacherCertificateGateway;
|
import com.zcloud.edu.domain.gateway.TeacherCertificateGateway;
|
||||||
import com.zcloud.edu.domain.model.TeacherCertificateE;
|
import com.zcloud.edu.domain.model.TeacherCertificateE;
|
||||||
import com.zcloud.edu.persistence.dataobject.TeacherCertificateDO;
|
import com.zcloud.edu.persistence.dataobject.TeacherCertificateDO;
|
||||||
import com.zcloud.edu.persistence.repository.TeacherCertificateRepository;
|
import com.zcloud.edu.persistence.repository.TeacherCertificateRepository;
|
||||||
|
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -25,6 +29,12 @@ public class TeacherCertificateGatewayImpl implements TeacherCertificateGateway
|
||||||
public Boolean add(TeacherCertificateE teacherCertificateE) {
|
public Boolean add(TeacherCertificateE teacherCertificateE) {
|
||||||
TeacherCertificateDO d = new TeacherCertificateDO();
|
TeacherCertificateDO d = new TeacherCertificateDO();
|
||||||
BeanUtils.copyProperties(teacherCertificateE, d);
|
BeanUtils.copyProperties(teacherCertificateE, d);
|
||||||
|
if(StringUtils.isEmpty(d.getTeacherCertificateId())){
|
||||||
|
d.setTeacherCertificateId(UuidUtil.get32UUID());
|
||||||
|
}
|
||||||
|
if(d.getCorpinfoId() == null){
|
||||||
|
d.setCorpinfoId(AuthContext.getTenantId());
|
||||||
|
}
|
||||||
teacherCertificateRepository.save(d);
|
teacherCertificateRepository.save(d);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -44,7 +54,7 @@ public class TeacherCertificateGatewayImpl implements TeacherCertificateGateway
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean deletedTeacherCertificateByIds(Long[] ids) {
|
public Boolean deletedTeacherCertificateByIds(Long[] ids) {
|
||||||
return teacherCertificateRepository.removeByIds(Collections.singletonList(ids));
|
return teacherCertificateRepository.removeByIds(Arrays.asList(ids));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import lombok.AllArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -44,7 +45,7 @@ public class TeacherGatewayImpl implements TeacherGateway {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean deletedTeacherByIds(Long[] ids) {
|
public Boolean deletedTeacherByIds(Long[] ids) {
|
||||||
return teacherRepository.removeByIds(Collections.singletonList(ids));
|
return teacherRepository.removeByIds(Arrays.asList(ids));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,86 @@
|
||||||
|
package com.zcloud.edu.gatewayimpl;
|
||||||
|
|
||||||
|
import com.alibaba.cloud.commons.lang.StringUtils;
|
||||||
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||||
|
import com.zcloud.edu.domain.gateway.VideoCoursewareGateway;
|
||||||
|
import com.zcloud.edu.domain.model.VideoCoursewareE;
|
||||||
|
import com.zcloud.edu.persistence.dataobject.VideoCoursewareDO;
|
||||||
|
import com.zcloud.edu.persistence.repository.VideoCoursewareRepository;
|
||||||
|
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:32
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class VideoCoursewareGatewayImpl implements VideoCoursewareGateway {
|
||||||
|
private final VideoCoursewareRepository videoCoursewareRepository;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean add(VideoCoursewareE videoCoursewareE) {
|
||||||
|
VideoCoursewareDO d = new VideoCoursewareDO();
|
||||||
|
BeanUtils.copyProperties(videoCoursewareE, d);
|
||||||
|
|
||||||
|
if(StringUtils.isEmpty(d.getVideoCoursewareId())){
|
||||||
|
d.setVideoCoursewareId(UuidUtil.get32UUID());
|
||||||
|
}
|
||||||
|
if(d.getCorpinfoId() == null){
|
||||||
|
d.setCorpinfoId(AuthContext.getTenantId());
|
||||||
|
}
|
||||||
|
d.setState(1);
|
||||||
|
// 计算课时
|
||||||
|
if(StringUtils.isNotEmpty(d.getVideoTime())){
|
||||||
|
String videoTime = d.getVideoTime();
|
||||||
|
try {
|
||||||
|
// 将字符串转换为数字(分钟)
|
||||||
|
double minutes = Double.parseDouble(videoTime);
|
||||||
|
|
||||||
|
// 除以45,每45分钟为一课时
|
||||||
|
double classHours = minutes / 45.0;
|
||||||
|
|
||||||
|
// 四舍五入保留两位小数
|
||||||
|
BigDecimal result = new BigDecimal(classHours)
|
||||||
|
.setScale(2, RoundingMode.HALF_UP);
|
||||||
|
|
||||||
|
// 使用结果
|
||||||
|
d.setClassHour(result.toString());
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
// 处理数字格式错误
|
||||||
|
throw new BizException("视频时间格式错误: " + videoTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
videoCoursewareRepository.save(d);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean update(VideoCoursewareE videoCoursewareE) {
|
||||||
|
VideoCoursewareDO d = new VideoCoursewareDO();
|
||||||
|
BeanUtils.copyProperties(videoCoursewareE, d);
|
||||||
|
videoCoursewareRepository.updateById(d);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deletedVideoCoursewareById(Long id) {
|
||||||
|
return videoCoursewareRepository.removeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deletedVideoCoursewareByIds(Long[] ids) {
|
||||||
|
return videoCoursewareRepository.removeByIds(Collections.singletonList(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
package com.zcloud.edu.persistence.dataobject;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||||
|
import lombok.Data;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("question")
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class QuestionDO extends BaseDO {
|
||||||
|
//业务主键id
|
||||||
|
@ApiModelProperty(value = "业务主键id")
|
||||||
|
private String questionId;
|
||||||
|
//课件id
|
||||||
|
@ApiModelProperty(value = "课件id")
|
||||||
|
private String videoCoursewareId;
|
||||||
|
//试卷id
|
||||||
|
@ApiModelProperty(value = "试卷id")
|
||||||
|
private String examPaperId;
|
||||||
|
//题号
|
||||||
|
@ApiModelProperty(value = "题号")
|
||||||
|
private Integer questionNumber;
|
||||||
|
//试题类型(单选题、多选题、判断题、填空题)
|
||||||
|
@ApiModelProperty(value = "试题类型(1单选题、2多选题、3判断题)")
|
||||||
|
private String questionType;
|
||||||
|
//题干
|
||||||
|
@ApiModelProperty(value = "题干")
|
||||||
|
private String questionDry;
|
||||||
|
//选项A
|
||||||
|
@ApiModelProperty(value = "选项A")
|
||||||
|
private String optionA;
|
||||||
|
//选项B
|
||||||
|
@ApiModelProperty(value = "选项B")
|
||||||
|
private String optionB;
|
||||||
|
//选项C
|
||||||
|
@ApiModelProperty(value = "选项C")
|
||||||
|
private String optionC;
|
||||||
|
//选项D
|
||||||
|
@ApiModelProperty(value = "选项D")
|
||||||
|
private String optionD;
|
||||||
|
//答案
|
||||||
|
@ApiModelProperty(value = "答案")
|
||||||
|
private String answer;
|
||||||
|
//课件类型(1:视频课件、2:试卷习题)
|
||||||
|
@ApiModelProperty(value = "课件类型(1:视频课件、2:试卷习题)")
|
||||||
|
private Integer coursewareType;
|
||||||
|
//答案解析
|
||||||
|
@ApiModelProperty(value = "答案解析")
|
||||||
|
private String descr;
|
||||||
|
//分值
|
||||||
|
@ApiModelProperty(value = "分值")
|
||||||
|
private String score;
|
||||||
|
|
||||||
|
public QuestionDO(String questionId) {
|
||||||
|
this.questionId = questionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -29,6 +29,9 @@ public class TeacherDO extends BaseDO {
|
||||||
//企业ID
|
//企业ID
|
||||||
@ApiModelProperty(value = "企业ID")
|
@ApiModelProperty(value = "企业ID")
|
||||||
private Long corpinfoId;
|
private Long corpinfoId;
|
||||||
|
@ApiModelProperty(value = "单位名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String corpinfoName;
|
||||||
//教师姓名
|
//教师姓名
|
||||||
@ApiModelProperty(value = "教师姓名")
|
@ApiModelProperty(value = "教师姓名")
|
||||||
private String teacherName;
|
private String teacherName;
|
||||||
|
|
@ -61,7 +64,11 @@ public class TeacherDO extends BaseDO {
|
||||||
private String assessmentResult;
|
private String assessmentResult;
|
||||||
//状态(0-禁用 1-启用)(老项目0启用,1禁用)
|
//状态(0-禁用 1-启用)(老项目0启用,1禁用)
|
||||||
@ApiModelProperty(value = "状态(0-禁用 1-启用)(老项目0启用,1禁用)")
|
@ApiModelProperty(value = "状态(0-禁用 1-启用)(老项目0启用,1禁用)")
|
||||||
private String state;
|
private Integer state;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "资质类型名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String qualificationTypeNames;
|
||||||
|
|
||||||
public TeacherDO(String teacherId) {
|
public TeacherDO(String teacherId) {
|
||||||
this.teacherId = teacherId;
|
this.teacherId = teacherId;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.zcloud.edu.persistence.dataobject;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||||
|
import lombok.Data;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:32
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("video_courseware")
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class VideoCoursewareDO extends BaseDO {
|
||||||
|
//业务主键id
|
||||||
|
@ApiModelProperty(value = "业务主键id")
|
||||||
|
private String videoCoursewareId;
|
||||||
|
//企业ID
|
||||||
|
@ApiModelProperty(value = "企业ID")
|
||||||
|
private Long corpinfoId;
|
||||||
|
private String corpName;
|
||||||
|
//课件名称
|
||||||
|
@ApiModelProperty(value = "课件名称")
|
||||||
|
private String coursewareName;
|
||||||
|
//培训类型id
|
||||||
|
@ApiModelProperty(value = "培训类型id")
|
||||||
|
private String trainingTypeId;
|
||||||
|
//培训类型名称
|
||||||
|
private String trainingTypeName;
|
||||||
|
//教师id
|
||||||
|
@ApiModelProperty(value = "教师id")
|
||||||
|
private String teacherId;
|
||||||
|
private String teacherName;
|
||||||
|
//课件文件路径
|
||||||
|
@ApiModelProperty(value = "课件文件路径")
|
||||||
|
private String videoFiles;
|
||||||
|
//课件描述
|
||||||
|
@ApiModelProperty(value = "课件描述")
|
||||||
|
private String coursewareIntroduce;
|
||||||
|
//课件状态 0未启用, 1-启用
|
||||||
|
@ApiModelProperty(value = "课件状态 0未启用, 1-启用")
|
||||||
|
private Integer state;
|
||||||
|
//学时,单位分钟
|
||||||
|
@ApiModelProperty(value = "学时,单位分钟")
|
||||||
|
private String classHour;
|
||||||
|
//课件时长(视频时间)-分钟
|
||||||
|
@ApiModelProperty(value = "课件时长(视频时间)-分钟")
|
||||||
|
private String videoTime;
|
||||||
|
|
||||||
|
public VideoCoursewareDO(String videoCoursewareId) {
|
||||||
|
this.videoCoursewareId = videoCoursewareId;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.zcloud.edu.persistence.mapper;
|
||||||
|
|
||||||
|
import com.zcloud.edu.persistence.dataobject.QuestionDO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:10
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface QuestionMapper extends BaseMapper<QuestionDO> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,8 +1,14 @@
|
||||||
package com.zcloud.edu.persistence.mapper;
|
package com.zcloud.edu.persistence.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.zcloud.edu.persistence.dataobject.TeacherDO;
|
import com.zcloud.edu.persistence.dataobject.TeacherDO;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-infrastructure
|
* web-infrastructure
|
||||||
|
|
@ -13,5 +19,10 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface TeacherMapper extends BaseMapper<TeacherDO> {
|
public interface TeacherMapper extends BaseMapper<TeacherDO> {
|
||||||
|
|
||||||
|
IPage<TeacherDO> getTeacherPage(IPage<TeacherDO> page, Map<String, Object> params);
|
||||||
|
|
||||||
|
List<TeacherDO> getTeacherList(@Param("ew") QueryWrapper<TeacherDO> queryWrapper);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.zcloud.edu.persistence.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.zcloud.edu.persistence.dataobject.VideoCoursewareDO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:32
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface VideoCoursewareMapper extends BaseMapper<VideoCoursewareDO> {
|
||||||
|
|
||||||
|
VideoCoursewareDO getInfoById(@Param("id") Long id);
|
||||||
|
|
||||||
|
IPage<VideoCoursewareDO> getVideoCoursewarePage(IPage<VideoCoursewareDO> page, @Param("ew") QueryWrapper<VideoCoursewareDO> queryWrapper);
|
||||||
|
|
||||||
|
List<VideoCoursewareDO> getVideoCoursewareList(@Param("ew") QueryWrapper<VideoCoursewareDO> queryWrapper);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.zcloud.edu.persistence.repository;
|
||||||
|
|
||||||
|
import com.zcloud.edu.persistence.dataobject.QuestionDO;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.jjb.saas.framework.repository.repo.BaseRepository;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:11
|
||||||
|
*/
|
||||||
|
public interface QuestionRepository extends BaseRepository<QuestionDO> {
|
||||||
|
|
||||||
|
PageResponse<QuestionDO> listPage(Map<String, Object> params);
|
||||||
|
|
||||||
|
List<QuestionDO> list(Map<String, Object> params);
|
||||||
|
|
||||||
|
Integer getMaxQuestionNumber(String videoCoursewareId);
|
||||||
|
|
||||||
|
SingleResponse<QuestionDO> getInfoById(Long id);
|
||||||
|
|
||||||
|
boolean saveBatch(List<QuestionDO> list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -20,6 +20,12 @@ public interface TeacherCertificateRepository extends BaseRepository<TeacherCert
|
||||||
|
|
||||||
List<TeacherCertificateDO> list(Map<String, Object> params);
|
List<TeacherCertificateDO> list(Map<String, Object> params);
|
||||||
|
|
||||||
|
List<TeacherCertificateDO> listByTeacherId(String teacherId);
|
||||||
|
|
||||||
SingleResponse<TeacherCertificateDO> getInfoById(Long id);
|
SingleResponse<TeacherCertificateDO> getInfoById(Long id);
|
||||||
|
|
||||||
|
boolean removeByTeacherId(String teacherId);
|
||||||
|
|
||||||
|
boolean removeByTeacherIds(List<String> teacherIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ public interface TeacherRepository extends BaseRepository<TeacherDO> {
|
||||||
|
|
||||||
List<TeacherDO> list(Map<String, Object> params);
|
List<TeacherDO> list(Map<String, Object> params);
|
||||||
|
|
||||||
|
List<TeacherDO> listByIds(List<Long> ids);
|
||||||
|
|
||||||
SingleResponse<TeacherDO> getInfoById(Long id);
|
SingleResponse<TeacherDO> getInfoById(Long id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.zcloud.edu.persistence.repository;
|
||||||
|
|
||||||
|
import com.zcloud.edu.persistence.dataobject.VideoCoursewareDO;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.jjb.saas.framework.repository.repo.BaseRepository;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:32
|
||||||
|
*/
|
||||||
|
public interface VideoCoursewareRepository extends BaseRepository<VideoCoursewareDO> {
|
||||||
|
|
||||||
|
PageResponse<VideoCoursewareDO> listPage(Map<String, Object> params);
|
||||||
|
|
||||||
|
List<VideoCoursewareDO> list(Map<String, Object> params);
|
||||||
|
|
||||||
|
List<VideoCoursewareDO> listByTeacherId(String teacherId);
|
||||||
|
|
||||||
|
List<VideoCoursewareDO> listByTeacherIds(List<String> teacherIds);
|
||||||
|
|
||||||
|
SingleResponse<VideoCoursewareDO> getInfoById(Long id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
package com.zcloud.edu.persistence.repository.impl;
|
||||||
|
|
||||||
|
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||||
|
import com.zcloud.edu.persistence.dataobject.QuestionDO;
|
||||||
|
import com.zcloud.edu.persistence.mapper.QuestionMapper;
|
||||||
|
import com.zcloud.edu.persistence.repository.QuestionRepository;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||||
|
import com.zcloud.gbscommon.utils.Query;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
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 java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:06:11
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class QuestionRepositoryImpl extends BaseRepositoryImpl<QuestionMapper, QuestionDO> implements QuestionRepository {
|
||||||
|
private final QuestionMapper questionMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResponse<QuestionDO> listPage(Map<String, Object> params) {
|
||||||
|
IPage<QuestionDO> iPage = new Query<QuestionDO>().getPage(params);
|
||||||
|
QueryWrapper<QuestionDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||||
|
queryWrapper.orderByAsc("question_number");
|
||||||
|
IPage<QuestionDO> result = questionMapper.selectPage(iPage, queryWrapper);
|
||||||
|
return PageHelper.pageToResponse(result, result.getRecords());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<QuestionDO> list(Map<String, Object> params) {
|
||||||
|
QueryWrapper<QuestionDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||||
|
queryWrapper.orderByDesc("create_time");
|
||||||
|
List<QuestionDO> result = questionMapper.selectList(queryWrapper);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer getMaxQuestionNumber(String videoCoursewareId) {
|
||||||
|
QueryWrapper<QuestionDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("video_courseware_id", videoCoursewareId);
|
||||||
|
return list(queryWrapper).stream().mapToInt(QuestionDO::getQuestionNumber).max().orElse(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResponse<QuestionDO> getInfoById(Long id) {
|
||||||
|
return SingleResponse.of(questionMapper.selectById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean saveBatch(List<QuestionDO> list) {
|
||||||
|
saveBatch(list);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -14,6 +14,7 @@ import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -47,9 +48,30 @@ public class TeacherCertificateRepositoryImpl extends BaseRepositoryImpl<Teacher
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TeacherCertificateDO> listByTeacherId(String teacherId) {
|
||||||
|
QueryWrapper<TeacherCertificateDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("teacher_id", teacherId);
|
||||||
|
return list(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SingleResponse<TeacherCertificateDO> getInfoById(Long id) {
|
public SingleResponse<TeacherCertificateDO> getInfoById(Long id) {
|
||||||
return SingleResponse.of(teacherCertificateMapper.selectById(id));
|
return SingleResponse.of(teacherCertificateMapper.selectById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean removeByTeacherId(String teacherId) {
|
||||||
|
QueryWrapper<TeacherCertificateDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("teacher_id", teacherId);
|
||||||
|
return teacherCertificateMapper.delete(queryWrapper) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean removeByTeacherIds(List<String> teacherIds) {
|
||||||
|
QueryWrapper<TeacherCertificateDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.in("teacher_id", teacherIds);
|
||||||
|
return teacherCertificateMapper.delete(queryWrapper) > 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.zcloud.edu.persistence.repository.impl;
|
package com.zcloud.edu.persistence.repository.impl;
|
||||||
|
|
||||||
|
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||||
import com.zcloud.edu.persistence.dataobject.TeacherDO;
|
import com.zcloud.edu.persistence.dataobject.TeacherDO;
|
||||||
import com.zcloud.edu.persistence.mapper.TeacherMapper;
|
import com.zcloud.edu.persistence.mapper.TeacherMapper;
|
||||||
|
|
@ -12,8 +13,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -30,23 +33,58 @@ public class TeacherRepositoryImpl extends BaseRepositoryImpl<TeacherMapper, Tea
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResponse<TeacherDO> listPage(Map<String, Object> params) {
|
public PageResponse<TeacherDO> listPage(Map<String, Object> params) {
|
||||||
|
if(params.get("corpFlag") != null){
|
||||||
|
Integer corpFlag = (Integer)params.get("corpFlag");
|
||||||
|
if(corpFlag == 2){
|
||||||
|
params.put("eqCorpinfoId", AuthContext.getTenantId());
|
||||||
|
}
|
||||||
|
}
|
||||||
IPage<TeacherDO> iPage = new Query<TeacherDO>().getPage(params);
|
IPage<TeacherDO> iPage = new Query<TeacherDO>().getPage(params);
|
||||||
QueryWrapper<TeacherDO> queryWrapper = new QueryWrapper<>();
|
// QueryWrapper<TeacherDO> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
// queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params, "a.");
|
||||||
queryWrapper.orderByDesc("create_time");
|
// queryWrapper.eq("a.delete_enum", "FALSE");
|
||||||
IPage<TeacherDO> result = teacherMapper.selectPage(iPage, queryWrapper);
|
//// if(StringUtils.isNotEmpty((String) params.get("qualificationType"))){
|
||||||
|
//// queryWrapper.in("b.qualification_type", params.get("qualificationType").toString());
|
||||||
|
//// }
|
||||||
|
// String qualificationType = "";
|
||||||
|
// if(params.get("qualificationType") != null){
|
||||||
|
// qualificationType = params.get("qualificationType").toString();
|
||||||
|
// }
|
||||||
|
// queryWrapper.groupBy("a.teacher_id")
|
||||||
|
// .groupBy("a.id")
|
||||||
|
// .groupBy("a.user_id")
|
||||||
|
// .groupBy("a.corpinfo_id")
|
||||||
|
// .groupBy("a.teacher_name")
|
||||||
|
// .groupBy("a.state")
|
||||||
|
// .groupBy("a.create_time");
|
||||||
|
// queryWrapper.orderByDesc("a.create_time");
|
||||||
|
IPage<TeacherDO> result = teacherMapper.getTeacherPage(iPage, params);
|
||||||
return PageHelper.pageToResponse(result, result.getRecords());
|
return PageHelper.pageToResponse(result, result.getRecords());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TeacherDO> list(Map<String, Object> params) {
|
public List<TeacherDO> list(Map<String, Object> params) {
|
||||||
|
if(params.get("corpFlag") != null){
|
||||||
|
Integer corpFlag = (Integer)params.get("corpFlag");
|
||||||
|
if(corpFlag == 2){
|
||||||
|
params.put("eqCorpinfoId", AuthContext.getTenantId());
|
||||||
|
}
|
||||||
|
}
|
||||||
QueryWrapper<TeacherDO> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<TeacherDO> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params, "a.");
|
||||||
queryWrapper.orderByDesc("create_time");
|
queryWrapper.eq("a.delete_enum", "FALSE");
|
||||||
List<TeacherDO> result = teacherMapper.selectList(queryWrapper);
|
queryWrapper.orderByDesc("a.create_time");
|
||||||
|
List<TeacherDO> result = teacherMapper.getTeacherList(queryWrapper);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TeacherDO> listByIds(List<Long> ids) {
|
||||||
|
QueryWrapper<TeacherDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.in("a.id", ids);
|
||||||
|
return list(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SingleResponse<TeacherDO> getInfoById(Long id) {
|
public SingleResponse<TeacherDO> getInfoById(Long id) {
|
||||||
return SingleResponse.of(teacherMapper.selectById(id));
|
return SingleResponse.of(teacherMapper.selectById(id));
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
package com.zcloud.edu.persistence.repository.impl;
|
||||||
|
|
||||||
|
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||||
|
import com.zcloud.edu.persistence.dataobject.VideoCoursewareDO;
|
||||||
|
import com.zcloud.edu.persistence.mapper.VideoCoursewareMapper;
|
||||||
|
import com.zcloud.edu.persistence.repository.VideoCoursewareRepository;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||||
|
import com.zcloud.gbscommon.utils.Query;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
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 java.util.Collections;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-11-27 14:05:32
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class VideoCoursewareRepositoryImpl extends BaseRepositoryImpl<VideoCoursewareMapper, VideoCoursewareDO> implements VideoCoursewareRepository {
|
||||||
|
private final VideoCoursewareMapper videoCoursewareMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResponse<VideoCoursewareDO> listPage(Map<String, Object> params) {
|
||||||
|
IPage<VideoCoursewareDO> iPage = new Query<VideoCoursewareDO>().getPage(params);
|
||||||
|
QueryWrapper<VideoCoursewareDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params, "a.");
|
||||||
|
queryWrapper.eq("a.delete_enum", "FALSE");
|
||||||
|
queryWrapper.orderByDesc("a.create_time");
|
||||||
|
IPage<VideoCoursewareDO> result = videoCoursewareMapper.getVideoCoursewarePage(iPage, queryWrapper);
|
||||||
|
return PageHelper.pageToResponse(result, result.getRecords());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<VideoCoursewareDO> list(Map<String, Object> params) {
|
||||||
|
QueryWrapper<VideoCoursewareDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params, "a.");
|
||||||
|
queryWrapper.eq("a.delete_enum", "FALSE");
|
||||||
|
queryWrapper.orderByDesc("a.create_time");
|
||||||
|
List<VideoCoursewareDO> result = videoCoursewareMapper.getVideoCoursewareList(queryWrapper);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<VideoCoursewareDO> listByTeacherId(String teacherId) {
|
||||||
|
QueryWrapper<VideoCoursewareDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("teacher_id", teacherId);
|
||||||
|
return list(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<VideoCoursewareDO> listByTeacherIds(List<String> teacherIds) {
|
||||||
|
QueryWrapper<VideoCoursewareDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.in("teacher_id", teacherIds);
|
||||||
|
return list(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResponse<VideoCoursewareDO> getInfoById(Long id) {
|
||||||
|
return SingleResponse.of(videoCoursewareMapper.getInfoById(id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.zcloud.edu.persistence.mapper.QuestionMapper">
|
||||||
|
</mapper>
|
||||||
|
|
||||||
|
|
@ -3,5 +3,50 @@
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
<mapper namespace="com.zcloud.edu.persistence.mapper.TeacherMapper">
|
<mapper namespace="com.zcloud.edu.persistence.mapper.TeacherMapper">
|
||||||
|
|
||||||
|
<select id="getTeacherPage" resultType="com.zcloud.edu.persistence.dataobject.TeacherDO">
|
||||||
|
SELECT a.id,
|
||||||
|
a.teacher_id,
|
||||||
|
a.user_id,
|
||||||
|
a.corpinfo_id,
|
||||||
|
a.teacher_name,
|
||||||
|
a.`state`,
|
||||||
|
a.create_time,
|
||||||
|
c.corp_name AS corpinfoName,
|
||||||
|
GROUP_CONCAT(b.qualification_type_name SEPARATOR ',') AS qualificationTypeNames
|
||||||
|
FROM teacher a
|
||||||
|
LEFT JOIN teacher_certificate b ON a.teacher_id = b.teacher_id AND b.delete_enum = 'FALSE'
|
||||||
|
LEFT JOIN corp_info c ON a.corpinfo_id = c.id
|
||||||
|
WHERE a.delete_enum = 'FALSE'
|
||||||
|
<if test="params.eqCorpinfoId != null">
|
||||||
|
AND a.corpinfo_id = #{params.eqCorpinfoId}
|
||||||
|
</if>
|
||||||
|
AND EXISTS ( -- 关键:确保教师有符合条件的证书
|
||||||
|
SELECT 1 FROM teacher_certificate b2
|
||||||
|
WHERE b2.teacher_id = a.teacher_id
|
||||||
|
AND b2.delete_enum = 'FALSE'
|
||||||
|
<if test="params.qualificationType != null and params.qualificationType != ''">
|
||||||
|
AND b2.qualification_type IN
|
||||||
|
<foreach collection="params.qualificationType.split(',')" item="type" open="(" separator="," close=")">
|
||||||
|
#{type}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
)
|
||||||
|
GROUP BY a.teacher_id, a.id, a.user_id, a.corpinfo_id, a.teacher_name, a.state, a.create_time
|
||||||
|
ORDER BY a.create_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getTeacherList" resultType="com.zcloud.edu.persistence.dataobject.TeacherDO">
|
||||||
|
select
|
||||||
|
a.id,a.teacher_id,a.user_id,a.corpinfo_id,a.teacher_name,a.`state`,a.create_time,
|
||||||
|
c.corp_name as corpinfoName,
|
||||||
|
GROUP_CONCAT(b.qualification_type_name SEPARATOR ',') AS qualificationTypeNames
|
||||||
|
from teacher a
|
||||||
|
left join teacher_certificate b on a.teacher_id = b.teacher_id and b.delete_enum = 'FALSE'
|
||||||
|
left join corp_info c on a.corpinfo_id = c.id
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.zcloud.edu.persistence.mapper.VideoCoursewareMapper">
|
||||||
|
|
||||||
|
<select id="getInfoById" resultType="com.zcloud.edu.persistence.dataobject.VideoCoursewareDO">
|
||||||
|
select
|
||||||
|
a.id,a.video_courseware_id,a.corpinfo_id,a.courseware_name,a.training_type_id,a.teacher_id,a.video_files,a.courseware_introduce,
|
||||||
|
a.`state`,a.class_hour,a.video_time,a.delete_enum,a.remarks,a.create_name,a.update_name,a.tenant_id,a.org_id,a.version,
|
||||||
|
a.create_time,a.update_time,a.create_id,a.update_id,a.env,
|
||||||
|
b.training_type_name as trainingTypeName,
|
||||||
|
c.teacher_name as teacherName,
|
||||||
|
d.corp_name as corpName
|
||||||
|
from video_courseware a
|
||||||
|
left join training_type b on a.training_type_id = b.training_type_id and b.delete_enum = 'FALSE'
|
||||||
|
left join teacher c on a.teacher_id = c.teacher_id and c.delete_enum = 'FALSE'
|
||||||
|
left join corp_info d on a.corpinfo_id = d.id
|
||||||
|
where a.id = #{id,jdbcType=BIGINT}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getVideoCoursewarePage" resultType="com.zcloud.edu.persistence.dataobject.VideoCoursewareDO">
|
||||||
|
select
|
||||||
|
a.id,a.video_courseware_id,a.corpinfo_id,a.courseware_name,a.training_type_id,a.teacher_id,a.video_files,a.courseware_introduce,
|
||||||
|
a.`state`,a.class_hour,a.video_time,a.delete_enum,a.remarks,a.create_name,a.update_name,a.tenant_id,a.org_id,a.version,
|
||||||
|
a.create_time,a.update_time,a.create_id,a.update_id,a.env,
|
||||||
|
b.training_type_name as trainingTypeName,
|
||||||
|
c.teacher_name as teacherName,
|
||||||
|
d.corp_name as corpName
|
||||||
|
from video_courseware a
|
||||||
|
left join training_type b on a.training_type_id = b.training_type_id and b.delete_enum = 'FALSE'
|
||||||
|
left join teacher c on a.teacher_id = c.teacher_id and c.delete_enum = 'FALSE'
|
||||||
|
left join corp_info d on a.corpinfo_id = d.id
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getVideoCoursewareList" resultType="com.zcloud.edu.persistence.dataobject.VideoCoursewareDO">
|
||||||
|
select
|
||||||
|
a.id,a.video_courseware_id,a.corpinfo_id,a.courseware_name,a.training_type_id,a.teacher_id,a.video_files,a.courseware_introduce,
|
||||||
|
a.`state`,a.class_hour,a.video_time,a.delete_enum,a.remarks,a.create_name,a.update_name,a.tenant_id,a.org_id,a.version,
|
||||||
|
a.create_time,a.update_time,a.create_id,a.update_id,a.env,
|
||||||
|
b.training_type_name as trainingTypeName,
|
||||||
|
c.teacher_name as teacherName,
|
||||||
|
d.corp_name as corpName
|
||||||
|
from video_courseware a
|
||||||
|
left join training_type b on a.training_type_id = b.training_type_id and b.delete_enum = 'FALSE'
|
||||||
|
left join teacher c on a.teacher_id = c.teacher_id and c.delete_enum = 'FALSE'
|
||||||
|
left join corp_info d on a.corpinfo_id = d.id
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
||||||
Loading…
Reference in New Issue