Kaynağa Gözat

项目申报和归集 的并集

tags/24080901
PoffyZhang 1 yıl önce
ebeveyn
işleme
ed015ef7a5
1 değiştirilmiş dosya ile 42 ekleme ve 0 silme
  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 Dosyayı Görüntüle

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

Yükleniyor…
İptal
Kaydet