| | |
| | | import org.springblade.modules.jurisdiction.service.JurisdictionService; |
| | | import org.springblade.modules.jurisdiction.vo.JurisdictionVO; |
| | | import org.springblade.modules.jurisdiction.wrapper.JurisdictionWrapper; |
| | | import org.springblade.modules.system.node.TreeNode; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "树形结构", notes = "树形结构") |
| | | public R<List<JurisdictionVO>> tree(String tenantId, BladeUser bladeUser) { |
| | | tenantId = "000000"; |
| | | List<JurisdictionVO> tree = jurisdictionService.tree(Func.toStrWithEmpty(tenantId, bladeUser.getTenantId())); |
| | | return R.data(tree); |
| | | } |
| | |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "懒加载树形结构", notes = "树形结构") |
| | | public R<List<JurisdictionVO>> lazyTree(String tenantId, Long parentId, BladeUser bladeUser) { |
| | | bladeUser.setTenantId("000000"); |
| | | List<JurisdictionVO> tree = jurisdictionService.lazyTree(Func.toStrWithEmpty(tenantId, bladeUser.getTenantId()), parentId); |
| | | return R.data(tree); |
| | | } |
| | |
| | | @ApiOperation(value = "懒加载树形结构", notes = "树形结构") |
| | | public R<List<JurisdictionVO>> lazyTrees() { |
| | | List<JurisdictionVO> tree = jurisdictionService.lazyTrees(); |
| | | return R.data(tree); |
| | | } |
| | | |
| | | /** |
| | | * 辖区树(对接大数据平台) |
| | | */ |
| | | @GetMapping("/jurisdiction_lazy-tree") |
| | | public R jurisdictionLazyTree(HttpServletRequest request) { |
| | | String fieldNames = request.getHeader("_fieldNames"); |
| | | List<String> asList = new ArrayList<>(); |
| | | if (null!= fieldNames && !fieldNames.equals("")) { |
| | | //去除头尾 |
| | | String fieldString = fieldNames.substring(1, fieldNames.length() - 1); |
| | | asList = Arrays.asList(fieldString.split(",")); |
| | | } |
| | | List<TreeNode> tree = jurisdictionService.jurisdictionLazyTree(); |
| | | return R.data(tree); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 辖区id |
| | | * @param deptname |
| | | * @return |
| | | */ |
| | | @GetMapping("/selJur") |
| | | public R selJur(String deptname) { |
| | | String s = jurisdictionService.selJur(deptname); |
| | | return R.data(s); |
| | | } |
| | | } |