Commit 7bfcd65c by 李小龙

组织角色

parent 88b6ee64
Showing with 372 additions and 225 deletions
...@@ -53,7 +53,7 @@ public class SwaggerSaasConfig { ...@@ -53,7 +53,7 @@ public class SwaggerSaasConfig {
Docket docket = new Docket(DocumentationType.SWAGGER_2) Docket docket = new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo()) .apiInfo(apiInfo())
.groupName("03-平台端"); .groupName("03-平台端-人员管理");
ApiSelectorBuilder builder = docket.select(); ApiSelectorBuilder builder = docket.select();
//api过滤 //api过滤
builder = builder.apis( builder = builder.apis(
......
...@@ -29,7 +29,7 @@ public class PlatLoginController { ...@@ -29,7 +29,7 @@ public class PlatLoginController {
@ApiOperation("退出登录") @ApiOperation("退出登录")
@PostMapping("logout") @PostMapping("logout")
public ApiResponseEntity<?> logout() { public ApiResponseEntity<Void> logout() {
platUserService.logout(); platUserService.logout();
return ApiResponseUtils.success(); return ApiResponseUtils.success();
} }
......
package com.makeit.controller.plat;
import com.makeit.common.dto.BaseIdDTO;
import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.entity.platform.auth.PlatOrg;
import com.makeit.global.annotation.Action;
import com.makeit.service.platform.auth.PlatOrgService;
import com.makeit.service.platform.auth.PlatUserService;
import com.makeit.vo.platform.auth.PlatOrgQueryDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* <p>
* 租户端角色 前端控制器
* </p>
*
* @author eugene young
* @since 2022-05-10
*/
@Api(tags = "平台端-组织")
@RestController
@RequestMapping("/plat/org")
public class PlatOrgController {
@Autowired
private PlatOrgService platOrgService;
@Autowired
private PlatUserService platUserService;
@Action(module = "平台端-组织", name = "分页列表", code = "plat:org:page")
@ApiOperation("树形列表")
@PostMapping("page")
public ApiResponseEntity<PageVO<PlatOrg>> page(@RequestBody PageReqDTO<PlatOrgQueryDTO> pageReqDTO){
return ApiResponseUtils.success(platOrgService.page(pageReqDTO));
}
@Action(module = "平台端-组织", name = "不分页列表", code = "plat:org:list")
@ApiOperation("树形列表")
@PostMapping("list")
public ApiResponseEntity<List<PlatOrg>> list(@RequestBody PlatOrgQueryDTO platOrgQueryDTO){
return ApiResponseUtils.success(platOrgService.subOrgList(platOrgQueryDTO));
}
@Action(module = "平台端-组织", name = "树形列表", code = "plat:org:tree")
@ApiOperation("树形列表")
@PostMapping("tree")
public ApiResponseEntity<List<PlatOrg>> tree(@RequestBody PlatOrgQueryDTO tntDept){
return ApiResponseUtils.success(platOrgService.tree(tntDept));
}
@ApiOperation("树形列表(AuthIgnore)")
@PostMapping("treeAuthIgnore")
public ApiResponseEntity<List<PlatOrg>> treeAuthIgnore(@RequestBody PlatOrgQueryDTO tntDept){
return ApiResponseUtils.success(platOrgService.tree(tntDept));
}
@Action(module = "平台端-组织", name = "新增", code = "plat:org:add")
@ApiOperation("新增")
@PostMapping("add")
public ApiResponseEntity<String> add(@Validated @RequestBody PlatOrg tntDept){
return ApiResponseUtils.success(platOrgService.add(tntDept));
}
@Action(module = "平台端-组织", name = "编辑", code = "plat:org:edit")
@ApiOperation("编辑")
@PostMapping("edit")
public ApiResponseEntity<Void> edit(@Validated @RequestBody PlatOrg tntDept){
platOrgService.edit(tntDept);
return ApiResponseUtils.success();
}
@Action(module = "平台端-组织", name = "详情", code = "plat:org:view")
@ApiOperation("详情")
@PostMapping("view")
public ApiResponseEntity<PlatOrg> view(@RequestBody BaseIdDTO baseIdDTO){
return ApiResponseUtils.success(platOrgService.view(baseIdDTO.getId()));
}
@Action(module = "平台端-组织", name = "删除", code = "plat:org:del")
@ApiOperation("删除")
@PostMapping("del")
public ApiResponseEntity<PlatOrg> del(@RequestBody BaseIdDTO baseIdDTO){
platOrgService.del(baseIdDTO.getId());
return ApiResponseUtils.success();
}
@ApiOperation("左上方组织树")
@PostMapping("deptTree")
public ApiResponseEntity<List<PlatOrg>> tree(){
return ApiResponseUtils.success(platUserService.getDeptTreeList());
}
@ApiOperation("当前账号的权限级别树")
@PostMapping("belongToScopeTree")
public ApiResponseEntity<List<PlatOrg>> belongToScopeTree(@RequestBody BaseIdDTO baseIdDTO){
return ApiResponseUtils.success(platOrgService.belongToOrgTree());
}
@ApiOperation("启用|禁用")
@PostMapping("enable")
public ApiResponseEntity<Void> enable(@RequestBody PlatOrg param){
platOrgService.enable(param);
return ApiResponseUtils.success();
}
}
...@@ -11,6 +11,8 @@ import com.makeit.common.response.ApiResponseUtils; ...@@ -11,6 +11,8 @@ import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.platform.auth.PlatRoleDeptDTOVO; import com.makeit.dto.platform.auth.PlatRoleDeptDTOVO;
import com.makeit.dto.platform.auth.PlatRoleMenuDTO; import com.makeit.dto.platform.auth.PlatRoleMenuDTO;
import com.makeit.dto.platform.auth.PlatUserRoleDTO; import com.makeit.dto.platform.auth.PlatUserRoleDTO;
import com.makeit.entity.platform.auth.PlatOrg;
import com.makeit.entity.platform.auth.PlatRole;
import com.makeit.entity.platform.auth.PlatRoleMenu; import com.makeit.entity.platform.auth.PlatRoleMenu;
import com.makeit.entity.platform.auth.PlatRoleOrg; import com.makeit.entity.platform.auth.PlatRoleOrg;
import com.makeit.global.annotation.Action; import com.makeit.global.annotation.Action;
...@@ -76,15 +78,14 @@ public class PlatRoleController { ...@@ -76,15 +78,14 @@ public class PlatRoleController {
@Action(module = "平台端-角色", name = "新增", code = "tnt:role:add") @Action(module = "平台端-角色", name = "新增", code = "tnt:role:add")
@ApiOperation("新增") @ApiOperation("新增")
@PostMapping("add") @PostMapping("add")
public ApiResponseEntity<?> add(@Validated @RequestBody PlatRoleDTOVO dto) { public ApiResponseEntity<String> add(@Validated @RequestBody PlatRoleDTOVO dto) {
platRoleService.add(dto); return ApiResponseUtils.success(platRoleService.add(dto));
return ApiResponseUtils.success();
} }
@Action(module = "平台端-角色", name = "编辑", code = "tnt:role:edit") @Action(module = "平台端-角色", name = "编辑", code = "tnt:role:edit")
@ApiOperation("编辑") @ApiOperation("编辑")
@PostMapping("edit") @PostMapping("edit")
public ApiResponseEntity<?> edit(@Validated @RequestBody PlatRoleDTOVO dto) { public ApiResponseEntity<Void> edit(@Validated @RequestBody PlatRoleDTOVO dto) {
platRoleService.edit(dto); platRoleService.edit(dto);
return ApiResponseUtils.success(); return ApiResponseUtils.success();
} }
...@@ -99,7 +100,7 @@ public class PlatRoleController { ...@@ -99,7 +100,7 @@ public class PlatRoleController {
@Action(module = "平台端-角色", name = "删除", code = "tnt:role:del") @Action(module = "平台端-角色", name = "删除", code = "tnt:role:del")
@ApiOperation("删除") @ApiOperation("删除")
@PostMapping("del") @PostMapping("del")
public ApiResponseEntity<?> del(@RequestBody BaseIdDTO dto) { public ApiResponseEntity<Void> del(@RequestBody BaseIdDTO dto) {
platRoleService.del(dto.getId()); platRoleService.del(dto.getId());
return ApiResponseUtils.success(); return ApiResponseUtils.success();
} }
...@@ -107,7 +108,7 @@ public class PlatRoleController { ...@@ -107,7 +108,7 @@ public class PlatRoleController {
@Action(module = "平台端-角色", name = "改变状态", code = "tnt:role:changeStatus") @Action(module = "平台端-角色", name = "改变状态", code = "tnt:role:changeStatus")
@ApiOperation("改变状态") @ApiOperation("改变状态")
@PostMapping("changeStatus") @PostMapping("changeStatus")
public ApiResponseEntity<?> changeStatus(@RequestBody StatusDTO dto) { public ApiResponseEntity<Void> changeStatus(@RequestBody StatusDTO dto) {
platRoleService.changeStatus(dto); platRoleService.changeStatus(dto);
return ApiResponseUtils.success(); return ApiResponseUtils.success();
} }
...@@ -115,7 +116,7 @@ public class PlatRoleController { ...@@ -115,7 +116,7 @@ public class PlatRoleController {
@Action(module = "平台端-角色", name = "分配用户", code = "tnt:role:assignUserList") @Action(module = "平台端-角色", name = "分配用户", code = "tnt:role:assignUserList")
@ApiOperation("分配用户") @ApiOperation("分配用户")
@PostMapping("assignUserList") @PostMapping("assignUserList")
public ApiResponseEntity<?> assignUserList(@RequestBody List<PlatUserRoleDTO> userRoleDTOList) {//参数要不要是一个对象里 有一个数组 public ApiResponseEntity<Void> assignUserList(@RequestBody List<PlatUserRoleDTO> userRoleDTOList) {//参数要不要是一个对象里 有一个数组
platRoleService.assignUserList(userRoleDTOList); platRoleService.assignUserList(userRoleDTOList);
return ApiResponseUtils.success(); return ApiResponseUtils.success();
} }
...@@ -123,7 +124,7 @@ public class PlatRoleController { ...@@ -123,7 +124,7 @@ public class PlatRoleController {
@Action(module = "平台端-角色", name = "删除分配用户", code = "tnt:role:removeAssignUserList") @Action(module = "平台端-角色", name = "删除分配用户", code = "tnt:role:removeAssignUserList")
@ApiOperation("删除分配用户") @ApiOperation("删除分配用户")
@PostMapping("removeAssignUserList") @PostMapping("removeAssignUserList")
public ApiResponseEntity<?> removeAssignUserList(@RequestBody List<PlatUserRoleDTO> userRoleDTOList) { public ApiResponseEntity<Void> removeAssignUserList(@RequestBody List<PlatUserRoleDTO> userRoleDTOList) {
platRoleService.removeAssignUserList(userRoleDTOList); platRoleService.removeAssignUserList(userRoleDTOList);
return ApiResponseUtils.success(); return ApiResponseUtils.success();
} }
...@@ -131,7 +132,7 @@ public class PlatRoleController { ...@@ -131,7 +132,7 @@ public class PlatRoleController {
@Action(module = "平台端-角色", name = "分配菜单", code = "tnt:role:assignMenuList") @Action(module = "平台端-角色", name = "分配菜单", code = "tnt:role:assignMenuList")
@ApiOperation("分配菜单") @ApiOperation("分配菜单")
@PostMapping("assignMenuList") @PostMapping("assignMenuList")
public ApiResponseEntity<?> assignMenuList(@RequestBody PlatRoleMenuDTO roleMenuDTO) { public ApiResponseEntity<Void> assignMenuList(@RequestBody PlatRoleMenuDTO roleMenuDTO) {
platRoleService.assignMenuList(roleMenuDTO); platRoleService.assignMenuList(roleMenuDTO);
return ApiResponseUtils.success(); return ApiResponseUtils.success();
} }
...@@ -143,38 +144,22 @@ public class PlatRoleController { ...@@ -143,38 +144,22 @@ public class PlatRoleController {
return ApiResponseUtils.success(platRoleService.getAssignMenuList(baseIdDTO.getId())); return ApiResponseUtils.success(platRoleService.getAssignMenuList(baseIdDTO.getId()));
} }
// @Action(module = "平台端-角色", name = "分配微信菜单", code = "tnt:role:assignWechatMenuList")
// @ApiOperation("分配微信菜单")
// @PostMapping("assignWechatMenuList")
// public ApiResponseEntity<?> assignWechatMenuList(@RequestBody PlatRoleMenuDTO roleMenuDTO) {
// platRoleService.assignWechatMenuList(roleMenuDTO);
// return ApiResponseUtils.success();
// }
//
// @Action(module = "平台端-角色", name = "获取分配微信菜单", code = "tnt:role:getWechatMenuListByRoleId")
// @ApiOperation("获取分配微信菜单")
// @PostMapping("getWechatMenuListByRoleId")
// public ApiResponseEntity<List<PlatRoleWechatMenu>> getWechatMenuListByRoleId(@RequestBody BaseIdDTO baseIdDTO) {
// return ApiResponseUtils.success(platRoleService.getWechatMenuListByRoleId(baseIdDTO.getId()));
// }
//@Action(module = "平台端-角色", name = "管理范围可选值", code = "tnt:role:getCandidateDeptList")
@ApiOperation("管理范围可选值") @ApiOperation("管理范围可选值")
@PostMapping("getCandidateOrgList") @PostMapping("getCandidateOrgList")
public ApiResponseEntity<?> getCandidateDeptList(@RequestBody BaseOrgDTO deptDTO) { public ApiResponseEntity<List<PlatOrg>> getCandidateDeptList(@RequestBody BaseOrgDTO deptDTO) {
return ApiResponseUtils.success(platUserService.getHotelList(deptDTO.getOrgId())); return ApiResponseUtils.success(platUserService.getHotelList(deptDTO.getOrgId()));
} }
@ApiOperation("管理范围可选值2") @ApiOperation("管理范围可选值2")
@PostMapping("getCandidateDeptList2") @PostMapping("getCandidateDeptList2")
public ApiResponseEntity<?> getCandidateDeptList2(@RequestBody BaseOrgDTO deptDTO) { public ApiResponseEntity<List<PlatOrg>> getCandidateDeptList2(@RequestBody BaseOrgDTO deptDTO) {
return ApiResponseUtils.success(platUserService.getCandidateDeptList()); return ApiResponseUtils.success(platUserService.getCandidateDeptList());
} }
@Action(module = "平台端-角色", name = "分配管理权限", code = "tnt:role:assignDeptList") @Action(module = "平台端-角色", name = "分配管理权限", code = "tnt:role:assignDeptList")
@ApiOperation("分配管理权限") @ApiOperation("分配管理权限")
@PostMapping("assignDeptList") @PostMapping("assignDeptList")
public ApiResponseEntity<?> assignDeptList(@RequestBody PlatRoleDeptDTOVO roleDeptDTO) { public ApiResponseEntity<Void> assignDeptList(@RequestBody PlatRoleDeptDTOVO roleDeptDTO) {
platRoleService.assignDeptList(roleDeptDTO); platRoleService.assignDeptList(roleDeptDTO);
return ApiResponseUtils.success(); return ApiResponseUtils.success();
} }
...@@ -189,7 +174,7 @@ public class PlatRoleController { ...@@ -189,7 +174,7 @@ public class PlatRoleController {
@Action(module = "平台端-角色", name = "复制角色及关联", code = "tnt:role:copyRole") @Action(module = "平台端-角色", name = "复制角色及关联", code = "tnt:role:copyRole")
@ApiOperation("复制角色及关联") @ApiOperation("复制角色及关联")
@PostMapping("copyRole") @PostMapping("copyRole")
public ApiResponseEntity<?> copyRole(@RequestBody BaseIdDTO baseIdDTO) { public ApiResponseEntity<Void> copyRole(@RequestBody BaseIdDTO baseIdDTO) {
platRoleService.copyRole(baseIdDTO.getId()); platRoleService.copyRole(baseIdDTO.getId());
return ApiResponseUtils.success(); return ApiResponseUtils.success();
} }
...@@ -200,20 +185,12 @@ public class PlatRoleController { ...@@ -200,20 +185,12 @@ public class PlatRoleController {
return ApiResponseUtils.success(platRoleService.getList(dto)); return ApiResponseUtils.success(platRoleService.getList(dto));
} }
// @ApiOperation(value = "导出模板", notes = "") @ApiOperation("人员管理-角色")
// @PostMapping("/exportTemplate") @PostMapping("belongTo")
// public void exportTemplate(HttpServletResponse response) { public ApiResponseEntity<List<PlatRole>> belongTo(@Validated @RequestBody BaseIdDTO baseIdDTO) {
// platRoleService.exportTemplate(response); List<PlatRole> list = platRoleService.belongTo(baseIdDTO);
// } return ApiResponseUtils.success(list);
// }
// @ApiOperation(value = "人员角色关联-导入", notes = "tnt.userLabel.importExcel")
// @PostMapping("/importExcel")
// @Action(name = "人员角色关联-导入", code = "tnt:role:copyRole.userRole.importExcel")
// public ApiResponseEntity<ExcelImportVo> importExcel(@RequestParam(value = "deptId", required = true) String deptId,
// @RequestParam(value = "hotelId", required = true) String hotelId,
// @RequestParam(value = "excelFile", required = true) MultipartFile excelFile) throws Exception {
// return ApiResponseUtils.success(platRoleService.importExcel(deptId, hotelId, excelFile));
// }
} }
...@@ -10,6 +10,7 @@ import com.makeit.common.response.ApiResponseUtils; ...@@ -10,6 +10,7 @@ import com.makeit.common.response.ApiResponseUtils;
import com.makeit.global.annotation.Action; import com.makeit.global.annotation.Action;
import com.makeit.module.admin.dto.plat.PlatUserDTOVO; import com.makeit.module.admin.dto.plat.PlatUserDTOVO;
import com.makeit.module.admin.dto.plat.PlatUserQueryDTO; import com.makeit.module.admin.dto.plat.PlatUserQueryDTO;
import com.makeit.module.admin.vo.plat.PlatUserLoginVO;
import com.makeit.service.platform.auth.PlatUserService; import com.makeit.service.platform.auth.PlatUserService;
import com.makeit.vo.platform.auth.PlatPersonDTOVO; import com.makeit.vo.platform.auth.PlatPersonDTOVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -75,15 +76,14 @@ public class PlatUserController { ...@@ -75,15 +76,14 @@ public class PlatUserController {
@Action(module = "平台端-人员", name = "新增", code = "plat:user:add") @Action(module = "平台端-人员", name = "新增", code = "plat:user:add")
@ApiOperation("新增") @ApiOperation("新增")
@PostMapping("add") @PostMapping("add")
public ApiResponseEntity<?> add(@Validated @RequestBody PlatPersonDTOVO dto) { public ApiResponseEntity<String> add(@Validated @RequestBody PlatPersonDTOVO dto) {
platUserService.addPerson(dto); return ApiResponseUtils.success(platUserService.addPerson(dto));
return ApiResponseUtils.success();
} }
@Action(module = "平台端-人员", name = "编辑", code = "plat:user:edit") @Action(module = "平台端-人员", name = "编辑", code = "plat:user:edit")
@ApiOperation("编辑") @ApiOperation("编辑")
@PostMapping("edit") @PostMapping("edit")
public ApiResponseEntity<?> edit(@Validated @RequestBody PlatPersonDTOVO dto) { public ApiResponseEntity<Void> edit(@Validated @RequestBody PlatPersonDTOVO dto) {
platUserService.editPerson(dto); platUserService.editPerson(dto);
return ApiResponseUtils.success(); return ApiResponseUtils.success();
} }
...@@ -91,7 +91,7 @@ public class PlatUserController { ...@@ -91,7 +91,7 @@ public class PlatUserController {
@Action(module = "平台端-人员", name = "改变密码", code = "plat:user:changePassword") @Action(module = "平台端-人员", name = "改变密码", code = "plat:user:changePassword")
@ApiOperation("改变密码") @ApiOperation("改变密码")
@PostMapping("changePassword") @PostMapping("changePassword")
public ApiResponseEntity<?> changePassword(@RequestBody PlatUserDTOVO dto) { public ApiResponseEntity<Void> changePassword(@RequestBody PlatUserDTOVO dto) {
platUserService.changePassword(dto); platUserService.changePassword(dto);
return ApiResponseUtils.success(); return ApiResponseUtils.success();
} }
...@@ -106,7 +106,7 @@ public class PlatUserController { ...@@ -106,7 +106,7 @@ public class PlatUserController {
@Action(module = "平台端-人员", name = "删除", code = "plat:user:del") @Action(module = "平台端-人员", name = "删除", code = "plat:user:del")
@ApiOperation("删除") @ApiOperation("删除")
@PostMapping("del") @PostMapping("del")
public ApiResponseEntity<?> del(@RequestBody BaseIdDTO dto) { public ApiResponseEntity<Void> del(@RequestBody BaseIdDTO dto) {
platUserService.del(dto.getId()); platUserService.del(dto.getId());
return ApiResponseUtils.success(); return ApiResponseUtils.success();
} }
...@@ -114,41 +114,34 @@ public class PlatUserController { ...@@ -114,41 +114,34 @@ public class PlatUserController {
@Action(module = "平台端-人员", name = "改变状态", code = "plat:user:changeStatus") @Action(module = "平台端-人员", name = "改变状态", code = "plat:user:changeStatus")
@ApiOperation("改变状态") @ApiOperation("改变状态")
@PostMapping("changeStatus") @PostMapping("changeStatus")
public ApiResponseEntity<?> changeStatus(@RequestBody StatusDTO dto) { public ApiResponseEntity<Void> changeStatus(@RequestBody StatusDTO dto) {
platUserService.changeStatus(dto); platUserService.changeStatus(dto);
return ApiResponseUtils.success(); return ApiResponseUtils.success();
} }
// @ApiOperation("获取当前登录用户角色菜单") @ApiOperation("获取当前登录用户角色菜单")
// @PostMapping("getRoleMenu") @PostMapping("getRoleMenu")
// public ApiResponseEntity<PlatUserLoginVO> getRoleAndMenuList() { public ApiResponseEntity<PlatUserLoginVO> getRoleAndMenuList() {
// return ApiResponseUtils.success(platUserService.getRoleAndMenuList()); return ApiResponseUtils.success(platUserService.getRoleAndMenuList());
// } }
//
// @ApiOperation("获取当前登录用户角色菜单2") @ApiOperation("获取当前登录用户角色菜单2")
// @PostMapping("getRoleMenu2") @PostMapping("getRoleMenu2")
// public ApiResponseEntity<PlatUserLoginVO> getRoleAndMenuList2() { public ApiResponseEntity<PlatUserLoginVO> getRoleAndMenuList2() {
// return ApiResponseUtils.success(platUserService.getRoleAndMenuList2()); return ApiResponseUtils.success(platUserService.getRoleAndMenuList2());
// } }
// //@Action(module = "平台端-人员", name = "获取当前登录用户企业微信菜单", code = "tnt:user:getWechatMenuList") @ApiOperation("获取当前登录用户信息")
// @ApiOperation("获取当前登录用户企业微信菜单") @PostMapping("getUserVO")
// @PostMapping("getWechatMenuList") public ApiResponseEntity<PlatUserLoginVO> getUserInfo() {
// public ApiResponseEntity<PlatUserLoginVO> getWechatMenuList() { return ApiResponseUtils.success(platUserService.getUserVO());
// return ApiResponseUtils.success(platUserService.getWechatMenuList()); }
// }
@ApiOperation("获取当前登录用户详细信息")
// @ApiOperation("获取当前登录用户信息") @PostMapping("getUserDetail")
// @PostMapping("getUserVO") public ApiResponseEntity<PlatPersonDTOVO> getUserDetail() {
// public ApiResponseEntity<PlatUserLoginVO> getUserInfo() { return ApiResponseUtils.success(platUserService.getUserDetail());
// return ApiResponseUtils.success(platUserService.getUserVO()); }
// }
//
// @ApiOperation("获取当前登录用户详细信息")
// @PostMapping("getUserDetail")
// public ApiResponseEntity<PlatPersonDTOVO> getUserDetail() {
// return ApiResponseUtils.success(platUserService.getUserDetail());
// }
} }
...@@ -18,4 +18,7 @@ public class BaseOrgDTO extends BaseTenantDTO implements Serializable { ...@@ -18,4 +18,7 @@ public class BaseOrgDTO extends BaseTenantDTO implements Serializable {
@ApiModelProperty(value = "部门树冗余 id") @ApiModelProperty(value = "部门树冗余 id")
private String path; private String path;
@ApiModelProperty(value = "父级id")
private String parentId;
} }
package com.makeit.module.admin.dto.plat; package com.makeit.module.admin.dto.plat;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.makeit.common.dto.BaseOrgDTO; import com.makeit.common.dto.BaseOrgDTO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ApiModel("租户端角色 列表 新增 编辑 详情") @ApiModel("租户端角色 列表 新增 编辑 详情")
...@@ -23,33 +20,9 @@ public class PlatRoleDTOVO extends BaseOrgDTO implements Serializable { ...@@ -23,33 +20,9 @@ public class PlatRoleDTOVO extends BaseOrgDTO implements Serializable {
@ApiModelProperty(value = "名称") @ApiModelProperty(value = "名称")
private String name; private String name;
@NotBlank(message = "编码不能为空")
@Size(max = 64, message = "编码最长为64字符")
@Pattern(regexp = "[a-zA-Z0-9]{0,64}", message = "编码只能为大小写英文字符和数字")
@ApiModelProperty(value = "编码")
private String code;
// @NotBlank(message = "状态不能为空")
// @Pattern(regexp = "0|1", message = "状态可选值为 0禁用 1启用")
// @ApiModelProperty(value = "状态 0禁用 1启用")
// private String status;
@Size(max = 512, message = "备注最长512字符")
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "是否管理员角色 0否 1是") @ApiModelProperty(value = "是否管理员角色 0否 1是")
private String isAdmin; private String isAdmin;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间", required = false)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createdAt;
@ApiModelProperty(value = "关键词 查询用")
private String keyword;
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "部门名称") @ApiModelProperty(value = "部门名称")
......
...@@ -18,10 +18,7 @@ public class PlatUserQueryDTO extends BaseOrgDTO { ...@@ -18,10 +18,7 @@ public class PlatUserQueryDTO extends BaseOrgDTO {
private String account; private String account;
@ApiModelProperty(value = "姓名") @ApiModelProperty(value = "姓名")
private String name; private String username;
// @ApiModelProperty(value = "姓名")
// private String username;
@ApiModelProperty(value = "手机号") @ApiModelProperty(value = "手机号")
private String mobile; private String mobile;
...@@ -63,9 +60,6 @@ public class PlatUserQueryDTO extends BaseOrgDTO { ...@@ -63,9 +60,6 @@ public class PlatUserQueryDTO extends BaseOrgDTO {
private List<String> roleIdList; private List<String> roleIdList;
@ApiModelProperty(value = "部门id集合") @ApiModelProperty(value = "部门id集合")
private List<String> deptIdList; private List<String> orgIdList;
@ApiModelProperty("分管部门树id")
private String chargeDeptId;
} }
...@@ -21,12 +21,6 @@ public class PlatTenantVO extends BaseIdDTO implements Serializable { ...@@ -21,12 +21,6 @@ public class PlatTenantVO extends BaseIdDTO implements Serializable {
@ApiModelProperty(value = "状态 0停用 1启用") @ApiModelProperty(value = "状态 0停用 1启用")
private String status; private String status;
// @ApiModelProperty(value = "开始时间")
// private LocalDateTime startTime;
//
// @ApiModelProperty(value = "结束时间")
// private LocalDateTime endTime;
@ApiModelProperty(value = "开始时间") @ApiModelProperty(value = "开始时间")
private LocalDate startTime; private LocalDate startTime;
...@@ -47,13 +41,13 @@ public class PlatTenantVO extends BaseIdDTO implements Serializable { ...@@ -47,13 +41,13 @@ public class PlatTenantVO extends BaseIdDTO implements Serializable {
*/ */
@ApiModelProperty(value = "创建时间",required = false) @ApiModelProperty(value = "创建时间",required = false)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private LocalDateTime createdAt; private LocalDateTime createDate;
/** /**
* 更新时间 * 更新时间
*/ */
@ApiModelProperty(value = "更新时间",required = false) @ApiModelProperty(value = "更新时间",required = false)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private LocalDateTime updatedAt; private LocalDateTime updateDate;
} }
...@@ -30,7 +30,7 @@ public class PlatUserLoginVO implements Serializable { ...@@ -30,7 +30,7 @@ public class PlatUserLoginVO implements Serializable {
private String isTenant; private String isTenant;
@ApiModelProperty(value = "部门树id") @ApiModelProperty(value = "部门树id")
private String deptId; private String orgId;
@ApiModelProperty("token") @ApiModelProperty("token")
private String token; private String token;
......
...@@ -14,7 +14,7 @@ public class PlatUserVO implements Serializable { ...@@ -14,7 +14,7 @@ public class PlatUserVO implements Serializable {
private String isTenant; private String isTenant;
private String deptId; private String orgId;
public PlatUserVO() { public PlatUserVO() {
} }
......
...@@ -30,7 +30,7 @@ public class WechatUserInfo implements Serializable { ...@@ -30,7 +30,7 @@ public class WechatUserInfo implements Serializable {
private String tenantId; private String tenantId;
private String isFactory; private String isFactory;
private String deptId; private String orgId;
private String account; private String account;
......
...@@ -58,10 +58,7 @@ public class PlatPersonDTOVO extends BaseIdDTO { ...@@ -58,10 +58,7 @@ public class PlatPersonDTOVO extends BaseIdDTO {
@NotBlank(message = "部门不能为空") @NotBlank(message = "部门不能为空")
@ApiModelProperty(value = "部门树id") @ApiModelProperty(value = "部门树id")
private String deptId; private String orgId;
@ApiModelProperty(value = "分管部门id")
private String chargeDeptId;
@NotBlank(message = "性别不能为空") @NotBlank(message = "性别不能为空")
@Pattern(regexp = "1|2", message = "性别可选值为 1男 2女") @Pattern(regexp = "1|2", message = "性别可选值为 1男 2女")
...@@ -100,7 +97,7 @@ public class PlatPersonDTOVO extends BaseIdDTO { ...@@ -100,7 +97,7 @@ public class PlatPersonDTOVO extends BaseIdDTO {
*/ */
@ApiModelProperty(value = "创建时间", required = false) @ApiModelProperty(value = "创建时间", required = false)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createdAt; private LocalDateTime createDate;
/** /**
* 更新时间 * 更新时间
...@@ -109,15 +106,9 @@ public class PlatPersonDTOVO extends BaseIdDTO { ...@@ -109,15 +106,9 @@ public class PlatPersonDTOVO extends BaseIdDTO {
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private LocalDateTime updatedAt; private LocalDateTime updatedAt;
@ApiModelProperty(value = "部门名称") @ApiModelProperty(value = "部门名称")
private String deptName; private String deptName;
@ApiModelProperty(value = "分管部门名称")
private String chargeDeptName;
@ApiModelProperty(value = "头像") @ApiModelProperty(value = "头像")
private String avatar; private String avatar;
......
...@@ -21,6 +21,6 @@ public class PlatRoleDeptDTOVO extends BaseTenantDTO { ...@@ -21,6 +21,6 @@ public class PlatRoleDeptDTOVO extends BaseTenantDTO {
// private String hotelId; // private String hotelId;
@ApiModelProperty(value = "部门树id集合") @ApiModelProperty(value = "部门树id集合")
private List<String> deptIdList; private List<String> orgIdList;
} }
...@@ -7,6 +7,6 @@ import lombok.experimental.FieldNameConstants; ...@@ -7,6 +7,6 @@ import lombok.experimental.FieldNameConstants;
@Data @Data
public class PlatUserCountVO { public class PlatUserCountVO {
//private String id; //private String id;
private String deptId; private String orgId;
private Integer count; private Integer count;
} }
...@@ -6,6 +6,7 @@ import com.makeit.common.entity.BaseBusEntity; ...@@ -6,6 +6,7 @@ import com.makeit.common.entity.BaseBusEntity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -17,14 +18,14 @@ import java.util.List; ...@@ -17,14 +18,14 @@ import java.util.List;
public class PlatOrg extends BaseBusEntity { public class PlatOrg extends BaseBusEntity {
/** /**
* 租户id * 父级id
*/ */
private String tenantId; private String parentId;
/** /**
* 父级id * 全路径id
*/ */
private String parentId; private String path;
/** /**
* 组织名称 * 组织名称
...@@ -53,7 +54,7 @@ public class PlatOrg extends BaseBusEntity { ...@@ -53,7 +54,7 @@ public class PlatOrg extends BaseBusEntity {
@ApiModelProperty(value = "子集") @ApiModelProperty(value = "子集")
@TableField(exist = false) @TableField(exist = false)
private List<PlatOrg> children; private List<PlatOrg> children = new ArrayList<>();
@TableField(exist = false) @TableField(exist = false)
private PlatOrg parent; private PlatOrg parent;
......
...@@ -18,16 +18,16 @@ import java.util.function.Function; ...@@ -18,16 +18,16 @@ import java.util.function.Function;
public class DeptUtil { public class DeptUtil {
private static PlatUserService tntUserService; private static PlatUserService platUserService;
private static PlatOrgService tntDeptService; private static PlatOrgService platOrgService;
public static PlatOrg getById(String deptId) { public static PlatOrg getById(String deptId) {
return tntDeptService.getById(deptId); return platOrgService.getById(deptId);
} }
public static List<PlatOrg> getHotelList() { public static List<PlatOrg> getHotelList() {
List<PlatOrg> deptList = tntDeptService.list(new QueryWrapper<PlatOrg>().lambda() List<PlatOrg> deptList = platOrgService.list(new QueryWrapper<PlatOrg>().lambda()
//.eq(PlatOrg::getTag, DeptEnum.DeptTagEnum.HOTEL.getValue()) //.eq(PlatOrg::getTag, DeptEnum.DeptTagEnum.HOTEL.getValue())
//.eq(TntDept::getStatus, CommonEnum.YES.getValue()) //.eq(TntDept::getStatus, CommonEnum.YES.getValue())
); );
...@@ -147,7 +147,7 @@ public class DeptUtil { ...@@ -147,7 +147,7 @@ public class DeptUtil {
//不涉及角色 //不涉及角色
public static List<String> findSelfAndAllChildrenIdList(String deptId) { public static List<String> findSelfAndAllChildrenIdList(String deptId) {
List<String> idList = StreamUtil.map(tntDeptService.findSelfAndAllChildren(deptId), PlatOrg::getId); List<String> idList = StreamUtil.map(platOrgService.findSelfAndAllChildren(deptId), PlatOrg::getId);
idList.add(-1 + ""); idList.add(-1 + "");
return idList; return idList;
} }
...@@ -178,7 +178,7 @@ public class DeptUtil { ...@@ -178,7 +178,7 @@ public class DeptUtil {
// } // }
public static <T> void join(List<T> list, Function<T, String> getNid, BiConsumer<T, PlatOrg> consumer) { public static <T> void join(List<T> list, Function<T, String> getNid, BiConsumer<T, PlatOrg> consumer) {
JoinUtil.join(list, tntDeptService, null, getNid, PlatOrg::getId, consumer); JoinUtil.join(list, platOrgService, null, getNid, PlatOrg::getId, consumer);
} }
public static String getDeptName(List<String> applyDeptIds, Map<String, String> deptMap) { public static String getDeptName(List<String> applyDeptIds, Map<String, String> deptMap) {
......
...@@ -2,12 +2,15 @@ package com.makeit.service.platform.auth; ...@@ -2,12 +2,15 @@ package com.makeit.service.platform.auth;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.entity.platform.auth.PlatOrg; import com.makeit.entity.platform.auth.PlatOrg;
import com.makeit.vo.platform.auth.PlatOrgQueryDTO; import com.makeit.vo.platform.auth.PlatOrgQueryDTO;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
/** /**
* @author lixl * @author lixl
...@@ -60,7 +63,7 @@ public interface PlatOrgService extends IService<PlatOrg> { ...@@ -60,7 +63,7 @@ public interface PlatOrgService extends IService<PlatOrg> {
Comparator<PlatOrg> getComparator(); Comparator<PlatOrg> getComparator();
void add(PlatOrg dto); String add(PlatOrg dto);
void edit(PlatOrg dto); void edit(PlatOrg dto);
...@@ -80,4 +83,27 @@ public interface PlatOrgService extends IService<PlatOrg> { ...@@ -80,4 +83,27 @@ public interface PlatOrgService extends IService<PlatOrg> {
List<PlatOrg> getSelfAndAllParent(String deptId); List<PlatOrg> getSelfAndAllParent(String deptId);
List<PlatOrg> getDeptSelfAndChildren(String deptId); List<PlatOrg> getDeptSelfAndChildren(String deptId);
/**
* 获取所属组织
* 当前账号所属角色的权限级别,可查看某一级或者某一级及其下级
* @return
*/
List<PlatOrg> belongToOrgTree();
/**
* 启用|禁用
* @param param
*/
void enable(PlatOrg param);
/**
* 获取用户权限范围
*/
Set<String> getOrgIdListByUserId(String userId);
PageVO<PlatOrg> page(PageReqDTO<PlatOrgQueryDTO> pageReqDTO);
List<PlatOrg> subOrgList(PlatOrgQueryDTO platOrgQueryDTO);
} }
...@@ -4,6 +4,9 @@ package com.makeit.service.platform.auth; ...@@ -4,6 +4,9 @@ package com.makeit.service.platform.auth;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.makeit.entity.platform.auth.PlatRoleOrg; import com.makeit.entity.platform.auth.PlatRoleOrg;
import java.util.Collection;
import java.util.List;
/** /**
* @author lixl * @author lixl
* @description 针对表【plat_role_org(租户端角色部门关联表)】的数据库操作Service * @description 针对表【plat_role_org(租户端角色部门关联表)】的数据库操作Service
...@@ -11,4 +14,11 @@ import com.makeit.entity.platform.auth.PlatRoleOrg; ...@@ -11,4 +14,11 @@ import com.makeit.entity.platform.auth.PlatRoleOrg;
*/ */
public interface PlatRoleOrgService extends IService<PlatRoleOrg> { public interface PlatRoleOrgService extends IService<PlatRoleOrg> {
/**
* 根据角色获取所属组织
* @param roleIds
* @return
*/
List<PlatRoleOrg> getByRoleIds(Collection<String> roleIds);
} }
...@@ -2,6 +2,7 @@ package com.makeit.service.platform.auth; ...@@ -2,6 +2,7 @@ package com.makeit.service.platform.auth;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.makeit.common.dto.BaseIdDTO;
import com.makeit.common.dto.StatusDTO; import com.makeit.common.dto.StatusDTO;
import com.makeit.common.page.PageReqDTO; import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO; import com.makeit.common.page.PageVO;
...@@ -25,7 +26,7 @@ public interface PlatRoleService extends IService<PlatRole> { ...@@ -25,7 +26,7 @@ public interface PlatRoleService extends IService<PlatRole> {
PageVO<PlatRoleDTOVO> page(PageReqDTO<PlatRoleDTOVO> page); PageVO<PlatRoleDTOVO> page(PageReqDTO<PlatRoleDTOVO> page);
void add(PlatRoleDTOVO dto); String add(PlatRoleDTOVO dto);
void edit(PlatRoleDTOVO dto); void edit(PlatRoleDTOVO dto);
...@@ -35,27 +36,14 @@ public interface PlatRoleService extends IService<PlatRole> { ...@@ -35,27 +36,14 @@ public interface PlatRoleService extends IService<PlatRole> {
void changeStatus(StatusDTO dto); void changeStatus(StatusDTO dto);
void assignUserList(List<PlatUserRoleDTO> userRoleDTOList); void assignUserList(List<PlatUserRoleDTO> userRoleDTOList);
void removeAssignUserList(List<PlatUserRoleDTO> userRoleDTOList); void removeAssignUserList(List<PlatUserRoleDTO> userRoleDTOList);
// void exportTemplate(HttpServletResponse response);
//
// ExcelImportVo importExcel(String deptId, String hotelId, MultipartFile excelFile) throws Exception;
void assignMenuList(PlatRoleMenuDTO roleMenuDTO); void assignMenuList(PlatRoleMenuDTO roleMenuDTO);
List<PlatRoleMenu> getAssignMenuList(String id); List<PlatRoleMenu> getAssignMenuList(String id);
// void assignWechatMenuList(PlatRoleMenuDTO roleMenuDTO);
// List<PlatRoleWechatMenu> getWechatMenuListByRoleId(String roleId);
void assignDeptList(PlatRoleDeptDTOVO tntRoleDeptDTO); void assignDeptList(PlatRoleDeptDTOVO tntRoleDeptDTO);
List<PlatRoleOrg> getDeptListByRoleId(String roleId); List<PlatRoleOrg> getDeptListByRoleId(String roleId);
...@@ -70,4 +58,11 @@ public interface PlatRoleService extends IService<PlatRole> { ...@@ -70,4 +58,11 @@ public interface PlatRoleService extends IService<PlatRole> {
* @return * @return
*/ */
List<PlatRoleDTOVO> getList(PlatRoleDTOVO dto); List<PlatRoleDTOVO> getList(PlatRoleDTOVO dto);
/**
* 当前用户的所属组织下的角色
* @param baseIdDTO
* @return
*/
List<PlatRole> belongTo(BaseIdDTO baseIdDTO);
} }
...@@ -4,6 +4,8 @@ package com.makeit.service.platform.auth; ...@@ -4,6 +4,8 @@ package com.makeit.service.platform.auth;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.makeit.entity.platform.auth.PlatUserRole; import com.makeit.entity.platform.auth.PlatUserRole;
import java.util.List;
/** /**
* @author lixl * @author lixl
* @description 针对表【plat_user_role(租户端用户角色关联表)】的数据库操作Service * @description 针对表【plat_user_role(租户端用户角色关联表)】的数据库操作Service
...@@ -11,4 +13,10 @@ import com.makeit.entity.platform.auth.PlatUserRole; ...@@ -11,4 +13,10 @@ import com.makeit.entity.platform.auth.PlatUserRole;
*/ */
public interface PlatUserRoleService extends IService<PlatUserRole> { public interface PlatUserRoleService extends IService<PlatUserRole> {
/**
* 根据userId 获取
* @param userId
* @return
*/
List<PlatUserRole> getByUserId(String userId);
} }
...@@ -80,7 +80,7 @@ public interface PlatUserService extends IService<PlatUser> { ...@@ -80,7 +80,7 @@ public interface PlatUserService extends IService<PlatUser> {
List<PlatPersonDTOVO> auditUserList(PlatUserQueryDTO dto); List<PlatPersonDTOVO> auditUserList(PlatUserQueryDTO dto);
void addPerson(PlatPersonDTOVO dto); String addPerson(PlatPersonDTOVO dto);
void editPerson(PlatPersonDTOVO dto); void editPerson(PlatPersonDTOVO dto);
......
package com.makeit.service.platform.auth.impl; package com.makeit.service.platform.auth.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.makeit.entity.platform.auth.PlatRoleOrg; import com.makeit.entity.platform.auth.PlatRoleOrg;
import com.makeit.mapper.platform.auth.PlatRoleOrgMapper; import com.makeit.mapper.platform.auth.PlatRoleOrgMapper;
import com.makeit.service.platform.auth.PlatRoleOrgService; import com.makeit.service.platform.auth.PlatRoleOrgService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/** /**
* @author lixl * @author lixl
* @description 针对表【plat_role_org(租户端角色部门关联表)】的数据库操作Service实现 * @description 针对表【plat_role_org(租户端角色部门关联表)】的数据库操作Service实现
...@@ -15,4 +21,19 @@ import org.springframework.stereotype.Service; ...@@ -15,4 +21,19 @@ import org.springframework.stereotype.Service;
public class PlatRoleOrgServiceImpl extends ServiceImpl<PlatRoleOrgMapper, PlatRoleOrg> public class PlatRoleOrgServiceImpl extends ServiceImpl<PlatRoleOrgMapper, PlatRoleOrg>
implements PlatRoleOrgService{ implements PlatRoleOrgService{
/**
* 根据角色获取所属组织
*
* @param roleIds
* @return
*/
@Override
public List<PlatRoleOrg> getByRoleIds(Collection<String> roleIds) {
if(CollectionUtils.isEmpty(roleIds)){
return new ArrayList<>();
}
LambdaQueryWrapper<PlatRoleOrg> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(PlatRoleOrg::getRoleId,roleIds);
return list(queryWrapper);
}
} }
package com.makeit.service.platform.auth.impl; package com.makeit.service.platform.auth.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.makeit.entity.platform.auth.PlatUserRole; import com.makeit.entity.platform.auth.PlatUserRole;
import com.makeit.mapper.platform.auth.PlatUserRoleMapper; import com.makeit.mapper.platform.auth.PlatUserRoleMapper;
import com.makeit.service.platform.auth.PlatRoleOrgService;
import com.makeit.service.platform.auth.PlatUserRoleService; import com.makeit.service.platform.auth.PlatUserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* @author lixl * @author lixl
* @description 针对表【plat_user_role(租户端用户角色关联表)】的数据库操作Service实现 * @description 针对表【plat_user_role(租户端用户角色关联表)】的数据库操作Service实现
...@@ -15,4 +20,21 @@ import org.springframework.stereotype.Service; ...@@ -15,4 +20,21 @@ import org.springframework.stereotype.Service;
public class PlatUserRoleServiceImpl extends ServiceImpl<PlatUserRoleMapper, PlatUserRole> public class PlatUserRoleServiceImpl extends ServiceImpl<PlatUserRoleMapper, PlatUserRole>
implements PlatUserRoleService{ implements PlatUserRoleService{
@Autowired
private PlatRoleOrgService platRoleOrgService;
/**
* 根据userId 获取
*
* @param userId
* @return
*/
@Override
public List<PlatUserRole> getByUserId(String userId) {
LambdaQueryWrapper<PlatUserRole> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(PlatUserRole::getUserId,userId);
return list(queryWrapper);
}
} }
...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.makeit.common.entity.BaseEntity; import com.makeit.common.entity.BaseEntity;
import com.makeit.common.page.PageReqDTO; import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO; import com.makeit.common.page.PageVO;
import com.makeit.entity.platform.auth.PlatOrg;
import com.makeit.entity.platform.auth.PlatUser; import com.makeit.entity.platform.auth.PlatUser;
import com.makeit.entity.saas.PlatTenant; import com.makeit.entity.saas.PlatTenant;
import com.makeit.entity.saas.PlatTenantMenu; import com.makeit.entity.saas.PlatTenantMenu;
...@@ -22,6 +23,7 @@ import com.makeit.module.admin.dto.plat.PlatTenantMenuDTO; ...@@ -22,6 +23,7 @@ import com.makeit.module.admin.dto.plat.PlatTenantMenuDTO;
import com.makeit.module.admin.dto.plat.PlatTenantStatusDTO; import com.makeit.module.admin.dto.plat.PlatTenantStatusDTO;
import com.makeit.module.admin.vo.plat.PlatTenantVO; import com.makeit.module.admin.vo.plat.PlatTenantVO;
import com.makeit.module.system.service.SysConfigService; import com.makeit.module.system.service.SysConfigService;
import com.makeit.service.platform.auth.PlatOrgService;
import com.makeit.service.platform.auth.PlatUserService; import com.makeit.service.platform.auth.PlatUserService;
import com.makeit.service.saas.PlatTenantMenuService; import com.makeit.service.saas.PlatTenantMenuService;
import com.makeit.service.saas.PlatTenantService; import com.makeit.service.saas.PlatTenantService;
...@@ -70,6 +72,9 @@ implements PlatTenantService { ...@@ -70,6 +72,9 @@ implements PlatTenantService {
@Autowired @Autowired
private PlatTenantMenuService platTenantMenuService; private PlatTenantMenuService platTenantMenuService;
@Autowired
private PlatOrgService platOrgService;
private LambdaQueryWrapper<PlatTenant> listLambdaQueryWrapper(PlatTenantVO dto, boolean userAccountLike) { private LambdaQueryWrapper<PlatTenant> listLambdaQueryWrapper(PlatTenantVO dto, boolean userAccountLike) {
List<String> tenantUserIdList = new ArrayList<>(10); List<String> tenantUserIdList = new ArrayList<>(10);
...@@ -195,6 +200,10 @@ implements PlatTenantService { ...@@ -195,6 +200,10 @@ implements PlatTenantService {
//更新用户的tenantId //更新用户的tenantId
platUserService.updatePlatUserTenantId(tntTenant.getId(),dto.getPlatUserId()); platUserService.updatePlatUserTenantId(tntTenant.getId(),dto.getPlatUserId());
//组织表增加一条数据
PlatOrg platOrg = convertToPlatOrg(tntTenant);
platOrgService.add(platOrg);
return tntTenant.getId(); return tntTenant.getId();
} }
...@@ -213,10 +222,23 @@ implements PlatTenantService { ...@@ -213,10 +222,23 @@ implements PlatTenantService {
} }
platUserService.updatePlatUserTenantId(tntTenant.getId(),dto.getPlatUserId()); platUserService.updatePlatUserTenantId(tntTenant.getId(),dto.getPlatUserId());
PlatOrg platOrg = convertToPlatOrg(platTenant);
//更新组织表
platOrgService.edit(platOrg);
saasOperationLogService.add("平台端-租户账号-编辑", dto.getId()); saasOperationLogService.add("平台端-租户账号-编辑", dto.getId());
} }
public PlatOrg convertToPlatOrg(PlatTenant platTenant){
PlatOrg platOrg = new PlatOrg();
platOrg.setTenantId(platTenant.getId());
platOrg.setName(platTenant.getName());
platOrg.setStatus(platTenant.getStatus());
platOrg.setId(platTenant.getId());
return platOrg;
}
@Override @Override
public PlatTenantDTOVO view(String id) { public PlatTenantDTOVO view(String id) {
PlatTenantDTOVO userVO = BeanDtoVoUtils.convert(getById(id), PlatTenantDTOVO.class); PlatTenantDTOVO userVO = BeanDtoVoUtils.convert(getById(id), PlatTenantDTOVO.class);
......
...@@ -15,7 +15,7 @@ public class PlatOrgQueryDTO extends BaseOrgDTO { ...@@ -15,7 +15,7 @@ public class PlatOrgQueryDTO extends BaseOrgDTO {
@ApiModelProperty(value = "状态 0禁用 1启用") @ApiModelProperty(value = "状态 0禁用 1启用")
private String status; private String status;
@ApiModelProperty(value = "是否从酒店开始 0否 1是") @ApiModelProperty(value = "字典类型 1-居家 2-机构")
private String fromHotel; private String type;
} }
...@@ -46,7 +46,7 @@ public class PlatPersonDTOVO extends BaseIdDTO { ...@@ -46,7 +46,7 @@ public class PlatPersonDTOVO extends BaseIdDTO {
private String status; private String status;
@ApiModelProperty(value = "部门树id") @ApiModelProperty(value = "部门树id")
private String deptId; private String orgId;
@Size(max = 512, message = "备注最长512字符") @Size(max = 512, message = "备注最长512字符")
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
...@@ -67,7 +67,7 @@ public class PlatPersonDTOVO extends BaseIdDTO { ...@@ -67,7 +67,7 @@ public class PlatPersonDTOVO extends BaseIdDTO {
private LocalDateTime updateDate; private LocalDateTime updateDate;
@ApiModelProperty(value = "部门名称") @ApiModelProperty(value = "部门名称")
private String deptName; private String orgName;
@ApiModelProperty(value = "头像") @ApiModelProperty(value = "头像")
......
...@@ -7,6 +7,6 @@ import lombok.experimental.FieldNameConstants; ...@@ -7,6 +7,6 @@ import lombok.experimental.FieldNameConstants;
@Data @Data
public class PlatUserCountVO { public class PlatUserCountVO {
//private String id; //private String id;
private String deptId; private String orgId;
private Integer count; private Integer count;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment