Jelajahi Sumber

优化查询浩天

夏文涛 1 tahun lalu
induk
melakukan
4041fa801a

+ 17 - 1
src/main/java/com/template/controller/LoginController.java

@@ -282,6 +282,14 @@ public class LoginController implements LoginControllerAPI {
 
             if(!(student.getIsPay() != null && student.getIsPay().intValue() == 1)){
                 List<JsonPayVo> payInfos = WelcomePayController.queryStudentPayInfo(card_number,TimeExchange.getYear());
+                BigDecimal payAmount = new BigDecimal(BigInteger.ZERO);//实缴金额
+                BigDecimal yjPayAmount = new BigDecimal(BigInteger.ZERO);//应缴金额
+                for (JsonPayVo pi:payInfos) {
+                    payAmount = payAmount.add(pi.getSJJE());
+                    yjPayAmount = yjPayAmount.add(pi.getYJJE());
+                }
+                student.setPayAmount(payAmount);
+                student.setAmountPayable(yjPayAmount);
                 if(payInfos != null && payInfos.size() > 0){
                     List<WelcomePaySetting> paySettings = welcomePaySettingService.queryPaySettings(campus);
                     if(paySettings != null && paySettings.size() > 0){
@@ -525,6 +533,14 @@ public class LoginController implements LoginControllerAPI {
         if(!(student.getIsPay() != null && student.getIsPay().intValue() == 1)){
             System.out.println("进支付比较");
             List<JsonPayVo> payInfos = WelcomePayController.queryStudentPayInfo(student.getAdmissNum(),TimeExchange.getYear());
+            BigDecimal payAmount = new BigDecimal(BigInteger.ZERO);//实缴金额
+            BigDecimal yjPayAmount = new BigDecimal(BigInteger.ZERO);//应缴金额
+            for (JsonPayVo pi:payInfos) {
+                payAmount = payAmount.add(pi.getSJJE());
+                yjPayAmount = yjPayAmount.add(pi.getYJJE());
+            }
+            student.setPayAmount(payAmount);
+            student.setAmountPayable(yjPayAmount);
             System.out.println("进支付比较1"+JSON.toJSON(payInfos));
             if(payInfos != null && payInfos.size() > 0){
                 System.out.println("进支付比较2");
@@ -558,7 +574,7 @@ public class LoginController implements LoginControllerAPI {
             }else{
                 student.setIsPay(0);
             }
-            if(student.getIsPay().intValue() == 1){
+            if(payInfos != null && payInfos.size() > 0){
                 int update = welcomeStudentService.updateWelcomeStudent(student);
                 if(update < 0){
                     logger.error("获取支付信息导致学校信息查询失败");

+ 17 - 1
src/main/java/com/template/controller/WelcomeStudentController.java

@@ -665,6 +665,14 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
         if(!(ws.getIsPay() != null && ws.getIsPay().intValue() == 1)){
             System.out.println("进支付比较");
             List<JsonPayVo> payInfos = WelcomePayController.queryStudentPayInfo(ws.getAdmissNum(),TimeExchange.getYear());
+            BigDecimal payAmount = new BigDecimal(BigInteger.ZERO);//实缴金额
+            BigDecimal yjPayAmount = new BigDecimal(BigInteger.ZERO);//应缴金额
+            for (JsonPayVo pi:payInfos) {
+                payAmount = payAmount.add(pi.getSJJE());
+                yjPayAmount = yjPayAmount.add(pi.getYJJE());
+            }
+            ws.setPayAmount(payAmount);
+            ws.setAmountPayable(yjPayAmount);
             System.out.println("进支付比较1"+JSON.toJSON(payInfos));
             if(payInfos != null && payInfos.size() > 0){
                 System.out.println("进支付比较2");
@@ -1554,6 +1562,14 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
         WelcomeStudent student = welcomeStudentService.getManageById(Integer.valueOf(userId));
         if(!(student.getIsPay() != null && student.getIsPay().intValue() == 1)){
             List<JsonPayVo> payInfos = WelcomePayController.queryStudentPayInfo(student.getAdmissNum(), TimeExchange.getYear());
+            BigDecimal payAmount = new BigDecimal(BigInteger.ZERO);//实缴金额
+            BigDecimal yjPayAmount = new BigDecimal(BigInteger.ZERO);//应缴金额
+            for (JsonPayVo pi:payInfos) {
+                payAmount = payAmount.add(pi.getSJJE());
+                yjPayAmount = yjPayAmount.add(pi.getYJJE());
+            }
+            student.setPayAmount(payAmount);
+            student.setAmountPayable(yjPayAmount);
             if(payInfos != null && payInfos.size() > 0){
                 List<WelcomePaySetting> paySettings = welcomePaySettingService.queryPaySettings(student.getSchool());
                 if(paySettings != null && paySettings.size() > 0){
@@ -1582,7 +1598,7 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
             }else{
                 student.setIsPay(0);
             }
-            if(student.getIsPay().intValue() == 1){
+            if(payInfos != null && payInfos.size() > 0){
                 int update = welcomeStudentService.updateWelcomeStudent(student);
                 if(update < 0){
                     logger.error("获取支付信息导致学校信息查询失败");

+ 1 - 1
src/main/java/com/template/services/impl/WelcomeStudentServiceImpl.java

@@ -148,7 +148,7 @@ public class WelcomeStudentServiceImpl extends ServiceImpl<WelcomeStudentMapper,
     @Override
     public int payCount() {
         QueryWrapper<WelcomeStudent> wss = new QueryWrapper<>();
-        wss.eq("is_pay",1);
+        wss.gt("pay_amount",0);//交了钱就算已交付
         Integer count = welcomeStudentMapper.selectCount(wss);
         return count;
     }