Commit bc905ed0 authored by 张森's avatar 张森

下拉API修改

parent 86b9ea7b
...@@ -67,6 +67,19 @@ public class PlanClassifyTreeController extends BaseController { ...@@ -67,6 +67,19 @@ public class PlanClassifyTreeController extends BaseController {
e.printStackTrace(); e.printStackTrace();
System.out.println(e.getStackTrace().toString()); System.out.println(e.getStackTrace().toString());
} }
return CommonResponseUtil2.success(list);
}
@ApiOperation(value = "查询分类树 - 新页面使用")
@RequestMapping(value = "/treeNew", method = RequestMethod.GET)
public ResponseModel getTreeNew() {
Collection<PlanClassifyTreeVo> list = null;
try {
list = planClassifyTreeService.getTree();
}catch (Exception e){
e.printStackTrace();
System.out.println(e.getStackTrace().toString());
}
//增加根节点 //增加根节点
PlanClassifyTreeVo tree = new PlanClassifyTreeVo(); PlanClassifyTreeVo tree = new PlanClassifyTreeVo();
tree.setId(0); tree.setId(0);
...@@ -77,4 +90,10 @@ public class PlanClassifyTreeController extends BaseController { ...@@ -77,4 +90,10 @@ public class PlanClassifyTreeController extends BaseController {
root.add(tree); root.add(tree);
return CommonResponseUtil2.success(root); return CommonResponseUtil2.success(root);
} }
@ApiOperation(value = "查询分类信息 - 新页面使用")
@RequestMapping(value = "/getPlanClassifyInfo", method = RequestMethod.GET)
public ResponseModel getPlanClassifyInfo() {
return CommonResponseUtil2.success(planClassifyTreeService.findAllInfo());
}
} }
...@@ -62,6 +62,7 @@ public class PlanClassifyTreeServiceImpl implements IPlanClassifyTreeService { ...@@ -62,6 +62,7 @@ public class PlanClassifyTreeServiceImpl implements IPlanClassifyTreeService {
for (PlanClassifyTree planClassifyTree : list) { for (PlanClassifyTree planClassifyTree : list) {
PlanClassifyTreeVo planClassifyTreeVo = new PlanClassifyTreeVo(); PlanClassifyTreeVo planClassifyTreeVo = new PlanClassifyTreeVo();
BeanUtils.copyProperties(planClassifyTree, planClassifyTreeVo); BeanUtils.copyProperties(planClassifyTree, planClassifyTreeVo);
planClassifyTreeVo.setParentId(0L);
voList.add(planClassifyTreeVo); voList.add(planClassifyTreeVo);
} }
Map<Object, PlanClassifyTreeVo> map = Bean.listToMap(voList, "id", PlanClassifyTree.class); Map<Object, PlanClassifyTreeVo> map = Bean.listToMap(voList, "id", PlanClassifyTree.class);
...@@ -73,6 +74,11 @@ public class PlanClassifyTreeServiceImpl implements IPlanClassifyTreeService { ...@@ -73,6 +74,11 @@ public class PlanClassifyTreeServiceImpl implements IPlanClassifyTreeService {
return TreeBuilder.buildByRecursive(completeList, ROOT); return TreeBuilder.buildByRecursive(completeList, ROOT);
} }
@Override
public List<PlanClassifyTree> findAllInfo() {
return planClassifyTreeDao.findAll();
}
private List<PlanClassifyTreeVo> buildWithParent(PlanClassifyTreeVo groupModel, Map<Object, PlanClassifyTreeVo> map) { private List<PlanClassifyTreeVo> buildWithParent(PlanClassifyTreeVo groupModel, Map<Object, PlanClassifyTreeVo> map) {
List<PlanClassifyTreeVo> completeList = new ArrayList<>(); List<PlanClassifyTreeVo> completeList = new ArrayList<>();
......
...@@ -4,6 +4,7 @@ import com.yeejoin.amos.fas.business.vo.PlanClassifyTreeVo; ...@@ -4,6 +4,7 @@ import com.yeejoin.amos.fas.business.vo.PlanClassifyTreeVo;
import com.yeejoin.amos.fas.dao.entity.PlanClassifyTree; import com.yeejoin.amos.fas.dao.entity.PlanClassifyTree;
import java.util.Collection; import java.util.Collection;
import java.util.List;
/** /**
* @author wjk * @author wjk
...@@ -30,4 +31,6 @@ public interface IPlanClassifyTreeService { ...@@ -30,4 +31,6 @@ public interface IPlanClassifyTreeService {
PlanClassifyTree update(PlanClassifyTree model); PlanClassifyTree update(PlanClassifyTree model);
PlanClassifyTree findById(Long id); PlanClassifyTree findById(Long id);
List<PlanClassifyTree> findAllInfo();
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment