|
@@ -15,12 +15,14 @@ import com.usky.fire.mapper.BaseCompanyMapper;
|
|
import com.usky.fire.service.*;
|
|
import com.usky.fire.service.*;
|
|
import com.usky.fire.service.util.OnlineMethod;
|
|
import com.usky.fire.service.util.OnlineMethod;
|
|
import com.usky.fire.service.vo.CompanyDataVo;
|
|
import com.usky.fire.service.vo.CompanyDataVo;
|
|
|
|
+import com.usky.fire.service.vo.CompanyExportVO;
|
|
import com.usky.fire.service.vo.LocateInfo;
|
|
import com.usky.fire.service.vo.LocateInfo;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -171,6 +173,75 @@ public class BaseCompanyServiceImpl extends AbstractCrudService<BaseCompanyMappe
|
|
return new CommonPage<>(list, page.getTotal(), pageSize, pageNum);
|
|
return new CommonPage<>(list, page.getTotal(), pageSize, pageNum);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ 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)
|
|
|
|
+ .eq(BaseCompany::getEnable, 0)
|
|
|
|
+ .like(StringUtils.isNotBlank(companyName), BaseCompany::getCompanyName, companyName)
|
|
|
|
+ .like(StringUtils.isNotBlank(organization), BaseCompany::getOrganization, organization)
|
|
|
|
+ .orderByDesc(BaseCompany::getId);
|
|
|
|
+ List<BaseCompany> baseCompanyList = this.list(queryWrapper);
|
|
|
|
+ if (CollectionUtils.isNotEmpty(baseCompanyList)) {
|
|
|
|
+ List<String> companyIdList = new ArrayList<>();
|
|
|
|
+ for (int i = 0; i < baseCompanyList.size(); i++) {
|
|
|
|
+ companyIdList.add(baseCompanyList.get(i).getCompanyId());
|
|
|
|
+ }
|
|
|
|
+ List<BaseCompanyPerson> list1 = new ArrayList<>();
|
|
|
|
+ List<BaseCompanyAttach1> list2 = new ArrayList<>();
|
|
|
|
+ if (CollectionUtils.isNotEmpty(companyIdList)) {
|
|
|
|
+ LambdaQueryWrapper<BaseCompanyPerson> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
|
+ queryWrapper1.select(BaseCompanyPerson::getId, BaseCompanyPerson::getCompanyId, BaseCompanyPerson::getFireDutyName,
|
|
|
|
+ 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)
|
|
|
|
+ .in(BaseCompanyAttach1::getCompanyId, companyIdList);
|
|
|
|
+ list2 = baseCompanyAttach1Service.list(queryWrapper2);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < baseCompanyList.size(); i++) {
|
|
|
|
+ CompanyExportVO companyDataVo = new CompanyExportVO();
|
|
|
|
+ companyDataVo.setCompanyName(baseCompanyList.get(i).getCompanyName());
|
|
|
|
+ companyDataVo.setOrganization(baseCompanyList.get(i).getOrganization());
|
|
|
|
+ companyDataVo.setAddress(baseCompanyList.get(i).getAddress());
|
|
|
|
+ companyDataVo.setCompanyType(baseCompanyList.get(i).getCompanyType());
|
|
|
|
+ companyDataVo.setFireHazard(baseCompanyList.get(i).getFireHazard());
|
|
|
|
+ companyDataVo.setLinkPhone(baseCompanyList.get(i).getLinkPhone());
|
|
|
|
+ companyDataVo.setFoundTime(baseCompanyList.get(i).getFoundTime());
|
|
|
|
+ companyDataVo.setCompanyNature(baseCompanyList.get(i).getCompanyNature());
|
|
|
|
+ companyDataVo.setAdministrativeDivision(baseCompanyList.get(i).getAdministrativeDivision());
|
|
|
|
+ for (int j = 0; j < list1.size(); j++) {
|
|
|
|
+ if (baseCompanyList.get(i).getCompanyId().equals(list1.get(j).getCompanyId())) {
|
|
|
|
+ companyDataVo.setDelegateName(list1.get(j).getDelegateName());
|
|
|
|
+ companyDataVo.setFireDutyName(list1.get(j).getFireDutyName());
|
|
|
|
+ companyDataVo.setFireManageName(list1.get(j).getFireManageName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for (int j = 0; j < list2.size(); j++) {
|
|
|
|
+ if (baseCompanyList.get(i).getCompanyId().equals(list2.get(j).getCompanyId())) {
|
|
|
|
+ companyDataVo.setGovernBody(list2.get(j).getGovernBody());
|
|
|
|
+ companyDataVo.setMainAttribute(list2.get(j).getMainAttribute());
|
|
|
|
+ companyDataVo.setEmployeeNum(list2.get(j).getEmployeeNum());
|
|
|
|
+ companyDataVo.setFixedAssets(list2.get(j).getFixedAssets());
|
|
|
|
+ companyDataVo.setCoverArea(list2.get(j).getCoverArea());
|
|
|
|
+ companyDataVo.setBuildArea(list2.get(j).getBuildArea());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ companyDataVo.setCreateTime((baseCompanyList.get(i).getCreateTime()).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
|
+ list.add(companyDataVo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
public void updateCompany(CompanyDataVo companyDataVo) {
|
|
public void updateCompany(CompanyDataVo companyDataVo) {
|