|
@@ -2,12 +2,14 @@ package com.xkl.controller; |
|
@@ -2,12 +2,14 @@ package com.xkl.controller; |
2
|
|
2
|
|
3
|
import com.wordnik.swagger.annotations.ApiOperation;
|
3
|
import com.wordnik.swagger.annotations.ApiOperation;
|
4
|
import com.xkl.authorization.annotation.LogAnnotation;
|
4
|
import com.xkl.authorization.annotation.LogAnnotation;
|
|
|
5
|
+import com.xkl.authorization.annotation.Sign;
|
5
|
import com.xkl.config.Constants;
|
6
|
import com.xkl.config.Constants;
|
6
|
import com.xkl.domain.*;
|
7
|
import com.xkl.domain.*;
|
7
|
import com.xkl.model.ReportDetailModel;
|
8
|
import com.xkl.model.ReportDetailModel;
|
8
|
import com.xkl.model.ReportModel;
|
9
|
import com.xkl.model.ReportModel;
|
9
|
import com.xkl.model.ResultModel;
|
10
|
import com.xkl.model.ResultModel;
|
10
|
import com.xkl.repository.*;
|
11
|
import com.xkl.repository.*;
|
|
|
12
|
+import com.xkl.security.AntiXSS;
|
11
|
import com.xkl.service.IScoreService;
|
13
|
import com.xkl.service.IScoreService;
|
12
|
import org.springframework.beans.factory.annotation.Autowired;
|
14
|
import org.springframework.beans.factory.annotation.Autowired;
|
13
|
import org.springframework.http.HttpStatus;
|
15
|
import org.springframework.http.HttpStatus;
|
|
@@ -43,22 +45,19 @@ public class DataShareController { |
|
@@ -43,22 +45,19 @@ public class DataShareController { |
43
|
private IScoreService scoreService;
|
45
|
private IScoreService scoreService;
|
44
|
|
46
|
|
45
|
@LogAnnotation
|
47
|
@LogAnnotation
|
46
|
- //@AntiXSS
|
|
|
47
|
- //@Sign
|
48
|
+ @AntiXSS
|
|
|
49
|
+ @Sign
|
48
|
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
50
|
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
49
|
@ApiOperation(value = "体检报告列表共享接口")
|
51
|
@ApiOperation(value = "体检报告列表共享接口")
|
50
|
public ResponseEntity<ResultModel> getReportList(HttpServletRequest request,
|
52
|
public ResponseEntity<ResultModel> getReportList(HttpServletRequest request,
|
51
|
@RequestParam String sign, @RequestParam long t, @RequestParam int type) {
|
53
|
@RequestParam String sign, @RequestParam long t, @RequestParam int type) {
|
52
|
- //if (!(boolean) request.getAttribute("signAspect"))
|
|
|
53
|
- //return new ResponseEntity<>(ResultModel.error(SIGN_ERROR), HttpStatus.OK);
|
54
|
+ if (!(boolean) request.getAttribute("signAspect"))
|
|
|
55
|
+ return new ResponseEntity<>(ResultModel.error(SIGN_ERROR), HttpStatus.OK);
|
54
|
XklApiKeyEntity xklApiKey = xklApiKeyRespository.findOne((long)type);
|
56
|
XklApiKeyEntity xklApiKey = xklApiKeyRespository.findOne((long)type);
|
55
|
List<XklAmpReportEntity> xklAmpReportResult = new ArrayList<>();
|
57
|
List<XklAmpReportEntity> xklAmpReportResult = new ArrayList<>();
|
56
|
if(xklApiKey.getActiveStatus()!=1){
|
58
|
if(xklApiKey.getActiveStatus()!=1){
|
57
|
return new ResponseEntity<>(ResultModel.error(SIGN_NO_ACTIVE), HttpStatus.OK);
|
59
|
return new ResponseEntity<>(ResultModel.error(SIGN_NO_ACTIVE), HttpStatus.OK);
|
58
|
}
|
60
|
}
|
59
|
- if(xklApiKey.getAccessStatus()!=3){
|
|
|
60
|
- return new ResponseEntity<>(ResultModel.error(SIGN_NO_ACCESS), HttpStatus.OK);
|
|
|
61
|
- }
|
|
|
62
|
|
61
|
|
63
|
long companyId = xklApiKey.getCompanyId();
|
62
|
long companyId = xklApiKey.getCompanyId();
|
64
|
XklCompanyEntity xklCompany = xklCompanyRespository.findOne(companyId);
|
63
|
XklCompanyEntity xklCompany = xklCompanyRespository.findOne(companyId);
|
|
@@ -87,23 +86,20 @@ public class DataShareController { |
|
@@ -87,23 +86,20 @@ public class DataShareController { |
87
|
}
|
86
|
}
|
88
|
|
87
|
|
89
|
@LogAnnotation
|
88
|
@LogAnnotation
|
90
|
- //@AntiXSS
|
|
|
91
|
- //@Sign
|
89
|
+ @AntiXSS
|
|
|
90
|
+ @Sign
|
92
|
@RequestMapping(value = "/detail", method = RequestMethod.GET)
|
91
|
@RequestMapping(value = "/detail", method = RequestMethod.GET)
|
93
|
@ApiOperation(value = "体检报告详情共享接口")
|
92
|
@ApiOperation(value = "体检报告详情共享接口")
|
94
|
public ResponseEntity<ResultModel> getReportDetail(HttpServletRequest request, @RequestParam long report_id,
|
93
|
public ResponseEntity<ResultModel> getReportDetail(HttpServletRequest request, @RequestParam long report_id,
|
95
|
@RequestParam String sign, @RequestParam long t, @RequestParam int type) {
|
94
|
@RequestParam String sign, @RequestParam long t, @RequestParam int type) {
|
96
|
- //if (!(boolean) request.getAttribute("signAspect"))
|
|
|
97
|
- // return new ResponseEntity<>(ResultModel.error(SIGN_ERROR), HttpStatus.OK);
|
95
|
+ if (!(boolean) request.getAttribute("signAspect"))
|
|
|
96
|
+ return new ResponseEntity<>(ResultModel.error(SIGN_ERROR), HttpStatus.OK);
|
98
|
XklAmpReportEntity report = xklAmpReportRespository.findOne(report_id);
|
97
|
XklAmpReportEntity report = xklAmpReportRespository.findOne(report_id);
|
99
|
|
98
|
|
100
|
XklApiKeyEntity xklApiKey = xklApiKeyRespository.findOne((long)type);
|
99
|
XklApiKeyEntity xklApiKey = xklApiKeyRespository.findOne((long)type);
|
101
|
if(xklApiKey.getActiveStatus()!=1){
|
100
|
if(xklApiKey.getActiveStatus()!=1){
|
102
|
return new ResponseEntity<>(ResultModel.error(SIGN_NO_ACTIVE), HttpStatus.OK);
|
101
|
return new ResponseEntity<>(ResultModel.error(SIGN_NO_ACTIVE), HttpStatus.OK);
|
103
|
}
|
102
|
}
|
104
|
- if(xklApiKey.getAccessStatus()!=3){
|
|
|
105
|
- return new ResponseEntity<>(ResultModel.error(SIGN_NO_ACCESS), HttpStatus.OK);
|
|
|
106
|
- }
|
|
|
107
|
|
103
|
|
108
|
long companyId = xklApiKey.getCompanyId();
|
104
|
long companyId = xklApiKey.getCompanyId();
|
109
|
XklCompanyEntity company = xklCompanyRespository.findOne(companyId);
|
105
|
XklCompanyEntity company = xklCompanyRespository.findOne(companyId);
|