yaozhixue 1 year ago
parent
commit
c70c69de03

+ 3 - 1
src/main/java/com/zfire/jiasm/syncdata/download/order/testt.java

@@ -2,6 +2,8 @@ package com.zfire.jiasm.syncdata.download.order;
 
 import com.zfire.jiasm.syncdata.service.AddRepairBusinessService;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
 
@@ -12,7 +14,7 @@ public class testt {
     @Resource
     AddRepairBusinessService addRepairBusinessService;
 
-
+    // @Scheduled(fixedDelay = 1 * 1 * 5000)
     public void test() {
         try{
             addRepairBusinessService.csfun();

+ 27 - 5
src/main/java/com/zfire/jiasm/syncdata/service/impl/AddRepairBusinessServiceImpl.java

@@ -2758,15 +2758,37 @@ public class AddRepairBusinessServiceImpl implements AddRepairBusinessService {
 
     // //////////////////////////////////////////
     @Override
-    @Transactional(rollbackFor = Exception.class)
+    // @Transactional(rollbackFor = Exception.class)
     public Boolean csfun() throws Exception {
         List<Brand> addmx = new ArrayList<>();
         List<Brand> upMxd = new ArrayList<>();
         List<Test> ttt = new ArrayList<>();
-        // 取数据
-        csfuna(upMxd,ttt);
-        // 表中插入数据
-        csfunb(addmx,upMxd,ttt);
+        List<Test> tx = new ArrayList<>();
+
+        try {
+            try{
+                Test tt = new Test();
+                tt.setId("1");
+                tx.add(tt);
+                testService.saveBatch(tx);
+            } catch (Exception ex) {
+                log.error("A失败:", ex);
+            }
+
+            Test t = new Test();
+            t.setId("2");
+            ttt.add(t);
+            testService.saveBatch(ttt);
+
+
+        } catch (Exception ex) {
+            log.error("B失败:", ex);
+        }
+
+
+
+
+
 
         // 网络请求
         // csfunbc();

+ 2 - 2
src/main/java/com/zfire/jiasm/syncdata/upload/DownTest.java

@@ -9,7 +9,7 @@ import javax.annotation.Resource;
 
 
 @Slf4j
-@Component
+// @Component
 public class DownTest {
     @Resource
     GreeLogic greeLogic;
@@ -17,7 +17,7 @@ public class DownTest {
 
 
 
-    @Scheduled(fixedDelay = 1 * 60 * 1000)
+    @Scheduled(fixedDelay = 1 * 1 * 5000)
     public void testProcess() throws Exception {
         // Map<String, Object>  test = greeLogic.greeDownFile("1_p_230209_S2105410_1623559064415977474.jpeg");
         // log.info("test: {}",test);

+ 1 - 1
src/main/resources/bootstrap.properties

@@ -1,4 +1,4 @@
-spring.profiles.active=test
+spring.profiles.active=dev
 spring.application.name=jiasm-syncdata
 spring.main.allow-bean-definition-overriding=true
 # 修改线程池的拒绝策略