|
@@ -1,11 +1,11 @@
|
|
package com.qmth.distributed.print.business.service.impl;
|
|
package com.qmth.distributed.print.business.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import com.qmth.distributed.print.business.bean.dto.CardCustDto;
|
|
import com.qmth.distributed.print.business.bean.params.ExamCardParams;
|
|
import com.qmth.distributed.print.business.bean.params.ExamCardParams;
|
|
-import com.qmth.distributed.print.business.bean.result.WorkResult;
|
|
|
|
import com.qmth.distributed.print.business.entity.*;
|
|
import com.qmth.distributed.print.business.entity.*;
|
|
-import com.qmth.distributed.print.business.enums.ExamStatusEnum;
|
|
|
|
import com.qmth.distributed.print.business.enums.MakeMethodEnum;
|
|
import com.qmth.distributed.print.business.enums.MakeMethodEnum;
|
|
import com.qmth.distributed.print.business.mapper.ExamCardMapper;
|
|
import com.qmth.distributed.print.business.mapper.ExamCardMapper;
|
|
import com.qmth.distributed.print.business.service.BasicExamRuleService;
|
|
import com.qmth.distributed.print.business.service.BasicExamRuleService;
|
|
@@ -20,10 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import javax.annotation.Resource;
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
-import java.util.Map;
|
|
|
|
-import java.util.Objects;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -111,6 +108,52 @@ public class ExamCardServiceImpl extends ServiceImpl<ExamCardMapper, ExamCard> i
|
|
return String.valueOf(examCard.getId());
|
|
return String.valueOf(examCard.getId());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public IPage<CardCustDto> listCardCust(String status, String paperNumber, String userId, Long applyStartTime, Long applyEndTime, Long finishStartTime, Long finishEndTime, Integer pageNumber, Integer pageSize) {
|
|
|
|
+ Page<CardCustDto> page = new Page<>(pageNumber, pageSize);
|
|
|
|
+ IPage<CardCustDto> cardCustDtoIPage = this.baseMapper.listCardCust(page, status, paperNumber, userId, applyStartTime, applyEndTime, finishStartTime, finishEndTime);
|
|
|
|
+ return cardCustDtoIPage;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Transactional
|
|
|
|
+ @Override
|
|
|
|
+ public String saveExamCardCust(ExamCardParams examCardParams) {
|
|
|
|
+ Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
|
|
+ SysUser user = (SysUser) ServletUtil.getRequestUser();
|
|
|
|
+
|
|
|
|
+ if(!MakeMethodEnum.CUST.name().equals(examCardParams.getMakeMethod().name())){
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("题卡制作类型错误");
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isBlank(examCardParams.getAttachmentId())) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("客户制卡时,附件未上传");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ExamCard examCard = new ExamCard();
|
|
|
|
+ examCard.setId(SystemConstant.getDbUuid());
|
|
|
|
+ examCard.setSchoolId(schoolId);
|
|
|
|
+ examCard.setCourseCode(examCardParams.getCourseCode());
|
|
|
|
+ examCard.setCourseName(examCardParams.getCourseName());
|
|
|
|
+ examCard.setMakeMethod(examCardParams.getMakeMethod());
|
|
|
|
+ examCard.setStatus(examCardParams.getStatus());
|
|
|
|
+ examCard.setCreateId(user.getId());
|
|
|
|
+ examCard.setCreateTime(System.currentTimeMillis());
|
|
|
|
+ this.save(examCard);
|
|
|
|
+
|
|
|
|
+ ExamCardDetail examCardDetail = new ExamCardDetail();
|
|
|
|
+ examCardDetail.setId(SystemConstant.getDbUuid());
|
|
|
|
+ examCardDetail.setCardId(examCard.getId());
|
|
|
|
+ examCardDetail.setAttachmentId(examCardParams.getAttachmentId());
|
|
|
|
+ examCardDetail.setCreateId(user.getId());
|
|
|
|
+ examCardDetail.setCreateTime(System.currentTimeMillis());
|
|
|
|
+ examCardDetailService.save(examCardDetail);
|
|
|
|
+
|
|
|
|
+ // 绑定命题任务
|
|
|
|
+ examTaskDetailService.bindCardId(examCardParams.getExamTaskId(), examCard.getId());
|
|
|
|
+
|
|
|
|
+ return String.valueOf(examCard.getId());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 数据验证
|
|
* 数据验证
|
|
*
|
|
*
|
|
@@ -164,8 +207,13 @@ public class ExamCardServiceImpl extends ServiceImpl<ExamCardMapper, ExamCard> i
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else if (MakeMethodEnum.CUST.name().equals(examCardParams.getMakeMethod().name())) {
|
|
} else if (MakeMethodEnum.CUST.name().equals(examCardParams.getMakeMethod().name())) {
|
|
- if (StringUtils.isBlank(examCardParams.getAttachmentId())) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("客户制卡时,附件未上传");
|
|
|
|
|
|
+ if (StringUtils.isBlank(examCardParams.getContent())) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("题卡内容不能为空");
|
|
|
|
+ }
|
|
|
|
+ if ("SUBMIT".equals(examCardParams.getStatus())) {
|
|
|
|
+ if (StringUtils.isBlank(examCardParams.getHtmlContent())) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("提交题卡时,html内容不能为空");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|