| | |
| | | import com.core.common.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import zy.cloud.wms.common.utils.ListUtils; |
| | | import zy.cloud.wms.common.utils.TreeUtils; |
| | | import zy.cloud.wms.common.web.BaseController; |
| | | import zy.cloud.wms.manager.entity.Node; |
| | | import zy.cloud.wms.manager.service.NodeService; |
| | | import zy.cloud.wms.manager.utils.NodeUtils; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | |
| | | @Autowired |
| | | private NodeService nodeService; |
| | | @Autowired |
| | | private TreeUtils treeUtils; |
| | | |
| | | @RequestMapping(value = "/node/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | return R.ok().add(result); |
| | | } |
| | | |
| | | @PostMapping(value = "/node/tree/auth") |
| | | @ManagerAuth |
| | | public R tree(@RequestParam(required = false, defaultValue = "") String condition) throws IOException, ClassNotFoundException { |
| | | ArrayList<Map> tree = treeUtils.getNodeTree(String.valueOf(getOriginNode().getId())); |
| | | // 深拷贝 |
| | | List<Map> result = ListUtils.deepCopy(tree); |
| | | if (!Cools.isEmpty(condition)) { |
| | | treeUtils.remove(condition, result); |
| | | treeUtils.remove(condition, result); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | |
| | | } |