|
@@ -72,12 +72,11 @@ public class ExamCardServiceImpl extends ServiceImpl<ExamCardMapper, ExamCard> i
|
|
// 新增
|
|
// 新增
|
|
ExamCard examCard;
|
|
ExamCard examCard;
|
|
ExamCardDetail examCardDetail;
|
|
ExamCardDetail examCardDetail;
|
|
- if(examCardParams.getTitle().getBytes().length > 80){
|
|
|
|
|
|
+ if (examCardParams.getTitle().getBytes().length > 80) {
|
|
throw ExceptionResultEnum.ERROR.exception("标题最长只能输入80个字符");
|
|
throw ExceptionResultEnum.ERROR.exception("标题最长只能输入80个字符");
|
|
}
|
|
}
|
|
if (examCardParams.getId() == null) {
|
|
if (examCardParams.getId() == null) {
|
|
examCard = new ExamCard();
|
|
examCard = new ExamCard();
|
|
- examCard.setId(SystemConstant.getDbUuid());
|
|
|
|
examCard.setSchoolId(schoolId);
|
|
examCard.setSchoolId(schoolId);
|
|
examCard.setCourseCode(examCardParams.getCourseCode());
|
|
examCard.setCourseCode(examCardParams.getCourseCode());
|
|
examCard.setCourseName(examCardParams.getCourseName());
|
|
examCard.setCourseName(examCardParams.getCourseName());
|
|
@@ -86,18 +85,16 @@ public class ExamCardServiceImpl extends ServiceImpl<ExamCardMapper, ExamCard> i
|
|
examCard.setStatus(examCardParams.getStatus());
|
|
examCard.setStatus(examCardParams.getStatus());
|
|
examCard.setType(examCardParams.getType());
|
|
examCard.setType(examCardParams.getType());
|
|
examCard.setTemplateId(examCardParams.getTemplateId());
|
|
examCard.setTemplateId(examCardParams.getTemplateId());
|
|
- examCard.setCreateId(user.getId());
|
|
|
|
- examCard.setCreateTime(System.currentTimeMillis());
|
|
|
|
|
|
+ examCard.insertInfo(user.getId());
|
|
|
|
+ examCard.setOrgId(user.getOrgId());
|
|
this.save(examCard);
|
|
this.save(examCard);
|
|
|
|
|
|
examCardDetail = new ExamCardDetail();
|
|
examCardDetail = new ExamCardDetail();
|
|
- examCardDetail.setId(SystemConstant.getDbUuid());
|
|
|
|
examCardDetail.setCardId(examCard.getId());
|
|
examCardDetail.setCardId(examCard.getId());
|
|
examCardDetail.setContent(examCardParams.getContent());
|
|
examCardDetail.setContent(examCardParams.getContent());
|
|
examCardDetail.setHtmlContent(examCardParams.getHtmlContent());
|
|
examCardDetail.setHtmlContent(examCardParams.getHtmlContent());
|
|
examCardDetail.setAttachmentId(examCardParams.getAttachmentId());
|
|
examCardDetail.setAttachmentId(examCardParams.getAttachmentId());
|
|
- examCardDetail.setCreateId(user.getId());
|
|
|
|
- examCardDetail.setCreateTime(System.currentTimeMillis());
|
|
|
|
|
|
+ examCardDetail.insertInfo(user.getId());
|
|
examCardDetailService.save(examCardDetail);
|
|
examCardDetailService.save(examCardDetail);
|
|
}
|
|
}
|
|
// 修改
|
|
// 修改
|
|
@@ -122,8 +119,7 @@ public class ExamCardServiceImpl extends ServiceImpl<ExamCardMapper, ExamCard> i
|
|
examCardDetail.setContent(examCardParams.getContent());
|
|
examCardDetail.setContent(examCardParams.getContent());
|
|
examCardDetail.setHtmlContent(examCardParams.getHtmlContent());
|
|
examCardDetail.setHtmlContent(examCardParams.getHtmlContent());
|
|
examCardDetail.setAttachmentId(examCardParams.getAttachmentId());
|
|
examCardDetail.setAttachmentId(examCardParams.getAttachmentId());
|
|
- examCardDetail.setUpdateId(user.getId());
|
|
|
|
- examCardDetail.setUpdateTime(System.currentTimeMillis());
|
|
|
|
|
|
+ examCardDetail.updateInfo(user.getId());
|
|
examCardDetailService.updateById(examCardDetail);
|
|
examCardDetailService.updateById(examCardDetail);
|
|
|
|
|
|
}
|
|
}
|
|
@@ -246,7 +242,7 @@ public class ExamCardServiceImpl extends ServiceImpl<ExamCardMapper, ExamCard> i
|
|
ExamCardDetail examCardDetail = examCardDetailService.getByCardId(cardId);
|
|
ExamCardDetail examCardDetail = examCardDetailService.getByCardId(cardId);
|
|
BasicAttachment attachment = basicAttachmentService.getById(examCardDetail.getCustAttachmentId());
|
|
BasicAttachment attachment = basicAttachmentService.getById(examCardDetail.getCustAttachmentId());
|
|
String fileName = attachment.getName() + attachment.getType();
|
|
String fileName = attachment.getName() + attachment.getType();
|
|
- teachcloudCommonService.copyFile(sj.toString(),fileName, attachment);
|
|
|
|
|
|
+ teachcloudCommonService.copyFile(sj.toString(), fileName, attachment);
|
|
}
|
|
}
|
|
// 压缩
|
|
// 压缩
|
|
teachcloudCommonService.downloadFileAndZip(response, rootPath, time);
|
|
teachcloudCommonService.downloadFileAndZip(response, rootPath, time);
|