|
|
|
@ -159,7 +159,17 @@ public class SysContentServiceImpl extends ServiceImpl<SysContentMapper, SysCont |
|
|
|
|
//获取当前文章所属栏目id
|
|
|
|
|
Integer columnId = content.getColumnId(); |
|
|
|
|
|
|
|
|
|
if (currentSerialNumber.equals(sequenceNumber)){ |
|
|
|
|
//获取栏目下全部文章的数量与当前输入的序号判断 如果要更改的序号大于当前有的数量,直接替换
|
|
|
|
|
QueryWrapper<SysContent> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("column_id", columnId); |
|
|
|
|
queryWrapper.eq("deleted", 1); |
|
|
|
|
List<SysContent> contentList = baseMapper.selectList(queryWrapper); |
|
|
|
|
if (sequenceNumber >= contentList.size()) { |
|
|
|
|
sequenceNumber = contentList.size(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (currentSerialNumber.equals(sequenceNumber)) { |
|
|
|
|
return R.success(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -178,7 +188,7 @@ public class SysContentServiceImpl extends ServiceImpl<SysContentMapper, SysCont |
|
|
|
|
if (currentSerialNumber > sequenceNumber) { |
|
|
|
|
//改大 gt >
|
|
|
|
|
updateWrapper1.setSql(" sequence = sequence + 1"); |
|
|
|
|
updateWrapper1.last(" and sequence >= "+sequenceNumber+ " and sequence < "+currentSerialNumber); |
|
|
|
|
updateWrapper1.last(" and sequence >= " + sequenceNumber + " and sequence < " + currentSerialNumber); |
|
|
|
|
} else if (currentSerialNumber < sequenceNumber) { |
|
|
|
|
//改小
|
|
|
|
|
updateWrapper1.le("sequence", sequenceNumber); |
|
|
|
|