|
@@ -495,6 +495,7 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
|
|
|
|
|
|
|
|
String nstartTime = null;
|
|
String nstartTime = null;
|
|
|
String nendTime = null;
|
|
String nendTime = null;
|
|
|
|
|
+ boolean isNowYear = false;
|
|
|
boolean lastYear = TimeExchange.CompareDate(TimeExchange.getDate(), TimeExchange.getYear() + "-07-01", "yyyy-MM-dd");
|
|
boolean lastYear = TimeExchange.CompareDate(TimeExchange.getDate(), TimeExchange.getYear() + "-07-01", "yyyy-MM-dd");
|
|
|
if (yearId == null) {
|
|
if (yearId == null) {
|
|
|
Integer yearInt = Integer.valueOf(TimeExchange.getYear());
|
|
Integer yearInt = Integer.valueOf(TimeExchange.getYear());
|
|
@@ -503,6 +504,7 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
|
|
|
nstartTime = (yearInt - 1) + "-06-01";
|
|
nstartTime = (yearInt - 1) + "-06-01";
|
|
|
nendTime = yearInt + "-06-01";
|
|
nendTime = yearInt + "-06-01";
|
|
|
} else {//今年
|
|
} else {//今年
|
|
|
|
|
+ isNowYear = true;
|
|
|
nstartTime = yearInt + "-06-01";
|
|
nstartTime = yearInt + "-06-01";
|
|
|
nendTime = (yearInt + 1) + "-06-01";
|
|
nendTime = (yearInt + 1) + "-06-01";
|
|
|
}
|
|
}
|
|
@@ -533,7 +535,8 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
|
|
|
if (result != null && result.getList() != null && result.getList().size() > 0) {
|
|
if (result != null && result.getList() != null && result.getList().size() > 0) {
|
|
|
List<StudentPageVo> students = result.getList().stream().filter(e -> e.getIsPay().intValue() == 0).collect(Collectors.toList());
|
|
List<StudentPageVo> students = result.getList().stream().filter(e -> e.getIsPay().intValue() == 0).collect(Collectors.toList());
|
|
|
//只处理本学期的未达标人员的数据同步一下支付数据
|
|
//只处理本学期的未达标人员的数据同步一下支付数据
|
|
|
- if (students != null && students.size() > 0 && !lastYear) {
|
|
|
|
|
|
|
+ if (students != null && students.size() > 0 && isNowYear) {
|
|
|
|
|
+ List<PayDetailsVo> pdvs = new ArrayList<>();
|
|
|
List<Integer> ids = new ArrayList<>();
|
|
List<Integer> ids = new ArrayList<>();
|
|
|
for (StudentPageVo student : students) {
|
|
for (StudentPageVo student : students) {
|
|
|
|
|
|
|
@@ -560,6 +563,11 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
|
|
|
if (studentPay.compareTo(paySettings.getPayAmount()) >= 0) {
|
|
if (studentPay.compareTo(paySettings.getPayAmount()) >= 0) {
|
|
|
student.setIsPay(1);
|
|
student.setIsPay(1);
|
|
|
ids.add(student.getId());
|
|
ids.add(student.getId());
|
|
|
|
|
+ PayDetailsVo pdv = new PayDetailsVo();
|
|
|
|
|
+ pdv.setId(student.getId());
|
|
|
|
|
+ pdv.setPayAmount(studentPay);
|
|
|
|
|
+ pdv.setAmountPayable(yjPayAmount);
|
|
|
|
|
+ pdvs.add(pdv);
|
|
|
} else {
|
|
} else {
|
|
|
student.setIsPay(0);
|
|
student.setIsPay(0);
|
|
|
}
|
|
}
|
|
@@ -571,10 +579,21 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (ids != null && ids.size() > 0) {
|
|
if (ids != null && ids.size() > 0) {
|
|
|
- int update = welcomeStudentService.updateStudents(ids);
|
|
|
|
|
- if (update < 0) {
|
|
|
|
|
- logger.error("获取支付信息导致学校信息查询失败");
|
|
|
|
|
- return CommonResult.fail("查询失败");
|
|
|
|
|
|
|
+ List<WelcomeStudent> studentDatas = welcomeStudentService.queryStudents(ids);
|
|
|
|
|
+ if(studentDatas != null && studentDatas.size() > 0){
|
|
|
|
|
+ for (WelcomeStudent ws:studentDatas){
|
|
|
|
|
+ Optional<PayDetailsVo> opdv = pdvs.stream().filter(e -> e.getId().intValue() == ws.getId().intValue()).findFirst();
|
|
|
|
|
+ if(opdv != null && opdv.isPresent()){
|
|
|
|
|
+ ws.setAmountPayable(opdv.get().getAmountPayable());
|
|
|
|
|
+ ws.setPayAmount(opdv.get().getPayAmount());
|
|
|
|
|
+ }
|
|
|
|
|
+ ws.setIsPay(1);
|
|
|
|
|
+ }
|
|
|
|
|
+ boolean update = welcomeStudentService.updateBatchById(studentDatas);
|
|
|
|
|
+ if (!update) {
|
|
|
|
|
+ logger.error("获取支付信息导致学校信息查询失败");
|
|
|
|
|
+ return CommonResult.fail("查询失败");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|