// }
@RequestMapping(params = "typeGridTree")
@ResponseBody
public List<TreeGrid> typeGridTree(HttpServletRequest request, TreeGrid treegrid) {
CriteriaQuery cq;
List<TreeGrid> treeGrids = new ArrayList<TreeGrid>();
if (treegrid.getId() != null) {
cq = new CriteriaQuery(TSType.class);
cq.eq("TSTypegroup.id", treegrid.getId().substring(1));
cq.add();
List<TSType> typeList = systemService.getListByCriteriaQuery(cq, false);
for (TSType obj : typeList) {
TreeGrid treeNode = new TreeGrid();
treeNode.setId("T"+obj.getId());
treeNode.setText(obj.getTypename());
treeNode.setCode(obj.getTypecode());
treeGrids.add(treeNode);
}
} else {
cq = new CriteriaQuery(TSTypegroup.class);
List<TSTypegroup> typeGroupList = systemService.getListByCriteriaQuery(cq, false);
for (TSTypegroup obj : typeGroupList) {
TreeGrid treeNode = new TreeGrid();
treeNode.setId("G"+obj.getId());
treeNode.setText(obj.getTypegroupname());