Merge remote-tracking branch 'origin/master'

master
cheney 2 years ago
commit 202b9d7846
  1. 13
      src/main/java/com/huoran/iasf/controller/SysColumnController.java
  2. 2
      src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml
  3. 9
      src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java

@ -159,6 +159,19 @@ public class SysColumnController {
@ApiOperation(value = "栏目排序(依据id更改)", response = SysColumn.class) @ApiOperation(value = "栏目排序(依据id更改)", response = SysColumn.class)
public R sortByColumn(@RequestBody List<SortColumnRespVO> sortColumnRespVOList) { public R sortByColumn(@RequestBody List<SortColumnRespVO> sortColumnRespVOList) {
for (SortColumnRespVO sort : sortColumnRespVOList) { for (SortColumnRespVO sort : sortColumnRespVOList) {
SysColumn column = service.getById(sort.getId());
QueryWrapper<SysColumn> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("column_name", column.getColumnName());
queryWrapper.eq("site_id", column.getSiteId());
queryWrapper.eq("father_id", sort.getFatherId());
queryWrapper.last(" and id <> " + sort.getId());
List<SysColumn> columnList = service.list(queryWrapper);
if (columnList.size() > 0) {
return R.fail("同级下已存在重复栏目:" + column.getColumnName());
}
SysColumn sysColumn = new SysColumn(); SysColumn sysColumn = new SysColumn();
BeanUtils.copyProperties(sort, sysColumn); BeanUtils.copyProperties(sort, sysColumn);
service.updateById(sysColumn); service.updateById(sysColumn);

@ -135,7 +135,7 @@
</when> </when>
<otherwise> <otherwise>
ORDER BY ORDER BY
t.create_time DESC t.sequence asc
</otherwise> </otherwise>
</choose> </choose>

@ -65,9 +65,10 @@ public class SysContentServiceImpl extends ServiceImpl<SysContentMapper, SysCont
public R articlePaginationList(PageContentReqVO reqVO) { public R articlePaginationList(PageContentReqVO reqVO) {
Page<PageContentRespVO> page = new Page<PageContentRespVO>(reqVO.getPageNum(), reqVO.getPageSize()); Page<PageContentRespVO> page = new Page<PageContentRespVO>(reqVO.getPageNum(), reqVO.getPageSize());
/*if (reqVO.getModifiedTimeSort() == null && reqVO.getPublicationTimeSort() == null) { //没传任何排序参数时候 默认以发布时间排序
if (reqVO.getModifiedTimeSort() == null && reqVO.getPublicationTimeSort() == null && reqVO.getOrdinalSort() == null) {
reqVO.setPublicationTimeSort(0); reqVO.setPublicationTimeSort(0);
}*/ }
/*if (reqVO.getIsDisable()!=null){ /*if (reqVO.getIsDisable()!=null){
if (reqVO.getIsDisable() == 1) { if (reqVO.getIsDisable() == 1) {
//是否禁用(0默认,0启用 1禁用) //是否禁用(0默认,0启用 1禁用)
@ -80,9 +81,9 @@ public class SysContentServiceImpl extends ServiceImpl<SysContentMapper, SysCont
@Override @Override
public R newlyPublishedArticles(PageContentReqVO reqVO) { public R newlyPublishedArticles(PageContentReqVO reqVO) {
if(reqVO.getRole()==null){ if (reqVO.getRole() == null) {
}else if (reqVO.getRole()!=null||reqVO.getRole().equals("admin") || ObjectUtil.isNotNull(reqVO.isIsadmin()) || reqVO.isIsadmin()){ } else if (reqVO.getRole() != null || reqVO.getRole().equals("admin") || ObjectUtil.isNotNull(reqVO.isIsadmin()) || reqVO.isIsadmin()) {
throw new IllegalArgumentException("参数名不能包含admin"); throw new IllegalArgumentException("参数名不能包含admin");
} }
Page<PageContentRespVO> page = new Page<PageContentRespVO>(reqVO.getPageNum(), reqVO.getPageSize()); Page<PageContentRespVO> page = new Page<PageContentRespVO>(reqVO.getPageNum(), reqVO.getPageSize());

Loading…
Cancel
Save