| | |
| | | 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; |
| | |
| | | */ |
| | | @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("反馈成功!"); |
| | | } |