|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private ColumnMapper columnMapper = SpringContextHolder.getBean(ColumnMapper.class); | 
|---|
|  |  |  | private ArticleMapper articleMapper = SpringContextHolder.getBean(ArticleMapper.class); | 
|---|
|  |  |  | private CmsProperties cmsProperties = SpringContextHolder.getBean(CmsProperties.class); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private String baseUrl = ""; | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public void dataParser(AttrNode attrNode) { | 
|---|
|  |  |  | log.info("栏目解析"); | 
|---|
|  |  |  | //        log.info("栏目解析"); | 
|---|
|  |  |  | Long companyId = (Long) attrNode.getSystemDataValue("companyId"); | 
|---|
|  |  |  | baseUrl = (String) attrNode.getSystemDataValue("baseUrl"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Column param = (Column) attrNode.getParam(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | public ColumnData columnToData(ColumnEntity column) { | 
|---|
|  |  |  | ColumnData columnData = ColumnConversion.INSTANCE.entityToData(column); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | columnData.setUrl(cmsProperties.getBaseUrl() + column.getPath()); | 
|---|
|  |  |  | columnData.setUrl(baseUrl + column.getPath()); | 
|---|
|  |  |  | if (column.getType() == 2) { | 
|---|
|  |  |  | if (column.getTargetType() == 1) { | 
|---|
|  |  |  | ArticleEntity article = this.articleMapper.selectArticleById(Long.parseLong(column.getTargetUrl())); | 
|---|
|  |  |  | columnData.setUrl(cmsProperties.getBaseUrl() + article.getPath() + "/" + article.getId() + ".html"); | 
|---|
|  |  |  | columnData.setUrl(baseUrl + article.getPath() + "/" + article.getId() + ".html"); | 
|---|
|  |  |  | } else if (column.getTargetType() == 2) { | 
|---|
|  |  |  | ColumnEntity columnEntity = this.columnMapper.selectByCodeAndCompanyId(column.getTargetUrl(), column.getCompanyId()); | 
|---|
|  |  |  | columnData.setUrl(cmsProperties.getBaseUrl() + columnEntity.getPath()); | 
|---|
|  |  |  | columnData.setUrl(baseUrl + columnEntity.getPath()); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | columnData.setUrl(column.getTargetUrl()); | 
|---|
|  |  |  | } | 
|---|