|
|
@@ -4,16 +4,22 @@ 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.ningdatech.pmapi.declared.entity.dto.DeclaredProjectDto; |
|
|
|
import com.ningdatech.pmapi.declared.entity.dto.DeclaredProjectListParamDto; |
|
|
|
import com.wflow.bean.entity.NdDeclaredProject; |
|
|
|
import com.wflow.bean.entity.WflowModels; |
|
|
|
import com.wflow.bean.vo.NdDeclaredProjectVo; |
|
|
|
import com.wflow.service.NdDeclaredProjectService; |
|
|
|
import com.wflow.workflow.bean.vo.ProcessStartParamsVo; |
|
|
|
import com.wflow.workflow.service.ProcessInstanceService; |
|
|
|
import com.wflow.workflow.service.ProcessModelService; |
|
|
|
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.Collections; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Objects; |
|
|
|
import java.util.stream.Collectors; |
|
|
@@ -31,7 +37,11 @@ public class DeclaredProjectManage { |
|
|
|
|
|
|
|
private final NdDeclaredProjectService declaredProjectService; |
|
|
|
|
|
|
|
public PageVo<NdDeclaredProjectVo> page(DeclaredProjectParamDto params) { |
|
|
|
private final ProcessInstanceService processService; |
|
|
|
|
|
|
|
private final ProcessModelService processModelService; |
|
|
|
|
|
|
|
public PageVo<NdDeclaredProjectVo> page(DeclaredProjectListParamDto params) { |
|
|
|
Page<NdDeclaredProject> page = params.page(); |
|
|
|
LambdaQueryWrapper<NdDeclaredProject> wrapper = Wrappers.lambdaQuery(NdDeclaredProject.class) |
|
|
|
.ge(Objects.nonNull(params.getStartTime()), NdDeclaredProject::getCreateOn, params.getStartTime()) |
|
|
@@ -53,4 +63,25 @@ public class DeclaredProjectManage { |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
return PageVo.of(res,page.getTotal()); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 启动实例 |
|
|
|
* @param dto |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public String startTheProcess(DeclaredProjectDto dto) { |
|
|
|
String defId = null; |
|
|
|
String regionCode = dto.getRegionCode(); |
|
|
|
|
|
|
|
processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) |
|
|
|
.eq(WflowModels::getRegionCode,regionCode) |
|
|
|
.eq(WflowModels::getFormName,"单位内部审批流程") |
|
|
|
.last("limit 1")); |
|
|
|
|
|
|
|
ProcessStartParamsVo params = new ProcessStartParamsVo(); |
|
|
|
params.setDeptId("6179678"); |
|
|
|
params.setProcessUsers(Collections.emptyMap()); |
|
|
|
params.setFormData(dto.getFormData()); |
|
|
|
return processService.startProcess(defId, params); |
|
|
|
} |
|
|
|
} |