|
package org.springblade.modules.apply.service.impl;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import lombok.AllArgsConstructor;
|
import net.sourceforge.pinyin4j.PinyinHelper;
|
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
|
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
|
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
|
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
|
import org.springblade.modules.apply.entity.Apply;
|
import org.springblade.modules.apply.entity.ExamPayment;
|
import org.springblade.modules.apply.excel.ApplyExcel;
|
import org.springblade.modules.apply.mapper.ExamPaymentMapper;
|
import org.springblade.modules.apply.service.ApplyService;
|
import org.springblade.modules.apply.service.ExamPaymentService;
|
import org.springblade.modules.apply.vo.ExamPaymentVO;
|
import org.springblade.modules.exam.entity.ExamPaper;
|
import org.springblade.modules.exam.service.ExamPaperService;
|
import org.springblade.modules.system.entity.Dept;
|
import org.springblade.modules.system.entity.User;
|
import org.springblade.modules.system.service.IDeptService;
|
import org.springblade.modules.system.service.IUserService;
|
import org.springframework.stereotype.Service;
|
import org.springframework.transaction.annotation.Transactional;
|
|
import java.text.DecimalFormat;
|
import java.text.SimpleDateFormat;
|
import java.util.Date;
|
import java.util.List;
|
import java.util.UUID;
|
|
/**
|
* 考试缴费服务实现类
|
* @author zhongrj
|
*/
|
@Service
|
@AllArgsConstructor
|
public class ExamPaymentServiceImpl extends ServiceImpl<ExamPaymentMapper, ExamPayment> implements ExamPaymentService {
|
|
private final ApplyService applyService;
|
|
private final IDeptService deptService;
|
|
private final IUserService userService;
|
|
|
/**
|
* 自定义分页数据
|
* @param page 分页条件
|
* @param examPayment 考试缴费对象
|
* @return
|
*/
|
@Override
|
public IPage<ExamPaymentVO> selectExamPaymentPage(IPage<ExamPaymentVO> page, ExamPaymentVO examPayment) {
|
List<ExamPaymentVO> examPaymentVOS = baseMapper.selectExamPaymentPage(page, examPayment);
|
for (ExamPaymentVO examPaymentVO : examPaymentVOS) {
|
//查询人数
|
examPaymentVO.setNum(applyService.getApplyNum(examPaymentVO.getApplyCode()));
|
//如果为公司缴费
|
if (examPaymentVO.getType()==1){
|
//查询公司名称
|
Dept dept = deptService.getById(examPaymentVO.getWorkerId());
|
if (null!=dept){
|
examPaymentVO.setDeptName(dept.getDeptName());
|
}
|
}
|
//如果为个人缴费
|
if (examPaymentVO.getType()==2){
|
//查询公司名称
|
User user = userService.getById(examPaymentVO.getWorkerId());
|
if (null!=user){
|
examPaymentVO.setDeptName(user.getRealName());
|
}
|
}
|
}
|
return page.setRecords(examPaymentVOS);
|
}
|
|
/**
|
* 详情
|
* @param examPayment 考试缴费信息对象
|
*/
|
@Override
|
public ExamPaymentVO selectExamPaymentInfo(ExamPayment examPayment) {
|
return baseMapper.selectExamPaymentInfo(examPayment);
|
}
|
|
|
}
|