@@ -3,11 +3,14 @@ package com.ningdatech.pmapi.common.enumeration; | |||||
import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||
import lombok.Getter; | import lombok.Getter; | ||||
import lombok.NoArgsConstructor; | import lombok.NoArgsConstructor; | ||||
import org.apache.commons.lang3.StringUtils; | |||||
import java.util.Objects; | |||||
@Getter | @Getter | ||||
@AllArgsConstructor | @AllArgsConstructor | ||||
@NoArgsConstructor | @NoArgsConstructor | ||||
public enum ProjectProessStageEnum { | |||||
public enum ProjectProcessStageEnum { | |||||
/** | /** | ||||
* 项目流程配置 阶段枚举 | * 项目流程配置 阶段枚举 | ||||
*/ | */ | ||||
@@ -19,4 +22,16 @@ public enum ProjectProessStageEnum { | |||||
private Integer code; | private Integer code; | ||||
private String desc; | 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; | |||||
} | |||||
} | } |
@@ -66,7 +66,6 @@ public class EmployeeBatchGetTask { | |||||
} | } | ||||
} | } | ||||
// zwddClient.pageOrganizationEmployeePositions(query); | // zwddClient.pageOrganizationEmployeePositions(query); | ||||
@@ -33,5 +33,4 @@ public class CompanyFiscalCodeController { | |||||
companyFiscalCodeManage.fiscalCodeConfigure(reqCompanyFiscalCodeAndSealSnPO); | companyFiscalCodeManage.fiscalCodeConfigure(reqCompanyFiscalCodeAndSealSnPO); | ||||
} | } | ||||
} | } |
@@ -1,13 +1,14 @@ | |||||
package com.ningdatech.pmapi.organization.controller; | 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.stereotype.Controller; | ||||
import org.springframework.web.bind.annotation.PostMapping; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
* 前端控制器 | |||||
* 前端控制器 | |||||
* </p> | * </p> | ||||
* | * | ||||
* @author Lierbao | * @author Lierbao | ||||
@@ -17,4 +18,10 @@ import org.springframework.stereotype.Controller; | |||||
@RequestMapping("/api/v1/organization") | @RequestMapping("/api/v1/organization") | ||||
public class DingOrganizationController { | public class DingOrganizationController { | ||||
@ApiModelProperty("单位成员配置") | |||||
@PostMapping("/member/config") | |||||
public void organizationManage() { | |||||
} | |||||
} | } |
@@ -1,7 +1,7 @@ | |||||
package com.ningdatech.pmapi.projectdeclared.controller; | package com.ningdatech.pmapi.projectdeclared.controller; | ||||
import com.ningdatech.basic.model.PageVo; | 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.projectdeclared.manage.ConstructionPlanManage; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; | import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; | ||||
@@ -43,7 +43,7 @@ public class ConstructionPlanController { | |||||
@ApiOperation(value = "建设方案申报", notes = "建设方案申报") | @ApiOperation(value = "建设方案申报", notes = "建设方案申报") | ||||
@PostMapping("/start") | @PostMapping("/start") | ||||
public String startTheProcess(@Validated @RequestBody ConstructionPlanDto dto) { | |||||
public String startTheProcess(@Validated @RequestBody ConstructionPlanDTO dto) { | |||||
String instanceId = constructionPlanManage.startTheProcess(dto); | String instanceId = constructionPlanManage.startTheProcess(dto); | ||||
return "建设方案申报 【" + instanceId + "】 成功"; | return "建设方案申报 【" + instanceId + "】 成功"; | ||||
} | } | ||||
@@ -1,10 +1,10 @@ | |||||
package com.ningdatech.pmapi.projectdeclared.controller; | package com.ningdatech.pmapi.projectdeclared.controller; | ||||
import com.ningdatech.basic.model.PageVo; | 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.projectdeclared.manage.DeclaredProjectManage; | ||||
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; | import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; | ||||
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; | ||||
@@ -41,25 +41,25 @@ public class DeclaredProjectController { | |||||
@ApiOperation(value = "申报项目草稿箱列表", notes = "申报项目草稿箱列表") | @ApiOperation(value = "申报项目草稿箱列表", notes = "申报项目草稿箱列表") | ||||
@GetMapping("/draft") | @GetMapping("/draft") | ||||
public PageVo<ProjectDraftVo> draft(@ModelAttribute DeclaredProjectListParamDto params) { | |||||
public PageVo<ProjectDraftVO> draft(@ModelAttribute DeclaredProjectListParamDTO params) { | |||||
return declaredProjectManage.pageDraft(params); | return declaredProjectManage.pageDraft(params); | ||||
} | } | ||||
@ApiOperation(value = "申报项目草稿箱详情", notes = "申报项目草稿箱详情") | @ApiOperation(value = "申报项目草稿箱详情", notes = "申报项目草稿箱详情") | ||||
@GetMapping("/draft/{id}") | @GetMapping("/draft/{id}") | ||||
public ProjectDraftVo draft(@PathVariable Long id) { | |||||
public ProjectDraftVO draft(@PathVariable Long id) { | |||||
return declaredProjectManage.draftDatail(id); | return declaredProjectManage.draftDatail(id); | ||||
} | } | ||||
@ApiOperation(value = "申报项目保存至草稿箱", notes = "申报项目保存至草稿箱") | @ApiOperation(value = "申报项目保存至草稿箱", notes = "申报项目保存至草稿箱") | ||||
@PostMapping("/save-to-draft") | @PostMapping("/save-to-draft") | ||||
public Object saveToDraft(@Validated @RequestBody ProjectDraftSaveDto dto) { | |||||
public Object saveToDraft(@Validated @RequestBody ProjectDraftSaveDTO dto) { | |||||
return declaredProjectManage.saveToDraft(dto); | return declaredProjectManage.saveToDraft(dto); | ||||
} | } | ||||
@ApiOperation(value = "申报项目", notes = "申报项目") | @ApiOperation(value = "申报项目", notes = "申报项目") | ||||
@PostMapping("/start") | @PostMapping("/start") | ||||
public String startTheProcess(@Validated @RequestBody DeclaredProjectDto dto) { | |||||
public String startTheProcess(@Validated @RequestBody DeclaredProjectDTO dto) { | |||||
String instanceId = declaredProjectManage.startTheProcess(dto); | String instanceId = declaredProjectManage.startTheProcess(dto); | ||||
return "启动流程实例 【" + instanceId + "】 成功"; | return "启动流程实例 【" + instanceId + "】 成功"; | ||||
} | } | ||||
@@ -1,7 +1,7 @@ | |||||
package com.ningdatech.pmapi.projectdeclared.controller; | package com.ningdatech.pmapi.projectdeclared.controller; | ||||
import com.ningdatech.basic.model.PageVo; | 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.projectdeclared.manage.PrequalificationDeclaredProjectManage; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; | import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage; | ||||
@@ -43,7 +43,7 @@ public class PrequalificationDeclaredController { | |||||
@ApiOperation(value = "申报预审", notes = "申报预审") | @ApiOperation(value = "申报预审", notes = "申报预审") | ||||
@PostMapping("/start") | @PostMapping("/start") | ||||
public String startTheProcess(@Validated @RequestBody PreDeclaredProjectDto dto) { | |||||
public String startTheProcess(@Validated @RequestBody PreDeclaredProjectDTO dto) { | |||||
String instanceId = prequalificationDeclaredProjectManage.startTheProcess(dto); | String instanceId = prequalificationDeclaredProjectManage.startTheProcess(dto); | ||||
return "提交预审 【" + instanceId + "】 成功"; | return "提交预审 【" + instanceId + "】 成功"; | ||||
} | } | ||||
@@ -22,7 +22,7 @@ import java.util.Map; | |||||
@Builder | @Builder | ||||
@NoArgsConstructor | @NoArgsConstructor | ||||
@AllArgsConstructor | @AllArgsConstructor | ||||
public class ConstructionPlanDto implements Serializable { | |||||
public class ConstructionPlanDTO implements Serializable { | |||||
@NotNull | @NotNull | ||||
private Long projectId; | private Long projectId; |
@@ -23,7 +23,7 @@ import java.util.Map; | |||||
@Builder | @Builder | ||||
@NoArgsConstructor | @NoArgsConstructor | ||||
@AllArgsConstructor | @AllArgsConstructor | ||||
public class DeclaredProjectDto implements Serializable { | |||||
public class DeclaredProjectDTO implements Serializable { | |||||
@NotNull | @NotNull | ||||
private ProjectDTO projectInfo; | private ProjectDTO projectInfo; |
@@ -17,7 +17,7 @@ import org.springframework.format.annotation.DateTimeFormat; | |||||
@Builder | @Builder | ||||
@NoArgsConstructor | @NoArgsConstructor | ||||
@AllArgsConstructor | @AllArgsConstructor | ||||
public class DeclaredProjectListParamDto extends PagePo { | |||||
public class DeclaredProjectListParamDTO extends PagePo { | |||||
private String userId; | private String userId; | ||||
@@ -22,7 +22,7 @@ import java.util.Map; | |||||
@Builder | @Builder | ||||
@NoArgsConstructor | @NoArgsConstructor | ||||
@AllArgsConstructor | @AllArgsConstructor | ||||
public class PreDeclaredProjectDto implements Serializable { | |||||
public class PreDeclaredProjectDTO implements Serializable { | |||||
@NotNull | @NotNull | ||||
private Long projectId; | private Long projectId; |
@@ -18,7 +18,7 @@ import java.math.BigDecimal; | |||||
@Builder | @Builder | ||||
@NoArgsConstructor | @NoArgsConstructor | ||||
@AllArgsConstructor | @AllArgsConstructor | ||||
public class ProjectConditionDto implements Serializable { | |||||
public class ProjectConditionDTO implements Serializable { | |||||
private Long projectId; | private Long projectId; | ||||
@@ -21,7 +21,7 @@ import java.io.Serializable; | |||||
@NoArgsConstructor | @NoArgsConstructor | ||||
@AllArgsConstructor | @AllArgsConstructor | ||||
@ToString | @ToString | ||||
public class ProjectDraftSaveDto implements Serializable { | |||||
public class ProjectDraftSaveDTO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
@@ -29,7 +29,7 @@ import java.util.Map; | |||||
@Builder | @Builder | ||||
@NoArgsConstructor | @NoArgsConstructor | ||||
@AllArgsConstructor | @AllArgsConstructor | ||||
public class ProjectDraftVo implements Serializable { | |||||
public class ProjectDraftVO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
@@ -4,10 +4,10 @@ import com.alibaba.fastjson.JSON; | |||||
import com.alibaba.fastjson.TypeReference; | import com.alibaba.fastjson.TypeReference; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.ningdatech.basic.function.VUtils; | 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.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.enumeration.ProjectStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | import com.ningdatech.pmapi.projectlib.service.IProjectService; | ||||
@@ -50,7 +50,7 @@ public class ConstructionPlanManage { | |||||
* @param dto | * @param dto | ||||
* @return | * @return | ||||
*/ | */ | ||||
public String startTheProcess(ConstructionPlanDto dto) { | |||||
public String startTheProcess(ConstructionPlanDTO dto) { | |||||
Project projectInfo = projectService.getById(dto.getProjectId()); | Project projectInfo = projectService.getById(dto.getProjectId()); | ||||
VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); | VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); | ||||
@@ -59,7 +59,7 @@ public class ConstructionPlanManage { | |||||
WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) | WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) | ||||
.eq(WflowModels::getRegionCode, regionCode) | .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")); | .last("limit 1")); | ||||
if (Objects.isNull(model)) { | if (Objects.isNull(model)) { | ||||
@@ -77,14 +77,12 @@ public class ConstructionPlanManage { | |||||
params.setUser(dto.getUser()); | params.setUser(dto.getUser()); | ||||
params.setProcessUsers(Collections.emptyMap()); | params.setProcessUsers(Collections.emptyMap()); | ||||
//放入条件判断的项目字段 | //放入条件判断的项目字段 | ||||
ProjectConditionDto conditionDto = new ProjectConditionDto(); | |||||
ProjectConditionDTO conditionDto = new ProjectConditionDTO(); | |||||
BeanUtils.copyProperties(projectInfo, conditionDto); | BeanUtils.copyProperties(projectInfo, conditionDto); | ||||
if (Objects.nonNull(conditionDto)) { | |||||
dto.getFormData().putAll( | |||||
JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference<Map<String, Object>>() { | |||||
}) | |||||
); | |||||
} | |||||
dto.getFormData().putAll( | |||||
JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference<Map<String, Object>>() { | |||||
}) | |||||
); | |||||
params.setFormData(dto.getFormData()); | params.setFormData(dto.getFormData()); | ||||
String instanceId = processService.startProcess(model.getProcessDefId(), params); | String instanceId = processService.startProcess(model.getProcessDefId(), params); | ||||
log.info("建设方案项目申报成功 【{}】", instanceId); | log.info("建设方案项目申报成功 【{}】", instanceId); | ||||
@@ -2,26 +2,23 @@ package com.ningdatech.pmapi.projectdeclared.manage; | |||||
import cn.hutool.core.collection.CollUtil; | import cn.hutool.core.collection.CollUtil; | ||||
import com.alibaba.fastjson.JSON; | import com.alibaba.fastjson.JSON; | ||||
import com.alibaba.fastjson.JSONArray; | |||||
import com.alibaba.fastjson.TypeReference; | import com.alibaba.fastjson.TypeReference; | ||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
import com.ningdatech.basic.model.PageVo; | 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.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.projectdeclared.service.IProjectDraftService; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; | import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; | 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.IProjectApplicationService; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | import com.ningdatech.pmapi.projectlib.service.IProjectService; | ||||
import com.wflow.bean.entity.WflowModels; | import com.wflow.bean.entity.WflowModels; | ||||
@@ -63,30 +60,7 @@ public class DeclaredProjectManage { | |||||
private final ProcessModelService processModelService; | private final ProcessModelService processModelService; | ||||
public PageVo<ProjectLibListItemVO> page(DeclaredProjectListParamDto params) { | |||||
Page<Project> page = params.page(); | |||||
LambdaQueryWrapper<Project> 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<ProjectLibListItemVO> 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<ProjectDraftVo> pageDraft(DeclaredProjectListParamDto params) { | |||||
public PageVo<ProjectDraftVO> pageDraft(DeclaredProjectListParamDTO params) { | |||||
Page<ProjectDraft> page = params.page(); | Page<ProjectDraft> page = params.page(); | ||||
LambdaQueryWrapper<ProjectDraft> wrapper = Wrappers.lambdaQuery(ProjectDraft.class) | LambdaQueryWrapper<ProjectDraft> wrapper = Wrappers.lambdaQuery(ProjectDraft.class) | ||||
.eq(ProjectDraft::getUserId,params.getUserId()) | .eq(ProjectDraft::getUserId,params.getUserId()) | ||||
@@ -102,17 +76,17 @@ public class DeclaredProjectManage { | |||||
if (0L == page.getTotal()) { | if (0L == page.getTotal()) { | ||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
List<ProjectDraftVo> res = page.getRecords().stream().map(record -> { | |||||
ProjectDraftVo vo = new ProjectDraftVo(); | |||||
List<ProjectDraftVO> res = page.getRecords().stream().map(record -> { | |||||
ProjectDraftVO vo = new ProjectDraftVO(); | |||||
BeanUtils.copyProperties(record, vo); | BeanUtils.copyProperties(record, vo); | ||||
return vo; | return vo; | ||||
}).collect(Collectors.toList()); | }).collect(Collectors.toList()); | ||||
return PageVo.of(res, page.getTotal()); | return PageVo.of(res, page.getTotal()); | ||||
} | } | ||||
public ProjectDraftVo draftDatail(Long id) { | |||||
public ProjectDraftVO draftDatail(Long id) { | |||||
ProjectDraft draft = projectDraftService.getById(id); | ProjectDraft draft = projectDraftService.getById(id); | ||||
ProjectDraftVo vo = new ProjectDraftVo(); | |||||
ProjectDraftVO vo = new ProjectDraftVO(); | |||||
BeanUtils.copyProperties(draft, vo); | BeanUtils.copyProperties(draft, vo); | ||||
if(StringUtils.isNotBlank(draft.getProjectApplicationList())){ | if(StringUtils.isNotBlank(draft.getProjectApplicationList())){ | ||||
vo.setApplicationList(JSON.parseArray(draft.getProjectApplicationList(),ProjectApplication.class)); | vo.setApplicationList(JSON.parseArray(draft.getProjectApplicationList(),ProjectApplication.class)); | ||||
@@ -129,13 +103,13 @@ public class DeclaredProjectManage { | |||||
* @param dto | * @param dto | ||||
* @return | * @return | ||||
*/ | */ | ||||
public String startTheProcess(DeclaredProjectDto dto) { | |||||
public String startTheProcess(DeclaredProjectDTO dto) { | |||||
ProjectDTO projectInfo = dto.getProjectInfo(); | ProjectDTO projectInfo = dto.getProjectInfo(); | ||||
String regionCode = projectInfo.getAreaCode(); | String regionCode = projectInfo.getAreaCode(); | ||||
WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) | WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) | ||||
.eq(WflowModels::getRegionCode, regionCode) | .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")); | .last("limit 1")); | ||||
if (Objects.isNull(model)) { | if (Objects.isNull(model)) { | ||||
@@ -147,7 +121,7 @@ public class DeclaredProjectManage { | |||||
params.setUser(dto.getUser()); | params.setUser(dto.getUser()); | ||||
params.setProcessUsers(Collections.emptyMap()); | params.setProcessUsers(Collections.emptyMap()); | ||||
//放入条件判断的项目字段 | //放入条件判断的项目字段 | ||||
ProjectConditionDto conditionDto = new ProjectConditionDto(); | |||||
ProjectConditionDTO conditionDto = new ProjectConditionDTO(); | |||||
BeanUtils.copyProperties(dto.getProjectInfo(), conditionDto); | BeanUtils.copyProperties(dto.getProjectInfo(), conditionDto); | ||||
if (Objects.nonNull(conditionDto)) { | if (Objects.nonNull(conditionDto)) { | ||||
dto.getFormData().putAll( | dto.getFormData().putAll( | ||||
@@ -206,7 +180,7 @@ public class DeclaredProjectManage { | |||||
* @param dto | * @param dto | ||||
* @return | * @return | ||||
*/ | */ | ||||
public Long saveToDraft(ProjectDraftSaveDto dto) { | |||||
public Long saveToDraft(ProjectDraftSaveDTO dto) { | |||||
ProjectDTO projectInfo = dto.getProjectInfo(); | ProjectDTO projectInfo = dto.getProjectInfo(); | ||||
ProjectDraft draft = new ProjectDraft(); | ProjectDraft draft = new ProjectDraft(); | ||||
BeanUtils.copyProperties(projectInfo, draft); | BeanUtils.copyProperties(projectInfo, draft); | ||||
@@ -4,10 +4,10 @@ import com.alibaba.fastjson.JSON; | |||||
import com.alibaba.fastjson.TypeReference; | import com.alibaba.fastjson.TypeReference; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.ningdatech.basic.function.VUtils; | 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.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.enumeration.ProjectStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | import com.ningdatech.pmapi.projectlib.service.IProjectService; | ||||
@@ -51,7 +51,7 @@ public class PrequalificationDeclaredProjectManage { | |||||
* @param dto | * @param dto | ||||
* @return | * @return | ||||
*/ | */ | ||||
public String startTheProcess(PreDeclaredProjectDto dto) { | |||||
public String startTheProcess(PreDeclaredProjectDTO dto) { | |||||
Project projectInfo = projectService.getById(dto.getProjectId()); | Project projectInfo = projectService.getById(dto.getProjectId()); | ||||
VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); | VUtils.isTrue(Objects.isNull(projectInfo)).throwMessage("提交失败 此项目不存在!"); | ||||
@@ -60,7 +60,7 @@ public class PrequalificationDeclaredProjectManage { | |||||
WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) | WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) | ||||
.eq(WflowModels::getRegionCode, regionCode) | .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")); | .last("limit 1")); | ||||
if (Objects.isNull(model)) { | if (Objects.isNull(model)) { | ||||
@@ -78,7 +78,7 @@ public class PrequalificationDeclaredProjectManage { | |||||
params.setUser(dto.getUser()); | params.setUser(dto.getUser()); | ||||
params.setProcessUsers(Collections.emptyMap()); | params.setProcessUsers(Collections.emptyMap()); | ||||
//放入条件判断的项目字段 | //放入条件判断的项目字段 | ||||
ProjectConditionDto conditionDto = new ProjectConditionDto(); | |||||
ProjectConditionDTO conditionDto = new ProjectConditionDTO(); | |||||
BeanUtils.copyProperties(projectInfo, conditionDto); | BeanUtils.copyProperties(projectInfo, conditionDto); | ||||
if (Objects.nonNull(conditionDto)) { | if (Objects.nonNull(conditionDto)) { | ||||
dto.getFormData().putAll( | dto.getFormData().putAll( | ||||
@@ -40,6 +40,7 @@ public class ProjectHelper { | |||||
query.le(req.getApproveAmountMax() != null, Project::getApprovalAmount, req.getApproveAmountMax()); | query.le(req.getApproveAmountMax() != null, Project::getApprovalAmount, req.getApproveAmountMax()); | ||||
query.like(req.getBuildOrg() != null, Project::getBuildOrgName, req.getBuildOrg()); | query.like(req.getBuildOrg() != null, Project::getBuildOrgName, req.getBuildOrg()); | ||||
query.eq(req.getIsTemporaryAugment() != null, Project::getIsTemporaryAugment, req.getIsTemporaryAugment()); | |||||
return query; | return query; | ||||
} | } | ||||
@@ -66,4 +66,8 @@ public class ProjectListReq extends PagePo { | |||||
@ApiModelProperty("用户ID") | @ApiModelProperty("用户ID") | ||||
private Long userId; | private Long userId; | ||||
@ApiModelProperty("是否临时增补 0:否 1:是") | |||||
private Integer isTemporaryAugment; | |||||
} | } |
@@ -1,5 +1,7 @@ | |||||
package com.ningdatech.pmapi.scheduler.contants; | package com.ningdatech.pmapi.scheduler.contants; | ||||
import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; | |||||
/** | /** | ||||
* @author PoffyZhang | * @author PoffyZhang | ||||
* @Classname TaskContant | * @Classname TaskContant | ||||
@@ -19,5 +21,11 @@ public interface TaskContant { | |||||
public static final String DEFAULT_FORM_NAME = "丽水申报项目表单"; | public static final String DEFAULT_FORM_NAME = "丽水申报项目表单"; | ||||
public static final String[] DEFAULT_PROCESS_LIST = {"单位内部审批流程","项目预审审批流程","部门联合审批流程","建设方案审批流程","验收申报审批流程"}; | 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()}; | |||||
} | } | ||||
} | } |
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil; | |||||
import cn.hutool.core.date.StopWatch; | import cn.hutool.core.date.StopWatch; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.ningdatech.basic.exception.BizException; | import com.ningdatech.basic.exception.BizException; | ||||
import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; | |||||
import com.ningdatech.pmapi.scheduler.contants.TaskContant; | import com.ningdatech.pmapi.scheduler.contants.TaskContant; | ||||
import com.ningdatech.pmapi.sys.contant.RegionConst; | import com.ningdatech.pmapi.sys.contant.RegionConst; | ||||
import com.ningdatech.pmapi.sys.model.entity.Region; | import com.ningdatech.pmapi.sys.model.entity.Region; | ||||
@@ -96,15 +97,17 @@ public class InitProcessTask { | |||||
// continue; | // 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(); | WflowModelHistorysDto models = new WflowModelHistorysDto(); | ||||
models.setCreated(GregorianCalendar.getInstance().getTime()); | models.setCreated(GregorianCalendar.getInstance().getTime()); | ||||
// models.setFormId("wf" + IdUtil.objectId()); | // models.setFormId("wf" + IdUtil.objectId()); | ||||
models.setVersion(1); | models.setVersion(1); | ||||
models.setGroupId(1); | models.setGroupId(1); | ||||
// models.setProcessDefId("pd" + IdUtil.objectId()); | // models.setProcessDefId("pd" + IdUtil.objectId()); | ||||
models.setFormName(processName); | |||||
models.setFormName(formName); | |||||
models.setProcessType(processType); | |||||
models.setRegionCode(region.getRegionCode()); | models.setRegionCode(region.getRegionCode()); | ||||
ProcessNode processNode = new ProcessNode(); | ProcessNode processNode = new ProcessNode(); | ||||
models.setProcess(processNode); | models.setProcess(processNode); | ||||
@@ -114,12 +117,12 @@ public class InitProcessTask { | |||||
if(StringUtils.isNotBlank(processModelService.saveProcess(models))){ | if(StringUtils.isNotBlank(processModelService.saveProcess(models))){ | ||||
//初始的流程在部署表也存一份,用来查询 | //初始的流程在部署表也存一份,用来查询 | ||||
if(StringUtils.isNotBlank(processModelService.deployProcess(models.getFormId()))){ | if(StringUtils.isNotBlank(processModelService.deployProcess(models.getFormId()))){ | ||||
log.info("当前区域 【{}】 流程名[{}] 流程数据已经保存成功",region.getName(),processName); | |||||
log.info("当前区域 【{}】 流程名[{}] 流程数据已经保存成功",region.getName(),formName); | |||||
}else{ | }else{ | ||||
log.info("当前区域 【{}】 流程名[{}] 流程数据保存失败",region.getName(),processName); | |||||
log.info("当前区域 【{}】 流程名[{}] 流程数据保存失败",region.getName(),formName); | |||||
} | } | ||||
}else{ | }else{ | ||||
log.info("当前区域 【{}】流程名[{}] 流程数据保存失败",region.getName(),processName); | |||||
log.info("当前区域 【{}】流程名[{}] 流程数据保存失败",region.getName(),formName); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -1,13 +1,12 @@ | |||||
package com.ningdatech.pmapi.user.controller; | package com.ningdatech.pmapi.user.controller; | ||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
import org.springframework.stereotype.Controller; | import org.springframework.stereotype.Controller; | ||||
import org.springframework.web.bind.annotation.RequestMapping; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
* 前端控制器 | |||||
* 前端控制器 | |||||
* </p> | * </p> | ||||
* | * | ||||
* @author Lierbao | * @author Lierbao | ||||
@@ -17,4 +16,5 @@ import org.springframework.stereotype.Controller; | |||||
@RequestMapping("/pmapi.user/nd-user-info") | @RequestMapping("/pmapi.user/nd-user-info") | ||||
public class NdUserInfoController { | public class NdUserInfoController { | ||||
} | } |
@@ -1,9 +1,23 @@ | |||||
package com.ningdatech.pmapi.user.controller; | 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; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
@@ -13,8 +27,55 @@ import org.springframework.stereotype.Controller; | |||||
* @author Liuxinxin | * @author Liuxinxin | ||||
* @since 2023-01-04 | * @since 2023-01-04 | ||||
*/ | */ | ||||
@Controller | |||||
@RequestMapping("/pmapi.user/user-auth") | |||||
@RestController | |||||
@RequestMapping("/api/v1/user/auth") | |||||
@Api(tags = {"用户鉴权-相关接口"}) | |||||
@RequiredArgsConstructor | |||||
public class UserAuthController { | 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)); | |||||
} | |||||
} | } |
@@ -1,9 +1,21 @@ | |||||
package com.ningdatech.pmapi.user.controller; | 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.stereotype.Controller; | ||||
import org.springframework.web.bind.annotation.PostMapping; | |||||
import org.springframework.web.bind.annotation.RequestBody; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | import org.springframework.web.bind.annotation.RequestMapping; | ||||
import javax.validation.Valid; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
* 用户信息表 前端控制器 | * 用户信息表 前端控制器 | ||||
@@ -13,7 +25,23 @@ import org.springframework.web.bind.annotation.RequestMapping; | |||||
* @since 2023-01-04 | * @since 2023-01-04 | ||||
*/ | */ | ||||
@Controller | @Controller | ||||
@RequestMapping("/pmapi.user/user-info") | |||||
@RequestMapping("/api/v1/user-info") | |||||
@RequiredArgsConstructor | |||||
@Api(value = "UserInfoController", tags = "用户管理") | |||||
public class UserInfoController { | public class UserInfoController { | ||||
private final UserInfoManage userInfoManage; | |||||
@ApiOperation(value = "用户列表搜索", notes = "用户列表搜索") | |||||
@PostMapping("/list") | |||||
public PageVo<ResUserInfoListVO> userInfoList(@Valid @RequestBody ReqUserInfoListPO reqUserInfoListPO) { | |||||
return userInfoManage.list(reqUserInfoListPO); | |||||
} | |||||
@ApiOperation(value = "用户禁用", notes = "用户禁用") | |||||
@PostMapping("/disable") | |||||
public void disable(@Valid @RequestBody ReqUserDisablePO reqUserDisablePO){ | |||||
userInfoManage.disable(reqUserDisablePO); | |||||
} | |||||
} | } |
@@ -18,7 +18,13 @@ public class UserAuthLoginManage { | |||||
private final IUserAuthService iUserAuthService; | private final IUserAuthService iUserAuthService; | ||||
private final IUserInfoService iUserInfoService; | 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; | |||||
} | } | ||||
} | } |
@@ -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<ResUserInfoListVO> list(ReqUserInfoListPO reqUserInfoListPO) { | |||||
return null; | |||||
} | |||||
public void disable(ReqUserDisablePO reqUserDisablePO) { | |||||
} | |||||
} |
@@ -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; | |||||
} |
@@ -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<Role> userRoleList; | |||||
@ApiModelProperty("状态") | |||||
private String status; | |||||
} |
@@ -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<Role> userRoleList; | |||||
@ApiModelProperty("状态") | |||||
private String status; | |||||
@ApiModelProperty("更新时间") | |||||
private LocalDateTime updateTime; | |||||
} |
@@ -4,10 +4,12 @@ import cn.hutool.core.collection.CollectionUtil; | |||||
import com.ningdatech.basic.auth.AbstractLoginUser; | import com.ningdatech.basic.auth.AbstractLoginUser; | ||||
import lombok.Data; | import lombok.Data; | ||||
import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
import org.apache.commons.lang3.StringUtils; | |||||
import org.springframework.security.core.GrantedAuthority; | import org.springframework.security.core.GrantedAuthority; | ||||
import org.springframework.security.core.authority.SimpleGrantedAuthority; | import org.springframework.security.core.authority.SimpleGrantedAuthority; | ||||
import org.springframework.security.core.userdetails.UserDetails; | import org.springframework.security.core.userdetails.UserDetails; | ||||
import java.util.ArrayList; | |||||
import java.util.Collection; | import java.util.Collection; | ||||
import java.util.List; | import java.util.List; | ||||
@@ -41,8 +43,11 @@ public class UserInfoDetails extends AbstractLoginUser implements UserDetails { | |||||
*/ | */ | ||||
@Override | @Override | ||||
public Collection<? extends GrantedAuthority> getAuthorities() { | 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 | @Override | ||||
@@ -31,7 +31,8 @@ public class UsernamePasswordAuthProvider implements AuthenticationProvider { | |||||
if (user == null) { | if (user == null) { | ||||
throw new InternalAuthenticationServiceException("can not get user info!"); | throw new InternalAuthenticationServiceException("can not get user info!"); | ||||
} | } | ||||
additionalAuthenticationChecks(user, authenticationToken); | |||||
// TODO 开发使用暂时关闭账号密码验证 | |||||
// additionalAuthenticationChecks(user, authenticationToken); | |||||
// 校验用户是否有当前端的登陆权限 | // 校验用户是否有当前端的登陆权限 | ||||
// 将用户定义的user放入token中,这样可以在session中查询到所有自定义的用户信息 | // 将用户定义的user放入token中,这样可以在session中查询到所有自定义的用户信息 | ||||
return new UsernamePasswordAuthToken(user, user.getPassword(), user.getAuthorities()); | return new UsernamePasswordAuthToken(user, user.getPassword(), user.getAuthorities()); | ||||