From 88700e4d93e6d1e0892c488ffbf165b010d1a182 Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期一, 15 一月 2024 11:49:40 +0800 Subject: [PATCH] 设备监控上报设备状态信息接口 --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipment.java | 7 ------- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml | 6 +----- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipmentMonitor.java | 6 ------ lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentController.java | 16 ++++++++++------ 4 files changed, 11 insertions(+), 24 deletions(-) diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentController.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentController.java index 3cdb4be..f0777d6 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentController.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentController.java @@ -10,6 +10,7 @@ import org.apache.shiro.SecurityUtils; import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.modules.mdc.dto.MdcEquipmentDto; @@ -475,18 +476,21 @@ */ @AutoLog(value = "璁惧琛�-鎵嬪姩涓婃姤璁惧寮傚父鍙婅鏄�") @ApiOperation(value = "璁惧琛�-鎵嬪姩涓婃姤璁惧寮傚父鍙婅鏄�", notes = "璁惧琛�-鎵嬪姩涓婃姤璁惧寮傚父鍙婅鏄�") - @PostMapping("/updateEquipmentStatus") - public Result<?> updateEquipmentStatus(@RequestBody MdcEquipmentMonitor mdcEquipmentMonitor) { + @GetMapping("/updateEquipmentStatus") + public Result<?> updateEquipmentStatus(@RequestParam(name = "id", required = true) String id) { Result result = new Result<>(); try { - MdcEquipment mdcEquipment1 = mdcEquipmentService.getById(mdcEquipmentMonitor.getId()); + MdcEquipment mdcEquipment1 = mdcEquipmentService.getById(id); if (mdcEquipment1 == null) { result.error500("鏈壘鍒板搴斿疄浣�"); } else { LambdaUpdateWrapper<MdcEquipment> updateWrapper = new LambdaUpdateWrapper<MdcEquipment>(); - updateWrapper.eq(MdcEquipment::getId, mdcEquipmentMonitor.getId()); - updateWrapper.set(MdcEquipment::getEquipmentStatus, mdcEquipmentMonitor.getEquipmentStatus()); - updateWrapper.set(MdcEquipment::getEquipmentStatusRemark, mdcEquipmentMonitor.getEquipmentStatusRemark()); + updateWrapper.eq(MdcEquipment::getId, id); + if (CommonConstant.STATUS_NORMAL.equals(mdcEquipment1.getEquipmentStatus())) { + updateWrapper.set(MdcEquipment::getEquipmentStatus, CommonConstant.STATUS_DISABLE); + } else { + updateWrapper.set(MdcEquipment::getEquipmentStatus, CommonConstant.STATUS_NORMAL); + } mdcEquipmentService.update(updateWrapper); result.success("鍙嶉鎴愬姛!"); } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipment.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipment.java index 6106a04..058f9bc 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipment.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipment.java @@ -129,13 +129,6 @@ @ApiModelProperty(value = "璁惧鐘舵��") private Integer equipmentStatus; - /** - * 璁惧鐘舵�佽鏄� - */ - @Excel(name = "璁惧鐘舵�佽鏄�", width = 15) - @ApiModelProperty(value = "璁惧鐘舵�佽鏄�") - private Integer equipmentStatusRemark; - /**閮ㄩ棬鍚嶇О*/ private transient String orgCodeTxt; diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipmentMonitor.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipmentMonitor.java index c63525c..be37156 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipmentMonitor.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipmentMonitor.java @@ -64,12 +64,6 @@ private Integer equipmentStatus; /** - * 璁惧鐘舵�佽鏄� - */ - @ApiModelProperty(value = "璁惧鐘舵�佽鏄�") - private Integer equipmentStatusRemark; - - /** * 閲囬泦鏃堕棿 */ @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml index 6824c8a..c682b6e 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml @@ -97,7 +97,6 @@ MAX ( l.Oporation ) Oporation, k.id, k.equipment_status, - k.equipment_status_remark, k.equipment_type equipmentType, k.equipment_type_pictures FROM @@ -108,11 +107,10 @@ MAX ( m.CollectTime ) CollectTime, id, equipment_status, - equipment_status_remark, equipment_type, equipment_type_pictures FROM - ( SELECT equipment_id EquipmentID, equipment_Name equipmentName, id, equipment_type, equipment_status, equipment_status_remark FROM mdc_equipment WHERE equipment_id IN + ( SELECT equipment_id EquipmentID, equipment_Name equipmentName, id, equipment_type, equipment_status FROM mdc_equipment WHERE equipment_id IN <foreach collection="equipmentIds" index="index" item="id" open="(" separator="," close=")"> #{id} </foreach> @@ -124,7 +122,6 @@ id, equipment_type, equipment_status, - equipment_status_remark, equipment_type_pictures ) k LEFT JOIN ( SELECT EquipmentID, CollectTime, Oporation FROM EquipmentLog WHERE Oporation <![CDATA[ <> ]]> 23 ) l ON k.CollectTime= l.CollectTime @@ -135,7 +132,6 @@ k.equipmentName, k.id, k.equipment_status, - k.equipment_status_remark, k.equipment_type, k.equipment_type_pictures ORDER BY -- Gitblit v1.9.3