Quellcode durchsuchen

测试部署

master
PoffyZhang vor 1 Jahr
Ursprung
Commit
998111120a
2 geänderte Dateien mit 29 neuen und 12 gelöschten Zeilen
  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 Datei anzeigen

@@ -68,14 +68,15 @@ public class SynProjectCollectionTask {
*/
@Scheduled(cron = "0 0 1 * * ?")
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.start();
@@ -114,16 +115,18 @@ public class SynProjectCollectionTask {
ProjectListReq req = new ProjectListReq();
req.setPageNumber(1);
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)){
log.info("没有项目归集 任务终止");
return;
}

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


+ 14
- 0
pmapi/src/test/java/com/ningdatech/pmapi/projectCollection/ProjectCollectionTest.java Datei anzeigen

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

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

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

@Autowired
private SynProjectCollectionTask collectionTask;

@Test
public void test(){
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");
}
}

Laden…
Abbrechen
Speichern