|
@@ -2,14 +2,21 @@ package com.zhongzheng.modules.exam.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.modules.exam.bo.ExamApplyUserAddBo;
|
|
import com.zhongzheng.modules.exam.bo.ExamApplyUserAddBo;
|
|
import com.zhongzheng.modules.exam.bo.ExamApplyUserEditBo;
|
|
import com.zhongzheng.modules.exam.bo.ExamApplyUserEditBo;
|
|
import com.zhongzheng.modules.exam.bo.ExamApplyUserQueryBo;
|
|
import com.zhongzheng.modules.exam.bo.ExamApplyUserQueryBo;
|
|
import com.zhongzheng.modules.exam.domain.ExamApplyUser;
|
|
import com.zhongzheng.modules.exam.domain.ExamApplyUser;
|
|
|
|
+import com.zhongzheng.modules.exam.domain.ExamBefore;
|
|
|
|
+import com.zhongzheng.modules.exam.domain.ExamBeforeApply;
|
|
import com.zhongzheng.modules.exam.mapper.ExamApplyUserMapper;
|
|
import com.zhongzheng.modules.exam.mapper.ExamApplyUserMapper;
|
|
import com.zhongzheng.modules.exam.service.IExamApplyUserService;
|
|
import com.zhongzheng.modules.exam.service.IExamApplyUserService;
|
|
|
|
+import com.zhongzheng.modules.exam.service.IExamBeforeApplyService;
|
|
|
|
+import com.zhongzheng.modules.exam.service.IExamBeforeService;
|
|
import com.zhongzheng.modules.exam.vo.ExamApplyUserVo;
|
|
import com.zhongzheng.modules.exam.vo.ExamApplyUserVo;
|
|
|
|
+import com.zhongzheng.modules.exam.vo.ExamBeforeVo;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
@@ -30,6 +37,11 @@ import java.util.stream.Collectors;
|
|
@Service
|
|
@Service
|
|
public class ExamApplyUserServiceImpl extends ServiceImpl<ExamApplyUserMapper, ExamApplyUser> implements IExamApplyUserService {
|
|
public class ExamApplyUserServiceImpl extends ServiceImpl<ExamApplyUserMapper, ExamApplyUser> implements IExamApplyUserService {
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IExamBeforeApplyService iExamBeforeApplyService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IExamBeforeService iExamBeforeService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public ExamApplyUserVo queryById(Long id){
|
|
public ExamApplyUserVo queryById(Long id){
|
|
ExamApplyUser db = this.baseMapper.selectById(id);
|
|
ExamApplyUser db = this.baseMapper.selectById(id);
|
|
@@ -102,4 +114,19 @@ public class ExamApplyUserServiceImpl extends ServiceImpl<ExamApplyUserMapper, E
|
|
}
|
|
}
|
|
return this.removeByIds(ids);
|
|
return this.removeByIds(ids);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public ExamBeforeVo getBeforeByApplyId(Long applyId) {
|
|
|
|
+ ExamBeforeApply beforeApply = iExamBeforeApplyService
|
|
|
|
+ .list(new LambdaQueryWrapper<ExamBeforeApply>()
|
|
|
|
+ .eq(ExamBeforeApply::getApplyId, applyId)
|
|
|
|
+ .last("LIMIT 1")).stream().findFirst().orElse(null);
|
|
|
|
+ if (ObjectUtils.isNull(beforeApply)){
|
|
|
|
+ return new ExamBeforeVo();
|
|
|
|
+ }
|
|
|
|
+ ExamBefore before = iExamBeforeService.getById(beforeApply.getBeforeId());
|
|
|
|
+ ExamBeforeVo vo = new ExamBeforeVo();
|
|
|
|
+ BeanUtil.copyProperties(before,vo);
|
|
|
|
+ return vo;
|
|
|
|
+ }
|
|
}
|
|
}
|