@@ -258,6 +258,11 @@ | |||||
<artifactId>nd-file-starter</artifactId> | <artifactId>nd-file-starter</artifactId> | ||||
<version>1.0.0</version> | <version>1.0.0</version> | ||||
</dependency> | </dependency> | ||||
<dependency> | |||||
<groupId>com.ningdatech</groupId> | |||||
<artifactId>nd-zwdd-starter</artifactId> | |||||
<version>1.0.0</version> | |||||
</dependency> | |||||
</dependencies> | </dependencies> | ||||
<!-- 打包 --> | <!-- 打包 --> | ||||
<!--配置环境的profile--> | <!--配置环境的profile--> | ||||
@@ -337,7 +342,6 @@ | |||||
<groupId>org.apache.maven.plugins</groupId> | <groupId>org.apache.maven.plugins</groupId> | ||||
<artifactId>maven-surefire-plugin</artifactId> | <artifactId>maven-surefire-plugin</artifactId> | ||||
<configuration> | <configuration> | ||||
<skipTests>true</skipTests> | <skipTests>true</skipTests> | ||||
</configuration> | </configuration> | ||||
</plugin> | </plugin> | ||||
@@ -34,7 +34,7 @@ public interface ProjectDeclareConstants { | |||||
// 是否首次新建 | // 是否首次新建 | ||||
public static final String FIRST_NEW_CONSTRUCTION = "firstNewConstruction"; | 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"; | public static final String CONSTRUCTION_START_TIME = "constructionStartTime"; | ||||
// 建设结束时间 | // 建设结束时间 | ||||
@@ -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 + " 成功"; | |||||
} | |||||
} |
@@ -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; | |||||
} |
@@ -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()); | |||||
} | |||||
} |
@@ -34,9 +34,9 @@ public class OrganizationProcdefController { | |||||
@ApiOperation(value = "单位流程配置列表", notes = "单位流程配置列表") | @ApiOperation(value = "单位流程配置列表", notes = "单位流程配置列表") | ||||
@GetMapping("/list") | @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) { | @RequestParam(defaultValue = "10") Integer pageSize) { | ||||
return orgProcdefService.getOrgProcessByOrgCode(orgCode, pageNum, pageSize); | |||||
return orgProcdefService.getOrgProcessByOrgCode(orgCode, pageNumber, pageSize); | |||||
} | } | ||||
@ApiOperation(value = "单位流程配置详情", notes = "单位流程配置详情") | @ApiOperation(value = "单位流程配置详情", notes = "单位流程配置详情") | ||||
@@ -33,9 +33,9 @@ public class SysProcdefController { | |||||
@ApiOperation(value = "系统流程配置列表", notes = "系统流程配置列表") | @ApiOperation(value = "系统流程配置列表", notes = "系统流程配置列表") | ||||
@GetMapping("/list") | @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) { | @RequestParam(defaultValue = "10") Integer pageSize) { | ||||
return modelGroupService.getModelsPage(regionCode,pageNum,pageSize); | |||||
return modelGroupService.getModelsPage(regionCode,pageNumber,pageSize); | |||||
} | } | ||||
@ApiOperation(value = "系统流程配置详情", notes = "系统流程配置详情") | @ApiOperation(value = "系统流程配置详情", notes = "系统流程配置详情") | ||||