Bläddra i källkod

新增修改联网单位和地理设置经纬度转换接口

fuyuchuan 2 månader sedan
förälder
incheckning
0503d427dc

+ 27 - 8
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/BaseCompanyController.java

@@ -61,7 +61,7 @@ public class BaseCompanyController {
                                                      @RequestParam(value = "companyType", required = false) String companyType,
                                                      @RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
                                                      @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
-        return ApiResult.success(baseCompanyService.companyList(companyName, organization, streetTownName,companyType,pageNum, pageSize));
+        return ApiResult.success(baseCompanyService.companyList(companyName, organization, streetTownName, companyType, pageNum, pageSize));
     }
 
     /**
@@ -74,13 +74,14 @@ public class BaseCompanyController {
      */
     @PostMapping("companyListExport")
     public void export(HttpServletResponse response,
-                                  @RequestParam(value = "companyName", required = false) String companyName,
-                                  @RequestParam(value = "organization", required = false) String organization,
-                                  @RequestParam(value = "exportTitle") String exportTitle) throws IOException {
+                       @RequestParam(value = "companyName", required = false) String companyName,
+                       @RequestParam(value = "organization", required = false) String organization,
+                       @RequestParam(value = "exportTitle") String exportTitle) throws IOException {
         List<CompanyExportVO> list = baseCompanyService.companyListExport(companyName, organization);
         ExcelUtil<CompanyExportVO> util = new ExcelUtil<CompanyExportVO>(CompanyExportVO.class);
-        util.exportExcel(response,list,exportTitle,exportTitle);
+        util.exportExcel(response, list, exportTitle, exportTitle);
     }
+
     /**
      * 单位管理-修改
      *
@@ -121,6 +122,24 @@ public class BaseCompanyController {
         return ApiResult.success(baseCompanyService.companyScatterer(streetTown, companyType));
     }
 
+    /**
+     * 经纬度转换
+     */
+    @PutMapping("lonLatConversion")
+    public ApiResult<Void> lonLatConversion(@RequestBody List<BaseCompanyLonLatVO> list) {
+        baseCompanyService.lonLatConversion(list);
+        return ApiResult.success();
+    }
+
+    /**
+     *  获取经纬度
+     * @return
+     */
+    @GetMapping("getLonLat")
+    public ApiResult<List<BaseCompanyLonLatVO>> getLonLat() {
+        return ApiResult.success(baseCompanyService.getLonLat());
+    }
+
     /**
      * 消防执法动态-撒点
      *
@@ -163,9 +182,9 @@ public class BaseCompanyController {
      */
     @PostMapping("fireInspectionDataExport")
     public void fireInspectionDataExport(HttpServletResponse response,
-                       @RequestParam(value = "companyName", required = false) String companyName,
-                       @RequestParam(value = "organization", required = false) String organization,
-                       @RequestParam(value = "exportTitle") String exportTitle)throws IOException{
+                                         @RequestParam(value = "companyName", required = false) String companyName,
+                                         @RequestParam(value = "organization", required = false) String organization,
+                                         @RequestParam(value = "exportTitle") String exportTitle) throws IOException {
         List<BaseCompanyExportVO> list = baseCompanyService.fireInspectionDataExport(companyName, organization);
         ExcelUtil<BaseCompanyExportVO> util = new ExcelUtil<BaseCompanyExportVO>(BaseCompanyExportVO.class);
         util.exportExcel(response, list, exportTitle, exportTitle);

+ 19 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/BaseGgpFacilityController.java

@@ -4,6 +4,7 @@ package com.usky.fire.controller.web;
 import com.usky.common.core.bean.ApiResult;
 import com.usky.fire.domain.BaseGgpFacility;
 import com.usky.fire.service.BaseGgpFacilityService;
+import com.usky.fire.service.vo.BaseCompanyLonLatVO;
 import com.usky.fire.service.vo.BaseGgpFacilityListVO;
 import com.usky.fire.service.vo.BaseGgpFacilityStatisticVO;
 import com.usky.fire.service.vo.BaseGgpFacilityVO;
@@ -36,6 +37,24 @@ public class BaseGgpFacilityController {
         return ApiResult.success(baseGgpFacilityService.baseGgpFacilityList(baseGgpFacilityVO));
     }
 
+    /**
+     * 经纬度转换
+     */
+    @PutMapping("lonLatConversion")
+    public ApiResult<Void> lonLatConversion(@RequestBody List<BaseCompanyLonLatVO> list) {
+        baseGgpFacilityService.lonLatConversion(list);
+        return ApiResult.success();
+    }
+
+    /**
+     *  获取经纬度
+     * @return
+     */
+    @GetMapping("getLonLat")
+    public ApiResult<List<BaseCompanyLonLatVO>> getLonLat() {
+        return ApiResult.success(baseGgpFacilityService.getLonLat());
+    }
+
     /**
      * 统计
      * @param baseGgpFacilityVO

+ 10 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/BaseCompanyAttach1.java

@@ -2,8 +2,10 @@ package com.usky.fire.domain;
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
+
 import java.time.LocalDateTime;
 import java.io.Serializable;
+
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -252,5 +254,13 @@ public class BaseCompanyAttach1 implements Serializable {
      */
     private String birthCert;
 
+    /**
+     * 经度(旧)
+     */
+    private String lon;
 
+    /**
+     * 纬度(旧)
+     */
+    private String lat;
 }

+ 13 - 5
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/BaseCompanyService.java

@@ -3,10 +3,7 @@ package com.usky.fire.service;
 import com.usky.common.core.bean.CommonPage;
 import com.usky.common.mybatis.core.CrudService;
 import com.usky.fire.domain.BaseCompany;
-import com.usky.fire.service.vo.BaseCompanyExportVO;
-import com.usky.fire.service.vo.CompanyAddVO;
-import com.usky.fire.service.vo.CompanyDataVo;
-import com.usky.fire.service.vo.CompanyExportVO;
+import com.usky.fire.service.vo.*;
 
 import java.util.List;
 import java.util.Map;
@@ -54,7 +51,7 @@ public interface BaseCompanyService extends CrudService<BaseCompany> {
      * @param pageSize     每页条数
      * @return
      */
-    CommonPage<Object> companyList(String companyName, String organization,String streetTownName,
+    CommonPage<Object> companyList(String companyName, String organization, String streetTownName,
                                    String companyType, Integer pageNum,
                                    Integer pageSize);
 
@@ -141,4 +138,15 @@ public interface BaseCompanyService extends CrudService<BaseCompany> {
      * @return
      */
     List<BaseCompany> companyIdByTypeList(String companyType);
+
+    /**
+     * 经纬度转换
+     */
+    void lonLatConversion(List<BaseCompanyLonLatVO> list);
+
+    /**
+     * 获取经纬度
+     * @return List<BaseCompanyLonLatVO>
+     */
+    List<BaseCompanyLonLatVO> getLonLat();
 }

+ 5 - 4
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/BaseGgpFacilityService.java

@@ -3,10 +3,7 @@ package com.usky.fire.service;
 import com.usky.fire.domain.BaseGgpFacility;
 import com.usky.common.mybatis.core.CrudService;
 import com.usky.fire.domain.DemFireStation;
-import com.usky.fire.service.vo.BaseGgpFacilityListVO;
-import com.usky.fire.service.vo.BaseGgpFacilityStatisticVO;
-import com.usky.fire.service.vo.BaseGgpFacilityVO;
-import com.usky.fire.service.vo.DemFireStationVO;
+import com.usky.fire.service.vo.*;
 import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.List;
@@ -29,4 +26,8 @@ public interface BaseGgpFacilityService extends CrudService<BaseGgpFacility> {
     List<BaseGgpFacility> baseGgpFacilityList(BaseGgpFacilityVO baseGgpFacilityVO);
 
     List<BaseGgpFacilityStatisticVO> statistic(BaseGgpFacilityVO baseGgpFacilityVO);
+
+    void lonLatConversion(List<BaseCompanyLonLatVO> list);
+
+    List<BaseCompanyLonLatVO> getLonLat();
 }

+ 118 - 72
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BaseCompanyServiceImpl.java

@@ -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());
+    }
 }
 
 

