Bläddra i källkod

Merge remote-tracking branch 'origin/master'

master
WendyYang 1 år sedan
förälder
incheckning
52b1eb71b0
7 ändrade filer med 153 tillägg och 6 borttagningar
  1. +5
    -1
      pmapi/pom.xml
  2. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/constant/ProjectDeclareConstants.java
  3. +53
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/declared/controller/DeclaredProjectController.java
  4. +34
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/declared/entity/dto/DeclaredProjectParamDto.java
  5. +56
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/declared/manage/DeclaredProjectManage.java
  6. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/OrganizationProcdefController.java
  7. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/SysProcdefController.java

+ 5
- 1
pmapi/pom.xml Visa fil

@@ -258,6 +258,11 @@
<artifactId>nd-file-starter</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.ningdatech</groupId>
<artifactId>nd-zwdd-starter</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<!-- 打包 -->
<!--配置环境的profile-->
@@ -337,7 +342,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>

<skipTests>true</skipTests>
</configuration>
</plugin>


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/constant/ProjectDeclareConstants.java Visa fil

@@ -34,7 +34,7 @@ public interface ProjectDeclareConstants {
// 是否首次新建
public static final String FIRST_NEW_CONSTRUCTION = "firstNewConstruction";
// 预算年度
public static final String BUDGET_YEAR = "budgetYear";
public static final String BUDGET_YEAR = "projectYear";
// 建设开始时间
public static final String CONSTRUCTION_START_TIME = "constructionStartTime";
// 建设结束时间


+ 53
- 0
pmapi/src/main/java/com/ningdatech/pmapi/declared/controller/DeclaredProjectController.java Visa fil

@@ -0,0 +1,53 @@
package com.ningdatech.pmapi.declared.controller;

import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.declared.entity.dto.DeclaredProjectParamDto;
import com.ningdatech.pmapi.declared.manage.DeclaredProjectManage;
import com.wflow.bean.vo.NdDeclaredProjectVo;
import com.wflow.workflow.bean.vo.ProcessStartParamsVo;
import com.wflow.workflow.service.ProcessInstanceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
* @Classname DeclaredProjectController
* @Description 申报项目
* @Date 2023/1/31 11:29
* @Author PoffyZhang
*/
@Slf4j
@Validated
@RestController
@RequestMapping("/api/v1/declared")
@Api(value = "DeclaredProject", tags = "申报管理-申报项目")
@RequiredArgsConstructor
public class DeclaredProjectController {
private final ProcessInstanceService processService;

private final DeclaredProjectManage declaredProjectManage;

@ApiOperation(value = "申报项目已申报列表", notes = "申报项目已申报列表")
@GetMapping("/list")
public PageVo<NdDeclaredProjectVo> list(@Validated @ModelAttribute DeclaredProjectParamDto params) {;
return declaredProjectManage.page(params);
}

@ApiOperation(value = "申报项目草稿箱", notes = "申报项目草稿箱")
@GetMapping("/draft")
public PageVo<NdDeclaredProjectVo> draft(@Validated @ModelAttribute ProcessStartParamsVo params) {
return PageVo.empty();
}

@ApiOperation(value = "申报项目", notes = "申报项目")
@PostMapping("/start/{defId}")
public String startTheProcess(@PathVariable String defId,
@RequestBody ProcessStartParamsVo params) {
String instanceId = processService.startProcess(defId, params);
return "启动流程实例 " + instanceId + " 成功";
}

}

+ 34
- 0
pmapi/src/main/java/com/ningdatech/pmapi/declared/entity/dto/DeclaredProjectParamDto.java Visa fil

@@ -0,0 +1,34 @@
package com.ningdatech.pmapi.declared.entity.dto;

import com.ningdatech.basic.model.PagePo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* @Classname DeclaredProjectParamDto
* @Description
* @Date 2023/2/1 14:52
* @Author PoffyZhang
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DeclaredProjectParamDto extends PagePo {

private String projectName;

private Integer projectType;

private Integer projectStatusFirst;

private Integer projectStatusSecond;

private Integer projectYear;

private String startTime;

private String endTime;
}

+ 56
- 0
pmapi/src/main/java/com/ningdatech/pmapi/declared/manage/DeclaredProjectManage.java Visa fil

@@ -0,0 +1,56 @@
package com.ningdatech.pmapi.declared.manage;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.declared.entity.dto.DeclaredProjectParamDto;
import com.wflow.bean.entity.NdDeclaredProject;
import com.wflow.bean.vo.NdDeclaredProjectVo;
import com.wflow.service.NdDeclaredProjectService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

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

/**
* @Classname DeclaredProjectManage
* @Description
* @Date 2023/2/1 14:48
* @Author PoffyZhang
*/
@Component
@Slf4j
@RequiredArgsConstructor
public class DeclaredProjectManage {

private final NdDeclaredProjectService declaredProjectService;

public PageVo<NdDeclaredProjectVo> page(DeclaredProjectParamDto params) {
Page<NdDeclaredProject> page = params.page();
LambdaQueryWrapper<NdDeclaredProject> wrapper = Wrappers.lambdaQuery(NdDeclaredProject.class)
.ge(Objects.nonNull(params.getStartTime()), NdDeclaredProject::getCreateOn, params.getStartTime())
.le(Objects.nonNull(params.getEndTime()), NdDeclaredProject::getCreateOn, params.getEndTime())
.eq(Objects.nonNull(params.getProjectType()), NdDeclaredProject::getProjectType, params.getProjectType())
.eq(Objects.nonNull(params.getProjectYear()), NdDeclaredProject::getProjectYear, params.getProjectYear())
.eq(Objects.nonNull(params.getProjectStatusFirst()), NdDeclaredProject::getProjectStatusFirst, params.getProjectStatusFirst())
.eq(Objects.nonNull(params.getProjectStatusSecond()), NdDeclaredProject::getProjectStatusSecond, params.getProjectStatusSecond())
.like(StringUtils.isNotBlank(params.getProjectName()), NdDeclaredProject::getProjectName, params.getProjectName())
.orderByDesc(NdDeclaredProject::getUpdateOn);
declaredProjectService.page(page,wrapper);
if(0L == page.getTotal()){
return PageVo.empty();
}
List<NdDeclaredProjectVo> res = page.getRecords().stream().map(record -> {
NdDeclaredProjectVo vo = new NdDeclaredProjectVo();
BeanUtils.copyProperties(record, vo);
return vo;
}).collect(Collectors.toList());
return PageVo.of(res,page.getTotal());
}
}

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/OrganizationProcdefController.java Visa fil

@@ -34,9 +34,9 @@ public class OrganizationProcdefController {

@ApiOperation(value = "单位流程配置列表", notes = "单位流程配置列表")
@GetMapping("/list")
public PageVo<OrgProcdefVo> list(@RequestParam String orgCode, @RequestParam(defaultValue = "1") Integer pageNum,
public PageVo<OrgProcdefVo> list(@RequestParam String orgCode, @RequestParam(defaultValue = "1") Integer pageNumber,
@RequestParam(defaultValue = "10") Integer pageSize) {
return orgProcdefService.getOrgProcessByOrgCode(orgCode, pageNum, pageSize);
return orgProcdefService.getOrgProcessByOrgCode(orgCode, pageNumber, pageSize);
}

@ApiOperation(value = "单位流程配置详情", notes = "单位流程配置详情")


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/sys/controller/SysProcdefController.java Visa fil

@@ -33,9 +33,9 @@ public class SysProcdefController {

@ApiOperation(value = "系统流程配置列表", notes = "系统流程配置列表")
@GetMapping("/list")
public PageVo<WflowModelVo> list(@RequestParam String regionCode, @RequestParam(defaultValue = "1") Integer pageNum,
public PageVo<WflowModelVo> list(@RequestParam String regionCode, @RequestParam(defaultValue = "1") Integer pageNumber,
@RequestParam(defaultValue = "10") Integer pageSize) {
return modelGroupService.getModelsPage(regionCode,pageNum,pageSize);
return modelGroupService.getModelsPage(regionCode,pageNumber,pageSize);
}

@ApiOperation(value = "系统流程配置详情", notes = "系统流程配置详情")


Laddar…
Avbryt
Spara