feat:修改专题活动service

special-20250331
wangxy 5 days ago
parent 33f9cce7d1
commit 305381a7ab

@ -73,7 +73,7 @@ public class ColumnTreeController extends BaseController {
LambdaQueryWrapper<SysColumn> tagWrapper = new LambdaQueryWrapper<>();
tagWrapper.eq(SysColumn::getColumnId, columnId)
.eq(SysColumn::getColumnGrade, COLUMN_GRADE)
.eq(SysColumn::getStatus,STATUS)
.eq(SysColumn::getStatus, STATUS)
.orderByAsc(SysColumn::getOrderNum);
List<SysColumn> datas = columnService.list(tagWrapper);
List<SysColumnVO> tagTreeVOList = new ArrayList<>(Convert.toList(SysColumnVO.class, datas));
@ -113,21 +113,21 @@ public class ColumnTreeController extends BaseController {
@ApiOperation("获取专题栏目")
@GetMapping("/getSpecial")
public R<PageInfo<SysSpecialVo>> getSpecial(@RequestParam(required = false) String id,
@RequestParam(required = false) String columnId) {
public R<List<SysSpecialVo>> getSpecial(@RequestParam(required = false) String columnId,
@RequestParam(required = false, defaultValue = "1") String type) {
List<SysSpecialVo> sysSpecialVos = new ArrayList<>();
LambdaQueryWrapper<SysColumn> columnQueryWrapper = new LambdaQueryWrapper<>();
columnQueryWrapper.eq(SysColumn::getStatus, STATUS);
if(StringUtils.isNotEmpty(columnId)){
if(Objects.equals(type, COLUMN_GRADE)){
columnQueryWrapper.eq(SysColumn::getColumnId, columnId);
}else{
columnQueryWrapper.eq(SysColumn::getParentId, id);
columnQueryWrapper.eq(SysColumn::getParentId, columnId);
}
columnQueryWrapper.orderByAsc(SysColumn::getOrderNum);
List<SysColumn> columns = columnService.list(columnQueryWrapper);
if (columns.isEmpty() && Objects.isNull(columnId)) {
if (columns.isEmpty() && !Objects.equals(type, COLUMN_GRADE)) {
columnQueryWrapper.clear();
columnQueryWrapper.eq(SysColumn::getColumnId, id)
columnQueryWrapper.eq(SysColumn::getColumnId, columnId)
.eq(SysColumn::getStatus, STATUS)
.orderByAsc(SysColumn::getOrderNum);
columns = columnService.list(columnQueryWrapper);
@ -141,10 +141,9 @@ public class ColumnTreeController extends BaseController {
.eq(SysSpecial::getStatus, STATUS)
.orderByDesc(SysSpecial::getCreateTime)
.list();
sysSpecialVo.setSysSpecials(specialList);
sysSpecialVo.setSysSpecials(PageInfo.of(specialList));
sysSpecialVos.add(sysSpecialVo);
});
PageInfo<SysSpecialVo> page = PageInfo.of(sysSpecialVos);
return R.ok(page);
return R.ok(sysSpecialVos);
}
}

@ -297,19 +297,7 @@ public class HomeController {
@ApiOperation("专题活动")
@GetMapping("/special_view.html")
public String special(ModelMap mmap,
@RequestParam(required = false, defaultValue = "1", value = "p") Integer pageNum,
@RequestParam(required = false ,defaultValue = PAGE_SIZE, value = "ps") Integer pageSize,
@RequestParam(required = false ) String columnId
) {
PageMethod.startPage(pageNum,pageSize);
//专题活动
SysSpecial sysSpecial = new SysSpecial();
sysSpecial.setStatus(STATUS);
sysSpecial.setColumnId(columnId);
List<SysSpecial> specialList = specialService.selectSysSpecialList(sysSpecial);
PageInfo<SysSpecial> page = new PageInfo<>(specialList, pageSize);
mmap.put("page", page);
mmap.put("pageUrl", "/special_view.html");
String columnId) {
mmap.put("columnId", columnId);
return "home/special_view";
}

@ -219,7 +219,7 @@
</blockquote>
<br>
<p><i class="layui-icon layui-icon-location"></i>当前位置:<a target="_parent" href="base.html">首页</a>&nbsp;/&nbsp;<a
href="special_view.html" target="_parent">专题活动</a></p>
href="special_list.html" target="_parent">专题活动</a></p>
<hr>
<br>
<div class="container">

@ -1,5 +1,6 @@
package com.ruoyi.system.domain;
import com.github.pagehelper.PageInfo;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@ -20,7 +21,7 @@ public class SysSpecialVo implements Serializable {
private String columnName;
private List<SysSpecial> sysSpecials ;
private PageInfo<SysSpecial> sysSpecials ;

Loading…
Cancel
Save