Commit eb3a4bfa authored by chenzhao's avatar chenzhao

修改代码

parent 18f8a09d
package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthIndex;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvPointProcessVariableClassification;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthIndexMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -31,6 +35,8 @@ public class AnalyseController extends BaseController {
@Autowired
CommonServiceImpl commonServiceImpl;
@Autowired
IdxBizFanHealthIndexMapper idxBizFanHealthIndexMapper;
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "工况测点区间划分-风机", notes = "工况测点区间划分-风机")
......@@ -154,4 +160,38 @@ public class AnalyseController extends BaseController {
public ResponseModel<Map<String, String>> getUnitByIndexAddress(@RequestParam String stationType, @RequestParam String pointId) {
return ResponseHelper.buildResponse(commonServiceImpl.getUnitByIndexAddress(stationType, pointId));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "post", value = "获取influxdb数据", notes = "获取influxdb数据")
@PostMapping(value = "/getInfluxdbDataByConditon")
public ResponseModel<Map<String, Object>> getDataByConditon(@RequestParam String stationType, @RequestParam(required = false) String pointId, @RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime,@RequestBody Map<String,Object> map ) {
if ("FD".equals(stationType)){
LambdaQueryWrapper<IdxBizFanHealthIndex> indexLambdaQueryWrapper = new LambdaQueryWrapper<>();
indexLambdaQueryWrapper.eq(IdxBizFanHealthIndex::getStation,map.get("STATION"));
indexLambdaQueryWrapper.eq(IdxBizFanHealthIndex::getEquipmentName,map.get("EQUIPNAME"));
indexLambdaQueryWrapper.eq(IdxBizFanHealthIndex::getPointName,map.get("EQUIPINDEX")).last("limit 1");
List<IdxBizFanHealthIndex> idxBizFanHealthIndices = idxBizFanHealthIndexMapper.selectList(indexLambdaQueryWrapper);
if (CollectionUtils.isNotEmpty(idxBizFanHealthIndices)){
pointId = idxBizFanHealthIndices.get(0).getIndexAddress();
}
}
if (StringUtils.isEmpty(startTime) && StringUtils.isEmpty(endTime) ){
Date currentDayStartTime = null;
try {
currentDayStartTime = DateUtils.minDateOfMonth(new Date());
} catch (Exception e) {
e.printStackTrace();
}
Date currentDayEndTime = DateUtils.getCurrentMonthEndTime(new Date());
startTime = DateUtils.convertDateToString(currentDayStartTime, DateUtils.DATE_TIME_PATTERN);
endTime = DateUtils.convertDateToString(currentDayEndTime, DateUtils.DATE_TIME_PATTERN);
}
return ResponseHelper.buildResponse(commonServiceImpl.getInfluxdbDataByConditon(stationType,pointId,startTime, endTime)) ;
}
}
......@@ -100,6 +100,7 @@ public class IdxBizFanWarningRuleSetController extends BaseController {
page.setCurrent(current);
page.setSize(size);
List<Map<String,Object>> data = idxBizFanWarningRuleSetServiceImpl.queryList(current,current*size);
page.setRecords(data);
int i = idxBizFanWarningRuleSetServiceImpl.queryListCount();
page.setTotal(i);
return ResponseHelper.buildResponse(page);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment