From ec86d09c76ec2f445628e429f198680ce3c2d5f6 Mon Sep 17 00:00:00 2001 From: guoshengxiong <1923636941@qq.com> Date: Thu, 29 May 2025 14:42:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E6=8B=9F=E6=95=B0=E6=8D=AE=E7=94=9F?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AntiPressureFoldManageServiceImpl.java | 6 - .../GantryCraneCurrentDataController.java | 251 +++++++--- ...antryCraneCurrentDataConfigController.java | 146 ++++++ .../entity/GantryCraneCurrentData.java | 67 ++- .../MockGantryCraneCurrentDataConfig.java | 462 ++++++++++++++++++ ...ockGantryCraneCurrentDataConfigMapper.java | 51 ++ .../xml/GantryCraneCurrentDataMapper.xml | 14 +- ...MockGantryCraneCurrentDataConfigMapper.xml | 18 + ...ckGantryCraneCurrentDataConfigService.java | 66 +++ ...ntryCraneCurrentDataConfigServiceImpl.java | 104 ++++ 10 files changed, 1075 insertions(+), 110 deletions(-) create mode 100644 src/main/java/com/zhgd/xmgl/modules/bigdevice/controller/MockGantryCraneCurrentDataConfigController.java create mode 100644 src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/MockGantryCraneCurrentDataConfig.java create mode 100644 src/main/java/com/zhgd/xmgl/modules/bigdevice/mapper/MockGantryCraneCurrentDataConfigMapper.java create mode 100644 src/main/java/com/zhgd/xmgl/modules/bigdevice/mapper/xml/MockGantryCraneCurrentDataConfigMapper.xml create mode 100644 src/main/java/com/zhgd/xmgl/modules/bigdevice/service/IMockGantryCraneCurrentDataConfigService.java create mode 100644 src/main/java/com/zhgd/xmgl/modules/bigdevice/service/impl/MockGantryCraneCurrentDataConfigServiceImpl.java diff --git a/src/main/java/com/zhgd/xmgl/modules/antipressurefold/service/impl/AntiPressureFoldManageServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/antipressurefold/service/impl/AntiPressureFoldManageServiceImpl.java index 0b3bfde2b..33d745af5 100644 --- a/src/main/java/com/zhgd/xmgl/modules/antipressurefold/service/impl/AntiPressureFoldManageServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/antipressurefold/service/impl/AntiPressureFoldManageServiceImpl.java @@ -21,14 +21,10 @@ import com.zhgd.xmgl.modules.antipressurefold.mapper.AntiPressureFoldManageBlock import com.zhgd.xmgl.modules.antipressurefold.mapper.AntiPressureFoldManageBlockNumberMapper; import com.zhgd.xmgl.modules.antipressurefold.mapper.AntiPressureFoldManageMapper; import com.zhgd.xmgl.modules.antipressurefold.service.IAntiPressureFoldManageService; -import com.zhgd.xmgl.modules.universaltest.entity.UniversalTestDev; -import com.zhgd.xmgl.modules.universaltest.entity.UniversalTestManageBlockData; -import com.zhgd.xmgl.modules.universaltest.entity.UniversalTestManageBlockNumber; import com.zhgd.xmgl.util.DateUtils; import com.zhgd.xmgl.util.PageUtil; import com.zhgd.xmgl.util.RefUtil; import org.apache.commons.collections.MapUtils; -import org.apache.http.impl.client.AIMDBackoffManager; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -107,9 +103,7 @@ public class AntiPressureFoldManageServiceImpl extends ServiceImpl> queryPageList(@RequestBody Map map) { - Result> result = new Result>(); - IPage pageList = gantryCraneCurrentDataService.queryGantryCraneCurrentDataPageList(map); - result.setSuccess(true); - result.setResult(pageList); - return result; - } + @ApiOperation(value = "分页列表查询龙门吊实时数据表信息", notes = "分页列表查询龙门吊实时数据表信息", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "devSn", value = "设备编号", dataType = "String", paramType = "body", required = false), + @ApiImplicitParam(name = "startTime", value = "开始时间,格式2020-08-16", dataType = "String", paramType = "body", required = false), + @ApiImplicitParam(name = "endTime", value = "结束时间,格式2020-08-16", dataType = "String", paramType = "body", required = false), + @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 = "/list") + public Result> queryPageList(@RequestBody Map map) { + Result> result = new Result>(); + IPage pageList = gantryCraneCurrentDataService.queryGantryCraneCurrentDataPageList(map); + result.setSuccess(true); + result.setResult(pageList); + return result; + } - /** - * 添加 + /** + * 添加 + * * @param gantryCraneCurrentData * @return */ @@ -69,56 +78,152 @@ public class GantryCraneCurrentDataController { return Result.ok(); } - /** - * 编辑 - * - * @param taskProgressMaterialRel - * @return - */ - @ApiOperation(value = "编辑龙门吊实时数据", notes = "编辑龙门吊实时数据", httpMethod = "POST") - @PostMapping(value = "/edit") - public Result edit(@RequestBody GantryCraneCurrentData taskProgressMaterialRel) { - gantryCraneCurrentDataService.updateById(taskProgressMaterialRel); - return Result.ok(); - } + /** + * 编辑 + * + * @param taskProgressMaterialRel + * @return + */ + @ApiOperation(value = "编辑龙门吊实时数据", notes = "编辑龙门吊实时数据", httpMethod = "POST") + @PostMapping(value = "/edit") + public Result edit(@RequestBody GantryCraneCurrentData taskProgressMaterialRel) { + gantryCraneCurrentDataService.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 delete(@ApiIgnore @RequestBody HashMap map) { - String id = MapUtils.getString(map, "id"); - Result result = new Result<>(); - GantryCraneCurrentData taskProgressMaterialRel = gantryCraneCurrentDataService.getById(id); - if (taskProgressMaterialRel == null) { - result.error500("未找到对应实体"); - } else { - boolean ok = gantryCraneCurrentDataService.removeById(id); - if (ok) { - Result.success("删除成功!"); - } - } + /** + * 通过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 delete(@ApiIgnore @RequestBody HashMap map) { + String id = MapUtils.getString(map, "id"); + Result result = new Result<>(); + GantryCraneCurrentData taskProgressMaterialRel = gantryCraneCurrentDataService.getById(id); + if (taskProgressMaterialRel == null) { + result.error500("未找到对应实体"); + } else { + boolean ok = gantryCraneCurrentDataService.removeById(id); + if (ok) { + Result.success("删除成功!"); + } + } - return result; - } + return result; + } + + @ApiOperation(value = "查询龙门吊设备最新一条实时数据", notes = "查询龙门吊设备最新一条实时数据", httpMethod = "POST") + @ApiImplicitParam(name = "devSn", value = "龙门吊设备编号", paramType = "body", required = true, dataType = "Integer") + @PostMapping(value = "/getNewestGantryCraneCurrentData") + public Result getNewestGantryCraneCurrentData(@RequestBody Map map) { + return Result.success(gantryCraneCurrentDataService.getNewestGantryCraneCurrentData(map)); + } + + @ApiOperation(value = "查询龙门吊设备当日实时数据", notes = "查询龙门吊设备当日实时数据", httpMethod = "POST") + @ApiImplicitParam(name = "devSn", value = "升降机设备编号", paramType = "body", required = true, dataType = "Integer") + @PostMapping(value = "/getTodayGantryCraneCurrentDataList") + public Result> getTodayGantryCraneCurrentDataList(@RequestBody Map map) { + return Result.success(gantryCraneCurrentDataService.getTodayGantryCraneCurrentDataList(map)); + } + + @ApiOperation(value = "生成龙门吊实时数据", notes = "生成龙门吊实时数据", httpMethod = "POST") + @PostMapping(value = "/mockData") + public Result mockData(@RequestBody MockGantryCraneCurrentDataConfig config) { + mockGantryCraneCurrentDataConfigService.saveEntity(config); + List devIdList = StrUtil.split(config.getDevSns(), ","); + ThreadLocalRandom random = ThreadLocalRandom.current(); + List datas = new ArrayList<>(); + for (String devId : devIdList) { + for (int i = 0; i < config.getDevGenerateNum(); i++) { + GantryCraneCurrentData data = new GantryCraneCurrentData(); + data.setDevSn(devId); + data.setProjectSn(config.getProjectSn()); + if (config.getReciveTimeBegin() != null && config.getReciveTimeEnd() != null) { + data.setReciveTime(new Date(random.nextLong(config.getReciveTimeBegin().getTime(), config.getReciveTimeEnd().getTime() + 1))); + } + if (config.getRunTimeBegin() != null && config.getRunTimeEnd() != null) { + data.setRunTime(DateUtil.formatDateTime(new Date(random.nextLong(DateUtil.parseDateTime(config.getRunTimeBegin()).getTime(), DateUtil.parseDateTime(config.getRunTimeEnd()).getTime() + 1)))); + } + EntityUtils.setRandomDoubleInt(config.getWindSpeedBegin(), config.getWindSpeedEnd(), data::setWindSpeed, random); + EntityUtils.setRandomDoubleInt(config.getAngleXAxisBegin(), config.getAngleXAxisEnd(), data::setAngleXAxis, random); + EntityUtils.setRandomDoubleInt(config.getAngleYAxisBegin(), config.getAngleYAxisEnd(), data::setAngleYAxis, random); + EntityUtils.setRandomDoubleInt(config.getLargeCraneRangeBegin(), config.getLargeCraneRangeEnd(), data::setLargeCraneRange, random); + EntityUtils.setRandomDoubleInt(config.getLargeCraneSpeedBegin(), config.getLargeCraneSpeedEnd(), data::setLargeCraneSpeed, random); + EntityUtils.setRandomDoubleInt(config.getSmallCraneRangeBegin(), config.getSmallCraneRangeEnd(), data::setSmallCraneRange, random); + EntityUtils.setRandomDoubleInt(config.getSmallCraneSpeedBegin(), config.getSmallCraneSpeedEnd(), data::setSmallCraneSpeed, random); + EntityUtils.setRandomDoubleInt(config.getSecondSmallCraneRangeBegin(), config.getSecondSmallCraneRangeEnd(), data::setSecondSmallCraneRange, random); + EntityUtils.setRandomDoubleInt(config.getSecondSmallCraneSpeedBegin(), config.getSecondSmallCraneSpeedEnd(), data::setSecondSmallCraneSpeed, random); + EntityUtils.setRandomDoubleInt(config.getSmallCraneMainHookLoadBegin(), config.getSmallCraneMainHookLoadEnd(), data::setSmallCraneMainHookLoad, random); + EntityUtils.setRandomDoubleInt(config.getSmallCraneAuxiliaryHookLoadBegin(), config.getSmallCraneAuxiliaryHookLoadEnd(), data::setSmallCraneAuxiliaryHookLoad, random); + EntityUtils.setRandomDoubleInt(config.getSmallCraneAuxiliaryHookHeightBegin(), config.getSmallCraneAuxiliaryHookHeightEnd(), data::setSmallCraneAuxiliaryHookHeight, random); + EntityUtils.setRandomDoubleInt(config.getSecondSmallCraneMainHookLoadBegin(), config.getSecondSmallCraneMainHookLoadEnd(), data::setSecondSmallCraneMainHookLoad, random); + EntityUtils.setRandomDoubleInt(config.getSecondSmallCraneMainHookHeightBegin(), config.getSecondSmallCraneMainHookHeightEnd(), data::setSecondSmallCraneMainHookHeight, random); + EntityUtils.setRandomDoubleInt(config.getSecondSmallCraneAuxiliaryHookLoadBegin(), config.getSecondSmallCraneAuxiliaryHookLoadEnd(), data::setSecondSmallCraneAuxiliaryHookLoad, random); + EntityUtils.setRandomDoubleInt(config.getSecondSmallCraneAuxiliaryHookHeightBegin(), config.getSecondSmallCraneAuxiliaryHookHeightEnd(), data::setSecondSmallCraneAuxiliaryHookHeight, random); + EntityUtils.setRandomDoubleInt(config.getMainHookCurrentBegin(), config.getMainHookCurrentEnd(), data::setMainHookCurrent, random); + EntityUtils.setRandomDoubleInt(config.getMainHookVoltageBegin(), config.getMainHookVoltageEnd(), data::setMainHookVoltage, random); + EntityUtils.setRandomDoubleInt(config.getSecondMainHookCurrentBegin(), config.getSecondMainHookCurrentEnd(), data::setSecondMainHookCurrent, random); + EntityUtils.setRandomDoubleInt(config.getSecondMainHookVoltageBegin(), config.getSecondMainHookVoltageEnd(), data::setSecondMainHookVoltage, random); + EntityUtils.setRandomDoubleInt(config.getSmallCraneMainHookHeightBegin(), config.getSmallCraneMainHookHeightEnd(), data::setSmallCraneMainHookHeight, random); + EntityUtils.setRandomIntByPoint(config.getWindSpeedStates(), data::setWindSpeedState, random); + EntityUtils.setRandomIntByPoint(config.getSmallCraneRangeStates(), data::setSmallCraneRangeState, random); + EntityUtils.setRandomIntByPoint(config.getSecondSmallCraneRangeStates(), data::setSecondSmallCraneRangeState, random); + EntityUtils.setRandomIntByPoint(config.getLargeCraneDistanceStates(), data::setLargeCraneDistanceState, random); + EntityUtils.setRandomIntByPoint(config.getMainHookWeightStates(), data::setMainHookWeightState, random); + EntityUtils.setRandomIntByPoint(config.getSecondMainHookWeightStates(), data::setSecondMainHookWeightState, random); + EntityUtils.setRandomIntByPoint(config.getAuxiliaryHookWeightStates(), data::setAuxiliaryHookWeightState, random); + EntityUtils.setRandomIntByPoint(config.getSecondAuxiliaryHookWeightStates(), data::setSecondAuxiliaryHookWeightState, random); + EntityUtils.setRandomIntByPoint(config.getMainHookHeightStates(), data::setMainHookHeightState, random); + EntityUtils.setRandomIntByPoint(config.getSecondMainHookHeightStates(), data::setSecondMainHookHeightState, random); + EntityUtils.setRandomIntByPoint(config.getAuxiliaryHookHeightStates(), data::setAuxiliaryHookHeightState, random); + EntityUtils.setRandomIntByPoint(config.getSecondAuxiliaryHookHeightStates(), data::setSecondAuxiliaryHookHeightState, random); + EntityUtils.setRandomIntByPoint(config.getAngleXStates(), data::setAngleXState, random); + EntityUtils.setRandomIntByPoint(config.getAngleYStates(), data::setAngleYState, random); + EntityUtils.setRandomIntByPoint(config.getGatedStates(), data::setGatedState, random); + EntityUtils.setRandomIntByPoint(config.getAntiWindAndNonslipStates(), data::setAntiWindAndNonslipState, random); + EntityUtils.setRandomIntByPoint(config.getCableReelStatuses(), data::setCableReelStatus, random); + EntityUtils.setRandomIntByPoint(config.getLargeCarSafeStatuses(), data::setLargeCarSafeStatus, random); + EntityUtils.setRandomIntByPoint(config.getLargeCarRunStatuses(), data::setLargeCarRunStatus, random); + EntityUtils.setRandomIntByPoint(config.getSmallCarRunStatuses(), data::setSmallCarRunStatus, random); + EntityUtils.setRandomIntByPoint(config.getSecondSmallCarRunStatuses(), data::setSecondSmallCarRunStatus, random); + EntityUtils.setRandomIntByPoint(config.getMasterHookRunStatuses(), data::setMasterHookRunStatus, random); + EntityUtils.setRandomIntByPoint(config.getSecondMasterHookRunStatuses(), data::setSecondMasterHookRunStatus, random); + EntityUtils.setRandomIntByPoint(config.getSubHookRunStatuses(), data::setSubHookRunStatus, random); + EntityUtils.setRandomIntByPoint(config.getSecondSubHookRunStatuses(), data::setSecondSubHookRunStatus, random); + data.setDriverName(config.getDriverName()); + data.setDriverIdCard(config.getDriverIdCard()); + data.setTotalDay(config.getTotalDay()); + data.setTotalTimes(config.getTotalTimes()); + data.setPowerOnDay(config.getPowerOnDay()); + data.setPowerOnTimes(config.getPowerOnTimes()); + EntityUtils.setRandomInt(config.getOperatingCycleNumberBegin(), config.getOperatingCycleNumberEnd(), data::setOperatingCycleNumber, random); + datas.add(data); + } + } + if (CollUtil.isNotEmpty(datas)) { + gantryCraneCurrentDataService.saveBatch(datas); + } + return Result.ok(); + } - @ApiOperation(value = "查询龙门吊设备最新一条实时数据", notes = "查询龙门吊设备最新一条实时数据", httpMethod = "POST") - @ApiImplicitParam(name = "devSn", value = "龙门吊设备编号", paramType = "body", required = true, dataType = "Integer") - @PostMapping(value = "/getNewestGantryCraneCurrentData") - public Result getNewestGantryCraneCurrentData(@RequestBody Map map) { - return Result.success(gantryCraneCurrentDataService.getNewestGantryCraneCurrentData(map)); - } + @ApiOperation(value = "批量删除龙门吊实时数据", notes = "批量删除龙门吊实时数据", httpMethod = "POST") + @ApiImplicitParam(name = "ids", value = "龙门吊实时数据ID字符串(多个以,分割)", paramType = "body", required = true, dataType = "String") + @PostMapping(value = "/deleteBatch") + public Result deleteBatch(@ApiIgnore @RequestBody HashMap paramMap) { + String ids = MapUtils.getString(paramMap, "ids"); + Result result = new Result<>(); + if (ids == null || "".equals(ids.trim())) { + result.error500("参数不识别!"); + } else { + gantryCraneCurrentDataService.removeByIds(Arrays.asList(ids.split(","))); + Result.success("删除成功!"); + } + return result; + } - @ApiOperation(value = "查询龙门吊设备当日实时数据", notes = "查询龙门吊设备当日实时数据", httpMethod = "POST") - @ApiImplicitParam(name = "devSn", value = "升降机设备编号", paramType = "body", required = true, dataType = "Integer") - @PostMapping(value = "/getTodayGantryCraneCurrentDataList") - public Result> getTodayGantryCraneCurrentDataList(@RequestBody Map map) { - return Result.success(gantryCraneCurrentDataService.getTodayGantryCraneCurrentDataList(map)); - } } diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/controller/MockGantryCraneCurrentDataConfigController.java b/src/main/java/com/zhgd/xmgl/modules/bigdevice/controller/MockGantryCraneCurrentDataConfigController.java new file mode 100644 index 000000000..a2f0d165a --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/controller/MockGantryCraneCurrentDataConfigController.java @@ -0,0 +1,146 @@ +package com.zhgd.xmgl.modules.bigdevice.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.zhgd.annotation.OperLog; +import com.zhgd.jeecg.common.api.vo.Result; +import com.zhgd.xmgl.modules.bigdevice.entity.MockGantryCraneCurrentDataConfig; +import com.zhgd.xmgl.modules.bigdevice.service.IMockGantryCraneCurrentDataConfigService; +import com.zhgd.xmgl.util.mysql.MysqlDataUtil; +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.simpleframework.xml.core.Validate; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.HashMap; +import java.util.List; + + +/** + * @Title: Controller + * @Description: 模拟龙门吊实时数据配置 + * @author: pds + * @date: 2025-05-29 + * @version: V1.0 + */ +@RestController +@RequestMapping("/xmgl/mockGantryCraneCurrentDataConfig") +@Slf4j +@Api(tags = "模拟龙门吊实时数据配置相关Api") +public class MockGantryCraneCurrentDataConfigController { + @Autowired + private IMockGantryCraneCurrentDataConfigService mockGantryCraneCurrentDataConfigService; + + /** + * 分页列表查询 + * + * @return + */ + @OperLog(operModul = "模拟龙门吊实时数据配置管理", operType = "分页查询", operDesc = "分页列表查询模拟龙门吊实时数据配置信息") + @ApiOperation(value = "分页列表查询模拟龙门吊实时数据配置信息", notes = "分页列表查询模拟龙门吊实时数据配置信息", httpMethod = "GET") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"), + @ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"), + }) + @GetMapping(value = "/page") + public Result> queryPageList(@ApiIgnore @RequestParam HashMap param) { + return Result.success(mockGantryCraneCurrentDataConfigService.queryPageList(param)); + } + + /** + * 列表查询 + * + * @return + */ + @OperLog(operModul = "模拟龙门吊实时数据配置管理", operType = "列表查询", operDesc = "列表查询模拟龙门吊实时数据配置信息") + @ApiOperation(value = "列表查询模拟龙门吊实时数据配置信息", notes = "列表查询模拟龙门吊实时数据配置信息", httpMethod = "GET") + @GetMapping(value = "/list") + public Result> queryList(@ApiIgnore @RequestParam HashMap param) { + return Result.success(mockGantryCraneCurrentDataConfigService.queryList(param)); + } + + /** + * 添加 + * + * @param mockGantryCraneCurrentDataConfig + * @return + */ + @OperLog(operModul = "模拟龙门吊实时数据配置管理", operType = "添加", operDesc = "添加模拟龙门吊实时数据配置信息") + @ApiOperation(value = "添加模拟龙门吊实时数据配置信息", notes = "添加模拟龙门吊实时数据配置信息", httpMethod = "POST") + @PostMapping(value = "/add") + public Result add(@RequestBody @Validate MockGantryCraneCurrentDataConfig mockGantryCraneCurrentDataConfig) { + mockGantryCraneCurrentDataConfigService.add(mockGantryCraneCurrentDataConfig); + return Result.ok(); + } + + /** + * 编辑 + * + * @param mockGantryCraneCurrentDataConfig + * @return + */ + @OperLog(operModul = "模拟龙门吊实时数据配置管理", operType = "编辑", operDesc = "编辑模拟龙门吊实时数据配置信息") + @ApiOperation(value = "编辑模拟龙门吊实时数据配置信息", notes = "编辑模拟龙门吊实时数据配置信息", httpMethod = "POST") + @PostMapping(value = "/edit") + public Result edit(@RequestBody MockGantryCraneCurrentDataConfig mockGantryCraneCurrentDataConfig) { + mockGantryCraneCurrentDataConfigService.edit(mockGantryCraneCurrentDataConfig); + return Result.ok(); + } + + /** + * 通过id删除 + * + * @return + */ + @OperLog(operModul = "模拟龙门吊实时数据配置管理", operType = "删除", operDesc = "删除模拟龙门吊实时数据配置信息") + @ApiOperation(value = "删除模拟龙门吊实时数据配置信息", notes = "删除模拟龙门吊实时数据配置信息", httpMethod = "POST") + @ApiImplicitParam(name = "id", value = "模拟龙门吊实时数据配置ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}") + @PostMapping(value = "/delete") + public Result delete(@ApiIgnore @RequestBody HashMap map) { + mockGantryCraneCurrentDataConfigService.delete(MapUtils.getString(map, "id")); + return Result.ok(); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @OperLog(operModul = "模拟龙门吊实时数据配置管理", operType = "通过id查询", operDesc = "通过id查询模拟龙门吊实时数据配置信息") + @ApiOperation(value = "通过id查询模拟龙门吊实时数据配置信息", notes = "通过id查询模拟龙门吊实时数据配置信息", httpMethod = "GET") + @ApiImplicitParam(name = "id", value = "模拟龙门吊实时数据配置ID", paramType = "query", required = true, dataType = "Integer") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + return Result.success(mockGantryCraneCurrentDataConfigService.queryById(id)); + } + + + @OperLog(operModul = "模拟龙门吊实时数据配置管理", operType = "保存", operDesc = "保存模拟龙门吊实时数据配置信息") + @ApiOperation(value = "保存模拟龙门吊实时数据配置信息", notes = "保存模拟龙门吊实时数据配置信息", httpMethod = "POST") + @PostMapping(value = "/save") + public Result saveEntity(@RequestBody @Validate MockGantryCraneCurrentDataConfig mockWorkerAttendanceConfig) { + mockGantryCraneCurrentDataConfigService.saveEntity(mockWorkerAttendanceConfig); + return Result.ok(); + } + + @OperLog(operModul = "模拟龙门吊实时数据配置管理", operType = "重置", operDesc = "重置模拟龙门吊实时数据配置信息") + @ApiOperation(value = "重置模拟龙门吊实时数据配置信息", notes = "重置模拟龙门吊实时数据配置信息", httpMethod = "POST") + @PostMapping(value = "/reset") + public Result reset(@RequestBody @Validate MockGantryCraneCurrentDataConfig mockWorkerAttendanceConfig) { + MockGantryCraneCurrentDataConfig one = mockGantryCraneCurrentDataConfigService.getOne(new LambdaQueryWrapper() + .eq(MockGantryCraneCurrentDataConfig::getProjectSn, mockWorkerAttendanceConfig.getProjectSn()) + ); + if (one != null) { + MysqlDataUtil.setFieldsToNull(mockGantryCraneCurrentDataConfigService, MockGantryCraneCurrentDataConfig.class, one.getId()); + } + return Result.ok(); + } + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/GantryCraneCurrentData.java b/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/GantryCraneCurrentData.java index 9ab80a704..2aee7ec0c 100644 --- a/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/GantryCraneCurrentData.java +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/GantryCraneCurrentData.java @@ -1,19 +1,17 @@ package com.zhgd.xmgl.modules.bigdevice.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.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.format.annotation.DateTimeFormat; -import org.jeecgframework.poi.excel.annotation.Excel; 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 @@ -34,29 +32,41 @@ public class GantryCraneCurrentData implements Serializable { @Excel(name = "设备编号", width = 15) @ApiModelProperty(value="设备编号") private java.lang.String devSn ; - /**项目sn*/ + /** + * 项目sn + */ @Excel(name = "项目sn", width = 15) - @ApiModelProperty(value="项目sn") - private java.lang.String projectSn ; - /**接收时间*/ + @ApiModelProperty(value = "项目sn") + private java.lang.String projectSn; + /** + * 接收时间 + */ @Excel(name = "接收时间", 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="接收时间") - private java.util.Date reciveTime ; - /**运行时间*/ - @Excel(name = "运行时间", width = 15) - @ApiModelProperty(value="运行时间") - private java.lang.String runTime ; - /**风速*/ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "接收时间") + private java.util.Date reciveTime; + /** + * 运行时间,时间格式如2021-03-08 09:23:08 + */ + @Excel(name = "运行时间,时间格式如2021-03-08 09:23:08", width = 15) + @ApiModelProperty(value = "运行时间,时间格式如2021-03-08 09:23:08") + private java.lang.String runTime; + /** + * 风速 + */ @Excel(name = "风速", width = 15) - @ApiModelProperty(value="风速") - private java.lang.String windSpeed ; - /**风速状态 0: 正常1:预警2:报警*/ + @ApiModelProperty(value = "风速") + private java.lang.String windSpeed; + /** + * 风速状态 0: 正常1:预警2:报警 + */ @Excel(name = "风速状态 0: 正常1:预警2:报警", width = 15) - @ApiModelProperty(value="风速状态 0: 正常1:预警2:报警") - private java.lang.Integer windSpeedState ; - /**倾角X轴*/ + @ApiModelProperty(value = "风速状态 0: 正常1:预警2:报警") + private java.lang.Integer windSpeedState; + /** + * 倾角X轴 + */ @Excel(name = "倾角X轴", width = 15) @ApiModelProperty(value="倾角X轴") private java.lang.String angleXAxis ; @@ -275,6 +285,11 @@ public class GantryCraneCurrentData implements Serializable { @Excel(name = "当前工作时分秒 HH:MM:SS", width = 15) @ApiModelProperty(value = "当前工作时分秒 HH:MM:SS") private java.lang.String powerOnTimes; + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "模拟生成时间") + private java.util.Date mockTime; + @TableField(exist = false) private java.lang.String fieldAcquisitionUrl; @TableField(exist = false) diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/MockGantryCraneCurrentDataConfig.java b/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/MockGantryCraneCurrentDataConfig.java new file mode 100644 index 000000000..cd4ab49a3 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/entity/MockGantryCraneCurrentDataConfig.java @@ -0,0 +1,462 @@ +package com.zhgd.xmgl.modules.bigdevice.entity; + +import java.io.Serializable; +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @Description: 模拟龙门吊实时数据配置 + * @author: pds + * @date: 2025-05-29 + * @version: V1.0 + */ +@Data +@TableName("mock_gantry_crane_current_data_config") +@ApiModel(value = "MockGantryCraneCurrentDataConfig实体类", description = "MockGantryCraneCurrentDataConfig") +public class MockGantryCraneCurrentDataConfig implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "id") + private java.lang.Long id; + /** + * 所属项目SN + */ + @ApiModelProperty(value = "所属项目SN") + private java.lang.String projectSn; + /** + * 设备sn(多个,分隔) + */ + @ApiModelProperty(value = "设备sn(多个,分隔)") + private java.lang.String devSns; + /** + * 每个设备随机生成数量 + */ + @ApiModelProperty(value = "每个设备随机生成数量") + private java.lang.Integer devGenerateNum; + /** + * 创建时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建时间") + private java.util.Date createDate; + /** + * 更新时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新时间") + private java.util.Date updateDate; + /** + * 接收时间开始 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "接收时间开始") + private java.util.Date reciveTimeBegin; + /** + * 接收时间结束 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "接收时间结束") + private java.util.Date reciveTimeEnd; + /** + * 运行时间开始 + */ + @ApiModelProperty(value = "运行时间开始") + private java.lang.String runTimeBegin; + /** + * 运行时间结束 + */ + @ApiModelProperty(value = "运行时间结束") + private java.lang.String runTimeEnd; + /** + * 风速开始 + */ + @ApiModelProperty(value = "风速开始") + private java.lang.String windSpeedBegin; + /** + * 风速结束 + */ + @ApiModelProperty(value = "风速结束") + private java.lang.String windSpeedEnd; + /** + * 倾角X轴开始 + */ + @ApiModelProperty(value = "倾角X轴开始") + private java.lang.String angleXAxisBegin; + /** + * 倾角X轴结束 + */ + @ApiModelProperty(value = "倾角X轴结束") + private java.lang.String angleXAxisEnd; + /** + * 倾角Y轴开始 + */ + @ApiModelProperty(value = "倾角Y轴开始") + private java.lang.String angleYAxisBegin; + /** + * 倾角Y轴结束 + */ + @ApiModelProperty(value = "倾角Y轴结束") + private java.lang.String angleYAxisEnd; + /** + * 大车行程(m)开始 + */ + @ApiModelProperty(value = "大车行程(m)开始") + private java.lang.String largeCraneRangeBegin; + /** + * 大车行程(m)结束 + */ + @ApiModelProperty(value = "大车行程(m)结束") + private java.lang.String largeCraneRangeEnd; + /** + * 大车速度(m/s)开始 + */ + @ApiModelProperty(value = "大车速度(m/s)开始") + private java.lang.String largeCraneSpeedBegin; + /** + * 大车速度(m/s)结束 + */ + @ApiModelProperty(value = "大车速度(m/s)结束") + private java.lang.String largeCraneSpeedEnd; + /** + * 小车1行程(m)开始 + */ + @ApiModelProperty(value = "小车1行程(m)开始") + private java.lang.String smallCraneRangeBegin; + /** + * 小车1行程(m)结束 + */ + @ApiModelProperty(value = "小车1行程(m)结束") + private java.lang.String smallCraneRangeEnd; + /** + * 小车1速度(m/s)开始 + */ + @ApiModelProperty(value = "小车1速度(m/s)开始") + private java.lang.String smallCraneSpeedBegin; + /** + * 小车1速度(m/s)结束 + */ + @ApiModelProperty(value = "小车1速度(m/s)结束") + private java.lang.String smallCraneSpeedEnd; + /** + * 小车2行程(m)开始 + */ + @ApiModelProperty(value = "小车2行程(m)开始") + private java.lang.String secondSmallCraneRangeBegin; + /** + * 小车2行程(m)结束 + */ + @ApiModelProperty(value = "小车2行程(m)结束") + private java.lang.String secondSmallCraneRangeEnd; + /** + * 小车2速度(m/s)开始 + */ + @ApiModelProperty(value = "小车2速度(m/s)开始") + private java.lang.String secondSmallCraneSpeedBegin; + /** + * 小车2速度(m/s)结束 + */ + @ApiModelProperty(value = "小车2速度(m/s)结束") + private java.lang.String secondSmallCraneSpeedEnd; + /** + * 小车1主钩吊重(t)开始 + */ + @ApiModelProperty(value = "小车1主钩吊重(t)开始") + private java.lang.String smallCraneMainHookLoadBegin; + /** + * 小车1主钩吊重(t)结束 + */ + @ApiModelProperty(value = "小车1主钩吊重(t)结束") + private java.lang.String smallCraneMainHookLoadEnd; + /** + * 小车1主钩高度(m)开始 + */ + @ApiModelProperty(value = "小车1主钩高度(m)开始") + private java.lang.Double smallCraneMainHookHeightBegin; + /** + * 小车1主钩高度(m)结束 + */ + @ApiModelProperty(value = "小车1主钩高度(m)结束") + private java.lang.Double smallCraneMainHookHeightEnd; + /** + * 小车1副钩吊重(t)开始 + */ + @ApiModelProperty(value = "小车1副钩吊重(t)开始") + private java.lang.String smallCraneAuxiliaryHookLoadBegin; + /** + * 小车1副钩吊重(t)结束 + */ + @ApiModelProperty(value = "小车1副钩吊重(t)结束") + private java.lang.String smallCraneAuxiliaryHookLoadEnd; + /** + * 小车1副钩高度(m)开始 + */ + @ApiModelProperty(value = "小车1副钩高度(m)开始") + private java.lang.String smallCraneAuxiliaryHookHeightBegin; + /** + * 小车1副钩高度(m)结束 + */ + @ApiModelProperty(value = "小车1副钩高度(m)结束") + private java.lang.String smallCraneAuxiliaryHookHeightEnd; + /** + * 小车2主钩吊重(t)开始 + */ + @ApiModelProperty(value = "小车2主钩吊重(t)开始") + private java.lang.String secondSmallCraneMainHookLoadBegin; + /** + * 小车2主钩吊重(t)结束 + */ + @ApiModelProperty(value = "小车2主钩吊重(t)结束") + private java.lang.String secondSmallCraneMainHookLoadEnd; + /** + * 小车2主钩高度(m)开始 + */ + @ApiModelProperty(value = "小车2主钩高度(m)开始") + private java.lang.String secondSmallCraneMainHookHeightBegin; + /** + * 小车2主钩高度(m)结束 + */ + @ApiModelProperty(value = "小车2主钩高度(m)结束") + private java.lang.String secondSmallCraneMainHookHeightEnd; + /** + * 小车2副钩吊重(t)开始 + */ + @ApiModelProperty(value = "小车2副钩吊重(t)开始") + private java.lang.String secondSmallCraneAuxiliaryHookLoadBegin; + /** + * 小车2副钩吊重(t)结束 + */ + @ApiModelProperty(value = "小车2副钩吊重(t)结束") + private java.lang.String secondSmallCraneAuxiliaryHookLoadEnd; + /** + * 小车2副钩高度(m)开始 + */ + @ApiModelProperty(value = "小车2副钩高度(m)开始") + private java.lang.String secondSmallCraneAuxiliaryHookHeightBegin; + /** + * 小车2副钩高度(m)结束 + */ + @ApiModelProperty(value = "小车2副钩高度(m)结束") + private java.lang.String secondSmallCraneAuxiliaryHookHeightEnd; + /** + * 小车1主钩电流开始 + */ + @ApiModelProperty(value = "小车1主钩电流开始") + private java.lang.String mainHookCurrentBegin; + /** + * 小车1主钩电流结束 + */ + @ApiModelProperty(value = "小车1主钩电流结束") + private java.lang.String mainHookCurrentEnd; + /** + * 小车1主钩电压开始 + */ + @ApiModelProperty(value = "小车1主钩电压开始") + private java.lang.String mainHookVoltageBegin; + /** + * 小车1主钩电压结束 + */ + @ApiModelProperty(value = "小车1主钩电压结束") + private java.lang.String mainHookVoltageEnd; + /** + * 小车2主钩电流开始 + */ + @ApiModelProperty(value = "小车2主钩电流开始") + private java.lang.String secondMainHookCurrentBegin; + /** + * 小车2主钩电流结束 + */ + @ApiModelProperty(value = "小车2主钩电流结束") + private java.lang.String secondMainHookCurrentEnd; + /** + * 小车2主钩电压开始 + */ + @ApiModelProperty(value = "小车2主钩电压开始") + private java.lang.String secondMainHookVoltageBegin; + /** + * 小车2主钩电压结束 + */ + @ApiModelProperty(value = "小车2主钩电压结束") + private java.lang.String secondMainHookVoltageEnd; + /** + * 工作循环次数开始 + */ + @ApiModelProperty(value = "工作循环次数开始") + private java.lang.Integer operatingCycleNumberBegin; + /** + * 工作循环次数结束 + */ + @ApiModelProperty(value = "工作循环次数结束") + private java.lang.Integer operatingCycleNumberEnd; + /** + * 风速状态 0: 正常1:预警2:报警(多个数字,分割) + */ + @ApiModelProperty(value = "风速状态 0: 正常1:预警2:报警(多个数字,分割)") + private java.lang.String windSpeedStates; + /** + * 小车1幅度状态 0: 正常,1: 左限位,2: 右限位(多个数字,分割) + */ + @ApiModelProperty(value = "小车1幅度状态 0: 正常,1: 左限位,2: 右限位(多个数字,分割)") + private java.lang.String smallCraneRangeStates; + /** + * 小车2幅度状态 0: 正常,1: 左限位,2: 右限位(多个数字,分割) + */ + @ApiModelProperty(value = "小车2幅度状态 0: 正常,1: 左限位,2: 右限位(多个数字,分割)") + private java.lang.String secondSmallCraneRangeStates; + /** + * 大车行程状态 0: 正常1: 左限预警2: 右限预警3: 左限控制4: 右限控制(多个数字,分割) + */ + @ApiModelProperty(value = "大车行程状态 0: 正常1: 左限预警2: 右限预警3: 左限控制4: 右限控制(多个数字,分割)") + private java.lang.String largeCraneDistanceStates; + /** + * 小车1主钩载重状态 0: 正常,1: 空载,2: 轻载,3: 重载,4: 满载,5: 超载,6: 控制(多个数字,分割) + */ + @ApiModelProperty(value = "小车1主钩载重状态 0: 正常,1: 空载,2: 轻载,3: 重载,4: 满载,5: 超载,6: 控制(多个数字,分割)") + private java.lang.String mainHookWeightStates; + /** + * 小车2主钩载重状态 0: 正常,1: 空载,2: 轻载,3: 重载,4: 满载,5: 超载,6: 控制(多个数字,分割) + */ + @ApiModelProperty(value = "小车2主钩载重状态 0: 正常,1: 空载,2: 轻载,3: 重载,4: 满载,5: 超载,6: 控制(多个数字,分割)") + private java.lang.String secondMainHookWeightStates; + /** + * 小车1副钩载重状态 0: 正常,1: 空载,2: 轻载,3: 重载,4: 满载,5: 超载,6: 控制(多个数字,分割) + */ + @ApiModelProperty(value = "小车1副钩载重状态 0: 正常,1: 空载,2: 轻载,3: 重载,4: 满载,5: 超载,6: 控制(多个数字,分割)") + private java.lang.String auxiliaryHookWeightStates; + /** + * 小车2副钩载重状态 0: 正常,1: 空载,2: 轻载,3: 重载,4: 满载,5: 超载,6: 控制(多个数字,分割) + */ + @ApiModelProperty(value = "小车2副钩载重状态 0: 正常,1: 空载,2: 轻载,3: 重载,4: 满载,5: 超载,6: 控制(多个数字,分割)") + private java.lang.String secondAuxiliaryHookWeightStates; + /** + * 小车1主钩高度状态 0: 正常,1: 上限位(多个数字,分割) + */ + @ApiModelProperty(value = "小车1主钩高度状态 0: 正常,1: 上限位(多个数字,分割)") + private java.lang.String mainHookHeightStates; + /** + * 小车2主钩高度状态 0: 正常,1: 上限位(多个数字,分割) + */ + @ApiModelProperty(value = "小车2主钩高度状态 0: 正常,1: 上限位(多个数字,分割)") + private java.lang.String secondMainHookHeightStates; + /** + * 小车1副钩高度状态 0: 正常,1: 上限位(多个数字,分割) + */ + @ApiModelProperty(value = "小车1副钩高度状态 0: 正常,1: 上限位(多个数字,分割)") + private java.lang.String auxiliaryHookHeightStates; + /** + * 小车2副钩高度状态 0: 正常,1: 上限位(多个数字,分割) + */ + @ApiModelProperty(value = "小车2副钩高度状态 0: 正常,1: 上限位(多个数字,分割)") + private java.lang.String secondAuxiliaryHookHeightStates; + /** + * X轴倾斜状态 0: 正常1:预警2:报警(多个数字,分割) + */ + @ApiModelProperty(value = "X轴倾斜状态 0: 正常1:预警2:报警(多个数字,分割)") + private java.lang.String angleXStates; + /** + * Y轴倾斜状态 0: 正常1:预警2:报警(多个数字,分割) + */ + @ApiModelProperty(value = "Y轴倾斜状态 0: 正常1:预警2:报警(多个数字,分割)") + private java.lang.String angleYStates; + /** + * 门控状态 0:关闭 1:打开(多个数字,分割) + */ + @ApiModelProperty(value = "门控状态 0:关闭 1:打开(多个数字,分割)") + private java.lang.String gatedStates; + /** + * 抗风防滑状态 0:未锚定 1:锚定成功(多个数字,分割) + */ + @ApiModelProperty(value = "抗风防滑状态 0:未锚定 1:锚定成功(多个数字,分割)") + private java.lang.String antiWindAndNonslipStates; + /** + * 电缆卷筒状态 0:正常 1:报警(多个数字,分割) + */ + @ApiModelProperty(value = "电缆卷筒状态 0:正常 1:报警(多个数字,分割)") + private java.lang.String cableReelStatuses; + /** + * 大车防碰撞状态 0:正常 1:左侧防撞报警 2:右侧防撞报警(多个数字,分割) + */ + @ApiModelProperty(value = "大车防碰撞状态 0:正常 1:左侧防撞报警 2:右侧防撞报警(多个数字,分割)") + private java.lang.String largeCarSafeStatuses; + /** + * 大车运行状态 0:停止 1:左移 2:右移3:故障(多个数字,分割) + */ + @ApiModelProperty(value = "大车运行状态 0:停止 1:左移 2:右移3:故障(多个数字,分割)") + private java.lang.String largeCarRunStatuses; + /** + * 小车运行状态 0:停止 1:前进 2:后退 3:故障(多个数字,分割) + */ + @ApiModelProperty(value = "小车运行状态 0:停止 1:前进 2:后退 3:故障(多个数字,分割)") + private java.lang.String smallCarRunStatuses; + /** + * 小车2运行状态 0:停止 1:前进 2:后退 3:故障(多个数字,分割) + */ + @ApiModelProperty(value = "小车2运行状态 0:停止 1:前进 2:后退 3:故障(多个数字,分割)") + private java.lang.String secondSmallCarRunStatuses; + /** + * 主钩运行状态 0:停止 1:上升 2:下降 3:故障(多个数字,分割) + */ + @ApiModelProperty(value = "主钩运行状态 0:停止 1:上升 2:下降 3:故障(多个数字,分割)") + private java.lang.String masterHookRunStatuses; + /** + * 小车2主钩运行状态 0:停止 1:上升 2:下降 3:故障(多个数字,分割) + */ + @ApiModelProperty(value = "小车2主钩运行状态 0:停止 1:上升 2:下降 3:故障(多个数字,分割)") + private java.lang.String secondMasterHookRunStatuses; + /** + * 副钩运行状态 0:停止 1:上升 2:下降 3:故障(多个数字,分割) + */ + @ApiModelProperty(value = "副钩运行状态 0:停止 1:上升 2:下降 3:故障(多个数字,分割)") + private java.lang.String subHookRunStatuses; + /** + * 小车2副钩运行状态 0:停止 1:上升 2:下降 3:故障(多个数字,分割) + */ + @ApiModelProperty(value = "小车2副钩运行状态 0:停止 1:上升 2:下降 3:故障(多个数字,分割)") + private java.lang.String secondSubHookRunStatuses; + /** + * 操作员姓名 + */ + @ApiModelProperty(value = "操作员姓名") + private java.lang.String driverName; + /** + * 操作员身份证号 + */ + @ApiModelProperty(value = "操作员身份证号") + private java.lang.String driverIdCard; + /** + * 累计工作天数 + */ + @ApiModelProperty(value = "累计工作天数") + private java.lang.String totalDay; + /** + * 累计工作时分秒 HH:MM:SS + */ + @ApiModelProperty(value = "累计工作时分秒 HH:MM:SS") + private java.lang.String totalTimes; + /** + * 当前工作天数 天 + */ + @ApiModelProperty(value = "当前工作天数 天") + private java.lang.String powerOnDay; + /** + * 当前工作时分秒 HH:MM:SS + */ + @ApiModelProperty(value = "当前工作时分秒 HH:MM:SS") + private java.lang.String powerOnTimes; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/mapper/MockGantryCraneCurrentDataConfigMapper.java b/src/main/java/com/zhgd/xmgl/modules/bigdevice/mapper/MockGantryCraneCurrentDataConfigMapper.java new file mode 100644 index 000000000..f0166fd6e --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/mapper/MockGantryCraneCurrentDataConfigMapper.java @@ -0,0 +1,51 @@ +package com.zhgd.xmgl.modules.bigdevice.mapper; + +import java.util.List; +import java.util.HashMap; + +import com.zhgd.xmgl.modules.bigdevice.entity.MockGantryCraneCurrentDataConfig; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 模拟龙门吊实时数据配置 + * @author: pds + * @date: 2025-05-29 + * @version: V1.0 + */ +@Mapper +public interface MockGantryCraneCurrentDataConfigMapper extends BaseMapper { + + /** + * 分页列表查询模拟龙门吊实时数据配置信息 + * + * @param page + * @param queryWrapper + * @param param + * @return + */ + IPage queryList(Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper, @Param("param") HashMap param); + + /** + * 列表查询模拟龙门吊实时数据配置信息 + * + * @param queryWrapper + * @param param + * @return + */ + List queryList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper, @Param("param") HashMap param); + + + /** + * 通过id查询模拟龙门吊实时数据配置信息 + * + * @param id + * @return + */ + MockGantryCraneCurrentDataConfig queryById(String id); +} diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/mapper/xml/GantryCraneCurrentDataMapper.xml b/src/main/java/com/zhgd/xmgl/modules/bigdevice/mapper/xml/GantryCraneCurrentDataMapper.xml index 6676b0eee..0aadd0721 100644 --- a/src/main/java/com/zhgd/xmgl/modules/bigdevice/mapper/xml/GantryCraneCurrentDataMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/mapper/xml/GantryCraneCurrentDataMapper.xml @@ -29,16 +29,20 @@ from gantry_crane_current_data a LEFT JOIN gantry_crane b ON a.dev_sn=b.dev_sn where a.project_sn=#{param.projectSn} - + and a.dev_sn=#{param.devSn} - + AND a.recive_time >=CONCAT(DATE_FORMAT(#{param.startTime},'%Y-%m-%d'),' 00:00:00') - + AND a.recive_time <=CONCAT(DATE_FORMAT(#{param.endTime},'%Y-%m-%d'),' 23:59:59') - order by a.recive_time desc - + + order by a.mock_time desc + + + order by a.recive_time desc + diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/mapper/xml/MockGantryCraneCurrentDataConfigMapper.xml b/src/main/java/com/zhgd/xmgl/modules/bigdevice/mapper/xml/MockGantryCraneCurrentDataConfigMapper.xml new file mode 100644 index 000000000..80e5e6aed --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/mapper/xml/MockGantryCraneCurrentDataConfigMapper.xml @@ -0,0 +1,18 @@ + + + + + + diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/IMockGantryCraneCurrentDataConfigService.java b/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/IMockGantryCraneCurrentDataConfigService.java new file mode 100644 index 000000000..b779e78cf --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/IMockGantryCraneCurrentDataConfigService.java @@ -0,0 +1,66 @@ +package com.zhgd.xmgl.modules.bigdevice.service; + +import com.zhgd.xmgl.modules.bigdevice.entity.MockGantryCraneCurrentDataConfig; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.HashMap; +import java.util.List; + +/** + * @Description: 模拟龙门吊实时数据配置 + * @author: pds + * @date: 2025-05-29 + * @version: V1.0 + */ +public interface IMockGantryCraneCurrentDataConfigService extends IService { + /** + * 分页列表查询模拟龙门吊实时数据配置信息 + * + * @param param 参数map + * @return + */ + IPage queryPageList(HashMap param); + + /** + * 列表查询模拟龙门吊实时数据配置信息 + * + * @param param 参数map + * @return + */ + List queryList(HashMap param); + + /** + * 添加模拟龙门吊实时数据配置信息 + * + * @param mockGantryCraneCurrentDataConfig 模拟龙门吊实时数据配置 + * @return + */ + void add(MockGantryCraneCurrentDataConfig mockGantryCraneCurrentDataConfig); + + /** + * 编辑模拟龙门吊实时数据配置信息 + * + * @param mockGantryCraneCurrentDataConfig 模拟龙门吊实时数据配置 + * @return + */ + void edit(MockGantryCraneCurrentDataConfig mockGantryCraneCurrentDataConfig); + + /** + * 根据id删除模拟龙门吊实时数据配置信息 + * + * @param id 模拟龙门吊实时数据配置的id + * @return + */ + void delete(String id); + + /** + * 根据id查询模拟龙门吊实时数据配置信息 + * + * @param id 模拟龙门吊实时数据配置的id + * @return + */ + MockGantryCraneCurrentDataConfig queryById(String id); + + void saveEntity(MockGantryCraneCurrentDataConfig mockWorkerAttendanceConfig); +} diff --git a/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/impl/MockGantryCraneCurrentDataConfigServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/impl/MockGantryCraneCurrentDataConfigServiceImpl.java new file mode 100644 index 000000000..f377f05db --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/bigdevice/service/impl/MockGantryCraneCurrentDataConfigServiceImpl.java @@ -0,0 +1,104 @@ +package com.zhgd.xmgl.modules.bigdevice.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +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.jeecg.common.system.query.QueryGenerator; +import com.zhgd.xmgl.modules.bigdevice.entity.MockGantryCraneCurrentDataConfig; +import com.zhgd.xmgl.modules.bigdevice.mapper.MockGantryCraneCurrentDataConfigMapper; +import com.zhgd.xmgl.modules.bigdevice.service.IMockGantryCraneCurrentDataConfigService; +import com.zhgd.xmgl.util.PageUtil; +import com.zhgd.xmgl.util.RefUtil; +import com.zhgd.xmgl.util.mysql.MysqlDataUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; + +/** + * @Description: 模拟龙门吊实时数据配置 + * @author: pds + * @date: 2025-05-29 + * @version: V1.0 + */ +@Service +public class MockGantryCraneCurrentDataConfigServiceImpl extends ServiceImpl implements IMockGantryCraneCurrentDataConfigService { + @Autowired + private MockGantryCraneCurrentDataConfigMapper mockGantryCraneCurrentDataConfigMapper; + + @Override + public IPage queryPageList(HashMap param) { + QueryWrapper queryWrapper = this.getQueryWrapper(param); + Page page = PageUtil.getPage(param); + IPage pageList = baseMapper.queryList(page, queryWrapper, param); + pageList.setRecords(this.dealList(pageList.getRecords())); + return pageList; + } + + @Override + public List queryList(HashMap param) { + QueryWrapper queryWrapper = getQueryWrapper(param); + return dealList(baseMapper.queryList(queryWrapper, param)); + } + + private QueryWrapper getQueryWrapper(HashMap param) { + QueryWrapper queryWrapper = QueryGenerator.initPageQueryWrapper(MockGantryCraneCurrentDataConfig.class, param, true); + queryWrapper.orderByDesc(RefUtil.fieldNameUlc(MockGantryCraneCurrentDataConfig::getId)); + return queryWrapper; + } + + private List dealList(List list) { + return list; + } + + @Override + public void add(MockGantryCraneCurrentDataConfig mockGantryCraneCurrentDataConfig) { + mockGantryCraneCurrentDataConfig.setId(null); + baseMapper.insert(mockGantryCraneCurrentDataConfig); + } + + @Override + public void edit(MockGantryCraneCurrentDataConfig mockGantryCraneCurrentDataConfig) { + MockGantryCraneCurrentDataConfig oldMockGantryCraneCurrentDataConfig = baseMapper.selectById(mockGantryCraneCurrentDataConfig.getId()); + if (oldMockGantryCraneCurrentDataConfig == null) { + throw new OpenAlertException("未找到对应实体"); + } + baseMapper.updateById(mockGantryCraneCurrentDataConfig); + } + + @Override + public void delete(String id) { + MockGantryCraneCurrentDataConfig mockGantryCraneCurrentDataConfig = baseMapper.selectById(id); + if (mockGantryCraneCurrentDataConfig == null) { + throw new OpenAlertException("未找到对应实体"); + } + baseMapper.deleteById(id); + } + + @Override + public MockGantryCraneCurrentDataConfig queryById(String id) { + MockGantryCraneCurrentDataConfig entity = baseMapper.queryById(id); + if (entity == null) { + throw new OpenAlertException("未找到对应实体"); + } + return entity; + } + + @Override + public void saveEntity(MockGantryCraneCurrentDataConfig config) { + MockGantryCraneCurrentDataConfig dbConfig = this.getOne(new LambdaQueryWrapper() + .eq(MockGantryCraneCurrentDataConfig::getProjectSn, config.getProjectSn())); + if (dbConfig == null) { + this.add(config); + } else { + config.setId(dbConfig.getId()); + this.edit(config); + } + MysqlDataUtil.setFieldsToNull(this, config); + } + +}