|
@@ -9,6 +9,7 @@ import com.xkl.model.ReportIdModel; |
|
@@ -9,6 +9,7 @@ import com.xkl.model.ReportIdModel; |
9
|
import com.xkl.model.ResultModel;
|
9
|
import com.xkl.model.ResultModel;
|
10
|
import com.xkl.repository.*;
|
10
|
import com.xkl.repository.*;
|
11
|
import com.xkl.security.SecurityTool;
|
11
|
import com.xkl.security.SecurityTool;
|
|
|
12
|
+import lombok.extern.apachecommons.CommonsLog;
|
12
|
import org.springframework.beans.factory.annotation.Autowired;
|
13
|
import org.springframework.beans.factory.annotation.Autowired;
|
13
|
import org.springframework.data.redis.core.RedisTemplate;
|
14
|
import org.springframework.data.redis.core.RedisTemplate;
|
14
|
import org.springframework.http.HttpStatus;
|
15
|
import org.springframework.http.HttpStatus;
|
|
@@ -22,6 +23,7 @@ import java.util.*; |
|
@@ -22,6 +23,7 @@ import java.util.*; |
22
|
* Created by zhao yue on 2016/11/13.
|
23
|
* Created by zhao yue on 2016/11/13.
|
23
|
*/
|
24
|
*/
|
24
|
@Service
|
25
|
@Service
|
|
|
26
|
+@CommonsLog
|
25
|
public class ReportService implements IReportService {
|
27
|
public class ReportService implements IReportService {
|
26
|
@Autowired
|
28
|
@Autowired
|
27
|
private ReportMetaItemsRepository reportMetaItemsRepository;
|
29
|
private ReportMetaItemsRepository reportMetaItemsRepository;
|
|
@@ -67,7 +69,7 @@ public class ReportService implements IReportService { |
|
@@ -67,7 +69,7 @@ public class ReportService implements IReportService { |
67
|
XklAmpReportEntity report = reportRepository.findByMd5AndStatus(reportMd5, Constants.STATUS_OK);
|
69
|
XklAmpReportEntity report = reportRepository.findByMd5AndStatus(reportMd5, Constants.STATUS_OK);
|
68
|
if (report != null && report.getStatus() > 0) {
|
70
|
if (report != null && report.getStatus() > 0) {
|
69
|
// 返回,报告已存在。
|
71
|
// 返回,报告已存在。
|
70
|
- return new ResponseEntity<>(ResultModel.ok(new ReportIdModel(report.getId())), HttpStatus.OK);
|
72
|
+ return new ResponseEntity<>(ResultModel.error(ResultStatus.REPORT_EXISTED_ERROR, new ReportIdModel(report.getId())), HttpStatus.OK);
|
71
|
} else if (redis.hasKey(reportWithNoUser)) {
|
73
|
} else if (redis.hasKey(reportWithNoUser)) {
|
72
|
// 返回,报告对应会员不存在。
|
74
|
// 返回,报告对应会员不存在。
|
73
|
return new ResponseEntity<>(ResultModel.error(ResultStatus.INVALID_USER_ERROR), HttpStatus.OK);
|
75
|
return new ResponseEntity<>(ResultModel.error(ResultStatus.INVALID_USER_ERROR), HttpStatus.OK);
|
|
@@ -118,7 +120,7 @@ public class ReportService implements IReportService { |
|
@@ -118,7 +120,7 @@ public class ReportService implements IReportService { |
118
|
XklAmpReportEntity report = reportRepository.findById(report_id);
|
120
|
XklAmpReportEntity report = reportRepository.findById(report_id);
|
119
|
if (report == null || report.getStatus() == 0) {
|
121
|
if (report == null || report.getStatus() == 0) {
|
120
|
// 报告不存在,返回
|
122
|
// 报告不存在,返回
|
121
|
- return new ResponseEntity<>(ResultModel.error(ResultStatus.REPORT_INVALID__ERROR), HttpStatus.OK);
|
123
|
+ return new ResponseEntity<>(ResultModel.error(ResultStatus.REPORT_INVALID_ERROR), HttpStatus.OK);
|
122
|
}
|
124
|
}
|
123
|
|
125
|
|
124
|
// 2. 验证admin
|
126
|
// 2. 验证admin
|
|
@@ -215,6 +217,7 @@ public class ReportService implements IReportService { |
|
@@ -215,6 +217,7 @@ public class ReportService implements IReportService { |
215
|
}
|
217
|
}
|
216
|
}
|
218
|
}
|
217
|
} catch (Exception e) {
|
219
|
} catch (Exception e) {
|
|
|
220
|
+ log.info("ERROR, JSON FROMAT ERROR!!!"+e);
|
218
|
return null;
|
221
|
return null;
|
219
|
}
|
222
|
}
|
220
|
markItemStatus(sex, detailList);
|
223
|
markItemStatus(sex, detailList);
|