feat: 同步代码与文档,完善满意度调查相关功能及文档记录(含前后端、API文档、变更日志等)
This commit is contained in:
1 parent
eeb79de050
commit
7a10da0ffc
15 files changed
+460
-177
No files matched your search
+10
@@ -45,6 +45,16 @@ public class HqSatCategoryController extends BaseController {
|
||||
return hqSatCategoryService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有题目分类列表(包括已逻辑删除的)
|
||||
*/
|
||||
@SaCheckPermission("hq:satCategory:list")
|
||||
@GetMapping("/listAllIncludeDeleted")
|
||||
public R<List<HqSatCategoryVo>> listAllIncludeDeleted(HqSatCategoryBo bo) {
|
||||
List<HqSatCategoryVo> list = hqSatCategoryService.queryListWithDeleted(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出题目分类列表
|
||||
*/
|
||||
|
||||
@@ -32,6 +32,7 @@ public class HqSatSurvey extends TenantEntity {
|
||||
/**
|
||||
* 删除标志
|
||||
*/
|
||||
@TableLogic(value = "0", delval = "1")
|
||||
private Long deleted;
|
||||
|
||||
/**
|
||||
|
||||
+8
@@ -41,6 +41,14 @@ public interface IHqSatCategoryService {
|
||||
*/
|
||||
List<HqSatCategoryVo> queryList(HqSatCategoryBo bo);
|
||||
|
||||
/**
|
||||
* 查询所有题目分类列表,包括已逻辑删除的
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 包含已删除记录的题目分类列表
|
||||
*/
|
||||
List<HqSatCategoryVo> queryListWithDeleted(HqSatCategoryBo bo);
|
||||
|
||||
/**
|
||||
* 新增题目分类
|
||||
*
|
||||
|
||||
+38
-2
@@ -19,6 +19,8 @@ import org.dromara.hq.service.IHqSatCategoryService;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 题目分类Service业务层处理
|
||||
@@ -70,6 +72,41 @@ public class HqSatCategoryServiceImpl implements IHqSatCategoryService {
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有题目分类列表,包括已逻辑删除的
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 包含已删除记录的题目分类列表
|
||||
*/
|
||||
@Override
|
||||
public List<HqSatCategoryVo> queryListWithDeleted(HqSatCategoryBo bo) {
|
||||
// 使用原生SQL来执行,确保能查询包含已删除的数据
|
||||
return baseMapper.selectByMap(null).stream()
|
||||
.filter(entity -> {
|
||||
// 手动应用过滤条件
|
||||
boolean match = true;
|
||||
if (StringUtils.isNotBlank(bo.getCategoryCode())) {
|
||||
match = match && entity.getCategoryCode() != null && entity.getCategoryCode().contains(bo.getCategoryCode());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getCategoryName())) {
|
||||
match = match && entity.getCategoryName() != null && entity.getCategoryName().contains(bo.getCategoryName());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getCategoryDesc())) {
|
||||
match = match && entity.getCategoryDesc() != null && entity.getCategoryDesc().equals(bo.getCategoryDesc());
|
||||
}
|
||||
if (bo.getSortOrder() != null) {
|
||||
match = match && entity.getSortOrder() != null && entity.getSortOrder().equals(bo.getSortOrder());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getStatus())) {
|
||||
match = match && entity.getStatus() != null && entity.getStatus().equals(bo.getStatus());
|
||||
}
|
||||
return match;
|
||||
})
|
||||
.map(entity -> MapstructUtils.convert(entity, HqSatCategoryVo.class))
|
||||
.sorted(Comparator.comparing(HqSatCategoryVo::getId))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<HqSatCategory> buildQueryWrapper(HqSatCategoryBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<HqSatCategory> lqw = Wrappers.lambdaQuery();
|
||||
@@ -132,7 +169,6 @@ public class HqSatCategoryServiceImpl implements IHqSatCategoryService {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
// 逻辑删除实现
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -104,8 +104,8 @@ public class HqSatSurveyServiceImpl implements IHqSatSurveyService {
|
||||
LambdaQueryWrapper<HqSatSurvey> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(HqSatSurvey::getId);
|
||||
lqw.eq(bo.getDeleted() != null, HqSatSurvey::getDeleted, bo.getDeleted());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSurveyCode()), HqSatSurvey::getSurveyCode, bo.getSurveyCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSurveyTitle()), HqSatSurvey::getSurveyTitle, bo.getSurveyTitle());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSurveyCode()), HqSatSurvey::getSurveyCode, bo.getSurveyCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSurveyTitle()), HqSatSurvey::getSurveyTitle, bo.getSurveyTitle());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSurveyDesc()), HqSatSurvey::getSurveyDesc, bo.getSurveyDesc());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSurveyInstruction()), HqSatSurvey::getSurveyInstruction,
|
||||
bo.getSurveyInstruction());
|
||||
|
||||
Reference in new issue
Block a user