Administrator
2021-08-03 7b18a6778a4ab36ff4181ebcef1d2f747a7291c6
src/main/java/org/springblade/modules/apply/service/impl/ApplyServiceImpl.java
@@ -10,6 +10,7 @@
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
import org.springblade.common.utils.arg;
import org.springblade.core.mp.support.Condition;
import org.springblade.modules.apply.entity.Apply;
import org.springblade.modules.apply.excel.ApplyExcel;
import org.springblade.modules.apply.excel.ApplyInfoExcel;
@@ -19,6 +20,8 @@
import org.springblade.modules.apply.vo.ApplyVO;
import org.springblade.modules.exam.entity.ExamPaper;
import org.springblade.modules.exam.service.ExamPaperService;
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IUserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -38,6 +41,8 @@
   private final ExamPaperService examPaperService;
   private final IUserService userService;
   /**
    * 自定义分页数据
@@ -82,26 +87,24 @@
   @Override
   @Transactional(rollbackFor = Exception.class)
   public void importApply(List<ApplyExcel> data, Boolean isCovered) {
      data.forEach(applyExcel -> {
   public void importApply(List<ApplyInfoExcel> data, Boolean isCovered) {
      data.forEach(applyInfoExcel -> {
         //通过准考证号
         if (null!=applyInfoExcel.getCandidateNo() && applyInfoExcel.getIdCardNo()!=""){
         Apply apply = new Apply();
         //设置数据
         apply.setExamId(applyExcel.getExamId());
         apply.setUserId(applyExcel.getUserId());
         apply.setApplyTime(new Date());
         apply.setApplyStatus(2);
         //去生成准考证号码
         apply.setCandidateNo(getCandidateNo(apply));
         //去生成考试编号
         apply.setApplyCode(getApplyCode(apply));
         //插入数据
         this.save(apply);
            apply.setCandidateNo(applyInfoExcel.getCandidateNo());
            //查询报名信息
            Apply apply1 = baseMapper.selectOne(Condition.getQueryWrapper(apply));
            apply1.setIsExam(2);
            baseMapper.updateById(apply1);
         //内网新增
         try {
            arg.test01(arg.url+"/apply/save",apply);
//               arg.test01(arg.url+"/apply/update",apply1);
         } catch (Exception e) {
            e.printStackTrace();
         }
         }
      });
   }