Showing
4 changed files
with
11 additions
and
12 deletions
@@ -55,13 +55,13 @@ public class UpSoftAccountController { | @@ -55,13 +55,13 @@ public class UpSoftAccountController { | ||
55 | // if (ampMachine == null ||// 未找到密钥所对应的机器 | 55 | // if (ampMachine == null ||// 未找到密钥所对应的机器 |
56 | // !ampMachine.getAMPSerial().equals(ampserial) ||//amp序号不符合 | 56 | // !ampMachine.getAMPSerial().equals(ampserial) ||//amp序号不符合 |
57 | // ampMachine.getStatus() != 1) {//用户无效 | 57 | // ampMachine.getStatus() != 1) {//用户无效 |
58 | -// return new ResponseEntity<>(ResultModel.error(ResultStatus.AMP_KEY_ERROR), HttpStatus.NOT_FOUND); | 58 | +// return new ResponseEntity<>(ResultModel.error(ResultStatus.AMP_KEY_ERROR),HttpStatus.OK); |
59 | // } | 59 | // } |
60 | XklAdminEntity admin = adminRepository.findByAccountAndStatus(account, Constants.STATUS_OK); | 60 | XklAdminEntity admin = adminRepository.findByAccountAndStatus(account, Constants.STATUS_OK); |
61 | //未注册 | 61 | //未注册 |
62 | if (admin == null) { | 62 | if (admin == null) { |
63 | //提示用户名或密码错误 | 63 | //提示用户名或密码错误 |
64 | - return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR), HttpStatus.NOT_FOUND); | 64 | + return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR),HttpStatus.OK); |
65 | } | 65 | } |
66 | String salt = admin.getSalt(); | 66 | String salt = admin.getSalt(); |
67 | String pass_in_db = admin.getPwd(); | 67 | String pass_in_db = admin.getPwd(); |
@@ -69,7 +69,7 @@ public class UpSoftAccountController { | @@ -69,7 +69,7 @@ public class UpSoftAccountController { | ||
69 | if (!calcuPass.equals(pass_in_db) ||//密码错误 | 69 | if (!calcuPass.equals(pass_in_db) ||//密码错误 |
70 | admin.getStatus() != 1) {//用户无效 | 70 | admin.getStatus() != 1) {//用户无效 |
71 | //提示用户名或密码错误 | 71 | //提示用户名或密码错误 |
72 | - return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR), HttpStatus.NOT_FOUND); | 72 | + return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR),HttpStatus.OK); |
73 | } | 73 | } |
74 | 74 | ||
75 | //生成一个token,保存用户登录状态 | 75 | //生成一个token,保存用户登录状态 |
@@ -53,7 +53,6 @@ public class UpSoftReportController { | @@ -53,7 +53,6 @@ public class UpSoftReportController { | ||
53 | }) | 53 | }) |
54 | public ResponseEntity<ResultModel> save(@CurrentAdmin XklAdminEntity admin, @RequestParam String json_report) { | 54 | public ResponseEntity<ResultModel> save(@CurrentAdmin XklAdminEntity admin, @RequestParam String json_report) { |
55 | // 其中json_report格式为上传软件上传上来的原始report格式。 | 55 | // 其中json_report格式为上传软件上传上来的原始report格式。 |
56 | - System.out.println("$$$$$$$$$" + json_report); | ||
57 | return reportService.save(admin, json_report); | 56 | return reportService.save(admin, json_report); |
58 | } | 57 | } |
59 | 58 |
@@ -55,7 +55,7 @@ public class AdminAccountController { | @@ -55,7 +55,7 @@ public class AdminAccountController { | ||
55 | //未注册 | 55 | //未注册 |
56 | if (admin == null) { | 56 | if (admin == null) { |
57 | //提示用户名或密码错误 | 57 | //提示用户名或密码错误 |
58 | - return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR), HttpStatus.NOT_FOUND); | 58 | + return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR),HttpStatus.OK); |
59 | } | 59 | } |
60 | String salt = admin.getSalt(); | 60 | String salt = admin.getSalt(); |
61 | String pass_in_db = admin.getPwd(); | 61 | String pass_in_db = admin.getPwd(); |
@@ -63,7 +63,7 @@ public class AdminAccountController { | @@ -63,7 +63,7 @@ public class AdminAccountController { | ||
63 | if (!calcuPass.equals(pass_in_db) ||//密码错误 | 63 | if (!calcuPass.equals(pass_in_db) ||//密码错误 |
64 | admin.getStatus() != 1) {//用户无效 | 64 | admin.getStatus() != 1) {//用户无效 |
65 | //提示用户名或密码错误 | 65 | //提示用户名或密码错误 |
66 | - return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR), HttpStatus.NOT_FOUND); | 66 | + return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR),HttpStatus.OK); |
67 | } | 67 | } |
68 | 68 | ||
69 | //生成一个token,保存用户登录状态 | 69 | //生成一个token,保存用户登录状态 |
@@ -70,10 +70,10 @@ public class ReportService implements IReportService { | @@ -70,10 +70,10 @@ public class ReportService implements IReportService { | ||
70 | return new ResponseEntity<>(ResultModel.ok(new ReportIdModel(report.getId())), HttpStatus.OK); | 70 | return new ResponseEntity<>(ResultModel.ok(new ReportIdModel(report.getId())), HttpStatus.OK); |
71 | } else if (redis.hasKey(reportWithNoUser)) { | 71 | } else if (redis.hasKey(reportWithNoUser)) { |
72 | // 返回,报告对应会员不存在。 | 72 | // 返回,报告对应会员不存在。 |
73 | - return new ResponseEntity<>(ResultModel.error(ResultStatus.INVALID_USER_ERROR), HttpStatus.NOT_FOUND); | 73 | + return new ResponseEntity<>(ResultModel.error(ResultStatus.INVALID_USER_ERROR),HttpStatus.OK); |
74 | } else if (redis.hasKey(reportWrongFormat)) { | 74 | } else if (redis.hasKey(reportWrongFormat)) { |
75 | // 返回,报告格式有问题。 | 75 | // 返回,报告格式有问题。 |
76 | - return new ResponseEntity<>(ResultModel.error(ResultStatus.REPORT_FORMAT_ERROR), HttpStatus.NOT_FOUND); | 76 | + return new ResponseEntity<>(ResultModel.error(ResultStatus.REPORT_FORMAT_ERROR),HttpStatus.OK); |
77 | } | 77 | } |
78 | /* | 78 | /* |
79 | * 解析报告数据 | 79 | * 解析报告数据 |
@@ -85,7 +85,7 @@ public class ReportService implements IReportService { | @@ -85,7 +85,7 @@ public class ReportService implements IReportService { | ||
85 | if (reportData == null) { | 85 | if (reportData == null) { |
86 | redis.boundValueOps(reportWrongFormat).set(""); | 86 | redis.boundValueOps(reportWrongFormat).set(""); |
87 | // 返回,报告格式有问题。 | 87 | // 返回,报告格式有问题。 |
88 | - return new ResponseEntity<>(ResultModel.error(ResultStatus.REPORT_FORMAT_ERROR), HttpStatus.NOT_FOUND); | 88 | + return new ResponseEntity<>(ResultModel.error(ResultStatus.REPORT_FORMAT_ERROR),HttpStatus.OK); |
89 | } | 89 | } |
90 | /* | 90 | /* |
91 | * 检验会员存在性 | 91 | * 检验会员存在性 |
@@ -94,7 +94,7 @@ public class ReportService implements IReportService { | @@ -94,7 +94,7 @@ public class ReportService implements IReportService { | ||
94 | if (user == null) { | 94 | if (user == null) { |
95 | redis.boundValueOps(reportWithNoUser).set(""); | 95 | redis.boundValueOps(reportWithNoUser).set(""); |
96 | // 返回,报告对应会员不存在。 | 96 | // 返回,报告对应会员不存在。 |
97 | - return new ResponseEntity<>(ResultModel.error(ResultStatus.INVALID_USER_ERROR), HttpStatus.NOT_FOUND); | 97 | + return new ResponseEntity<>(ResultModel.error(ResultStatus.INVALID_USER_ERROR),HttpStatus.OK); |
98 | } | 98 | } |
99 | 99 | ||
100 | /* | 100 | /* |
@@ -106,7 +106,7 @@ public class ReportService implements IReportService { | @@ -106,7 +106,7 @@ public class ReportService implements IReportService { | ||
106 | return new ResponseEntity<>(ResultModel.ok(new ReportIdModel(reportId)), HttpStatus.OK); | 106 | return new ResponseEntity<>(ResultModel.ok(new ReportIdModel(reportId)), HttpStatus.OK); |
107 | } else { | 107 | } else { |
108 | // 返回,服务器存储问题。 | 108 | // 返回,服务器存储问题。 |
109 | - return new ResponseEntity<>(ResultModel.error(ResultStatus.DB_ERROR), HttpStatus.NOT_FOUND); | 109 | + return new ResponseEntity<>(ResultModel.error(ResultStatus.DB_ERROR),HttpStatus.OK); |
110 | } | 110 | } |
111 | } | 111 | } |
112 | 112 | ||
@@ -124,7 +124,7 @@ public class ReportService implements IReportService { | @@ -124,7 +124,7 @@ public class ReportService implements IReportService { | ||
124 | // 2. 验证admin | 124 | // 2. 验证admin |
125 | if (report.getCreateBy() != admin.getId()) { | 125 | if (report.getCreateBy() != admin.getId()) { |
126 | // 非此admin创建,不能删除,返回 | 126 | // 非此admin创建,不能删除,返回 |
127 | - return new ResponseEntity<>(ResultModel.error(ResultStatus.INVALID_ADMIN_RPDEL_ERROR), HttpStatus.NOT_FOUND); | 127 | + return new ResponseEntity<>(ResultModel.error(ResultStatus.INVALID_ADMIN_RPDEL_ERROR),HttpStatus.OK); |
128 | } | 128 | } |
129 | // 3. 删除report和detail,返回ok | 129 | // 3. 删除report和detail,返回ok |
130 | reportRepository.delete(report); | 130 | reportRepository.delete(report); |
-
Please register or login to post a comment