Browse Source

代码bug修复

zhouy 2 năm trước cách đây
mục cha
commit
cc978a38f1
1 tập tin đã thay đổi với 16 bổ sung3 xóa
  1. 16 3
      src/main/java/com/uas/eis/serviceImpl/InsertServiceImpl.java

+ 16 - 3
src/main/java/com/uas/eis/serviceImpl/InsertServiceImpl.java

@@ -44,6 +44,8 @@ public class InsertServiceImpl implements InsertService {
     //    public static final String sessionKey = "61024291979328cd09f0ba138f79236d66bd313f3364cf148715824"; // 必须替换为沙箱账号授权得到的真实有效sessionKey    /* 待修改 */
     public static Logger logger = Logger.getLogger(InsertServiceImpl.class);
 
+    private final int maxNums = 80;
+
     @Autowired
     private BaseDao baseDao;
 
@@ -75,7 +77,7 @@ public class InsertServiceImpl implements InsertService {
     }
 
     @Autowired
-    @Scheduled(cron = "0 0/3 * * * ?")
+    @Scheduled(cron = "0 0/8 * * * ?")
     public void getAllDate() {
 
 //        1.无淘宝自动抓取的 订单 ,则正常备份历史订单
@@ -335,10 +337,21 @@ public class InsertServiceImpl implements InsertService {
             logger.info("执行插入----");
             baseDao.execute(insertSqlsList);
             logger.info("存储过程调用-----"+StringUtils.join(saleIDS, ',') );
+            //int maxSaleID  = saleIDS.get(saleIDS.size()-1);
+
             if(saleIDS.size()>0) {
-                baseDao.callProcedure("SP_UPDATE_SALE", StringUtils.join(saleIDS, ','));
+                int cur = saleIDS.size()/maxNums;
+                int ys = saleIDS.size()%maxNums;
+                if(cur > 0) {
+                    for(int i=0; i< cur ;i++){
+                        baseDao.callProcedure("SP_UPDATE_SALE", StringUtils.join(saleIDS.subList(i*maxNums,(i+1)*maxNums), ','));
+                    }
+                }
+                if(ys > 0) {
+                    baseDao.callProcedure("SP_UPDATE_SALE", StringUtils.join(saleIDS.subList(saleIDS.size()-ys,saleIDS.size()), ','));
+                }
             }
-            logger.info("存储过程成功-----");
+
 
 
         }catch (Exception e) {