Helius
2022-07-08 2b9bed85bac6906bd6c53bbe82057cc78d1af9f7
修改栏目发布bug
2 files modified
38 ■■■■ changed files
src/main/java/com/xcong/farmer/cms/modules/core/service/impl/CmsCoreServiceImpl.java 4 ●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ReleaseServiceImpl.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/modules/core/service/impl/CmsCoreServiceImpl.java
@@ -73,9 +73,7 @@
            templateName = "defualt.list.html";
        }
        synchronized (this) {
            cfg.process(data, templateName);
        }
        cfg.process(data, templateName);
    }
    @Override
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ReleaseServiceImpl.java
@@ -63,17 +63,7 @@
    @Override
    public void releaseColumn(Long id, int type, Long companyId) {
        ColumnEntity columnEntity = columnMapper.selectById(id);
        Map<String, Object> map = new Hashtable<>();
        map.put("id", columnEntity.getId());
        map.put("code", columnEntity.getColumnCode());
        if (columnEntity.getParentId() == 0L) {
            map.put("parentCode", columnEntity.getColumnCode());
        } else {
            ColumnEntity parent = columnMapper.selectById(columnEntity.getParentId());
            map.put("parentCode", parent.getColumnCode());
        }
        map.put("templatePath", columnEntity.getPath());
        map.put("companyId", companyId);
        Map<String, Object> map = buildColumnData(columnEntity);
        executor.execute(() -> {
            cmsCoreService.columnProcess(map, columnEntity.getListTemplate());
@@ -86,12 +76,11 @@
                    List<ColumnEntity> columns = columnMapper.selectColumnByParentId(columnEntity.getId(), companyId, 2);
                    if (CollUtil.isNotEmpty(columns)) {
                        for (ColumnEntity column : columns) {
                            map.put("id", column.getId());
                            map.put("code", column.getColumnCode());
                            cmsCoreService.columnProcess(map, column.getListTemplate());
                            Map<String, Object> data = buildColumnData(column);
                            cmsCoreService.columnProcess(data, column.getListTemplate());
                            List<Long> ids = articleMapper.selectArticleIdsByColumnId(column.getId(), companyId,type);
                            cmsCoreService.articlesProcess(map, ids, column.getArticleTemplate(), column.getPath());
                            cmsCoreService.articlesProcess(data, ids, column.getArticleTemplate(), column.getPath());
                        }
                    }
                }
@@ -104,6 +93,21 @@
        }
    }
    private Map<String, Object> buildColumnData(ColumnEntity columnEntity) {
        Map<String, Object> map = new Hashtable<>();
        map.put("id", columnEntity.getId());
        map.put("code", columnEntity.getColumnCode());
        if (columnEntity.getParentId() == 0L) {
            map.put("parentCode", columnEntity.getColumnCode());
        } else {
            ColumnEntity parent = columnMapper.selectById(columnEntity.getParentId());
            map.put("parentCode", parent.getColumnCode());
        }
        map.put("templatePath", columnEntity.getPath());
        map.put("companyId", columnEntity.getCompanyId());
        return map;
    }
    @Override
    public void releaseIndex(Long companyId) {
        Map<String, Object> map = new HashMap<>();