| | |
| | | @RequestMapping(value = "/staDesc/init/auth") |
| | | @ManagerAuth(memo = "初始化站点路径") |
| | | public R init(StaDescInitParam param) { |
| | | SqlSession sqlSession = null; |
| | | try{ |
| | | if (param.getTypeDesc()==1){ |
| | | staDescService.delete(new EntityWrapper<>()); |
| | |
| | | String[] startStaList = param.getStartStaList().split(";"); |
| | | String[] endStaList = param.getEndStaList().split(";"); |
| | | List<StaDesc> staDescList = new ArrayList<>(); |
| | | SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH,false); |
| | | sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH,false); |
| | | StaDescMapper sqlSessionMapper = sqlSession.getMapper(StaDescMapper.class); |
| | | for (String startSta : startStaList){ |
| | | for (String endSta : endStaList){ |
| | |
| | | staDesc.setModiTime(new Date()); |
| | | staDesc.setAppeUser(getUserId()); |
| | | staDesc.setAppeTime(new Date()); |
| | | // staDescList.add(staDesc); |
| | | sqlSessionMapper.insert(staDesc); |
| | | |
| | | // staDescList.add(staDesc); |
| | | } |
| | | } |
| | | } |
| | | try{ |
| | | sqlSession.commit(); |
| | | sqlSession.close(); |
| | | }catch (Exception e){ |
| | | log.error("初始化站点路径异常===>sql异常:{}",e.getMessage()); |
| | | } |
| | | sqlSession.flushStatements(); |
| | | sqlSession.clearCache(); |
| | | |
| | | // staDescService.insertBatch(staDescList); |
| | | }catch (Exception e){ |
| | | log.error("初始化站点路径异常:{}",e.getMessage()); |
| | | return R.error("初始化站点路径异常:"+e.getMessage()); |
| | | return R.error(e.getMessage()); |
| | | }finally { |
| | | sqlSession.close(); |
| | | } |
| | | |
| | | return R.ok("ok1").add("ok2"); |