| | |
| | | if(CollUtil.isNotEmpty(columnEntities) && columnEntities.size() > 1){ |
| | | return Result.fail("栏目编码不能重复"); |
| | | } |
| | | |
| | | // 判断是否编辑了栏目编码且此时栏目处于已发布的状态,然后保存之前的编码。因为如果是未发布状态,多次保存的话,容易覆盖真正的最开始的栏目编码 |
| | | if (!columnEntity.getColumnCode().equals(columnCode) && columnEntity.getReleaseState() == 1) { |
| | | columnEntity.setBeforeColumnCode(columnCode); |
| | | } |
| | | columnEntity.setColumnCode(columnCode); |
| | | |
| | | String remark = adminUpdateColumnDto.getRemark(); |
| | | columnEntity.setRemark(remark); |
| | | String pic = adminUpdateColumnDto.getPic(); |
| | |
| | | columnEntity.setOrderNum(orderNum); |
| | | } |
| | | Long parentId = adminUpdateColumnDto.getParentId(); |
| | | // 同栏目编码 |
| | | if (!columnEntity.getParentId().equals(parentId) && columnEntity.getReleaseState() == 1) { |
| | | columnEntity.setBeforeParentId(columnEntity.getParentId()); |
| | | } |
| | | |
| | | if(ObjectUtil.isEmpty(parentId)){ |
| | | columnEntity.setParentId(ColumnEntity.PARENTID_DEFAULT); |
| | | columnEntity.setPath("/" + columnEntity.getColumnCode()); |
| | |
| | | columnEntity.setTargetUrl(adminUpdateColumnDto.getTargetUrl()); |
| | | columnEntity.setIsNav(adminUpdateColumnDto.getIsNav()); |
| | | columnEntity.setContentType(adminUpdateColumnDto.getContentType()); |
| | | columnEntity.setReleaseState(2); |
| | | this.baseMapper.updateById(columnEntity); |
| | | return Result.ok("更新成功"); |
| | | } |