Commit 6da60ff1ee02cea1bafb064b134ddead4797de73
1 parent
910ac5e0
update...
Showing
1 changed file
with
4 additions
and
3 deletions
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| @@ -387,7 +387,7 @@ public class DayOfSchedule { | @@ -387,7 +387,7 @@ public class DayOfSchedule { | ||
| 387 | * @Title: batchSave | 387 | * @Title: batchSave |
| 388 | * @Description: TODO(批量入库) | 388 | * @Description: TODO(批量入库) |
| 389 | */ | 389 | */ |
| 390 | - private void batchSave(final List<ScheduleRealInfo> list) { | 390 | + private void batchSave(List<ScheduleRealInfo> list) { |
| 391 | // 查询数据库最大ID | 391 | // 查询数据库最大ID |
| 392 | Long id = schRepository.getMaxId(); | 392 | Long id = schRepository.getMaxId(); |
| 393 | if (null == id) | 393 | if (null == id) |
| @@ -408,12 +408,13 @@ public class DayOfSchedule { | @@ -408,12 +408,13 @@ public class DayOfSchedule { | ||
| 408 | TransactionStatus status = tran.getTransaction(def); | 408 | TransactionStatus status = tran.getTransaction(def); |
| 409 | 409 | ||
| 410 | try{ | 410 | try{ |
| 411 | + final List<ScheduleRealInfo> pstList = list; | ||
| 411 | //写入 | 412 | //写入 |
| 412 | jdbcTemplate.batchUpdate("insert into bsth_c_s_sp_info_real(id,bc_type,bcs,bcsj,cl_zbh,create_date,dfsj,directive_state,fcno,fcsj,fcsj_actual,j_gh,j_name,jhlc,lp_name,qdz_code,qdz_name,real_exec_date,remarks,s_gh,s_name,schedule_date,schedule_date_str,sflj,sp_id,status,update_date,xl_bm,xl_dir,xl_name,zdsj,zdsj_actual,zdz_code,zdz_name,ccno,df_auto,fgs_bm,fgs_name,gs_bm,gs_name,online,adjust_exps,reissue,jhlc_orig,sigin_compate,drift_status,cc_service,major_station_name)" + | 413 | jdbcTemplate.batchUpdate("insert into bsth_c_s_sp_info_real(id,bc_type,bcs,bcsj,cl_zbh,create_date,dfsj,directive_state,fcno,fcsj,fcsj_actual,j_gh,j_name,jhlc,lp_name,qdz_code,qdz_name,real_exec_date,remarks,s_gh,s_name,schedule_date,schedule_date_str,sflj,sp_id,status,update_date,xl_bm,xl_dir,xl_name,zdsj,zdsj_actual,zdz_code,zdz_name,ccno,df_auto,fgs_bm,fgs_name,gs_bm,gs_name,online,adjust_exps,reissue,jhlc_orig,sigin_compate,drift_status,cc_service,major_station_name)" + |
| 413 | " VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", new BatchPreparedStatementSetter() { | 414 | " VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", new BatchPreparedStatementSetter() { |
| 414 | @Override | 415 | @Override |
| 415 | public void setValues(PreparedStatement ps, int i) throws SQLException { | 416 | public void setValues(PreparedStatement ps, int i) throws SQLException { |
| 416 | - ScheduleRealInfo sch = list.get(i); | 417 | + ScheduleRealInfo sch = pstList.get(i); |
| 417 | ps.setLong(1, sch.getId()); | 418 | ps.setLong(1, sch.getId()); |
| 418 | ps.setString(2, sch.getBcType()); | 419 | ps.setString(2, sch.getBcType()); |
| 419 | ps.setInt(3, sch.getBcs()==null?0:sch.getBcs()); | 420 | ps.setInt(3, sch.getBcs()==null?0:sch.getBcs()); |
| @@ -466,7 +467,7 @@ public class DayOfSchedule { | @@ -466,7 +467,7 @@ public class DayOfSchedule { | ||
| 466 | 467 | ||
| 467 | @Override | 468 | @Override |
| 468 | public int getBatchSize() { | 469 | public int getBatchSize() { |
| 469 | - return list.size(); | 470 | + return pstList.size(); |
| 470 | } | 471 | } |
| 471 | }); | 472 | }); |
| 472 | 473 |