夏文涛 hace 1 año
padre
commit
f2ca891be7
Se han modificado 1 ficheros con 18 adiciones y 21 borrados
  1. 18 21
      src/main/java/com/template/controller/WelcomeStudentController.java

+ 18 - 21
src/main/java/com/template/controller/WelcomeStudentController.java

@@ -636,16 +636,13 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
                 if (!(StringUtils.hasText(fv.getName()) && StringUtils.hasText(fv.getPhone()) && StringUtils.hasText(fv.getWorkUnit()) && StringUtils.hasText(fv.getFamilyShip()))) {
                     return CommonResult.fail("家庭成员信息不能为空!");
                 }
-                if (!(fv.getId() != null && fv.getId().intValue() > 0)) {
-                    WelcomeFamily wf = new WelcomeFamily();
-                    wf.setName(fv.getName());
-                    wf.setPhone(fv.getPhone());
-                    wf.setWorkUnit(fv.getWorkUnit());
-                    wf.setFamilyShip(fv.getFamilyShip());
-                    wf.setStudentCard(icr.getCardId());
-                    wfs.add(wf);
-                }
-
+                WelcomeFamily wf = new WelcomeFamily();
+                wf.setName(fv.getName());
+                wf.setPhone(fv.getPhone());
+                wf.setWorkUnit(fv.getWorkUnit());
+                wf.setFamilyShip(fv.getFamilyShip());
+                wf.setStudentCard(icr.getCardId());
+                wfs.add(wf);
             }
         }
 
@@ -656,13 +653,11 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
                 if (!(StringUtils.hasText(av.getName()) && StringUtils.hasText(av.getPhone()))) {
                     return CommonResult.fail("家庭成员信息不能为空!");
                 }
-                if(!(av.getId()!= null && av.getId().intValue() > 0)) {
-                    WelcomeAccompany wa = new WelcomeAccompany();
-                    wa.setName(av.getName());
-                    wa.setPhone(av.getPhone());
-                    wa.setStudentCard(icr.getCardId());
-                    was.add(wa);
-                }
+                WelcomeAccompany wa = new WelcomeAccompany();
+                wa.setName(av.getName());
+                wa.setPhone(av.getPhone());
+                wa.setStudentCard(icr.getCardId());
+                was.add(wa);
             }
         }
 
@@ -734,6 +729,7 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
             }
             System.out.println("信息采集2");
             if (wfs != null && wfs.size() > 0) {
+                int deleteF = welcomeFamilyService.deleteWelcomeFamilyByCard(ws.getCardId());
                 boolean resultWf = welcomeFamilyService.saveBatch(wfs);
                 System.out.println("信息采集1.3");
                 if (!resultWf) {
@@ -746,6 +742,7 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
 
             System.out.println("信息采集3");
             if (was != null && was.size() > 0) {
+                int deleteF = welcomeAccompanyService.deleteWelcomeAccompanyByCard(ws.getCardId());
                 boolean resultWa = welcomeAccompanyService.saveBatch(was);
                 System.out.println("信息采集1.5");
                 if (!resultWa) {
@@ -1492,7 +1489,7 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
 //        BigDecimal total = new BigDecimal(enrollmentTotal);
 //        BigDecimal bedTotal = new BigDecimal(checkInBedTotal);
 //        BigDecimal bigDecimal = bedTotal.divide(total).setScale(4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
-        String registrationRate = String.format("%.2f",(double)(checkInBedTotal/enrollmentTotal) * 100);
+        String registrationRate = String.format("%.2f", (double) (checkInBedTotal / enrollmentTotal) * 100);
 
 
         LocalDateTime start = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0);
@@ -1629,7 +1626,7 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
     @Override
     public CommonResult queryStudentInfo(String admissNum) {
         WelcomeStudent ws = welcomeStudentService.getDataByNum(admissNum);
-        if(ws == null){
+        if (ws == null) {
             return CommonResult.fail("当前学生信息已失效,查询失败");
         }
         List<PayDetailVO> pdvs = new ArrayList<>();
@@ -1681,9 +1678,9 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
         } else {
             ws.setIsPay(0);
         }
-        if(!(ws.getIsPay() != null && ws.getIsPay().intValue() == 1)){
+        if (!(ws.getIsPay() != null && ws.getIsPay().intValue() == 1)) {
             int updateResult = welcomeStudentService.updateWelcomeStudent(ws);
-            if(updateResult < 0){
+            if (updateResult < 0) {
                 return CommonResult.fail("查询支付信息失败");
             }
         }