|
@@ -4,7 +4,6 @@ import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.zjugis.framework.common.enums.CommonStatusEnum;
|
|
|
import com.zjugis.framework.common.pojo.CommonResult;
|
|
|
import com.zjugis.framework.common.util.collection.CollectionUtils;
|
|
|
-import com.zjugis.module.system.api.dept.dto.DeptRespDTO;
|
|
|
import com.zjugis.module.system.controller.admin.dept.vo.dept.*;
|
|
|
import com.zjugis.module.system.convert.dept.DeptConvert;
|
|
|
import com.zjugis.module.system.dal.dataobject.dept.DeptDO;
|
|
@@ -13,9 +12,9 @@ import com.zjugis.module.system.dal.dataobject.user.AdminUserDO;
|
|
|
import com.zjugis.module.system.service.dept.DeptLeaderService;
|
|
|
import com.zjugis.module.system.service.dept.DeptService;
|
|
|
import com.zjugis.module.system.service.user.AdminUserService;
|
|
|
-import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
-import io.swagger.v3.oas.annotations.Parameter;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.Parameter;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -79,7 +78,7 @@ public class DeptController {
|
|
|
List<DeptRespVO> result = DeptConvert.INSTANCE.convertList(list);
|
|
|
result.forEach(deptRespVO -> {
|
|
|
DeptLeaderDO deptLeaderDO = stringDeptLeaderDOMap.get(deptRespVO.getId());
|
|
|
- if(ObjectUtil.isNotNull(deptLeaderDO)){
|
|
|
+ if (ObjectUtil.isNotNull(deptLeaderDO)) {
|
|
|
String deptLeaderUserId = deptLeaderDO.getUserId();
|
|
|
deptRespVO.setDeptLeaderUserId(deptLeaderUserId);
|
|
|
}
|
|
@@ -132,7 +131,10 @@ public class DeptController {
|
|
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
@PreAuthorize("@ss.hasPermission('system:dept:query')")
|
|
|
public CommonResult<DeptRespVO> getDept(@RequestParam("id") String id) {
|
|
|
- return success(DeptConvert.INSTANCE.convert(deptService.getDept(id)));
|
|
|
+ DeptRespVO result = DeptConvert.INSTANCE.convert(deptService.getDept(id));
|
|
|
+ DeptLeaderDO deptLeader = deptLeaderService.getDeptLeaderByDeptId(result.getId());
|
|
|
+ result.setDeptLeaderUserId(deptLeader.getUserId());
|
|
|
+ return success(result);
|
|
|
}
|
|
|
|
|
|
}
|