#
luxiaotao1123
2021-04-02 967bfd405284931fc69e4bf92636cd753215c982
#
1个文件已修改
20 ■■■■ 已修改文件
src/main/java/zy/cloud/wms/system/controller/ResourceController.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/zy/cloud/wms/system/controller/ResourceController.java
@@ -3,15 +3,15 @@
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import zy.cloud.wms.common.web.BaseController;
import zy.cloud.wms.system.entity.Resource;
import zy.cloud.wms.system.service.ResourceService;
import com.core.annotations.ManagerAuth;
import com.core.common.Cools;
import com.core.common.DateUtils;
import com.core.common.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import zy.cloud.wms.common.web.BaseController;
import zy.cloud.wms.system.entity.Resource;
import zy.cloud.wms.system.service.ResourceService;
import java.util.*;
@@ -41,6 +41,20 @@
        return R.ok(resourceService.selectPage(new Page<>(curr, limit), wrapper));
    }
    @RequestMapping(value = "/resource/tree/auth")
    @ManagerAuth
    public R tree(@RequestParam(defaultValue = "1")Integer curr,
                  @RequestParam(defaultValue = "10")Integer limit,
                  @RequestParam(required = false)String orderByField,
                  @RequestParam(required = false)String orderByType,
                  @RequestParam Map<String, Object> param){
        EntityWrapper<Resource> wrapper = new EntityWrapper<>();
        excludeTrash(param);
        convert(param, wrapper);
        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
        return R.parse("0-操作成功").add(resourceService.selectList(wrapper));
    }
    private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){
        for (Map.Entry<String, Object> entry : map.entrySet()){
            String val = String.valueOf(entry.getValue());