钢结构自动化监测系统

This commit is contained in:
guo 2024-01-22 15:32:53 +08:00
parent 5a4e70b117
commit cdce5ab672
59 changed files with 4492 additions and 0 deletions

View File

@ -0,0 +1,211 @@
package com.zhgd.xmgl.modules.steelstructure.controller;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.NumberUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureCurrentData;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureSensor;
import com.zhgd.xmgl.modules.steelstructure.entity.qo.CurrentDataListQO;
import com.zhgd.xmgl.modules.steelstructure.entity.vo.CurrentDataListVO;
import com.zhgd.xmgl.modules.steelstructure.entity.vo.DataAlarmVO;
import com.zhgd.xmgl.modules.steelstructure.service.SteelStructureSensorService;
import com.zhgd.xmgl.modules.steelstructure.service.ISteelStructureCurrentDataService;
import com.zhgd.xmgl.modules.highformwork.entity.vo.NumberDifferentTypesAlarmsRadarChartOneMonthVo;
import com.zhgd.xmgl.modules.taskprogress.entity.TaskProgressMaterialRel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Title: Controller
* @Description: 钢结构自动化监测系统-监测实时数据
* @author pds
* @date 2021-10-08
* @version V1.0
*/
@RestController
@RequestMapping("/xmgl/steelStructureCurrentData")
@Slf4j
@Api(tags = "钢结构自动化监测系统-监测实时数据")
public class SteelStructureCurrentDataController {
@Autowired
private ISteelStructureCurrentDataService steelStructureCurrentDataService;
@Autowired
private SteelStructureSensorService steelStructureSensorService;
@ApiOperation(value = "分页列表查询钢结构自动化监测系统-传感器实时数据信息 form data", notes = "分页列表查询钢结构自动化监测系统-传感器实时数据信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "query", dataType = "string", required = true),
@ApiImplicitParam(name = "measurePointName", value = "测点名称", paramType = "query", dataType = "string"),
@ApiImplicitParam(name = "steelStructureSensorTypeId", value = "钢结构自动化监测系统-传感器类型id", paramType = "query", dataType = "long"),
@ApiImplicitParam(name = "startDate", value = "开始时间yyyy-MM-dd HH:mm:ss", paramType = "query", dataType = "string"),
@ApiImplicitParam(name = "endDate", value = "结束时间yyyy-MM-dd HH:mm:ss", paramType = "query", dataType = "string"),
@ApiImplicitParam(name = "pageNo", value = "当前页", paramType = "query", dataType = "int"),
@ApiImplicitParam(name = "pageSize", value = "页大小", paramType = "query", dataType = "int")
})
@PostMapping(value = "/selectPage")
public Result<IPage<SteelStructureCurrentData>> selectPage(String measurePointName, Long steelStructureSensorTypeId, String startDate, String endDate, String projectSn, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
return Result.success(steelStructureCurrentDataService.selectPageByProjectSn(measurePointName, steelStructureSensorTypeId, startDate, endDate, projectSn, pageNo, pageSize));
}
@ApiOperation(value = "分页列表查询钢结构自动化监测系统-监测实时数据信息", notes = "分页列表查询钢结构自动化监测系统-监测实时数据信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "alarmState", value = "报警状态0-正常1-预警2-报警3-控制", paramType = "body", required = false, dataType = "Integer"),
@ApiImplicitParam(name = "steelStructureMonitorTypeId", value = "钢结构自动化监测系统-监测类型表id", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "measurePointNumber", value = "测点编号", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "startTime", value = "开始时间,格式2020-08-16 00:00:00", dataType = "String", paramType = "body", required = false),
@ApiImplicitParam(name = "endTime", value = "结束时间,格式2020-08-16 23:59:59", dataType = "String", paramType = "body", required = false),
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "body", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "body", required = true, dataType = "Integer"),
})
@PostMapping(value = "/list")
public Result<IPage<SteelStructureCurrentData>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
return Result.success(steelStructureCurrentDataService.selectSteelStructureCurrentDataPage(map));
}
/**
* 添加
*
* @param steelStructureCurrentData
* @return
*/
@ApiOperation(value = "添加钢结构自动化监测系统-监测实时数据信息", notes = "添加钢结构自动化监测系统-监测实时数据信息", httpMethod = "POST")
@PostMapping(value = "/add")
public Result<SteelStructureCurrentData> add(@RequestBody SteelStructureCurrentData steelStructureCurrentData) {
steelStructureCurrentDataService.saveSteelStructureCurrentData(steelStructureCurrentData);
return Result.success(steelStructureCurrentData);
}
/**
* 编辑
*
* @param taskProgressMaterialRel
* @return
*/
@ApiOperation(value = "编辑钢结构自动化监测系统-监测实时数据", notes = "编辑钢结构自动化监测系统-监测实时数据", httpMethod = "POST")
@PostMapping(value = "/edit")
public Result<SteelStructureCurrentData> edit(@RequestBody SteelStructureCurrentData taskProgressMaterialRel) {
steelStructureCurrentDataService.updateById(taskProgressMaterialRel);
return Result.ok();
}
/**
* 通过id删除
*
* @return
*/
@ApiOperation(value = "删除钢结构自动化监测系统-监测实时数据", notes = "删除钢结构自动化监测系统-监测实时数据", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "钢结构自动化监测系统-监测实时数据id", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
@PostMapping(value = "/delete")
public Result<SteelStructureCurrentData> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
String id = MapUtils.getString(map, "id");
Result<SteelStructureCurrentData> result = new Result<>();
SteelStructureCurrentData taskProgressMaterialRel = steelStructureCurrentDataService.getById(id);
if (taskProgressMaterialRel == null) {
result.error500("未找到对应实体");
} else {
boolean ok = steelStructureCurrentDataService.removeById(id);
if (ok) {
result.success("删除成功!");
}
}
return result;
}
@ApiOperation(value = "通过分页信息查询所有相关数据(项目监测详情-数据列表、钢结构自动化监测系统配置-实时数据)", notes = "通过分页信息查询所有相关数据(项目监测详情-数据列表、钢结构自动化监测系统配置-实时数据)")
@PostMapping(value = "/selectSteelStructureCurrentDataList")
public Result<CurrentDataListVO> selectSteelStructureCurrentDataList(@RequestBody CurrentDataListQO currentDataListQO) {
CurrentDataListVO currentDataListVO = new CurrentDataListVO();
String sensorSn = currentDataListQO.getSensorSn();
String measurePointNumber = currentDataListQO.getMeasurePointNumber();
IPage<SteelStructureCurrentData> page = steelStructureCurrentDataService.selectSteelStructureCurrentDataList(currentDataListQO.getProjectSn()
, measurePointNumber, sensorSn, currentDataListQO.getSteelStructureEngineeringToMonitorTypeId(), currentDataListQO.getStartTime()
, currentDataListQO.getEndTime(), currentDataListQO.getAlarmState(), currentDataListQO.getPageNo(), currentDataListQO.getPageSize());
currentDataListVO.setData(page);
if (StringUtils.isNotBlank(sensorSn)) {
List<SteelStructureCurrentData> records = page.getRecords();
if (CollUtil.isNotEmpty(records)) {
currentDataListVO.setUnit(records.get(0).getUnit());
currentDataListVO.setPositiveAlarmValue(NumberUtil.add(records.get(0).getAlarmValue(), records.get(0).getFiducialValue()).doubleValue());
currentDataListVO.setNegativeAlarmValue(NumberUtil.add(NumberUtil.mul(records.get(0).getAlarmValue().floatValue(), -1), records.get(0).getFiducialValue().floatValue()));
} else {
SteelStructureSensor sensor = steelStructureSensorService.getUnitAndAlarmValueBySnAndPointNumber(sensorSn, measurePointNumber);
if (sensor != null) {
currentDataListVO.setUnit(sensor.getUnit());
currentDataListVO.setPositiveAlarmValue(NumberUtil.add(sensor.getAlarmValue(), sensor.getFiducialValue()).doubleValue());
currentDataListVO.setNegativeAlarmValue(NumberUtil.add(NumberUtil.mul(sensor.getAlarmValue().floatValue(), -1), sensor.getFiducialValue().floatValue()));
} else {
currentDataListVO.setUnit("");
currentDataListVO.setPositiveAlarmValue(0d);
currentDataListVO.setNegativeAlarmValue(0d);
}
}
}
return Result.success(currentDataListVO);
}
@ApiOperation(value = "项目版-导出数据", notes = "项目版-导出数据")
@GetMapping(value = "/exportData")
public void exportData(HttpServletResponse response, CurrentDataListQO currentDataListQO) {
steelStructureCurrentDataService.exportData(response, currentDataListQO.getProjectSn(), currentDataListQO.getMeasurePointNumber(), currentDataListQO.getSensorSn(), currentDataListQO.getSteelStructureEngineeringToMonitorTypeId()
, currentDataListQO.getStartTime(), currentDataListQO.getEndTime(), currentDataListQO.getAlarmState());
}
@ApiOperation(value = "gxlt大屏导出", notes = "gxlt大屏导出", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "测点名称", paramType = "query", dataType = "string", required = true),
@ApiImplicitParam(name = "measurePointName", value = "测点名称", paramType = "query", dataType = "string"),
@ApiImplicitParam(name = "steelStructureSensorTypeId", value = "钢结构自动化监测系统-传感器类型id", paramType = "query", dataType = "long"),
@ApiImplicitParam(name = "startDate", value = "开始时间yyyy-MM-dd HH:mm:ss", paramType = "query", dataType = "string"),
@ApiImplicitParam(name = "endDate", value = "结束时间yyyy-MM-dd HH:mm:ss", paramType = "query", dataType = "string")
})
@GetMapping(value = "/zwExportData")
public void zwExportData(HttpServletResponse response, String measurePointName, Long steelStructureSensorType, String startDate, String endDate, String projectSn) {
steelStructureCurrentDataService.zwExportData(response, measurePointName, steelStructureSensorType, startDate, endDate, projectSn);
}
@GetMapping(value = "/getDataAlarmNumber")
public Result<DataAlarmVO> getDataAlarmNumber() {
return Result.success(steelStructureCurrentDataService.getDataAlarmNumber());
}
@ApiOperation(value = "查询报警周期趋势图(近一月不同类型报警数量)", notes = "查询报警周期趋势图(近一月不同类型报警数量)", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String"),
@ApiImplicitParam(name = "steelStructurePlaneFigureId", value = "钢结构自动化监测系统-平面图配置ID", paramType = "query", required = true, dataType = "String"),
})
@GetMapping(value = "/recent/month/alarm/graph")
public Result<List<EntityMap>> getAlarmCycleTrendGraph(@RequestParam Map<String, Object> map) {
return Result.success(steelStructureCurrentDataService.getAlarmCycleTrendGraph(map));
}
@ApiOperation(value = "查询报警类型雷达图(近一月不同类型报警数量)", notes = "查询报警类型雷达图(近一月不同类型报警数量)", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String"),
@ApiImplicitParam(name = "steelStructurePlaneFigureId", value = "钢结构自动化监测系统-平面图配置ID", paramType = "query", required = true, dataType = "String"),
})
@GetMapping(value = "/recent/month/radar")
public Result<List<NumberDifferentTypesAlarmsRadarChartOneMonthVo>> getNumberDifferentTypesAlarmsRadarChartOneMonth(@RequestParam Map<String, Object> map) {
return Result.success(steelStructureCurrentDataService.getNumberDifferentTypesAlarmsRadarChartOneMonth(map));
}
}

View File

@ -0,0 +1,126 @@
package com.zhgd.xmgl.modules.steelstructure.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureEngineering;
import com.zhgd.xmgl.modules.steelstructure.service.ISteelStructureEngineeringService;
import com.zhgd.xmgl.util.MessageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.Map;
/**
* @Title: Controller
* @Description: 钢结构自动化监测系统-工程
* @author pds
* @date 2021-10-08
* @version V1.0
*/
@RestController
@RequestMapping("/xmgl/steelStructureEngineering")
@Slf4j
@Api(tags = "钢结构自动化监测系统-工程")
public class SteelStructureEngineeringController {
@Autowired
private ISteelStructureEngineeringService steelStructureEngineeringService;
@ApiOperation(value = "分页列表查询钢结构自动化监测系统-工程信息", notes = "分页列表查询钢结构自动化监测系统-工程信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "body", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "body", required = true, dataType = "Integer"),
})
@PostMapping(value = "/page")
public Result<IPage<SteelStructureEngineering>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
return Result.success(steelStructureEngineeringService.selectSteelStructureEngineeringPage(map));
}
/**
* 列表查询
*/
@ApiOperation(value = "列表查询钢结构自动化监测系统-工程信息", notes = "列表查询钢结构自动化监测系统-工程信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/list")
public Result<List<SteelStructureEngineering>> selectSteelStructureList(@ApiIgnore @RequestBody Map<String, Object> map) {
return Result.success(steelStructureEngineeringService.selectSteelStructureList(map));
}
/**
* 添加
*
* @param steelStructureEngineering
* @return
*/
@ApiOperation(value = "添加钢结构自动化监测系统-工程信息", notes = "添加钢结构自动化监测系统-工程信息", httpMethod = "POST")
@PostMapping(value = "/add")
public Result<SteelStructureEngineering> add(@RequestBody @Validated SteelStructureEngineering steelStructureEngineering) {
steelStructureEngineeringService.saveSteelStructureEngineering(steelStructureEngineering);
return Result.ok();
}
/**
* 编辑
*
* @param steelStructureEngineering
* @return
*/
@ApiOperation(value = "编辑钢结构自动化监测系统-工程信息", notes = "编辑钢结构自动化监测系统-工程信息", httpMethod = "POST")
@PostMapping(value = "/edit")
public Result<SteelStructureEngineering> edit(@RequestBody SteelStructureEngineering steelStructureEngineering) {
return Result.success(steelStructureEngineeringService.edit(steelStructureEngineering));
}
/**
* 通过id删除
*
* @param
* @return
*/
@ApiOperation(value = "删除钢结构自动化监测系统-工程信息", notes = "删除钢结构自动化监测系统-工程信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "钢结构自动化监测系统-工程ID", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/delete")
public Result<SteelStructureEngineering> delete(@ApiIgnore @RequestBody Map<String, Object> map) {
steelStructureEngineeringService.deleteSteelStructureEngineering(MapUtils.getLong(map, "id"));
return Result.ok();
}
/**
* 通过id查询
*
* @param
* @return
*/
@ApiOperation(value = "通过id查询钢结构自动化监测系统-工程信息", notes = "通过id查询钢结构自动化监测系统-工程信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "钢结构自动化监测系统-工程ID", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/queryById")
public Result<SteelStructureEngineering> queryById(@ApiIgnore @RequestBody Map<String, Object> map) {
Result<SteelStructureEngineering> result = new Result<SteelStructureEngineering>();
SteelStructureEngineering steelStructureEngineering = steelStructureEngineeringService.getById(MapUtils.getString(map, "id"));
if (steelStructureEngineering == null) {
result.error500(MessageUtil.get("notFindErr"));
} else {
result.setResult(steelStructureEngineering);
result.setSuccess(true);
}
return result;
}
}

View File

