zhangherong
2025-05-16 420fc99fd32eb6d19ef9f83fecf06ae234f7d31f
art: 设备管理-设备处置 借用归还 删除接口
已修改2个文件
22 ■■■■ 文件已修改
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentLeanOutController.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentLeanOutServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentLeanOutController.java
@@ -1,6 +1,5 @@
package org.jeecg.modules.eam.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
@@ -8,6 +7,7 @@
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.modules.eam.constant.BusinessCodeConst;
import org.jeecg.modules.eam.constant.EquipmentLeanOutStatusEnum;
@@ -17,11 +17,10 @@
import org.jeecg.modules.system.service.ISysBusinessCodeRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
/**
 * @Description: 设备借出归还
@@ -75,6 +74,7 @@
        String codeSeq = businessCodeRuleService.generateBusinessCodeSeq(BusinessCodeConst.LEAN_OUT_CODE_RULE);
        request.setCode(codeSeq);
        request.setLeanStatus(EquipmentLeanOutStatusEnum.WAIT_SUBMIT.name());
        request.setDelFlag(CommonConstant.DEL_FLAG_0);
        boolean b = eamEquipmentLeanOutService.addLeanOut(request);
        if (!b) {
            return Result.error("添加失败!");
@@ -112,7 +112,11 @@
    @ApiOperation(value = "设备借出归还-通过id删除", notes = "设备借出归还-通过id删除")
    @DeleteMapping(value = "/delete")
    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
        eamEquipmentLeanOutService.removeById(id);
        EamEquipmentLeanOut entity = eamEquipmentLeanOutService.getById(id);
        if (entity != null) {
            entity.setDelFlag(CommonConstant.DEL_FLAG_1);
            eamEquipmentLeanOutService.updateById(entity);
        }
        return Result.OK("删除成功!");
    }
@@ -126,7 +130,14 @@
    @ApiOperation(value = "设备借出归还-批量删除", notes = "设备借出归还-批量删除")
    @DeleteMapping(value = "/deleteBatch")
    public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
        this.eamEquipmentLeanOutService.removeByIds(Arrays.asList(ids.split(",")));
        List<String> list = Arrays.asList(ids.split(","));
        list.forEach(id -> {
            EamEquipmentLeanOut entity = eamEquipmentLeanOutService.getById(id);
            if (entity != null) {
                entity.setDelFlag(CommonConstant.DEL_FLAG_1);
                eamEquipmentLeanOutService.updateById(entity);
            }
        });
        return Result.OK("批量删除成功!");
    }
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentLeanOutServiceImpl.java
@@ -47,6 +47,7 @@
    @Override
    public IPage<EamEquipmentLeanOut> queryPageList(Page<EamEquipmentLeanOut> page, EamEquipmentLeanOutQuery query) {
        QueryWrapper<EamEquipmentLeanOut> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("wmo.del_flag", CommonConstant.DEL_FLAG_0);
        //用户数据权限
        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
        if (sysUser == null) {