...
|
...
|
@@ -70,10 +70,10 @@ public class ReportService implements IReportService { |
|
|
return new ResponseEntity<>(ResultModel.ok(new ReportIdModel(report.getId())), HttpStatus.OK);
|
|
|
} else if (redis.hasKey(reportWithNoUser)) {
|
|
|
// 返回,报告对应会员不存在。
|
|
|
return new ResponseEntity<>(ResultModel.error(ResultStatus.INVALID_USER_ERROR), HttpStatus.NOT_FOUND);
|
|
|
return new ResponseEntity<>(ResultModel.error(ResultStatus.INVALID_USER_ERROR),HttpStatus.OK);
|
|
|
} else if (redis.hasKey(reportWrongFormat)) {
|
|
|
// 返回,报告格式有问题。
|
|
|
return new ResponseEntity<>(ResultModel.error(ResultStatus.REPORT_FORMAT_ERROR), HttpStatus.NOT_FOUND);
|
|
|
return new ResponseEntity<>(ResultModel.error(ResultStatus.REPORT_FORMAT_ERROR),HttpStatus.OK);
|
|
|
}
|
|
|
/*
|
|
|
* 解析报告数据
|
...
|
...
|
@@ -85,7 +85,7 @@ public class ReportService implements IReportService { |
|
|
if (reportData == null) {
|
|
|
redis.boundValueOps(reportWrongFormat).set("");
|
|
|
// 返回,报告格式有问题。
|
|
|
return new ResponseEntity<>(ResultModel.error(ResultStatus.REPORT_FORMAT_ERROR), HttpStatus.NOT_FOUND);
|
|
|
return new ResponseEntity<>(ResultModel.error(ResultStatus.REPORT_FORMAT_ERROR),HttpStatus.OK);
|
|
|
}
|
|
|
/*
|
|
|
* 检验会员存在性
|
...
|
...
|
@@ -94,7 +94,7 @@ public class ReportService implements IReportService { |
|
|
if (user == null) {
|
|
|
redis.boundValueOps(reportWithNoUser).set("");
|
|
|
// 返回,报告对应会员不存在。
|
|
|
return new ResponseEntity<>(ResultModel.error(ResultStatus.INVALID_USER_ERROR), HttpStatus.NOT_FOUND);
|
|
|
return new ResponseEntity<>(ResultModel.error(ResultStatus.INVALID_USER_ERROR),HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
/*
|
...
|
...
|
@@ -106,7 +106,7 @@ public class ReportService implements IReportService { |
|
|
return new ResponseEntity<>(ResultModel.ok(new ReportIdModel(reportId)), HttpStatus.OK);
|
|
|
} else {
|
|
|
// 返回,服务器存储问题。
|
|
|
return new ResponseEntity<>(ResultModel.error(ResultStatus.DB_ERROR), HttpStatus.NOT_FOUND);
|
|
|
return new ResponseEntity<>(ResultModel.error(ResultStatus.DB_ERROR),HttpStatus.OK);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -124,7 +124,7 @@ public class ReportService implements IReportService { |
|
|
// 2. 验证admin
|
|
|
if (report.getCreateBy() != admin.getId()) {
|
|
|
// 非此admin创建,不能删除,返回
|
|
|
return new ResponseEntity<>(ResultModel.error(ResultStatus.INVALID_ADMIN_RPDEL_ERROR), HttpStatus.NOT_FOUND);
|
|
|
return new ResponseEntity<>(ResultModel.error(ResultStatus.INVALID_ADMIN_RPDEL_ERROR),HttpStatus.OK);
|
|
|
}
|
|
|
// 3. 删除report和detail,返回ok
|
|
|
reportRepository.delete(report);
|
...
|
...
|
|