增加查询条件

master
bynt 9 months ago
parent d4e93cc8f3
commit 29b10a8486

@ -41,14 +41,7 @@ public class ClueController {
@GetMapping("/page") @GetMapping("/page")
@Operation(summary = "分页查询资源") @Operation(summary = "分页查询资源")
public R<PageResult<ClueVO>> getClueRecordPage(@Validated PageParam pageParam, ClueQo qo) { public R<PageResult<ClueVO>> getClueRecordPage(@Validated PageParam pageParam, ClueQo qo) {
if (ObjectUtil.isNotNull(qo.getSalesmanType())) { setQueryQo(qo);
if (qo.getSalesmanType() == DefaultNumberConstants.FOUR_NUMBER) {
qo.setAssignedBy(SecurityUtils.getCurrentUserId());
}
if (qo.getSalesmanType() == DefaultNumberConstants.ZERO_NUMBER) {
qo.setCompanyId(SecurityUtils.getCurrentUserId());
}
}
return R.ok(clueService.queryPage(pageParam, qo)); return R.ok(clueService.queryPage(pageParam, qo));
} }
@ -83,9 +76,21 @@ public class ClueController {
@ResponseExcel(name = "线索表单") @ResponseExcel(name = "线索表单")
@GetMapping("/export") @GetMapping("/export")
public List<ClueVO> exportClueData(ClueQo qo) { public List<ClueVO> exportClueData(ClueQo qo) {
setQueryQo(qo);
List<ClueVO> list = clueService.queryList(qo); List<ClueVO> list = clueService.queryList(qo);
return CollUtil.isEmpty(list) ? Lists.newArrayList(new ClueVO()) : list; return CollUtil.isEmpty(list) ? Lists.newArrayList(new ClueVO()) : list;
} }
private void setQueryQo(ClueQo qo) {
if (ObjectUtil.isNotNull(qo.getSalesmanType())) {
if (qo.getSalesmanType() == DefaultNumberConstants.FOUR_NUMBER) {
qo.setAssignedBy(SecurityUtils.getCurrentUserId());
}
if (qo.getSalesmanType() == DefaultNumberConstants.ZERO_NUMBER) {
qo.setCompanyId(SecurityUtils.getCurrentUserId());
}
}
}
} }

Loading…
Cancel
Save