|
|
@@ -156,8 +156,12 @@ public class WelcomePaySettingController implements WelcomePaySettingControllerA
|
|
|
List<WelcomePaySetting> existPays = welcomePaySettingService.queryPaySettings();
|
|
|
if (existPays != null && existPays.size() > 0) {
|
|
|
for (WelcomePaySetting wps : result) {
|
|
|
+ int one = wps.getCollegeId().intValue();
|
|
|
+ int two = wps.getMajorId().intValue();
|
|
|
+ String theww = wps.getEduLevel();
|
|
|
+
|
|
|
Optional<WelcomePaySetting> ows = existPays.stream().filter(e -> e.getCollegeId().intValue() == wps.getCollegeId().intValue()
|
|
|
- && e.getMajorId().intValue() == wps.getMajorId().intValue() && e.getEduLevel().equals(wps.getEduLevel())).findFirst();
|
|
|
+ && e.getMajorId().intValue() == wps.getMajorId().intValue() && e.getEduLevel().equals(wps.getEduLevel())).findFirst();
|
|
|
if (ows != null && ows.isPresent()) {
|
|
|
wps.setId(ows.get().getId());
|
|
|
}
|
|
|
@@ -239,6 +243,8 @@ public class WelcomePaySettingController implements WelcomePaySettingControllerA
|
|
|
if (owo != null && owo.isPresent()) {
|
|
|
paySetting.setCollegeName(college);
|
|
|
paySetting.setCollegeId(owo.get().getId());
|
|
|
+ } else {
|
|
|
+ return CommonResult.fail("系统中不存在学院为" + college + "的数据");
|
|
|
}
|
|
|
|
|
|
String major = dataFormatter.formatCellValue(row.getCell(2));//专业
|
|
|
@@ -246,6 +252,8 @@ public class WelcomePaySettingController implements WelcomePaySettingControllerA
|
|
|
if (omwo != null && omwo.isPresent()) {
|
|
|
paySetting.setMajorName(major);
|
|
|
paySetting.setMajorId(omwo.get().getId());
|
|
|
+ } else {
|
|
|
+ return CommonResult.fail("系统中不存在专业为" + major + "的数据");
|
|
|
}
|
|
|
|
|
|
String eduLevel = dataFormatter.formatCellValue(row.getCell(3));//层次
|
|
|
@@ -334,6 +342,9 @@ public class WelcomePaySettingController implements WelcomePaySettingControllerA
|
|
|
if (owo != null && owo.isPresent()) {
|
|
|
paySetting.setCollegeName(college);
|
|
|
paySetting.setCollegeId(owo.get().getId());
|
|
|
+ } else {
|
|
|
+ return CommonResult.fail("系统中不存在学院为" + college + "的数据");
|
|
|
+
|
|
|
}
|
|
|
|
|
|
String major = dataFormatter.formatCellValue(row.getCell(2));//专业
|
|
|
@@ -341,6 +352,9 @@ public class WelcomePaySettingController implements WelcomePaySettingControllerA
|
|
|
if (omwo != null && omwo.isPresent()) {
|
|
|
paySetting.setMajorName(major);
|
|
|
paySetting.setMajorId(omwo.get().getId());
|
|
|
+ } else {
|
|
|
+ return CommonResult.fail("系统中不存在专业为" + major + "的数据");
|
|
|
+
|
|
|
}
|
|
|
|
|
|
String eduLevel = dataFormatter.formatCellValue(row.getCell(3));//层次
|
|
|
@@ -387,7 +401,10 @@ public class WelcomePaySettingController implements WelcomePaySettingControllerA
|
|
|
dataRow.createCell(2).setCellValue(studentData.getMajorName());
|
|
|
dataRow.createCell(3).setCellValue(studentData.getEduLevel());
|
|
|
dataRow.createCell(4).setCellValue(studentData.getEduSystem());
|
|
|
- dataRow.createCell(5).setCellValue(String.format("%02d", studentData.getPayAmount()));
|
|
|
+
|
|
|
+ BigDecimal payAmount = studentData.getPayAmount();
|
|
|
+
|
|
|
+ dataRow.createCell(5).setCellValue(String.format("%.2f", payAmount));
|
|
|
}
|
|
|
// 将工作簿写入文件
|
|
|
ExcelUtils.excelDownload(workbook, "缴费设置.xlsx", response);
|