diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/ProjectProessStageEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/ProjectProcessStageEnum.java similarity index 58% rename from pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/ProjectProessStageEnum.java rename to pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/ProjectProcessStageEnum.java index 99cc654..bcc0cce 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/ProjectProessStageEnum.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/ProjectProcessStageEnum.java @@ -3,11 +3,14 @@ package com.ningdatech.pmapi.common.enumeration; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; +import org.apache.commons.lang3.StringUtils; + +import java.util.Objects; @Getter @AllArgsConstructor @NoArgsConstructor -public enum ProjectProessStageEnum { +public enum ProjectProcessStageEnum { /** * 项目流程配置 阶段枚举 */ @@ -19,4 +22,16 @@ public enum ProjectProessStageEnum { private Integer code; private String desc; + + public static String getDesc(Integer code) { + if (Objects.isNull(code)) { + return StringUtils.EMPTY; + } + for (ProjectProcessStageEnum t : ProjectProcessStageEnum.values()) { + if (code.equals(t.getCode())) { + return t.desc; + } + } + return StringUtils.EMPTY; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java index ab797aa..b5b3f89 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java @@ -66,7 +66,6 @@ public class EmployeeBatchGetTask { } - } // zwddClient.pageOrganizationEmployeePositions(query); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/fiscal/controller/CompanyFiscalCodeController.java b/pmapi/src/main/java/com/ningdatech/pmapi/fiscal/controller/CompanyFiscalCodeController.java index 3d2f987..f7847d8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/fiscal/controller/CompanyFiscalCodeController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/fiscal/controller/CompanyFiscalCodeController.java @@ -33,5 +33,4 @@ public class CompanyFiscalCodeController { companyFiscalCodeManage.fiscalCodeConfigure(reqCompanyFiscalCodeAndSealSnPO); } - } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java index 12973e6..2ce1a10 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java @@ -1,13 +1,14 @@ package com.ningdatech.pmapi.organization.controller; -import org.springframework.web.bind.annotation.RequestMapping; - +import io.swagger.annotations.ApiModelProperty; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; /** *

- * 前端控制器 + * 前端控制器 *

* * @author Lierbao @@ -17,4 +18,10 @@ import org.springframework.stereotype.Controller; @RequestMapping("/api/v1/organization") public class DingOrganizationController { + @ApiModelProperty("单位成员配置") + @PostMapping("/member/config") + public void organizationManage() { + + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java index c64adaf..d076821 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java @@ -1,7 +1,7 @@ package com.ningdatech.pmapi.projectdeclared.controller; import com.ningdatech.basic.model.PageVo; -import com.ningdatech.pmapi.projectdeclared.entity.dto.ConstructionPlanDto; +import com.ningdatech.pmapi.projectdeclared.entity.dto.ConstructionPlanDTO; import com.ningdatech.pmapi.projectdeclared.manage.ConstructionPlanManage; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; @@ -43,7 +43,7 @@ public class ConstructionPlanController { @ApiOperation(value = "建设方案申报", notes = "建设方案申报") @PostMapping("/start") - public String startTheProcess(@Validated @RequestBody ConstructionPlanDto dto) { + public String startTheProcess(@Validated @RequestBody ConstructionPlanDTO dto) { String instanceId = constructionPlanManage.startTheProcess(dto); return "建设方案申报 【" + instanceId + "】 成功"; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DeclaredProjectController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DeclaredProjectController.java index 67bfd0a..4c269a7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DeclaredProjectController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DeclaredProjectController.java @@ -1,10 +1,10 @@ package com.ningdatech.pmapi.projectdeclared.controller; import com.ningdatech.basic.model.PageVo; -import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectDto; -import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectListParamDto; -import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectDraftSaveDto; -import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDraftVo; +import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectDTO; +import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectListParamDTO; +import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectDraftSaveDTO; +import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDraftVO; import com.ningdatech.pmapi.projectdeclared.manage.DeclaredProjectManage; import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; @@ -41,25 +41,25 @@ public class DeclaredProjectController { @ApiOperation(value = "申报项目草稿箱列表", notes = "申报项目草稿箱列表") @GetMapping("/draft") - public PageVo draft(@ModelAttribute DeclaredProjectListParamDto params) { + public PageVo draft(@ModelAttribute DeclaredProjectListParamDTO params) { return declaredProjectManage.pageDraft(params); } @ApiOperation(value = "申报项目草稿箱详情", notes = "申报项目草稿箱详情") @GetMapping("/draft/{id}") - public ProjectDraftVo draft(@PathVariable Long id) { + public ProjectDraftVO draft(@PathVariable Long id) { return declaredProjectManage.draftDatail(id); } @ApiOperation(value = "申报项目保存至草稿箱", notes = "申报项目保存至草稿箱") @PostMapping("/save-to-draft") - public Object saveToDraft(@Validated @RequestBody ProjectDraftSaveDto dto) { + public Object saveToDraft(@Validated @RequestBody ProjectDraftSaveDTO dto) { return declaredProjectManage.saveToDraft(dto); } @ApiOperation(value = "申报项目", notes = "申报项目") @PostMapping("/start") - public String startTheProcess(@Validated @RequestBody DeclaredProjectDto dto) { + public String startTheProcess(@Validated @RequestBody DeclaredProjectDTO dto) { String instanceId = declaredProjectManage.startTheProcess(dto); return "启动流程实例 【" + instanceId + "】 成功"; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/PrequalificationDeclaredController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/PrequalificationDeclaredController.java index c05225f..e31be9a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/PrequalificationDeclaredController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/PrequalificationDeclaredController.java @@ -1,7 +1,7 @@ package com.ningdatech.pmapi.projectdeclared.controller; import com.ningdatech.basic.model.PageVo; -import com.ningdatech.pmapi.projectdeclared.entity.dto.PreDeclaredProjectDto; +import com.ningdatech.pmapi.projectdeclared.entity.dto.PreDeclaredProjectDTO; import com.ningdatech.pmapi.projectdeclared.manage.PrequalificationDeclaredProjectManage; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; @@ -43,7 +43,7 @@ public class PrequalificationDeclaredController { @ApiOperation(value = "申报预审", notes = "申报预审") @PostMapping("/start") - public String startTheProcess(@Validated @RequestBody PreDeclaredProjectDto dto) { + public String startTheProcess(@Validated @RequestBody PreDeclaredProjectDTO dto) { String instanceId = prequalificationDeclaredProjectManage.startTheProcess(dto); return "提交预审 【" + instanceId + "】 成功"; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ConstructionPlanDto.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ConstructionPlanDTO.java similarity index 94% rename from pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ConstructionPlanDto.java rename to pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ConstructionPlanDTO.java index 86ba27c..f9630b8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ConstructionPlanDto.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ConstructionPlanDTO.java @@ -22,7 +22,7 @@ import java.util.Map; @Builder @NoArgsConstructor @AllArgsConstructor -public class ConstructionPlanDto implements Serializable { +public class ConstructionPlanDTO implements Serializable { @NotNull private Long projectId; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDto.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDTO.java similarity index 94% rename from pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDto.java rename to pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDTO.java index f88bd05..233b5d4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDto.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDTO.java @@ -23,7 +23,7 @@ import java.util.Map; @Builder @NoArgsConstructor @AllArgsConstructor -public class DeclaredProjectDto implements Serializable { +public class DeclaredProjectDTO implements Serializable { @NotNull private ProjectDTO projectInfo; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectListParamDto.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectListParamDTO.java similarity index 93% rename from pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectListParamDto.java rename to pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectListParamDTO.java index 32b1868..6f4b327 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectListParamDto.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectListParamDTO.java @@ -17,7 +17,7 @@ import org.springframework.format.annotation.DateTimeFormat; @Builder @NoArgsConstructor @AllArgsConstructor -public class DeclaredProjectListParamDto extends PagePo { +public class DeclaredProjectListParamDTO extends PagePo { private String userId; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/PreDeclaredProjectDto.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/PreDeclaredProjectDTO.java similarity index 93% rename from pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/PreDeclaredProjectDto.java rename to pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/PreDeclaredProjectDTO.java index 92d2e62..e6ae09e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/PreDeclaredProjectDto.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/PreDeclaredProjectDTO.java @@ -22,7 +22,7 @@ import java.util.Map; @Builder @NoArgsConstructor @AllArgsConstructor -public class PreDeclaredProjectDto implements Serializable { +public class PreDeclaredProjectDTO implements Serializable { @NotNull private Long projectId; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectConditionDto.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectConditionDTO.java similarity index 92% rename from pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectConditionDto.java rename to pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectConditionDTO.java index 4e60030..b74c2a0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectConditionDto.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectConditionDTO.java @@ -18,7 +18,7 @@ import java.math.BigDecimal; @Builder @NoArgsConstructor @AllArgsConstructor -public class ProjectConditionDto implements Serializable { +public class ProjectConditionDTO implements Serializable { private Long projectId; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectDraftSaveDto.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectDraftSaveDTO.java similarity index 91% rename from pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectDraftSaveDto.java rename to pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectDraftSaveDTO.java index 62070a3..78ab8f3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectDraftSaveDto.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectDraftSaveDTO.java @@ -21,7 +21,7 @@ import java.io.Serializable; @NoArgsConstructor @AllArgsConstructor @ToString -public class ProjectDraftSaveDto implements Serializable { +public class ProjectDraftSaveDTO implements Serializable { private static final long serialVersionUID = 1L; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDraftVo.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDraftVO.java similarity index 99% rename from pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDraftVo.java rename to pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDraftVO.java index 5cb5c4e..a822fd0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDraftVo.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDraftVO.java @@ -29,7 +29,7 @@ import java.util.Map; @Builder @NoArgsConstructor @AllArgsConstructor -public class ProjectDraftVo implements Serializable { +public class ProjectDraftVO implements Serializable { private static final long serialVersionUID = 1L; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java index ae1c659..2d69514 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.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.ConstructionPlanDto; -import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectConditionDto; +import com.ningdatech.pmapi.projectdeclared.entity.dto.ConstructionPlanDTO; +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; @@ -50,7 +50,7 @@ public class ConstructionPlanManage { * @param dto * @return */ - public String startTheProcess(ConstructionPlanDto dto) { + public String startTheProcess(ConstructionPlanDTO dto) { Project projectInfo = projectService.getById(dto.getProjectId()); VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); @@ -59,7 +59,7 @@ public class ConstructionPlanManage { WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) .eq(WflowModels::getRegionCode, regionCode) - .eq(WflowModels::getFormName, ProjectProessStageEnum.CONSTRUCTION_PROJECT_APPROVAL_PROCESS.getDesc()) + .eq(WflowModels::getProcessType, ProjectProcessStageEnum.CONSTRUCTION_PROJECT_APPROVAL_PROCESS.getCode()) .last("limit 1")); if (Objects.isNull(model)) { @@ -77,14 +77,12 @@ public class ConstructionPlanManage { 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( - JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference>() { - }) - ); - } + dto.getFormData().putAll( + JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference>() { + }) + ); params.setFormData(dto.getFormData()); String instanceId = processService.startProcess(model.getProcessDefId(), params); log.info("建设方案项目申报成功 【{}】", instanceId); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java index 5da452f..14de447 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java @@ -2,26 +2,23 @@ package com.ningdatech.pmapi.projectdeclared.manage; import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.TypeReference; 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.common.enumeration.ProjectProessStageEnum; +import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; import com.ningdatech.pmapi.projectdeclared.entity.ProjectDraft; -import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectDto; -import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectListParamDto; -import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectConditionDto; -import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectDraftSaveDto; -import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDeclaredDetailVO; -import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDraftVo; +import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectDTO; +import com.ningdatech.pmapi.projectdeclared.entity.dto.DeclaredProjectListParamDTO; +import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectConditionDTO; +import com.ningdatech.pmapi.projectdeclared.entity.dto.ProjectDraftSaveDTO; +import com.ningdatech.pmapi.projectdeclared.entity.vo.ProjectDraftVO; import com.ningdatech.pmapi.projectdeclared.service.IProjectDraftService; import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; -import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; import com.ningdatech.pmapi.projectlib.service.IProjectService; import com.wflow.bean.entity.WflowModels; @@ -63,30 +60,7 @@ public class DeclaredProjectManage { private final ProcessModelService processModelService; - public PageVo page(DeclaredProjectListParamDto params) { - Page page = params.page(); - LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(Project.class) - .ge(Objects.nonNull(params.getStartTime()), Project::getCreateOn, params.getStartTime()) - .le(Objects.nonNull(params.getEndTime()), Project::getCreateOn, params.getEndTime()) - .eq(Objects.nonNull(params.getProjectType()), Project::getProjectType, params.getProjectType()) - .eq(Objects.nonNull(params.getProjectYear()), Project::getProjectYear, params.getProjectYear()) - .eq(Objects.nonNull(params.getProjectStage()), Project::getStage, params.getProjectStage()) - .eq(Objects.nonNull(params.getProjectStatus()), Project::getStatus, params.getProjectStatus()) - .like(StringUtils.isNotBlank(params.getProjectName()), Project::getProjectName, params.getProjectName()) - .orderByDesc(Project::getUpdateOn); - projectService.page(page, wrapper); - if (0L == page.getTotal()) { - return PageVo.empty(); - } - List res = page.getRecords().stream().map(record -> { - ProjectLibListItemVO vo = new ProjectLibListItemVO(); - BeanUtils.copyProperties(record, vo); - return vo; - }).collect(Collectors.toList()); - return PageVo.of(res, page.getTotal()); - } - - public PageVo pageDraft(DeclaredProjectListParamDto params) { + public PageVo pageDraft(DeclaredProjectListParamDTO params) { Page page = params.page(); LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(ProjectDraft.class) .eq(ProjectDraft::getUserId,params.getUserId()) @@ -102,17 +76,17 @@ public class DeclaredProjectManage { if (0L == page.getTotal()) { return PageVo.empty(); } - List res = page.getRecords().stream().map(record -> { - ProjectDraftVo vo = new ProjectDraftVo(); + List 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 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());