cy
2023-02-09 60890359b3052847fb9e61d4675147aba20fec73
src/main/java/com/integrated/zyyt/service/ZyytService.java
@@ -1,6 +1,5 @@
package com.integrated.zyyt.service;
import com.alibaba.fastjson.JSON;
import com.integrated.zyyt.enetity.StationInfo;
import com.integrated.zyyt.enetity.YyztTDjtjb;
import com.integrated.zyyt.enetity.YyztTShkdrb;
@@ -48,7 +47,7 @@
        Long totalSize = 0L;
        int pageNum = 0;
        int pageSize = 2000;
        int pageSize = 1000;
        //设置回滚点
        Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint();
@@ -75,7 +74,7 @@
                    int fromIndex = i * batchSize;
                    // 结束位置
                    int toIndex = (i + 1) * batchSize < length ? (i + 1) * batchSize : length;
                    if (fromIndex == batchSize) {
                    if (fromIndex == length) {
                        continue;
                    }
                    System.out.println(fromIndex + " === " + toIndex);
@@ -85,7 +84,7 @@
                            @Override
                            public void setValues(PreparedStatement ps, int i) throws SQLException {
                                StationInfo stationInfo = stationInfoListCopy.get(i);
                                log.info("stationInfo==> {}", JSON.toJSONString(stationInfo));
//                                log.info("stationInfo==> {}", JSON.toJSONString(stationInfo));
                                ps.setObject(1, stationInfo.getVJgbh());
@@ -154,6 +153,8 @@
                            }
                        });
                    } catch (Exception e) {
                        log.error("设置参数值报错了");
                        e.printStackTrace();
                        log.error(e.getMessage());
                        //手工回滚异常
                        TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint);
@@ -197,7 +198,7 @@
        Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint();
        try {
            int pageNum = 0;
            int pageSize = 500;
            int pageSize = 1000;
            String batchInsertSql = "INSERT INTO YYZT_T_SHKDRB (\"V_SFDM\",\"V_SFMC\",\"V_DSDM\",\"V_DSMC\",\"V_QXDM\",\"V_XSMC\",\"V_TDJGBH\",\"V_TDJGMC\",\"V_JGBH\",\"V_JGMC\",\"D_RBRQ\",\"N_ZGYZLJS\",\"N_ZGYZQJS\",\"N_SHKDLJS\",\"N_SHKDQJS\",\"N_ZTLJS\",\"N_ZTQJS\",\"N_YTLJS\",\"N_YTQJS\",\"N_STLJS\",\"N_STQJS\",\"N_BSLJS\",\"N_BSQJS\",\"N_YDLJS\",\"N_YDQJS\",\"N_YFLJS\",\"N_YFQJS\",\"N_JDLJS\",\"N_JDQJS\",\"N_JTLJS\",\"N_JTQJS\",\"N_TTLJS\",\"N_TTQJS\",\"N_DBLJS\",\"N_DBQJS\",\"N_DNLJS\",\"N_DNQJS\",\"N_FWLJS\",\"N_FWQJS\",\"N_YSLJS\",\"N_YSQJS\",\"N_QTLJS\",\"N_QTQJS\",\"RESERVED1\",\"RESERVED2\",\"RESERVED3\",\"RESERVED4\",\"BATCH_NO\") VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
@@ -223,7 +224,7 @@
                    int fromIndex = i * batchSize;
                    // 结束位置
                    int toIndex = (i + 1) * batchSize < length ? (i + 1) * batchSize : length;
                    if (fromIndex == batchSize) {
                    if (fromIndex == length) {
                        continue;
                    }
                    List<YyztTShkdrb> yyztTShkdrbs = stationInfoList.subList(fromIndex, toIndex);
@@ -324,7 +325,7 @@
        try {
            int pageNum = 0;
            int pageSize = 500;
            int pageSize = 1000;
            String batchInsertSql = "INSERT INTO YYZT_T_DJTJB (\"V_SFDM\", \"V_SFMC\", \"V_DSDM\", \"V_DSMC\", \"V_QXDM\", \"V_XSMC\", \"V_TDJGBH\", \"V_JGBH\", \"V_JGMC\", \"D_RBRQ\", \"V_YLGZDID\", \"V_YLGZDMC\", \"N_SJYWL\", \"N_TKYWL\", \"N_BKYEL\", \"N_SJZJE\", \"N_TKSR\", \"N_BKSR\", \"BATCH_NO\") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
            // 查询总数
@@ -348,7 +349,7 @@
                    int fromIndex = i * batchSize;
                    // 结束位置
                    int toIndex = (i + 1) * batchSize < length ? (i + 1) * batchSize : length;
                    if (fromIndex == batchSize) {
                    if (fromIndex == length) {
                        continue;
                    }
                    System.out.println(fromIndex + " === " + toIndex);