Lius
2024-01-15 88700e4d93e6d1e0892c488ffbf165b010d1a182
设备监控上报设备状态信息接口
已修改4个文件
35 ■■■■■ 文件已修改
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentController.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipment.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipmentMonitor.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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("反馈成功!");
            }
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;
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")
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