|
@@ -8,12 +8,14 @@ import com.xkl.authorization.annotation.CurrentUser; |
|
@@ -8,12 +8,14 @@ import com.xkl.authorization.annotation.CurrentUser; |
8
|
import com.xkl.config.Constants;
|
8
|
import com.xkl.config.Constants;
|
9
|
import com.xkl.domain.*;
|
9
|
import com.xkl.domain.*;
|
10
|
import com.xkl.model.ReportDetailModel;
|
10
|
import com.xkl.model.ReportDetailModel;
|
|
|
11
|
+import com.xkl.model.ReportItemGraphModel;
|
11
|
import com.xkl.model.ReportModel;
|
12
|
import com.xkl.model.ReportModel;
|
12
|
import com.xkl.model.ResultModel;
|
13
|
import com.xkl.model.ResultModel;
|
13
|
import com.xkl.repository.XklAmpReportDetailRespository;
|
14
|
import com.xkl.repository.XklAmpReportDetailRespository;
|
14
|
import com.xkl.repository.XklAmpReportHealthScoreRespository;
|
15
|
import com.xkl.repository.XklAmpReportHealthScoreRespository;
|
15
|
import com.xkl.repository.XklAmpReportRespository;
|
16
|
import com.xkl.repository.XklAmpReportRespository;
|
16
|
import com.xkl.service.IScoreService;
|
17
|
import com.xkl.service.IScoreService;
|
|
|
18
|
+import com.xkl.tools.UtilTools;
|
17
|
import org.springframework.beans.factory.annotation.Autowired;
|
19
|
import org.springframework.beans.factory.annotation.Autowired;
|
18
|
import org.springframework.http.HttpStatus;
|
20
|
import org.springframework.http.HttpStatus;
|
19
|
import org.springframework.http.ResponseEntity;
|
21
|
import org.springframework.http.ResponseEntity;
|
|
@@ -134,5 +136,34 @@ public class ReportController { |
|
@@ -134,5 +136,34 @@ public class ReportController { |
134
|
return new ResponseEntity<>(ResultModel.ok(result), HttpStatus.OK);
|
136
|
return new ResponseEntity<>(ResultModel.ok(result), HttpStatus.OK);
|
135
|
}
|
137
|
}
|
136
|
|
138
|
|
|
|
139
|
+ @RequestMapping(value="/itemGraph",method = RequestMethod.GET)
|
|
|
140
|
+ @Authorization
|
|
|
141
|
+ //@Sign
|
|
|
142
|
+ @ApiOperation(value = "指标曲线查询接口")
|
|
|
143
|
+ @ApiImplicitParams({
|
|
|
144
|
+ @ApiImplicitParam(name = "authorization", value = "请输入登录返回信息:userId_tokens", required = true, dataType = "string", paramType = "header"),
|
|
|
145
|
+ })
|
|
|
146
|
+ public ResponseEntity<ResultModel> getReportItemGraph(HttpServletRequest request, @CurrentUser User user,@RequestParam int itemId,@RequestParam String stime,@RequestParam String etime,
|
|
|
147
|
+ @RequestParam String sign, @RequestParam long t, @RequestParam int type) {
|
|
|
148
|
+ long member_id=user.getMemberId();
|
|
|
149
|
+ List<XklAmpReportEntity> xklAmpReportEntity=xklAmpReportRespository.findByMemberId(member_id);
|
|
|
150
|
+ List<ReportItemGraphModel> reportItemGraphModelList =new ArrayList<>();
|
|
|
151
|
+
|
|
|
152
|
+ if(xklAmpReportEntity!=null && xklAmpReportEntity.size()>0){
|
|
|
153
|
+ for(XklAmpReportEntity report:xklAmpReportEntity){
|
|
|
154
|
+ long reportTime= UtilTools.getLongTime(report.getUptime());
|
|
|
155
|
+ long stimeLong= UtilTools.getLongTime(stime);
|
|
|
156
|
+ long etimeLong= UtilTools.getLongTime(etime);
|
|
|
157
|
+ long reportId= report.getId();
|
|
|
158
|
+ if(reportTime>=stimeLong&&reportTime<=etimeLong){//在时间范围内
|
|
|
159
|
+ XklAmpReportDetailEntity reportDetail = xklAmpReportDetailRespository.findByReportIdAndItemId(reportId,itemId);
|
|
|
160
|
+ ReportItemGraphModel reportItemGraphModel= new ReportItemGraphModel(reportTime,reportDetail.getItemValue());
|
|
|
161
|
+ reportItemGraphModelList.add(reportItemGraphModel);
|
|
|
162
|
+ }
|
|
|
163
|
+ }
|
|
|
164
|
+ }
|
|
|
165
|
+ return new ResponseEntity<>(ResultModel.ok(reportItemGraphModelList), HttpStatus.OK);
|
|
|
166
|
+ }
|
|
|
167
|
+
|
137
|
|
168
|
|
138
|
} |
169
|
} |