@ -0,0 +1,134 @@
package com.zhgd.xmgl.modules.steelstructure.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureMeasurePoint;
import com.zhgd.xmgl.modules.steelstructure.entity.qo.SelectMeasurePointListQO;
import com.zhgd.xmgl.modules.steelstructure.service.ISteelStructureMeasurePointService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.Map;
/**
* @Title: Controller
* @Description: 钢结构自动化监测系统-测点
* @author pds
* @date 2021-10-08
* @version V1.0
*/
@RestController
@RequestMapping("/xmgl/steelStructureMeasurePoint")
@Slf4j
@Api(tags = "钢结构自动化监测系统-测点")
public class SteelStructureMeasurePointController {
@Autowired
private ISteelStructureMeasurePointService steelStructureMeasurePointService;
/**
* 钢结构自动化监测系统配置-测点管理列表
*/
@ApiOperation(value = "钢结构自动化监测系统配置-测点管理列表", notes = "钢结构自动化监测系统配置-测点管理列表", httpMethod = "POST")
@PostMapping(value = "/selectMeasurePointList")
public Result<IPage<SteelStructureMeasurePoint>> selectListByPageInfo(@RequestBody SelectMeasurePointListQO selectMeasurePointListQO) {
LambdaQueryWrapper<SteelStructureMeasurePoint> wrapper = Wrappers.<SteelStructureMeasurePoint>lambdaQuery().eq(SteelStructureMeasurePoint::getSteelStructureEngineeringToMonitorTypeId, selectMeasurePointListQO.getSteelStructureEngineeringToMonitorTypeId());
if (StringUtils.isNotBlank(selectMeasurePointListQO.getMeasurePointNumber())) {
wrapper.like(SteelStructureMeasurePoint::getMeasurePointNumber, selectMeasurePointListQO.getMeasurePointNumber());
}
if (selectMeasurePointListQO.getAlarmState() != null) {
wrapper.eq(SteelStructureMeasurePoint::getAlarmState, selectMeasurePointListQO.getAlarmState());
}
return Result.success(steelStructureMeasurePointService.page(new Page<>(selectMeasurePointListQO.getPageNo(), selectMeasurePointListQO.getPageSize()), wrapper));
}
@ApiOperation(value = "钢结构自动化监测系统配置-根据测点编号查询详情", notes = "钢结构自动化监测系统配置-根据测点编号查询详情")
@ApiImplicitParams({
@ApiImplicitParam(name = "measurePointNumber", value = "测点编号", paramType = "query", required = true, dataType = "String")
})
@GetMapping(value = "/getDetailsByMeasurePointNumber")
public Result<SteelStructureMeasurePoint> getDetailsByMeasurePointNumber(String measurePointNumber) {
return Result.success(steelStructureMeasurePointService.getDetailsByMeasurePointNumber(measurePointNumber));
}
@ApiOperation(value = "列表查询钢结构自动化监测系统所有测点信息", notes = "列表查询钢结构自动化监测系统所有测点信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "steelStructureEngineeringToMonitorTypeId", value = "钢结构自动化监测系统-工程和监测类型中间表id", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "steelStructureEngineeringId", value = "钢结构自动化监测系统-工程id", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/selectSteelStructureAllMeasurePointList")
public Result<List<SteelStructureMeasurePoint>> selectSteelStructureAllMeasurePointList(@ApiIgnore @RequestBody Map<String, Object> map) {
return Result.success(steelStructureMeasurePointService.selectSteelStructureAllMeasurePointList(map));
}
/**
* 添加
*
* @param steelStructureMeasurePoint
* @return
*/
@ApiOperation(value = "添加钢结构自动化监测系统-测点信息", notes = "添加钢结构自动化监测系统-测点信息", httpMethod = "POST")
@PostMapping(value = "/add")
public Result<SteelStructureMeasurePoint> add(@RequestBody @Validated SteelStructureMeasurePoint steelStructureMeasurePoint) {
steelStructureMeasurePointService.saveMeasurePoint(steelStructureMeasurePoint);
return Result.ok();
}
/**
* 编辑
*
* @param steelStructureMeasurePoint
* @return
*/
@ApiOperation(value = "编辑测点", notes = "编辑测点", httpMethod = "POST")
@PostMapping(value = "/edit")
public Result<SteelStructureMeasurePoint> edit(@RequestBody SteelStructureMeasurePoint steelStructureMeasurePoint) {
steelStructureMeasurePointService.editMeasurePoint(steelStructureMeasurePoint);
return Result.ok();
}
/**
* 通过id删除
*
* @param
* @return
*/
@ApiOperation(value = "删除钢结构自动化监测系统-测点信息", notes = "删除钢结构自动化监测系统-测点信息")
@ApiImplicitParam(name = "measurePointNumber", value = "钢结构自动化监测系统-测点编号", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/delete")
public Result<SteelStructureMeasurePoint> delete(@ApiIgnore @RequestBody Map<String, Object> map) {
steelStructureMeasurePointService.deleteByMeasurePointNumber(MapUtils.getString(map, "measurePointNumber"));
return Result.ok();
}
/**
* 通过id查询
*
* @param
* @return
*/
@ApiOperation(value = "通过id查询钢结构自动化监测系统-测点信息", notes = "通过id查询钢结构自动化监测系统-测点信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "钢结构自动化监测系统-测点ID", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/queryById")
public Result<SteelStructureMeasurePoint> queryById(@ApiIgnore @RequestBody Map<String, Object> map) {
return Result.success(steelStructureMeasurePointService.selectSteelStructureMeasurePointById(map));
}
}

View File

@ -0,0 +1,145 @@
package com.zhgd.xmgl.modules.steelstructure.controller;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Title: Controller
* @Description: 钢结构自动化监测系统-测点警情设置
* @author pds
* @date 2021-10-08
* @version V1.0
*/
@RestController
@RequestMapping("/xmgl/steelStructureMeasurePointThreshold")
@Slf4j
@Api(tags = "钢结构自动化监测系统-测点警情设置相关Api")
public class SteelStructureMeasurePointThresholdController {
//
//
// /**
// * 分页列表查询
// *
// * @param steelStructureMeasurePointThreshold
// * @param pageNo
// * @param pageSize
// * @param req
// * @return
// */
// @ApiOperation(value = "分页列表查询钢结构自动化监测系统-测点警情设置信息", notes = "分页列表查询钢结构自动化监测系统-测点警情设置信息", httpMethod = "GET")
// @GetMapping(value = "/list")
//
// public Result<IPage<SteelStructureMeasurePointThreshold>> queryList(SteelStructureMeasurePointThreshold steelStructureMeasurePointThreshold,
// @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
// @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
// HttpServletRequest req) {
//
// Result<IPage<SteelStructureMeasurePointThreshold>> result = new Result<IPage<SteelStructureMeasurePointThreshold>>();
// QueryWrapper<SteelStructureMeasurePointThreshold> queryWrapper = QueryGenerator.initQueryWrapper(steelStructureMeasurePointThreshold, req.getParameterMap());
// Page<SteelStructureMeasurePointThreshold> page = new Page<SteelStructureMeasurePointThreshold>(pageNo, pageSize);
// IPage<SteelStructureMeasurePointThreshold> pageList = steelStructureMeasurePointThresholdService.page(page, queryWrapper);
// result.setSuccess(true);
// result.setResult(pageList);
// return null;
// }
//
// /**
// * 添加
// *
// * @param steelStructureMeasurePointThreshold
// * @return
// */
// @ApiOperation(value = "添加钢结构自动化监测系统-测点警情设置信息", notes = "添加钢结构自动化监测系统-测点警情设置信息", httpMethod = "POST")
// @PostMapping(value = "/add")
// public Result<SteelStructureMeasurePointThreshold> add(@RequestBody SteelStructureMeasurePointThreshold steelStructureMeasurePointThreshold) {
// Result<SteelStructureMeasurePointThreshold> result = new Result<SteelStructureMeasurePointThreshold>();
// try {
// //
//// steelStructureMeasurePointThresholdService.save(steelStructureMeasurePointThreshold);
// result.success("添加成功!");
// } catch (Exception e) {
// e.printStackTrace();
// log.info(e.getMessage());
// result.error500("操作失败");
// }
// return result;
// }
//
// /**
// * 编辑
// *
// * @param steelStructureMeasurePointThreshold
// * @return
// */
// @ApiOperation(value = "编辑钢结构自动化监测系统-测点警情设置信息", notes = "编辑钢结构自动化监测系统-测点警情设置信息", httpMethod = "PUT")
// @PutMapping(value = "/edit")
// public Result<SteelStructureMeasurePointThreshold> edit(@RequestBody SteelStructureMeasurePointThreshold steelStructureMeasurePointThreshold) {
//// Result<SteelStructureMeasurePointThreshold> result = new Result<SteelStructureMeasurePointThreshold>();
//// SteelStructureMeasurePointThreshold steelStructureMeasurePointThresholdEntity = steelStructureMeasurePointThresholdService.getById(steelStructureMeasurePointThreshold.getId());
//// if (steelStructureMeasurePointThresholdEntity == null) {
//// result.error500("未找到对应实体");
//// } else {
//// boolean ok = steelStructureMeasurePointThresholdService.updateById(steelStructureMeasurePointThreshold);
////
//// if (ok) {
//// result.success("修改成功!");
//// }
//// }
////
//// return result;
// return null;
// }
//
// /**
// * 通过id删除
// *
// * @param id
// * @return
// */
// @ApiOperation(value = "删除钢结构自动化监测系统-测点警情设置信息", notes = "删除钢结构自动化监测系统-测点警情设置信息", httpMethod = "DELETE")
// @ApiImplicitParam(name = "id", value = "钢结构自动化监测系统-测点警情设置ID", paramType = "query", required = true, dataType = "Integer")
// @DeleteMapping(value = "/delete")
// public Result<SteelStructureMeasurePointThreshold> delete(@RequestParam(name = "id", required = true) String id) {
//// Result<SteelStructureMeasurePointThreshold> result = new Result<SteelStructureMeasurePointThreshold>();
//// SteelStructureMeasurePointThreshold steelStructureMeasurePointThreshold = steelStructureMeasurePointThresholdService.getById(id);
//// if (steelStructureMeasurePointThreshold == null) {
//// result.error500("未找到对应实体");
//// } else {
//// boolean ok = steelStructureMeasurePointThresholdService.removeById(id);
//// if (ok) {
//// result.success("删除成功!");
//// }
//// }
////
//// return result;
// return null;
// }
//
//
// /**
// * 通过id查询
// *
// * @param id
// * @return
// */
// @ApiOperation(value = "通过id查询钢结构自动化监测系统-测点警情设置信息", notes = "通过id查询钢结构自动化监测系统-测点警情设置信息", httpMethod = "GET")
// @ApiImplicitParam(name = "id", value = "钢结构自动化监测系统-测点警情设置ID", paramType = "query", required = true, dataType = "Integer")
// @GetMapping(value = "/queryById")
// public Result<SteelStructureMeasurePointThreshold> queryById(@RequestParam(name = "id", required = true) String id) {
//// Result<SteelStructureMeasurePointThreshold> result = new Result<SteelStructureMeasurePointThreshold>();
//// SteelStructureMeasurePointThreshold steelStructureMeasurePointThreshold = steelStructureMeasurePointThresholdService.getById(id);
//// if (steelStructureMeasurePointThreshold == null) {
//// result.error500("未找到对应实体");
//// } else {
//// result.setResult(steelStructureMeasurePointThreshold);
//// result.setSuccess(true);
//// }
//// return result;
// return null;
// }
}

View File

@ -0,0 +1,126 @@
package com.zhgd.xmgl.modules.steelstructure.controller;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureMeasurePointToPlaneFigure;
import com.zhgd.xmgl.modules.steelstructure.service.SteelStructureMeasurePointToPlaneFigureService;
import com.zhgd.xmgl.util.MessageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.Map;
/**
* @Title: Controller
* @Description: 钢结构自动化监测系统-测点和平面图配置中间表
* @author pds
* @date 2021-10-09
* @version V1.0
*/
@RestController
@RequestMapping("/xmgl/steelStructurePlaneFigureCoordinate")
@Slf4j
@Api(tags = "钢结构自动化监测系统-测点和平面图配置中间表")
public class SteelStructureMeasurePointToPlaneFigureController {
@Autowired
private SteelStructureMeasurePointToPlaneFigureService steelStructurePlaneFigureCoordinateService;
/**
* 分页列表查询
*
* @return
*/
@ApiOperation(value = "列表查询钢结构自动化监测系统-测点和平面图配置中间表信息", notes = "列表查询钢结构自动化监测系统-测点和平面图配置中间表信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "steelStructurePlaneFigureId", value = "钢结构自动化监测系统-平面图配置ID", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "steelStructureEngineeringId", value = "钢结构自动化监测系统-工程id", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/list")
public Result<List<EntityMap>> selectList(@ApiIgnore @RequestBody Map<String, Object> map) {
return Result.success(steelStructurePlaneFigureCoordinateService.selectPlaneFigureCoordinateList(map));
}
/**
* 编辑
*
* @param
* @return
*/
@ApiOperation(value = "编辑钢结构自动化监测系统-测点和平面图配置中间表信息", notes = "编辑钢结构自动化监测系统-测点和平面图配置中间表信息", httpMethod = "POST")
@PostMapping(value = "/edit")
public Result<SteelStructureMeasurePointToPlaneFigure> edit(@RequestBody SteelStructureMeasurePointToPlaneFigure steelStructureMeasurePointToPlaneFigure) {
steelStructurePlaneFigureCoordinateService.editPlaneFigureCoordinate(steelStructureMeasurePointToPlaneFigure);
return Result.ok();
}
@ApiOperation(value = "编辑钢结构自动化监测系统-测点和平面图配置中间表信息", notes = "编辑钢结构自动化监测系统-测点和平面图配置中间表信息", httpMethod = "POST")
@PostMapping(value = "/updateFigureCoordinate")
public Result<SteelStructureMeasurePointToPlaneFigure> updateFigureCoordinate(@RequestBody List<SteelStructureMeasurePointToPlaneFigure> list) {
steelStructurePlaneFigureCoordinateService.updateFigureCoordinate(list);
return Result.ok();
}
@ApiOperation(value = "删除-通过设备和平面图ID删除钢结构自动化监测系统-测点和平面图配置中间表信息", notes = "删除-通过设备和平面图ID删除钢结构自动化监测系统-测点和平面图配置中间表信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "steelStructurePlaneFigureId", value = "钢结构自动化监测系统-平面图配置ID", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "steelStructureMeasurePointId", value = "钢结构自动化监测系统-测点id", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/deletePlaneFigureCoordinate")
public Result<SteelStructureMeasurePointToPlaneFigure> deleteSteelStructurePlaneFigureCoordinate(@ApiIgnore @RequestBody Map<String, Object> map) {
steelStructurePlaneFigureCoordinateService.deleteSteelStructurePlaneFigureCoordinate(map);
return Result.ok();
}
/**
* 通过id删除
*
* @param
* @return
*/
@ApiOperation(value = "删除钢结构自动化监测系统-测点和平面图配置中间表信息", notes = "删除钢结构自动化监测系统-测点和平面图配置中间表信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "钢结构自动化监测系统-测点和平面图配置中间表ID", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/delete")
public Result<SteelStructureMeasurePointToPlaneFigure> delete(@ApiIgnore @RequestBody Map<String, Object> map) {
Result<SteelStructureMeasurePointToPlaneFigure> result = new Result<SteelStructureMeasurePointToPlaneFigure>();
SteelStructureMeasurePointToPlaneFigure steelStructureMeasurePointToPlaneFigure = steelStructurePlaneFigureCoordinateService.getById(MapUtils.getString(map, "id"));
if (steelStructureMeasurePointToPlaneFigure == null) {
result.error500(MessageUtil.get("notFindErr"));
} else {
boolean ok = steelStructurePlaneFigureCoordinateService.removeById(MapUtils.getString(map, "id"));
if (ok) {
result.successMsg(MessageUtil.get("deleteSucess"));
}
}
return result;
}
@ApiOperation(value = "添加钢结构自动化监测系统-测点和平面图配置中间表信息", notes = "添加钢结构自动化监测系统-测点和平面图配置中间表信息", httpMethod = "POST")
@PostMapping(value = "/adds")
public Result<SteelStructureMeasurePointToPlaneFigure> adds(@RequestBody SteelStructureMeasurePointToPlaneFigure steelStructureMeasurePointToPlaneFigure) {
Result<SteelStructureMeasurePointToPlaneFigure> result = new Result<SteelStructureMeasurePointToPlaneFigure>();
try {
steelStructurePlaneFigureCoordinateService.save(steelStructureMeasurePointToPlaneFigure);
result.successMsg("添加成功");
} catch (Exception e) {
e.printStackTrace();
log.info(e.getMessage());
result.error500("添加失败");
}
return result;
}
}

View File

@ -0,0 +1,132 @@
package com.zhgd.xmgl.modules.steelstructure.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureMonitorType;
import com.zhgd.xmgl.modules.steelstructure.service.ISteelStructureMonitorTypeService;
import com.zhgd.xmgl.util.MessageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.Map;
/**
* @Title: Controller
* @Description: 钢结构自动化监测系统-监测类型
* @author pds
* @date 2021-10-08
* @version V1.0
*/
@RestController
@RequestMapping("/xmgl/steelStructureMonitorType")
@Slf4j
@Api(tags = "钢结构自动化监测系统-监测内容")
public class SteelStructureMonitorTypeController {
@Autowired
private ISteelStructureMonitorTypeService steelStructureMonitorTypeService;
@ApiOperation(value = "分页列表查询钢结构自动化监测系统-监测类型", notes = "分页列表查询钢结构自动化监测系统-监测类型", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "steelStructureEngineeringId", value = "钢结构自动化监测系统-工程id", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "body", required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "body", required = true, dataType = "Integer"),
})
@PostMapping(value = "/page")
public Result<IPage<EntityMap>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
return Result.success(steelStructureMonitorTypeService.selectSteelStructureMonitorPage(map));
}
/**
* 列表查询
*/
@ApiOperation(value = "列表查询钢结构自动化监测系统-监测类型(测点数量)", notes = "列表查询钢结构自动化监测系统-监测类型(测点数量)", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "steelStructureEngineeringId", value = "钢结构自动化监测系统-工程id", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/selectSteelStructureMonitorList")
public Result<List<EntityMap>> selectSteelStructureMonitorList(@ApiIgnore @RequestBody Map<String, Object> map) {
return Result.success(steelStructureMonitorTypeService.selectSteelStructureMonitorList(map));
}
/**
* 列表查询
*
* @return
*/
@ApiOperation(value = "列表查询默认钢结构自动化监测系统-监测类型列表", notes = "列表查询默认钢结构自动化监测系统-监测类型列表", httpMethod = "POST")
@PostMapping(value = "/getDefaultMonitorTypeList")
public Result<List<SteelStructureMonitorType>> getDefaultMonitorTypeList() {
return Result.success(steelStructureMonitorTypeService.list());
}
/**
* 通过id查询
*
* @param
* @return
*/
@ApiOperation(value = "通过id查询钢结构自动化监测系统-监测类型信息", notes = "通过id查询钢结构自动化监测系统-监测类型信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "钢结构自动化监测系统-监测类型ID", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/queryById")
public Result<SteelStructureMonitorType> queryById(@ApiIgnore @RequestBody Map<String, Object> map) {
Result<SteelStructureMonitorType> result = new Result<SteelStructureMonitorType>();
SteelStructureMonitorType steelStructureMonitorType = steelStructureMonitorTypeService.getById(MapUtils.getString(map, "id"));
if (steelStructureMonitorType == null) {
result.error500(MessageUtil.get("notFindErr"));
} else {
result.setResult(steelStructureMonitorType);
result.setSuccess(true);
}
return result;
}
/**
* 列表查询
*/
@ApiOperation(value = "查询监测内容列表以及测点汇总", notes = "查询监测内容列表以及测点汇总", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "steelStructureEngineeringId", value = "钢结构自动化监测系统-工程id", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/selectMonitorTypeCount")
public Result<Map<String, Object>> selectMonitorTypeCount(@ApiIgnore @RequestBody Map<String, Object> map) {
return Result.success(steelStructureMonitorTypeService.selectMonitorTypeCount(map));
}
@ApiOperation(value = "项目监测内容列表查询", notes = "项目监测内容列表查询", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "steelStructureEngineeringId", value = "钢结构自动化监测系统-工程id", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/selectMonitorTypeList")
public Result<List<EntityMap>> selectMonitorTypeList(@ApiIgnore @RequestBody Map<String, Object> map) {
return Result.success(steelStructureMonitorTypeService.selectMonitorTypeList(map));
}
@ApiOperation(value = "统计查询项目监测内容告警列表", notes = "统计查询项目监测内容告警列表", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "steelStructureEngineeringId", value = "钢结构自动化监测系统-工程id", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "searchType", value = "类型1查询近7天2查询30天", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/selectMonitorTypeAlarmCountList")
public Result<List<Map<String, Object>>> selectMonitorTypeAlarmCountList(@ApiIgnore @RequestBody Map<String, Object> map) {
return Result.success(steelStructureMonitorTypeService.selectMonitorTypeAlarmCountList(map));
}
}

View File

@ -0,0 +1,136 @@
package com.zhgd.xmgl.modules.steelstructure.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructurePlaneFigure;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureMeasurePointToPlaneFigure;
import com.zhgd.xmgl.modules.steelstructure.service.SteelStructureMeasurePointToPlaneFigureService;
import com.zhgd.xmgl.modules.steelstructure.service.ISteelStructurePlaneFigureService;
import com.zhgd.xmgl.util.MessageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Title: Controller
* @Description: 钢结构自动化监测系统-平面图配置
* @author pds
* @date 2021-10-09
* @version V1.0
*/
@RestController
@RequestMapping("/xmgl/steelStructurePlaneFigure")
@Slf4j
@Api(tags = "钢结构自动化监测系统-平面图配置")
public class SteelStructurePlaneFigureController {
@Autowired
private ISteelStructurePlaneFigureService steelStructurePlaneFigureService;
@Autowired
private SteelStructureMeasurePointToPlaneFigureService steelStructurePlaneFigureCoordinate;
/**
* 列表查询
*
* @return
*/
@ApiOperation(value = "列表查询钢结构自动化监测系统-平面图配置信息", notes = "列表查询钢结构自动化监测系统-平面图配置信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "steelStructureEngineeringId", value = "钢结构自动化监测系统-工程id", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/selectList")
public Result<List<SteelStructurePlaneFigure>> selectList(@ApiIgnore @RequestBody Map<String, Object> map) {
QueryWrapper<SteelStructurePlaneFigure> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(SteelStructurePlaneFigure::getProjectSn, MapUtils.getString(map, "projectSn"))
.eq(SteelStructurePlaneFigure::getSteelStructureEngineeringId, MapUtils.getString(map, "steelStructureEngineeringId"));
List<SteelStructurePlaneFigure> list = steelStructurePlaneFigureService.list(queryWrapper);
for (SteelStructurePlaneFigure steelStructurePlaneFigure : list) {
LambdaQueryWrapper<SteelStructureMeasurePointToPlaneFigure> wrapper = Wrappers.<SteelStructureMeasurePointToPlaneFigure>lambdaQuery()
.eq(SteelStructureMeasurePointToPlaneFigure::getSteelStructurePlaneFigureId, steelStructurePlaneFigure.getId());
steelStructurePlaneFigure.setMeasurePointIds(steelStructurePlaneFigureCoordinate.list(wrapper).stream().map(d -> d.getSteelStructureMeasurePointId().toString()).collect(Collectors.joining(",")));
}
return Result.success(list);
}
/**
* 添加
*
* @param steelStructurePlaneFigure
* @return
*/
@ApiOperation(value = "添加钢结构自动化监测系统-平面图配置信息", notes = "添加钢结构自动化监测系统-平面图配置信息", httpMethod = "POST")
@PostMapping(value = "/add")
public Result<SteelStructurePlaneFigure> add(@RequestBody SteelStructurePlaneFigure steelStructurePlaneFigure) {
steelStructurePlaneFigureService.savesteelStructurePlaneFigure(steelStructurePlaneFigure);
return Result.ok();
}
/**
* 编辑
*
* @param steelStructurePlaneFigure
* @return
*/
@ApiOperation(value = "编辑钢结构自动化监测系统-平面图配置信息", notes = "编辑钢结构自动化监测系统-平面图配置信息", httpMethod = "POST")
@PostMapping(value = "/edit")
public Result<SteelStructurePlaneFigure> edit(@RequestBody SteelStructurePlaneFigure steelStructurePlaneFigure) {
steelStructurePlaneFigureService.editsteelStructurePlaneFigure(steelStructurePlaneFigure);
return Result.success(steelStructurePlaneFigure);
}
/**
* 通过id删除
*
* @param
* @return
*/
@ApiOperation(value = "删除钢结构自动化监测系统-平面图配置信息", notes = "删除钢结构自动化监测系统-平面图配置信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "钢结构自动化监测系统-平面图配置ID", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/delete")
public Result<SteelStructurePlaneFigure> delete(@ApiIgnore @RequestBody Map<String, Object> map) {
steelStructurePlaneFigureService.deleteSteelStructurePlaneFigure(MapUtils.getString(map, "id"));
return Result.ok();
}
/**
* 通过id查询
*
* @param
* @return
*/
@ApiOperation(value = "通过id查询钢结构自动化监测系统-平面图配置信息", notes = "通过id查询钢结构自动化监测系统-平面图配置信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "钢结构自动化监测系统-平面图配置ID", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/queryById")
public Result<SteelStructurePlaneFigure> queryById(@ApiIgnore @RequestBody Map<String, Object> map) {
Result<SteelStructurePlaneFigure> result = new Result<SteelStructurePlaneFigure>();
SteelStructurePlaneFigure steelStructurePlaneFigure = steelStructurePlaneFigureService.getById(MapUtils.getString(map, "id"));
if (steelStructurePlaneFigure == null) {
result.error500(MessageUtil.get("notFindErr"));
} else {
result.setResult(steelStructurePlaneFigure);
result.setSuccess(true);
}
return result;
}
}

View File

@ -0,0 +1,53 @@
package com.zhgd.xmgl.modules.steelstructure.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureCurrentData;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureSensor;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureSensorType;
import com.zhgd.xmgl.modules.steelstructure.service.SteelStructureSensorService;
import com.zhgd.xmgl.modules.steelstructure.service.ISteelStructureSensorTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author 邱平毅
* @ClassName SteelStructureSensorController
* @date 2022/8/18 14:06
* @Version 1.0
*/
@RestController
@RequestMapping("/xmgl/steelStructureSensor")
@Slf4j
@Api(tags = "钢结构自动化监测系统-传感器")
public class SteelStructureSensorController {
@Autowired
private SteelStructureSensorService steelStructureSensorService;
/**
* 通过测点编号查询传感器列表
*
* @return
*/
@ApiOperation(value = "通过测点编号查询传感器列表", notes = "通过测点编号查询传感器列表")
@ApiImplicitParam(name = "measurePointNumber", value = "测点编号", paramType = "query", required = true, dataType = "String")
@GetMapping(value = "/getSensorListByMeasurePointNumber")
public Result<List<SteelStructureSensor>> getSensorListByMeasurePointNumber(String measurePointNumber) {
QueryWrapper<SteelStructureSensor> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(SteelStructureSensor::getMeasurePointNumber, measurePointNumber);
return Result.success(steelStructureSensorService.list(queryWrapper));
}
}

View File

@ -0,0 +1,139 @@
package com.zhgd.xmgl.modules.steelstructure.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureSensorType;
import com.zhgd.xmgl.modules.steelstructure.service.ISteelStructureSensorTypeService;
import com.zhgd.xmgl.util.MessageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.Map;
/**
* @Title: Controller
* @Description: 钢结构自动化监测系统-传感器类型
* @author pds
* @date 2021-10-08
* @version V1.0
*/
@RestController
@RequestMapping("/xmgl/steelStructureSensorType")
@Slf4j
@Api(tags = "钢结构自动化监测系统-传感器类型")
public class SteelStructureSensorTypeController {
@Autowired
private ISteelStructureSensorTypeService steelStructureSensorTypeService;
@ApiOperation(value = "列表查询钢结构自动化监测系统-传感器类型信息", notes = "列表查询钢结构自动化监测系统-传感器类型信息", httpMethod = "POST")
@PostMapping(value = "/selectSteelStructureSensorTypeList")
public Result<List<SteelStructureSensorType>> selectSteelStructureSensorTypeList() {
QueryWrapper<SteelStructureSensorType> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(SteelStructureSensorType::getProjectSn, "-1");
List<SteelStructureSensorType> list = steelStructureSensorTypeService.list(queryWrapper);
return Result.success(list);
}
/**
* 添加
*
* @param steelStructureSensorType
* @return
*/
@ApiOperation(value = "添加钢结构自动化监测系统-传感器类型信息", notes = "添加钢结构自动化监测系统-传感器类型信息", httpMethod = "POST")
@PostMapping(value = "/add")
public Result<SteelStructureSensorType> add(@RequestBody SteelStructureSensorType steelStructureSensorType) {
Result<SteelStructureSensorType> result = new Result<SteelStructureSensorType>();
try {
steelStructureSensorTypeService.save(steelStructureSensorType);
result.successMsg(MessageUtil.get("addSucess"));
} catch (Exception e) {
e.printStackTrace();
log.info(e.getMessage());
result.error500(MessageUtil.get("failErr"));
}
return result;
}
/**
* 编辑
*
* @param steelStructureSensorType
* @return
*/
@ApiOperation(value = "编辑钢结构自动化监测系统-传感器类型信息", notes = "编辑钢结构自动化监测系统-传感器类型信息", httpMethod = "POST")
@PostMapping(value = "/edit")
public Result<SteelStructureSensorType> edit(@RequestBody SteelStructureSensorType steelStructureSensorType) {
Result<SteelStructureSensorType> result = new Result<SteelStructureSensorType>();
SteelStructureSensorType steelStructureSensorTypeEntity = steelStructureSensorTypeService.getById(steelStructureSensorType.getId());
if (steelStructureSensorTypeEntity == null) {
result.error500(MessageUtil.get("notFindErr"));
} else {
boolean ok = steelStructureSensorTypeService.updateById(steelStructureSensorType);
if (ok) {
result.successMsg(MessageUtil.get("editSucess"));
}
}
return result;
}
/**
* 通过id删除
*
* @param
* @return
*/
@ApiOperation(value = "删除钢结构自动化监测系统-传感器类型信息", notes = "删除钢结构自动化监测系统-传感器类型信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "钢结构自动化监测系统-传感器类型ID", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/delete")
public Result<SteelStructureSensorType> delete(@ApiIgnore @RequestBody Map<String, Object> map) {
Result<SteelStructureSensorType> result = new Result<SteelStructureSensorType>();
SteelStructureSensorType steelStructureSensorType = steelStructureSensorTypeService.getById(MapUtils.getString(map, "id"));
if (steelStructureSensorType == null) {
result.error500(MessageUtil.get("notFindErr"));
} else {
boolean ok = steelStructureSensorTypeService.removeById(MapUtils.getString(map, "id"));
if (ok) {
result.successMsg(MessageUtil.get("deleteSucess"));
}
}
return result;
}
/**
* 通过id查询
*
* @param
* @return
*/
@ApiOperation(value = "通过id查询钢结构自动化监测系统-传感器类型信息", notes = "通过id查询钢结构自动化监测系统-传感器类型信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "钢结构自动化监测系统-传感器类型ID", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/queryById")
public Result<SteelStructureSensorType> queryById(@ApiIgnore @RequestBody Map<String, Object> map) {
Result<SteelStructureSensorType> result = new Result<SteelStructureSensorType>();
SteelStructureSensorType steelStructureSensorType = steelStructureSensorTypeService.getById(MapUtils.getString(map, "id"));
if (steelStructureSensorType == null) {
result.error500(MessageUtil.get("notFindErr"));
} else {
result.setResult(steelStructureSensorType);
result.setSuccess(true);
}
return result;
}
}

View File

@ -0,0 +1,197 @@
package com.zhgd.xmgl.modules.steelstructure.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.beans.BeanUtils;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
* @Description: 钢结构自动化监测系统-监测实时数据
* @author pds
* @date 2021-10-08
* @version V1.0
*/
@Data
@TableName("steel_structure_current_data")
@ApiModel(value = "SteelStructureCurrentData实体类", description = "SteelStructureCurrentData")
@Accessors(chain = true)
@NoArgsConstructor
public class SteelStructureCurrentData implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private Long id;
/**
* 项目sn
*/
@Excel(name = "项目sn", width = 15)
@ApiModelProperty(value = "项目sn")
private String projectSn;
/**
* 厂家code
*/
@Excel(name = "厂家code", width = 15)
@ApiModelProperty(value = "厂家code")
private String projectCode;
/**
* 接收时间
*/
@Excel(name = "接收时间", width = 15)
@ApiModelProperty(value = "接收时间")
private String receiveTime;
/**
* 传感器编号
*/
@Excel(name = "传感器编号", width = 15)
@ApiModelProperty(value = "传感器编号")
private String sensorSn;
/**
* 采样值默认为0
*/
@Excel(name = "采样值默认为0", width = 15)
@ApiModelProperty(value = "采样值默认为0")
private Float data;
/**
* 采样值 单次变化量默认为0
*/
@Excel(name = "采样值 单次变化量默认为0", width = 15)
@ApiModelProperty(value = "采样值 单次变化量默认为0")
private Float dataThis;
/**
* 采样值 累计变化量默认为0
*/
@Excel(name = "采样值 累计变化量默认为0", width = 15)
@ApiModelProperty(value = "采样值 累计变化量默认为0")
private Float dataTotal;
/**
* 采样值 变化速率默认为0
*/
@Excel(name = "采样值 变化速率默认为0", width = 15)
@ApiModelProperty(value = "采样值 变化速率默认为0")
private Float dataRate;
/**
* 报警状态 1.正常 2.超报警 3.超控制 4.变化速率报警
*/
@Excel(name = "报警状态 1.正常 2.超报警 3.超控制 4.变化速率报警", width = 15)
@ApiModelProperty(value = "报警状态 1.正常 2.超报警 3.超控制 4.变化速率报警")
private Integer alarmState;
/**
* 创建时间 yyyy-MM-dd HH:mm:ss
*/
@Excel(name = "创建时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime;
/**
* 更新时间 yyyy-MM-dd HH:mm:ss
*/
@Excel(name = "更新时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date updateTime;
/**
* 单位
*/
@Excel(name = "单位", width = 15)
@ApiModelProperty(value = "单位")
@TableField(exist = false)
private String unit;
/**
* 钢结构自动化监测系统名称
*/
@Excel(name = "钢结构自动化监测系统名称", width = 15)
@ApiModelProperty(value = "钢结构自动化监测系统名称")
@TableField(exist = false)
private String slopeName;
/**
* 测点编号
*/
@Excel(name = "测点编号", width = 15)
@ApiModelProperty(value = "测点编号")
@TableField(exist = false)
private String measurePointNumber;
/**
* 测点名称
*/
@Excel(name = "测点名称", width = 15)
@ApiModelProperty(value = "测点名称")
@TableField(exist = false)
private String measurePointName;
/**
* 传感器类型
*/
@ApiModelProperty(value = "传感器类型")
@TableField(exist = false)
private String sensorTypeName;
/**
* 累计值报警值
*/
@ApiModelProperty(value = "累计值报警值")
@TableField(exist = false)
private Float alarmValue;
/**
* 基准值
*/
@ApiModelProperty(value = "基准值")
@TableField(exist = false)
private Float fiducialValue;
/**
* 变化速率报警值
*/
@ApiModelProperty(value = "变化速率报警值")
@TableField(exist = false)
private Float rateAlarmValue;
/**
* 上次值
*/
@ApiModelProperty(value = "上次值")
@TableField(exist = false)
private Float lastTimeData;
/**
* 传感器名称
*/
@ApiModelProperty(value = "传感器名称")
@TableField(exist = false)
private String sensorName;
/**
* 报警状态字符串
*/
@ApiModelProperty(value = "报警状态字符串")
@TableField(exist = false)
private String AlarmStateStr;
public SteelStructureCurrentData(SteelStructureCurrentData steelStructureCurrentData) {
BeanUtils.copyProperties(steelStructureCurrentData, this);
}
}

View File

@ -0,0 +1,139 @@
package com.zhgd.xmgl.modules.steelstructure.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description: 钢结构自动化监测系统-工程
* @author pds
* @date 2021-10-08
* @version V1.0
*/
@Data
@TableName("steel_structure_engineering")
@ApiModel(value = "SteelStructureEngineering实体类", description = "SteelStructureEngineering")
public class SteelStructureEngineering implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private Long id;
/**
* 项目sn
*/
@Excel(name = "项目sn", width = 15)
@ApiModelProperty(value = "项目sn")
private String projectSn;
/**
* 边坡名称
*/
@Excel(name = "边坡名称", width = 15)
@ApiModelProperty(value = "边坡名称")
private String slopeName;
/**
* 开工日期
*/
@Excel(name = "开工日期", width = 20, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "开工日期")
private java.util.Date startDate;
/**
* 完工日期
*/
@Excel(name = "完工日期", width = 20, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "完工日期")
private java.util.Date endDate;
/**
* 监测负责人id
*/
@Excel(name = "监测负责人id", width = 15)
@ApiModelProperty(value = "监测负责人id")
private Long surveyDirectorId;
/**
* 监测负责人名称
*/
@Excel(name = "监测负责人名称", width = 15)
@ApiModelProperty(value = "监测负责人名称")
private String surveyDirectorName;
/**
* 监测人员id
*/
@Excel(name = "监测人员id", width = 15)
@ApiModelProperty(value = "监测人员id")
private Long surveyPersonnelId;
/**
* 监测人员名称
*/
@Excel(name = "监测人员名称", width = 15)
@ApiModelProperty(value = "监测人员名称")
private String surveyPersonnelName;
/**
* 监测方案
*/
@Excel(name = "监测方案", width = 15)
@ApiModelProperty(value = "监测方案")
private String surveyScheme;
/**
* 地勘报告
*/
@Excel(name = "地勘报告", width = 15)
@ApiModelProperty(value = "地勘报告")
private String prospectingReport;
/**
* 设计图纸
*/
@Excel(name = "设计图纸", width = 15)
@ApiModelProperty(value = "设计图纸")
private String deviseDrawing;
/**
* 安全等级
*/
@Excel(name = "安全等级", width = 15)
@ApiModelProperty(value = "安全等级")
private String safetyLevel;
/**
* 状态1进行中2已完成
*/
@Excel(name = "状态1进行中2已完成", width = 15)
@ApiModelProperty(value = "状态1进行中2已完成")
private Integer status;
/**
* 创建时间 yyyy-MM-dd HH:mm:ss
*/
@Excel(name = "创建时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime;
/**
* 更新时间 yyyy-MM-dd HH:mm:ss
*/
@Excel(name = "更新时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date updateTime;
@ApiModelProperty(value = "钢结构自动化监测系统-监测类型表id多个,分隔)")
@TableField(exist = false)
@NotBlank
private String steelStructureMonitorTypeIds;
}

View File

@ -0,0 +1,63 @@
package com.zhgd.xmgl.modules.steelstructure.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
* 钢结构自动化监测系统-工程和监测类型中间表
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "steel_structure_engineering_to_monitor_type")
public class SteelStructureEngineeringToMonitorType implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private Long id;
/**
* 钢结构自动化监测系统-工程id
*/
@Excel(name = "钢结构自动化监测系统-工程id", width = 15)
@ApiModelProperty(value = "钢结构自动化监测系统-工程id")
private Long steelStructureEngineeringId;
/**
* 钢结构自动化监测系统-监测类型表id
*/
@Excel(name = "钢结构自动化监测系统-监测类型表id", width = 15)
@ApiModelProperty(value = "钢结构自动化监测系统-监测类型表id")
private Long steelStructureMonitorTypeId;
/**
* 创建时间 yyyy-MM-dd HH:mm:ss
*/
@Excel(name = "创建时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime;
/**
* 更新时间 yyyy-MM-dd HH:mm:ss
*/
@Excel(name = "更新时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date updateTime;
@ApiModelProperty(value = "项目SN")
private String projectSn;
}

View File

@ -0,0 +1,121 @@
package com.zhgd.xmgl.modules.steelstructure.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureSensor;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* @Description: 钢结构自动化监测系统-测点
* @author pds
* @date 2021-10-08
* @version V1.0
*/
@Data
@TableName("steel_structure_measure_point")
@ApiModel(value = "SteelStructureMeasurePoint实体类", description = "SteelStructureMeasurePoint")
public class SteelStructureMeasurePoint implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private Long id;
/**
* 钢结构自动化监测系统-工程id
*/
@Excel(name = "钢结构自动化监测系统-工程id", width = 15)
@ApiModelProperty(value = "钢结构自动化监测系统-工程id")
private Long steelStructureEngineeringId;
/**
* 钢结构自动化监测系统-工程和监测类型中间表id
*/
@Excel(name = "钢结构自动化监测系统-工程和监测类型中间表id", width = 15)
@ApiModelProperty(value = "钢结构自动化监测系统-工程和监测类型中间表id")
@NotNull
private Long steelStructureEngineeringToMonitorTypeId;
/**
* 钢结构自动化监测系统-监测实时数据id
*/
@Excel(name = "钢结构自动化监测系统-监测实时数据id", width = 15)
@ApiModelProperty(value = "钢结构自动化监测系统-监测实时数据id")
private Long steelStructureCurrentDataId;
/**
* 测点名称
*/
@Excel(name = "测点名称", width = 15)
@ApiModelProperty(value = "测点名称")
private String measurePointName;
/**
* 测点编号
*/
@Excel(name = "测点编号", width = 15)
@ApiModelProperty(value = "测点编号")
private String measurePointNumber;
/**
* 测点位置
*/
@Excel(name = "测点位置", width = 15)
@ApiModelProperty(value = "测点位置")
private String measurePointAddr;
/**
* 报警状态1.正常 2.超报警 3.超控制 4.变化速率报警
*/
@Excel(name = "报警状态1.正常 2.超报警 3.超控制 4.变化速率报警", width = 15)
@ApiModelProperty(value = "报警状态1.正常 2.超报警 3.超控制 4.变化速率报警")
private Integer alarmState;
/**
* 报警类型
*/
@Excel(name = "报警类型", width = 15)
@ApiModelProperty(value = "报警类型")
private String alarmType;
/**
* 报警时间
*/
@Excel(name = "报警时间", width = 15)
@ApiModelProperty(value = "报警时间")
private String alarmDate;
/**
* 创建时间 yyyy-MM-dd HH:mm:ss
*/
@Excel(name = "创建时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime;
/**
* 更新时间 yyyy-MM-dd HH:mm:ss
*/
@Excel(name = "更新时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date updateTime;
@ApiModelProperty(value = "项目SN")
private String projectSn;
/**
* 传感器编号列表
*/
@TableField(exist = false)
@ApiModelProperty(value = "传感器编号列表")
private List<SteelStructureSensor> sensorList;
}

View File

@ -0,0 +1,73 @@
package com.zhgd.xmgl.modules.steelstructure.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
* @Description: 钢结构自动化监测系统-测点和平面图配置中间表
* @author pds
* @date 2021-10-09
* @version V1.0
*/
@Data
@TableName("steel_structure_measure_point_to_plane_figure")
@ApiModel(value = "SteelStructurePlaneFigureCoordinate实体类", description = "SteelStructureMeasurePointToPlaneFigure")
public class SteelStructureMeasurePointToPlaneFigure implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private Long id;
/**
* 钢结构自动化监测系统-测点id
*/
@Excel(name = "钢结构自动化监测系统-测点id", width = 15)
@ApiModelProperty(value = "钢结构自动化监测系统-测点id")
private Long steelStructureMeasurePointId;
/**
* 钢结构自动化监测系统-平面图配置ID
*/
@Excel(name = "钢结构自动化监测系统-平面图配置ID", width = 15)
@ApiModelProperty(value = "钢结构自动化监测系统-平面图配置ID")
private Long steelStructurePlaneFigureId;
/**
* X坐标
*/
@Excel(name = "X坐标", width = 15)
@ApiModelProperty(value = "X坐标")
private String mapX;
/**
* Y坐标
*/
@Excel(name = "Y坐标", width = 15)
@ApiModelProperty(value = "Y坐标")
private String mapY;
/**
* 创建时间 yyyy-MM-dd HH:mm:ss
*/
@Excel(name = "创建时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime;
/**
* 更新时间 yyyy-MM-dd HH:mm:ss
*/
@Excel(name = "更新时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date updateTime;
}

View File

@ -0,0 +1,66 @@
package com.zhgd.xmgl.modules.steelstructure.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
/**
* 钢结构自动化监测系统-监测类型表
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "steel_structure_monitor_type")
@Accessors(chain = true)
public class SteelStructureMonitorType {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private Long id;
/**
* 监测类型名称
*/
@Excel(name = "监测类型名称", width = 15)
@ApiModelProperty(value = "监测类型名称")
private String monitorTypeName;
/**
* 监测编码
*/
@Excel(name = "监测编码", width = 15)
@ApiModelProperty(value = "监测编码")
private String monitorTypeCode;
/**
* 单位
*/
@Excel(name = "单位", width = 15)
@ApiModelProperty(value = "单位")
private String unit;
/**
* 创建时间 yyyy-MM-dd HH:mm:ss
*/
@Excel(name = "创建时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime;
/**
* 更新时间 yyyy-MM-dd HH:mm:ss
*/
@Excel(name = "更新时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date updateTime;
}

View File

@ -0,0 +1,80 @@
package com.zhgd.xmgl.modules.steelstructure.entity;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;
/**
* @Description: 钢结构自动化监测系统-平面图配置
* @author pds
* @date 2021-10-09
* @version V1.0
*/
@Data
@TableName("steel_structure_plane_figure")
@ApiModel(value = "SteelStructurePlaneFigure实体类", description = "SteelStructurePlaneFigure")
public class SteelStructurePlaneFigure implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private Long id;
/**
* 项目SN
*/
@Excel(name = "项目SN", width = 15)
@ApiModelProperty(value = "项目SN")
private String projectSn;
/**
* 钢结构自动化监测系统-工程id
*/
@Excel(name = "钢结构自动化监测系统-工程id", width = 15)
@ApiModelProperty(value = "钢结构自动化监测系统-工程id")
private Long steelStructureEngineeringId;
/**
* 平面图像名称
*/
@Excel(name = "平面图像名称", width = 15)
@ApiModelProperty(value = "平面图像名称")
private String planeFigureName;
/**
* 图片url
*/
@Excel(name = "图片url", width = 15)
@ApiModelProperty(value = "图片url")
private String imageUrl;
/**
* 创建时间 yyyy-MM-dd HH:mm:ss
*/
@Excel(name = "创建时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime;
/**
* 更新时间 yyyy-MM-dd HH:mm:ss
*/
@Excel(name = "更新时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date updateTime;
@TableField(exist = false)
@ApiModelProperty(value = "测点ID,多个逗号分隔")
private String measurePointIds;
}

View File

@ -0,0 +1,219 @@
package com.zhgd.xmgl.modules.steelstructure.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureCurrentData;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.beans.BeanUtils;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "steel_structure_sensor")
@Accessors(chain = true)
@ApiModel(value = "SteelStructureSensor实体类", description = "SteelStructureSensor")
public class SteelStructureSensor implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 传感器id
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "传感器id")
private Long id;
/**
* 传感器sn
*/
@Excel(name = "传感器sn", width = 15)
@ApiModelProperty(value = "传感器sn")
private String sensorSn;
/**
* 传感器名称
*/
@Excel(name = "传感器名称", width = 15)
@ApiModelProperty(value = "传感器名称")
private String sensorName;
/**
* 传感器安装深度
*/
@Excel(name = "传感器安装深度", width = 15)
@ApiModelProperty(value = "传感器安装深度")
private String sensorInstallationDepth;
/**
* 测点编号
*/
@Excel(name = "测点编号", width = 15)
@ApiModelProperty(value = "测点编号")
private String measurePointNumber;
/**
* 钢结构自动化监测系统-传感器类型id
*/
@Excel(name = "钢结构自动化监测系统-传感器类型id", width = 15)
@ApiModelProperty(value = "钢结构自动化监测系统-传感器类型id")
private Long steelStructureSensorTypeId;
/**
* 报警状态 1.正常 2.超报警 3.超控制 4.变化速率报警
*/
@Excel(name = "报警状态 1.正常 2.超报警 3.超控制 4.变化速率报警", width = 15)
@ApiModelProperty(value = "报警状态 1.正常 2.超报警 3.超控制 4.变化速率报警")
private Integer status;
/**
* 当前值
*/
@Excel(name = "当前值", width = 15)
@ApiModelProperty(value = "当前值")
private Float data;
/**
* 采样值 累计变化量
*/
@Excel(name = "采样值 累计变化量", width = 15)
@ApiModelProperty(value = "采样值 累计变化量")
private Float dataTotal;
/**
* 采样值 变化速率
*/
@Excel(name = "采样值 变化速率", width = 15)
@ApiModelProperty(value = "采样值 变化速率")
private Float dataRate;
/**
* 接收时间
*/
@Excel(name = "接收时间", width = 15)
@ApiModelProperty(value = "接收时间")
private String receiveTime;
/**
* 预警值
*/
@Excel(name = "预警值", width = 15)
@ApiModelProperty(value = "预警值")
private Float earlyWarningValue;
/**
* 累计值报警值
*/
@Excel(name = "累计值报警值", width = 15)
@ApiModelProperty(value = "累计值报警值")
private Float alarmValue;
/**
* 控制值
*/
@Excel(name = "控制值", width = 15)
@ApiModelProperty(value = "控制值")
private Float controlValue;
/**
* 基准值
*/
@Excel(name = "基准值", width = 15)
@ApiModelProperty(value = "基准值")
private Float fiducialValue;
/**
* 变化速率报警值
*/
@Excel(name = "变化速率报警值", width = 15)
@ApiModelProperty(value = "变化速率报警值")
private Float rateAlarmValue;
/**
* 创建时间 yyyy-MM-dd HH:mm:ss
*/
@Excel(name = "创建时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime;
/**
* 更新时间 yyyy-MM-dd HH:mm:ss
*/
@Excel(name = "更新时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date updateTime;
/**
* 项目编号
*/
@ApiModelProperty(value = "项目编号")
private String projectSn;
/**
* 钢结构自动化监测系统名称
*/
@ApiModelProperty(value = "钢结构自动化监测系统名称")
@TableField(exist = false)
private String slopeName;
/**
* 测点名称
*/
@ApiModelProperty(value = "测点名称")
@TableField(exist = false)
private String measurePointName;
/**
* 传感器类型
*/
@ApiModelProperty(value = "传感器类型")
@TableField(exist = false)
private String sensorTypeName;
/**
* 单位
*/
@ApiModelProperty(value = "单位")
@TableField(exist = false)
private String unit;
@ApiModelProperty(value = "传感器编码")
@TableField(exist = false)
private String sensorTypeCode;
public SteelStructureSensor(String sensorSn, Long sensorTypeId, Integer status) {
this.sensorSn = sensorSn;
this.measurePointNumber = "-1";
this.sensorName = measurePointNumber + "-" + sensorSn;
this.status = status;
this.earlyWarningValue = 0f;
this.alarmValue = 0f;
this.controlValue = 0f;
this.fiducialValue = 0f;
this.rateAlarmValue = 0f;
}
public SteelStructureSensor(String sensorSn, Long sensorTypeId, Integer status, SteelStructureSensor steelStructureSensor) {
this.sensorSn = sensorSn;
this.status = status;
this.measurePointNumber = steelStructureSensor.getMeasurePointNumber();
this.projectSn = steelStructureSensor.getProjectSn();
this.sensorName = steelStructureSensor.getMeasurePointNumber() + "-" + sensorSn;
this.earlyWarningValue = steelStructureSensor.getEarlyWarningValue();
this.alarmValue = steelStructureSensor.getAlarmValue();
this.controlValue = steelStructureSensor.getControlValue();
this.fiducialValue = steelStructureSensor.getFiducialValue();
this.rateAlarmValue = steelStructureSensor.getRateAlarmValue();
}
public SteelStructureSensor(String sensorSn, SteelStructureSensor steelStructureSensor, SteelStructureCurrentData data) {
BeanUtils.copyProperties(steelStructureSensor, this);
this.status = data.getAlarmState();
this.data = data.getData();
this.dataTotal = data.getDataTotal();
this.dataRate = data.getDataRate();
this.receiveTime = data.getReceiveTime();
this.sensorSn = sensorSn;
this.sensorName = steelStructureSensor.getMeasurePointNumber();
this.id = null;
}
}

View File

@ -0,0 +1,76 @@
package com.zhgd.xmgl.modules.steelstructure.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
* @Description: 钢结构自动化监测系统-传感器类型
* @author pds
* @date 2021-10-08
* @version V1.0
*/
@Data
@TableName("steel_structure_sensor_type")
@ApiModel(value = "SteelStructureSensorType实体类", description = "SteelStructureSensorType")
public class SteelStructureSensorType implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private Long id;
/**
* 项目编号
*/
@Excel(name = "项目编号", width = 15)
@ApiModelProperty(value = "项目编号")
private String projectSn;
/**
* 传感器类型名称
*/
@Excel(name = "传感器类型名称", width = 15)
@ApiModelProperty(value = "传感器类型名称")
private String sensorTypeName;
/**
* 传感器编码
*/
@Excel(name = "传感器编码", width = 15)
@ApiModelProperty(value = "传感器编码")
private String sensorTypeCode;
/**
* 单位
*/
@Excel(name = "单位", width = 15)
@ApiModelProperty(value = "单位")
private String unit;
/**
* 创建时间 yyyy-MM-dd HH:mm:ss
*/
@Excel(name = "创建时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime;
/**
* 更新时间 yyyy-MM-dd HH:mm:ss
*/
@Excel(name = "更新时间 yyyy-MM-dd HH:mm:ss", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date updateTime;
}

View File

@ -0,0 +1,35 @@
package com.zhgd.xmgl.modules.steelstructure.entity.qo;
import com.zhgd.xmgl.entity.PageQO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author 邱平毅
* @ClassName CurrentDataListQO
* @date 2022/8/19 14:47
* @Version 1.0
*/
@Data
public class CurrentDataListQO extends PageQO {
@ApiModelProperty(value = "项目编号", required = true)
private String projectSn;
@ApiModelProperty(value = "测点编号", required = false)
private String measurePointNumber;
@ApiModelProperty(value = "传感器sn", required = false)
private String sensorSn;
@ApiModelProperty(value = "钢结构自动化监测系统-工程和监测类型中间表id", required = true)
private Long steelStructureEngineeringToMonitorTypeId;
@ApiModelProperty(value = "开始时间 2022-08-19 14:42:17格式", required = false)
private String startTime;
@ApiModelProperty(value = "结束时间 2022-08-19 14:42:17格式", required = false)
private String endTime;
@ApiModelProperty(value = "报警状态 1.正常 2.超报警 3.超控制 4.变化速率报警", required = false)
private Integer alarmState;
}

View File

@ -0,0 +1,23 @@
package com.zhgd.xmgl.modules.steelstructure.entity.qo;
import com.zhgd.xmgl.entity.PageQO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author 邱平毅
* @ClassName SelectMeasurePointListQO
* @date 2022/8/24 11:42
* @Version 1.0
*/
@Data
@ApiModel(value = "查询测点列表请求对象", description = "查询测点列表请求对象")
public class SelectMeasurePointListQO extends PageQO {
@ApiModelProperty(value = "钢结构自动化监测系统与监测内容关系ID", required = true)
private Long steelStructureEngineeringToMonitorTypeId;
@ApiModelProperty(value = "测点编号")
private String measurePointNumber;
@ApiModelProperty(value = "报警状态 1.正常 2.超报警 3.超控制 4.变化速率报警")
private Integer alarmState;
}

View File

@ -0,0 +1,28 @@
package com.zhgd.xmgl.modules.steelstructure.entity.vo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureCurrentData;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author 邱平毅
* @ClassName CurrentDataListVO
* @date 2022/8/23 16:39
* @Version 1.0
*/
@Data
@ApiModel("钢结构自动化监测系统历史数据对象")
public class CurrentDataListVO {
@ApiModelProperty("单位")
private String unit;
@ApiModelProperty("正报警值")
private Double positiveAlarmValue;
@ApiModelProperty("负报警值")
private Double negativeAlarmValue;
private IPage<SteelStructureCurrentData> data;
}

View File

@ -0,0 +1,23 @@
package com.zhgd.xmgl.modules.steelstructure.entity.vo;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author 邱平毅
* @ClassName DataAlramVO
* @date 2022/10/19 15:05
* @Version 1.0
*/
@Data
@ApiModel("钢结构自动化监测系统报警数量对象")
@NoArgsConstructor
@AllArgsConstructor
public class DataAlarmVO {
private Integer sum;
private Integer month;
private Integer week;
private Integer day;
}

View File

@ -0,0 +1,46 @@
package com.zhgd.xmgl.modules.steelstructure.enums;
/**
* @author 邱平毅
* @ClassName DataStatusEnum
* @date 2022/9/26 16:04
* @Version 1.0
* 钢结构自动化监测系统状态
*/
public enum DataStatusEnum {
NORMAL(1, "正常"),
SUPER_ALARM(2, "超报警"),
SUPER_CONTROL(3, "超控制"),
RATE_OF_CHANGE_ALARM(4, "变化速率报警");
int id;
String statusName;
public int getId() {
return id;
}
public String getStatusName() {
return statusName;
}
DataStatusEnum(int id, String statusName) {
this.id = id;
this.statusName = statusName;
}
public static String getStatusNameById(Integer id) {
if (id != null) {
for (DataStatusEnum statusEnum : DataStatusEnum.values()) {
if (statusEnum.id == id) {
return statusEnum.getStatusName();
}
}
}
return "";
}
}

View File

@ -0,0 +1,42 @@
package com.zhgd.xmgl.modules.steelstructure.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureCurrentData;
import com.zhgd.xmgl.modules.highformwork.entity.vo.NumberDifferentTypesAlarmsRadarChartOneMonthVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* @Description: 钢结构自动化监测系统-监测实时数据
* @author pds
* @date 2021-10-08
* @version V1.0
*/
@Mapper
public interface SteelStructureCurrentDataMapper extends BaseMapper<SteelStructureCurrentData> {
IPage<SteelStructureCurrentData> selectPageByProjectSn(@Param("measurePointName") String measurePointName, @Param("steelStructureSensorTypeId") Long steelStructureSensorTypeId,
@Param("startDate") String startDate, @Param("endDate") String endDate, @Param("projectSn") String projectSn, Page<?> objectPage);
List<SteelStructureCurrentData> selectSteelStructureCurrentDataPage(Page<SteelStructureCurrentData> page, @Param("param") Map<String, Object> map);
SteelStructureCurrentData selectNewestSteelStructureCurrentData(@Param("measurePointNumber") String measurePointNumber, @Param("projectSn") String projectSn);
IPage<SteelStructureCurrentData> selectSteelStructureCurrentDataList(@Param("projectSn") String projectSn, @Param("measurePointNumber") String measurePointNumber, @Param("sensorSn") String sensorSn, @Param("steelStructureEngineeringToMonitorTypeId") Long steelStructureEngineeringToMonitorTypeId, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("alarmState") Integer alarmState, Page<?> tPage);
List<SteelStructureCurrentData> selectArticleOneDataList(Set<String> sensorSnList);
List<SteelStructureCurrentData> getAllEndData();
int updateDataTotalAndAlarmState(@Param("sensorSn") String sensorSn, @Param("fiducialValue") Float fiducialValue, @Param("alarmValue") Float alarmValue, @Param("rateAlarmValue") Float rateAlarmValue);
List<EntityMap> getAlarmCycleTrendGraph(Map<String, Object> map);
List<NumberDifferentTypesAlarmsRadarChartOneMonthVo> getNumberDifferentTypesAlarmsRadarChartOneMonth(Map<String, Object> map);
}

View File

@ -0,0 +1,24 @@
package com.zhgd.xmgl.modules.steelstructure.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureEngineering;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @Description: 钢结构自动化监测系统-工程
* @author pds
* @date 2021-10-08
* @version V1.0
*/
@Mapper
public interface SteelStructureEngineeringMapper extends BaseMapper<SteelStructureEngineering> {
List<SteelStructureEngineering> selectSteelStructureEngineeringPage(Page<SteelStructureEngineering> page, @Param("param") Map<String, Object> map);
List<SteelStructureEngineering> selectSteelStructureList(Map<String, Object> map);
}

View File

@ -0,0 +1,15 @@
package com.zhgd.xmgl.modules.steelstructure.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureEngineeringToMonitorType;
import org.apache.ibatis.annotations.Mapper;
/**
* @author 邱平毅
* @ClassName SteelStructureEngineeringToMonitorTypeMapper
* @date 2022/8/19 11:29
* @Version 1.0
*/
@Mapper
public interface SteelStructureEngineeringToMonitorTypeMapper extends BaseMapper<SteelStructureEngineeringToMonitorType> {
}

View File

@ -0,0 +1,22 @@
package com.zhgd.xmgl.modules.steelstructure.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureMeasurePoint;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @Description: 钢结构自动化监测系统-测点
* @author pds
* @date 2021-10-08
* @version V1.0
*/
@Mapper
public interface SteelStructureMeasurePointMapper extends BaseMapper<SteelStructureMeasurePoint> {
List<SteelStructureMeasurePoint> selectSteelStructureAllMeasurePointList(Map<String, Object> map);
SteelStructureMeasurePoint getDetailsByMeasurePointNumber(@Param("measurePointNumber") String measurePointNumber);
}

View File

@ -0,0 +1,20 @@
package com.zhgd.xmgl.modules.steelstructure.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureMeasurePointToPlaneFigure;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @Description: 钢结构自动化监测系统-测点和平面图配置中间表
* @author pds
* @date 2021-10-09
* @version V1.0
*/
@Mapper
public interface SteelStructureMeasurePointToPlaneFigureMapper extends BaseMapper<SteelStructureMeasurePointToPlaneFigure> {
List<EntityMap> selectPlaneFigureCoordinateList(Long steelStructurePlaneFigureId);
}

View File

@ -0,0 +1,31 @@
package com.zhgd.xmgl.modules.steelstructure.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureMonitorType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @Description: 钢结构自动化监测系统-监测类型
* @author pds
* @date 2021-10-08
* @version V1.0
*/
@Mapper
public interface SteelStructureMonitorTypeMapper extends BaseMapper<SteelStructureMonitorType> {
List<EntityMap> selectSteelStructureMonitorPage(Page<EntityMap> page, @Param("steelStructureEngineeringId") Long steelStructureEngineeringId);
List<EntityMap> selectSteelStructureMonitorList(Map<String, Object> map);
List<Map<String, Object>> selectSteelStructureMonitorTypeCountList(Map<String, Object> map);
List<EntityMap> selectMonitorTypeList(Map<String, Object> map);
List<Map<String, Object>> selectMonitorTypeAlarmCountList(Map<String, Object> map);
}

View File

@ -0,0 +1,16 @@
package com.zhgd.xmgl.modules.steelstructure.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructurePlaneFigure;
import org.apache.ibatis.annotations.Mapper;
/**
* @Description: 钢结构自动化监测系统-平面图配置
* @author pds
* @date 2021-10-09
* @version V1.0
*/
@Mapper
public interface SteelStructurePlaneFigureMapper extends BaseMapper<SteelStructurePlaneFigure> {
}

View File

@ -0,0 +1,26 @@
package com.zhgd.xmgl.modules.steelstructure.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureSensor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
/**
* @author 邱平毅
* @ClassName SteelStructureSensorMapper
* @date 2022/8/18 9:42
* @Version 1.0
*/
@Mapper
public interface SteelStructureSensorMapper extends BaseMapper<SteelStructureSensor> {
List<SteelStructureSensor> getListBySensorSnSet(Set<String> sensorSnSet);
SteelStructureSensor getUnitAndAlarmValueBySnAndPointNumber(@Param("sensorSn") String sensorSn, @Param("measurePointNumber") String measurePointNumber);
List<SteelStructureSensor> getListByMeasurePointNumberList(List<String> measurePointNumberList);
List<SteelStructureSensor> getListBySensorSnList(List<String> sensorSnList);
}

View File

@ -0,0 +1,16 @@
package com.zhgd.xmgl.modules.steelstructure.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureSensorType;
import org.apache.ibatis.annotations.Mapper;
/**
* @Description: 钢结构自动化监测系统-传感器类型
* @author pds
* @date 2021-10-08
* @version V1.0
*/
@Mapper
public interface SteelStructureSensorTypeMapper extends BaseMapper<SteelStructureSensorType> {
}

View File

@ -0,0 +1,196 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureCurrentDataMapper">
<select id="selectPageByProjectSn"
resultType="com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureCurrentData">
SELECT dee.slope_name slopeName,
demp.measure_point_name measurePointName,
dest.sensor_type_name sensorTypeName,
des.sensor_sn,
des.sensor_name,
decd.id,
decd.`data`,
dest.unit,
decd.data_rate,
decd.data_this,
decd.data_total,
decd.receive_time,
decd.alarm_state,
des.alarm_value,
des.fiducial_value,
des.rate_alarm_value
FROM steel_structure_current_data decd
inner join steel_structure_sensor des on decd.sensor_sn = des.sensor_sn
inner join steel_structure_measure_point demp
on des.measure_point_number = demp.measure_point_number
inner join steel_structure_engineering dee on demp.steel_structure_engineering_id = dee.id
inner join steel_structure_sensor_type dest on dest.id = des.steel_structure_sensor_type_id
where dee.project_sn = #{projectSn}
<if test="steelStructureSensorTypeId != null">
and dest.id = #{steelStructureSensorTypeId}
</if>
<if test="startDate != null and startDate != ''">
and decd.receive_time >= #{startDate}
</if>
<if test="endDate != null and endDate != ''">
and #{endDate} >= decd.receive_time
</if>
<if test="measurePointName != null and measurePointName != ''">
and demp.measure_point_name like CONCAT('%', #{measurePointName}, '%')
</if>
order by decd.receive_time desc
</select>
<select id="selectSteelStructureCurrentDataPage"
resultType="com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureCurrentData">
SELECT a.*
from steel_structure_current_data a
join steel_structure_sensor h on h.sensor_sn= a.sensor_sn
LEFT JOIN steel_structure_measure_point b ON h.measure_point_number = b.measure_point_number
left join steel_structure_engineering_to_monitor_type h2 on
h2.id=b.steel_structure_engineering_to_monitor_type_id
WHERE a.project_sn = #{param.projectSn}
<if test="param.measurePointNumber != null and param.measurePointNumber != ''">
and h.measure_point_number like CONCAT(CONCAT('%', #{param.measurePointNumber}), '%')
</if>
<if test="param.steelStructureMonitorTypeId != null and param.steelStructureMonitorTypeId != ''">
and h2.steel_structure_monitor_type_id = #{param.steelStructureMonitorTypeId}
</if>
<if test="param.alarmState != null and param.alarmState != '' or param.alarmState == '0'.toString()">
and a.alarm_state = #{param.alarmState}
</if>
<if test="param.startTime != null and param.startTime != ''">
AND a.receive_time >= #{param.startTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
and a.receive_time &lt;= #{param.endTime}
</if>
order by a.receive_time desc
</select>
<select id="selectNewestSteelStructureCurrentData"
resultType="com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureCurrentData">
SELECT decd.*
from steel_structure_current_data decd
inner join steel_structure_sensor des on des.sensor_sn = decd.sensor_sn
inner join steel_structure_measure_point demp
on des.measure_point_number = demp.measure_point_number
where demp.measure_point_number = #{measurePointNumber}
order by decd.receive_time
desc
limit 1
</select>
<select id="selectSteelStructureCurrentDataList"
resultType="com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureCurrentData">
select dee.slope_name slopeName,
demp.measure_point_name measurePointName,
demp.measure_point_number measurePointNumber,
dest.sensor_type_name sensorTypeName,
des.sensor_sn,
des.sensor_name,
decd.id,
decd.`data`,
dest.unit,
decd.data_rate,
decd.data_this,
decd.data_total,
decd.receive_time,
decd.alarm_state,
des.alarm_value,
des.fiducial_value,
des.rate_alarm_value
from steel_structure_current_data decd
left join steel_structure_sensor des on decd.sensor_sn = des.sensor_sn
left join steel_structure_measure_point demp
on des.measure_point_number = demp.measure_point_number
inner join steel_structure_engineering dee on demp.steel_structure_engineering_id = dee.id
left join steel_structure_sensor_type dest on dest.id = des.steel_structure_sensor_type_id
<where>
<if test="projectSn != null and projectSn != ''">
and dee.project_sn = #{projectSn}
</if>
<if test="measurePointNumber != null and measurePointNumber != ''">
and des.measure_point_number like concat('%', #{measurePointNumber}, '%')
</if>
<if test="sensorSn != null and sensorSn != ''">
and des.sensor_sn = #{sensorSn}
</if>
<if test="steelStructureEngineeringToMonitorTypeId != null">
and demp.steel_structure_engineering_to_monitor_type_id = #{steelStructureEngineeringToMonitorTypeId}
</if>
<if test="startTime != null and startTime != ''">
and decd.receive_time >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and #{endTime} >= decd.receive_time
</if>
<if test="alarmState != null">
and decd.alarm_state = #{alarmState}
</if>
</where>
order by decd.receive_time desc
</select>
<select id="selectArticleOneDataList"
resultType="com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureCurrentData">
SELECT decd.*
from steel_structure_current_data decd
inner join
(select MIN(id) id, sensor_sn
from steel_structure_current_data
WHERE sensor_sn in
<foreach collection="collection" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
group by sensor_sn) temp on decd.id = temp.id
</select>
<select id="getAllEndData" resultType="com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureCurrentData">
select sensor_sn, MAX(receive_time) receive_time
from steel_structure_current_data
group by sensor_sn
</select>
<update id="updateDataTotalAndAlarmState">
update steel_structure_current_data
set data = data_total + ${fiducialValue},
alarm_state = IF( data_rate &gt; ${rateAlarmValue}, 4,
if(data_total &gt; ${alarmValue}, 2, 1))
where sensor_sn = #{sensorSn}
</update>
<select id="getAlarmCycleTrendGraph" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
SELECT
count(*) num,
DATE_FORMAT(decd.receive_time, '%Y-%m-%d') time
FROM
steel_structure_measure_point_to_plane_figure a
INNER JOIN steel_structure_measure_point b ON a.steel_structure_measure_point_id = b.id
INNER JOIN steel_structure_sensor des ON b.measure_point_number = des.measure_point_number
INNER JOIN steel_structure_current_data decd ON decd.sensor_sn = des.sensor_sn
WHERE a.steel_structure_plane_figure_id = #{steelStructurePlaneFigureId}
and decd.project_sn = #{projectSn}
and decd.receive_time >= DATE_SUB(NOW(),INTERVAL 30 day)
and decd.alarm_state in (2,3,4)
GROUP BY time
</select>
<select id="getNumberDifferentTypesAlarmsRadarChartOneMonth"
resultType="com.zhgd.xmgl.modules.highformwork.entity.vo.NumberDifferentTypesAlarmsRadarChartOneMonthVo">
SELECT
demt.monitor_type_name as name,count(*) num
FROM
steel_structure_measure_point_to_plane_figure a
INNER JOIN steel_structure_measure_point b ON a.steel_structure_measure_point_id = b.id
INNER JOIN steel_structure_sensor des ON b.measure_point_number = des.measure_point_number
INNER JOIN steel_structure_current_data decd ON decd.sensor_sn = des.sensor_sn
INNER JOIN steel_structure_engineering_to_monitor_type demtr ON demtr.steel_structure_engineering_id =
b.steel_structure_engineering_id AND
demtr.id=b.steel_structure_engineering_to_monitor_type_id
INNER JOIN steel_structure_monitor_type demt ON demt.id = demtr.steel_structure_monitor_type_id
WHERE a.steel_structure_plane_figure_id = #{steelStructurePlaneFigureId}
and decd.project_sn = #{projectSn}
and decd.receive_time >= DATE_SUB(NOW(),INTERVAL 30 day)
and decd.alarm_state in (2,3,4)
group by demt.monitor_type_name
order by num desc
</select>
</mapper>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureEngineeringMapper">
<select id="selectSteelStructureEngineeringPage"
resultType="com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureEngineering">
SELECT *
from steel_structure_engineering
WHERE project_sn=#{param.projectSn}
order by id desc
</select>
<select id="selectSteelStructureList"
resultType="com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureEngineering">
SELECT *
from steel_structure_engineering
WHERE project_sn=#{projectSn}
order by id desc
</select>
</mapper>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureEngineeringToMonitorTypeMapper">
</mapper>

View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureMeasurePointMapper">
<select id="selectSteelStructureAllMeasurePointList"
resultType="com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureMeasurePoint">
select a.*
from steel_structure_measure_point a
INNER JOIN steel_structure_engineering_to_monitor_type b ON a.steel_structure_engineering_to_monitor_type_id =
b.id
where b.steel_structure_engineering_id = #{steelStructureEngineeringId}
<if test="steelStructureEngineeringToMonitorTypeId != null and steelStructureEngineeringToMonitorTypeId != ''">
and a.steel_structure_engineering_to_monitor_type_id = #{steelStructureEngineeringToMonitorTypeId}
</if>
</select>
<resultMap autoMapping="true" id="measurePointAndSensor"
type="com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureMeasurePoint">
<id property="id" column="id"/>
<collection autoMapping="true" property="sensorList"
ofType="com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureSensor">
<id property="id" column="sId"/>
</collection>
</resultMap>
<select id="getDetailsByMeasurePointNumber" resultMap="measurePointAndSensor">
select demp.id,
demp.steel_structure_engineering_id,
demp.steel_structure_engineering_to_monitor_type_id,
demp.measure_point_name,
demp.measure_point_number,
demp.measure_point_addr,
demp.alarm_state,
demp.alarm_type,
demp.steel_structure_current_data_id,
demp.alarm_date,
des.id sId,
des.sensor_sn,
des.sensor_name,
des.steel_structure_sensor_type_id,
des.status,
des.early_warning_value,
des.alarm_value,
des.rate_alarm_value,
des.fiducial_value,
des.control_value
from steel_structure_measure_point demp
left join steel_structure_sensor des on demp.measure_point_number = des.measure_point_number
where demp.measure_point_number = #{measurePointNumber}
</select>
</mapper>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureMeasurePointToPlaneFigureMapper">
<select id="selectPlaneFigureCoordinateList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
SELECT a.*,
b.measure_point_name,
b.measure_point_addr,
b.measure_point_number,
b.alarm_state,
demt.monitor_type_name
from steel_structure_measure_point_to_plane_figure a
INNER JOIN steel_structure_measure_point b ON a.steel_structure_measure_point_id = b.id
inner join steel_structure_engineering_to_monitor_type demtr on demtr.id =
b.steel_structure_engineering_to_monitor_type_id
inner join steel_structure_monitor_type demt on demtr.steel_structure_monitor_type_id = demt.id
WHERE a.steel_structure_plane_figure_id = #{steelStructurePlaneFigureId}
</select>
</mapper>

View File

@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureMonitorTypeMapper">
<select id="selectSteelStructureMonitorList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
SELECT a.*, IFNULL(b.num, 0) measure_point_num
from steel_structure_monitor_type a
LEFT JOIN
(SELECT steel_structure_monitor_type_id, COUNT(1) num
from steel_structure_measure_point
GROUP BY steel_structure_monitor_type_id) b
ON a.id = b.steel_structure_monitor_type_id
where a.project_sn = #{projectSn}
and a.steel_structure_engineering_id = #{steelStructureEngineeringId}
</select>
<select id="selectSteelStructureMonitorTypeCountList"
resultType="java.util.Map">
SELECT demt.monitor_type_name monitorTypeName, IFNULL(b.num, 0) measurePointNum
from steel_structure_engineering_to_monitor_type demtr
left join steel_structure_monitor_type demt on demt.id = demtr.steel_structure_monitor_type_id
LEFT JOIN
(SELECT steel_structure_engineering_to_monitor_type_id, COUNT(1) num from steel_structure_measure_point GROUP BY
steel_structure_engineering_to_monitor_type_id) b
ON demtr.id = b.steel_structure_engineering_to_monitor_type_id
where demtr.steel_structure_engineering_id = #{steelStructureEngineeringId}
</select>
<select id="selectMonitorTypeList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
SELECT demtr.*,
demt.monitor_type_name,
IFNULL(b.num, 0) measure_point_num,
IFNULL(c.normal_number, 0) normal_number,
IFNULL(c.super_alarm_number, 0) super_alarm_number,
IFNULL(c.super_control_number, 0) super_control_number,
IFNULL(c.rate_alarm_number, 0) rate_alarm_number,
(case when alarm_state_type = 0 then 0 else 1 end) alarm_type
from steel_structure_engineering_to_monitor_type demtr
inner join steel_structure_monitor_type demt on demt.id = demtr.steel_structure_monitor_type_id
LEFT JOIN
(SELECT steel_structure_engineering_to_monitor_type_id,
COUNT(1) num,
IFNULL(SUM((case when alarm_state <![CDATA[ <> ]]> 1 then 1 else 0 end)), 0) alarm_state_type
from steel_structure_measure_point
GROUP BY steel_structure_engineering_to_monitor_type_id) b ON demtr.id =
b.steel_structure_engineering_to_monitor_type_id
LEFT JOIN (SELECT t2.steel_structure_engineering_to_monitor_type_id,
IFNULL(SUM((case when decd.alarm_state = 1 then 1 else 0 end)), 0) normal_number,
IFNULL(SUM((case when decd.alarm_state = 2 then 1 else 0 end)), 0) super_alarm_number,
IFNULL(SUM((case when decd.alarm_state = 3 then 1 else 0 end)), 0) super_control_number,
IFNULL(SUM((case when decd.alarm_state = 4 then 1 else 0 end)), 0) rate_alarm_number
from steel_structure_current_data decd
INNER JOIN steel_structure_sensor des
ON des.sensor_sn = decd.sensor_sn
INNER JOIN steel_structure_measure_point t2
ON des.measure_point_number = t2.measure_point_number
<where>
<if test="steelStructureEngineeringId != null and steelStructureEngineeringId != ''">
t2.steel_structure_engineering_id = #{steelStructureEngineeringId}
</if>
</where>
AND decd.receive_time >=
CONCAT(DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -6 DAY), '%Y-%m-%d'), ' 00:00:00')
GROUP BY t2.steel_structure_engineering_to_monitor_type_id) c ON demtr.id =
c.steel_structure_engineering_to_monitor_type_id
<where>
<if test="steelStructureEngineeringId != null and steelStructureEngineeringId != ''">
demtr.steel_structure_engineering_id = #{steelStructureEngineeringId}
</if>
</where>
</select>
<select id="selectMonitorTypeAlarmCountList" resultType="java.util.Map">
SELECT demt.monitor_type_name monitorTypeName,
IFNULL(c.normal_number, 0) normalNumber,
IFNULL(c.super_alarm_number, 0) superAlarmNumber,
IFNULL(c.rate_alarm_number, 0) rateAlarmNumber
from steel_structure_engineering_to_monitor_type demtr
LEFT JOIN (SELECT t2.steel_structure_engineering_to_monitor_type_id,
IFNULL(SUM((case when t1.alarm_state = 1 then 1 else 0 end)), 0) normal_number,
IFNULL(SUM((case when t1.alarm_state = 2 then 1 else 0 end)), 0) super_alarm_number,
IFNULL(SUM((case when t1.alarm_state = 4 then 1 else 0 end)), 0) rate_alarm_number
from steel_structure_current_data t1
inner join steel_structure_sensor des on t1.sensor_sn = des.sensor_sn
INNER JOIN steel_structure_measure_point t2
ON des.measure_point_number = t2.measure_point_number
WHERE t2.steel_structure_engineering_id=#{steelStructureEngineeringId}
<if test="searchType == '1'.toString()">
AND t1.receive_time >=CONCAT(DATE_FORMAT(DATE_ADD(NOW()
,INTERVAL -6 DAY)
,'%Y-%m-%d')
,' 00:00:00')
</if>
<if test="searchType == '2'.toString()">
AND t1.receive_time >=CONCAT(DATE_FORMAT(DATE_ADD(NOW()
,INTERVAL -30 DAY)
,'%Y-%m-%d')
,' 00:00:00')
</if>
GROUP BY t2.steel_structure_engineering_to_monitor_type_id) c ON demtr.id =
c.steel_structure_engineering_to_monitor_type_id
inner join steel_structure_monitor_type demt on demtr.steel_structure_monitor_type_id = demt.id
where demtr.steel_structure_engineering_id = #{steelStructureEngineeringId}
</select>
<select id="selectSteelStructureMonitorPage" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
SELECT demtr.*,
demt.monitor_type_name monitor_type_name,
IFNULL(conutTable.num, 0) measure_point_num
FROM steel_structure_engineering_to_monitor_type demtr
LEFT JOIN steel_structure_monitor_type demt ON demtr.steel_structure_monitor_type_id = demt.id
LEFT JOIN(SELECT steel_structure_engineering_to_monitor_type_id, COUNT(1) num
FROM steel_structure_measure_point
where steel_structure_engineering_id = #{steelStructureEngineeringId}
GROUP BY steel_structure_engineering_to_monitor_type_id) conutTable ON
conutTable.steel_structure_engineering_to_monitor_type_id = demtr.id
WHERE demtr.steel_structure_engineering_id = #{steelStructureEngineeringId}
</select>
</mapper>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructurePlaneFigureMapper">
</mapper>

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureSensorMapper">
<select id="getListBySensorSnSet" resultType="com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureSensor">
select des.*, dee.project_sn,dest.sensor_type_code
from steel_structure_sensor des
left join steel_structure_measure_point demp on des.measure_point_number = demp.measure_point_number
left join steel_structure_sensor_type dest ON dest.id = des.steel_structure_sensor_type_id
left join steel_structure_engineering dee on dee.id = demp.steel_structure_engineering_id
where 1 = 1
<if test="collection != null and collection.size() != 0">
and des.sensor_sn in
<foreach collection="collection" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="getListByMeasurePointNumberList"
resultType="com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureSensor">
SELECT des.id,
des.sensor_sn,
des.measure_point_number,
des.steel_structure_sensor_type_id,
des.status,
des.data,
des.data_rate,
des.data_total,
des.receive_time,
des.early_warning_value,
des.alarm_value,
des.control_value,
dest.unit,
dest.sensor_type_name
FROM steel_structure_sensor des
left join steel_structure_sensor_type dest on dest.id = des.steel_structure_sensor_type_id
WHERE measure_point_number IN
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="getListBySensorSnList"
resultType="com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureSensor">
select des.*, dee.project_sn
from steel_structure_sensor des
left join steel_structure_measure_point demp
on des.measure_point_number = demp.measure_point_number
left join steel_structure_engineering dee on demp.steel_structure_engineering_id = dee.id
where 1 = 1
<if test="list != null and list.size() != 0">
and des.sensor_sn in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="getUnitAndAlarmValueBySnAndPointNumber"
resultType="com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureSensor">
select dest.unit, des.alarm_value, des.fiducial_value
from steel_structure_sensor_type dest
inner join steel_structure_sensor des on dest.id = des.steel_structure_sensor_type_id
where des.sensor_sn = #{sensorSn}
and des.measure_point_number = #{measurePointNumber}
</select>
</mapper>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureSensorTypeMapper">
</mapper>

View File

@ -0,0 +1,56 @@
package com.zhgd.xmgl.modules.steelstructure.service;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureCurrentData;
import com.zhgd.xmgl.modules.steelstructure.entity.vo.DataAlarmVO;
import com.zhgd.xmgl.modules.highformwork.entity.vo.NumberDifferentTypesAlarmsRadarChartOneMonthVo;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* @Description: 钢结构自动化监测系统-监测实时数据
* @author pds
* @date 2021-10-08
* @version V1.0
*/
public interface ISteelStructureCurrentDataService extends IService<SteelStructureCurrentData> {
IPage<SteelStructureCurrentData> selectPageByProjectSn(String measurePointName, Long sensorTypeId, String startDate, String endDate, String projectSn, Integer pageNo, Integer pageSize);
IPage<SteelStructureCurrentData> selectSteelStructureCurrentDataPage(Map<String, Object> map);
void saveSteelStructureCurrentData(SteelStructureCurrentData steelStructureCurrentData);
/**
* 批量保存实时数据
*
* @param jsonArray
*/
void saveBatchSteelStructureCurrentData(JSONArray jsonArray);
IPage<SteelStructureCurrentData> selectSteelStructureCurrentDataList(String projectSn, String measurePointNumber, String sensorSn, Long steelStructureEngineeringToMonitorTypeId, String startTime, String endTime, Integer alarmState, Integer pageNo, Integer pageSize);
/**
* 获取所有传感器最后一条数据时间
*
* @return
*/
List<SteelStructureCurrentData> getAllEndData();
void updateDataTotalAndAlarmState(String sensorSn, Float fiducialValue, Float alarmValue, Float rateAlarmValue);
void exportData(HttpServletResponse response, String projectSn, String measurePointNumber, String sensorSn, Long steelStructureEngineeringToMonitorTypeId, String startTime, String endTime, Integer alarmState);
void zwExportData(HttpServletResponse response, String measurePointName, Long sensorTypeId, String startDate, String endDate, String projectSn);
DataAlarmVO getDataAlarmNumber();
List<NumberDifferentTypesAlarmsRadarChartOneMonthVo> getNumberDifferentTypesAlarmsRadarChartOneMonth(Map<String, Object> map);
List<EntityMap> getAlarmCycleTrendGraph(Map<String, Object> map);
}

View File

@ -0,0 +1,27 @@
package com.zhgd.xmgl.modules.steelstructure.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureEngineering;
import java.util.List;
import java.util.Map;
/**
* @Description: 钢结构自动化监测系统-工程
* @author pds
* @date 2021-10-08
* @version V1.0
*/
public interface ISteelStructureEngineeringService extends IService<SteelStructureEngineering> {
void saveSteelStructureEngineering(SteelStructureEngineering steelStructureEngineering);
void deleteSteelStructureEngineering(Long id);
IPage<SteelStructureEngineering> selectSteelStructureEngineeringPage(Map<String, Object> map);
List<SteelStructureEngineering> selectSteelStructureList(Map<String, Object> map);
SteelStructureEngineering edit(SteelStructureEngineering steelStructureEngineering);
}

View File

@ -0,0 +1,34 @@
package com.zhgd.xmgl.modules.steelstructure.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureMeasurePoint;
import java.util.List;
import java.util.Map;
/**
* @Description: 钢结构自动化监测系统-测点
* @author pds
* @date 2021-10-08
* @version V1.0
*/
public interface ISteelStructureMeasurePointService extends IService<SteelStructureMeasurePoint> {
void saveMeasurePoint(SteelStructureMeasurePoint steelStructureMeasurePoint);
void editMeasurePoint(SteelStructureMeasurePoint steelStructureMeasurePoint);
SteelStructureMeasurePoint selectSteelStructureMeasurePointById(Map<String, Object> map);
List<SteelStructureMeasurePoint> selectSteelStructureAllMeasurePointList(Map<String, Object> map);
SteelStructureMeasurePoint getDetailsByMeasurePointNumber(String measurePointNumber);
/**
* 根据关系id列表删除数据
*
* @param relaIdList
*/
void deleteByRelaIdList(List<Long> relaIdList);
void deleteByMeasurePointNumber(String measurePointNumber);
}

View File

@ -0,0 +1,28 @@
package com.zhgd.xmgl.modules.steelstructure.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureMonitorType;
import java.util.List;
import java.util.Map;
/**
* @Description: 钢结构自动化监测系统-监测类型
* @author pds
* @date 2021-10-08
* @version V1.0
*/
public interface ISteelStructureMonitorTypeService extends IService<SteelStructureMonitorType> {
IPage<EntityMap> selectSteelStructureMonitorPage(Map<String, Object> map);
List<EntityMap> selectSteelStructureMonitorList(Map<String, Object> map);
Map<String, Object> selectMonitorTypeCount(Map<String, Object> map);
List<EntityMap> selectMonitorTypeList(Map<String, Object> map);
List<Map<String, Object>> selectMonitorTypeAlarmCountList(Map<String, Object> map);
}

View File

@ -0,0 +1,19 @@
package com.zhgd.xmgl.modules.steelstructure.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructurePlaneFigure;
/**
* @Description: 钢结构自动化监测系统-平面图配置
* @author pds
* @date 2021-10-09
* @version V1.0
*/
public interface ISteelStructurePlaneFigureService extends IService<SteelStructurePlaneFigure> {
void deleteSteelStructurePlaneFigure(String id);
void savesteelStructurePlaneFigure(SteelStructurePlaneFigure steelStructurePlaneFigure);
void editsteelStructurePlaneFigure(SteelStructurePlaneFigure steelStructurePlaneFigure);
}

View File

@ -0,0 +1,14 @@
package com.zhgd.xmgl.modules.steelstructure.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureSensorType;
/**
* @Description: 钢结构自动化监测系统-传感器类型
* @author pds
* @date 2021-10-08
* @version V1.0
*/
public interface ISteelStructureSensorTypeService extends IService<SteelStructureSensorType> {
}

View File

@ -0,0 +1,19 @@
package com.zhgd.xmgl.modules.steelstructure.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureEngineeringToMonitorType;
/**
* @author 邱平毅
* @ClassName SteelStructureEngineeringToMonitorTypeService
* @date 2022/8/19 11:29
* @Version 1.0
*/
public interface SteelStructureEngineeringToMonitorTypeService extends IService<SteelStructureEngineeringToMonitorType> {
/**
* 根据钢结构自动化监测系统id删除监测内容
*
* @param id
*/
void deleteByExcavationId(Long id);
}

View File

@ -0,0 +1,25 @@
package com.zhgd.xmgl.modules.steelstructure.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureMeasurePointToPlaneFigure;
import java.util.List;
import java.util.Map;
/**
* @Description: 钢结构自动化监测系统-测点和平面图配置中间表
* @author pds
* @date 2021-10-09
* @version V1.0
*/
public interface SteelStructureMeasurePointToPlaneFigureService extends IService<SteelStructureMeasurePointToPlaneFigure> {
List<EntityMap> selectPlaneFigureCoordinateList(Map<String, Object> map);
void editPlaneFigureCoordinate(SteelStructureMeasurePointToPlaneFigure steelStructureMeasurePointToPlaneFigure);
void deleteSteelStructurePlaneFigureCoordinate(Map<String, Object> map);
void updateFigureCoordinate(List<SteelStructureMeasurePointToPlaneFigure> list);
}

View File

@ -0,0 +1,31 @@
package com.zhgd.xmgl.modules.steelstructure.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureSensor;
import java.util.List;
import java.util.Map;
/**
* @author 邱平毅
* @ClassName SteelStructureSensorService
* @date 2022/8/18 9:42
* @Version 1.0
*/
public interface SteelStructureSensorService extends IService<SteelStructureSensor> {
/**
* 根据测点编号列表删除传感器
*
* @param mpNumberList
*/
void deleteByMpNumberList(List<String> mpNumberList);
List<SteelStructureSensor> getListBySensorAndTypeMap(Map<String, String> sensorAndTypeMap);
SteelStructureSensor getUnitAndAlarmValueBySnAndPointNumber(String sensorSn, String measurePointNumber);
List<SteelStructureSensor> getListBySensorSnList(List<String> sensorSnList);
List<SteelStructureSensor> getListByMeasurePointNumberList(List<String> measurePointNumberList);
}

View File

@ -0,0 +1,363 @@
package com.zhgd.xmgl.modules.steelstructure.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.async.AsyncDevExcavation;
import com.zhgd.xmgl.modules.discharging.service.impl.DischargingPlatformAlarmServiceImpl;
import com.zhgd.xmgl.modules.highformwork.entity.vo.NumberDifferentTypesAlarmsRadarChartOneMonthVo;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureCurrentData;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureMeasurePoint;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureMonitorType;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureSensor;
import com.zhgd.xmgl.modules.steelstructure.entity.vo.DataAlarmVO;
import com.zhgd.xmgl.modules.steelstructure.enums.DataStatusEnum;
import com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureCurrentDataMapper;
import com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureMeasurePointMapper;
import com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureMonitorTypeMapper;
import com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureSensorMapper;
import com.zhgd.xmgl.modules.steelstructure.service.SteelStructureSensorService;
import com.zhgd.xmgl.modules.steelstructure.service.ISteelStructureCurrentDataService;
import com.zhgd.xmgl.modules.steelstructure.service.ISteelStructureMeasurePointService;
import com.zhgd.xmgl.modules.steelstructure.service.ISteelStructureMonitorTypeService;
import com.zhgd.xmgl.util.JxlExcelUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @Description: 钢结构自动化监测系统-监测实时数据
* @author pds
* @date 2021-10-08
* @version V1.0
*/
@Service
@Transactional(rollbackFor = Exception.class)
@Slf4j
public class SteelStructureCurrentDataServiceImpl extends ServiceImpl<SteelStructureCurrentDataMapper, SteelStructureCurrentData> implements ISteelStructureCurrentDataService {
@Autowired
private SteelStructureMonitorTypeMapper steelStructureMonitorTypeMapper;
@Autowired
private DischargingPlatformAlarmServiceImpl dischargingPlatformAlarmService;
@Autowired
private SteelStructureCurrentDataMapper steelStructureCurrentDataMapper;
@Autowired
private SteelStructureMeasurePointMapper steelStructureMeasurePointMapper;
@Autowired
ISteelStructureMonitorTypeService steelStructureMonitorTypeService;
@Autowired
ISteelStructureCurrentDataService steelStructureCurrentDataService;
@Autowired
SteelStructureSensorMapper steelStructureSensorMapper;
@Autowired
SteelStructureSensorService steelStructureSensorService;
@Autowired
ISteelStructureMeasurePointService steelStructureMeasurePointService;
@Autowired
AsyncDevExcavation asyncSteelStructure;
@Override
public IPage<SteelStructureCurrentData> selectPageByProjectSn(String measurePointName, Long sensorTypeId, String startDate, String endDate, String projectSn, Integer pageNo, Integer pageSize) {
IPage<SteelStructureCurrentData> page = steelStructureCurrentDataMapper.selectPageByProjectSn(measurePointName, sensorTypeId, startDate, endDate, projectSn, new Page<>(pageNo, pageSize));
for (SteelStructureCurrentData currentData : page.getRecords()) {
currentData.setLastTimeData(NumberUtil.sub(Optional.ofNullable(currentData.getData()).orElse(0f), Optional.ofNullable(currentData.getDataThis()).orElse(0f)).floatValue());
}
return page;
}
@Override
public IPage<SteelStructureCurrentData> selectSteelStructureCurrentDataPage(Map<String, Object> map) {
int pageNo = Integer.parseInt(map.getOrDefault("pageNo", 1).toString());
int pageSize = Integer.parseInt(map.getOrDefault("pageSize", 10).toString());
Page<SteelStructureCurrentData> page = new Page<>(pageNo, pageSize);
List<SteelStructureCurrentData> list = steelStructureCurrentDataMapper.selectSteelStructureCurrentDataPage(page, map);
return page.setRecords(list);
}
@Override
public IPage<SteelStructureCurrentData> selectSteelStructureCurrentDataList(String projectSn, String measurePointNumber, String sensorSn, Long steelStructureEngineeringToMonitorTypeId, String startTime, String endTime, Integer alarmState, Integer pageNo, Integer pageSize) {
IPage<SteelStructureCurrentData> page = steelStructureCurrentDataMapper.selectSteelStructureCurrentDataList(projectSn, measurePointNumber, sensorSn, steelStructureEngineeringToMonitorTypeId, startTime, endTime, alarmState, new Page<>(pageNo, pageSize));
for (SteelStructureCurrentData currentData : page.getRecords()) {
currentData.setLastTimeData(NumberUtil.sub(Optional.ofNullable(currentData.getData()).orElse(0f), Optional.ofNullable(currentData.getDataThis()).orElse(0f)).floatValue());
}
return page;
}
@Override
public List<SteelStructureCurrentData> getAllEndData() {
return steelStructureCurrentDataMapper.getAllEndData();
}
@Override
public void updateDataTotalAndAlarmState(String sensorSn, Float fiducialValue, Float alarmValue, Float rateAlarmValue) {
steelStructureCurrentDataMapper.updateDataTotalAndAlarmState(sensorSn, fiducialValue, Math.abs(alarmValue), Math.abs(rateAlarmValue));
}
@Override
public void exportData(HttpServletResponse response, String projectSn, String measurePointNumber, String sensorSn, Long steelStructureEngineeringToMonitorTypeId, String startTime, String endTime, Integer alarmState) {
try {
List<SteelStructureCurrentData> list = steelStructureCurrentDataMapper.selectSteelStructureCurrentDataList(projectSn, measurePointNumber, sensorSn, steelStructureEngineeringToMonitorTypeId, startTime, endTime, alarmState, new Page<>().setSize(-1)).getRecords();
for (SteelStructureCurrentData currentData : list) {
currentData.setLastTimeData(NumberUtil.sub(Optional.ofNullable(currentData.getData()).orElse(0f), Optional.ofNullable(currentData.getDataThis()).orElse(0f)).floatValue());
currentData.setAlarmStateStr(DataStatusEnum.getStatusNameById(currentData.getAlarmState()));
}
String[] heads = {"测点名称", "传感器名称", "传感器编号", "传感器类型", "初始值", "采集时间", "上次值", "本次值", "本次变化量", "累计值", "累计值预警值", "变化速率", "变化速率预警值", "报警状态"};
String[] headsStr = {"measurePointName", "sensorName", "sensorSn", "sensorTypeName", "fiducialValue", "receiveTime", "lastTimeData", "data", "dataThis", "dataTotal", "alarmValue", "dataRate", "rateAlarmValue", "alarmStateStr"};
JxlExcelUtils.excelExport("钢结构自动化监测系统实时数据列表", heads, headsStr, list, response);
} catch (Exception e) {
log.error("导出培训记录数据异常" + e);
}
}
@Override
public void zwExportData(HttpServletResponse response, String measurePointName, Long sensorTypeId, String startDate, String endDate, String projectSn) {
try {
List<SteelStructureCurrentData> list = steelStructureCurrentDataMapper.selectPageByProjectSn(measurePointName, sensorTypeId, startDate, endDate, projectSn, new Page<>().setSize(-1)).getRecords();
for (SteelStructureCurrentData currentData : list) {
currentData.setLastTimeData(NumberUtil.sub(Optional.ofNullable(currentData.getData()).orElse(0f), Optional.ofNullable(currentData.getDataThis()).orElse(0f)).floatValue());
currentData.setAlarmStateStr(DataStatusEnum.getStatusNameById(currentData.getAlarmState()));
}
String[] heads = {"钢结构自动化监测系统名称", "测点名称", "传感器类型", "传感器名称", "传感器编号", "初始值", "采集时间", "上次值", "本次值", "本次变化量", "累计值", "累计值预警值", "变化速率", "变化速率预警值", "报警状态"};
String[] headsStr = {"slopeName", "measurePointName", "sensorTypeName", "sensorName", "sensorSn", "fiducialValue", "receiveTime", "lastTimeData", "data", "dataThis", "dataTotal", "alarmValue", "dataRate", "rateAlarmValue", "alarmStateStr"};
JxlExcelUtils.excelExport("钢结构自动化监测系统实时数据列表", heads, headsStr, list, response);
} catch (Exception e) {
log.error("导出培训记录数据异常" + e);
}
}
@Override
public DataAlarmVO getDataAlarmNumber() {
List<SteelStructureCurrentData> allList = steelStructureCurrentDataMapper.selectList(Wrappers.<SteelStructureCurrentData>lambdaQuery().ne(SteelStructureCurrentData::getAlarmState, DataStatusEnum.NORMAL.getId()).isNotNull(SteelStructureCurrentData::getReceiveTime));
int month = 0;
int week = 0;
int day = 0;
Date currentDate = new Date();
int currentYear = DateUtil.year(currentDate);
int currentWeek = DateUtil.weekOfYear(currentDate);
for (SteelStructureCurrentData data : allList) {
Date receiveTime = DateUtil.parse(data.getReceiveTime(), DatePattern.NORM_DATETIME_PATTERN);
if (DateUtil.isSameDay(currentDate, receiveTime)) {
// 同一天
day++;
week++;
month++;
} else if (currentYear == DateUtil.year(receiveTime) && DateUtil.weekOfYear(receiveTime) == currentWeek) {
// 同一周
week++;
month++;
} else if (DateUtil.isSameMonth(currentDate, receiveTime)) {
// 同一个月
month++;
}
}
return new DataAlarmVO(allList.size(), month, week, day);
}
@Override
public List<EntityMap> getAlarmCycleTrendGraph(Map<String, Object> map) {
//eg:[{time:2020-11-11,num:11}]
List<EntityMap> list = steelStructureCurrentDataMapper.getAlarmCycleTrendGraph(map);
dischargingPlatformAlarmService.fillEmptyDateData(list);
return list;
}
@Override
public List<NumberDifferentTypesAlarmsRadarChartOneMonthVo> getNumberDifferentTypesAlarmsRadarChartOneMonth(Map<String, Object> map) {
List<NumberDifferentTypesAlarmsRadarChartOneMonthVo> list = steelStructureCurrentDataMapper.getNumberDifferentTypesAlarmsRadarChartOneMonth(map);
fillData(list);
return list;
}
private void fillData(List<NumberDifferentTypesAlarmsRadarChartOneMonthVo> list) {
Map<String, NumberDifferentTypesAlarmsRadarChartOneMonthVo> nameDataMap = list.stream().collect(Collectors.toMap(NumberDifferentTypesAlarmsRadarChartOneMonthVo::getName, o -> o));
//类型 1电量%2 X轴°3 Y轴°4压力kN5沉降mm
//支架沉降模板沉降立杆轴力压力监测水平位移
List<SteelStructureMonitorType> typeList = steelStructureMonitorTypeMapper.selectList(null);
List<String> dataList = typeList.stream().map(SteelStructureMonitorType::getMonitorTypeName).collect(Collectors.toList());
list.clear();
for (String name : dataList) {
NumberDifferentTypesAlarmsRadarChartOneMonthVo vo = nameDataMap.get(name);
if (vo == null) {
vo = new NumberDifferentTypesAlarmsRadarChartOneMonthVo();
vo.setName(name);
vo.setNum(0);
}
list.add(vo);
}
List<NumberDifferentTypesAlarmsRadarChartOneMonthVo> limitList = list.stream().sorted((o1, o2) -> o2.getNum().compareTo(o1.getNum())).limit(6).collect(Collectors.toList());
list.clear();
list.addAll(limitList);
}
@Override
public void saveSteelStructureCurrentData(SteelStructureCurrentData steelStructureCurrentData) {
SteelStructureSensor steelStructureSensor = steelStructureSensorMapper.selectOne(new LambdaQueryWrapper<SteelStructureSensor>()
.eq(SteelStructureSensor::getSensorSn, steelStructureCurrentData.getSensorSn()));
if (steelStructureSensor == null) {
throw new OpenAlertException("传感器编号不存在");
}
steelStructureCurrentData.setProjectSn(steelStructureSensor.getProjectSn());
steelStructureCurrentData.setId(null);
steelStructureCurrentDataMapper.insert(steelStructureCurrentData);
steelStructureMeasurePointMapper.update(null, new LambdaUpdateWrapper<SteelStructureMeasurePoint>()
.set(SteelStructureMeasurePoint::getAlarmState, steelStructureCurrentData.getAlarmState())
.eq(SteelStructureMeasurePoint::getMeasurePointNumber, steelStructureSensor.getMeasurePointNumber())
);
}
/**
* @param currentDataList
* @return Map<传感器编号, 传感器类型>
*/
private Map<String, String> getSensorAndTypeMap(JSONArray currentDataList) {
Map<String, String> sensorAndTypeMap = new LinkedHashMap<>();
for (int i = 0; i < currentDataList.size(); i++) {
// 当前数据
JSONObject currentData = currentDataList.getJSONObject(i);
// 实时数据
JSONObject current = currentData.getJSONObject("current");
if (current == null || CollUtil.isEmpty(current.getJSONArray("calcValue"))) {
break;
}
JSONArray calcValue = current.getJSONArray("calcValue");
for (int j = 0; j < calcValue.size(); j++) {
sensorAndTypeMap.put(uuidToSensorSn(currentData, j),
Optional.ofNullable(currentData.getJSONObject("metadata")).map(metadata -> metadata.getString("monitorTypeCode")).orElse(null));
}
}
return sensorAndTypeMap;
}
private String uuidToSensorSn(JSONObject currentData, int index) {
return currentData.getString("uuid") + (index > 0 ? "(" + (index + 1) + ")" : "");
}
private List<SteelStructureCurrentData> getBatchSaveListProcess(JSONArray currentDataList) {
// Map<传感器编号, 传感器类型>
Map<String, String> sensorAndTypeMap = getSensorAndTypeMap(currentDataList);
List<SteelStructureSensor> sensorList = steelStructureSensorService.getListBySensorAndTypeMap(sensorAndTypeMap);
Map<String, SteelStructureSensor> sensorMap = sensorList.stream().collect(Collectors.toMap(SteelStructureSensor::getSensorSn, Function.identity()));
return createCurrentDataList(currentDataList, sensorMap);
}
private List<SteelStructureCurrentData> createCurrentDataList(JSONArray currentDataList, Map<String, SteelStructureSensor> sensorMap) {
// 实时数据列表
List<SteelStructureCurrentData> steelStructureCurrentDataList = new LinkedList<>();
// 循环创建实时数据对象并赋值给列表
for (int i = 0; i < currentDataList.size(); i++) {
SteelStructureCurrentData steelStructureCurrentData = new SteelStructureCurrentData();
JSONObject currentData = currentDataList.getJSONObject(i);
String date = currentData.getString("time").substring(0, currentData.getString("time").length() - 3);
DateTime receiveTime = DateUtil.parse(date, "yyyyMMddHHmmss");
steelStructureCurrentData.setReceiveTime(DateUtil.format(receiveTime, "yyyy-MM-dd HH:mm:ss"));
JSONObject current = currentData.getJSONObject("current");
log.info("currentData.current{}", current);
int alarmState = Optional.ofNullable(current.getJSONObject("pointAlarmStatus")).map(e -> e.getInteger("alarmState")).orElse(1);
if (current != null) {
if (currentData.getJSONObject("metadata") != null) {
steelStructureCurrentData.setProjectCode(currentData.getJSONObject("metadata").getString("projectCode"));
}
JSONArray calcValue = current.getJSONArray("calcValue");
if (CollUtil.isNotEmpty(calcValue)) {
for (int j = 0; j < calcValue.size(); j++) {
String sensorSn = uuidToSensorSn(currentData, j);
SteelStructureSensor sensor = sensorMap.get(sensorSn);
steelStructureCurrentData.setProjectSn(sensor.getProjectSn());
JSONObject valueObject = calcValue.getJSONObject(j);
Float dataTotal = valueObject.getFloat("value");
steelStructureCurrentData.setData(dataTotal + sensor.getFiducialValue());
steelStructureCurrentData.setDataThis(valueObject.getFloat("variation"));
Float rateChange = valueObject.getFloat("rateChange");
steelStructureCurrentData.setDataRate(rateChange);
steelStructureCurrentData.setDataTotal(dataTotal);
steelStructureCurrentData.setSensorSn(sensor.getSensorSn());
steelStructureCurrentData.setAlarmState(alarmState);
steelStructureCurrentDataList.add(new SteelStructureCurrentData(steelStructureCurrentData));
if (alarmState != DataStatusEnum.NORMAL.getId()) {
log.info("钢结构自动化监测系统数据异常,进行通知,通知传感器编号为:{},数据为:{}", sensorSn, steelStructureCurrentData);
//asyncSteelStructure.sendExceptionData(alarmState, sensor);
}
if (!Objects.equals(sensor.getStatus(), alarmState)) {
steelStructureSensorService.update(null, Wrappers.<SteelStructureSensor>lambdaUpdate()
.eq(SteelStructureSensor::getSensorSn, sensor.getSensorSn()).set(SteelStructureSensor::getStatus, alarmState));
List<SteelStructureSensor> sensorList = steelStructureSensorService.list(Wrappers.<SteelStructureSensor>lambdaQuery().eq(SteelStructureSensor::getMeasurePointNumber, sensor.getMeasurePointNumber()));
List<Integer> statusList = sensorList.stream().map(SteelStructureSensor::getStatus).collect(Collectors.toList());
int updateState = 1;
if (statusList.contains(4)) {
updateState = 4;
} else if (statusList.contains(3)) {
updateState = 3;
} else if (statusList.contains(2)) {
updateState = 2;
}
steelStructureMeasurePointService.update(null, Wrappers.<SteelStructureMeasurePoint>lambdaUpdate()
.eq(SteelStructureMeasurePoint::getMeasurePointNumber, sensor.getMeasurePointNumber()).set(SteelStructureMeasurePoint::getAlarmState, updateState));
}
if (sensor.getReceiveTime() == null || receiveTime.getTime() >= DateUtil.parse(sensor.getReceiveTime(), DatePattern.NORM_DATETIME_PATTERN).getTime()) {
LambdaUpdateWrapper<SteelStructureSensor> updateWrapper = Wrappers.<SteelStructureSensor>lambdaUpdate()
.eq(SteelStructureSensor::getSensorSn, steelStructureCurrentData.getSensorSn())
.set(SteelStructureSensor::getStatus, steelStructureCurrentData.getAlarmState())
.set(SteelStructureSensor::getDataRate, steelStructureCurrentData.getDataRate())
.set(SteelStructureSensor::getReceiveTime, steelStructureCurrentData.getReceiveTime())
.set(SteelStructureSensor::getData, steelStructureCurrentData.getData())
.set(SteelStructureSensor::getDataTotal, steelStructureCurrentData.getDataTotal());
steelStructureSensorService.update(updateWrapper);
}
}
}
}
}
return steelStructureCurrentDataList;
}
@Override
public void saveBatchSteelStructureCurrentData(JSONArray jsonArray) {
// 判断是否传送数据
if (CollUtil.isEmpty(jsonArray)) {
log.warn("数据为空!");
throw new NullPointerException("数据不能为空");
}
// 实时数据列表
List<SteelStructureCurrentData> steelStructureCurrentDataList = getBatchSaveListProcess(jsonArray);
log.info("实时数据列表内容为:{}", steelStructureCurrentDataList);
// 添加到数据库
steelStructureCurrentDataService.saveBatch(steelStructureCurrentDataList);
}
}

View File

@ -0,0 +1,122 @@
package com.zhgd.xmgl.modules.steelstructure.service.impl;
import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureEngineering;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureEngineeringToMonitorType;
import com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureEngineeringMapper;
import com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureMeasurePointMapper;
import com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureMonitorTypeMapper;
import com.zhgd.xmgl.modules.steelstructure.service.*;
import com.zhgd.xmgl.util.MessageUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Description: 钢结构自动化监测系统-工程
* @author pds
* @date 2021-10-08
* @version V1.0
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class SteelStructureEngineeringServiceImpl extends ServiceImpl<SteelStructureEngineeringMapper, SteelStructureEngineering> implements ISteelStructureEngineeringService {
@Autowired
private SteelStructureEngineeringMapper steelStructureEngineeringMapper;
@Autowired
private SteelStructureMonitorTypeMapper steelStructureMonitorTypeMapper;
@Autowired
private SteelStructureMeasurePointMapper steelStructureMeasurePointMapper;
@Autowired
private ISteelStructureMeasurePointService steelStructureMeasurePointService;
@Autowired
private SteelStructureSensorService steelStructureSensorService;
@Autowired
private ISteelStructureCurrentDataService steelStructureCurrentDataService;
@Autowired
private SteelStructureEngineeringToMonitorTypeService steelStructureEngineeringToMonitorTypeService;
@Override
public void saveSteelStructureEngineering(SteelStructureEngineering steelStructureEngineering) {
checkParams(steelStructureEngineering);
setStatus(steelStructureEngineering);
steelStructureEngineering.setId(null);
steelStructureEngineeringMapper.insert(steelStructureEngineering);
if (StringUtils.isNotEmpty(steelStructureEngineering.getSteelStructureMonitorTypeIds())) {
List<SteelStructureEngineeringToMonitorType> relaList = Arrays.stream(steelStructureEngineering.getSteelStructureMonitorTypeIds().split(","))
.map(item -> new SteelStructureEngineeringToMonitorType(null, steelStructureEngineering.getId(), Long.valueOf(item), null, null, steelStructureEngineering.getProjectSn())).collect(Collectors.toList());
steelStructureEngineeringToMonitorTypeService.saveBatch(relaList);
}
}
@Override
public void deleteSteelStructureEngineering(Long id) {
steelStructureEngineeringToMonitorTypeService.deleteByExcavationId(id);
steelStructureEngineeringMapper.deleteById(id);
}
@Override
public IPage<SteelStructureEngineering> selectSteelStructureEngineeringPage(Map<String, Object> map) {
int pageNo = Integer.parseInt(map.getOrDefault("pageNo", 1).toString());
int pageSize = Integer.parseInt(map.getOrDefault("pageSize", 10).toString());
Page<SteelStructureEngineering> page = new Page<>(pageNo, pageSize);
List<SteelStructureEngineering> list = steelStructureEngineeringMapper.selectSteelStructureEngineeringPage(page, map);
return page.setRecords(list);
}
@Override
public List<SteelStructureEngineering> selectSteelStructureList(Map<String, Object> map) {
return steelStructureEngineeringMapper.selectSteelStructureList(map);
}
@Override
public SteelStructureEngineering edit(SteelStructureEngineering steelStructureEngineering) {
SteelStructureEngineering steelStructureEngineeringEntity = getById(steelStructureEngineering.getId());
if (steelStructureEngineeringEntity == null) {
throw new OpenAlertException(MessageUtil.get("notFindErr"));
}
checkParams(steelStructureEngineering);
setStatus(steelStructureEngineering);
updateById(steelStructureEngineering);
return steelStructureEngineering;
}
private void checkParams(SteelStructureEngineering steelStructureEngineering) {
if (steelStructureEngineering.getStartDate().compareTo(steelStructureEngineering.getEndDate()) > 0) {
throw new OpenAlertException("开工时间不能大于完工时间");
}
}
private void setStatus(SteelStructureEngineering steelStructureEngineering) {
Date start = steelStructureEngineering.getStartDate();
Date end = steelStructureEngineering.getEndDate();
DateTime now = DateTime.now();
if (now.compareTo(start) < 0) {
steelStructureEngineering.setStatus(0);
} else if (now.compareTo(start) >= 0 && now.compareTo(end) < 0) {
steelStructureEngineering.setStatus(1);
} else {
steelStructureEngineering.setStatus(2);
}
}
}

View File

@ -0,0 +1,37 @@
package com.zhgd.xmgl.modules.steelstructure.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureEngineeringToMonitorType;
import com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureEngineeringToMonitorTypeMapper;
import com.zhgd.xmgl.modules.steelstructure.service.SteelStructureEngineeringToMonitorTypeService;
import com.zhgd.xmgl.modules.steelstructure.service.ISteelStructureMeasurePointService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.stream.Collectors;
@Service
@Transactional(rollbackFor = Exception.class)
public class SteelStructureEngineeringToEngineeringToMonitorTypeServiceImpl extends ServiceImpl<SteelStructureEngineeringToMonitorTypeMapper, SteelStructureEngineeringToMonitorType> implements SteelStructureEngineeringToMonitorTypeService {
@Autowired
SteelStructureEngineeringToMonitorTypeMapper steelStructureEngineeringToMonitorTypeMapper;
@Autowired
ISteelStructureMeasurePointService steelStructureMeasurePointService;
@Override
public void deleteByExcavationId(Long id) {
LambdaQueryWrapper<SteelStructureEngineeringToMonitorType> queryWrapper = Wrappers.<SteelStructureEngineeringToMonitorType>lambdaQuery().eq(SteelStructureEngineeringToMonitorType::getSteelStructureEngineeringId, id);
List<Long> relaIdList = steelStructureEngineeringToMonitorTypeMapper.selectList(queryWrapper).stream().map(SteelStructureEngineeringToMonitorType::getId).collect(Collectors.toList());
if (CollUtil.isNotEmpty(relaIdList)) {
steelStructureMeasurePointService.deleteByRelaIdList(relaIdList);
}
steelStructureEngineeringToMonitorTypeMapper.delete(queryWrapper);
}
}

View File

@ -0,0 +1,240 @@
package com.zhgd.xmgl.modules.steelstructure.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.xmgl.modules.steelstructure.entity.*;
import com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureEngineeringMapper;
import com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureEngineeringToMonitorTypeMapper;
import com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureMeasurePointMapper;
import com.zhgd.xmgl.modules.steelstructure.service.SteelStructureSensorService;
import com.zhgd.xmgl.modules.steelstructure.service.ISteelStructureCurrentDataService;
import com.zhgd.xmgl.modules.steelstructure.service.ISteelStructureMeasurePointService;
import com.zhgd.xmgl.util.MessageUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @Description: 钢结构自动化监测系统-测点
* @author pds
* @date 2021-10-08
* @version V1.0
*/
@Service
@Transactional(rollbackFor = Exception.class)
@Slf4j
public class SteelStructureMeasurePointServiceImpl extends ServiceImpl<SteelStructureMeasurePointMapper, SteelStructureMeasurePoint> implements ISteelStructureMeasurePointService {
@Autowired
private SteelStructureMeasurePointMapper steelStructureMeasurePointMapper;
@Autowired
private SteelStructureEngineeringMapper steelStructureEngineeringMapper;
@Autowired
private SteelStructureEngineeringToMonitorTypeMapper steelStructureEngineeringToMonitorTypeMapper;
@Autowired
private SteelStructureSensorService steelStructureSensorService;
@Autowired
ISteelStructureCurrentDataService steelStructureCurrentDataService;
@Override
public void saveMeasurePoint(SteelStructureMeasurePoint steelStructureMeasurePoint) {
String measurePointNumber = steelStructureMeasurePoint.getMeasurePointNumber();
// 验证测点编号是否存在
QueryWrapper<SteelStructureMeasurePoint> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(SteelStructureMeasurePoint::getMeasurePointNumber, measurePointNumber);
int count = steelStructureMeasurePointMapper.selectCount(queryWrapper);
if (count > 0) {
log.warn("当前监测类型,测点编号 {} 已存在!", measurePointNumber);
throw new OpenAlertException(MessageUtil.get("pointNoExistErr"));
}
SteelStructureEngineeringToMonitorType toMonitorType = steelStructureEngineeringToMonitorTypeMapper.selectById(steelStructureMeasurePoint.getSteelStructureEngineeringToMonitorTypeId());
SteelStructureEngineering engineering = steelStructureEngineeringMapper.selectById(toMonitorType.getSteelStructureEngineeringId());
// 验证是否存在
List<SteelStructureSensor> sensorList = steelStructureMeasurePoint.getSensorList();
verifySensorData(sensorList);
steelStructureMeasurePoint.setAlarmState(1);
steelStructureMeasurePoint.setId(null);
steelStructureMeasurePoint.setProjectSn(engineering.getProjectSn());
steelStructureMeasurePointMapper.insert(steelStructureMeasurePoint);
for (SteelStructureSensor steelStructureSensor : sensorList) {
steelStructureSensor.setProjectSn(engineering.getProjectSn());
steelStructureSensor.setMeasurePointNumber(measurePointNumber);
}
steelStructureSensorService.saveBatch(sensorList);
}
/**
* 处理传感器数据
*
* @param sensorList
*/
private void verifySensorData(List<SteelStructureSensor> sensorList) {
Set<String> sensorSnSet = sensorList.stream().map(SteelStructureSensor::getSensorSn).collect(Collectors.toSet());
if (sensorList.size() != sensorSnSet.size()) {
throw new OpenAlertException(MessageUtil.get("sensorNoRepetitionErr"));
}
List<SteelStructureSensor> sensors = steelStructureSensorService.list(Wrappers.<SteelStructureSensor>lambdaQuery().in(SteelStructureSensor::getSensorSn, sensorSnSet));
if (!sensors.isEmpty()) {
StringBuilder sb = new StringBuilder();
for (SteelStructureSensor sensor : sensors) {
sb.append(sensor.getSensorSn());
sb.append(" ");
}
sb.append(MessageUtil.get("sensorNoExistErr"));
throw new OpenAlertException(sb.toString());
}
}
@Override
public void editMeasurePoint(SteelStructureMeasurePoint steelStructureMeasurePoint) {
log.info("用户调用了编辑测点接口");
int count = steelStructureMeasurePointMapper.selectCount(Wrappers.<SteelStructureMeasurePoint>lambdaQuery().eq(SteelStructureMeasurePoint::getId, steelStructureMeasurePoint.getId()));
if (count != 1) {
throw new OpenAlertException(MessageUtil.get("pointNoExistErr"));
}
steelStructureMeasurePointMapper.updateById(steelStructureMeasurePoint);
List<SteelStructureSensor> sensorList = steelStructureMeasurePoint.getSensorList();
for (SteelStructureSensor sensor : sensorList) {
sensor.setMeasurePointNumber(steelStructureMeasurePoint.getMeasurePointNumber());
}
List<SteelStructureSensor> addSensorList = sensorList.stream().filter(sensor -> sensor.getId() == null).collect(Collectors.toList());
List<SteelStructureSensor> updateSensorList = sensorList.stream().filter(sensor -> sensor.getId() != null).collect(Collectors.toList());
Set<String> sensorSnSet = updateSensorList.stream().map(SteelStructureSensor::getSensorSn).collect(Collectors.toSet());
sensorSnSet.addAll(addSensorList.stream().map(SteelStructureSensor::getSensorSn).collect(Collectors.toSet()));
List<SteelStructureSensor> existSensorList = steelStructureSensorService.list(Wrappers.lambdaQuery(SteelStructureSensor.class).eq(SteelStructureSensor::getSensorSn, sensorSnSet));
if (CollUtil.isNotEmpty(existSensorList)) {
Set<String> existSensorSnList = existSensorList.stream().map(SteelStructureSensor::getSensorSn).collect(Collectors.toSet());
String joinStr = CollUtil.join(existSensorSnList, ",");
log.warn("传感器编号{}已存在!", joinStr);
throw new RuntimeException("测点中编号" + joinStr + "已存在!");
}
// 判断添加的传感器编号是否存在
if (CollUtil.isNotEmpty(addSensorList)) {
steelStructureSensorService.saveBatch(addSensorList);
}
List<SteelStructureSensor> existList = steelStructureSensorService.list(Wrappers.<SteelStructureSensor>lambdaQuery().eq(SteelStructureSensor::getMeasurePointNumber, steelStructureMeasurePoint.getMeasurePointNumber()));
List<String> removeSnList = existList.stream().filter(e -> {
for (SteelStructureSensor sensor : addSensorList) {
if (e.getId().equals(sensor.getId())) {
return false;
}
}
for (SteelStructureSensor sensor : updateSensorList) {
if (e.getId().equals(sensor.getId())) {
return false;
}
}
return true;
}).map(SteelStructureSensor::getSensorSn).collect(Collectors.toList());
if (CollUtil.isNotEmpty(updateSensorList)) {
Map<Long, SteelStructureSensor> sensorMap = existList.stream().collect(Collectors.toMap(SteelStructureSensor::getId, Function.identity()));
Map<Long, SteelStructureSensor> updateMap = updateSensorList.stream().collect(Collectors.toMap(SteelStructureSensor::getId, Function.identity()));
for (Map.Entry<Long, SteelStructureSensor> sensorEntry : sensorMap.entrySet()) {
Long id = sensorEntry.getKey();
SteelStructureSensor sensor = sensorEntry.getValue();
SteelStructureSensor updateSensor = updateMap.get(id);
if (updateSensor == null) {
continue;
}
// 修改历史数据的传感器编号
String sensorSn = sensor.getSensorSn();
String updateSensorSn = updateSensor.getSensorSn();
if (!sensorSn.equals(updateSensorSn)) {
LambdaUpdateWrapper<SteelStructureCurrentData> updateWrapper = Wrappers.<SteelStructureCurrentData>lambdaUpdate()
.eq(SteelStructureCurrentData::getSensorSn, sensorSn).set(SteelStructureCurrentData::getSensorSn, updateSensorSn);
steelStructureCurrentDataService.update(updateWrapper);
}
// 修改变化速率状态
Float rateAlarmValue = sensor.getRateAlarmValue();
Float updateRateAlarmValue = updateSensor.getRateAlarmValue();
// 修改累计值及状态
Float alarmValue = sensor.getAlarmValue();
Float updateAlarmValue = updateSensor.getAlarmValue();
// 修改基准值及状态
Float fiducialValue = sensor.getFiducialValue();
Float updateFiducialValue = updateSensor.getFiducialValue();
if (!Objects.equals(rateAlarmValue, updateRateAlarmValue) || !Objects.equals(alarmValue, updateAlarmValue) || !Objects.equals(fiducialValue, updateFiducialValue)) {
steelStructureCurrentDataService.updateDataTotalAndAlarmState(updateSensorSn, updateFiducialValue, updateAlarmValue, updateRateAlarmValue);
}
}
steelStructureSensorService.updateBatchById(updateSensorList);
}
if (CollUtil.isNotEmpty(removeSnList)) {
steelStructureSensorService.remove(Wrappers.<SteelStructureSensor>lambdaQuery().in(SteelStructureSensor::getSensorSn, removeSnList));
steelStructureCurrentDataService.remove(Wrappers.<SteelStructureCurrentData>lambdaQuery().in(SteelStructureCurrentData::getSensorSn, removeSnList));
log.info("用户删除了编号为:{}的传感器", removeSnList);
}
}
@Override
public SteelStructureMeasurePoint selectSteelStructureMeasurePointById(Map<String, Object> map) {
SteelStructureMeasurePoint measurePoint = steelStructureMeasurePointMapper.selectById(MapUtils.getString(map, "id"));
if (measurePoint != null) {
QueryWrapper<SteelStructureSensor> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(SteelStructureSensor::getMeasurePointNumber, measurePoint.getMeasurePointNumber());
List<SteelStructureSensor> list = steelStructureSensorService.list(queryWrapper);
measurePoint.setSensorList(list);
}
return measurePoint;
}
@Override
public List<SteelStructureMeasurePoint> selectSteelStructureAllMeasurePointList(Map<String, Object> map) {
return steelStructureMeasurePointMapper.selectSteelStructureAllMeasurePointList(map);
}
@Override
public SteelStructureMeasurePoint getDetailsByMeasurePointNumber(String measurePointNumber) {
return steelStructureMeasurePointMapper.getDetailsByMeasurePointNumber(measurePointNumber);
}
@Override
public void deleteByRelaIdList(List<Long> relaIdList) {
LambdaQueryWrapper<SteelStructureMeasurePoint> queryWrapper = Wrappers.<SteelStructureMeasurePoint>lambdaQuery()
.in(SteelStructureMeasurePoint::getSteelStructureEngineeringToMonitorTypeId, relaIdList);
List<String> mpNumberList = steelStructureMeasurePointMapper.selectList(queryWrapper).stream().map(SteelStructureMeasurePoint::getMeasurePointNumber).collect(Collectors.toList());
if (CollUtil.isNotEmpty(mpNumberList)) {
steelStructureSensorService.deleteByMpNumberList(mpNumberList);
}
steelStructureMeasurePointMapper.delete(queryWrapper);
}
@Override
public void deleteByMeasurePointNumber(String measurePointNumber) {
steelStructureSensorService.deleteByMpNumberList(Collections.singletonList(measurePointNumber));
steelStructureMeasurePointMapper.delete(Wrappers.<SteelStructureMeasurePoint>lambdaQuery().in(SteelStructureMeasurePoint::getMeasurePointNumber, measurePointNumber));
}
}

View File

@ -0,0 +1,82 @@
package com.zhgd.xmgl.modules.steelstructure.service.impl;
import cn.hutool.core.map.MapUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureMeasurePointToPlaneFigure;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureSensor;
import com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureCurrentDataMapper;
import com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureMeasurePointToPlaneFigureMapper;
import com.zhgd.xmgl.modules.steelstructure.service.SteelStructureSensorService;
import com.zhgd.xmgl.modules.steelstructure.service.SteelStructureMeasurePointToPlaneFigureService;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Description: 钢结构自动化监测系统-测点和平面图配置中间表
* @author pds
* @date 2021-10-09
* @version V1.0
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class SteelStructureMeasurePointToPlaneFigureServiceImpl extends ServiceImpl<SteelStructureMeasurePointToPlaneFigureMapper, SteelStructureMeasurePointToPlaneFigure> implements SteelStructureMeasurePointToPlaneFigureService {
@Autowired
private SteelStructureMeasurePointToPlaneFigureMapper steelStructureMeasurePointToPlaneFigureMapper;
@Autowired
private SteelStructureCurrentDataMapper steelStructureCurrentDataMapper;
@Autowired
private SteelStructureSensorService steelStructureSensorService;
@Override
public List<EntityMap> selectPlaneFigureCoordinateList(Map<String, Object> map) {
List<EntityMap> list = steelStructureMeasurePointToPlaneFigureMapper.selectPlaneFigureCoordinateList(MapUtil.getLong(map, "steelStructurePlaneFigureId"));
if (list.size() > 0) {
List<String> measurePointNumberList = list.stream().map(m -> m.get("measurePointNumber").toString()).collect(Collectors.toList());
List<SteelStructureSensor> sensors = steelStructureSensorService.getListByMeasurePointNumberList(measurePointNumberList);
Map<String, List<SteelStructureSensor>> sensorMap = sensors.stream().collect(Collectors.groupingBy(SteelStructureSensor::getMeasurePointNumber));
for (EntityMap data : list) {
data.put("sensorList", sensorMap.get(MapUtils.getString(data, "measurePointNumber")));
}
}
return list;
}
@Override
public void editPlaneFigureCoordinate(SteelStructureMeasurePointToPlaneFigure steelStructureMeasurePointToPlaneFigure) {
QueryWrapper<SteelStructureMeasurePointToPlaneFigure> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(SteelStructureMeasurePointToPlaneFigure::getSteelStructurePlaneFigureId, steelStructureMeasurePointToPlaneFigure.getSteelStructurePlaneFigureId())
.eq(SteelStructureMeasurePointToPlaneFigure::getSteelStructureMeasurePointId, steelStructureMeasurePointToPlaneFigure.getSteelStructureMeasurePointId());
SteelStructureMeasurePointToPlaneFigure oldPlaneFigureCoordinate = steelStructureMeasurePointToPlaneFigureMapper.selectOne(queryWrapper);
if (oldPlaneFigureCoordinate != null) {
steelStructureMeasurePointToPlaneFigure.setId(oldPlaneFigureCoordinate.getId());
steelStructureMeasurePointToPlaneFigureMapper.updateById(steelStructureMeasurePointToPlaneFigure);
} else {
steelStructureMeasurePointToPlaneFigureMapper.insert(steelStructureMeasurePointToPlaneFigure);
}
}
@Override
public void deleteSteelStructurePlaneFigureCoordinate(Map<String, Object> map) {
QueryWrapper<SteelStructureMeasurePointToPlaneFigure> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(SteelStructureMeasurePointToPlaneFigure::getSteelStructurePlaneFigureId, MapUtils.getString(map, "steelStructurePlaneFigureId"))
.eq(SteelStructureMeasurePointToPlaneFigure::getSteelStructureMeasurePointId, MapUtils.getString(map, "pointId"));
steelStructureMeasurePointToPlaneFigureMapper.delete(queryWrapper);
}
@Override
public void updateFigureCoordinate(List<SteelStructureMeasurePointToPlaneFigure> list) {
if (list != null && list.size() > 0) {
for (SteelStructureMeasurePointToPlaneFigure figureCoordinate : list) {
steelStructureMeasurePointToPlaneFigureMapper.updateById(figureCoordinate);
}
}
}
}

View File

@ -0,0 +1,72 @@
package com.zhgd.xmgl.modules.steelstructure.service.impl;
import cn.hutool.core.map.MapUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureMonitorType;
import com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureMonitorTypeMapper;
import com.zhgd.xmgl.modules.steelstructure.service.ISteelStructureMonitorTypeService;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description: 钢结构自动化监测系统-监测类型
* @author pds
* @date 2021-10-08
* @version V1.0
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class SteelStructureMonitorTypeServiceImpl extends ServiceImpl<SteelStructureMonitorTypeMapper, SteelStructureMonitorType> implements ISteelStructureMonitorTypeService {
@Autowired
private SteelStructureMonitorTypeMapper steelStructureMonitorTypeMapper;
@Override
public IPage<EntityMap> selectSteelStructureMonitorPage(Map<String, Object> map) {
int pageNo = Integer.parseInt(map.getOrDefault("pageNo", 1).toString());
int pageSize = Integer.parseInt(map.getOrDefault("pageSize", 10).toString());
Page<EntityMap> page = new Page<>(pageNo, pageSize);
List<EntityMap> list = steelStructureMonitorTypeMapper.selectSteelStructureMonitorPage(page, MapUtil.getLong(map, "steelStructureEngineeringId"));
return page.setRecords(list);
}
@Override
public List<EntityMap> selectSteelStructureMonitorList(Map<String, Object> map) {
return steelStructureMonitorTypeMapper.selectSteelStructureMonitorList(map);
}
@Override
public Map<String, Object> selectMonitorTypeCount(Map<String, Object> map) {
Map<String, Object> data = new HashMap<>();
List<Map<String, Object>> list = steelStructureMonitorTypeMapper.selectSteelStructureMonitorTypeCountList(map);
int totalPointNum = 0;
if (list != null && list.size() > 0) {
for (Map<String, Object> typeData : list) {
totalPointNum = totalPointNum + MapUtils.getInteger(typeData, "measurePointNum");
}
}
data.put("monitorTypeNum", list.size());
data.put("totalPointNum", totalPointNum);
data.put("list", list);
return data;
}
@Override
public List<EntityMap> selectMonitorTypeList(Map<String, Object> map) {
return steelStructureMonitorTypeMapper.selectMonitorTypeList(map);
}
@Override
public List<Map<String, Object>> selectMonitorTypeAlarmCountList(Map<String, Object> map) {
return steelStructureMonitorTypeMapper.selectMonitorTypeAlarmCountList(map);
}
}

View File

@ -0,0 +1,97 @@
package com.zhgd.xmgl.modules.steelstructure.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureMeasurePointToPlaneFigure;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructurePlaneFigure;
import com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureMeasurePointToPlaneFigureMapper;
import com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructurePlaneFigureMapper;
import com.zhgd.xmgl.modules.steelstructure.service.ISteelStructurePlaneFigureService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description: 钢结构自动化监测系统-平面图配置
* @author pds
* @date 2021-10-09
* @version V1.0
*/
@Service
public class SteelStructurePlaneFigureServiceImpl extends ServiceImpl<SteelStructurePlaneFigureMapper, SteelStructurePlaneFigure> implements ISteelStructurePlaneFigureService {
@Autowired
private SteelStructurePlaneFigureMapper steelStructurePlaneFigureMapper;
@Autowired
private SteelStructureMeasurePointToPlaneFigureMapper steelStructureMeasurePointToPlaneFigureMapper;
@Override
public void deleteSteelStructurePlaneFigure(String id) {
steelStructurePlaneFigureMapper.deleteById(id);
QueryWrapper<SteelStructureMeasurePointToPlaneFigure> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(SteelStructureMeasurePointToPlaneFigure::getSteelStructurePlaneFigureId, id);
steelStructureMeasurePointToPlaneFigureMapper.delete(queryWrapper);
}
@Override
public void savesteelStructurePlaneFigure(SteelStructurePlaneFigure steelStructurePlaneFigure) {
steelStructurePlaneFigure.setId(null);
steelStructurePlaneFigureMapper.insert(steelStructurePlaneFigure);
if (StringUtils.isNotEmpty(steelStructurePlaneFigure.getMeasurePointIds())) {
for (String pointId : steelStructurePlaneFigure.getMeasurePointIds().split(",")) {
SteelStructureMeasurePointToPlaneFigure planeFigureCoordinate = new SteelStructureMeasurePointToPlaneFigure();
planeFigureCoordinate.setSteelStructureMeasurePointId(Long.valueOf(pointId));
planeFigureCoordinate.setSteelStructurePlaneFigureId(steelStructurePlaneFigure.getId());
planeFigureCoordinate.setMapY("0");
planeFigureCoordinate.setMapX("0");
steelStructureMeasurePointToPlaneFigureMapper.insert(planeFigureCoordinate);
}
}
}
@Override
public void editsteelStructurePlaneFigure(SteelStructurePlaneFigure steelStructurePlaneFigure) {
steelStructurePlaneFigureMapper.updateById(steelStructurePlaneFigure);
if (StringUtils.isNotEmpty(steelStructurePlaneFigure.getMeasurePointIds())) {
QueryWrapper<SteelStructureMeasurePointToPlaneFigure> planeFigureCoordinateQueryWrapper = new QueryWrapper<>();
planeFigureCoordinateQueryWrapper.lambda().eq(SteelStructureMeasurePointToPlaneFigure::getSteelStructurePlaneFigureId, steelStructurePlaneFigure.getId());
List<SteelStructureMeasurePointToPlaneFigure> list = steelStructureMeasurePointToPlaneFigureMapper.selectList(planeFigureCoordinateQueryWrapper);
Map<String, Object> data = new HashMap<>();
if (CollUtil.isNotEmpty(list)) {
for (SteelStructureMeasurePointToPlaneFigure planeFigureCoordinate : list) {
data.put(planeFigureCoordinate.getSteelStructureMeasurePointId().toString(), planeFigureCoordinate.getId());
}
}
for (String pointId : steelStructurePlaneFigure.getMeasurePointIds().split(",")) {
if (data.containsKey(pointId)) {
//从历史数据去除还存在的测点找出已取消的测点
data.remove(pointId);
} else {
//保存新增的测点
SteelStructureMeasurePointToPlaneFigure planeFigureCoordinate = new SteelStructureMeasurePointToPlaneFigure();
planeFigureCoordinate.setSteelStructureMeasurePointId(Long.valueOf(pointId));
planeFigureCoordinate.setSteelStructurePlaneFigureId(steelStructurePlaneFigure.getId());
planeFigureCoordinate.setMapY("0");
planeFigureCoordinate.setMapX("0");
steelStructureMeasurePointToPlaneFigureMapper.insert(planeFigureCoordinate);
}
}
//删除已取消的测点
if (data.size() > 0) {
for (String key : data.keySet()) {
String id = String.valueOf(data.get(key));
steelStructureMeasurePointToPlaneFigureMapper.deleteById(id);
}
}
} else {
steelStructureMeasurePointToPlaneFigureMapper.delete(Wrappers.<SteelStructureMeasurePointToPlaneFigure>lambdaQuery().eq(SteelStructureMeasurePointToPlaneFigure::getSteelStructurePlaneFigureId, steelStructurePlaneFigure.getId()));
}
}
}

View File

@ -0,0 +1,129 @@
package com.zhgd.xmgl.modules.steelstructure.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureCurrentData;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureSensor;
import com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureSensorMapper;
import com.zhgd.xmgl.modules.steelstructure.service.SteelStructureSensorService;
import com.zhgd.xmgl.modules.steelstructure.service.ISteelStructureCurrentDataService;
import com.zhgd.xmgl.modules.steelstructure.service.ISteelStructureSensorTypeService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @author 邱平毅
* @ClassName SteelStructureSensorServiceImpl
* @date 2022/8/18 9:42
* @Version 1.0
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class SteelStructureSensorServiceImpl extends ServiceImpl<SteelStructureSensorMapper, SteelStructureSensor> implements SteelStructureSensorService {
@Autowired
SteelStructureSensorMapper steelStructureSensorMapper;
@Autowired
ISteelStructureCurrentDataService steelStructureCurrentDataService;
@Autowired
ISteelStructureSensorTypeService steelStructureSensorTypeService;
@Autowired
SteelStructureSensorServiceImpl steelStructureSensorService;
@Override
public void deleteByMpNumberList(List<String> mpNumberList) {
LambdaQueryWrapper<SteelStructureSensor> queryWrapper = Wrappers.<SteelStructureSensor>lambdaQuery().in(SteelStructureSensor::getMeasurePointNumber, mpNumberList);
List<SteelStructureSensor> sensors = steelStructureSensorMapper.selectList(queryWrapper);
List<String> sensorSnList = sensors.stream().map(SteelStructureSensor::getSensorSn).collect(Collectors.toList());
if (!sensorSnList.isEmpty()) {
steelStructureCurrentDataService.remove(Wrappers.<SteelStructureCurrentData>lambdaQuery().in(SteelStructureCurrentData::getSensorSn, sensorSnList));
}
steelStructureSensorMapper.delete(queryWrapper);
}
@Override
public List<SteelStructureSensor> getListBySensorAndTypeMap(Map<String, String> sensorAndTypeMap) {
// 存在的传感器
List<SteelStructureSensor> existList = steelStructureSensorMapper.getListBySensorSnSet(sensorAndTypeMap.keySet());
Set<String> existSensorSnList = existList.stream().map(SteelStructureSensor::getSensorSn).collect(Collectors.toSet());
// 是否存在不存在的传感器
//if (sensorAndTypeMap.size() != existList.size()) {
Map<String, SteelStructureSensor> sensorSnThisMap = existList.stream().collect(Collectors.toMap(SteelStructureSensor::getSensorSn, Function.identity()));
Set<String> noExistSensorSn = sensorAndTypeMap.keySet().stream().filter(sensorSn -> !existSensorSnList.contains(sensorSn)).collect(Collectors.toSet());
if (CollectionUtils.isNotEmpty(noExistSensorSn)) {
throw new OpenAlertException("传感器【" + StringUtils.join(noExistSensorSn, ",") + "】不存在");
}
for (SteelStructureSensor des : existList) {
String code = sensorAndTypeMap.get(des.getSensorSn());
if (StringUtils.isNotBlank(code) && !code.equals(des.getSensorTypeCode())) {
throw new OpenAlertException("传感器【" + des.getSensorName() + "】的类型和配置的不一致");
}
}
//// 获取对应编码的传感器类型
//LambdaQueryWrapper<SteelStructureSensorType> typeWrapper = Wrappers
// .<SteelStructureSensorType>lambdaQuery().in(SteelStructureSensorType::getSensorTypeCode, sensorAndTypeMap.values());
//// 传感器编号传感器类型
//Map<String, Long> codeIdMap = steelStructureSensorTypeService
// .list(typeWrapper).stream().collect(Collectors.toMap(SteelStructureSensorType::getSensorTypeCode, SteelStructureSensorType::getId));
//
//List<SteelStructureSensor> createSensorList = new LinkedList<>();
//for (String sensorSn : noExistSensorSn) {
// int lastIndexOf = sensorSn.lastIndexOf("(");
//
// SteelStructureSensor steelStructureSensor;
// if (lastIndexOf != -1 && existSensorSnList.contains(sensorSn.substring(0, lastIndexOf))) {
// steelStructureSensor = new SteelStructureSensor(sensorSn, codeIdMap.get(sensorAndTypeMap.get(sensorSn)), 1, sensorSnThisMap.get(sensorSn.substring(0, lastIndexOf)));
// } else {
// steelStructureSensor = new SteelStructureSensor(sensorSn, codeIdMap.get(sensorAndTypeMap.get(sensorSn)), 1);
// }
// createSensorList.add(steelStructureSensor);
//}
//steelStructureSensorService.saveBatch(createSensorList);
//existList.addAll(createSensorList);
//}
return existList;
}
@Override
public SteelStructureSensor getUnitAndAlarmValueBySnAndPointNumber(String sensorSn, String measurePointNumber) {
return steelStructureSensorMapper.getUnitAndAlarmValueBySnAndPointNumber(sensorSn, measurePointNumber);
}
@Override
public List<SteelStructureSensor> getListByMeasurePointNumberList(List<String> measurePointNumberList) {
return steelStructureSensorMapper.getListByMeasurePointNumberList(measurePointNumberList);
}
@Override
public List<SteelStructureSensor> getListBySensorSnList(List<String> sensorSnList) {
return steelStructureSensorMapper.getListBySensorSnList(sensorSnList);
}
}

View File

@ -0,0 +1,21 @@
package com.zhgd.xmgl.modules.steelstructure.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.xmgl.modules.steelstructure.entity.SteelStructureSensorType;
import com.zhgd.xmgl.modules.steelstructure.mapper.SteelStructureSensorTypeMapper;
import com.zhgd.xmgl.modules.steelstructure.service.ISteelStructureSensorTypeService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* @Description: 钢结构自动化监测系统-传感器类型
* @author pds
* @date 2021-10-08
* @version V1.0
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class SteelStructureSensorTypeServiceImpl extends ServiceImpl<SteelStructureSensorTypeMapper, SteelStructureSensorType> implements ISteelStructureSensorTypeService {
}