fix
Helius
2022-07-12 85c0fd73a5286de23ef5e579f4dfadfa63217d8b
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ColumnServiceImpl.java
@@ -197,9 +197,11 @@
        String columnCode = adminUpdateColumnDto.getColumnCode();
        ColumnEntity updateEntity = ColumnConversion.INSTANCE.updateDtoToEntity(adminUpdateColumnDto);
        if (!columnEntity.getColumnCode().equals(columnCode)) {
        ColumnEntity hasExist = this.baseMapper.selectByCodeAndCompanyId(columnCode, companyId);
        if(ObjectUtil.isNotEmpty(hasExist)){
            return Result.fail("栏目编码不能重复");
            }
        }
        Long parentId = adminUpdateColumnDto.getParentId();
@@ -213,10 +215,12 @@
        }
        // 若编码进行了修改且该栏目为父栏目,则需要同步修改子栏目的path。
        if (!columnEntity.getColumnCode().equals(columnCode) && "-1".equals(columnEntity.getColumnCode())) {
            updateEntity.setBeforeColumnCode(columnCode);
        if (!columnEntity.getColumnCode().equals(columnCode)) {
            if ("-1".equals(columnEntity.getBeforeColumnCode())) {
                updateEntity.setBeforeColumnCode(columnEntity.getColumnCode());
            }
            if (adminUpdateColumnDto.getParentId() == 0L) {
            if (updateEntity.getParentId() == 0L) {
                List<ColumnEntity> childColumn = this.baseMapper.selectColumnByParentId(columnEntity.getId(), companyId, 2);
                if (CollUtil.isNotEmpty(childColumn)) {
                    for (ColumnEntity child : childColumn) {