| | |
| | | try { |
| | | int state = 0; |
| | | String columnName = "fbzt"; |
| | | // updateState(viewId, idList, state, columnName); |
| | | updateState(viewId, idList, state, columnName); |
| | | QueryWrapper<CatAjjxx> fileQueryWrapper = new QueryWrapper<>(); |
| | | fileQueryWrapper.in("id",idList); |
| | | List<CatAjjxx> catAjjxxList=catAjjxxService.list(fileQueryWrapper); |
| | | ArchivesCustomConfig archivesCustomConfig = customConfigUtil.getConfigObj(ArchivesCustomConfig.class); |
| | | for (CatAjjxx catAjjxx:catAjjxxList){ |
| | | String wjlj = archivesCustomConfig.getOriginalPath() + "已入库" + File.separator + catAjjxx.getXmkyqbh() + "["+catAjjxx.getXmkyqmc()+"]"; |
| | | File file=new File(wjlj); |
| | | deleteDirectory(file); |
| | | } |
| | | return new AjaxResponse(true); |
| | | } catch (Exception e) { |
| | | logger.error(e.getMessage(), e); |
| | |
| | | public void updateState(Long viewId, ArrayList<Long> idList, Integer state, String columnName) { |
| | | View view = viewService.getViewById(viewId); |
| | | String strSql = "update " + view.getMainTableName() + " set " + columnName + " = " + state; |
| | | // jdbcTemplate.batchUpdate(strSql + " where " + view.getIdField() + "=?", new BatchPreparedStatementSetter() { |
| | | // @Override |
| | | // public void setValues(PreparedStatement ps, int i) throws SQLException { |
| | | // ps.setLong(1, idList.get(i));// 下标从1开始 |
| | | // } |
| | | // |
| | | // @Override |
| | | // public int getBatchSize() { |
| | | // return idList.size(); |
| | | // } |
| | | // }); |
| | | jdbcTemplate.batchUpdate(strSql + " where " + view.getIdField() + "=?", new BatchPreparedStatementSetter() { |
| | | @Override |
| | | public void setValues(PreparedStatement ps, int i) throws SQLException { |
| | | ps.setLong(1, idList.get(i));// 下标从1开始 |
| | | } |
| | | |
| | | @Override |
| | | public int getBatchSize() { |
| | | return idList.size(); |
| | | } |
| | | }); |
| | | strSql = "update cat_item_yswjxx set yszt = 0"; |
| | | jdbcTemplate.batchUpdate(strSql + " where aj_id=?", new BatchPreparedStatementSetter() { |
| | | @Override |
| | | public void setValues(PreparedStatement ps, int i) throws SQLException { |
| | | ps.setLong(1, idList.get(i));// 下标从1开始 |
| | | } |
| | | |
| | | @Override |
| | | public int getBatchSize() { |
| | | return idList.size(); |
| | | } |
| | | }); |
| | | |
| | | |
| | | } |
| | | |