|
|
@@ -1,8 +1,15 @@
|
|
|
package com.izouma.zhirongip.service;
|
|
|
|
|
|
import com.izouma.zhirongip.ApplicationTests;
|
|
|
+import com.izouma.zhirongip.domain.supply.Copyright;
|
|
|
+import com.izouma.zhirongip.domain.supply.Logo;
|
|
|
+import com.izouma.zhirongip.domain.supply.Patent;
|
|
|
+import com.izouma.zhirongip.domain.supply.TechnologyProduct;
|
|
|
import com.izouma.zhirongip.dto.SearchDTO;
|
|
|
+import com.izouma.zhirongip.repo.supply.CopyrightRepo;
|
|
|
+import com.izouma.zhirongip.repo.supply.LogoRepo;
|
|
|
import com.izouma.zhirongip.repo.supply.PatentRepo;
|
|
|
+import com.izouma.zhirongip.repo.supply.TechnologyProductRepo;
|
|
|
import org.junit.Test;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.ApplicationContext;
|
|
|
@@ -17,6 +24,15 @@ public class AllServiceTest extends ApplicationTests {
|
|
|
@Autowired
|
|
|
private ApplicationContext applicationContext;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PatentRepo patentRepo;
|
|
|
+ @Autowired
|
|
|
+ private LogoRepo logoRepo;
|
|
|
+ @Autowired
|
|
|
+ private CopyrightRepo copyrightRepo;
|
|
|
+ @Autowired
|
|
|
+ private TechnologyProductRepo technologyProductRepo;
|
|
|
+
|
|
|
@Test
|
|
|
public void search() {
|
|
|
List<SearchDTO> search = allService.search("1");
|
|
|
@@ -29,4 +45,31 @@ public class AllServiceTest extends ApplicationTests {
|
|
|
PatentRepo patentRepo = applicationContext.getBean(PatentRepo.class);
|
|
|
patentRepo.addView(237L);
|
|
|
}
|
|
|
+
|
|
|
+// @Test
|
|
|
+// public void test2() {
|
|
|
+// List<Logo> logos= logoRepo.findAll();
|
|
|
+// logos.forEach(item ->{
|
|
|
+// if(item.getTradingMethod()!=null){
|
|
|
+// item.setTradingMethodId(item.getTradingMethod().getId());
|
|
|
+// logoRepo.save(item);
|
|
|
+// }
|
|
|
+// });
|
|
|
+// List<Copyright> copys= copyrightRepo.findAll();
|
|
|
+// copys.forEach(item ->{
|
|
|
+// if(item.getTradingMethod()!=null){
|
|
|
+// item.setTradingMethodId(item.getTradingMethod().getId());
|
|
|
+// copyrightRepo.save(item);
|
|
|
+// }
|
|
|
+// });
|
|
|
+// List<TechnologyProduct> tecs= technologyProductRepo.findAll();
|
|
|
+// tecs.forEach(item ->{
|
|
|
+// if(item.getTradingMethod()!=null){
|
|
|
+// item.setTradingMethodId(item.getTradingMethod().getId());
|
|
|
+// technologyProductRepo.save(item);
|
|
|
+// }
|
|
|
+// });
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
}
|