新增:客户管理的成员管理及企业资料管理
This commit is contained in:
@@ -1,22 +1,24 @@
|
|||||||
package com.gxwebsoft.oa.controller;
|
package com.gxwebsoft.oa.controller;
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.common.core.web.*;
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
import com.gxwebsoft.oa.service.CompanyService;
|
|
||||||
import com.gxwebsoft.oa.entity.Company;
|
import com.gxwebsoft.oa.entity.Company;
|
||||||
|
import com.gxwebsoft.oa.entity.CompanyUser;
|
||||||
import com.gxwebsoft.oa.param.CompanyParam;
|
import com.gxwebsoft.oa.param.CompanyParam;
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
import com.gxwebsoft.oa.service.CompanyService;
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
import com.gxwebsoft.oa.service.CompanyUserService;
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static com.gxwebsoft.common.core.constants.AppUserConstants.ADMINISTRATOR;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业信息控制器
|
* 企业信息控制器
|
||||||
@@ -30,12 +32,25 @@ import java.util.List;
|
|||||||
public class CompanyController extends BaseController {
|
public class CompanyController extends BaseController {
|
||||||
@Resource
|
@Resource
|
||||||
private CompanyService companyService;
|
private CompanyService companyService;
|
||||||
|
@Resource
|
||||||
|
private CompanyUserService companyUserService;
|
||||||
|
|
||||||
@ApiOperation("分页查询企业信息")
|
@ApiOperation("分页查询企业信息")
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
public ApiResult<PageResult<Company>> page(CompanyParam param) {
|
public ApiResult<PageResult<Company>> page(CompanyParam param) {
|
||||||
// 使用关联查询
|
final User loginUser = getLoginUser();
|
||||||
return success(companyService.pageRel(param));
|
final Integer userId = loginUser.getUserId();
|
||||||
|
loginUser.getRoles().forEach(d -> {
|
||||||
|
if(!StrUtil.equals(d.getRoleCode(),"superAdmin") && !StrUtil.equals(d.getRoleCode(),"admin")){
|
||||||
|
// 非管理员按项目成员权限显示
|
||||||
|
final List<CompanyUser> list = companyUserService.list(new LambdaQueryWrapper<CompanyUser>().eq(CompanyUser::getUserId, userId));
|
||||||
|
System.out.println("list = " + list);
|
||||||
|
final Set<Integer> collect = list.stream().map(CompanyUser::getCompanyId).collect(Collectors.toSet());
|
||||||
|
param.setCompanyIds(collect);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 使用关联查询
|
||||||
|
return success(companyService.pageRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("查询全部企业信息")
|
@ApiOperation("查询全部企业信息")
|
||||||
@@ -61,12 +76,19 @@ public class CompanyController extends BaseController {
|
|||||||
public ApiResult<?> save(@RequestBody Company company) {
|
public ApiResult<?> save(@RequestBody Company company) {
|
||||||
// 记录当前登录用户id
|
// 记录当前登录用户id
|
||||||
User loginUser = getLoginUser();
|
User loginUser = getLoginUser();
|
||||||
|
CompanyUser companyUser = new CompanyUser();
|
||||||
if (loginUser != null) {
|
if (loginUser != null) {
|
||||||
company.setUserId(loginUser.getUserId());
|
company.setUserId(loginUser.getUserId());
|
||||||
}
|
company.setTenantId(loginUser.getTenantId());
|
||||||
if (companyService.save(company)) {
|
}
|
||||||
return success("添加成功");
|
if (companyService.save(company)) {
|
||||||
}
|
// 添加客户所有者
|
||||||
|
companyUser.setUserId(loginUser.getUserId());
|
||||||
|
companyUser.setCompanyId(company.getCompanyId());
|
||||||
|
companyUser.setRole(ADMINISTRATOR);
|
||||||
|
companyUserService.save(companyUser);
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
return fail("添加失败");
|
return fail("添加失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,116 @@
|
|||||||
|
package com.gxwebsoft.oa.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.*;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import com.gxwebsoft.oa.entity.CompanyField;
|
||||||
|
import com.gxwebsoft.oa.param.CompanyFieldParam;
|
||||||
|
import com.gxwebsoft.oa.service.CompanyFieldService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业参数控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-02-04 14:44:42
|
||||||
|
*/
|
||||||
|
@Api(tags = "企业参数管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/oa/company-field")
|
||||||
|
public class CompanyFieldController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CompanyFieldService companyFieldService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询企业参数")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CompanyField>> page(CompanyFieldParam param) {
|
||||||
|
PageParam<CompanyField, CompanyFieldParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number desc");
|
||||||
|
page.setDefaultOrder("create_time asc");
|
||||||
|
return success(companyFieldService.page(page, page.getWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(companyFieldService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部企业参数")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CompanyField>> list(CompanyFieldParam param) {
|
||||||
|
PageParam<CompanyField, CompanyFieldParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(companyFieldService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(companyFieldService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询企业参数")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CompanyField> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(companyFieldService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(companyFieldService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加企业参数")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CompanyField companyField) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
companyField.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (companyFieldService.save(companyField)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改企业参数")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CompanyField companyField) {
|
||||||
|
if (companyFieldService.updateById(companyField)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除企业参数")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (companyFieldService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加企业参数")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CompanyField> list) {
|
||||||
|
if (companyFieldService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改企业参数")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CompanyField> batchParam) {
|
||||||
|
if (batchParam.update(companyFieldService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除企业参数")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (companyFieldService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
package com.gxwebsoft.oa.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.oa.entity.CompanyUser;
|
||||||
|
import com.gxwebsoft.oa.param.CompanyUserParam;
|
||||||
|
import com.gxwebsoft.oa.service.CompanyUserService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成员管理控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-02-04 14:44:42
|
||||||
|
*/
|
||||||
|
@Api(tags = "成员管理管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/oa/company-user")
|
||||||
|
public class CompanyUserController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CompanyUserService companyUserService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询成员管理")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CompanyUser>> page(CompanyUserParam param, HttpServletRequest request) {
|
||||||
|
// 使用关联查询
|
||||||
|
param.setToken(JwtUtil.getAccessToken(request));
|
||||||
|
param.setTenantId(getTenantId());
|
||||||
|
return success(companyUserService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部成员管理")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CompanyUser>> list(CompanyUserParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
if (param.getCompanyId() == null) {
|
||||||
|
return fail("该企业不存在",null);
|
||||||
|
}
|
||||||
|
// 使用关联查询
|
||||||
|
return success(companyUserService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询成员管理")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CompanyUser> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(companyUserService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加成员管理")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CompanyUser companyUser) {
|
||||||
|
if (companyUserService.count(new LambdaQueryWrapper<CompanyUser>()
|
||||||
|
.eq(CompanyUser::getUserId, companyUser.getUserId()).eq(CompanyUser::getCompanyId,companyUser.getCompanyId())) > 0) {
|
||||||
|
return fail("该成员已存在");
|
||||||
|
}
|
||||||
|
if (companyUserService.save(companyUser)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改成员管理")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CompanyUser companyUser) {
|
||||||
|
if (companyUserService.updateById(companyUser)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除成员管理")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (companyUserService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加成员管理")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CompanyUser> list) {
|
||||||
|
if (companyUserService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改成员管理")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CompanyUser> batchParam) {
|
||||||
|
if (batchParam.update(companyUserService, "company_user_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除成员管理")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (companyUserService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.gxwebsoft.oa.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-02-04 14:44:42
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "CompanyField对象", description = "企业参数")
|
||||||
|
@TableName("oa_company_field")
|
||||||
|
public class CompanyField implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "自增ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业ID")
|
||||||
|
private Integer companyId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1删除")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package com.gxwebsoft.oa.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成员管理
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-02-04 14:44:42
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "CompanyUser对象", description = "成员管理")
|
||||||
|
@TableName("oa_company_user")
|
||||||
|
public class CompanyUser implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "自增ID")
|
||||||
|
@TableId(value = "company_user_id", type = IdType.AUTO)
|
||||||
|
private Integer companyUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "角色,10体验成员 20开发者成员 30管理员 ")
|
||||||
|
private Integer role;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业ID")
|
||||||
|
private Integer companyId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1待确认")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "注册时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "昵称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户名")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手机号码")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "邮箱")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "头像")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.oa.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.oa.entity.CompanyField;
|
||||||
|
import com.gxwebsoft.oa.param.CompanyFieldParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业参数Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-02-04 14:44:42
|
||||||
|
*/
|
||||||
|
public interface CompanyFieldMapper extends BaseMapper<CompanyField> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CompanyField>
|
||||||
|
*/
|
||||||
|
List<CompanyField> selectPageRel(@Param("page") IPage<CompanyField> page,
|
||||||
|
@Param("param") CompanyFieldParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CompanyField> selectListRel(@Param("param") CompanyFieldParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.oa.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.oa.entity.CompanyUser;
|
||||||
|
import com.gxwebsoft.oa.param.CompanyUserParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成员管理Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-02-04 14:44:42
|
||||||
|
*/
|
||||||
|
public interface CompanyUserMapper extends BaseMapper<CompanyUser> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CompanyUser>
|
||||||
|
*/
|
||||||
|
List<CompanyUser> selectPageRel(@Param("page") IPage<CompanyUser> page,
|
||||||
|
@Param("param") CompanyUserParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<CompanyUser> selectListRel(@Param("param") CompanyUserParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.oa.mapper.CompanyFieldMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM oa_company_field a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.companyId != null">
|
||||||
|
AND a.company_id = #{param.companyId}
|
||||||
|
</if>
|
||||||
|
<if test="param.name != null">
|
||||||
|
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.oa.entity.CompanyField">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.oa.entity.CompanyField">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.oa.mapper.CompanyUserMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM oa_company_user a
|
||||||
|
<where>
|
||||||
|
<if test="param.companyUserId != null">
|
||||||
|
AND a.company_user_id = #{param.companyUserId}
|
||||||
|
</if>
|
||||||
|
<if test="param.role != null">
|
||||||
|
AND a.role = #{param.role}
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.companyId != null">
|
||||||
|
AND a.company_id = #{param.companyId}
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.oa.entity.CompanyUser">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.oa.entity.CompanyUser">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.gxwebsoft.oa.param;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业参数查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-02-04 14:44:42
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "CompanyFieldParam对象", description = "企业参数查询参数")
|
||||||
|
public class CompanyFieldParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "自增ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer companyId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1删除")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.gxwebsoft.oa.param;
|
package com.gxwebsoft.oa.param;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
import com.gxwebsoft.common.core.web.BaseParam;
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
@@ -9,6 +10,8 @@ import io.swagger.annotations.ApiModelProperty;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业信息查询参数
|
* 企业信息查询参数
|
||||||
*
|
*
|
||||||
@@ -180,4 +183,8 @@ public class CompanyParam extends BaseParam {
|
|||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer deleted;
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "按companyId集搜索")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Set<Integer> companyIds;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.gxwebsoft.oa.param;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成员管理查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-02-04 14:44:42
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "CompanyUserParam对象", description = "成员管理查询参数")
|
||||||
|
public class CompanyUserParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "自增ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer companyUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "角色,10体验成员 20开发者成员 30管理员 ")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer role;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer companyId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1待确认")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.oa.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.oa.entity.CompanyField;
|
||||||
|
import com.gxwebsoft.oa.param.CompanyFieldParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业参数Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-02-04 14:44:42
|
||||||
|
*/
|
||||||
|
public interface CompanyFieldService extends IService<CompanyField> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<CompanyField>
|
||||||
|
*/
|
||||||
|
PageResult<CompanyField> pageRel(CompanyFieldParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CompanyField>
|
||||||
|
*/
|
||||||
|
List<CompanyField> listRel(CompanyFieldParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id 自增ID
|
||||||
|
* @return CompanyField
|
||||||
|
*/
|
||||||
|
CompanyField getByIdRel(Integer id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.oa.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.oa.entity.CompanyUser;
|
||||||
|
import com.gxwebsoft.oa.param.CompanyUserParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成员管理Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-02-04 14:44:42
|
||||||
|
*/
|
||||||
|
public interface CompanyUserService extends IService<CompanyUser> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<CompanyUser>
|
||||||
|
*/
|
||||||
|
PageResult<CompanyUser> pageRel(CompanyUserParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<CompanyUser>
|
||||||
|
*/
|
||||||
|
List<CompanyUser> listRel(CompanyUserParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param companyUserId 自增ID
|
||||||
|
* @return CompanyUser
|
||||||
|
*/
|
||||||
|
CompanyUser getByIdRel(Integer companyUserId);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.gxwebsoft.oa.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.oa.mapper.CompanyFieldMapper;
|
||||||
|
import com.gxwebsoft.oa.service.CompanyFieldService;
|
||||||
|
import com.gxwebsoft.oa.entity.CompanyField;
|
||||||
|
import com.gxwebsoft.oa.param.CompanyFieldParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业参数Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-02-04 14:44:42
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CompanyFieldServiceImpl extends ServiceImpl<CompanyFieldMapper, CompanyField> implements CompanyFieldService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<CompanyField> pageRel(CompanyFieldParam param) {
|
||||||
|
PageParam<CompanyField, CompanyFieldParam> page = new PageParam<>(param);
|
||||||
|
//page.setDefaultOrder("create_time desc");
|
||||||
|
List<CompanyField> list = baseMapper.selectPageRel(page, param);
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CompanyField> listRel(CompanyFieldParam param) {
|
||||||
|
List<CompanyField> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<CompanyField, CompanyFieldParam> page = new PageParam<>();
|
||||||
|
//page.setDefaultOrder("create_time desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CompanyField getByIdRel(Integer id) {
|
||||||
|
CompanyFieldParam param = new CompanyFieldParam();
|
||||||
|
param.setId(id);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
package com.gxwebsoft.oa.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.net.url.UrlBuilder;
|
||||||
|
import cn.hutool.core.net.url.UrlQuery;
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.alibaba.fastjson.TypeReference;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import com.gxwebsoft.oa.entity.CompanyUser;
|
||||||
|
import com.gxwebsoft.oa.mapper.CompanyUserMapper;
|
||||||
|
import com.gxwebsoft.oa.param.CompanyUserParam;
|
||||||
|
import com.gxwebsoft.oa.service.CompanyUserService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成员管理Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-02-04 14:44:42
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CompanyUserServiceImpl extends ServiceImpl<CompanyUserMapper, CompanyUser> implements CompanyUserService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<CompanyUser> pageRel(CompanyUserParam param) {
|
||||||
|
PageParam<CompanyUser, CompanyUserParam> page = new PageParam<>(param);
|
||||||
|
//page.setDefaultOrder("create_time desc");
|
||||||
|
List<CompanyUser> list = baseMapper.selectPageRel(page, param);
|
||||||
|
PageResult<CompanyUser> result = new PageResult<>(list, page.getTotal());
|
||||||
|
final List<CompanyUser> companyUserList = result.getList();
|
||||||
|
final Set<Integer> userIds = companyUserList.stream().map(CompanyUser::getUserId).collect(Collectors.toSet());
|
||||||
|
// 请求主服务器获取用户信息
|
||||||
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
map.put("userIds", userIds);
|
||||||
|
System.out.println("map = " + map);
|
||||||
|
// 链式构建GET请求
|
||||||
|
final String build = UrlBuilder.of("https://server.gxwebsoft.com/api/system/user/page").setQuery(new UrlQuery(map)).build();
|
||||||
|
String response = HttpRequest.get(build)
|
||||||
|
.header("Authorization", param.getToken())
|
||||||
|
.header("Tenantid", param.getTenantId().toString())
|
||||||
|
.body(JSONObject.toJSONString(map))//表单内容
|
||||||
|
.timeout(20000)//超时,毫秒
|
||||||
|
.execute().body();
|
||||||
|
|
||||||
|
System.out.println("response = " + response);
|
||||||
|
|
||||||
|
final ApiResult<PageResult<User>> userResult = JSONObject.parseObject(response, new TypeReference<ApiResult<PageResult<User>>>() {
|
||||||
|
});
|
||||||
|
final PageResult<User> data = userResult.getData();
|
||||||
|
final List<User> userList = data.getList();
|
||||||
|
if (!CollectionUtils.isEmpty(userList)) {
|
||||||
|
final Map<Integer, List<User>> collect = userList.stream().collect(Collectors.groupingBy(User::getUserId));
|
||||||
|
companyUserList.forEach(item -> {
|
||||||
|
final List<User> users = collect.get(item.getUserId());
|
||||||
|
if (!CollectionUtils.isEmpty(users)) {
|
||||||
|
final User user = users.get(0);
|
||||||
|
item.setNickname(user.getNickname());
|
||||||
|
item.setAvatar(user.getAvatar());
|
||||||
|
item.setPhone(user.getPhone());
|
||||||
|
item.setEmail(user.getEmail());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
result.setList(companyUserList);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CompanyUser> listRel(CompanyUserParam param) {
|
||||||
|
List<CompanyUser> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<CompanyUser, CompanyUserParam> page = new PageParam<>();
|
||||||
|
//page.setDefaultOrder("create_time desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CompanyUser getByIdRel(Integer companyUserId) {
|
||||||
|
CompanyUserParam param = new CompanyUserParam();
|
||||||
|
param.setCompanyUserId(companyUserId);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -55,7 +55,9 @@ public class OaGenerator {
|
|||||||
// "oa_product"
|
// "oa_product"
|
||||||
// "oa_product_tabs",
|
// "oa_product_tabs",
|
||||||
// "oa_app_field",
|
// "oa_app_field",
|
||||||
"oa_link"
|
// "oa_link",
|
||||||
|
"oa_company_field",
|
||||||
|
"oa_company_user"
|
||||||
};
|
};
|
||||||
// 需要去除的表前缀
|
// 需要去除的表前缀
|
||||||
private static final String[] TABLE_PREFIX = new String[]{
|
private static final String[] TABLE_PREFIX = new String[]{
|
||||||
|
|||||||
Reference in New Issue
Block a user