智慧保安后台管理项目备份
zhongrj
2024-05-24 b5960d1968e007b91d4d33dd7cbb74f1b566f2c1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
 
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);
    }
 
 
}