|
@@ -109,7 +109,7 @@ public class PaperDetailServiceImpl extends ServiceImpl<PaperDetailDao, PaperDet
|
|
|
throw new StatusException("试卷满分必须大于0");
|
|
|
}
|
|
|
String total = domain.getTotalScore().toString();
|
|
|
- if (total.indexOf(".")>=0&&total.indexOf(".") < total.length() - 2) {
|
|
|
+ if (total.indexOf(".") >= 0 && total.indexOf(".") < total.length() - 2) {
|
|
|
throw new StatusException("试卷满分只能有一位小数");
|
|
|
}
|
|
|
if (CollectionUtils.isNotEmpty(domain.getStructInfo())) {
|
|
@@ -155,13 +155,17 @@ public class PaperDetailServiceImpl extends ServiceImpl<PaperDetailDao, PaperDet
|
|
|
paper.setTotalScore(domain.getTotalScore());
|
|
|
paper.setSubjectiveScore(domain.getTotalScore());
|
|
|
paperService.updateById(paper);
|
|
|
- for (PaperDetail pd : domain.getStructInfo()) {
|
|
|
- PaperDetailEntity e = new PaperDetailEntity();
|
|
|
- e.setName(pd.getName());
|
|
|
- e.setNumber(pd.getNumber());
|
|
|
- e.setPaperId(domain.getPaperId());
|
|
|
- this.save(e);
|
|
|
- paperDetailUnitService.saveUnit(e, pd.getUnits());
|
|
|
+ if (CollectionUtils.isNotEmpty(domain.getStructInfo())) {
|
|
|
+ for (PaperDetail pd : domain.getStructInfo()) {
|
|
|
+ PaperDetailEntity e = new PaperDetailEntity();
|
|
|
+ e.setName(pd.getName());
|
|
|
+ e.setNumber(pd.getNumber());
|
|
|
+ e.setPaperId(domain.getPaperId());
|
|
|
+ this.save(e);
|
|
|
+ if (CollectionUtils.isNotEmpty(pd.getUnits())) {
|
|
|
+ paperDetailUnitService.saveUnit(e, pd.getUnits());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|