修改bug2119,2072 接口返回过慢
This commit is contained in:
@@ -11,7 +11,6 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.system.pojo.dto.AreaTreeDTO;
|
||||
import com.njcn.system.pojo.po.Area;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.user.pojo.param.DeptParam;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
@@ -20,13 +19,12 @@ import com.njcn.user.pojo.vo.DeptTreeVO;
|
||||
import com.njcn.user.pojo.vo.DeptVO;
|
||||
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||
import com.njcn.user.service.IDeptService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.List;
|
||||
@@ -74,11 +72,8 @@ public class DeptController extends BaseController {
|
||||
public HttpResult<Object> getAreaTree(@RequestParam(required = false)@ApiParam("id")String id , @RequestParam("type") Integer type) {
|
||||
String methodDescribe = getMethodDescribe("getAreaTree");
|
||||
List<AreaTreeDTO> result = deptService.getAreaTree(id,type);
|
||||
if (!result.isEmpty()) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -196,6 +196,9 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
|
||||
List<String> areaTreeVO = deptArea();
|
||||
HttpResult<List<AreaTreeDTO>> areaTreeDTOS = areaFeignClient.areaDeptTree(id, type);
|
||||
List<AreaTreeDTO> list = areaTreeDTOS.getData();
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
for (AreaTreeDTO areaTreeVOList : list) {
|
||||
if (areaTreeVO.contains(areaTreeVOList.getId())) {
|
||||
areaTreeVOList.setName(areaTreeVOList.getName() + "(已被绑定)");
|
||||
|
||||
Reference in New Issue
Block a user