Browse Source

aps-排程结果回写,增加错误重调机制

sucheng 3 months ago
parent
commit
7352d07a26

+ 8 - 8
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsServiceImpl.java

@@ -855,14 +855,14 @@ public class ApsServiceImpl implements ApsService {
                     try {
                         apsBlankOrderService.ddApsAfter(productionScheduleRetVo, apsBlankOrders, currentUser, apsType);
                         isSuccess = true;
-                    } catch (SQLNonTransientConnectionException | CJCommunicationsException |
-                             SocketTimeoutException | CommunicationsException e) {
+                    } catch (Exception e) {
                         try {
                             Thread.sleep(120000);
                         } catch (InterruptedException ignored) {
                         }
-                    } catch (Exception e) {
-                        throw new CustomException(e.getMessage());
+                        if (i == 4) {
+                            throw new CustomException(e.getMessage());
+                        }
                     }
                 }
 
@@ -876,14 +876,14 @@ public class ApsServiceImpl implements ApsService {
                     try {
                         apsBlankOrderService.apsAfter(productionScheduleRetVo, apsBlankOrders, currentUser, apsType);
                         isSuccess = true;
-                    } catch (SQLNonTransientConnectionException | CJCommunicationsException |
-                             SocketTimeoutException | CommunicationsException e) {
+                    } catch (Exception e) {
                         try {
                             Thread.sleep(120000);
                         } catch (InterruptedException ignored) {
                         }
-                    } catch (Exception e) {
-                        throw new CustomException(e.getMessage());
+                        if (i == 4) {
+                            throw new CustomException(e.getMessage());
+                        }
                     }
                 }
             }