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