| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | 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.query.QueryGenerator; |
| | | import org.jeecg.modules.eam.entity.EamEquipment; |
| | | import org.jeecg.modules.eam.request.EamEquipmentQuery; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | |
| | | @ApiOperation(value = "设备台账-通过id删除", notes = "设备台账-通过id删除") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<?> delete(@RequestParam(name = "id", required = true) String id) { |
| | | eamEquipmentService.removeById(id); |
| | | EamEquipment entity = eamEquipmentService.getById(id); |
| | | if(entity != null) { |
| | | entity.setDelFlag(CommonConstant.DEL_FLAG_1); |
| | | eamEquipmentService.updateById(entity); |
| | | } |
| | | return Result.OK("删除成功!"); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "设备台账-批量删除", notes = "设备台账-批量删除") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | this.eamEquipmentService.removeByIds(Arrays.asList(ids.split(","))); |
| | | List<String> list = Arrays.asList(ids.split(",")); |
| | | list.forEach(id -> { |
| | | EamEquipment entity = eamEquipmentService.getById(id); |
| | | if(entity != null) { |
| | | entity.setDelFlag(CommonConstant.DEL_FLAG_1); |
| | | eamEquipmentService.updateById(entity); |
| | | } |
| | | }); |
| | | return Result.OK("批量删除成功!"); |
| | | } |
| | | |