Browse Source

测试部署

tags/24080901
PoffyZhang 1 year ago
parent
commit
998111120a
2 changed files with 29 additions and 12 deletions
  1. +15
    -12
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/SynProjectCollectionTask.java
  2. +14
    -0
      pmapi/src/test/java/com/ningdatech/pmapi/projectCollection/ProjectCollectionTest.java

+ 15
- 12
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/SynProjectCollectionTask.java View File

@@ -68,14 +68,15 @@ public class SynProjectCollectionTask {
*/ */
@Scheduled(cron = "0 0 1 * * ?") @Scheduled(cron = "0 0 1 * * ?")
public void doTask() throws UnknownHostException { public void doTask() throws UnknownHostException {
if (!HOST.equals(InetAddress.getLocalHost().getHostName())) {
log.info("定时器没开启或者host不对! {}:{}",
HOST,InetAddress.getLocalHost().getHostName());
}
if(BizConst.PRE.equals(active)){
log.info("预发环境不用同步!");
return;
}
// if (!HOST.equals(InetAddress.getLocalHost().getHostName())) {
// log.info("定时器没开启或者host不对! {}:{}",
// HOST,InetAddress.getLocalHost().getHostName());
// return
// }
// if(BizConst.PRE.equals(active)){
// log.info("预发环境不用同步!");
// return;
// }


StopWatch stopWatch = new StopWatch(); StopWatch stopWatch = new StopWatch();
stopWatch.start(); stopWatch.start();
@@ -114,16 +115,18 @@ public class SynProjectCollectionTask {
ProjectListReq req = new ProjectListReq(); ProjectListReq req = new ProjectListReq();
req.setPageNumber(1); req.setPageNumber(1);
req.setPageSize(BizConst.MAX_EXPORT_COUNT); req.setPageSize(BizConst.MAX_EXPORT_COUNT);
List<GovBizProjectBaseinfo> projects = baseinfoService.list(Wrappers.lambdaQuery(GovBizProjectBaseinfo.class)
.eq(GovBizProjectBaseinfo::getDeleted,Boolean.FALSE)
.eq(StringUtils.isNotBlank(projId),GovBizProjectBaseinfo::getBaseProjId,projId));
List<GovBizProjectApprove> projects = approveService.list(Wrappers.lambdaQuery(GovBizProjectApprove.class)
.eq(GovBizProjectApprove::getDeleted,Boolean.FALSE)
.eq(StringUtils.isNotBlank(projId),GovBizProjectApprove::getBaseProjId,projId)
.isNotNull(GovBizProjectApprove::getBaseReviewCommentsFile)
.isNull(GovBizProjectApprove::getBaseReviewCommentsFilePdf));


if(CollUtil.isEmpty(projects)){ if(CollUtil.isEmpty(projects)){
log.info("没有项目归集 任务终止"); log.info("没有项目归集 任务终止");
return; return;
} }


for(GovBizProjectBaseinfo project : projects){
for(GovBizProjectApprove project : projects){
//开始转换PDF //开始转换PDF
convertPdfVo(project.getBaseProjId()); convertPdfVo(project.getBaseProjId());
} }


+ 14
- 0
pmapi/src/test/java/com/ningdatech/pmapi/projectCollection/ProjectCollectionTest.java View File

@@ -10,9 +10,11 @@ import com.ningdatech.pmapi.gov.model.dto.GovBizProjectSaveDTO;
import com.ningdatech.pmapi.gov.model.entity.*; import com.ningdatech.pmapi.gov.model.entity.*;
import com.ningdatech.pmapi.gov.service.*; import com.ningdatech.pmapi.gov.service.*;
import com.ningdatech.pmapi.projectdeclared.utils.GenerateProjectCodeUtil; import com.ningdatech.pmapi.projectdeclared.utils.GenerateProjectCodeUtil;
import com.ningdatech.pmapi.scheduler.task.SynProjectCollectionTask;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;


import java.net.UnknownHostException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;


@@ -45,6 +47,9 @@ public class ProjectCollectionTest extends AppTests {
@Autowired @Autowired
private GenerateProjectCodeUtil generateProjectCodeUtil; private GenerateProjectCodeUtil generateProjectCodeUtil;


@Autowired
private SynProjectCollectionTask collectionTask;

@Test @Test
public void test(){ public void test(){
List<String> baseProjIds = Lists.newArrayList("33112700020210100191"); List<String> baseProjIds = Lists.newArrayList("33112700020210100191");
@@ -80,4 +85,13 @@ public class ProjectCollectionTest extends AppTests {
} }
} }


@Test
public void test2() throws UnknownHostException {
collectionTask.doTask();
}

@Test
public void test3() throws UnknownHostException {
collectionTask.stagingConvertPdf("33112200020230100008");
}
} }

Loading…
Cancel
Save