Browse Source

项目申报和归集 的并集

master
PoffyZhang 1 year ago
parent
commit
ed015ef7a5
1 changed files with 42 additions and 0 deletions
  1. +42
    -0
      pmapi/src/test/java/com/ningdatech/pmapi/refund/ProjectRefundTest.java

+ 42
- 0
pmapi/src/test/java/com/ningdatech/pmapi/refund/ProjectRefundTest.java View File

@@ -0,0 +1,42 @@
package com.ningdatech.pmapi.refund;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.pmapi.AppTests;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaration;
import com.ningdatech.pmapi.projectlib.service.IProjectRenewalFundDeclarationService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import java.util.Objects;

/**
* @Classname ProjectRefundTest
* @Description
* @Date 2023/9/7 15:08
* @Author PoffyZhang
*/
public class ProjectRefundTest extends AppTests {

@Autowired
private IProjectRenewalFundDeclarationService renewalFundDeclarationService;

@Autowired
private IProjectService projectService;

@Test
public void test(){
List<ProjectRenewalFundDeclaration> funds = renewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class));
for(ProjectRenewalFundDeclaration fund : funds){
if(StringUtils.isBlank(fund.getProjectCode())){
Project project = projectService.getById(fund.getProjectId());
if(Objects.nonNull(project)){
fund.setProjectCode(project.getProjectCode());
renewalFundDeclarationService.updateById(fund);
}
}
}
}
}

Loading…
Cancel
Save