From f5e3323be3ce83280c48cd1856bea88c6aed8ffa Mon Sep 17 00:00:00 2001
From: “djh” <“3298565835@qq.com”>
Date: 星期四, 06 三月 2025 13:40:47 +0800
Subject: [PATCH] 统计修改

---
 exam-system/src/main/java/com/gkhy/exam/pay/service/impl/CoalPayServiceImpl.java |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/exam-system/src/main/java/com/gkhy/exam/pay/service/impl/CoalPayServiceImpl.java b/exam-system/src/main/java/com/gkhy/exam/pay/service/impl/CoalPayServiceImpl.java
index ef7bfca..6964111 100644
--- a/exam-system/src/main/java/com/gkhy/exam/pay/service/impl/CoalPayServiceImpl.java
+++ b/exam-system/src/main/java/com/gkhy/exam/pay/service/impl/CoalPayServiceImpl.java
@@ -69,27 +69,27 @@
      */
     @Override
     public List<CoalPayRepDto> selectCoalPayList(CoalPayReq coalPay) {
-        List<CoalPayRepDto> coalPayRepDtos = new ArrayList<>();
-        List<CoalPay> coalPays = coalPayMapper.selectCoalPayList(coalPay);
-        for (CoalPay pay : coalPays) {
-            CoalPayRepDto coalPayRepDto = new CoalPayRepDto();
-            BeanUtils.copyProperties(pay, coalPayRepDto);
+//        List<CoalPayRepDto> coalPayRepDtos = new ArrayList<>();
+        List<CoalPayRepDto> coalPays = coalPayMapper.selectCoalPayList(coalPay);
+        for (CoalPayRepDto pay : coalPays) {
+//            CoalPayRepDto coalPayRepDto = new CoalPayRepDto();
+//            BeanUtils.copyProperties(pay, coalPayRepDto);
             //部门数据
             SysDept sysDept = sysDeptMapper.selectDeptById(pay.getDeptId());
-            coalPayRepDto.setDeptName(sysDept.getDeptName());
+            pay.setDeptName(sysDept.getDeptName());
             //工种数据
             List<CoalCategory> coalCategories = coalCategoryMapper.selectByCoalPayId(pay.getId());
-            coalPayRepDto.setCoalCategoryList(coalCategories);
+            pay.setCoalCategoryList(coalCategories);
             //学员数据
             List<CoalPayStudent> coalPayStudents = coalPayStudentService.selectByCoalPayId(pay.getId());
             List<CoalPayStudent> havePay = coalPayStudents.stream()
                     .filter(stu -> stu.getPayStatus() != null && stu.getPayStatus() == 1)
                     .collect(Collectors.toList());
-            coalPayRepDto.setTotalNum(coalPayStudents.size());
-            coalPayRepDto.setHavePayNum(havePay.size());
-            coalPayRepDtos.add(coalPayRepDto);
+            pay.setTotalNum(coalPayStudents.size());
+            pay.setHavePayNum(havePay.size());
+//            coalPayRepDtos.add(coalPayRepDto);
         }
-        return coalPayRepDtos;
+        return coalPays;
     }
 
     @Override
@@ -163,7 +163,7 @@
     @Override
     public AjaxResult deleteCoalPayByIds(Long[] ids) {
         for (Long id : ids) {
-            List<CoalPayStudent> coalPayStudents = coalPayStudentService.selectByCoalPayIdAndPayStatus(id, 1);
+            List<CoalPayStudent> coalPayStudents = coalPayStudentService.selectByCoalPayId(id);
             if (!CollectionUtils.isEmpty(coalPayStudents)) {
                 throw new BusinessException(this.getClass(), ResultConstants.BUSINESS_ERROR, "已有学员完成缴费,请勿删除");
             }
@@ -223,6 +223,7 @@
             CoalPayStudent coalPayStudent = new CoalPayStudent();
             coalPayStudent.setCoalPayId(coalPayTypeReq.getCoalPayId());
             coalPayStudent.setPayType(2);
+            coalPayStudent.setGovPayStatus(0);
             coalPayStudentService.updateByCoalPayId(coalPayStudent);
         }
         return i;

--
Gitblit v1.9.2