自动化立体仓库 - WMS系统
1
zhangc
9 天以前 cbbc882e4f93d87d91c1734901a7fc2ca0399774
src/main/java/com/zy/asrs/controller/StaDescController.java
@@ -37,6 +37,7 @@
    @RequestMapping(value = "/staDesc/init/auth")
    @ManagerAuth(memo = "初始化站点路径")
    public R init(StaDescInitParam param) {
        SqlSession sqlSession = null;
        try{
            if (param.getTypeDesc()==1){
                staDescService.delete(new EntityWrapper<>());
@@ -44,7 +45,7 @@
            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){
@@ -66,22 +67,19 @@
                        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");