+ 71 - 33
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BaseGgpFacilityServiceImpl.java

@@ -6,19 +6,20 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.usky.fire.domain.BaseCompanyAttach1;
 import com.usky.fire.domain.BaseGgpFacility;
 import com.usky.fire.mapper.BaseGgpFacilityMapper;
 import com.usky.fire.service.BaseGgpFacilityService;
 import com.usky.common.mybatis.core.AbstractCrudService;
-import com.usky.fire.service.vo.BaseGgpFacilityListVO;
-import com.usky.fire.service.vo.BaseGgpFacilityStatisticVO;
-import com.usky.fire.service.vo.BaseGgpFacilityVO;
-import com.usky.fire.service.vo.CompanyDataVo;
+import com.usky.fire.service.vo.*;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -33,40 +34,40 @@ public class BaseGgpFacilityServiceImpl extends AbstractCrudService<BaseGgpFacil
     @Override
     public List<BaseGgpFacility> baseGgpFacilityList(BaseGgpFacilityVO baseGgpFacilityVO) {
         List<BaseGgpFacility> list = new ArrayList<>();
-        if (baseGgpFacilityVO.getId()==null){
-            if (baseGgpFacilityVO.getFacilityType().size()==2 && baseGgpFacilityVO.getFacilityType().get(0)==39 && baseGgpFacilityVO.getFacilityType().get(1)==42){
+        if (baseGgpFacilityVO.getId() == null) {
+            if (baseGgpFacilityVO.getFacilityType().size() == 2 && baseGgpFacilityVO.getFacilityType().get(0) == 39 && baseGgpFacilityVO.getFacilityType().get(1) == 42) {
                 LambdaQueryWrapper<BaseGgpFacility> query1 = Wrappers.lambdaQuery();
-                query1.select(BaseGgpFacility::getId,BaseGgpFacility::getFacilityName,BaseGgpFacility::getAddress,
-                        BaseGgpFacility::getFacilityType,BaseGgpFacility::getLongitude,BaseGgpFacility::getLatitude,
-                        BaseGgpFacility::getStreetTown,BaseGgpFacility::getContact,BaseGgpFacility::getContactPhone,
+                query1.select(BaseGgpFacility::getId, BaseGgpFacility::getFacilityName, BaseGgpFacility::getAddress,
+                        BaseGgpFacility::getFacilityType, BaseGgpFacility::getLongitude, BaseGgpFacility::getLatitude,
+                        BaseGgpFacility::getStreetTown, BaseGgpFacility::getContact, BaseGgpFacility::getContactPhone,
                         BaseGgpFacility::getCheckComment);
-                query1.eq(StringUtils.isNotBlank(baseGgpFacilityVO.getStreetTown()),BaseGgpFacility::getStreetTown,
+                query1.eq(StringUtils.isNotBlank(baseGgpFacilityVO.getStreetTown()), BaseGgpFacility::getStreetTown,
                         baseGgpFacilityVO.getStreetTown());
-                query1.eq(BaseGgpFacility::getFacilityType,39);
+                query1.eq(BaseGgpFacility::getFacilityType, 39);
                 List<BaseGgpFacility> list1 = this.list(query1);
                 LambdaQueryWrapper<BaseGgpFacility> query2 = Wrappers.lambdaQuery();
-                query2.eq(StringUtils.isNotBlank(baseGgpFacilityVO.getStreetTown()),BaseGgpFacility::getStreetTown,
+                query2.eq(StringUtils.isNotBlank(baseGgpFacilityVO.getStreetTown()), BaseGgpFacility::getStreetTown,
                         baseGgpFacilityVO.getStreetTown());
-                query2.eq(BaseGgpFacility::getFacilityType,42);
+                query2.eq(BaseGgpFacility::getFacilityType, 42);
                 List<BaseGgpFacility> list2 = this.list(query2);
                 list.addAll(list1);
                 list.addAll(list2);
-            }else {
+            } else {
                 LambdaQueryWrapper<BaseGgpFacility> query = Wrappers.lambdaQuery();
-                if (baseGgpFacilityVO.getFacilityType().size()==1){
-                    if(baseGgpFacilityVO.getFacilityType().get(0)==39){
-                        query.select(BaseGgpFacility::getId,BaseGgpFacility::getFacilityName,BaseGgpFacility::getAddress,
-                                BaseGgpFacility::getFacilityType,BaseGgpFacility::getLongitude,BaseGgpFacility::getLatitude,
-                                BaseGgpFacility::getStreetTown,BaseGgpFacility::getContact,BaseGgpFacility::getContactPhone,
+                if (baseGgpFacilityVO.getFacilityType().size() == 1) {
+                    if (baseGgpFacilityVO.getFacilityType().get(0) == 39) {
+                        query.select(BaseGgpFacility::getId, BaseGgpFacility::getFacilityName, BaseGgpFacility::getAddress,
+                                BaseGgpFacility::getFacilityType, BaseGgpFacility::getLongitude, BaseGgpFacility::getLatitude,
+                                BaseGgpFacility::getStreetTown, BaseGgpFacility::getContact, BaseGgpFacility::getContactPhone,
                                 BaseGgpFacility::getCheckComment);
                     }
                 }
-                query.eq(StringUtils.isNotBlank(baseGgpFacilityVO.getStreetTown()),BaseGgpFacility::getStreetTown, baseGgpFacilityVO.getStreetTown());
-                query.in(CollectionUtils.isNotEmpty(baseGgpFacilityVO.getFacilityType()),BaseGgpFacility::getFacilityType,
+                query.eq(StringUtils.isNotBlank(baseGgpFacilityVO.getStreetTown()), BaseGgpFacility::getStreetTown, baseGgpFacilityVO.getStreetTown());
+                query.in(CollectionUtils.isNotEmpty(baseGgpFacilityVO.getFacilityType()), BaseGgpFacility::getFacilityType,
                         baseGgpFacilityVO.getFacilityType());
                 list = this.list(query);
             }
-        }else {
+        } else {
             LambdaQueryWrapper<BaseGgpFacility> query = Wrappers.lambdaQuery();
             query.eq(BaseGgpFacility::getId, baseGgpFacilityVO.getId());
             list = this.list(query);
@@ -87,15 +88,15 @@ public class BaseGgpFacilityServiceImpl extends AbstractCrudService<BaseGgpFacil
     }
 
     @Override
-    public List<BaseGgpFacilityStatisticVO> statistic(BaseGgpFacilityVO baseGgpFacilityVO){
+    public List<BaseGgpFacilityStatisticVO> statistic(BaseGgpFacilityVO baseGgpFacilityVO) {
         List<BaseGgpFacilityStatisticVO> list = new ArrayList<>();
         QueryWrapper<BaseGgpFacility> queryWrapper = Wrappers.query();
-        if(baseGgpFacilityVO.getStatisticType().equals("street")){
-            queryWrapper.select("street_town as streetTown","count(*) as count1")
-                    .in("facility_type",baseGgpFacilityVO.getFacilityType())
+        if (baseGgpFacilityVO.getStatisticType().equals("street")) {
+            queryWrapper.select("street_town as streetTown", "count(*) as count1")
+                    .in("facility_type", baseGgpFacilityVO.getFacilityType())
                     .groupBy("street_town");
-            List<Map<String,Object>> maps = this.listMaps(queryWrapper);
-            if(maps.size() > 0){
+            List<Map<String, Object>> maps = this.listMaps(queryWrapper);
+            if (maps.size() > 0) {
                 for (int i = 0; i < maps.size(); i++) {
                     BaseGgpFacilityStatisticVO statisticVO = new BaseGgpFacilityStatisticVO();
                     statisticVO.setStreetTown(maps.get(i).get("streetTown").toString());
@@ -103,12 +104,12 @@ public class BaseGgpFacilityServiceImpl extends AbstractCrudService<BaseGgpFacil
                     list.add(statisticVO);
                 }
             }
-        }else if(baseGgpFacilityVO.getStatisticType().equals("facilityType")){
-            queryWrapper.select("facility_type as facilityType","count(*) as count2")
-                    .in("facility_type",baseGgpFacilityVO.getFacilityType())
+        } else if (baseGgpFacilityVO.getStatisticType().equals("facilityType")) {
+            queryWrapper.select("facility_type as facilityType", "count(*) as count2")
+                    .in("facility_type", baseGgpFacilityVO.getFacilityType())
                     .groupBy("facility_type");
-            List<Map<String,Object>> maps = this.listMaps(queryWrapper);
-            if(maps.size() > 0){
+            List<Map<String, Object>> maps = this.listMaps(queryWrapper);
+            if (maps.size() > 0) {
                 for (int i = 0; i < maps.size(); i++) {
                     BaseGgpFacilityStatisticVO statisticVO = new BaseGgpFacilityStatisticVO();
                     statisticVO.setFacilityType(Integer.parseInt(maps.get(i).get("facilityType").toString()));
@@ -121,4 +122,41 @@ public class BaseGgpFacilityServiceImpl extends AbstractCrudService<BaseGgpFacil
 
         return list;
     }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void lonLatConversion(List<BaseCompanyLonLatVO> list) {
+        if (CollectionUtils.isEmpty(list)) {
+            return;
+        }
+        List<BaseGgpFacility> batch = list.stream()
+                .map(vo -> {
+                    BaseGgpFacility attach1 = new BaseGgpFacility();
+                    attach1.setId(vo.getId());
+                    attach1.setLongitude(vo.getLongitude());
+                    attach1.setLatitude(vo.getLatitude());
+                    return attach1;
+                })
+                .collect(Collectors.toList());
+
+        this.updateBatchById(batch, 2000);
+    }
+
+    @Override
+    public List<BaseCompanyLonLatVO> getLonLat() {
+        return baseMapper.selectList(
+                        Wrappers.<BaseGgpFacility>lambdaQuery()
+                                .select(BaseGgpFacility::getId,
+                                        BaseGgpFacility::getLongitude,
+                                        BaseGgpFacility::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());
+    }
 }

+ 28 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/BaseCompanyLonLatVO.java

@@ -0,0 +1,28 @@
+package com.usky.fire.service.vo;
+
+import lombok.Data;
+
+/**
+ *
+ * @author fyc
+ * @email yuchuan.fu@chinausky.com
+ * @date 2025/10/15
+ */
+@Data
+public class BaseCompanyLonLatVO {
+
+    /**
+     * 主键ID
+     */
+    private Integer id;
+
+    /**
+     * 经度
+     */
+    private String longitude;
+
+    /**
+     * 纬度
+     */
+    private String latitude;
+}

+ 6 - 6
service-fire/service-fire-biz/src/main/resources/application.yml

@@ -43,12 +43,12 @@ spring:
     dynamic:
       datasource:
         master:
-#          url: jdbc:mysql://192.168.10.165:3306/usky-fire?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&queryTimeout=2400
-#          username: root
-#          password: yt123456
-          driver-class-name: dm.jdbc.driver.DmDriver
-          password: Yt#75Usky
-          url: jdbc:dm://localhost:5237/SYSDBA?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF-8
+          url: jdbc:mysql://192.168.10.165:3306/usky-fire?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&queryTimeout=2400
+          username: root
+          password: yt123456
+#          driver-class-name: dm.jdbc.driver.DmDriver
+#          password: Yt#75Usky
+#          url: jdbc:dm://localhost:5237/SYSDBA?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF-8
       #          username: SYSDBA
       #        mhsystem:
       #          password: mysql570