feat: 照片查询增加活动参数,并使用通用装置查询

dev
huangfeng 2 months ago
parent 7c299692e1
commit fa8f8623ee

@ -51,4 +51,5 @@ public class TerminalPhotoSelectVo {
private int pagesize;
private Integer presetId;
private Integer activityId;
}

@ -82,6 +82,8 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
@Resource
NewCacheService newCacheService;
@Resource
TerminalExtService terminalExtService;
@Autowired
RequestResultsDao requestResultsDao;
@ -445,81 +447,91 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
List<Integer> termidlist = new ArrayList<>();
ArrayList<Integer> channelidlist = new ArrayList<>();
List<DyAndLineAndTowerAndTermDto> dtos = new ArrayList<>();
boolean queryCon = false;
List<Integer> dypList = new ArrayList<>();
List<Integer> linepList = new ArrayList<>();
List<Integer> towerpList = new ArrayList<>();
List<Integer> termpList = new ArrayList<>();
PermissionDetail permissionList = userService.getPermissionList();
if (CommonStatus.DELETE.value().equals(permissionList.getIsSuper())) {
dypList = permissionList.getDypList();
linepList = permissionList.getLinepList();
towerpList = permissionList.getTowerpList();
termpList = permissionList.getTermpList();
}
View_Dy_Line_Tower_TerminalsExample example = new View_Dy_Line_Tower_TerminalsExample();
example.setGroupByClause("id");
View_Dy_Line_Tower_TerminalsExample.Criteria criteria = example.createCriteria();
if (CollectionUtil.isNotEmpty(dypList)) {
criteria.andDyIdIn(dypList);
queryCon = true;
}
if (CollectionUtil.isNotEmpty(linepList)) {
criteria.andLineIdIn(linepList);
queryCon = true;
}
if (CollectionUtil.isNotEmpty(towerpList)) {
criteria.andTowerIdIn(towerpList);
queryCon = true;
}
if (CollectionUtil.isNotEmpty(termpList)) {
criteria.andIdIn(termpList);
queryCon = true;
}
if (StrUtil.isEmpty(search)) {
search = null;
} else {
search = "%" + search + "%";
}
if (StrUtil.isNotBlank(search)) {
View_Dy_Line_Tower_TerminalsExample.Criteria or = example.or();
or.andLineNameLike(search);
or.andTowerNameLike(search);
or.andCmdidLike(search);
queryCon = true;
}
if (dyid != null && dyid.intValue() != -1) {
View_Dy_Line_Tower_TerminalsExample.Criteria or1 = example.or();
or1.andDyIdEqualTo(dyid);
queryCon = true;
}
if (lineid != null && lineid.intValue() != -1) {
View_Dy_Line_Tower_TerminalsExample.Criteria or2 = example.or();
or2.andLineIdEqualTo(lineid);
queryCon = true;
}
if (towerid != null && towerid.intValue() != -1) {
View_Dy_Line_Tower_TerminalsExample.Criteria or3 = example.or();
or3.andTowerIdEqualTo(towerid);
queryCon = true;
}
if (termid != null && termid.intValue() != -1) {
View_Dy_Line_Tower_TerminalsExample.Criteria or3 = example.or();
or3.andIdEqualTo(termid);
queryCon = true;
}
if ( queryCon ) {
View_Dy_Line_Tower_TerminalsExample.Criteria or = example.or();
or.andIdIsNotNull();
List<View_Dy_Line_Tower_Terminals> lists = view_dy_line_tower_terminalsDao.selectByPermission(example);
for (View_Dy_Line_Tower_Terminals item : lists) {
termidlist.add(item.getId());
// List<DyAndLineAndTowerAndTermDto> dtos = new ArrayList<>();
//
// boolean queryCon = false;
//
// List<Integer> dypList = new ArrayList<>();
// List<Integer> linepList = new ArrayList<>();
// List<Integer> towerpList = new ArrayList<>();
// List<Integer> termpList = new ArrayList<>();
// PermissionDetail permissionList = userService.getPermissionList();
// if (CommonStatus.DELETE.value().equals(permissionList.getIsSuper())) {
// dypList = permissionList.getDypList();
// linepList = permissionList.getLinepList();
// towerpList = permissionList.getTowerpList();
// termpList = permissionList.getTermpList();
// }
// View_Dy_Line_Tower_TerminalsExample example = new View_Dy_Line_Tower_TerminalsExample();
// example.setGroupByClause("id");
// View_Dy_Line_Tower_TerminalsExample.Criteria criteria = example.createCriteria();
// if (CollectionUtil.isNotEmpty(dypList)) {
// criteria.andDyIdIn(dypList);
// queryCon = true;
// }
// if (CollectionUtil.isNotEmpty(linepList)) {
// criteria.andLineIdIn(linepList);
// queryCon = true;
// }
// if (CollectionUtil.isNotEmpty(towerpList)) {
// criteria.andTowerIdIn(towerpList);
// queryCon = true;
// }
// if (CollectionUtil.isNotEmpty(termpList)) {
// criteria.andIdIn(termpList);
// queryCon = true;
// }
//
// if (StrUtil.isEmpty(search)) {
// search = null;
// } else {
// search = "%" + search + "%";
// }
// if (StrUtil.isNotBlank(search)) {
// View_Dy_Line_Tower_TerminalsExample.Criteria or = example.or();
// or.andLineNameLike(search);
// or.andTowerNameLike(search);
// or.andCmdidLike(search);
// queryCon = true;
// }
// if (dyid != null && dyid.intValue() != -1) {
// View_Dy_Line_Tower_TerminalsExample.Criteria or1 = example.or();
// or1.andDyIdEqualTo(dyid);
// queryCon = true;
// }
// if (lineid != null && lineid.intValue() != -1) {
// View_Dy_Line_Tower_TerminalsExample.Criteria or2 = example.or();
// or2.andLineIdEqualTo(lineid);
// queryCon = true;
// }
// if (towerid != null && towerid.intValue() != -1) {
// View_Dy_Line_Tower_TerminalsExample.Criteria or3 = example.or();
// or3.andTowerIdEqualTo(towerid);
// queryCon = true;
// }
// if (termid != null && termid.intValue() != -1) {
// View_Dy_Line_Tower_TerminalsExample.Criteria or3 = example.or();
// or3.andIdEqualTo(termid);
// queryCon = true;
// }
// if ( queryCon ) {
// View_Dy_Line_Tower_TerminalsExample.Criteria or = example.or();
// or.andIdIsNotNull();
// List<View_Dy_Line_Tower_Terminals> lists = view_dy_line_tower_terminalsDao.selectByPermission(example);
// for (View_Dy_Line_Tower_Terminals item : lists) {
// termidlist.add(item.getId());
// }
// }
PageInfo<View_Dy_Line_Tower_Terminals> result = terminalExtService.getTerminalPage(dyid, lineid, towerid, termid,
search, null,
null, null, null, vo.getActivityId(),
1, 100000);
if (!CollectionUtils.isEmpty(result.getList())) {
for (View_Dy_Line_Tower_Terminals terminal : result.getList()) {
termidlist.add(terminal.getId());
}
}

Loading…
Cancel
Save