#
luxiaotao1123
2021-04-13 d8f5476af7490d3faf40a7da332155cf06aec5e1
src/main/java/zy/cloud/wms/common/web/BaseController.java
@@ -9,6 +9,10 @@
import com.core.exception.CoolException;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import zy.cloud.wms.manager.entity.Node;
import zy.cloud.wms.manager.entity.Tag;
import zy.cloud.wms.manager.service.NodeService;
import zy.cloud.wms.manager.service.TagService;
import zy.cloud.wms.system.entity.User;
import zy.cloud.wms.system.service.UserService;
@@ -28,6 +32,10 @@
    protected HttpServletRequest request;
    @Autowired
    private UserService userService;
    @Autowired
    private TagService tagService;
    @Autowired
    private NodeService nodeService;
    protected Long getUserId(){
        return Long.parseLong(String.valueOf(request.getAttribute("userId")));
@@ -50,6 +58,22 @@
        return "";
    }
    protected Tag getOriginTag(){
        Tag tag = tagService.selectOne(new EntityWrapper<Tag>().eq("level", 1));
        if (tag == null) {
            throw new CoolException("归类数据错误");
        }
        return tag;
    }
    protected Node getOriginNode(){
        Node node = nodeService.selectOne(new EntityWrapper<Node>().eq("level", 0));
        if (node == null) {
            throw new CoolException("库区数据错误");
        }
        return node;
    }
    /**
     * 分页组装
     * @param pageNumber