From 5cc9063aafa13e75d0fd918bd968c59f61525e2d Mon Sep 17 00:00:00 2001
From: “djh” <“3298565835@qq.com”>
Date: 星期四, 23 一月 2025 14:01:59 +0800
Subject: [PATCH] 煤矿缴费

---
 exam-system/src/main/java/com/gkhy/exam/pay/service/impl/NonCoalPayServiceImpl.java |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/exam-system/src/main/java/com/gkhy/exam/pay/service/impl/NonCoalPayServiceImpl.java b/exam-system/src/main/java/com/gkhy/exam/pay/service/impl/NonCoalPayServiceImpl.java
index 30bf5de..b90d219 100644
--- a/exam-system/src/main/java/com/gkhy/exam/pay/service/impl/NonCoalPayServiceImpl.java
+++ b/exam-system/src/main/java/com/gkhy/exam/pay/service/impl/NonCoalPayServiceImpl.java
@@ -18,6 +18,7 @@
 import com.gkhy.exam.pay.service.NonCoalPayCategoryService;
 import com.gkhy.exam.pay.service.NonCoalPayService;
 import com.gkhy.exam.pay.service.NonCoalPayStudentService;
+import com.ruoyi.common.constant.Constants;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.bean.BeanUtils;
@@ -59,7 +60,7 @@
     }
 
     @Override
-    public NonCoalPayDetailH5RepDto selectNonCoalPayByStu(String phone, String idCard) {
+    public List<NonCoalPayDetailH5RepDto> selectNonCoalPayByStu(String phone, String idCard) {
         return nonCoalPayMapper.selectNonCoalPayByParam(phone, idCard);
     }
 
@@ -73,7 +74,9 @@
     @Override
     public List<NonCoalPayPageRepDto> selectNonCoalPayList(NonCoalPay nonCoalPay) {
         if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
-            nonCoalPay.setDistrictCode(SecurityUtils.getDeptDistrictCode());
+            if (!Constants.DIS_XINJIANG_CODE.equals(SecurityUtils.getDeptDistrictCode())) {
+                nonCoalPay.setDistrictCode(SecurityUtils.getDeptDistrictCode());
+            }
         }
         return nonCoalPayMapper.getNonCoalPayList(nonCoalPay);
     }
@@ -122,6 +125,9 @@
     @Override
     @Transactional
     public int insertNonCoalPay(NonCoalPayReqDto nonCoalPay) {
+        if (!nonCoalPay.getDistrictCode().startsWith(Constants.DIS_XINJIANG_CODE)) {
+            throw new RuntimeException("地州信息错误");
+        }
         checkData(nonCoalPay);
         NonCoalPay nonCoalPay1 = new NonCoalPay();
         BeanUtils.copyProperties(nonCoalPay, nonCoalPay1);
@@ -155,7 +161,7 @@
                 .eq(NonCoalPay::getDistrictCode, nonCoalPay.getDistrictCode())
                 .eq(NonCoalPay::getBatchName, nonCoalPay.getBatchName())
                 .eq(NonCoalPay::getDelFlag, 0);
-        if (nonCoalPay.getId() == null) {
+        if (nonCoalPay.getId() != null) {
             lambdaQueryWrapper.ne(NonCoalPay::getId, nonCoalPay.getId());
         }
         Long l = baseMapper.selectCount(lambdaQueryWrapper);
@@ -173,10 +179,12 @@
     @Override
     @Transactional
     public int updateNonCoalPay(NonCoalPayReqDto nonCoalPay) {
+
         checkData(nonCoalPay);
         checkHavePay(nonCoalPay.getId());
         NonCoalPay nonCoalPay1 = new NonCoalPay();
         BeanUtils.copyProperties(nonCoalPay, nonCoalPay1);
+        nonCoalPay1.setDistrictCode(null);
         nonCoalPay1.setUpdateBy(SecurityUtils.getUsername());
         int i = nonCoalPayMapper.updateNonCoalPay(nonCoalPay1);
         if (i > 0) {
@@ -200,7 +208,7 @@
     @Override
     @Transactional
     public int updateNonCoalPayTypeStatus(int payPersonType, Long id) {
-        NonCoalPay byId = getById(id);
+        NonCoalPay byId = nonCoalPayMapper.selectNonCoalPayById(id);
         if (byId == null) {
             throw new ServiceException("该数据不存在");
         }
@@ -238,8 +246,8 @@
      */
     @Override
     public int deleteNonCoalPayById(Long id) {
-        NonCoalPay byId = getById(id);
-        if (byId == null) {
+        NonCoalPay nonCoalPay = nonCoalPayMapper.selectNonCoalPayById(id);
+        if (nonCoalPay == null) {
             throw new ServiceException("该数据不存在");
         }
         //验证是否有学员已缴费

--
Gitblit v1.9.2