瀏覽代碼

核心业务 可以按单位更新数据

tags/24080901
PoffyZhang 1 年之前
父節點
當前提交
49d06ecb0a
共有 3 個檔案被更改,包括 28 行新增7 行删除
  1. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java
  2. +0
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/SynProjectCoreBizTask.java
  3. +27
    -0
      pmapi/src/test/java/com/ningdatech/pmapi/projectCollection/ProjectCollectionTest.java

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java 查看文件

@@ -558,7 +558,7 @@ public class GovProjectCollectionManage {
for(GovBizProjectProcureDTO procure : procures){
procure.setBaseProjId(finalBaseProjId);
procure.setBaseProjName(baseProjName);
procure.setBaseBidCode(finalBaseProjId + StrPool.DASH + index);
procure.setBaseBidCode(finalBaseProjId + StrPool.DASH + String.format(StrPool.FORMAT_DATE_SINGLE_DIGITS,index));
GovBizProjectProcure saveProcure = BeanUtil.copyProperties(procure,GovBizProjectProcure.class);
saveProcure.setBaseProjId(finalBaseProjId);
saveProcure.setId(null);


+ 0
- 6
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/SynProjectCoreBizTask.java 查看文件

@@ -86,12 +86,6 @@ public class SynProjectCoreBizTask {
}

public void doTask(String orgCode) throws UnknownHostException {
if (!HOST.equals(InetAddress.getLocalHost().getHostName())) {
log.info("定时器没开启或者host不对! {}:{}",
HOST,InetAddress.getLocalHost().getHostName());
return;
}

log.info("同步项目核心业务开始=====");
StopWatch stopWatch = new StopWatch();
stopWatch.start();


+ 27
- 0
pmapi/src/test/java/com/ningdatech/pmapi/projectCollection/ProjectCollectionTest.java 查看文件

@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import com.ningdatech.basic.util.StrPool;
import com.ningdatech.log.model.domain.OptLog;
import com.ningdatech.log.service.OptLogService;
import com.ningdatech.pmapi.AppTests;
@@ -18,6 +19,7 @@ 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 com.ningdatech.pmapi.scheduler.task.SynProjectCoreBizTask;
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -68,6 +70,9 @@ public class ProjectCollectionTest extends AppTests {
@Autowired
private OptLogService optLogService;

@Autowired
private SynProjectCoreBizTask projectCoreBizTask;

@Test
public void test(){
List<String> baseProjIds = Lists.newArrayList("33110000020230100061");
@@ -186,4 +191,26 @@ public class ProjectCollectionTest extends AppTests {
Long ll = ChronoUnit.MONTHS.between(temporal1, temporal2);
return ll.toString();
}

@Test
public void test6(){
List<GovBizProjectProcure> list = procureService.list(Wrappers.lambdaQuery(GovBizProjectProcure.class)
.eq(GovBizProjectProcure::getDeleted,Boolean.FALSE));

for(GovBizProjectProcure procure : list){
try{
String index = procure.getBaseBidCode().split("-")[1];
procure.setBaseBidCode(procure.getBaseProjId() + StrPool.DASH + String.format(StrPool.FORMAT_DATE_SINGLE_DIGITS,Integer.parseInt(index)));
procureService.updateById(procure);
}catch (Exception e){
e.printStackTrace();
}
}
}

@Test
public void test7() throws UnknownHostException {
String orgCode = "GO_5f1f6f28a6f7484ea3b9991d8d02599f";
projectCoreBizTask.doTask(orgCode);
}
}

Loading…
取消
儲存