res = page.getRecords().stream().map(record -> {
+ ProjectDraftVO vo = new ProjectDraftVO();
BeanUtils.copyProperties(record, vo);
return vo;
}).collect(Collectors.toList());
return PageVo.of(res, page.getTotal());
}
- public ProjectDraftVo draftDatail(Long id) {
+ public ProjectDraftVO draftDatail(Long id) {
ProjectDraft draft = projectDraftService.getById(id);
- ProjectDraftVo vo = new ProjectDraftVo();
+ ProjectDraftVO vo = new ProjectDraftVO();
BeanUtils.copyProperties(draft, vo);
if(StringUtils.isNotBlank(draft.getProjectApplicationList())){
vo.setApplicationList(JSON.parseArray(draft.getProjectApplicationList(),ProjectApplication.class));
@@ -129,13 +103,13 @@ public class DeclaredProjectManage {
* @param dto
* @return
*/
- public String startTheProcess(DeclaredProjectDto dto) {
+ public String startTheProcess(DeclaredProjectDTO dto) {
ProjectDTO projectInfo = dto.getProjectInfo();
String regionCode = projectInfo.getAreaCode();
WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class)
.eq(WflowModels::getRegionCode, regionCode)
- .eq(WflowModels::getFormName, ProjectProessStageEnum.ORG_INTERNAL_APPROVAL_PROCESS.getDesc())
+ .eq(WflowModels::getProcessType, ProjectProcessStageEnum.ORG_INTERNAL_APPROVAL_PROCESS.getCode())
.last("limit 1"));
if (Objects.isNull(model)) {
@@ -147,7 +121,7 @@ public class DeclaredProjectManage {
params.setUser(dto.getUser());
params.setProcessUsers(Collections.emptyMap());
//放入条件判断的项目字段
- ProjectConditionDto conditionDto = new ProjectConditionDto();
+ ProjectConditionDTO conditionDto = new ProjectConditionDTO();
BeanUtils.copyProperties(dto.getProjectInfo(), conditionDto);
if (Objects.nonNull(conditionDto)) {
dto.getFormData().putAll(
@@ -206,7 +180,7 @@ public class DeclaredProjectManage {
* @param dto
* @return
*/
- public Long saveToDraft(ProjectDraftSaveDto dto) {
+ public Long saveToDraft(ProjectDraftSaveDTO dto) {
ProjectDTO projectInfo = dto.getProjectInfo();
ProjectDraft draft = new ProjectDraft();
BeanUtils.copyProperties(projectInfo, draft);
diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java
index e19f880..c7991bd 100644
--- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java
+++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java
@@ -4,10 +4,10 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.function.VUtils;
-import com.ningdatech.pmapi.common.enumeration.ProjectProessStageEnum;
+import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum;
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils;
-import com.ningdatech.pmapi.projectdeclared.entity.dto.PreDeclaredProjectDto;
-import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectConditionDto;
+import com.ningdatech.pmapi.projectdeclared.entity.dto.PreDeclaredProjectDTO;
+import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectConditionDTO;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
@@ -51,7 +51,7 @@ public class PrequalificationDeclaredProjectManage {
* @param dto
* @return
*/
- public String startTheProcess(PreDeclaredProjectDto dto) {
+ public String startTheProcess(PreDeclaredProjectDTO dto) {
Project projectInfo = projectService.getById(dto.getProjectId());
VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!");
@@ -60,7 +60,7 @@ public class PrequalificationDeclaredProjectManage {
WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class)
.eq(WflowModels::getRegionCode, regionCode)
- .eq(WflowModels::getFormName, ProjectProessStageEnum.PROJECT_PREQUALIFICATION_APPROVAL_PROCESS.getDesc())
+ .eq(WflowModels::getProcessType, ProjectProcessStageEnum.PROJECT_PREQUALIFICATION_APPROVAL_PROCESS.getCode())
.last("limit 1"));
if (Objects.isNull(model)) {
@@ -78,7 +78,7 @@ public class PrequalificationDeclaredProjectManage {
params.setUser(dto.getUser());
params.setProcessUsers(Collections.emptyMap());
//放入条件判断的项目字段
- ProjectConditionDto conditionDto = new ProjectConditionDto();
+ ProjectConditionDTO conditionDto = new ProjectConditionDTO();
BeanUtils.copyProperties(projectInfo, conditionDto);
if (Objects.nonNull(conditionDto)) {
dto.getFormData().putAll(
diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java
index 264d154..51971af 100644
--- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java
+++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java
@@ -40,6 +40,7 @@ public class ProjectHelper {
query.le(req.getApproveAmountMax() != null, Project::getApprovalAmount, req.getApproveAmountMax());
query.like(req.getBuildOrg() != null, Project::getBuildOrgName, req.getBuildOrg());
+ query.eq(req.getIsTemporaryAugment() != null, Project::getIsTemporaryAugment, req.getIsTemporaryAugment());
return query;
}
diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectListReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectListReq.java
index 398cf86..aeac65c 100644
--- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectListReq.java
+++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectListReq.java
@@ -66,4 +66,8 @@ public class ProjectListReq extends PagePo {
@ApiModelProperty("用户ID")
private Long userId;
+
+ @ApiModelProperty("是否临时增补 0:否 1:是")
+ private Integer isTemporaryAugment;
+
}
diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/contants/TaskContant.java b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/contants/TaskContant.java
index 7f689f9..e303c10 100644
--- a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/contants/TaskContant.java
+++ b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/contants/TaskContant.java
@@ -1,5 +1,7 @@
package com.ningdatech.pmapi.scheduler.contants;
+import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum;
+
/**
* @author PoffyZhang
* @Classname TaskContant
@@ -19,5 +21,11 @@ public interface TaskContant {
public static final String DEFAULT_FORM_NAME = "丽水申报项目表单";
public static final String[] DEFAULT_PROCESS_LIST = {"单位内部审批流程","项目预审审批流程","部门联合审批流程","建设方案审批流程","验收申报审批流程"};
+
+ public static final Integer[] DEFAULT_PROCESS_TYPE_LIST = {ProjectProcessStageEnum.ORG_INTERNAL_APPROVAL_PROCESS.getCode(),
+ ProjectProcessStageEnum.PROJECT_PREQUALIFICATION_APPROVAL_PROCESS.getCode(),
+ ProjectProcessStageEnum.DEPARTMENT_JOINT_APPROVAL_PROCESS.getCode(),
+ ProjectProcessStageEnum.CONSTRUCTION_PROJECT_APPROVAL_PROCESS.getCode(),
+ ProjectProcessStageEnum.ACCEPTANCE_DECLARATION_APPROVAL_PROCESS.getCode()};
}
}
diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/InitProcessTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/InitProcessTask.java
index 08b54d3..9279584 100644
--- a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/InitProcessTask.java
+++ b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/InitProcessTask.java
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.StopWatch;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.exception.BizException;
+import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum;
import com.ningdatech.pmapi.scheduler.contants.TaskContant;
import com.ningdatech.pmapi.sys.contant.RegionConst;
import com.ningdatech.pmapi.sys.model.entity.Region;
@@ -96,15 +97,17 @@ public class InitProcessTask {
// continue;
// }
- String[] processList = TaskContant.Wflow.DEFAULT_PROCESS_LIST;
- for(String processName : processList){
+ Integer[] processTypeList = TaskContant.Wflow.DEFAULT_PROCESS_TYPE_LIST;
+ for(Integer processType : processTypeList){
+ String formName = ProjectProcessStageEnum.getDesc(processType);
WflowModelHistorysDto models = new WflowModelHistorysDto();
models.setCreated(GregorianCalendar.getInstance().getTime());
// models.setFormId("wf" + IdUtil.objectId());
models.setVersion(1);
models.setGroupId(1);
// models.setProcessDefId("pd" + IdUtil.objectId());
- models.setFormName(processName);
+ models.setFormName(formName);
+ models.setProcessType(processType);
models.setRegionCode(region.getRegionCode());
ProcessNode processNode = new ProcessNode();
models.setProcess(processNode);
@@ -114,12 +117,12 @@ public class InitProcessTask {
if(StringUtils.isNotBlank(processModelService.saveProcess(models))){
//初始的流程在部署表也存一份,用来查询
if(StringUtils.isNotBlank(processModelService.deployProcess(models.getFormId()))){
- log.info("当前区域 【{}】 流程名[{}] 流程数据已经保存成功",region.getName(),processName);
+ log.info("当前区域 【{}】 流程名[{}] 流程数据已经保存成功",region.getName(),formName);
}else{
- log.info("当前区域 【{}】 流程名[{}] 流程数据保存失败",region.getName(),processName);
+ log.info("当前区域 【{}】 流程名[{}] 流程数据保存失败",region.getName(),formName);
}
}else{
- log.info("当前区域 【{}】流程名[{}] 流程数据保存失败",region.getName(),processName);
+ log.info("当前区域 【{}】流程名[{}] 流程数据保存失败",region.getName(),formName);
}
}
}
diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/NdUserInfoController.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/NdUserInfoController.java
index 1ac0332..2e29add 100644
--- a/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/NdUserInfoController.java
+++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/NdUserInfoController.java
@@ -1,13 +1,12 @@
package com.ningdatech.pmapi.user.controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-
import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
/**
*
- * 前端控制器
+ * 前端控制器
*
*
* @author Lierbao
@@ -17,4 +16,5 @@ import org.springframework.stereotype.Controller;
@RequestMapping("/pmapi.user/nd-user-info")
public class NdUserInfoController {
+
}
diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserAuthController.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserAuthController.java
index 233a7a5..efbb287 100644
--- a/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserAuthController.java
+++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserAuthController.java
@@ -1,9 +1,23 @@
package com.ningdatech.pmapi.user.controller;
-import org.springframework.web.bind.annotation.RequestMapping;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.ningdatech.basic.util.StrPool;
+import com.ningdatech.pmapi.common.constant.BizConst;
+import com.ningdatech.pmapi.user.security.auth.constants.SessionTimeConstant;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.*;
-import org.springframework.stereotype.Controller;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
/**
*
@@ -13,8 +27,55 @@ import org.springframework.stereotype.Controller;
* @author Liuxinxin
* @since 2023-01-04
*/
-@Controller
-@RequestMapping("/pmapi.user/user-auth")
+
+@RestController
+@RequestMapping("/api/v1/user/auth")
+@Api(tags = {"用户鉴权-相关接口"})
+@RequiredArgsConstructor
public class UserAuthController {
+ private final ObjectMapper objectMapper;
+
+ @PostMapping(value = "/login/password", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
+ @ApiOperation(value = "账号密码的登陆方式")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "username", value = "用户名", required = true, paramType = "form", dataType = "String"),
+ @ApiImplicitParam(name = "password", value = "密码", required = true, paramType = "form", dataType = "String")})
+ public void loginByUsernameAndPassword(@RequestParam("username") String username,
+ @RequestParam("password") String password) {
+ // 不实现任何内容,只是为了出api文档
+ }
+
+ @PostMapping(value = "/logout")
+ @ApiOperation(value = "退出登陆")
+ public void logout() {
+ // 不实现任何内容,具体实现交由Spring Security进行管理
+ }
+
+ /**
+ * 当需要身份认证时,跳转到这里
+ */
+ @GetMapping("/auth-require")
+ @CrossOrigin(originPatterns = "*", allowCredentials = "true", maxAge = 3600)
+ public void requireAuthentication(HttpServletResponse response) throws IOException {
+ response.setContentType(StrPool.CONTENT_TYPE);
+ response.setStatus(HttpStatus.UNAUTHORIZED.value());
+ response.getWriter().write(objectMapper.writeValueAsString(BizConst.UNAUTHENTICATED));
+ }
+
+ /**
+ * 设置session失效
+ */
+ @GetMapping("/invalid-session")
+ @CrossOrigin(originPatterns = "*", allowCredentials = "true", maxAge = 3600)
+ public void invalidSession(HttpServletRequest request, HttpServletResponse response) throws IOException {
+ response.setContentType(StrPool.CONTENT_TYPE);
+ Cookie cookie = new Cookie(BizConst.COOKIE_KEY, null);
+ cookie.setPath(request.getContextPath() + "/");
+ cookie.setMaxAge(SessionTimeConstant.SESSION_TIME_SECONDS);
+ response.addCookie(cookie);
+ response.setStatus(HttpStatus.UNAUTHORIZED.value());
+ response.getWriter().write(objectMapper.writeValueAsString(BizConst.UNAUTHENTICATED));
+ }
+
}
diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java
index d178e0d..8e2ae4c 100644
--- a/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java
+++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java
@@ -1,9 +1,21 @@
package com.ningdatech.pmapi.user.controller;
+import com.ningdatech.basic.model.PageVo;
+import com.ningdatech.pmapi.user.manage.UserInfoManage;
+import com.ningdatech.pmapi.user.model.po.ReqUserDisablePO;
+import com.ningdatech.pmapi.user.model.po.ReqUserInfoListPO;
+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;
+import javax.validation.Valid;
+
/**
*
* 用户信息表 前端控制器
@@ -13,7 +25,23 @@ import org.springframework.web.bind.annotation.RequestMapping;
* @since 2023-01-04
*/
@Controller
-@RequestMapping("/pmapi.user/user-info")
+@RequestMapping("/api/v1/user-info")
+@RequiredArgsConstructor
+@Api(value = "UserInfoController", tags = "用户管理")
public class UserInfoController {
+ private final UserInfoManage userInfoManage;
+
+ @ApiOperation(value = "用户列表搜索", notes = "用户列表搜索")
+ @PostMapping("/list")
+ public PageVo userInfoList(@Valid @RequestBody ReqUserInfoListPO reqUserInfoListPO) {
+ return userInfoManage.list(reqUserInfoListPO);
+ }
+
+ @ApiOperation(value = "用户禁用", notes = "用户禁用")
+ @PostMapping("/disable")
+ public void disable(@Valid @RequestBody ReqUserDisablePO reqUserDisablePO){
+ userInfoManage.disable(reqUserDisablePO);
+ }
+
}
diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java
index 93ea820..d2e5cd2 100644
--- a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java
+++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java
@@ -18,7 +18,13 @@ public class UserAuthLoginManage {
private final IUserAuthService iUserAuthService;
private final IUserInfoService iUserInfoService;
- public UserFullInfoDTO queryUserInfoInPasswordAuth(String username){
- return null;
+ public UserFullInfoDTO queryUserInfoInPasswordAuth(String username) {
+ UserFullInfoDTO userFullInfoDTO = new UserFullInfoDTO();
+ userFullInfoDTO.setCompanyId(1L);
+ userFullInfoDTO.setUserId(1L);
+ userFullInfoDTO.setIdentifier("123456");
+ userFullInfoDTO.setRealName("测试账号");
+ userFullInfoDTO.setUsername("测试账号");
+ return userFullInfoDTO;
}
}
diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java
new file mode 100644
index 0000000..39d3812
--- /dev/null
+++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java
@@ -0,0 +1,29 @@
+package com.ningdatech.pmapi.user.manage;
+
+import com.ningdatech.basic.model.PageVo;
+import com.ningdatech.pmapi.user.mapper.UserInfoMapper;
+import com.ningdatech.pmapi.user.model.po.ReqUserDisablePO;
+import com.ningdatech.pmapi.user.model.po.ReqUserInfoListPO;
+import com.ningdatech.pmapi.user.model.vo.ResUserInfoListVO;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author liuxinxin
+ * @date 2023/2/13 上午9:09
+ */
+@Component
+@RequiredArgsConstructor
+public class UserInfoManage {
+ private final UserInfoMapper userInfoMapper;
+
+
+ public PageVo list(ReqUserInfoListPO reqUserInfoListPO) {
+
+ return null;
+ }
+
+ public void disable(ReqUserDisablePO reqUserDisablePO) {
+
+ }
+}
diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/model/po/ReqUserDisablePO.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/model/po/ReqUserDisablePO.java
new file mode 100644
index 0000000..2f712df
--- /dev/null
+++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/model/po/ReqUserDisablePO.java
@@ -0,0 +1,22 @@
+package com.ningdatech.pmapi.user.model.po;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @author liuxinxin
+ * @date 2023/2/13 上午9:31
+ */
+
+@Data
+@ApiModel("用户禁用PO")
+public class ReqUserDisablePO {
+
+ @NotBlank(message = "用户ID不能为空")
+ @ApiModelProperty("用户id")
+ private Long userId;
+
+}
diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/model/po/ReqUserInfoListPO.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/model/po/ReqUserInfoListPO.java
new file mode 100644
index 0000000..9706f1e
--- /dev/null
+++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/model/po/ReqUserInfoListPO.java
@@ -0,0 +1,37 @@
+package com.ningdatech.pmapi.user.model.po;
+
+import com.ningdatech.basic.model.PagePo;
+import com.ningdatech.pmapi.sys.model.entity.Role;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author liuxinxin
+ * @date 2023/2/13 上午9:10
+ */
+@Data
+@ApiModel("用户管理查询 请求入参")
+public class ReqUserInfoListPO extends PagePo {
+
+ @ApiModelProperty("姓名")
+ private String name;
+
+ @ApiModelProperty("手机号码")
+ private String phoneNo;
+
+ @ApiModelProperty("所在单位(主职)")
+ private String orgName;
+
+ @ApiModelProperty("所属区域")
+ private Long regionId;
+
+ @ApiModelProperty("用户角色")
+ private List userRoleList;
+
+ @ApiModelProperty("状态")
+ private String status;
+
+}
diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserInfoListVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserInfoListVO.java
new file mode 100644
index 0000000..3e61983
--- /dev/null
+++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserInfoListVO.java
@@ -0,0 +1,47 @@
+package com.ningdatech.pmapi.user.model.vo;
+
+import com.ningdatech.pmapi.sys.model.entity.Role;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+/**
+ * @author liuxinxin
+ * @date 2023/2/13 上午9:10
+ */
+@Data
+@ApiModel("用户管理查询 请求response")
+public class ResUserInfoListVO {
+
+ @ApiModelProperty("用户id")
+ private Long userId;
+
+ @ApiModelProperty("姓名")
+ private String name;
+
+ @ApiModelProperty("手机号码")
+ private String phoneNo;
+
+ @ApiModelProperty("所在单位(主职)")
+ private String orgName;
+
+ @ApiModelProperty("所在单位(主职)id")
+ private Long orgId;
+
+ @ApiModelProperty("所属区域")
+ private Long regionId;
+
+ @ApiModelProperty("用户角色")
+ private List userRoleList;
+
+ @ApiModelProperty("状态")
+ private String status;
+
+ @ApiModelProperty("更新时间")
+ private LocalDateTime updateTime;
+
+
+}
diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java
index 868fbff..53b8efc 100644
--- a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java
+++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java
@@ -4,10 +4,12 @@ import cn.hutool.core.collection.CollectionUtil;
import com.ningdatech.basic.auth.AbstractLoginUser;
import lombok.Data;
import lombok.EqualsAndHashCode;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -41,8 +43,11 @@ public class UserInfoDetails extends AbstractLoginUser implements UserDetails {
*/
@Override
public Collection extends GrantedAuthority> getAuthorities() {
- SimpleGrantedAuthority simpleGrantedAuthority = new SimpleGrantedAuthority(this.role);
- return CollectionUtil.toList(simpleGrantedAuthority);
+ if (StringUtils.isNotBlank(role)) {
+ SimpleGrantedAuthority simpleGrantedAuthority = new SimpleGrantedAuthority(this.role);
+ return CollectionUtil.toList(simpleGrantedAuthority);
+ }
+ return new ArrayList<>();
}
@Override
diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/password/UsernamePasswordAuthProvider.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/password/UsernamePasswordAuthProvider.java
index 8c7adae..f586d5b 100644
--- a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/password/UsernamePasswordAuthProvider.java
+++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/password/UsernamePasswordAuthProvider.java
@@ -31,7 +31,8 @@ public class UsernamePasswordAuthProvider implements AuthenticationProvider {
if (user == null) {
throw new InternalAuthenticationServiceException("can not get user info!");
}
- additionalAuthenticationChecks(user, authenticationToken);
+ // TODO 开发使用暂时关闭账号密码验证
+// additionalAuthenticationChecks(user, authenticationToken);
// 校验用户是否有当前端的登陆权限
// 将用户定义的user放入token中,这样可以在session中查询到所有自定义的用户信息
return new UsernamePasswordAuthToken(user, user.getPassword(), user.getAuthorities());