|
|
@ -9,9 +9,7 @@ import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SysDepartment;
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.*;
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SysOrganize;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SysRefUserDepartment;
|
|
|
|
|
|
|
|
import cn.estsh.impp.framework.base.controller.CrudBaseController;
|
|
|
|
import cn.estsh.impp.framework.base.controller.CrudBaseController;
|
|
|
|
import cn.estsh.impp.framework.base.service.ICrudService;
|
|
|
|
import cn.estsh.impp.framework.base.service.ICrudService;
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
@ -24,9 +22,7 @@ import io.swagger.annotations.ApiOperation;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
@ -334,4 +330,32 @@ public class SysDepartmentController extends CrudBaseController<SysDepartment> {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/cloud-query-department/{departmentCode}")
|
|
|
|
|
|
|
|
@ApiOperation(value = "微服务查询部门", notes = "等值查询部门code")
|
|
|
|
|
|
|
|
public ResultBean queryPagerByCloud(@PathVariable String departmentCode) {
|
|
|
|
|
|
|
|
SessionUser sessionUser = getSessionUser();
|
|
|
|
|
|
|
|
SysUser sysUser = personnelService.getSysUserById(sessionUser.getUserId());
|
|
|
|
|
|
|
|
Long organizeId = sysUser.getOrganizeId();
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
//根据用户组织id 和 部门代码 查询部门
|
|
|
|
|
|
|
|
SysDepartment sysDepartment = departmentService.findSysDepartmentByDepartCodeAndOrganizedId(departmentCode, organizeId);
|
|
|
|
|
|
|
|
return ResultBean.success("操作成功").setResultObject(sysDepartment).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/cloud-insert")
|
|
|
|
|
|
|
|
@ApiOperation(value = "微服务添加部门", notes = "添加部门")
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public ResultBean insertByCloud(@RequestBody SysDepartment bean) {
|
|
|
|
|
|
|
|
SessionUser sessionUser = getSessionUser();
|
|
|
|
|
|
|
|
SysUser sysUser = personnelService.getSysUserById(sessionUser.getUserId());
|
|
|
|
|
|
|
|
Long organizeId = sysUser.getOrganizeId();
|
|
|
|
|
|
|
|
bean.setOrganizeId(organizeId);
|
|
|
|
|
|
|
|
return this.insert(bean);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|