This commit is contained in:
pengjie 2026-01-07 10:53:43 +08:00
parent 93cddd74f8
commit 4f3ac61a6a
5 changed files with 90 additions and 5 deletions

View File

@ -37,28 +37,28 @@ public class VideoConfigController {
@Operation(summary = "分页查询 @author pengjie")
@PostMapping("/videoConfig/queryPage")
@SaCheckPermission("videoConfig:query")
// @SaCheckPermission("videoConfig:query")
public ResponseDTO<PageResult<VideoConfigVO>> queryPage(@RequestBody @Valid VideoConfigQueryForm queryForm) {
return ResponseDTO.ok(videoConfigService.queryPage(queryForm));
}
@Operation(summary = "添加 @author pengjie")
@PostMapping("/videoConfig/add")
@SaCheckPermission("videoConfig:add")
// @SaCheckPermission("videoConfig:add")
public ResponseDTO<String> add(@RequestBody @Valid VideoConfigAddForm addForm) {
return videoConfigService.add(addForm);
}
@Operation(summary = "更新 @author pengjie")
@PostMapping("/videoConfig/update")
@SaCheckPermission("videoConfig:update")
// @SaCheckPermission("videoConfig:update")
public ResponseDTO<String> update(@RequestBody @Valid VideoConfigUpdateForm updateForm) {
return videoConfigService.update(updateForm);
}
@Operation(summary = "单个删除 @author pengjie")
@GetMapping("/videoConfig/delete/{id}")
@SaCheckPermission("videoConfig:delete")
// @SaCheckPermission("videoConfig:delete")
public ResponseDTO<String> batchDelete(@PathVariable Long id) {
return videoConfigService.delete(id);
}

View File

@ -93,7 +93,7 @@ public class VideoConfigService {
public ResponseDTO<String> updateEnable(Map<String, Object> map) {
LambdaUpdateWrapper<VideoConfigEntity> wrapper = Wrappers.<VideoConfigEntity>lambdaUpdate();
wrapper.set(VideoConfigEntity::getIsEnable, 0);
wrapper.set(VideoConfigEntity::getVillageId, SmartRequestUtil.getRequestUser().getVillageId());
wrapper.eq(VideoConfigEntity::getVillageId, SmartRequestUtil.getRequestUser().getVillageId());
videoConfigManager.update(wrapper);
VideoConfigEntity videoConfig = videoConfigDao.selectOne(Wrappers.<VideoConfigEntity>lambdaQuery()
.eq(VideoConfigEntity::getVillageId, SmartRequestUtil.getRequestUser().getVillageId())

View File

@ -0,0 +1,44 @@
package net.lab1024.sa.admin.module.business.travel.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import net.lab1024.sa.admin.module.business.travel.domain.form.LandscapeQueryForm;
import net.lab1024.sa.admin.module.business.travel.domain.vo.LandscapeTypeVO;
import net.lab1024.sa.admin.module.business.travel.domain.vo.LandscapeVO;
import net.lab1024.sa.admin.module.business.travel.service.LandscapeService;
import net.lab1024.sa.base.common.domain.PageResult;
import net.lab1024.sa.base.common.domain.ResponseDTO;
import net.lab1024.sa.base.module.support.dict.dao.DictValueDao;
import net.lab1024.sa.base.module.support.dict.domain.vo.DictValueVO;
import net.lab1024.sa.base.module.support.dict.service.DictCacheService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
/**
* 文旅大屏 Controller
*
* @Author pengjie
* @Date 2025-08-06 10:05:52
* @Copyright jxj
*/
@RestController
@Tag(name = "乡村文旅大屏")
public class TravelIndexController {
@Resource
private LandscapeService landscapeService;
@Operation(summary = "景区类型统计 @author pengjie")
@GetMapping("/landscapeIndex/landscapeTypeState")
public ResponseDTO<List<LandscapeTypeVO>> landscapeTypeState() {
return ResponseDTO.ok(landscapeService.landscapeTypeState());
}
}

View File

@ -0,0 +1,25 @@
package net.lab1024.sa.admin.module.business.travel.domain.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 景区类型统计 VO
*
* @Author pengjie
* @Date 2025-08-06 10:02:18
* @Copyright jxj
*/
@Data
public class LandscapeTypeVO {
@Schema(description = "景区类型名称")
private String typeName;
@Schema(description = "数量")
private Integer number;
}

View File

@ -1,5 +1,6 @@
package net.lab1024.sa.admin.module.business.travel.service;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@ -9,6 +10,7 @@ import net.lab1024.sa.admin.module.business.travel.domain.entity.*;
import net.lab1024.sa.admin.module.business.travel.domain.form.LandscapeAddForm;
import net.lab1024.sa.admin.module.business.travel.domain.form.LandscapeQueryForm;
import net.lab1024.sa.admin.module.business.travel.domain.form.LandscapeUpdateForm;
import net.lab1024.sa.admin.module.business.travel.domain.vo.LandscapeTypeVO;
import net.lab1024.sa.admin.module.business.travel.domain.vo.LandscapeVO;
import net.lab1024.sa.admin.module.business.travel.manager.GuideRouteManager;
import net.lab1024.sa.admin.module.business.travel.manager.RecommendRouteManager;
@ -167,6 +169,20 @@ public class LandscapeService {
return ResponseDTO.ok(landscapeVO);
}
public List<LandscapeTypeVO> landscapeTypeState() {
List<LandscapeTypeVO> resultList = new ArrayList<>();
List<DictValueVO> type = dictCacheService.selectByKeyCode("LANDSCAPE_TYPE");
List<LandscapeEntity> landscapeList = landscapeDao.selectList(null);
for (DictValueVO dictValueVO : type) {
LandscapeTypeVO landscapeTypeVO = new LandscapeTypeVO();
landscapeTypeVO.setTypeName(dictValueVO.getValueName());
landscapeTypeVO.setNumber((int) landscapeList.stream().filter(l -> l.getType().equals(dictValueVO.getValueCode())).count());
resultList.add(landscapeTypeVO);
}
return resultList;
}
private void build(List<LandscapeVO> landscapeVOList) {
List<DictValueVO> type = dictCacheService.selectByKeyCode("LANDSCAPE_TYPE");
List<DictValueVO> level = dictCacheService.selectByKeyCode("LANDSCAPE_LEVEL");