增加查询条件

master
bynt 9 months ago
parent d4e93cc8f3
commit 29b10a8486

@ -41,14 +41,7 @@ public class ClueController {
@GetMapping("/page")
@Operation(summary = "分页查询资源")
public R<PageResult<ClueVO>> getClueRecordPage(@Validated PageParam pageParam, 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());
}
}
setQueryQo(qo);
return R.ok(clueService.queryPage(pageParam, qo));
}
@ -83,9 +76,21 @@ public class ClueController {
@ResponseExcel(name = "线索表单")
@GetMapping("/export")
public List<ClueVO> exportClueData(ClueQo qo) {
setQueryQo(qo);
List<ClueVO> list = clueService.queryList(qo);
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