Browse Source

照片创建慢修改

qinhouyu 1 year ago
parent
commit
cbad81210a

+ 12 - 2
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEngineeringCivilServiceImpl.java

@@ -29,6 +29,7 @@ import org.hibernate.validator.internal.util.stereotypes.Lazy;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Async;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.ObjectUtils;
@@ -1059,8 +1060,16 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
                 MonthTableNameHandler.setData(format.format(item.getCreateTime()));
                 zEngineeringInfoMapper.update(lqw);
                 MonthTableNameHandler.removeData();
-                izEngiineeringPhotoService.writeImg(infoIdList.getInfoIdList(), item);
+                try {
+                    threadPoolTaskExecutor.execute(()->{
+                        izEngiineeringPhotoService.writeImg(infoIdList.getInfoIdList(), item);
+                    });
+                }catch (Exception e){
+                    e.getStackTrace();
+                }finally {
+                }
             });
+            threadPoolTaskExecutor.shutdown();
 
             izEngineeringReviewService.insert(zEngineeringReviewBo);
         } catch (Exception e) {
@@ -1068,7 +1077,8 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
         }
         return 0;
     }
-
+    @Autowired
+    private ThreadPoolTaskExecutor threadPoolTaskExecutor;
 
     @Override
     public List<ZEngineeringNodeBo> getRivewStatus(String Id) {