Browse Source

推送重大项目

tags/24080901
PoffyZhang 1 year ago
parent
commit
8ae195c485
6 changed files with 30 additions and 12 deletions
  1. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/constant/BizConst.java
  2. +8
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/converter/ApplicationConverter.java
  3. +5
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByProvincialDeptManage.java
  4. +5
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/ProcessEndListener.java
  5. +5
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java
  6. +5
    -1
      pmapi/src/test/java/com/ningdatech/pmapi/provincial/Test.java

+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/constant/BizConst.java View File

@@ -88,4 +88,6 @@ public interface BizConst {
String RESPONSE_KEY_DATA = "data"; String RESPONSE_KEY_DATA = "data";
String ORG_NAME = "organizationName"; String ORG_NAME = "organizationName";
String ORG_CODE = "organizationCode"; String ORG_CODE = "organizationCode";

String DEV = "dev";
} }

+ 8
- 6
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/converter/ApplicationConverter.java View File

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.ningdatech.file.service.FileService; import com.ningdatech.file.service.FileService;
import com.ningdatech.pmapi.common.constant.BizConst;
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.provincial.model.dto.FileDTO; import com.ningdatech.pmapi.provincial.model.dto.FileDTO;
@@ -28,10 +29,11 @@ import java.util.stream.Collectors;
public class ApplicationConverter { public class ApplicationConverter {


public static ProvincialProjectDTO convertProject(Project projectInfo, List<ProjectApplication> applications, public static ProvincialProjectDTO convertProject(Project projectInfo, List<ProjectApplication> applications,
FileService fileService) {
FileService fileService,String active) {
return ProvincialProjectDTO.builder() return ProvincialProjectDTO.builder()
//暂时先写死 //暂时先写死
.operationManageUnit("GO_a1479720291640b4982158fe3035a2d0")
.operationManageUnit(StringUtils.isBlank(active)|| BizConst.DEV.equals(active) ?
"GO_a1479720291640b4982158fe3035a2d0" : projectInfo.getHigherSuperOrgCode())
.digitalReform(String.valueOf(projectInfo.getBizDomain())) .digitalReform(String.valueOf(projectInfo.getBizDomain()))
.regionCode(projectInfo.getAreaCode()) .regionCode(projectInfo.getAreaCode())
.regionName(projectInfo.getArea()) .regionName(projectInfo.getArea())
@@ -58,11 +60,11 @@ public class ApplicationConverter {
.contactName(projectInfo.getContactName()) .contactName(projectInfo.getContactName())
.contactPhone(projectInfo.getContactPhone()) .contactPhone(projectInfo.getContactPhone())
.buildUnit(projectInfo.getBuildOrgName()) .buildUnit(projectInfo.getBuildOrgName())
// .buildUnitCode(projectInfo.getBuildOrgCode())
.buildUnitCode("GO_a1479720291640b4982158fe3035a2d0")
.buildUnitCode(StringUtils.isBlank(active)|| BizConst.DEV.equals(active) ?
"GO_a1479720291640b4982158fe3035a2d0" : projectInfo.getBuildOrgCode())
.superUnit(projectInfo.getSuperOrg()) .superUnit(projectInfo.getSuperOrg())
// .superUnitCode(projectInfo.getSuperOrgCode())
.superUnitCode("GO_a1479720291640b4982158fe3035a2d0")
.superUnitCode(StringUtils.isBlank(active)|| BizConst.DEV.equals(active) ?
"GO_a1479720291640b4982158fe3035a2d0" : projectInfo.getSuperOrgCode())
.projectEstimateFile(convertFile(projectInfo.getCalculationTotalInvestmentFile(),fileService)) .projectEstimateFile(convertFile(projectInfo.getCalculationTotalInvestmentFile(),fileService))
.unitThreePlan(convertFile(projectInfo.getMainResponsibilitiesApplicantFile(),fileService)) .unitThreePlan(convertFile(projectInfo.getMainResponsibilitiesApplicantFile(),fileService))
.otherFile(convertFile(projectInfo.getPreliminaryPlanFile(),fileService)) .otherFile(convertFile(projectInfo.getPreliminaryPlanFile(),fileService))


+ 5
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByProvincialDeptManage.java View File

@@ -18,6 +18,7 @@ import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant;
import com.wflow.exception.BusinessException; import com.wflow.exception.BusinessException;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;


@@ -46,7 +47,8 @@ public class ReviewByProvincialDeptManage {


private final ProjectLibManage projectLibManage; private final ProjectLibManage projectLibManage;


private final IProjectStagingService projectStagingService;
@Value("${spring.profiles.active}")
private String active;


/** /**
* 省级部门联审 * 省级部门联审
@@ -69,7 +71,7 @@ public class ReviewByProvincialDeptManage {
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectId, projectInfo.getId())); .eq(ProjectApplication::getProjectId, projectInfo.getId()));
if(joinReviewProvincialBureauService.pushImportProject( if(joinReviewProvincialBureauService.pushImportProject(
ApplicationConverter.convertProject(projectInfo,applications,fileService))){
ApplicationConverter.convertProject(projectInfo,applications,fileService,active))){
return Boolean.TRUE; return Boolean.TRUE;
} }


@@ -110,7 +112,7 @@ public class ReviewByProvincialDeptManage {
declaringDTO.getProjectInfo().setId(p.getId()); declaringDTO.getProjectInfo().setId(p.getId());
projectService.updateById(p); projectService.updateById(p);
if(!joinReviewProvincialBureauService.pushImportProject( if(!joinReviewProvincialBureauService.pushImportProject(
ApplicationConverter.convertProject(p,applications,fileService))){
ApplicationConverter.convertProject(p,applications,fileService,active))){
throw new BusinessException("提交省级部门联审失败"); throw new BusinessException("提交省级部门联审失败");
} }




+ 5
- 1
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/listener/ProcessEndListener.java View File

@@ -35,6 +35,7 @@ import org.flowable.engine.TaskService;
import org.flowable.engine.history.HistoricProcessInstance; import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.task.api.Task; import org.flowable.task.api.Task;
import org.flowable.task.api.history.HistoricTaskInstance; import org.flowable.task.api.history.HistoricTaskInstance;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.event.EventListener; import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@@ -76,6 +77,9 @@ public class ProcessEndListener {


private final FileService fileService; private final FileService fileService;


@Value("${spring.profiles.active}")
private String active;

@Async @Async
@EventListener @EventListener
public void onApplicationEvent(ProcessEndEvent event) { public void onApplicationEvent(ProcessEndEvent event) {
@@ -215,7 +219,7 @@ public class ProcessEndListener {
.list(Wrappers.lambdaQuery(ProjectApplication.class) .list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectId, declaredProject.getId())); .eq(ProjectApplication::getProjectId, declaredProject.getId()));
joinReviewProvincialBureauService.pushImportProject( joinReviewProvincialBureauService.pushImportProject(
ApplicationConverter.convertProject(declaredProject, applications, fileService));
ApplicationConverter.convertProject(declaredProject, applications, fileService,active));
handlerManage.updatePassProjectStatus(userId, declaredProject); handlerManage.updatePassProjectStatus(userId, declaredProject);
break; break;
} catch (Exception e) { } catch (Exception e) {


+ 5
- 1
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java View File

@@ -29,6 +29,7 @@ import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.engine.task.Comment; import org.flowable.engine.task.Comment;
import org.flowable.variable.api.history.HistoricVariableInstance; import org.flowable.variable.api.history.HistoricVariableInstance;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;


@@ -91,6 +92,9 @@ public class HandlerManage {
private final INdProjectDelayApplyService projectDelayApplyService; private final INdProjectDelayApplyService projectDelayApplyService;
private final INdProjectApplyBorrowService projectApplyBorrowService; private final INdProjectApplyBorrowService projectApplyBorrowService;


@Value("${spring.profiles.active}")
private String active;



/** /**
* 审核通过后 所处理的逻辑 * 审核通过后 所处理的逻辑
@@ -183,7 +187,7 @@ public class HandlerManage {
.list(Wrappers.lambdaQuery(ProjectApplication.class) .list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectCode, declaredProject.getProjectCode())); .eq(ProjectApplication::getProjectCode, declaredProject.getProjectCode()));
joinReviewProvincialBureauService.pushImportProject( joinReviewProvincialBureauService.pushImportProject(
ApplicationConverter.convertProject(declaredProject, applications, fileService));
ApplicationConverter.convertProject(declaredProject, applications, fileService,active));
updatePassProjectStatus(userId, declaredProject); updatePassProjectStatus(userId, declaredProject);
break; break;
} catch (Exception e) { } catch (Exception e) {


+ 5
- 1
pmapi/src/test/java/com/ningdatech/pmapi/provincial/Test.java View File

@@ -22,6 +22,7 @@ import com.wflow.exception.BusinessException;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;


import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException; import java.security.InvalidKeyException;
@@ -85,6 +86,9 @@ public class Test extends AppTests{//
System.out.println(url.replaceAll("&?" + s + "=[^&]*&", StringUtils.EMPTY)); System.out.println(url.replaceAll("&?" + s + "=[^&]*&", StringUtils.EMPTY));
} }


@Value("${spring.profiles.active}")
private String active;

@org.junit.Test @org.junit.Test
public void Test4444(){ public void Test4444(){
// 对接省级联审的接口 // 对接省级联审的接口
@@ -93,7 +97,7 @@ public class Test extends AppTests{//
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectId, p.getId())); .eq(ProjectApplication::getProjectId, p.getId()));
if(!joinReviewProvincialBureauService.pushImportProject( if(!joinReviewProvincialBureauService.pushImportProject(
ApplicationConverter.convertProject(p,applications,fileService))){
ApplicationConverter.convertProject(p,applications,fileService,active))){
throw new BusinessException("提交省级部门联审失败"); throw new BusinessException("提交省级部门联审失败");
} }
System.out.println("成功"); System.out.println("成功");


Loading…
Cancel
Save