Browse Source

用列表信息补充字段

tags/24080901
liuxinxin 1 year ago
parent
commit
f0eb4272cc
5 changed files with 68 additions and 16 deletions
  1. +4
    -9
      pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java
  2. +1
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserInfo.java
  3. +48
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java
  4. +9
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/user/model/po/ReqUserDisablePO.java
  5. +6
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserInfoListVO.java

+ 4
- 9
pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java View File

@@ -11,7 +11,6 @@ import com.ningdatech.pmapi.user.model.vo.ResUserInfoListVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -20,10 +19,6 @@ import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;

/**
* <p>
* 用户信息表 前端控制器
* </p>
*
* @author Liuxinxin
* @since 2023-01-04
*/
@@ -41,10 +36,10 @@ public class UserInfoController {
return userInfoManage.list(reqUserInfoListPO);
}

@ApiOperation(value = "用户禁用", notes = "用户禁用")
@PostMapping("/disable")
public void disable(@Valid @RequestBody ReqUserDisablePO reqUserDisablePO) {
userInfoManage.disable(reqUserDisablePO);
@ApiOperation(value = "用户禁用/启用", notes = "用户禁用/启用")
@PostMapping("/disable-enable")
public void disableOrEnable(@Valid @RequestBody ReqUserDisablePO reqUserDisablePO) {
userInfoManage.disableOrEnable(reqUserDisablePO);
}

@ApiOperation(value = "用户详情", notes = "用户详情")


+ 1
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/entity/UserInfo.java View File

@@ -40,4 +40,5 @@ public class UserInfo implements Serializable {

private String realName;

private String available;
}

+ 48
- 2
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java View File

@@ -1,14 +1,25 @@
package com.ningdatech.pmapi.user.manage;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo;
import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService;
import com.ningdatech.pmapi.organization.service.IDingOrganizationService;
import com.ningdatech.pmapi.user.model.po.ReqUserDetailEditPO;
import com.ningdatech.pmapi.user.model.po.ReqUserDisablePO;
import com.ningdatech.pmapi.user.model.po.ReqUserInfoListPO;
import com.ningdatech.pmapi.user.model.vo.ResUserDetailVO;
import com.ningdatech.pmapi.user.model.vo.ResUserInfoListVO;
import com.ningdatech.pmapi.user.service.IUserInfoService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
* @author liuxinxin
* @date 2023/2/13 上午9:09
@@ -17,12 +28,47 @@ import org.springframework.stereotype.Component;
@RequiredArgsConstructor
public class UserInfoManage {

private final IDingOrganizationService iDingOrganizationService;
private final IDingEmployeeInfoService iDingEmployeeInfoService;
private final IUserInfoService iUserInfoService;

public PageVo<ResUserInfoListVO> list(ReqUserInfoListPO reqUserInfoListPO) {
LambdaQueryWrapper<DingEmployeeInfo> wrapper = Wrappers.lambdaQuery(DingEmployeeInfo.class)
.eq(DingEmployeeInfo::getMainJob, "true");

return null;
Page<DingEmployeeInfo> page = iDingEmployeeInfoService.page(new Page<>(reqUserInfoListPO.getPageNumber(), reqUserInfoListPO.getPageSize()), wrapper);
List<DingEmployeeInfo> records = page.getRecords();
long total = page.getTotal();
List<ResUserInfoListVO> resUserInfoListVOList = new ArrayList<>();
if (records != null && records.size() > 0) {
resUserInfoListVOList = records.stream()
.map(r -> {
ResUserInfoListVO resListVO = new ResUserInfoListVO();
resListVO.setName(r.getEmployeeName());
resListVO.setOrgName(r.getOrganizationCode());
resListVO.setOrgCode(r.getOrganizationCode());
// TODO 从用户信息中获取
// resListVO.setPhoneNo();
// 从所属组织中获取
// resListVO.setRegionId();
resListVO.setStatus(false);
resListVO.setUpdateTime(r.getUpdateOn());
// 从用户信息中获取
resListVO.setUserId(1L);
resListVO.setEmployeeCode(r.getEmployeeCode());
resListVO.setUserRoleList(new ArrayList<>());
return resListVO;
}).collect(Collectors.toList());
}

PageVo<ResUserInfoListVO> pageVo = new PageVo<>();
pageVo.setTotal(total);
pageVo.setRecords(resUserInfoListVOList);
return pageVo;
}

public void disable(ReqUserDisablePO reqUserDisablePO) {
public void disableOrEnable(ReqUserDisablePO reqUserDisablePO) {


}



+ 9
- 2
pmapi/src/main/java/com/ningdatech/pmapi/user/model/po/ReqUserDisablePO.java View File

@@ -12,11 +12,18 @@ import javax.validation.constraints.NotBlank;
*/

@Data
@ApiModel("用户禁用PO")
@ApiModel("用户禁用/启用 PO")
public class ReqUserDisablePO {

@NotBlank(message = "用户ID不能为空")
@ApiModelProperty("用户id")
private Long userId;

@NotBlank(message = "浙政钉 用户编码 不能为空")
@ApiModelProperty("浙政钉 用户编码")
private String employeeCode;

@NotBlank(message = "浙政钉 用户编码 不能为空")
@ApiModelProperty("操作 true: 启用 / false 禁用")
private Boolean operation;

}

+ 6
- 3
pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserInfoListVO.java View File

@@ -19,6 +19,9 @@ public class ResUserInfoListVO {
@ApiModelProperty("用户id")
private Long userId;

@ApiModelProperty("浙政钉 用户编码")
private String employeeCode;

@ApiModelProperty("姓名")
private String name;

@@ -28,8 +31,8 @@ public class ResUserInfoListVO {
@ApiModelProperty("所在单位(主职)")
private String orgName;

@ApiModelProperty("所在单位(主职)id")
private Long orgId;
@ApiModelProperty("所在单位(主职)code")
private String orgCode;

@ApiModelProperty("所属区域")
private Long regionId;
@@ -38,7 +41,7 @@ public class ResUserInfoListVO {
private List<Role> userRoleList;

@ApiModelProperty("状态")
private String status;
private Boolean status;

@ApiModelProperty("更新时间")
private LocalDateTime updateTime;


Loading…
Cancel
Save