|
|
@@ -1,6 +1,8 @@
|
|
|
package com.usky.fire.service.impl;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
@@ -11,6 +13,7 @@ import com.usky.common.core.exception.BusinessException;
|
|
|
import com.usky.common.mybatis.core.AbstractCrudService;
|
|
|
import com.usky.common.security.utils.SecurityUtils;
|
|
|
import com.usky.fire.domain.*;
|
|
|
+import com.usky.fire.mapper.BaseCompanyAttach1Mapper;
|
|
|
import com.usky.fire.mapper.BaseCompanyMapper;
|
|
|
import com.usky.fire.service.*;
|
|
|
import com.usky.fire.service.util.OnlineMethod;
|
|
|
@@ -22,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
|
@@ -64,6 +68,11 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
@Autowired
|
|
|
private BaseBuildExtinguishService baseBuildExtinguishService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private BaseCompanyAttach1Mapper baseCompanyAttach1Mapper;
|
|
|
+ @Autowired
|
|
|
+ private MybatisPlusProperties properties;
|
|
|
+
|
|
|
@Override
|
|
|
public List<BaseCompany> userCompanySelect() {
|
|
|
List<String> companyIdList = baseUserCompanyService.companyIdList();
|
|
|
@@ -78,7 +87,7 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
@Override
|
|
|
public List<BaseCompany> companySelect(List<String> companyIdList) {
|
|
|
LambdaQueryWrapper<BaseCompany> queryWrapper = Wrappers.lambdaQuery();
|
|
|
- queryWrapper.select(BaseCompany::getCompanyId, BaseCompany::getCompanyName,BaseCompany::getLinkPerson,BaseCompany::getLinkPhone)
|
|
|
+ queryWrapper.select(BaseCompany::getCompanyId, BaseCompany::getCompanyName, BaseCompany::getLinkPerson, BaseCompany::getLinkPhone)
|
|
|
.in(BaseCompany::getCompanyId, companyIdList)
|
|
|
.eq(BaseCompany::getEnable, 0)
|
|
|
.orderByDesc(BaseCompany::getId);
|
|
|
@@ -98,15 +107,15 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public CommonPage<Object> companyList(String companyName, String organization,String streetTownName,
|
|
|
+ public CommonPage<Object> companyList(String companyName, String organization, String streetTownName,
|
|
|
String companyType, Integer pageNum, Integer pageSize) {
|
|
|
List<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::getFireHazard, BaseCompany::getLinkPhone,
|
|
|
- BaseCompany::getFoundTime, BaseCompany::getCompanyNature, BaseCompany::getAdministrativeDivision,
|
|
|
- BaseCompany::getCreateTime,BaseCompany::getStreetTown)
|
|
|
+ BaseCompany::getAddress, BaseCompany::getCompanyType, BaseCompany::getFireHazard, BaseCompany::getLinkPhone,
|
|
|
+ BaseCompany::getFoundTime, BaseCompany::getCompanyNature, BaseCompany::getAdministrativeDivision,
|
|
|
+ BaseCompany::getCreateTime, BaseCompany::getStreetTown)
|
|
|
.eq(BaseCompany::getEnable, 0)
|
|
|
.like(StringUtils.isNotBlank(companyName), BaseCompany::getCompanyName, companyName)
|
|
|
.like(StringUtils.isNotBlank(organization), BaseCompany::getOrganization, organization)
|
|
|
@@ -124,14 +133,14 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
if (CollectionUtils.isNotEmpty(companyIdList)) {
|
|
|
LambdaQueryWrapper<BaseCompanyPerson> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
queryWrapper1.select(BaseCompanyPerson::getId, BaseCompanyPerson::getCompanyId, BaseCompanyPerson::getFireDutyName,
|
|
|
- BaseCompanyPerson::getFireManageName, BaseCompanyPerson::getFireManagePhone,
|
|
|
- BaseCompanyPerson::getDelegateName)
|
|
|
+ BaseCompanyPerson::getFireManageName, BaseCompanyPerson::getFireManagePhone,
|
|
|
+ BaseCompanyPerson::getDelegateName)
|
|
|
.in(BaseCompanyPerson::getCompanyId, companyIdList);
|
|
|
list1 = baseCompanyPersonService.list(queryWrapper1);
|
|
|
LambdaQueryWrapper<BaseCompanyAttach1> queryWrapper2 = Wrappers.lambdaQuery();
|
|
|
queryWrapper2.select(BaseCompanyAttach1::getId, BaseCompanyAttach1::getCompanyId, BaseCompanyAttach1::getFixedAssets,
|
|
|
- BaseCompanyAttach1::getCoverArea, BaseCompanyAttach1::getBuildArea, BaseCompanyAttach1::getEmployeeNum,
|
|
|
- BaseCompanyAttach1::getMainAttribute, BaseCompanyAttach1::getGovernBody,BaseCompanyAttach1::getBirthCert)
|
|
|
+ BaseCompanyAttach1::getCoverArea, BaseCompanyAttach1::getBuildArea, BaseCompanyAttach1::getEmployeeNum,
|
|
|
+ BaseCompanyAttach1::getMainAttribute, BaseCompanyAttach1::getGovernBody, BaseCompanyAttach1::getBirthCert)
|
|
|
.in(BaseCompanyAttach1::getCompanyId, companyIdList);
|
|
|
list2 = baseCompanyAttach1Service.list(queryWrapper2);
|
|
|
}
|
|
|
@@ -190,13 +199,13 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<CompanyExportVO> companyListExport(String companyName, String organization){
|
|
|
+ public List<CompanyExportVO> companyListExport(String companyName, String organization) {
|
|
|
|
|
|
List<CompanyExportVO> list = new ArrayList<>();
|
|
|
LambdaQueryWrapper<BaseCompany> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.select(BaseCompany::getId, BaseCompany::getCompanyId, BaseCompany::getCompanyName, BaseCompany::getOrganization,
|
|
|
- BaseCompany::getAddress, BaseCompany::getCompanyType, BaseCompany::getFireHazard, BaseCompany::getLinkPhone,
|
|
|
- BaseCompany::getFoundTime, BaseCompany::getCompanyNature, BaseCompany::getAdministrativeDivision, BaseCompany::getCreateTime)
|
|
|
+ BaseCompany::getAddress, BaseCompany::getCompanyType, BaseCompany::getFireHazard, BaseCompany::getLinkPhone,
|
|
|
+ BaseCompany::getFoundTime, BaseCompany::getCompanyNature, BaseCompany::getAdministrativeDivision, BaseCompany::getCreateTime)
|
|
|
.eq(BaseCompany::getEnable, 0)
|
|
|
.like(StringUtils.isNotBlank(companyName), BaseCompany::getCompanyName, companyName)
|
|
|
.like(StringUtils.isNotBlank(organization), BaseCompany::getOrganization, organization)
|
|
|
@@ -212,13 +221,13 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
if (CollectionUtils.isNotEmpty(companyIdList)) {
|
|
|
LambdaQueryWrapper<BaseCompanyPerson> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
queryWrapper1.select(BaseCompanyPerson::getId, BaseCompanyPerson::getCompanyId, BaseCompanyPerson::getFireDutyName,
|
|
|
- BaseCompanyPerson::getFireManageName, BaseCompanyPerson::getDelegateName)
|
|
|
+ BaseCompanyPerson::getFireManageName, BaseCompanyPerson::getDelegateName)
|
|
|
.in(BaseCompanyPerson::getCompanyId, companyIdList);
|
|
|
list1 = baseCompanyPersonService.list(queryWrapper1);
|
|
|
LambdaQueryWrapper<BaseCompanyAttach1> queryWrapper2 = Wrappers.lambdaQuery();
|
|
|
queryWrapper2.select(BaseCompanyAttach1::getId, BaseCompanyAttach1::getCompanyId, BaseCompanyAttach1::getFixedAssets,
|
|
|
- BaseCompanyAttach1::getCoverArea, BaseCompanyAttach1::getBuildArea, BaseCompanyAttach1::getEmployeeNum,
|
|
|
- BaseCompanyAttach1::getMainAttribute, BaseCompanyAttach1::getGovernBody)
|
|
|
+ BaseCompanyAttach1::getCoverArea, BaseCompanyAttach1::getBuildArea, BaseCompanyAttach1::getEmployeeNum,
|
|
|
+ BaseCompanyAttach1::getMainAttribute, BaseCompanyAttach1::getGovernBody)
|
|
|
.in(BaseCompanyAttach1::getCompanyId, companyIdList);
|
|
|
list2 = baseCompanyAttach1Service.list(queryWrapper2);
|
|
|
}
|
|
|
@@ -353,7 +362,7 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
List<Map<String, Object>> list1 = new ArrayList<>();
|
|
|
LambdaQueryWrapper<DemEnforceReportComplaint> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.select(DemEnforceReportComplaint::getReportAddress, DemEnforceReportComplaint::getLatitude,
|
|
|
- DemEnforceReportComplaint::getLongitude, DemEnforceReportComplaint::getId)
|
|
|
+ DemEnforceReportComplaint::getLongitude, DemEnforceReportComplaint::getId)
|
|
|
.eq(DemEnforceReportComplaint::getEnable, 0);
|
|
|
page = demEnforceReportComplaintService.page(page, queryWrapper);
|
|
|
List<DemEnforceReportComplaint> list = page.getRecords();
|
|
|
@@ -445,7 +454,7 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
|
LambdaQueryWrapper<BaseCompany> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.select(BaseCompany::getId, BaseCompany::getCompanyId, BaseCompany::getCompanyName,
|
|
|
- BaseCompany::getCompanyType, BaseCompany::getLinkPhone, BaseCompany::getAddress, BaseCompany::getStreetTown)
|
|
|
+ BaseCompany::getCompanyType, BaseCompany::getLinkPhone, BaseCompany::getAddress, BaseCompany::getStreetTown)
|
|
|
.eq(BaseCompany::getEnable, 0)
|
|
|
.eq(StringUtils.isNotBlank(streetTown), BaseCompany::getStreetTown, streetTown)
|
|
|
.in(CollectionUtils.isNotEmpty(companyCodeList), BaseCompany::getCompanyCode, companyCodeList);
|
|
|
@@ -457,7 +466,7 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
}
|
|
|
LambdaQueryWrapper<BaseCompanyAttach1> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
queryWrapper1.select(BaseCompanyAttach1::getId, BaseCompanyAttach1::getCompanyId, BaseCompanyAttach1::getLongitude,
|
|
|
- BaseCompanyAttach1::getLatitude)
|
|
|
+ BaseCompanyAttach1::getLatitude)
|
|
|
.in(BaseCompanyAttach1::getCompanyId, companyIdList);
|
|
|
List<BaseCompanyAttach1> list2 = baseCompanyAttach1Service.list(queryWrapper1);
|
|
|
for (int i = 0; i < list1.size(); i++) {
|
|
|
@@ -542,7 +551,7 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
IPage<BaseCompany> page = new Page<>(1, 500);
|
|
|
LambdaQueryWrapper<BaseCompany> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.select(BaseCompany::getId, BaseCompany::getCompanyId, BaseCompany::getCompanyName,
|
|
|
- BaseCompany::getCompanyType, BaseCompany::getLinkPhone, BaseCompany::getAddress, BaseCompany::getStreetTown)
|
|
|
+ BaseCompany::getCompanyType, BaseCompany::getLinkPhone, BaseCompany::getAddress, BaseCompany::getStreetTown)
|
|
|
.eq(BaseCompany::getEnable, 0)
|
|
|
.eq(StringUtils.isNotBlank(streetTown), BaseCompany::getStreetTown, streetTown)
|
|
|
.eq(StringUtils.isNotBlank(companyType), BaseCompany::getCompanyType, companyType);
|
|
|
@@ -555,7 +564,7 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
}
|
|
|
LambdaQueryWrapper<BaseCompanyAttach1> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
queryWrapper1.select(BaseCompanyAttach1::getId, BaseCompanyAttach1::getCompanyId, BaseCompanyAttach1::getLongitude,
|
|
|
- BaseCompanyAttach1::getLatitude)
|
|
|
+ BaseCompanyAttach1::getLatitude)
|
|
|
.in(BaseCompanyAttach1::getCompanyId, companyIdList);
|
|
|
List<BaseCompanyAttach1> list2 = baseCompanyAttach1Service.list(queryWrapper1);
|
|
|
for (int i = 0; i < list1.size(); i++) {
|
|
|
@@ -680,8 +689,8 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
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)
|
|
|
+ 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)
|
|
|
@@ -698,12 +707,12 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
if (CollectionUtils.isNotEmpty(companyIdList)) {
|
|
|
LambdaQueryWrapper<BaseCompanyAttach1> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
queryWrapper1.select(BaseCompanyAttach1::getId, BaseCompanyAttach1::getEmployeeNum, BaseCompanyAttach1::getBuildArea,
|
|
|
- BaseCompanyAttach1::getCompanyId)
|
|
|
+ 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)
|
|
|
+ BaseCompanyPerson::getFireManageName, BaseCompanyPerson::getCompanyId)
|
|
|
.in(BaseCompanyPerson::getCompanyId, companyIdList);
|
|
|
list2 = baseCompanyPersonService.list(queryWrapper2);
|
|
|
}
|
|
|
@@ -745,12 +754,12 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<BaseCompanyExportVO> fireInspectionDataExport(String companyName, String organization){
|
|
|
+ public List<BaseCompanyExportVO> fireInspectionDataExport(String companyName, String organization) {
|
|
|
List<BaseCompanyExportVO> list = new ArrayList<>();
|
|
|
LambdaQueryWrapper<BaseCompany> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.select(BaseCompany::getId, BaseCompany::getCompanyId, BaseCompany::getCompanyName,
|
|
|
- BaseCompany::getOrganization, BaseCompany::getAddress, BaseCompany::getCompanyType,
|
|
|
- BaseCompany::getLinkPhone)
|
|
|
+ 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)
|
|
|
@@ -766,12 +775,12 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
if (CollectionUtils.isNotEmpty(companyIdList)) {
|
|
|
LambdaQueryWrapper<BaseCompanyAttach1> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
queryWrapper1.select(BaseCompanyAttach1::getId, BaseCompanyAttach1::getEmployeeNum, BaseCompanyAttach1::getBuildArea,
|
|
|
- BaseCompanyAttach1::getCompanyId)
|
|
|
+ BaseCompanyAttach1::getCompanyId)
|
|
|
.in(BaseCompanyAttach1::getCompanyId, companyIdList);
|
|
|
list2 = baseCompanyAttach1Service.list(queryWrapper1);
|
|
|
LambdaQueryWrapper<BaseCompanyPerson> queryWrapper2 = Wrappers.lambdaQuery();
|
|
|
queryWrapper2.select(BaseCompanyPerson::getId, BaseCompanyPerson::getDelegateName, BaseCompanyPerson::getFireDutyName,
|
|
|
- BaseCompanyPerson::getFireManageName, BaseCompanyPerson::getCompanyId)
|
|
|
+ BaseCompanyPerson::getFireManageName, BaseCompanyPerson::getCompanyId)
|
|
|
.in(BaseCompanyPerson::getCompanyId, companyIdList);
|
|
|
list3 = baseCompanyPersonService.list(queryWrapper2);
|
|
|
}
|
|
|
@@ -781,7 +790,7 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
baseCompanyExportVO.setOrganization(list1.get(i).getOrganization());
|
|
|
baseCompanyExportVO.setDelegateName(null);
|
|
|
baseCompanyExportVO.setAddress(list1.get(i).getAddress());
|
|
|
- //单位类型(1:重点单位、2:一般单位、3:九小场所、9:其他单位)
|
|
|
+ // 单位类型(1:重点单位、2:一般单位、3:九小场所、9:其他单位)
|
|
|
String companyTypeName = "";
|
|
|
if (StringUtils.isNotBlank(list1.get(i).getCompanyType())) {
|
|
|
if (list1.get(i).getCompanyType().equals("1")) {
|
|
|
@@ -830,8 +839,8 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
list = companyAddVO.getBaseBuildList();
|
|
|
if (StringUtils.isNotBlank(baseCompany.getCompanyId())) {
|
|
|
LambdaQueryWrapper<BaseCompany> queryWrapper = Wrappers.lambdaQuery();
|
|
|
- queryWrapper.select(BaseCompany::getCompanyId,BaseCompany::getOrganization,BaseCompany::getCompanyName,
|
|
|
- BaseCompany::getAddress,BaseCompany::getFoundTime,BaseCompany::getCompanyNature, BaseCompany::getStreetTown)
|
|
|
+ queryWrapper.select(BaseCompany::getCompanyId, BaseCompany::getOrganization, BaseCompany::getCompanyName,
|
|
|
+ BaseCompany::getAddress, BaseCompany::getFoundTime, BaseCompany::getCompanyNature, BaseCompany::getStreetTown)
|
|
|
.eq(BaseCompany::getCompanyId, baseCompany.getCompanyId())
|
|
|
.eq(BaseCompany::getEnable, 0)
|
|
|
.orderByDesc(BaseCompany::getId);
|
|
|
@@ -846,14 +855,14 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
if (CollectionUtils.isNotEmpty(companyIdList)) {
|
|
|
LambdaQueryWrapper<BaseCompanyAttach1> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
queryWrapper1.select(BaseCompanyAttach1::getId, BaseCompanyAttach1::getEmployeeNum,
|
|
|
- BaseCompanyAttach1::getBuildArea, BaseCompanyAttach1::getCoverArea, BaseCompanyAttach1::getFixedAssets,
|
|
|
- BaseCompanyAttach1::getCompanyId,BaseCompanyAttach1::getBirthCert)
|
|
|
+ BaseCompanyAttach1::getBuildArea, BaseCompanyAttach1::getCoverArea, BaseCompanyAttach1::getFixedAssets,
|
|
|
+ BaseCompanyAttach1::getCompanyId, BaseCompanyAttach1::getBirthCert)
|
|
|
.in(BaseCompanyAttach1::getCompanyId, companyIdList);
|
|
|
list2 = baseCompanyAttach1Service.list(queryWrapper1);
|
|
|
LambdaQueryWrapper<BaseCompanyPerson> queryWrapper2 = Wrappers.lambdaQuery();
|
|
|
queryWrapper2.select(BaseCompanyPerson::getId, BaseCompanyPerson::getDelegateName, BaseCompanyPerson::getFireDutyName,
|
|
|
- BaseCompanyPerson::getFireManageName,BaseCompanyPerson::getFireManagePhone,
|
|
|
- BaseCompanyPerson::getCompanyId)
|
|
|
+ BaseCompanyPerson::getFireManageName, BaseCompanyPerson::getFireManagePhone,
|
|
|
+ BaseCompanyPerson::getCompanyId)
|
|
|
.in(BaseCompanyPerson::getCompanyId, companyIdList);
|
|
|
list3 = baseCompanyPersonService.list(queryWrapper2);
|
|
|
}
|
|
|
@@ -894,36 +903,36 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
BaseBuild baseBuild = list.get(j).getBaseBuild();
|
|
|
BaseBuildAttach baseBuildAttach = list.get(j).getBaseBuildAttach();
|
|
|
List<BaseBuildExtinguish> list4 = list.get(j).getBaseBuildExtinguishList();
|
|
|
- if (null!=baseBuild.getId()) {
|
|
|
+ if (null != baseBuild.getId()) {
|
|
|
baseBuild.setUpdateTime(LocalDateTime.now());
|
|
|
baseBuild.setDeleteFlag("0");
|
|
|
baseBuildService.updateById(baseBuild);
|
|
|
- if (null!=baseBuildAttach.getId()) {
|
|
|
+ if (null != baseBuildAttach.getId()) {
|
|
|
baseBuildAttachService.updateById(baseBuildAttach);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
baseBuildAttach.setBuildId(baseBuild.getId());
|
|
|
baseBuildAttachService.save(baseBuildAttach);
|
|
|
}
|
|
|
if (CollectionUtils.isNotEmpty(list4)) {
|
|
|
for (int k = 0; k < list4.size(); k++) {
|
|
|
BaseBuildExtinguish baseBuildExtinguish = list4.get(k);
|
|
|
- if (null!=baseBuildExtinguish.getId()) {
|
|
|
+ if (null != baseBuildExtinguish.getId()) {
|
|
|
baseBuildExtinguishService.updateById(baseBuildExtinguish);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
baseBuildExtinguish.setBuildId(baseBuild.getId());
|
|
|
baseBuildExtinguishService.save(baseBuildExtinguish);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
baseBuild.setCreateTime(LocalDateTime.now());
|
|
|
baseBuild.setCreator("123");
|
|
|
baseBuild.setCompanyId(baseCompany.getCompanyId());
|
|
|
baseBuild.setDeleteFlag("0");
|
|
|
baseBuildService.save(baseBuild);
|
|
|
Integer buildId = baseBuild.getId();
|
|
|
- if (null!=baseBuildAttach){
|
|
|
+ if (null != baseBuildAttach) {
|
|
|
baseBuildAttach.setBuildId(buildId);
|
|
|
baseBuildAttachService.save(baseBuildAttach);
|
|
|
}
|
|
|
@@ -937,18 +946,18 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
UUID uuid = UUID.randomUUID();
|
|
|
String uuidStr = uuid.toString();
|
|
|
- baseCompany.setCompanyId(uuidStr.replaceAll("-",""));
|
|
|
+ baseCompany.setCompanyId(uuidStr.replaceAll("-", ""));
|
|
|
baseCompany.setCompanyType("1");
|
|
|
baseCompany.setEnable("0");
|
|
|
baseCompany.setCreateTime(LocalDateTime.now());
|
|
|
baseCompany.setCreator(companyAddVO.getBaseCompanyPerson().getFireManageName());
|
|
|
this.save(baseCompany);
|
|
|
- baseCompanyAttach1.setCompanyId(uuidStr.replaceAll("-",""));
|
|
|
+ baseCompanyAttach1.setCompanyId(uuidStr.replaceAll("-", ""));
|
|
|
baseCompanyAttach1Service.save(baseCompanyAttach1);
|
|
|
- baseCompanyPerson.setCompanyId(uuidStr.replaceAll("-",""));
|
|
|
+ baseCompanyPerson.setCompanyId(uuidStr.replaceAll("-", ""));
|
|
|
baseCompanyPersonService.save(baseCompanyPerson);
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
for (int j = 0; j < list.size(); j++) {
|
|
|
@@ -957,7 +966,7 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
List<BaseBuildExtinguish> list4 = list.get(j).getBaseBuildExtinguishList();
|
|
|
baseBuild.setCreateTime(LocalDateTime.now());
|
|
|
baseBuild.setCreator(companyAddVO.getBaseCompanyPerson().getFireManageName());
|
|
|
- baseBuild.setCompanyId(uuidStr.replaceAll("-",""));
|
|
|
+ baseBuild.setCompanyId(uuidStr.replaceAll("-", ""));
|
|
|
baseBuild.setDeleteFlag("0");
|
|
|
baseBuildService.save(baseBuild);
|
|
|
Integer buildId = baseBuild.getId();
|
|
|
@@ -979,9 +988,9 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
public List<CompanyDataVo> companyByNameSelect(String companyName) {
|
|
|
List<CompanyDataVo> list = new ArrayList<>();
|
|
|
LambdaQueryWrapper<BaseCompany> queryWrapper = Wrappers.lambdaQuery();
|
|
|
- queryWrapper.select(BaseCompany::getId,BaseCompany::getCompanyId,BaseCompany::getOrganization,BaseCompany::getCompanyName,
|
|
|
- BaseCompany::getAddress,BaseCompany::getFoundTime,BaseCompany::getStreetTown)
|
|
|
- .like(StringUtils.isNotBlank(companyName),BaseCompany::getCompanyName, companyName)
|
|
|
+ queryWrapper.select(BaseCompany::getId, BaseCompany::getCompanyId, BaseCompany::getOrganization, BaseCompany::getCompanyName,
|
|
|
+ BaseCompany::getAddress, BaseCompany::getFoundTime, BaseCompany::getStreetTown)
|
|
|
+ .like(StringUtils.isNotBlank(companyName), BaseCompany::getCompanyName, companyName)
|
|
|
.eq(BaseCompany::getEnable, 0)
|
|
|
.orderByDesc(BaseCompany::getId).last(" limit 10");
|
|
|
List<BaseCompany> list1 = this.list(queryWrapper);
|
|
|
@@ -998,23 +1007,23 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
if (CollectionUtils.isNotEmpty(companyIdList)) {
|
|
|
LambdaQueryWrapper<BaseCompanyAttach1> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
queryWrapper1.select(BaseCompanyAttach1::getId, BaseCompanyAttach1::getEmployeeNum,
|
|
|
- BaseCompanyAttach1::getBuildArea, BaseCompanyAttach1::getCoverArea, BaseCompanyAttach1::getFixedAssets,
|
|
|
- BaseCompanyAttach1::getCompanyId,BaseCompanyAttach1::getBirthCert)
|
|
|
+ BaseCompanyAttach1::getBuildArea, BaseCompanyAttach1::getCoverArea, BaseCompanyAttach1::getFixedAssets,
|
|
|
+ BaseCompanyAttach1::getCompanyId, BaseCompanyAttach1::getBirthCert)
|
|
|
.in(BaseCompanyAttach1::getCompanyId, companyIdList);
|
|
|
list2 = baseCompanyAttach1Service.list(queryWrapper1);
|
|
|
LambdaQueryWrapper<BaseCompanyPerson> queryWrapper2 = Wrappers.lambdaQuery();
|
|
|
queryWrapper2.select(BaseCompanyPerson::getId, BaseCompanyPerson::getDelegateName, BaseCompanyPerson::getFireDutyName,
|
|
|
- BaseCompanyPerson::getFireManageName,BaseCompanyPerson::getFireManagePhone,
|
|
|
- BaseCompanyPerson::getCompanyId)
|
|
|
+ BaseCompanyPerson::getFireManageName, BaseCompanyPerson::getFireManagePhone,
|
|
|
+ BaseCompanyPerson::getCompanyId)
|
|
|
.in(BaseCompanyPerson::getCompanyId, companyIdList);
|
|
|
list3 = baseCompanyPersonService.list(queryWrapper2);
|
|
|
LambdaQueryWrapper<BaseBuild> queryWrapper3 = Wrappers.lambdaQuery();
|
|
|
queryWrapper3.select(BaseBuild::getId, BaseBuild::getBuildName, BaseBuild::getAddress,
|
|
|
- BaseBuild::getBuildStructure,BaseBuild::getAboveFloor,BaseBuild::getUnderFloor,
|
|
|
- BaseBuild::getBuildArea,BaseBuild::getUnderSpace,BaseBuild::getUseCharacter,
|
|
|
- BaseBuild::getCompleteYear,BaseBuild::getBuildHigh,BaseBuild::getFireFacilitySystem,
|
|
|
- BaseBuild::getOtherSystem,BaseBuild::getOtherFacilities,BaseBuild::getFireproofCoat,
|
|
|
- BaseBuild::getCompanyId)
|
|
|
+ BaseBuild::getBuildStructure, BaseBuild::getAboveFloor, BaseBuild::getUnderFloor,
|
|
|
+ BaseBuild::getBuildArea, BaseBuild::getUnderSpace, BaseBuild::getUseCharacter,
|
|
|
+ BaseBuild::getCompleteYear, BaseBuild::getBuildHigh, BaseBuild::getFireFacilitySystem,
|
|
|
+ BaseBuild::getOtherSystem, BaseBuild::getOtherFacilities, BaseBuild::getFireproofCoat,
|
|
|
+ BaseBuild::getCompanyId)
|
|
|
.in(BaseBuild::getCompanyId, companyIdList)
|
|
|
.eq(BaseBuild::getDeleteFlag, 0);
|
|
|
list4 = baseBuildService.list(queryWrapper3);
|
|
|
@@ -1022,7 +1031,7 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
List<Integer> buildIdList1 = new ArrayList<>();
|
|
|
if (CollectionUtils.isNotEmpty(list4)) {
|
|
|
for (int i = 0; i < list4.size(); i++) {
|
|
|
- if (19==list4.get(i).getUseCharacter() || 20==list4.get(i).getUseCharacter()){
|
|
|
+ if (19 == list4.get(i).getUseCharacter() || 20 == list4.get(i).getUseCharacter()) {
|
|
|
buildIdList.add(list4.get(i).getId());
|
|
|
}
|
|
|
buildIdList1.add(list4.get(i).getId());
|
|
|
@@ -1031,20 +1040,20 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
if (CollectionUtils.isNotEmpty(buildIdList)) {
|
|
|
LambdaQueryWrapper<BaseBuildAttach> queryWrapper4 = Wrappers.lambdaQuery();
|
|
|
queryWrapper4.select(BaseBuildAttach::getId, BaseBuildAttach::getBuildId,
|
|
|
- BaseBuildAttach::getHazardousProduceA,
|
|
|
- BaseBuildAttach::getHazardousProduceB,BaseBuildAttach::getHazardousProduceC,
|
|
|
- BaseBuildAttach::getHazardousProduceD,BaseBuildAttach::getHazardousStorageA,
|
|
|
- BaseBuildAttach::getHazardousStorageB,BaseBuildAttach::getHazardousStorageC,BaseBuildAttach::getHazardousStorageD)
|
|
|
+ BaseBuildAttach::getHazardousProduceA,
|
|
|
+ BaseBuildAttach::getHazardousProduceB, BaseBuildAttach::getHazardousProduceC,
|
|
|
+ BaseBuildAttach::getHazardousProduceD, BaseBuildAttach::getHazardousStorageA,
|
|
|
+ BaseBuildAttach::getHazardousStorageB, BaseBuildAttach::getHazardousStorageC, BaseBuildAttach::getHazardousStorageD)
|
|
|
.in(BaseBuildAttach::getBuildId, buildIdList);
|
|
|
list5 = baseBuildAttachService.list(queryWrapper4);
|
|
|
}
|
|
|
if (CollectionUtils.isNotEmpty(buildIdList1)) {
|
|
|
LambdaQueryWrapper<BaseBuildExtinguish> queryWrapper5 = Wrappers.lambdaQuery();
|
|
|
queryWrapper5.select(BaseBuildExtinguish::getId, BaseBuildExtinguish::getBuildId,
|
|
|
- BaseBuildExtinguish::getExtinguishNum,
|
|
|
- BaseBuildExtinguish::getExtinguishType)
|
|
|
+ BaseBuildExtinguish::getExtinguishNum,
|
|
|
+ BaseBuildExtinguish::getExtinguishType)
|
|
|
.in(BaseBuildExtinguish::getBuildId, buildIdList1)
|
|
|
- .eq(BaseBuildExtinguish::getDeleteFlag, 0);;
|
|
|
+ .eq(BaseBuildExtinguish::getDeleteFlag, 0);
|
|
|
list6 = baseBuildExtinguishService.list(queryWrapper5);
|
|
|
}
|
|
|
}
|
|
|
@@ -1083,12 +1092,12 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
BaseBuildAddVO baseBuildAddVO = new BaseBuildAddVO();
|
|
|
baseBuildAddVO.setBaseBuild(list4.get(j));
|
|
|
for (int k = 0; k < list5.size(); k++) {
|
|
|
- if (list4.get(j).getId().equals(list5.get(k).getBuildId())){
|
|
|
+ if (list4.get(j).getId().equals(list5.get(k).getBuildId())) {
|
|
|
baseBuildAddVO.setBaseBuildAttach(list5.get(k));
|
|
|
}
|
|
|
}
|
|
|
for (int l = 0; l < list6.size(); l++) {
|
|
|
- if (list4.get(j).getId().equals(list6.get(l).getBuildId())){
|
|
|
+ if (list4.get(j).getId().equals(list6.get(l).getBuildId())) {
|
|
|
list8.add(list6.get(l));
|
|
|
baseBuildAddVO.setBaseBuildExtinguishList(list8);
|
|
|
}
|
|
|
@@ -1106,13 +1115,50 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
|
@Override
|
|
|
public List<BaseCompany> companyIdByTypeList(String companyType) {
|
|
|
LambdaQueryWrapper<BaseCompany> queryWrapper = Wrappers.lambdaQuery();
|
|
|
- queryWrapper.select(BaseCompany::getId,BaseCompany::getCompanyId, BaseCompany::getCompanyCode,
|
|
|
- BaseCompany::getCompanyName)
|
|
|
+ queryWrapper.select(BaseCompany::getId, BaseCompany::getCompanyId, BaseCompany::getCompanyCode,
|
|
|
+ BaseCompany::getCompanyName)
|
|
|
.eq(BaseCompany::getEnable, 0)
|
|
|
.eq(StringUtils.isNotBlank(companyType), BaseCompany::getCompanyType, companyType);
|
|
|
List<BaseCompany> list = this.list(queryWrapper);
|
|
|
return list;
|
|
|
}
|
|
|
+
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Override
|
|
|
+ public void lonLatConversion(List<BaseCompanyLonLatVO> list) {
|
|
|
+ if (CollectionUtils.isEmpty(list)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ List<BaseCompanyAttach1> batch = list.stream()
|
|
|
+ .map(vo -> {
|
|
|
+ BaseCompanyAttach1 attach1 = new BaseCompanyAttach1();
|
|
|
+ attach1.setId(vo.getId());
|
|
|
+ attach1.setLongitude(vo.getLongitude());
|
|
|
+ attach1.setLatitude(vo.getLatitude());
|
|
|
+ return attach1;
|
|
|
+ })
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ baseCompanyAttach1Service.updateBatchById(batch, 2000);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<BaseCompanyLonLatVO> getLonLat() {
|
|
|
+ return baseCompanyAttach1Mapper.selectList(
|
|
|
+ Wrappers.<BaseCompanyAttach1>lambdaQuery()
|
|
|
+ .select(BaseCompanyAttach1::getId,
|
|
|
+ BaseCompanyAttach1::getLongitude,
|
|
|
+ BaseCompanyAttach1::getLatitude))
|
|
|
+ .stream()
|
|
|
+ .map(c -> {
|
|
|
+ BaseCompanyLonLatVO attach1 = new BaseCompanyLonLatVO();
|
|
|
+ attach1.setId(c.getId());
|
|
|
+ attach1.setLongitude(c.getLongitude());
|
|
|
+ attach1.setLatitude(c.getLatitude());
|
|
|
+ return attach1;
|
|
|
+ })
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|