CMM 1 rok temu
rodzic
commit
f1c26cf0bb
31 zmienionych plików z 347 dodań i 103 usunięć
  1. +16
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/ProjectProcessStageEnum.java
  2. +0
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java
  3. +0
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/fiscal/controller/CompanyFiscalCodeController.java
  4. +10
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java
  5. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java
  6. +8
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DeclaredProjectController.java
  7. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/PrequalificationDeclaredController.java
  8. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ConstructionPlanDTO.java
  9. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDTO.java
  10. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectListParamDTO.java
  11. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/PreDeclaredProjectDTO.java
  12. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectConditionDTO.java
  13. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectDraftSaveDTO.java
  14. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDraftVO.java
  15. +10
    -12
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java
  16. +15
    -41
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java
  17. +6
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java
  18. +1
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java
  19. +4
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectListReq.java
  20. +8
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/contants/TaskContant.java
  21. +9
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/InitProcessTask.java
  22. +3
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/user/controller/NdUserInfoController.java
  23. +65
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserAuthController.java
  24. +29
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java
  25. +8
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java
  26. +29
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java
  27. +22
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/model/po/ReqUserDisablePO.java
  28. +37
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/model/po/ReqUserInfoListPO.java
  29. +47
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserInfoListVO.java
  30. +7
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java
  31. +2
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/password/UsernamePasswordAuthProvider.java

pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/ProjectProessStageEnum.java → pmapi/src/main/java/com/ningdatech/pmapi/common/enumeration/ProjectProcessStageEnum.java Wyświetl plik

@@ -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;
}
}

+ 0
- 1
pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java Wyświetl plik

@@ -66,7 +66,6 @@ public class EmployeeBatchGetTask {
}



}

// zwddClient.pageOrganizationEmployeePositions(query);


+ 0
- 1
pmapi/src/main/java/com/ningdatech/pmapi/fiscal/controller/CompanyFiscalCodeController.java Wyświetl plik

@@ -33,5 +33,4 @@ public class CompanyFiscalCodeController {
companyFiscalCodeManage.fiscalCodeConfigure(reqCompanyFiscalCodeAndSealSnPO);
}


}

+ 10
- 3
pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java Wyświetl plik

@@ -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;

/**
* <p>
* 前端控制器
* 前端控制器
* </p>
*
* @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() {

}

}

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/ConstructionPlanController.java Wyświetl plik

@@ -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 + "】 成功";
}


+ 8
- 8
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/DeclaredProjectController.java Wyświetl plik

@@ -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<ProjectDraftVo> draft(@ModelAttribute DeclaredProjectListParamDto params) {
public PageVo<ProjectDraftVO> 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 + "】 成功";
}


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/PrequalificationDeclaredController.java Wyświetl plik

@@ -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 + "】 成功";
}


pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ConstructionPlanDto.java → pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ConstructionPlanDTO.java Wyświetl plik

@@ -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;

pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDto.java → pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectDTO.java Wyświetl plik

@@ -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;

pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectListParamDto.java → pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/DeclaredProjectListParamDTO.java Wyświetl plik

@@ -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;


pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/PreDeclaredProjectDto.java → pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/PreDeclaredProjectDTO.java Wyświetl plik

@@ -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;

pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectConditionDto.java → pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectConditionDTO.java Wyświetl plik

@@ -18,7 +18,7 @@ import java.math.BigDecimal;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProjectConditionDto implements Serializable {
public class ProjectConditionDTO implements Serializable {

private Long projectId;


pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectDraftSaveDto.java → pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/dto/ProjectDraftSaveDTO.java Wyświetl plik

@@ -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;


pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDraftVo.java → pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/entity/vo/ProjectDraftVO.java Wyświetl plik

@@ -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;


+ 10
- 12
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java Wyświetl plik

@@ -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<Map<String, Object>>() {
})
);
}
dto.getFormData().putAll(
JSON.parseObject(JSON.toJSONString(conditionDto), new TypeReference<Map<String, Object>>() {
})
);
params.setFormData(dto.getFormData());
String instanceId = processService.startProcess(model.getProcessDefId(), params);
log.info("建设方案项目申报成功 【{}】", instanceId);


+ 15
- 41
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java Wyświetl plik

@@ -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<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();
LambdaQueryWrapper<ProjectDraft> 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<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);
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);


+ 6
- 6
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PrequalificationDeclaredProjectManage.java Wyświetl plik

@@ -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(


+ 1
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java Wyświetl plik

@@ -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;
}



+ 4
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectListReq.java Wyświetl plik

@@ -66,4 +66,8 @@ public class ProjectListReq extends PagePo {

@ApiModelProperty("用户ID")
private Long userId;

@ApiModelProperty("是否临时增补 0:否 1:是")
private Integer isTemporaryAugment;

}

+ 8
- 0
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/contants/TaskContant.java Wyświetl plik

@@ -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()};
}
}

+ 9
- 6
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/InitProcessTask.java Wyświetl plik

@@ -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);
}
}
}


+ 3
- 3
pmapi/src/main/java/com/ningdatech/pmapi/user/controller/NdUserInfoController.java Wyświetl plik

@@ -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;

/**
* <p>
* 前端控制器
* 前端控制器
* </p>
*
* @author Lierbao
@@ -17,4 +16,5 @@ import org.springframework.stereotype.Controller;
@RequestMapping("/pmapi.user/nd-user-info")
public class NdUserInfoController {


}

+ 65
- 4
pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserAuthController.java Wyświetl plik

@@ -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;

/**
* <p>
@@ -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));
}

}

+ 29
- 1
pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java Wyświetl plik

@@ -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;

/**
* <p>
* 用户信息表 前端控制器
@@ -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<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);
}

}

+ 8
- 2
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java Wyświetl plik

@@ -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;
}
}

+ 29
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java Wyświetl plik

@@ -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) {

}
}

+ 22
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/model/po/ReqUserDisablePO.java Wyświetl plik

@@ -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;

}

+ 37
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/model/po/ReqUserInfoListPO.java Wyświetl plik

@@ -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;

}

+ 47
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserInfoListVO.java Wyświetl plik

@@ -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;


}

+ 7
- 2
pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java Wyświetl plik

@@ -4,10 +4,12 @@ import cn.hutool.core.collection.CollectionUtil;
import com.ningdatech.basic.auth.AbstractLoginUser;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

@@ -41,8 +43,11 @@ public class UserInfoDetails extends AbstractLoginUser implements UserDetails {
*/
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
SimpleGrantedAuthority simpleGrantedAuthority = new SimpleGrantedAuthority(this.role);
return CollectionUtil.toList(simpleGrantedAuthority);
if (StringUtils.isNotBlank(role)) {
SimpleGrantedAuthority simpleGrantedAuthority = new SimpleGrantedAuthority(this.role);
return CollectionUtil.toList(simpleGrantedAuthority);
}
return new ArrayList<>();
}

@Override


+ 2
- 1
pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/password/UsernamePasswordAuthProvider.java Wyświetl plik

@@ -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());


Ładowanie…
Anuluj
Zapisz