|
|
@@ -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); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |