...
|
...
|
@@ -8,12 +8,14 @@ import com.xkl.authorization.annotation.CurrentUser; |
|
|
import com.xkl.config.Constants;
|
|
|
import com.xkl.domain.*;
|
|
|
import com.xkl.model.ReportDetailModel;
|
|
|
import com.xkl.model.ReportItemGraphModel;
|
|
|
import com.xkl.model.ReportModel;
|
|
|
import com.xkl.model.ResultModel;
|
|
|
import com.xkl.repository.XklAmpReportDetailRespository;
|
|
|
import com.xkl.repository.XklAmpReportHealthScoreRespository;
|
|
|
import com.xkl.repository.XklAmpReportRespository;
|
|
|
import com.xkl.service.IScoreService;
|
|
|
import com.xkl.tools.UtilTools;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.ResponseEntity;
|
...
|
...
|
@@ -134,5 +136,34 @@ public class ReportController { |
|
|
return new ResponseEntity<>(ResultModel.ok(result), HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value="/itemGraph",method = RequestMethod.GET)
|
|
|
@Authorization
|
|
|
//@Sign
|
|
|
@ApiOperation(value = "指标曲线查询接口")
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "authorization", value = "请输入登录返回信息:userId_tokens", required = true, dataType = "string", paramType = "header"),
|
|
|
})
|
|
|
public ResponseEntity<ResultModel> getReportItemGraph(HttpServletRequest request, @CurrentUser User user,@RequestParam int itemId,@RequestParam String stime,@RequestParam String etime,
|
|
|
@RequestParam String sign, @RequestParam long t, @RequestParam int type) {
|
|
|
long member_id=user.getMemberId();
|
|
|
List<XklAmpReportEntity> xklAmpReportEntity=xklAmpReportRespository.findByMemberId(member_id);
|
|
|
List<ReportItemGraphModel> reportItemGraphModelList =new ArrayList<>();
|
|
|
|
|
|
if(xklAmpReportEntity!=null && xklAmpReportEntity.size()>0){
|
|
|
for(XklAmpReportEntity report:xklAmpReportEntity){
|
|
|
long reportTime= UtilTools.getLongTime(report.getUptime());
|
|
|
long stimeLong= UtilTools.getLongTime(stime);
|
|
|
long etimeLong= UtilTools.getLongTime(etime);
|
|
|
long reportId= report.getId();
|
|
|
if(reportTime>=stimeLong&&reportTime<=etimeLong){//在时间范围内
|
|
|
XklAmpReportDetailEntity reportDetail = xklAmpReportDetailRespository.findByReportIdAndItemId(reportId,itemId);
|
|
|
ReportItemGraphModel reportItemGraphModel= new ReportItemGraphModel(reportTime,reportDetail.getItemValue());
|
|
|
reportItemGraphModelList.add(reportItemGraphModel);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return new ResponseEntity<>(ResultModel.ok(reportItemGraphModelList), HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
|
|
|
} |
...
|
...
|
|