结班后证书发放
This commit is contained in:
@@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -400,113 +401,107 @@ public class ClassController {
|
|||||||
return R.ok().put("userCertificate",userCertificate);
|
return R.ok().put("userCertificate",userCertificate);
|
||||||
}
|
}
|
||||||
|
|
||||||
//生成证书
|
//结班后发放证书
|
||||||
@RequestMapping("/generateCertificateClass")
|
@RequestMapping("/generateCertificateByClassEnd")
|
||||||
@Transactional
|
@Transactional
|
||||||
public R generateCertificateClass(@RequestBody Map<String,Object> params) {
|
public R generateCertificateByClassEnd(@RequestBody Map<String,Object> params){
|
||||||
//抢锁
|
ClassEntity classEntity = classEntityService.getById(params.get("classId").toString());
|
||||||
Boolean lock = redisTemplate.opsForValue().setIfAbsent("lock", "123");
|
//给合格学员发放证书
|
||||||
if(lock) {
|
List<Map<String,Object>> userScoreList = classEntityService.userScoreList(params);
|
||||||
try {
|
for (Map<String, Object> userScoreMap : userScoreList) {
|
||||||
//证书类型A a证 B b证 ZK自考
|
if (new BigDecimal(userScoreMap.get("userScore").toString()).compareTo(new BigDecimal(60))>=0){
|
||||||
String type = params.get("type").toString();
|
|
||||||
MyUserEntity user = ShiroUtils.getUser();
|
|
||||||
String photoUrl = user.getPhoto();//证书人照片
|
|
||||||
String realName = user.getName();//真是姓名
|
|
||||||
UserCertificate userCertificate = new UserCertificate();
|
UserCertificate userCertificate = new UserCertificate();
|
||||||
|
userCertificate.setTitle(classEntity.getTitle());
|
||||||
|
String type = "B";
|
||||||
|
if (new BigDecimal(userScoreMap.get("userScore").toString()).compareTo(new BigDecimal(70))>=0){
|
||||||
|
type = "A";
|
||||||
|
}
|
||||||
userCertificate.setType(type);
|
userCertificate.setType(type);
|
||||||
userCertificate.setUserId(ShiroUtils.getUId());
|
MyUserEntity user = (MyUserEntity)userScoreMap.get("user");
|
||||||
if ("ZK".equals(type)){
|
userCertificate.setUserId(user.getId());
|
||||||
CourseEntity courseEntity = courseService.getById(params.get("relationId").toString());
|
userCertificate.setClassId(classEntity.getId());
|
||||||
String courseTitle = courseEntity.getTitle();
|
//查询小班下得课程信息
|
||||||
if (courseTitle.contains("【")){
|
List<Map<String,Object>> classCourseInfoLlist = classEntityService.classCourseInfoClassId(classEntity.getId(),0);
|
||||||
courseTitle = courseEntity.getTitle().substring(0,courseEntity.getTitle().indexOf("【"));
|
for (Map<String,Object> classCourseInfo:classCourseInfoLlist){
|
||||||
}
|
String certificateNo = classEntityService.getNextCertificateNo(type,classCourseInfo.get("titleAbbr").toString());
|
||||||
userCertificate.setTitle(courseTitle);
|
|
||||||
ClassExamUser classExamUser = classExamUserService.getOne(new LambdaQueryWrapper<ClassExamUser>()
|
|
||||||
.eq(ClassExamUser::getUserId,ShiroUtils.getUId())
|
|
||||||
.eq(ClassExamUser::getRelationId,params.get("relationId").toString()));
|
|
||||||
String endYear = DateUtil.year(classExamUser.getEndTime())+"";
|
|
||||||
String endMonth = DateUtil.month(classExamUser.getEndTime())+1+"";
|
|
||||||
String endDay = DateUtil.dayOfMonth(classExamUser.getEndTime())+"";
|
|
||||||
String[] description= {endYear,endMonth,endDay,courseTitle};
|
|
||||||
String[] edes = {courseEntity.getEtitle()};
|
|
||||||
String certificateNo = getNextCertificateNo(type,courseEntity.getTitleAbbr());//证书编号
|
|
||||||
String url = userCertificateService.generateCertificate(type,certificateNo,photoUrl,realName, description, edes, endYear,endMonth,endDay);
|
|
||||||
userCertificate.setCertificateNo(certificateNo);
|
userCertificate.setCertificateNo(certificateNo);
|
||||||
userCertificate.setCertificateUrl(url);
|
userCertificate.setCourseId((Integer) classCourseInfo.get("courseId"));
|
||||||
userCertificate.setCourseId(courseEntity.getId());
|
if (StringUtils.isNotEmpty(user.getPhoto())&&StringUtils.isNotEmpty(user.getName())){
|
||||||
userCertificateService.save(userCertificate);
|
String startYear = DateUtil.year(classEntity.getStartTime())+"";
|
||||||
}else {
|
String startMonth = DateUtil.month(classEntity.getStartTime())+1+"";
|
||||||
ClassEntity classEntity = classEntityService.getById(params.get("relationId").toString());
|
String startDay = DateUtil.dayOfMonth(classEntity.getStartTime())+"";
|
||||||
String startYear = DateUtil.year(classEntity.getStartTime())+"";
|
String endYear = DateUtil.year(classEntity.getEndTime())+"";
|
||||||
String startMonth = DateUtil.month(classEntity.getStartTime())+1+"";
|
String endMonth = DateUtil.month(classEntity.getEndTime())+1+"";
|
||||||
String startDay = DateUtil.dayOfMonth(classEntity.getStartTime())+"";
|
String endDay = DateUtil.dayOfMonth(classEntity.getEndTime())+"";
|
||||||
String endYear = DateUtil.year(classEntity.getEndTime())+"";
|
double keshiTotal = (double)classCourseInfo.get("keshi");
|
||||||
String endMonth = DateUtil.month(classEntity.getEndTime())+1+"";
|
|
||||||
String endDay = DateUtil.dayOfMonth(classEntity.getEndTime())+"";
|
|
||||||
List<Map<String,Object>> list = classEntityService.classCourseInfoClassId(classEntity.getId());
|
|
||||||
for (Map<String,Object> map:list){
|
|
||||||
userCertificate.setCourseId((Integer) map.get("courseId"));
|
|
||||||
double keshiTotal = (double)map.get("keshi");
|
|
||||||
String keshi = (keshiTotal+"").replace(".0","");
|
String keshi = (keshiTotal+"").replace(".0","");
|
||||||
String courseTitle = map.get("courseTitle").toString();
|
String courseTitle = classCourseInfo.get("courseTitle").toString();
|
||||||
if (courseTitle.contains("【")){
|
if (courseTitle.contains("【")){
|
||||||
courseTitle = courseTitle.substring(0,courseTitle.indexOf("【"));
|
courseTitle = courseTitle.substring(0,courseTitle.indexOf("【"));
|
||||||
}
|
}
|
||||||
String[] des = {startYear,startMonth,startDay,endYear,endMonth,endDay,
|
String[] des = {startYear,startMonth,startDay,endYear,endMonth,endDay,
|
||||||
classEntity.getTitle(),courseTitle,keshi};
|
classEntity.getTitle(),courseTitle,keshi};
|
||||||
String[] edes = {map.get("courseETitle").toString(),keshi};
|
String[] edes = {classCourseInfo.get("courseETitle").toString(),keshi};
|
||||||
String certificateNo = getNextCertificateNo(type,map.get("titleAbbr").toString());
|
String url = userCertificateService.generateCertificate(type,certificateNo,user.getPhoto(),user.getName(),
|
||||||
String url = userCertificateService.generateCertificate(type,certificateNo,photoUrl,realName,des, edes, endYear,endMonth,endDay);
|
des, edes, endYear,endMonth,endDay);
|
||||||
userCertificate.setCertificateUrl(url);
|
userCertificate.setCertificateUrl(url);
|
||||||
userCertificate.setCertificateNo(certificateNo);
|
|
||||||
userCertificate.setTitle(classEntity.getTitle());
|
|
||||||
userCertificate.setClassId(classEntity.getId());
|
|
||||||
userCertificateService.save(userCertificate);
|
|
||||||
}
|
}
|
||||||
|
userCertificateService.save(userCertificate);
|
||||||
}
|
}
|
||||||
}finally {
|
|
||||||
//解锁
|
|
||||||
redisTemplate.delete("lock");
|
|
||||||
}
|
}
|
||||||
}else {
|
|
||||||
generateCertificateClass(params);
|
|
||||||
}
|
}
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取下一个编号
|
//生成证书图片
|
||||||
public String getNextCertificateNo(String type,String courseNamePinyin){
|
@RequestMapping("/generateCertificateClass")
|
||||||
List<UserCertificate> userCertificateList = userCertificateService.list(new LambdaQueryWrapper<UserCertificate>()
|
public R generateCertificateClass(@RequestBody Map<String,Object> params) {
|
||||||
.orderByDesc(UserCertificate::getId));
|
MyUserEntity user = ShiroUtils.getUser();
|
||||||
String res = "";
|
String photoUrl = user.getPhoto();//证书人照片
|
||||||
if (userCertificateList.size() > 0){
|
String realName = user.getName();//真实姓名
|
||||||
UserCertificate u0 = userCertificateList.get(0);
|
UserCertificate userCertificate = userCertificateService.getById(params.get("id").toString());
|
||||||
String certificateNo = u0.getCertificateNo();
|
String type = userCertificate.getType();//证书类型A a证 B b证 ZK自考
|
||||||
int no = 0;
|
if ("ZK".equals(type)){
|
||||||
if (certificateNo.contains("ZK")){
|
CourseEntity courseEntity = courseService.getById(userCertificate.getCourseId());
|
||||||
no = Integer.parseInt(certificateNo.substring(5,11))+1;
|
String courseTitle = userCertificate.getTitle();
|
||||||
}else {
|
ClassExamUser classExamUser = classExamUserService.getOne(new LambdaQueryWrapper<ClassExamUser>()
|
||||||
no = Integer.parseInt(certificateNo.substring(3,9))+1;
|
.eq(ClassExamUser::getUserId,ShiroUtils.getUId())
|
||||||
}
|
.eq(ClassExamUser::getRelationId,userCertificate.getCourseId()));
|
||||||
if ("A".equals(type)){
|
String endYear = DateUtil.year(classExamUser.getEndTime())+"";
|
||||||
res = "NO."+String.format("%06d", no);
|
String endMonth = DateUtil.month(classExamUser.getEndTime())+1+"";
|
||||||
}else if ("B".equals(type)){
|
String endDay = DateUtil.dayOfMonth(classExamUser.getEndTime())+"";
|
||||||
res = "NO."+String.format("%06d", no);
|
String[] description= {endYear,endMonth,endDay,courseTitle};
|
||||||
}else if ("ZK".equals(type)){
|
String[] edes = {courseEntity.getEtitle()};
|
||||||
res = "NO.ZK"+String.format("%06d", no);
|
String certificateNo = userCertificate.getCertificateNo();//证书编号
|
||||||
}
|
String url = userCertificateService.generateCertificate(type,certificateNo,photoUrl,realName, description, edes, endYear,endMonth,endDay);
|
||||||
|
userCertificate.setCertificateUrl(url);
|
||||||
|
userCertificateService.updateById(userCertificate);
|
||||||
}else {
|
}else {
|
||||||
if ("A".equals(type)){
|
ClassEntity classEntity = classEntityService.getById(userCertificate.getClassId());
|
||||||
res = "NO.000001";
|
String startYear = DateUtil.year(classEntity.getStartTime())+"";
|
||||||
}else if ("B".equals(type)){
|
String startMonth = DateUtil.month(classEntity.getStartTime())+1+"";
|
||||||
res = "NO.000001";
|
String startDay = DateUtil.dayOfMonth(classEntity.getStartTime())+"";
|
||||||
}else if ("ZK".equals(type)){
|
String endYear = DateUtil.year(classEntity.getEndTime())+"";
|
||||||
res = "NO.ZK000001";
|
String endMonth = DateUtil.month(classEntity.getEndTime())+1+"";
|
||||||
|
String endDay = DateUtil.dayOfMonth(classEntity.getEndTime())+"";
|
||||||
|
List<Map<String,Object>> list = classEntityService.classCourseInfoClassId(classEntity.getId(),userCertificate.getCourseId());
|
||||||
|
for (Map<String,Object> map:list){
|
||||||
|
double keshiTotal = (double)map.get("keshi");
|
||||||
|
String keshi = (keshiTotal+"").replace(".0","");
|
||||||
|
String courseTitle = map.get("courseTitle").toString();
|
||||||
|
if (courseTitle.contains("【")){
|
||||||
|
courseTitle = courseTitle.substring(0,courseTitle.indexOf("【"));
|
||||||
|
}
|
||||||
|
String[] des = {startYear,startMonth,startDay,endYear,endMonth,endDay,
|
||||||
|
classEntity.getTitle(),courseTitle,keshi};
|
||||||
|
String[] edes = {map.get("courseETitle").toString(),keshi};
|
||||||
|
String certificateNo = userCertificate.getCertificateNo();
|
||||||
|
String url = userCertificateService.generateCertificate(type,certificateNo,photoUrl,realName,des, edes, endYear,endMonth,endDay);
|
||||||
|
userCertificate.setCertificateUrl(url);
|
||||||
|
userCertificateService.updateById(userCertificate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res+courseNamePinyin;
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
package com.peanut.modules.common.controller;
|
package com.peanut.modules.common.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.peanut.common.excel.ExcelUtil;
|
import com.peanut.common.excel.ExcelUtil;
|
||||||
import com.peanut.common.utils.DateUtils;
|
import com.peanut.common.utils.DateUtils;
|
||||||
import com.peanut.common.utils.R;
|
import com.peanut.common.utils.R;
|
||||||
import com.peanut.modules.common.entity.ClassExamOption;
|
import com.peanut.common.utils.ShiroUtils;
|
||||||
import com.peanut.modules.common.entity.ClassExamSubject;
|
import com.peanut.modules.common.entity.*;
|
||||||
import com.peanut.modules.common.entity.ClassExamUser;
|
import com.peanut.modules.common.service.*;
|
||||||
import com.peanut.modules.common.entity.ClassModel;
|
import com.peanut.modules.master.service.CourseService;
|
||||||
import com.peanut.modules.common.service.ClassExamOptionService;
|
|
||||||
import com.peanut.modules.common.service.ClassExamService;
|
|
||||||
import com.peanut.modules.common.service.ClassExamSubjectService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -35,6 +33,12 @@ public class ClassExamController {
|
|||||||
private ClassExamSubjectService classExamSubjectService;
|
private ClassExamSubjectService classExamSubjectService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ClassExamOptionService classExamOptionService;
|
private ClassExamOptionService classExamOptionService;
|
||||||
|
@Autowired
|
||||||
|
private CourseService courseService;
|
||||||
|
@Autowired
|
||||||
|
private ClassEntityService classEntityService;
|
||||||
|
@Autowired
|
||||||
|
private UserCertificateService userCertificateService;
|
||||||
|
|
||||||
//导入考试题
|
//导入考试题
|
||||||
@RequestMapping("/importSubject")
|
@RequestMapping("/importSubject")
|
||||||
@@ -191,8 +195,34 @@ public class ClassExamController {
|
|||||||
//提交试卷
|
//提交试卷
|
||||||
@RequestMapping("/submitExamPaper")
|
@RequestMapping("/submitExamPaper")
|
||||||
public R submitExamPaper(@RequestBody Map<String,Object> params){
|
public R submitExamPaper(@RequestBody Map<String,Object> params){
|
||||||
Object examPaper = classExamService.submitExamPaper(params);
|
ClassExamUser classExamUser = classExamService.submitExamPaper(params);
|
||||||
return R.ok().put("examPaper",examPaper);
|
//自考的人成绩达标,发放证书
|
||||||
|
if ("2".equals(classExamUser.getType())&&classExamUser.getScore()>=80){
|
||||||
|
UserCertificate userCertificate = new UserCertificate();
|
||||||
|
userCertificate.setType("ZK");
|
||||||
|
userCertificate.setUserId(ShiroUtils.getUId());
|
||||||
|
CourseEntity courseEntity = courseService.getById(classExamUser.getRelationId());
|
||||||
|
String courseTitle = courseEntity.getTitle();
|
||||||
|
if (courseTitle.contains("【")){
|
||||||
|
courseTitle = courseEntity.getTitle().substring(0,courseEntity.getTitle().indexOf("【"));
|
||||||
|
}
|
||||||
|
userCertificate.setTitle(courseTitle);
|
||||||
|
String certificateNo = classEntityService.getNextCertificateNo("ZK",courseEntity.getTitleAbbr());//证书编号
|
||||||
|
userCertificate.setCertificateNo(certificateNo);
|
||||||
|
if (StringUtils.isNotEmpty(ShiroUtils.getUser().getPhoto())&&StringUtils.isNotEmpty(ShiroUtils.getUser().getName())){
|
||||||
|
String endYear = DateUtil.year(classExamUser.getEndTime())+"";
|
||||||
|
String endMonth = DateUtil.month(classExamUser.getEndTime())+1+"";
|
||||||
|
String endDay = DateUtil.dayOfMonth(classExamUser.getEndTime())+"";
|
||||||
|
String[] description= {endYear,endMonth,endDay,courseTitle};
|
||||||
|
String[] edes = {courseEntity.getEtitle()};
|
||||||
|
String url = userCertificateService.generateCertificate("ZK",certificateNo,ShiroUtils.getUser().getPhoto(),
|
||||||
|
ShiroUtils.getUser().getName(), description, edes, endYear,endMonth,endDay);
|
||||||
|
userCertificate.setCertificateUrl(url);
|
||||||
|
}
|
||||||
|
userCertificate.setCourseId(courseEntity.getId());
|
||||||
|
userCertificateService.save(userCertificate);
|
||||||
|
}
|
||||||
|
return R.ok().put("examPaper",classExamUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
//试卷列表
|
//试卷列表
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ public class ClassExamUser {
|
|||||||
@TableId
|
@TableId
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
private String type;
|
private String type;//考试类型 1小班 2自考
|
||||||
|
|
||||||
private Integer relationId;//考试类型 1小班 2自考
|
private Integer relationId;//班级id或课程id
|
||||||
|
|
||||||
private Integer userId;//班级id或课程id
|
private Integer userId;
|
||||||
|
|
||||||
private Integer score;//分数
|
private Integer score;//分数
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ public interface ClassEntityService extends IService<ClassEntity> {
|
|||||||
|
|
||||||
R updateClassState(Map<String,Object> params);
|
R updateClassState(Map<String,Object> params);
|
||||||
|
|
||||||
|
String getNextCertificateNo(String type,String courseNamePinyin);
|
||||||
|
|
||||||
boolean editClass(Map<String ,Object> params);
|
boolean editClass(Map<String ,Object> params);
|
||||||
|
|
||||||
R setUserRole(Map<String ,Object> params);
|
R setUserRole(Map<String ,Object> params);
|
||||||
@@ -95,6 +97,6 @@ public interface ClassEntityService extends IService<ClassEntity> {
|
|||||||
|
|
||||||
List userScoreList(Map<String,Object> params);
|
List userScoreList(Map<String,Object> params);
|
||||||
|
|
||||||
List<Map<String,Object>> classCourseInfoClassId(int classId);
|
List<Map<String,Object>> classCourseInfoClassId(int classId,int courseId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public interface ClassExamService extends IService<ClassExam> {
|
|||||||
|
|
||||||
void submitOption(Map<String,Object> params);
|
void submitOption(Map<String,Object> params);
|
||||||
|
|
||||||
Object submitExamPaper(Map<String,Object> params);
|
ClassExamUser submitExamPaper(Map<String,Object> params);
|
||||||
|
|
||||||
Object getExamPaperList(Map<String,Object> params);
|
Object getExamPaperList(Map<String,Object> params);
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import org.apache.commons.lang.StringUtils;
|
|||||||
import org.springframework.amqp.core.MessagePostProcessor;
|
import org.springframework.amqp.core.MessagePostProcessor;
|
||||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@@ -54,6 +55,8 @@ public class ClassEntityServiceImpl extends ServiceImpl<ClassEntityDao, ClassEnt
|
|||||||
private RabbitTemplate rabbitTemplate;
|
private RabbitTemplate rabbitTemplate;
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserCertificateDao userCertificateDao;
|
private UserCertificateDao userCertificateDao;
|
||||||
|
@Autowired
|
||||||
|
private StringRedisTemplate redisTemplate;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page getClassModelList(Map<String, Object> params) {
|
public Page getClassModelList(Map<String, Object> params) {
|
||||||
@@ -334,6 +337,51 @@ public class ClassEntityServiceImpl extends ServiceImpl<ClassEntityDao, ClassEnt
|
|||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取下一个编号
|
||||||
|
@Override
|
||||||
|
public String getNextCertificateNo(String type,String courseNamePinyin){
|
||||||
|
//抢锁
|
||||||
|
Boolean lock = redisTemplate.opsForValue().setIfAbsent("certificateNoLock", "getNextCertificateNo");
|
||||||
|
if(lock) {
|
||||||
|
try {
|
||||||
|
List<UserCertificate> userCertificateList = userCertificateDao.selectList(new LambdaQueryWrapper<UserCertificate>()
|
||||||
|
.orderByDesc(UserCertificate::getId));
|
||||||
|
String res = "";
|
||||||
|
if (userCertificateList.size() > 0){
|
||||||
|
UserCertificate u0 = userCertificateList.get(0);
|
||||||
|
String certificateNo = u0.getCertificateNo();
|
||||||
|
int no = 0;
|
||||||
|
if (certificateNo.contains("ZK")){
|
||||||
|
no = Integer.parseInt(certificateNo.substring(5,11))+1;
|
||||||
|
}else {
|
||||||
|
no = Integer.parseInt(certificateNo.substring(3,9))+1;
|
||||||
|
}
|
||||||
|
if ("A".equals(type)){
|
||||||
|
res = "NO."+String.format("%06d", no);
|
||||||
|
}else if ("B".equals(type)){
|
||||||
|
res = "NO."+String.format("%06d", no);
|
||||||
|
}else if ("ZK".equals(type)){
|
||||||
|
res = "NO.ZK"+String.format("%06d", no);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
if ("A".equals(type)){
|
||||||
|
res = "NO.000001";
|
||||||
|
}else if ("B".equals(type)){
|
||||||
|
res = "NO.000001";
|
||||||
|
}else if ("ZK".equals(type)){
|
||||||
|
res = "NO.ZK000001";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res+courseNamePinyin;
|
||||||
|
}finally {
|
||||||
|
//解锁
|
||||||
|
redisTemplate.delete("certificateNoLock");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
return getNextCertificateNo(type,courseNamePinyin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean editClass(Map<String, Object> params) {
|
public boolean editClass(Map<String, Object> params) {
|
||||||
ClassEntity c = new ClassEntity();
|
ClassEntity c = new ClassEntity();
|
||||||
@@ -1302,7 +1350,7 @@ public class ClassEntityServiceImpl extends ServiceImpl<ClassEntityDao, ClassEnt
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Map<String,Object>> classCourseInfoClassId(int classId) {
|
public List<Map<String,Object>> classCourseInfoClassId(int classId,int courseId) {
|
||||||
List<Map<String,Object>> res = new ArrayList<>();
|
List<Map<String,Object>> res = new ArrayList<>();
|
||||||
ClassEntity classEntity = this.baseMapper.selectById(classId);
|
ClassEntity classEntity = this.baseMapper.selectById(classId);
|
||||||
MPJLambdaWrapper<CourseEntity> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<CourseEntity> wrapper = new MPJLambdaWrapper<>();
|
||||||
@@ -1310,6 +1358,9 @@ public class ClassEntityServiceImpl extends ServiceImpl<ClassEntityDao, ClassEnt
|
|||||||
wrapper.leftJoin(ClassCourse.class,ClassCourse::getCourseId,CourseEntity::getId);
|
wrapper.leftJoin(ClassCourse.class,ClassCourse::getCourseId,CourseEntity::getId);
|
||||||
wrapper.leftJoin(ClassModel.class,ClassModel::getId,ClassCourse::getModelId);
|
wrapper.leftJoin(ClassModel.class,ClassModel::getId,ClassCourse::getModelId);
|
||||||
wrapper.eq(ClassModel::getId,classEntity.getModelId());
|
wrapper.eq(ClassModel::getId,classEntity.getModelId());
|
||||||
|
if (courseId!=0){
|
||||||
|
wrapper.eq(CourseEntity::getId,courseId);
|
||||||
|
}
|
||||||
List<CourseEntity> courseEntityList = courseDao.selectList(wrapper);
|
List<CourseEntity> courseEntityList = courseDao.selectList(wrapper);
|
||||||
for (CourseEntity course:courseEntityList){
|
for (CourseEntity course:courseEntityList){
|
||||||
Map<String,Object> candk = new HashMap<>();
|
Map<String,Object> candk = new HashMap<>();
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ public class ClassExamServiceImpl extends ServiceImpl<ClassExamDao, ClassExam> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object submitExamPaper(Map<String, Object> params) {
|
public ClassExamUser submitExamPaper(Map<String, Object> params) {
|
||||||
ClassExamUser classExamUser = classExamUserDao.selectById(params.get("id").toString());
|
ClassExamUser classExamUser = classExamUserDao.selectById(params.get("id").toString());
|
||||||
List<Object> subjectList = JSONUtil.parseArray(classExamUser.getSubject());
|
List<Object> subjectList = JSONUtil.parseArray(classExamUser.getSubject());
|
||||||
List<Object> answerList = JSONUtil.parseArray(classExamUser.getAnswer());
|
List<Object> answerList = JSONUtil.parseArray(classExamUser.getAnswer());
|
||||||
|
|||||||
Reference in New Issue
Block a user