|
@@ -565,4 +565,74 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
}
|
|
|
return companyIdList;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public CommonPage<Map<String, Object>> fireInspectionData(String companyName, String organization, Integer id, Integer pageNum, Integer pageSize) {
|
|
|
+ List<Map<String, Object>> list = new ArrayList<>();
|
|
|
+ IPage<BaseCompany> page = new Page<>(pageNum, pageSize);
|
|
|
+ LambdaQueryWrapper<BaseCompany> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.select(BaseCompany::getId, BaseCompany::getCompanyId, BaseCompany::getCompanyName,
|
|
|
+ BaseCompany::getOrganization, BaseCompany::getAddress, BaseCompany::getCompanyType,
|
|
|
+ BaseCompany::getLinkPhone)
|
|
|
+ .eq(BaseCompany::getEnable, 0)
|
|
|
+ .like(StringUtils.isNotBlank(companyName), BaseCompany::getCompanyName, companyName)
|
|
|
+ .like(StringUtils.isNotBlank(organization), BaseCompany::getOrganization, organization)
|
|
|
+ .eq(id != 0 && id != null, BaseCompany::getId, id)
|
|
|
+ .orderByDesc(BaseCompany::getId);
|
|
|
+ page = this.page(page, queryWrapper);
|
|
|
+ if (CollectionUtils.isNotEmpty(page.getRecords())) {
|
|
|
+ List<String> companyIdList = new ArrayList<>();
|
|
|
+ for (int i = 0; i < page.getRecords().size(); i++) {
|
|
|
+ companyIdList.add(page.getRecords().get(i).getCompanyId());
|
|
|
+ }
|
|
|
+ List<BaseCompanyAttach1> list1 = new ArrayList<>();
|
|
|
+ List<BaseCompanyPerson> list2 = new ArrayList<>();
|
|
|
+ if (CollectionUtils.isNotEmpty(companyIdList)) {
|
|
|
+ LambdaQueryWrapper<BaseCompanyAttach1> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper1.select(BaseCompanyAttach1::getId, BaseCompanyAttach1::getEmployeeNum, BaseCompanyAttach1::getBuildArea,
|
|
|
+ BaseCompanyAttach1::getCompanyId)
|
|
|
+ .in(BaseCompanyAttach1::getCompanyId, companyIdList);
|
|
|
+ list1 = baseCompanyAttach1Service.list(queryWrapper1);
|
|
|
+ LambdaQueryWrapper<BaseCompanyPerson> queryWrapper2 = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper2.select(BaseCompanyPerson::getId, BaseCompanyPerson::getDelegateName, BaseCompanyPerson::getFireDutyName,
|
|
|
+ BaseCompanyPerson::getFireManageName, BaseCompanyPerson::getCompanyId)
|
|
|
+ .in(BaseCompanyPerson::getCompanyId, companyIdList);
|
|
|
+ list2 = baseCompanyPersonService.list(queryWrapper2);
|
|
|
+ }
|
|
|
+ for (int i = 0; i < page.getRecords().size(); i++) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("id", page.getRecords().get(i).getId());
|
|
|
+ map.put("companyId", page.getRecords().get(i).getCompanyId());
|
|
|
+ map.put("companyName", page.getRecords().get(i).getCompanyName());
|
|
|
+ map.put("organization", page.getRecords().get(i).getOrganization());
|
|
|
+ map.put("address", page.getRecords().get(i).getAddress());
|
|
|
+ map.put("companyType", page.getRecords().get(i).getCompanyType());
|
|
|
+ map.put("linkPhone", page.getRecords().get(i).getLinkPhone());
|
|
|
+ map.put("id1", null);
|
|
|
+ map.put("id2", null);
|
|
|
+ map.put("employeeNum", null);
|
|
|
+ map.put("buildArea", null);
|
|
|
+ map.put("delegateName", null);
|
|
|
+ map.put("fireDutyName", null);
|
|
|
+ map.put("fireManageName", null);
|
|
|
+ for (int j = 0; j < list1.size(); j++) {
|
|
|
+ if (page.getRecords().get(i).getCompanyId().equals(list1.get(j).getCompanyId())) {
|
|
|
+ map.put("id1", list1.get(j).getId());
|
|
|
+ map.put("employeeNum", list1.get(j).getEmployeeNum());
|
|
|
+ map.put("buildArea", list1.get(j).getBuildArea());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (int j = 0; j < list2.size(); j++) {
|
|
|
+ if (page.getRecords().get(i).getCompanyId().equals(list2.get(j).getCompanyId())) {
|
|
|
+ map.put("id2", list2.get(j).getId());
|
|
|
+ map.put("delegateName", list2.get(j).getDelegateName());
|
|
|
+ map.put("fireDutyName", list2.get(j).getFireDutyName());
|
|
|
+ map.put("fireManageName", list2.get(j).getFireManageName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ list.add(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return new CommonPage<>(list, page.getTotal(), pageSize, pageNum);
|
|
|
+ }
|
|
|
}
|