Authored by zhaoyue

Fix little bug

... ... @@ -55,13 +55,13 @@ public class UpSoftAccountController {
// if (ampMachine == null ||// 未找到密钥所对应的机器
// !ampMachine.getAMPSerial().equals(ampserial) ||//amp序号不符合
// ampMachine.getStatus() != 1) {//用户无效
// return new ResponseEntity<>(ResultModel.error(ResultStatus.AMP_KEY_ERROR), HttpStatus.NOT_FOUND);
// return new ResponseEntity<>(ResultModel.error(ResultStatus.AMP_KEY_ERROR),HttpStatus.OK);
// }
XklAdminEntity admin = adminRepository.findByAccountAndStatus(account, Constants.STATUS_OK);
//未注册
if (admin == null) {
//提示用户名或密码错误
return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR), HttpStatus.NOT_FOUND);
return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR),HttpStatus.OK);
}
String salt = admin.getSalt();
String pass_in_db = admin.getPwd();
... ... @@ -69,7 +69,7 @@ public class UpSoftAccountController {
if (!calcuPass.equals(pass_in_db) ||//密码错误
admin.getStatus() != 1) {//用户无效
//提示用户名或密码错误
return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR), HttpStatus.NOT_FOUND);
return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR),HttpStatus.OK);
}
//生成一个token,保存用户登录状态
... ...
... ... @@ -53,7 +53,6 @@ public class UpSoftReportController {
})
public ResponseEntity<ResultModel> save(@CurrentAdmin XklAdminEntity admin, @RequestParam String json_report) {
// 其中json_report格式为上传软件上传上来的原始report格式。
System.out.println("$$$$$$$$$" + json_report);
return reportService.save(admin, json_report);
}
... ...
... ... @@ -55,7 +55,7 @@ public class AdminAccountController {
//未注册
if (admin == null) {
//提示用户名或密码错误
return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR), HttpStatus.NOT_FOUND);
return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR),HttpStatus.OK);
}
String salt = admin.getSalt();
String pass_in_db = admin.getPwd();
... ... @@ -63,7 +63,7 @@ public class AdminAccountController {
if (!calcuPass.equals(pass_in_db) ||//密码错误
admin.getStatus() != 1) {//用户无效
//提示用户名或密码错误
return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR), HttpStatus.NOT_FOUND);
return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR),HttpStatus.OK);
}
//生成一个token,保存用户登录状态
... ...
... ... @@ -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);
... ...