智慧保安后台管理项目备份
zhongrj
2024-05-24 b5960d1968e007b91d4d33dd7cbb74f1b566f2c1
src/main/java/org/springblade/modules/apply/service/impl/ExamPaymentServiceImpl.java
@@ -18,6 +18,10 @@
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;
@@ -37,6 +41,10 @@
   private final ApplyService applyService;
   private final IDeptService deptService;
   private final IUserService userService;
   /**
    * 自定义分页数据
@@ -50,6 +58,22 @@
      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);
   }