Browse Source

支付判断变更

夏文涛 11 months ago
parent
commit
c317863c21

+ 27 - 44
src/main/java/com/template/controller/LoginController.java

@@ -291,33 +291,27 @@ public class LoginController implements LoginControllerAPI {
                 List<JsonPayVo> payInfos = WelcomePayController.queryStudentPayInfo(card_number, TimeExchange.getYear());
                 List<JsonPayVo> payInfos = WelcomePayController.queryStudentPayInfo(card_number, TimeExchange.getYear());
                 BigDecimal payAmount = new BigDecimal(BigInteger.ZERO);//实缴金额
                 BigDecimal payAmount = new BigDecimal(BigInteger.ZERO);//实缴金额
                 BigDecimal yjPayAmount = new BigDecimal(BigInteger.ZERO);//应缴金额
                 BigDecimal yjPayAmount = new BigDecimal(BigInteger.ZERO);//应缴金额
+                BigDecimal dkAmount = new BigDecimal(BigInteger.ZERO);//贷款金额
                 for (JsonPayVo pi : payInfos) {
                 for (JsonPayVo pi : payInfos) {
+                    dkAmount = dkAmount.add(pi.getDKJE());
                     payAmount = payAmount.add(pi.getSJJE());
                     payAmount = payAmount.add(pi.getSJJE());
                     yjPayAmount = yjPayAmount.add(pi.getYJJE());
                     yjPayAmount = yjPayAmount.add(pi.getYJJE());
                 }
                 }
-                student.setPayAmount(payAmount);
+                BigDecimal studentPay = payAmount.add(dkAmount);
+                student.setPayAmount(studentPay);
                 student.setAmountPayable(yjPayAmount);
                 student.setAmountPayable(yjPayAmount);
+                System.out.println("进支付比较1" + JSON.toJSON(payInfos));
                 if (payInfos != null && payInfos.size() > 0) {
                 if (payInfos != null && payInfos.size() > 0) {
-                    List<WelcomePaySetting> paySettings = welcomePaySettingService.queryPaySettings(campus);
-                    if (paySettings != null && paySettings.size() > 0) {
-                        for (WelcomePaySetting pay : paySettings) {
-                            BigDecimal money = pay.getPayAmount();
-                            if (pay.getMethod().equals("全部")) {
-                                BigDecimal totalSj = new BigDecimal(BigInteger.ZERO);
-                                for (JsonPayVo jpv : payInfos) {
-                                    totalSj = totalSj.add(jpv.getSJJE());
-                                }
-
-                                if (totalSj.compareTo(money) >= 0) {
-                                    student.setIsPay(1);
-                                }
-                            }
-                            Optional<JsonPayVo> ojpv = payInfos.stream().filter(e -> e.getSFXMMC().equals(pay.getMethod())).findFirst();
-                            if (ojpv != null && ojpv.isPresent()) {
-                                if (ojpv.get().getSJJE().compareTo(money) >= 0) {
-                                    student.setIsPay(1);
-                                }
-                            }
+                    System.out.println("进支付比较2");
+                    WelcomePaySetting paySettings = welcomePaySettingService.queryPaySettingById(student.getCollegeId(), student.getMajorId(), student.getBatchValue());
+                    System.out.println("进支付比较3" + JSON.toJSON(paySettings));
+                    if (paySettings != null) {
+                        System.out.println("进支付比较4");
+
+                        if (studentPay.compareTo(paySettings.getPayAmount()) >= 0) {
+                            student.setIsPay(1);
+                        } else {
+                            student.setIsPay(0);
                         }
                         }
                     } else {
                     } else {
                         student.setIsPay(0);
                         student.setIsPay(0);
@@ -526,38 +520,27 @@ public class LoginController implements LoginControllerAPI {
             List<JsonPayVo> payInfos = WelcomePayController.queryStudentPayInfo(student.getAdmissNum(), TimeExchange.getYear());
             List<JsonPayVo> payInfos = WelcomePayController.queryStudentPayInfo(student.getAdmissNum(), TimeExchange.getYear());
             BigDecimal payAmount = new BigDecimal(BigInteger.ZERO);//实缴金额
             BigDecimal payAmount = new BigDecimal(BigInteger.ZERO);//实缴金额
             BigDecimal yjPayAmount = new BigDecimal(BigInteger.ZERO);//应缴金额
             BigDecimal yjPayAmount = new BigDecimal(BigInteger.ZERO);//应缴金额
+            BigDecimal dkAmount = new BigDecimal(BigInteger.ZERO);//贷款金额
             for (JsonPayVo pi : payInfos) {
             for (JsonPayVo pi : payInfos) {
+                dkAmount = dkAmount.add(pi.getDKJE());
                 payAmount = payAmount.add(pi.getSJJE());
                 payAmount = payAmount.add(pi.getSJJE());
                 yjPayAmount = yjPayAmount.add(pi.getYJJE());
                 yjPayAmount = yjPayAmount.add(pi.getYJJE());
             }
             }
-            student.setPayAmount(payAmount);
+            BigDecimal studentPay = payAmount.add(dkAmount);
+            student.setPayAmount(studentPay);
             student.setAmountPayable(yjPayAmount);
             student.setAmountPayable(yjPayAmount);
             System.out.println("进支付比较1" + JSON.toJSON(payInfos));
             System.out.println("进支付比较1" + JSON.toJSON(payInfos));
             if (payInfos != null && payInfos.size() > 0) {
             if (payInfos != null && payInfos.size() > 0) {
                 System.out.println("进支付比较2");
                 System.out.println("进支付比较2");
-                List<WelcomePaySetting> paySettings = welcomePaySettingService.queryPaySettings(student.getSchool());
-                System.out.println("进支付比较3");
-                if (paySettings != null && paySettings.size() > 0) {
+                WelcomePaySetting paySettings = welcomePaySettingService.queryPaySettingById(student.getCollegeId(), student.getMajorId(), student.getBatchValue());
+                System.out.println("进支付比较3" + JSON.toJSON(paySettings));
+                if (paySettings != null) {
                     System.out.println("进支付比较4");
                     System.out.println("进支付比较4");
-                    for (WelcomePaySetting pay : paySettings) {
-                        System.out.println("进支付比较5");
-                        BigDecimal money = pay.getPayAmount();
-                        if (pay.getMethod().equals("全部")) {
-                            BigDecimal totalSj = new BigDecimal(BigInteger.ZERO);
-                            for (JsonPayVo jpv : payInfos) {
-                                totalSj = totalSj.add(jpv.getSJJE());
-                            }
-
-                            if (totalSj.compareTo(money) >= 0) {
-                                student.setIsPay(1);
-                            }
-                        }
-                        Optional<JsonPayVo> ojpv = payInfos.stream().filter(e -> e.getSFXMMC().equals(pay.getMethod())).findFirst();
-                        if (ojpv != null && ojpv.isPresent()) {
-                            if (ojpv.get().getSJJE().compareTo(money) >= 0) {
-                                student.setIsPay(1);
-                            }
-                        }
+
+                    if (studentPay.compareTo(paySettings.getPayAmount()) >= 0) {
+                        student.setIsPay(1);
+                    } else {
+                        student.setIsPay(0);
                     }
                     }
                 } else {
                 } else {
                     student.setIsPay(0);
                     student.setIsPay(0);

+ 34 - 34
src/main/java/com/template/controller/SystemSettingController.java

@@ -63,19 +63,19 @@ public class SystemSettingController implements SystemSettingControllerAPI {
         SystemSettingVo result = new SystemSettingVo();
         SystemSettingVo result = new SystemSettingVo();
 
 
         //选宿舍缴费设置
         //选宿舍缴费设置
-        List<PaySettingVo> psvs = new ArrayList<>();
-        if (wps != null && wps.size() > 0) {
-            for (WelcomePaySetting wp : wps) {
-                PaySettingVo psv = new PaySettingVo();
-                psv.setId(wp.getId());
-                psv.setSchool(wp.getSchool());
-                psv.setMethod(wp.getMethod());
-                psv.setPayAmount(wp.getPayAmount());
-                psv.setIsCheck(wp.getIsCheck());
-                psvs.add(psv);
-            }
-        }
-        result.setPsvs(psvs);
+//        List<PaySettingVo> psvs = new ArrayList<>();
+//        if (wps != null && wps.size() > 0) {
+//            for (WelcomePaySetting wp : wps) {
+//                PaySettingVo psv = new PaySettingVo();
+//                psv.setId(wp.getId());
+//                psv.setSchool(wp.getSchool());
+//                psv.setMethod(wp.getMethod());
+//                psv.setPayAmount(wp.getPayAmount());
+//                psv.setIsCheck(wp.getIsCheck());
+//                psvs.add(psv);
+//            }
+//        }
+//        result.setPsvs(psvs);
 
 
         //宿舍开放比例设置
         //宿舍开放比例设置
         List<OpenSettingVo> osvs = new ArrayList<>();
         List<OpenSettingVo> osvs = new ArrayList<>();
@@ -155,17 +155,17 @@ public class SystemSettingController implements SystemSettingControllerAPI {
         result.setCarOrder(iussr.getCarOrder());
         result.setCarOrder(iussr.getCarOrder());
 
 
         //选宿舍缴费设置WelcomePaySetting
         //选宿舍缴费设置WelcomePaySetting
-        List<WelcomePaySetting> wpss = new ArrayList<>();
-        if (iussr.getPsvs() != null && iussr.getPsvs().size() > 0) {
-            for (PaySettingVo psv : iussr.getPsvs()) {
-                WelcomePaySetting wps = new WelcomePaySetting();
-                wps.setSchool(psv.getSchool());
-                wps.setMethod(psv.getMethod());
-                wps.setPayAmount(psv.getPayAmount());
-                wps.setIsCheck(psv.getIsCheck());
-                wpss.add(wps);
-            }
-        }
+//        List<WelcomePaySetting> wpss = new ArrayList<>();
+//        if (iussr.getPsvs() != null && iussr.getPsvs().size() > 0) {
+//            for (PaySettingVo psv : iussr.getPsvs()) {
+//                WelcomePaySetting wps = new WelcomePaySetting();
+//                wps.setSchool(psv.getSchool());
+//                wps.setMethod(psv.getMethod());
+//                wps.setPayAmount(psv.getPayAmount());
+//                wps.setIsCheck(psv.getIsCheck());
+//                wpss.add(wps);
+//            }
+//        }
 
 
         //宿舍开放比例设置 welcome_open_setting
         //宿舍开放比例设置 welcome_open_setting
         List<WelcomeOpenSetting> woss = new ArrayList<>();
         List<WelcomeOpenSetting> woss = new ArrayList<>();
@@ -199,16 +199,16 @@ public class SystemSettingController implements SystemSettingControllerAPI {
                 throw new Exception("添加失败!");
                 throw new Exception("添加失败!");
             }
             }
 
 
-            if (wpss != null && wpss.size() > 0) {
-
-                int deleteAll = welcomePaySettingService.deleteAll();
-
-                boolean saveBatch = welcomePaySettingService.saveBatch(wpss);
-                if (!saveBatch) {
-                    logger.error("添加缴费设置信息失败,参数:" + JSON.toJSON(wpss));
-                    throw new Exception("添加失败!");
-                }
-            }
+//            if (wpss != null && wpss.size() > 0) {
+//
+//                int deleteAll = welcomePaySettingService.deleteAll();
+//
+//                boolean saveBatch = welcomePaySettingService.saveBatch(wpss);
+//                if (!saveBatch) {
+//                    logger.error("添加缴费设置信息失败,参数:" + JSON.toJSON(wpss));
+//                    throw new Exception("添加失败!");
+//                }
+//            }
 
 
             if (woss != null && woss.size() > 0) {
             if (woss != null && woss.size() > 0) {
                 int deleteAll = welcomeOpenSettingService.deleteAll();
                 int deleteAll = welcomeOpenSettingService.deleteAll();

+ 42 - 72
src/main/java/com/template/controller/WelcomeStudentController.java

@@ -119,7 +119,7 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
             return CommonResult.fail(st);
             return CommonResult.fail(st);
         }
         }
 
 
-        if(!isr.equals("本科") || !isr.equals("专升本")){
+        if (!isr.equals("本科") || !isr.equals("专升本")) {
             return CommonResult.fail("批次为本科或专升本");
             return CommonResult.fail("批次为本科或专升本");
         }
         }
         int existCount = welcomeStudentService.existStudentInfo(isr.getAdmissNum(), isr.getCardId());
         int existCount = welcomeStudentService.existStudentInfo(isr.getAdmissNum(), isr.getCardId());
@@ -299,7 +299,7 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
         if (student == null) {
         if (student == null) {
             return CommonResult.fail("学生数据已失效,编辑失败!");
             return CommonResult.fail("学生数据已失效,编辑失败!");
         }
         }
-        if(!usr.equals("本科") || !usr.equals("专升本")){
+        if (!usr.equals("本科") || !usr.equals("专升本")) {
             return CommonResult.fail("批次为本科或专升本");
             return CommonResult.fail("批次为本科或专升本");
         }
         }
         //region 学生信息
         //region 学生信息
@@ -630,7 +630,7 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
             return CommonResult.fail(st);
             return CommonResult.fail(st);
         }
         }
 
 
-        if(!icr.equals("本科") || !icr.equals("专升本")){
+        if (!icr.equals("本科") || !icr.equals("专升本")) {
             return CommonResult.fail("批次为本科或专升本");
             return CommonResult.fail("批次为本科或专升本");
         }
         }
         WelcomeStudent ws = welcomeStudentService.getDataByIdcardOrNum(icr.getAdmissNum(), icr.getCardId());
         WelcomeStudent ws = welcomeStudentService.getDataByIdcardOrNum(icr.getAdmissNum(), icr.getCardId());
@@ -712,38 +712,26 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
             List<JsonPayVo> payInfos = WelcomePayController.queryStudentPayInfo(ws.getAdmissNum(), TimeExchange.getYear());
             List<JsonPayVo> payInfos = WelcomePayController.queryStudentPayInfo(ws.getAdmissNum(), TimeExchange.getYear());
             BigDecimal payAmount = new BigDecimal(BigInteger.ZERO);//实缴金额
             BigDecimal payAmount = new BigDecimal(BigInteger.ZERO);//实缴金额
             BigDecimal yjPayAmount = new BigDecimal(BigInteger.ZERO);//应缴金额
             BigDecimal yjPayAmount = new BigDecimal(BigInteger.ZERO);//应缴金额
+            BigDecimal dkAmount = new BigDecimal(BigInteger.ZERO);//贷款金额
             for (JsonPayVo pi : payInfos) {
             for (JsonPayVo pi : payInfos) {
+                dkAmount = dkAmount.add(pi.getDKJE());
                 payAmount = payAmount.add(pi.getSJJE());
                 payAmount = payAmount.add(pi.getSJJE());
                 yjPayAmount = yjPayAmount.add(pi.getYJJE());
                 yjPayAmount = yjPayAmount.add(pi.getYJJE());
             }
             }
-            ws.setPayAmount(payAmount);
+            BigDecimal studentPay = payAmount.add(dkAmount);
+            ws.setPayAmount(studentPay);
             ws.setAmountPayable(yjPayAmount);
             ws.setAmountPayable(yjPayAmount);
             System.out.println("进支付比较1" + JSON.toJSON(payInfos));
             System.out.println("进支付比较1" + JSON.toJSON(payInfos));
             if (payInfos != null && payInfos.size() > 0) {
             if (payInfos != null && payInfos.size() > 0) {
                 System.out.println("进支付比较2");
                 System.out.println("进支付比较2");
-                List<WelcomePaySetting> paySettings = welcomePaySettingService.queryPaySettings(ws.getSchool());
+                WelcomePaySetting paySettings = welcomePaySettingService.queryPaySettingById(ws.getCollegeId(), ws.getMajorId(), ws.getBatchValue());
                 System.out.println("进支付比较3" + JSON.toJSON(paySettings));
                 System.out.println("进支付比较3" + JSON.toJSON(paySettings));
-                if (paySettings != null && paySettings.size() > 0) {
+                if (paySettings != null) {
                     System.out.println("进支付比较4");
                     System.out.println("进支付比较4");
-                    for (WelcomePaySetting pay : paySettings) {
-                        System.out.println("进支付比较5");
-                        BigDecimal money = pay.getPayAmount();
-                        if (pay.getMethod().equals("全部")) {
-                            BigDecimal totalSj = new BigDecimal(BigInteger.ZERO);
-                            for (JsonPayVo jpv : payInfos) {
-                                totalSj = totalSj.add(jpv.getSJJE());
-                            }
-
-                            if (totalSj.compareTo(money) >= 0) {
-                                ws.setIsPay(1);
-                            }
-                        }
-                        Optional<JsonPayVo> ojpv = payInfos.stream().filter(e -> e.getSFXMMC().equals(pay.getMethod())).findFirst();
-                        if (ojpv != null && ojpv.isPresent()) {
-                            if (ojpv.get().getSJJE().compareTo(money) >= 0) {
-                                ws.setIsPay(1);
-                            }
-                        }
+                    if (studentPay.compareTo(paySettings.getPayAmount()) >= 0) {
+                        ws.setIsPay(1);
+                    } else {
+                        ws.setIsPay(0);
                     }
                     }
                 } else {
                 } else {
                     ws.setIsPay(0);
                     ws.setIsPay(0);
@@ -753,7 +741,7 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
             }
             }
         }
         }
 
 
-        if(ws.getIsPay() == null){
+        if (ws.getIsPay() == null) {
             ws.setIsPay(0);
             ws.setIsPay(0);
         }
         }
         try {
         try {
@@ -1132,7 +1120,7 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
                         studentData.setGraduationSchool(graSchool);
                         studentData.setGraduationSchool(graSchool);
 
 
                         String batchValue = dataFormatter.formatCellValue(row.getCell(11));//批次
                         String batchValue = dataFormatter.formatCellValue(row.getCell(11));//批次
-                        if(!batchValue.equals("本科") || !batchValue.equals("专升本")){
+                        if (!batchValue.equals("本科") || !batchValue.equals("专升本")) {
                             return CommonResult.fail("批次为本科或专升本");
                             return CommonResult.fail("批次为本科或专升本");
                         }
                         }
                         studentData.setBatchValue(batchValue);
                         studentData.setBatchValue(batchValue);
@@ -1413,7 +1401,7 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
                         studentData.setGraduationSchool(graSchool);
                         studentData.setGraduationSchool(graSchool);
 
 
                         String batchValue = dataFormatter.formatCellValue(row.getCell(11));//批次
                         String batchValue = dataFormatter.formatCellValue(row.getCell(11));//批次
-                        if(!batchValue.equals("本科") || !batchValue.equals("专升本")){
+                        if (!batchValue.equals("本科") || !batchValue.equals("专升本")) {
                             return CommonResult.fail("批次为本科或专升本");
                             return CommonResult.fail("批次为本科或专升本");
                         }
                         }
                         studentData.setBatchValue(batchValue);
                         studentData.setBatchValue(batchValue);
@@ -1752,33 +1740,27 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
             List<JsonPayVo> payInfos = WelcomePayController.queryStudentPayInfo(student.getAdmissNum(), TimeExchange.getYear());
             List<JsonPayVo> payInfos = WelcomePayController.queryStudentPayInfo(student.getAdmissNum(), TimeExchange.getYear());
             BigDecimal payAmount = new BigDecimal(BigInteger.ZERO);//实缴金额
             BigDecimal payAmount = new BigDecimal(BigInteger.ZERO);//实缴金额
             BigDecimal yjPayAmount = new BigDecimal(BigInteger.ZERO);//应缴金额
             BigDecimal yjPayAmount = new BigDecimal(BigInteger.ZERO);//应缴金额
+            BigDecimal dkAmount = new BigDecimal(BigInteger.ZERO);//贷款金额
             for (JsonPayVo pi : payInfos) {
             for (JsonPayVo pi : payInfos) {
+                dkAmount = dkAmount.add(pi.getDKJE());
                 payAmount = payAmount.add(pi.getSJJE());
                 payAmount = payAmount.add(pi.getSJJE());
                 yjPayAmount = yjPayAmount.add(pi.getYJJE());
                 yjPayAmount = yjPayAmount.add(pi.getYJJE());
             }
             }
-            student.setPayAmount(payAmount);
+            BigDecimal studentPay = payAmount.add(dkAmount);
+            student.setPayAmount(studentPay);
             student.setAmountPayable(yjPayAmount);
             student.setAmountPayable(yjPayAmount);
+            System.out.println("进支付比较1" + JSON.toJSON(payInfos));
             if (payInfos != null && payInfos.size() > 0) {
             if (payInfos != null && payInfos.size() > 0) {
-                List<WelcomePaySetting> paySettings = welcomePaySettingService.queryPaySettings(student.getSchool());
-                if (paySettings != null && paySettings.size() > 0) {
-                    for (WelcomePaySetting pay : paySettings) {
-                        BigDecimal money = pay.getPayAmount();
-                        if (pay.getMethod().equals("全部")) {
-                            BigDecimal totalSj = new BigDecimal(BigInteger.ZERO);
-                            for (JsonPayVo jpv : payInfos) {
-                                totalSj = totalSj.add(jpv.getSJJE());
-                            }
+                System.out.println("进支付比较2");
+                WelcomePaySetting paySettings = welcomePaySettingService.queryPaySettingById(student.getCollegeId(), student.getMajorId(), student.getBatchValue());
+                System.out.println("进支付比较3" + JSON.toJSON(paySettings));
+                if (paySettings != null) {
+                    System.out.println("进支付比较4");
 
 
-                            if (totalSj.compareTo(money) >= 0) {
-                                student.setIsPay(1);
-                            }
-                        }
-                        Optional<JsonPayVo> ojpv = payInfos.stream().filter(e -> e.getSFXMMC().equals(pay.getMethod())).findFirst();
-                        if (ojpv != null && ojpv.isPresent()) {
-                            if (ojpv.get().getSJJE().compareTo(money) >= 0) {
-                                student.setIsPay(1);
-                            }
-                        }
+                    if (studentPay.compareTo(paySettings.getPayAmount()) >= 0) {
+                        student.setIsPay(1);
+                    } else {
+                        student.setIsPay(0);
                     }
                     }
                 } else {
                 } else {
                     student.setIsPay(0);
                     student.setIsPay(0);
@@ -1796,7 +1778,7 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
             }
             }
         }
         }
 
 
-        if(student.getIsPay() == null){
+        if (student.getIsPay() == null) {
             student.setIsPay(0);
             student.setIsPay(0);
         }
         }
         long expired = 1000 * 60 * 60 * 24 * 365;
         long expired = 1000 * 60 * 60 * 24 * 365;
@@ -1865,7 +1847,9 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
         List<JsonPayVo> payInfos = WelcomePayController.queryStudentPayInfo(ws.getAdmissNum(), TimeExchange.getYear());
         List<JsonPayVo> payInfos = WelcomePayController.queryStudentPayInfo(ws.getAdmissNum(), TimeExchange.getYear());
         BigDecimal payAmount = new BigDecimal(BigInteger.ZERO);//实缴金额
         BigDecimal payAmount = new BigDecimal(BigInteger.ZERO);//实缴金额
         BigDecimal yjPayAmount = new BigDecimal(BigInteger.ZERO);//应缴金额
         BigDecimal yjPayAmount = new BigDecimal(BigInteger.ZERO);//应缴金额
+        BigDecimal dkAmount = new BigDecimal(BigInteger.ZERO);//贷款金额
         for (JsonPayVo pi : payInfos) {
         for (JsonPayVo pi : payInfos) {
+            dkAmount = dkAmount.add(pi.getDKJE());
             payAmount = payAmount.add(pi.getSJJE());
             payAmount = payAmount.add(pi.getSJJE());
             yjPayAmount = yjPayAmount.add(pi.getYJJE());
             yjPayAmount = yjPayAmount.add(pi.getYJJE());
             PayDetailVO pdv = new PayDetailVO();
             PayDetailVO pdv = new PayDetailVO();
@@ -1874,34 +1858,20 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
             pdv.setSJJE(pi.getSJJE());
             pdv.setSJJE(pi.getSJJE());
             pdvs.add(pdv);
             pdvs.add(pdv);
         }
         }
-        ws.setPayAmount(payAmount);
+        BigDecimal studentPay = payAmount.add(dkAmount);
+        ws.setPayAmount(studentPay);
         ws.setAmountPayable(yjPayAmount);
         ws.setAmountPayable(yjPayAmount);
         System.out.println("进支付比较1" + JSON.toJSON(payInfos));
         System.out.println("进支付比较1" + JSON.toJSON(payInfos));
         if (payInfos != null && payInfos.size() > 0) {
         if (payInfos != null && payInfos.size() > 0) {
             System.out.println("进支付比较2");
             System.out.println("进支付比较2");
-            List<WelcomePaySetting> paySettings = welcomePaySettingService.queryPaySettings(ws.getSchool());
+            WelcomePaySetting paySettings = welcomePaySettingService.queryPaySettingById(ws.getCollegeId(), ws.getMajorId(), ws.getBatchValue());
             System.out.println("进支付比较3" + JSON.toJSON(paySettings));
             System.out.println("进支付比较3" + JSON.toJSON(paySettings));
-            if (paySettings != null && paySettings.size() > 0) {
+            if (paySettings != null) {
                 System.out.println("进支付比较4");
                 System.out.println("进支付比较4");
-                for (WelcomePaySetting pay : paySettings) {
-                    System.out.println("进支付比较5");
-                    BigDecimal money = pay.getPayAmount();
-                    if (pay.getMethod().equals("全部")) {
-                        BigDecimal totalSj = new BigDecimal(BigInteger.ZERO);
-                        for (JsonPayVo jpv : payInfos) {
-                            totalSj = totalSj.add(jpv.getSJJE());
-                        }
-
-                        if (totalSj.compareTo(money) >= 0) {
-                            ws.setIsPay(1);
-                        }
-                    }
-                    Optional<JsonPayVo> ojpv = payInfos.stream().filter(e -> e.getSFXMMC().equals(pay.getMethod())).findFirst();
-                    if (ojpv != null && ojpv.isPresent()) {
-                        if (ojpv.get().getSJJE().compareTo(money) >= 0) {
-                            ws.setIsPay(1);
-                        }
-                    }
+                if (studentPay.compareTo(paySettings.getPayAmount()) >= 0) {
+                    ws.setIsPay(1);
+                } else {
+                    ws.setIsPay(0);
                 }
                 }
             } else {
             } else {
                 ws.setIsPay(0);
                 ws.setIsPay(0);
@@ -1909,7 +1879,7 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
         } else {
         } else {
             ws.setIsPay(0);
             ws.setIsPay(0);
         }
         }
-        if(ws.getIsPay() == null){
+        if (ws.getIsPay() == null) {
             ws.setIsPay(0);
             ws.setIsPay(0);
         }
         }
         if (!(ws.getIsPay() != null && ws.getIsPay().intValue() == 1)) {
         if (!(ws.getIsPay() != null && ws.getIsPay().intValue() == 1)) {

+ 10 - 10
src/main/java/com/template/model/pojo/WelcomePaySetting.java

@@ -31,14 +31,14 @@ public class WelcomePaySetting implements Serializable {
     @TableId(value = "id", type = IdType.AUTO)
     @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
     private Integer id;
 
 
-    @ApiModelProperty(value = "是否选中")
-    private Integer isCheck;
-
-    @ApiModelProperty(value = "校区ID")
-    private Integer schoolId;
-
-    @ApiModelProperty(value = "校区")
-    private String school;
+//    @ApiModelProperty(value = "是否选中")
+//    private Integer isCheck;
+//
+//    @ApiModelProperty(value = "校区ID")
+//    private Integer schoolId;
+//
+//    @ApiModelProperty(value = "校区")
+//    private String school;
 
 
     @ApiModelProperty(value = "学院ID")
     @ApiModelProperty(value = "学院ID")
     private Integer collegeId;
     private Integer collegeId;
@@ -61,8 +61,8 @@ public class WelcomePaySetting implements Serializable {
     @ApiModelProperty(value = "金额")
     @ApiModelProperty(value = "金额")
     private BigDecimal payAmount;
     private BigDecimal payAmount;
 
 
-    @ApiModelProperty(value = "方式")
-    private String method;
+//    @ApiModelProperty(value = "方式")
+//    private String method;
 
 
     @ApiModelProperty(value = "创建时间")
     @ApiModelProperty(value = "创建时间")
     @TableField(fill = FieldFill.INSERT)
     @TableField(fill = FieldFill.INSERT)

+ 1 - 1
src/main/java/com/template/model/vo/JsonPayVo.java

@@ -18,7 +18,7 @@ public class JsonPayVo {
     private String BJMC;
     private String BJMC;
 
 
 
 
-    private Integer DKJE;
+    private BigDecimal DKJE;
 
 
     //应缴金额
     //应缴金额
     private BigDecimal YJJE;
     private BigDecimal YJJE;