>().ok(new PageData<>(new ArrayList<>(), NumConstant.ZERO));
@@ -236,6 +237,11 @@ public class HouseController implements ResultDataResolver {
@RequestMapping("exporthouseinfo")
public void exporthouseinfo(@RequestBody IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception {
ValidatorUtils.validateEntity(formDTO);
+ if (StringUtils.isNotBlank(formDTO.getId())){
+ formDTO.setSelectType("id");
+ }else{
+ formDTO.setSelectType("agency");
+ }
formDTO.setIsPage(false);
houseService.exportBuildinginfo(formDTO, response);
@@ -367,8 +373,8 @@ public class HouseController implements ResultDataResolver {
if (StringUtils.isBlank(formDTO.getAgencyId())) {
LoginUserDetailsResultDTO loginUserDetail = getLoginUserDetailsResultDTO(tokenDto, "【查询房屋】查询当前staff所在组织信息失败");
formDTO.setAgencyId(loginUserDetail.getAgencyId());
- formDTO.setSelectType("agency");
}
+ formDTO.setSelectType("agency");
ValidatorUtils.validateEntity(formDTO);
ExcelWriter excelWriter = null;
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java
new file mode 100644
index 0000000000..21ca6fb933
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java
@@ -0,0 +1,291 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.controller;
+
+import com.epmet.commons.tools.annotation.LoginUser;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.security.dto.TokenDto;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.form.HouseInformationFormDTO;
+import com.epmet.dto.result.*;
+import com.epmet.entity.IcNeighborHoodEntity;
+import com.epmet.service.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+
+/**
+ * 双实信息相关
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2021-10-25
+ */
+@RestController
+@RequestMapping("houseInformation")
+public class HouseInformationController {
+
+ @Autowired
+ private IcNeighborHoodService icNeighborHoodService;
+
+ @Autowired
+ private IcBuildingService icBuildingService;
+
+ @Autowired
+ private IcBuildingUnitService icBuildingUnitService;
+
+ @Resource
+ private HouseInformationService houseInformationService;
+
+ @Autowired
+ private IcOrganizationCodeInfoService icOrganizationCodeInfoService;
+
+ /**
+ * @describe: 【双实录入】小区详情
+ * @author wangtong
+ * @date 2022/6/28 10:48
+ * @params [neighborhoodId]
+ * @return com.epmet.commons.tools.utils.Result
+ */
+ @PostMapping("neighborhoodDetail/{neighborhoodId}")
+ public Result neighborhoodDetail(@PathVariable("neighborhoodId") String neighborhoodId){
+ return icNeighborHoodService.neighborhoodDetail(neighborhoodId);
+ }
+
+ /**
+ * @describe: 【双实录入】楼栋详情
+ * @author wangtong
+ * @date 2022/6/28 14:30
+ * @params [buildingId]
+ * @return com.epmet.commons.tools.utils.Result
+ */
+ @PostMapping("getBuildingDetail/{buildingId}")
+ public Result getBuildingDetail(@PathVariable("buildingId") String buildingId){
+ return icBuildingService.getBuildingDetail(buildingId);
+ }
+
+ /**
+ * @describe: 【双实录入】单元详情
+ * @author wangtong
+ * @date 2022/6/28 15:00
+ * @params [unitId]
+ * @return com.epmet.commons.tools.utils.Result
+ */
+ @PostMapping("getUnitDetail/{unitId}")
+ public Result getUnitDetail(@PathVariable("unitId") String unitId){
+ return icBuildingUnitService.getUnitDetail(unitId);
+ }
+
+ /**
+ * 【双实录入】社区录入数据统计
+ *
+ * @Param tokenDTO
+ * @Param formDTO
+ * @Return {@link Result}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 15:32
+ */
+ @PostMapping("getCommunityCount")
+ public Result getCommunityCount(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) {
+ formDTO.setCustomerId(tokenDTO.getCustomerId());
+ formDTO.setStaffId(tokenDTO.getUserId());
+ return new Result().ok(houseInformationService.getCommunityCount(formDTO));
+ }
+
+ /**
+ * 【双实录入】社区-网格列表
+ *
+ * @Param tokenDTO
+ * @Param formDTO
+ * @Return {@link Result>}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 15:42
+ */
+ @PostMapping("getGridList")
+ public Result> getGridList(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) {
+ formDTO.setCustomerId(tokenDTO.getCustomerId());
+ formDTO.setStaffId(tokenDTO.getUserId());
+ return new Result>().ok(houseInformationService.getGridList(formDTO));
+ }
+
+ /**
+ * 【双实录入】网格录入数据统计
+ *
+ * @Param tokenDTO
+ * @Param formDTO
+ * @Return {@link Result}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 15:42
+ */
+ @PostMapping("getGridCount")
+ public Result getGridCount(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) {
+ formDTO.setCustomerId(tokenDTO.getCustomerId());
+ formDTO.setStaffId(tokenDTO.getUserId());
+ return new Result().ok(houseInformationService.getGridCount(formDTO));
+ }
+
+ /**
+ * 【双实录入】网格-小区列表
+ *
+ * @Param tokenDTO
+ * @Param formDTO
+ * @Return {@link Result>}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 16:23
+ */
+ @PostMapping("getNeighborHoodList")
+ public Result> getNeighborHoodList(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) {
+ formDTO.setCustomerId(tokenDTO.getCustomerId());
+ formDTO.setStaffId(tokenDTO.getUserId());
+ return new Result>().ok(houseInformationService.getNeighborHoodList(formDTO));
+ }
+
+ /**
+ * 【双实录入】小区录入数据统计
+ *
+ * @Param tokenDTO
+ * @Param formDTO
+ * @Return {@link Result}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 16:44
+ */
+ @PostMapping("getNeighborHoodCount")
+ public Result getNeighborHoodCount(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) {
+ formDTO.setCustomerId(tokenDTO.getCustomerId());
+ formDTO.setStaffId(tokenDTO.getUserId());
+ return new Result().ok(houseInformationService.getNeighborHoodCount(formDTO));
+ }
+
+ /**
+ * 【双实录入】小区-楼栋列表
+ *
+ * @Param tokenDTO
+ * @Param formDTO
+ * @Return {@link Result>}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 16:47
+ */
+ @PostMapping("getBuildingList")
+ public Result> getBuildingList(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) {
+ formDTO.setCustomerId(tokenDTO.getCustomerId());
+ formDTO.setStaffId(tokenDTO.getUserId());
+ return new Result>().ok(houseInformationService.getBuildingList(formDTO));
+ }
+
+
+ /**
+ * 【双实录入】楼栋录入数据统计
+ *
+ * @Param tokenDTO
+ * @Param formDTO
+ * @Return {@link Result}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 16:51
+ */
+ @PostMapping("getBuildingCount")
+ public Result getBuildingCount(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) {
+ formDTO.setCustomerId(tokenDTO.getCustomerId());
+ formDTO.setStaffId(tokenDTO.getUserId());
+ return new Result().ok(houseInformationService.getBuildingCount(formDTO));
+ }
+
+ /**
+ * 【双实录入】楼栋-单元列表
+ *
+ * @Param tokenDTO
+ * @Param formDTO
+ * @Return {@link Result>}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 16:55
+ */
+ @PostMapping("getUnitList")
+ public Result> getUnitList(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) {
+ formDTO.setCustomerId(tokenDTO.getCustomerId());
+ formDTO.setStaffId(tokenDTO.getUserId());
+ return new Result>().ok(houseInformationService.getUnitList(formDTO));
+ }
+
+ /**
+ * 【双实录入】单元录入数据统计
+ *
+ * @Param tokenDTO
+ * @Param formDTO
+ * @Return {@link Result}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 16:57
+ */
+ @PostMapping("getUnitCount")
+ public Result getUnitCount(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) {
+ formDTO.setCustomerId(tokenDTO.getCustomerId());
+ formDTO.setStaffId(tokenDTO.getUserId());
+ return new Result().ok(houseInformationService.getUnitCount(formDTO));
+ }
+
+ /**
+ * 【双实录入】单元-房屋列表
+ *
+ * @Param tokenDTO
+ * @Param formDTO
+ * @Return {@link Result>}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 17:02
+ */
+ @PostMapping("getHouseList")
+ public Result> getHouseList(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) {
+ formDTO.setCustomerId(tokenDTO.getCustomerId());
+ formDTO.setStaffId(tokenDTO.getUserId());
+ return new Result>().ok(houseInformationService.getHouseList(formDTO));
+ }
+
+ /**
+ * @describe: 【双实录入】获取小区编码
+ * @author wangtong
+ * @date 2022/6/29 9:59
+ * @params [tokenDTO, gridId]
+ * @return com.epmet.commons.tools.utils.Result
+ */
+ @PostMapping("getNeighborHoodCoding/{gridId}")
+ public Result getNeighborHoodCoding(@LoginUser TokenDto tokenDTO, @PathVariable("gridId") String gridId) {
+ return icOrganizationCodeInfoService.getNeighborHoodCoding(tokenDTO.getCustomerId(),gridId,false);
+ }
+
+ /**
+ * @describe: 【双实录入】获取楼栋编码
+ * @author wangtong
+ * @date 2022/6/29 9:59
+ * @params [tokenDTO, neighborhoodId]
+ * @return com.epmet.commons.tools.utils.Result
+ */
+ @PostMapping("getBuildingCoding/{neighborhoodId}")
+ public Result getBuildingCoding(@LoginUser TokenDto tokenDTO, @PathVariable("neighborhoodId") String neighborhoodId) {
+ return icOrganizationCodeInfoService.getBuildingCoding(tokenDTO.getCustomerId(),neighborhoodId,false);
+ }
+
+ /**
+ * @describe: 【双实录入】获取房屋编码
+ * @author wangtong
+ * @date 2022/6/29 9:59
+ * @params [tokenDTO, unitId]
+ * @return com.epmet.commons.tools.utils.Result
+ */
+ @PostMapping("getHouseCoding/{unitId}")
+ public Result getHouseCoding(@LoginUser TokenDto tokenDTO, @PathVariable("unitId") String unitId) {
+ return icOrganizationCodeInfoService.getHouseCoding(tokenDTO.getCustomerId(),unitId,false);
+ }
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcOrganizationCodeInfoController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcOrganizationCodeInfoController.java
new file mode 100644
index 0000000000..5e20a16ea3
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcOrganizationCodeInfoController.java
@@ -0,0 +1,82 @@
+package com.epmet.controller;
+
+import com.epmet.commons.tools.aop.NoRepeatSubmit;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ExcelUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.AssertUtils;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.commons.tools.validator.group.AddGroup;
+import com.epmet.commons.tools.validator.group.UpdateGroup;
+import com.epmet.commons.tools.validator.group.DefaultGroup;
+import com.epmet.dto.IcOrganizationCodeInfoDTO;
+import com.epmet.excel.IcOrganizationCodeInfoExcel;
+import com.epmet.service.IcOrganizationCodeInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 小区/楼栋/房屋编码辅助表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-06-27
+ */
+@RestController
+@RequestMapping("icOrganizationCodeInfo")
+public class IcOrganizationCodeInfoController {
+
+ @Autowired
+ private IcOrganizationCodeInfoService icOrganizationCodeInfoService;
+
+ @RequestMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = icOrganizationCodeInfoService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
+ public Result get(@PathVariable("id") String id){
+ IcOrganizationCodeInfoDTO data = icOrganizationCodeInfoService.get(id);
+ return new Result().ok(data);
+ }
+
+ @NoRepeatSubmit
+ @PostMapping("save")
+ public Result save(@RequestBody IcOrganizationCodeInfoDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ icOrganizationCodeInfoService.save(dto);
+ return new Result();
+ }
+
+ @NoRepeatSubmit
+ @PostMapping("update")
+ public Result update(@RequestBody IcOrganizationCodeInfoDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ icOrganizationCodeInfoService.update(dto);
+ return new Result();
+ }
+
+ @PostMapping("delete")
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ icOrganizationCodeInfoService.delete(ids);
+ return new Result();
+ }
+
+ @GetMapping("export")
+ public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = icOrganizationCodeInfoService.list(params);
+ ExcelUtils.exportExcelToTarget(response, null, list, IcOrganizationCodeInfoExcel.class);
+ }
+
+
+
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
index 02e483d9f2..1c4aa9394c 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
@@ -19,6 +19,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.CustomerAgencyDTO;
+import com.epmet.dto.form.OrgInfoPointFormDTO;
import com.epmet.dto.form.OrgTreeByUserAndTypeFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity;
@@ -320,6 +321,8 @@ public interface CustomerAgencyDao extends BaseDao {
*/
List getCommunityList(@Param("customerId") String customerId, @Param("agencyId") String agencyId);
+ List communityListByCustomerId(@Param("customerId") String customerId);
+
List selectSubOrg(String agencyId);
/**
@@ -331,6 +334,8 @@ public interface CustomerAgencyDao extends BaseDao {
*/
List getOrgTreeByUserAndType(OrgTreeByUserAndTypeFormDTO formDto);
+ List getOrgTreeListByCustomerId(@Param("customerId") String customerId);
+
/**
* 通讯录树
*
@@ -344,5 +349,9 @@ public interface CustomerAgencyDao extends BaseDao {
@Param("customerId") String customerId);
List getDelAgencyIdList(@Param("agencyId") String agencyId);
+
+ CommunityInfoResultDTO getCommunityInfo(OrgInfoPointFormDTO formDTO);
+
+ CommunityInfoResultDTO getCommunityInfoByUserId(@Param("userId") String userId);
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
index 737e579fa5..1fb999e0f0 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
@@ -384,4 +384,13 @@ public interface CustomerGridDao extends BaseDao {
int updateTotalUser(@Param("gridId") String gridId, @Param("incrCount") long incrCount);
List getDelGridIdList(@Param("agencyId") String agencyId);
+
+ /**
+ * @describe: 通过网格id获取社区行政编码
+ * @author wangtong
+ * @date 2022/6/29 10:16
+ * @params [gridId]
+ * @return com.epmet.dto.result.OrganizationCommunityDTO
+ */
+ OrganizationCommunityDTO selectCommunityByGridId(@Param("gridId") String gridId);
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java
index 3fd205a48d..8b0cd3f470 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java
@@ -196,4 +196,32 @@ public interface IcBuildingDao extends BaseDao {
*/
Integer selectUnitCount(@Param("buildingId")String buildingId);
+ /**
+ * @describe: 获取楼栋详情
+ * @author wangtong
+ * @date 2022/6/28 16:16
+ * @params [buildingId]
+ * @return com.epmet.dto.result.IcBulidingDetailDTO
+ */
+ IcBulidingDetailDTO getBuildingDetail(@Param("buildingId") String buildingId);
+
+ /**
+ * @describe: 查询社区id及楼栋编码
+ * @author wangtong
+ * @date 2022/6/29 14:39
+ * @params [buildingId]
+ * @return com.epmet.dto.result.OrganizationCommunityDTO
+ */
+ OrganizationCommunityDTO selectCommunityByBuildingId(@Param("buildingId") String buildingId);
+
+ /**
+ * @describe: 通过可编辑编码查询
+ * @author wangtong
+ * @date 2022/6/29 14:57
+ * @params [coding]
+ * @return com.epmet.entity.IcBuildingEntity
+ */
+ IcBuildingEntity selectByCoding(@Param("coding") String coding,
+ @Param("id") String id);
+
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java
index 147f25f7d2..09c40920ed 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java
@@ -18,6 +18,8 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.result.HouseInfoResultDTO;
+import com.epmet.dto.result.OrganizationCommunityDTO;
import com.epmet.entity.IcBuildingUnitEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -50,4 +52,30 @@ public interface IcBuildingUnitDao extends BaseDao {
*/
void delUnit(@Param("ids")List ids);
-}
\ No newline at end of file
+ /**
+ * @describe: 获取单元详情
+ * @author wangtong
+ * @date 2022/6/28 17:03
+ * @params [unitId]
+ * @return com.epmet.dto.result.HouseInfoResultDTO
+ */
+ HouseInfoResultDTO getUnitDetail(@Param("unitId") String unitId);
+
+ /**
+ * @describe: 通过可编辑编码查询
+ * @author wangtong
+ * @date 2022/6/29 14:59
+ * @params [coding]
+ * @return com.epmet.entity.IcBuildingUnitEntity
+ */
+ IcBuildingUnitEntity selectByCoding(@Param("coding") String coding);
+
+ /**
+ * @describe: 查询社区id及单元编码
+ * @author wangtong
+ * @date 2022/6/29 15:15
+ * @params [buildingId]
+ * @return com.epmet.dto.result.OrganizationCommunityDTO
+ */
+ OrganizationCommunityDTO selectCommunityByUnitId(@Param("unitId") String unitId);
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcCityManagementDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcCityManagementDao.java
index b22f9734c6..fb9664fa0d 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcCityManagementDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcCityManagementDao.java
@@ -24,4 +24,5 @@ public interface IcCityManagementDao extends BaseDao {
void importInsert(@Param("entityList") List entityList);
+ void delByAgencyAndName(IcCityManagementEntity entity);
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcDangerousChemicalsDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcDangerousChemicalsDao.java
index 5f75264465..83adfa87b8 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcDangerousChemicalsDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcDangerousChemicalsDao.java
@@ -5,6 +5,7 @@ import com.epmet.dto.form.IcDangerousChemicalsListFormDTO;
import com.epmet.dto.result.IcDangerousChemicalsListResultDTO;
import com.epmet.entity.IcDangerousChemicalsEntity;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -21,5 +22,7 @@ public interface IcDangerousChemicalsDao extends BaseDao entityList);
+ void importInsert(@Param("entityList") List entityList);
+
+ void delByAgencyAndName(IcDangerousChemicalsEntity entity);
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
index a2213ed024..35abf9d798 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
@@ -176,9 +176,18 @@ public interface IcHouseDao extends BaseDao {
/**
* desc:更新房屋的屋内居民数 及更新时间 不更新 更新人以及 resiNumber没有变化的 记录
*
- * @param houseId,
+ * @param houseId,
* @param resiNumber
* @return
*/
int updateIcHouseResiNumber(String houseId, Integer resiNumber);
+
+ /**
+ * @return com.epmet.entity.IcHouseEntity
+ * @describe: 通过可编辑的编码查询
+ * @author wangtong
+ * @date 2022/6/29 15:24
+ * @params [coding]
+ */
+ IcHouseEntity selectByCoding(@Param("coding") String coding);
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java
index ca929081cc..a1999a0ee6 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java
@@ -21,8 +21,9 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.NeighborHoodAndManagementDTO;
+import com.epmet.dto.form.HouseInformationFormDTO;
import com.epmet.dto.form.IcNeighborHoodListFormDTO;
-import com.epmet.dto.result.IcNeighborHoodResultDTO;
+import com.epmet.dto.result.*;
import com.epmet.entity.IcHouseEntity;
import com.epmet.entity.IcNeighborHoodEntity;
import com.epmet.excel.IcNeighborHoodExcel;
@@ -91,4 +92,123 @@ public interface IcNeighborHoodDao extends BaseDao {
void updateOneNeighborHood(ImportGeneralDTO info);
String getAreaCode(@Param("neighborHoodId")String neighborHoodId);
+
+ /**
+ * @describe: 查询社区id及小区编码
+ * @author wangtong
+ * @date 2022/6/29 13:35
+ * @params [neighborhoodId]
+ * @return com.epmet.dto.result.OrganizationCommunityDTO
+ */
+ OrganizationCommunityDTO selectCommunityByNeiId(@Param("neighborhoodId") String neighborhoodId);
+
+ /**
+ * @describe: 通过可编辑的编码查询
+ * @author wangtong
+ * @date 2022/6/29 14:08
+ * @params [coding]
+ * @return com.epmet.entity.IcNeighborHoodEntity
+ */
+ IcNeighborHoodEntity selectByCoding(@Param("coding") String coding,
+ @Param("id") String id);
+
+ /**
+ * 社区录入数据统计
+ *
+ * @Param communityId
+ * @Return {@link CommunityCountResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 17:16
+ */
+ CommunityCountResultDTO getCommunityCount(HouseInformationFormDTO formDTO);
+
+ /**
+ * 【双实录入】社区-网格列表
+ *
+ * @Param formDTO
+ * @Return {@link List< GridCountListResultDTO>}
+ * @Author zhaoqifeng
+ * @Date 2022/6/29 11:06
+ */
+ List getGridList(HouseInformationFormDTO formDTO);
+
+ /**
+ * 【双实录入】网格录入数据统计
+ *
+ * @Param formDTO
+ * @Return {@link GridStatisticsResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2022/6/29 13:52
+ */
+ GridStatisticsResultDTO getGridCount(HouseInformationFormDTO formDTO);
+
+ /**
+ * 【双实录入】网格-小区列表
+ *
+ * @Param formDTO
+ * @Return {@link List}
+ * @Author zhaoqifeng
+ * @Date 2022/6/29 14:11
+ */
+ List getNeighborHoodList(HouseInformationFormDTO formDTO);
+
+ /**
+ * 【双实录入】小区录入数据统计
+ *
+ * @Param formDTO
+ * @Return {@link NeighborHoodCountResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2022/6/29 14:27
+ */
+ NeighborHoodCountResultDTO getNeighborHoodCount(HouseInformationFormDTO formDTO);
+
+ /**
+ * 【双实录入】小区-楼栋列表
+ *
+ * @Param formDTO
+ * @Return {@link List< BuildingListResultDTO>}
+ * @Author zhaoqifeng
+ * @Date 2022/6/29 14:50
+ */
+ List getBuildingList(HouseInformationFormDTO formDTO);
+
+ /**
+ * 【双实录入】楼栋录入数据统计
+ *
+ * @Param formDTO
+ * @Return {@link BuildingCountResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2022/6/29 15:44
+ */
+ BuildingCountResultDTO getBuildingCount(HouseInformationFormDTO formDTO);
+
+ /**
+ * 【双实录入】楼栋-单元列表
+ *
+ * @Param formDTO
+ * @Return {@link List}
+ * @Author zhaoqifeng
+ * @Date 2022/6/29 16:07
+ */
+ List getUnitList(HouseInformationFormDTO formDTO);
+
+ /**
+ * 【双实录入】单元录入数据统计
+ *
+ * @Param formDTO
+ * @Return {@link UnitCountResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2022/6/29 16:06
+ */
+ UnitCountResultDTO getUnitCount(HouseInformationFormDTO formDTO);
+
+ /**
+ * 【双实录入】单元-房屋列表
+ *
+ * @Param formDTO
+ * @Return {@link List}
+ * @Author zhaoqifeng
+ * @Date 2022/6/29 16:48
+ */
+ List getHouseList(HouseInformationFormDTO formDTO);
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcOrganizationCodeInfoDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcOrganizationCodeInfoDao.java
new file mode 100644
index 0000000000..d217c69a5a
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcOrganizationCodeInfoDao.java
@@ -0,0 +1,63 @@
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.entity.IcOrganizationCodeInfoEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 小区/楼栋/房屋编码辅助表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-06-27
+ */
+@Mapper
+public interface IcOrganizationCodeInfoDao extends BaseDao {
+
+ /**
+ * @describe: 通过客户id和社区id查询
+ * @author wangtong
+ * @date 2022/6/29 10:24
+ * @params [customerId, communityId]
+ * @return com.epmet.entity.IcOrganizationCodeInfoEntity
+ */
+ IcOrganizationCodeInfoEntity selectByIdAndType(@Param("customerId") String customerId,
+ @Param("sysId") String sysId,
+ @Param("sysType") String sysType);
+
+ /**
+ * @describe: 根据客户id和社区id更新小区编号
+ * @author wangtong
+ * @date 2022/6/29 10:53
+ * @params [communEntity]
+ * @return void
+ */
+ void updateMaxNumByIdAndType(IcOrganizationCodeInfoEntity communEntity);
+
+// /**
+// * @describe: 根据客户id和社区id更新楼栋编号
+// * @author wangtong
+// * @date 2022/6/29 14:51
+// * @params [buildingEntity]
+// * @return void
+// */
+// void updateBuildingByCuIdAndCoId(IcOrganizationCodeInfoEntity buildingEntity);
+//
+// /**
+// * @describe: 根据客户id和社区id更新单元编号
+// * @author wangtong
+// * @date 2022/6/29 15:01
+// * @params [unitEntity]
+// * @return void
+// */
+// void updateUnitByCuIdAndCoId(IcOrganizationCodeInfoEntity unitEntity);
+//
+// /**
+// * @describe: 根据客户id和社区id更新房屋编号
+// * @author wangtong
+// * @date 2022/6/29 15:25
+// * @params [houseEntity]
+// * @return void
+// */
+// void updateHouseByCuIdAndCoId(IcOrganizationCodeInfoEntity houseEntity);
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPublicServiceDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPublicServiceDao.java
index 3f29ecba64..d7ac4b6ef1 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPublicServiceDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPublicServiceDao.java
@@ -23,4 +23,6 @@ public interface IcPublicServiceDao extends BaseDao {
void del(IcPublicServiceEntity entity);
void importInsert(@Param("entityList") List entityList);
+
+ void delByAgencyAndName(IcPublicServiceEntity entity);
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcSuperiorResourceDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcSuperiorResourceDao.java
index cbd187c7bf..361cc8c5bf 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcSuperiorResourceDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcSuperiorResourceDao.java
@@ -23,4 +23,6 @@ public interface IcSuperiorResourceDao extends BaseDao
void del(IcSuperiorResourceEntity entity);
void importInsert(@Param("entityList") List entityList);
+
+ void delByAgencyAndName(IcSuperiorResourceEntity entity);
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingEntity.java
index 1b0535f803..801267e2dd 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingEntity.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingEntity.java
@@ -107,4 +107,19 @@ public class IcBuildingEntity extends BaseEpmetEntity {
*/
private String coordinatePosition;
+ /**
+ * 楼栋编码
+ */
+ private String coding;
+
+ /**
+ * 楼栋系统编码
+ */
+ private String sysCoding;
+
+ /**
+ * 实有人口数
+ */
+ private Integer realPerson;
+
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingUnitEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingUnitEntity.java
index bce611c47f..02124c90cc 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingUnitEntity.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingUnitEntity.java
@@ -55,4 +55,14 @@ public class IcBuildingUnitEntity extends BaseEpmetEntity {
*/
private String unitName;
+ /**
+ * 楼栋编码
+ */
+ private String coding;
+
+ /**
+ * 楼栋系统编码
+ */
+ private String sysCoding;
+
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java
index 25a02ec5fd..96e993c865 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java
@@ -132,4 +132,8 @@ public class IcHouseEntity extends BaseEpmetEntity {
* 居住人数
*/
private Integer resiNumber;
+ /**
+ * 房屋可编辑编码
+ */
+ private String coding;
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodEntity.java
index 8f83a0aba1..f96edb70bb 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodEntity.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodEntity.java
@@ -101,4 +101,19 @@ public class IcNeighborHoodEntity extends BaseEpmetEntity {
@TableField(exist = false)
private String propertyName;
+
+ /**
+ * 小区编码
+ */
+ private String coding;
+
+ /**
+ * 小区系统编码
+ */
+ private String sysCoding;
+
+ /**
+ * 实有楼栋数
+ */
+ private Integer realBuilding;
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcOrganizationCodeInfoEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcOrganizationCodeInfoEntity.java
new file mode 100644
index 0000000000..a5d9c8e9a4
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcOrganizationCodeInfoEntity.java
@@ -0,0 +1,45 @@
+package com.epmet.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 小区/楼栋/房屋编码辅助表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-06-27
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("ic_organization_code_info")
+public class IcOrganizationCodeInfoEntity{
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 社区/小区/楼栋/单元id
+ */
+ private String sysId;
+
+ /**
+ * 类型:
+ * 社区community
+ * 小区neighbor
+ * 楼栋building
+ * 单元unit
+ */
+ private String sysType;
+
+ /**
+ * 最大数
+ */
+ private String maxNum;
+
+
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcOrganizationCodeInfoExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcOrganizationCodeInfoExcel.java
new file mode 100644
index 0000000000..3402ef797a
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcOrganizationCodeInfoExcel.java
@@ -0,0 +1,33 @@
+package com.epmet.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 小区/楼栋/房屋编码辅助表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-06-27
+ */
+@Data
+public class IcOrganizationCodeInfoExcel {
+
+ @Excel(name = "客户id")
+ private String customerId;
+
+ @Excel(name = "社区id")
+ private String communityId;
+
+ @Excel(name = "该社区下最大的小区编码序列号")
+ private String neighborMaxNum;
+
+ @Excel(name = "该社区下最大的楼栋编码序列号")
+ private String buildingMaxNum;
+
+ @Excel(name = "该社区下最大的房屋编码序列号")
+ private String houseMaxNum;
+
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcOrganizationCodeInfoRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcOrganizationCodeInfoRedis.java
new file mode 100644
index 0000000000..50860d27ae
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcOrganizationCodeInfoRedis.java
@@ -0,0 +1,30 @@
+package com.epmet.redis;
+
+import com.epmet.commons.tools.redis.RedisUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 小区/楼栋/房屋编码辅助表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-06-27
+ */
+@Component
+public class IcOrganizationCodeInfoRedis {
+ @Autowired
+ private RedisUtils redisUtils;
+
+ public void delete(Object[] ids) {
+
+ }
+
+ public void set(){
+
+ }
+
+ public String get(String id){
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java
index ea43abd53e..4ae4672647 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java
@@ -150,6 +150,24 @@ public interface AgencyService {
*/
List getCommunityList(TokenDto tokenDto);
+ /**
+ * Desc: 查询客户下的所有社区
+ *
+ * @param tokenDto
+ * @author wgf
+ * @date 2022/6/23 09:13
+ */
+ List communityListByCustomerId(TokenDto tokenDto);
+
+ /**
+ * Desc: 查询客户下的所有街道社区
+ *
+ * @param tokenDto
+ * @author wgf
+ * @date 2022/6/23 09:13
+ */
+ List getOrgTreeListByCustomerId(TokenDto tokenDto);
+
/**
* 通讯录树状结构
*
@@ -160,4 +178,4 @@ public interface AgencyService {
* @date 2022/5/16 10:43
*/
List getAddressTree(String name, String customerId);
-}
\ No newline at end of file
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
index dcdc1d44a8..21e6f17320 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
@@ -24,6 +24,7 @@ import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity;
+import org.springframework.web.bind.annotation.PathVariable;
import java.util.List;
import java.util.Map;
@@ -317,4 +318,22 @@ public interface CustomerAgencyService extends BaseService
* @Description 获取当前组织及下级无效组织、网格Id列表
**/
DelAgencyGridIdResultDTO getDelAgencyGridIdList(String agencyId);
+
+ /**
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @Author wgf
+ * @Description 根据社区名称查询所属组织信息
+ * @Date 2022/6/21 22:41
+ **/
+ Result getCommunityInfo(OrgInfoPointFormDTO formDTO);
+
+ /**
+ * @param userId
+ * @return com.epmet.commons.tools.utils.Result
+ * @Author wgf
+ * @Description 根据用户ID查询所属组织信息
+ * @Date 2022/6/21 22:41
+ **/
+ Result getCommunityInfoByUserId(String userId);
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseInformationService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseInformationService.java
new file mode 100644
index 0000000000..ab49566845
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseInformationService.java
@@ -0,0 +1,112 @@
+package com.epmet.service;
+
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.dto.form.HouseInformationFormDTO;
+import com.epmet.dto.result.*;
+
+/**
+ * @Description
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 15:14
+ */
+public interface HouseInformationService {
+ /**
+ * 【双实录入】社区录入数据统计
+ *
+ * @Param formDTO
+ * @Return {@link CommunityCountResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 15:31
+ */
+ CommunityCountResultDTO getCommunityCount(HouseInformationFormDTO formDTO);
+
+ /**
+ * 【双实录入】社区-网格列表
+ *
+ * @Param formDTO
+ * @Return {@link PageData}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 15:41
+ */
+ PageData getGridList(HouseInformationFormDTO formDTO);
+
+ /**
+ * 【双实录入】网格录入数据统计
+ *
+ * @Param formDTO
+ * @Return {@link GridStatisticsResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 15:41
+ */
+ GridStatisticsResultDTO getGridCount(HouseInformationFormDTO formDTO);
+
+ /**
+ * 【双实录入】网格-小区列表
+ *
+ * @Param formDTO
+ * @Return {@link PageData}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 16:24
+ */
+ PageData getNeighborHoodList(HouseInformationFormDTO formDTO);
+
+ /**
+ * 【双实录入】小区录入数据统计
+ *
+ * @Param formDTO
+ * @Return {@link NeighborHoodCountResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 16:43
+ */
+ NeighborHoodCountResultDTO getNeighborHoodCount(HouseInformationFormDTO formDTO);
+
+ /**
+ * 【双实录入】小区-楼栋列表
+ *
+ * @Param formDTO
+ * @Return {@link PageData}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 16:47
+ */
+ PageData getBuildingList(HouseInformationFormDTO formDTO);
+
+ /**
+ * 【双实录入】楼栋录入数据统计
+ *
+ * @Param formDTO
+ * @Return {@link BuildingCountResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 16:50
+ */
+ BuildingCountResultDTO getBuildingCount(HouseInformationFormDTO formDTO);
+
+ /**
+ * 【双实录入】楼栋-单元列表
+ *
+ * @Param formDTO
+ * @Return {@link PageData}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 16:54
+ */
+ PageData getUnitList(HouseInformationFormDTO formDTO);
+
+ /**
+ * 【双实录入】单元录入数据统计
+ *
+ * @Param formDTO
+ * @Return {@link UnitCountResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 16:57
+ */
+ UnitCountResultDTO getUnitCount(HouseInformationFormDTO formDTO);
+
+ /**
+ * 【双实录入】单元-房屋列表
+ *
+ * @Param formDTO
+ * @Return {@link PageData}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 17:01
+ */
+ PageData getHouseList(HouseInformationFormDTO formDTO);
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingService.java
index 0822d4805b..cde64d4da0 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingService.java
@@ -20,8 +20,10 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcBuildingDTO;
import com.epmet.dto.ImportGeneralDTO;
+import com.epmet.dto.result.IcBulidingDetailDTO;
import com.epmet.entity.IcBuildingEntity;
import java.util.List;
@@ -122,4 +124,13 @@ public interface IcBuildingService extends BaseService {
* @date 2022/4/27 13:29
*/
void updateBuilding(ImportGeneralDTO info);
-}
\ No newline at end of file
+
+ /**
+ * @describe: 【双实录入】楼栋详情
+ * @author wangtong
+ * @date 2022/6/28 14:30
+ * @params [buildingId]
+ * @return com.epmet.commons.tools.utils.Result
+ */
+ Result getBuildingDetail(String buildingId);
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingUnitService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingUnitService.java
index 0d315539e6..da966fbf6e 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingUnitService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingUnitService.java
@@ -20,7 +20,9 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcBuildingUnitDTO;
+import com.epmet.dto.result.HouseInfoResultDTO;
import com.epmet.entity.IcBuildingUnitEntity;
import java.util.List;
@@ -112,4 +114,13 @@ public interface IcBuildingUnitService extends BaseService
* @Date 2022/2/14 15:42
*/
IcBuildingUnitDTO getUnitInfo(String buildingId, String unitName);
-}
\ No newline at end of file
+
+ /**
+ * @describe: 【双实录入】单元详情
+ * @author wangtong
+ * @date 2022/6/28 15:00
+ * @params [unitId]
+ * @return com.epmet.commons.tools.utils.Result
+ */
+ Result getUnitDetail(String unitId);
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java
index 087ab03441..085c363819 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java
@@ -172,4 +172,13 @@ public interface IcNeighborHoodService extends BaseService
* @date 2022/4/27 10:33
*/
void neighborHoodPropertyUpdate(List updateNeighborHoodAndManagement);
+
+ /**
+ * @describe: 【双实录入】小区详情
+ * @author wangtong
+ * @date 2022/6/28 15:04
+ * @params [neighborhoodId]
+ * @return com.epmet.commons.tools.utils.Result
+ */
+ Result neighborhoodDetail(String neighborhoodId);
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcOrganizationCodeInfoService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcOrganizationCodeInfoService.java
new file mode 100644
index 0000000000..58791b1b44
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcOrganizationCodeInfoService.java
@@ -0,0 +1,116 @@
+package com.epmet.service;
+
+import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.IcOrganizationCodeInfoDTO;
+import com.epmet.dto.result.OrganizationCodeResultDTO;
+import com.epmet.entity.IcOrganizationCodeInfoEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 小区/楼栋/房屋编码辅助表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-06-27
+ */
+public interface IcOrganizationCodeInfoService extends BaseService {
+
+ /**
+ * 默认分页
+ *
+ * @param params
+ * @return PageData
+ * @author generator
+ * @date 2022-06-27
+ */
+ PageData page(Map params);
+
+ /**
+ * 默认查询
+ *
+ * @param params
+ * @return java.util.List
+ * @author generator
+ * @date 2022-06-27
+ */
+ List list(Map params);
+
+ /**
+ * 单条查询
+ *
+ * @param id
+ * @return IcOrganizationCodeInfoDTO
+ * @author generator
+ * @date 2022-06-27
+ */
+ IcOrganizationCodeInfoDTO get(String id);
+
+ /**
+ * 默认保存
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2022-06-27
+ */
+ void save(IcOrganizationCodeInfoDTO dto);
+
+ /**
+ * 默认更新
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2022-06-27
+ */
+ void update(IcOrganizationCodeInfoDTO dto);
+
+ /**
+ * 批量删除
+ *
+ * @param ids
+ * @return void
+ * @author generator
+ * @date 2022-06-27
+ */
+ void delete(String[] ids);
+
+ /**
+ * @describe: 【双实录入】获取小区编码
+ * @author wangtong
+ * @date 2022/6/29 9:59
+ * @params [tokenDTO, gridId]
+ * @return com.epmet.commons.tools.utils.Result
+ */
+ Result getNeighborHoodCoding(String customerId, String gridId,Boolean updateFlag);
+
+ /**
+ * @describe: 【双实录入】获取楼栋编码
+ * @author wangtong
+ * @date 2022/6/29 9:59
+ * @params [tokenDTO, neighborhoodId]
+ * @return com.epmet.commons.tools.utils.Result
+ */
+ Result getBuildingCoding(String customerId, String neighborhoodId,Boolean updateFlag);
+
+ /**
+ * @describe: 【双实录入】获取单元编码
+ * @author wangtong
+ * @date 2022/6/29 9:59
+ * @params [tokenDTO, neighborhoodId]
+ * @return com.epmet.commons.tools.utils.Result
+ */
+ Result getUnitCoding(String customerId, String buildingId,Boolean updateFlag);
+
+ /**
+ * @describe: 【双实录入】获取房屋编码
+ * @author wangtong
+ * @date 2022/6/29 9:59
+ * @params [tokenDTO, unitId]
+ * @return com.epmet.commons.tools.utils.Result
+ */
+ Result getHouseCoding(String customerId, String unitId,Boolean updateFlag);
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
index ceee6804eb..cf2016de58 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
@@ -870,6 +870,23 @@ public class AgencyServiceImpl implements AgencyService {
return customerAgencyDao.getCommunityList(tokenDto.getCustomerId(), agencyId);
}
+ @Override
+ public List communityListByCustomerId(TokenDto tokenDto) {
+ if (null == tokenDto.getCustomerId()) {
+ throw new EpmetException("未查询到客户信息");
+ }
+ return customerAgencyDao.communityListByCustomerId(tokenDto.getCustomerId());
+ }
+
+ @Override
+ public List getOrgTreeListByCustomerId(TokenDto tokenDto) {
+ if (null == tokenDto.getCustomerId()) {
+ throw new EpmetException("未查询到客户信息");
+ }
+ List list = customerAgencyDao.getOrgTreeListByCustomerId(tokenDto.getCustomerId());
+ return NodeTreeUtils.build(list);
+ }
+
/**
* 通讯录树
*
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
index 6a95c20596..77fb6a3d53 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java
@@ -33,15 +33,13 @@ import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.*;
import com.epmet.enums.BuildingTypeEnums;
+import com.epmet.enums.OrganizationTypeEnums;
import com.epmet.excel.IcBuildingExcel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.model.BuildingInfoModel;
import com.epmet.model.ImportBuildingInfoListener;
import com.epmet.redis.IcHouseRedis;
-import com.epmet.service.BuildingService;
-import com.epmet.service.IcBuildingService;
-import com.epmet.service.IcBuildingUnitService;
-import com.epmet.service.IcNeighborHoodService;
+import com.epmet.service.*;
import com.epmet.util.ExcelPoiUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@@ -91,6 +89,13 @@ public class BuildingServiceImpl implements BuildingService {
private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient;
@Autowired
private ExecutorService executorService;
+ @Autowired
+ private IcOrganizationCodeInfoService icOrganizationCodeInfoService;
+ @Autowired
+ private IcOrganizationCodeInfoDao icOrganizationCodeInfoDao;
+ @Autowired
+ private IcOrganizationCodeInfoServiceImpl icOrganizationCodeInfoServiceImpl;
+
@Override
@Transactional(rollbackFor = Exception.class)
@@ -100,6 +105,14 @@ public class BuildingServiceImpl implements BuildingService {
if (null != count && count > 0) {
throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(), EpmetErrorCode.BUILDING_NAME_EXITED.getMsg());
}
+ //楼栋编码不可重复
+ if(org.apache.commons.lang3.StringUtils.isNotBlank(formDTO.getCoding())){
+ IcBuildingEntity isHaveCoding = icBuildingDao.selectByCoding(formDTO.getCoding(),null);
+ if(null != isHaveCoding){
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "该楼栋编码已存在,请勿重复!","该楼栋编码已存在,请勿重复!");
+ }
+ updateBuildingMaxNum(customerId,formDTO);
+ }
IcBuildingDTO icBuildingDTO = ConvertUtils.sourceToTarget(formDTO, IcBuildingDTO.class);
icBuildingDTO.setCustomerId(customerId);
IcBuildingEntity entity = ConvertUtils.sourceToTarget(icBuildingDTO, IcBuildingEntity.class);
@@ -114,12 +127,42 @@ public class BuildingServiceImpl implements BuildingService {
icBuildingUnit.setBuildingId(entity.getId());
icBuildingUnit.setUnitName((i + 1) + "单元");
icBuildingUnit.setUnitNum(String.valueOf(i + 1));
+ Result codeResult = icOrganizationCodeInfoService.getUnitCoding(customerId,entity.getId(),true);
+ if(!codeResult.success() || null == codeResult.getData()){
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "生成单元编码异常,请联系管理员","生成单元编码异常,请联系管理员");
+ }
+ icBuildingUnit.setCoding(codeResult.getData().getCoding());
+ icBuildingUnit.setSysCoding(codeResult.getData().getSysCoding());
unitList.add(icBuildingUnit);
}
icBuildingUnitService.insertBatch(unitList, NumConstant.ONE_HUNDRED);
}
+ /**
+ * @describe: 如果编码未改动提交,则最大数+1
+ * @author wangtong
+ * @date 2022/7/5 10:43
+ * @params [formDTO]
+ * @return void
+ */
+ private void updateBuildingMaxNum(String customerId,IcBulidingAddFormDTO formDTO){
+ //如果是自增的,则最大数+1
+ IcOrganizationCodeInfoEntity communEntity = icOrganizationCodeInfoDao.selectByIdAndType(customerId, formDTO.getNeighborHoodId(), OrganizationTypeEnums.NEI.getCode());
+ Integer buildMaxNum = org.apache.commons.lang3.StringUtils.isBlank(communEntity.getMaxNum())?1:Integer.valueOf(communEntity.getMaxNum()) + 1;
+ Integer submitMaxNum = null;
+ try {
+ submitMaxNum = Integer.valueOf(formDTO.getCoding().substring(formDTO.getCoding().length()-3));
+ }catch (Exception e){
+ e.printStackTrace();
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "编码转换失败", "编码转换失败");
+ }
+ if(buildMaxNum.intValue() == submitMaxNum.intValue()){
+ communEntity.setMaxNum(icOrganizationCodeInfoServiceImpl.getNewMaxIndex(3, buildMaxNum));
+ icOrganizationCodeInfoDao.updateMaxNumByIdAndType(communEntity);
+ }
+ }
+
@Override
public List treeList(String customerId, String staffId) {
CustomerStaffInfoCacheResult agency = CustomerStaffRedis.getStaffInfo(customerId, staffId);
@@ -440,6 +483,15 @@ public class BuildingServiceImpl implements BuildingService {
throw new RenException(EpmetErrorCode.ORG_EDIT_FAILED.getCode(), "楼栋单元下存在房屋,无法更新");
}
}
+ //楼栋编码不可重复
+ formDTO.setSysCoding(null);
+ if(org.apache.commons.lang3.StringUtils.isNotBlank(formDTO.getCoding())){
+ IcBuildingEntity isHaveCoding = icBuildingDao.selectByCoding(formDTO.getCoding(),formDTO.getBuildingId());
+ if(null != isHaveCoding){
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "该楼栋编码已存在,请勿重复!","该楼栋编码已存在,请勿重复!");
+ }
+ updateBuildingMaxNum(customerId,formDTO);
+ }
IcBuildingDTO icBuildingDTO = ConvertUtils.sourceToTarget(formDTO, IcBuildingDTO.class);
icBuildingDTO.setId(formDTO.getBuildingId());
icBuildingDTO.setCustomerId(customerId);
@@ -481,6 +533,12 @@ public class BuildingServiceImpl implements BuildingService {
icBuildingUnit.setCustomerId(customerId);
icBuildingUnit.setUnitName(unitNum + "单元");
icBuildingUnit.setUnitNum(unitNum);
+ Result codeResult = icOrganizationCodeInfoService.getUnitCoding(customerId,icBuilding.getId(),true);
+ if(!codeResult.success() || null == codeResult.getData()){
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "生成单元编码异常,请联系管理员","生成单元编码异常,请联系管理员");
+ }
+ icBuildingUnit.setCoding(codeResult.getData().getCoding());
+ icBuildingUnit.setSysCoding(codeResult.getData().getSysCoding());
unitList.add(icBuildingUnit);
}
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
index adaf547abf..d7f4e95ac1 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
@@ -710,6 +710,9 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl getCommunityInfo(OrgInfoPointFormDTO formDTO) {
+ CommunityInfoResultDTO communityInfoResultDTO = baseDao.getCommunityInfo(formDTO);
+
+ return new Result().ok(communityInfoResultDTO);
+ }
+
+ @Override
+ public Result getCommunityInfoByUserId(String userId) {
+ CommunityInfoResultDTO communityInfoResultDTO = baseDao.getCommunityInfoByUserId(userId);
+
+ return new Result().ok(communityInfoResultDTO);
+ }
+
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java
new file mode 100644
index 0000000000..33f3e3ab33
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java
@@ -0,0 +1,404 @@
+package com.epmet.service.impl;
+
+import com.epmet.commons.tools.constant.NumConstant;
+import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
+import com.epmet.commons.tools.exception.EpmetErrorCode;
+import com.epmet.commons.tools.exception.EpmetException;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dao.CustomerAgencyDao;
+import com.epmet.dao.IcNeighborHoodDao;
+import com.epmet.dto.form.HouseInformationFormDTO;
+import com.epmet.dto.form.IcUserCountFormDTO;
+import com.epmet.dto.result.*;
+import com.epmet.entity.CustomerAgencyEntity;
+import com.epmet.enums.BuildingTypeEnums;
+import com.epmet.enums.HouseRentFlagEnums;
+import com.epmet.feign.EpmetUserOpenFeignClient;
+import com.epmet.service.HouseInformationService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 15:14
+ */
+@Slf4j
+@Service
+public class HouseInformationServiceImpl implements HouseInformationService {
+
+ @Resource
+ private IcNeighborHoodDao icNeighborHoodDao;
+ @Resource
+ private CustomerAgencyDao customerAgencyDao;
+ @Resource
+ private EpmetUserOpenFeignClient userOpenFeignClient;
+
+ /**
+ * 【双实录入】社区录入数据统计
+ *
+ * @param formDTO
+ * @Param formDTO
+ * @Return {@link CommunityCountResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 15:31
+ */
+ @Override
+ public CommunityCountResultDTO getCommunityCount(HouseInformationFormDTO formDTO) {
+ if (StringUtils.isEmpty(formDTO.getCommunityId())) {
+ //获取工作人员所属组织
+ CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
+ if (null == staffInfo) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取用户信息失败", "获取用户信息失败");
+ }
+ formDTO.setCommunityId(staffInfo.getAgencyId());
+ }
+ String orgName;
+ CustomerAgencyEntity agency = customerAgencyDao.selectById(formDTO.getCommunityId());
+ if (null == agency) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "社区不存在", "社区不存在");
+ }
+ CustomerAgencyEntity parentAgency = customerAgencyDao.selectById(agency.getPid());
+ if (null == parentAgency) {
+ orgName = agency.getOrganizationName();
+ } else {
+ orgName = parentAgency.getOrganizationName() + agency.getOrganizationName();
+ }
+ //获取工作人员信息
+ CommunityCountResultDTO result = icNeighborHoodDao.getCommunityCount(formDTO);
+ result.setId(agency.getId());
+ result.setName(orgName);
+ //获取录入人口数
+ IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO();
+ countFormDTO.setOrgType(NumConstant.ZERO_STR);
+ countFormDTO.setOrgId(formDTO.getCommunityId());
+ countFormDTO.setType(NumConstant.ZERO_STR);
+ Map map = getMapResult(countFormDTO);
+ if (map.containsKey(formDTO.getCommunityId())) {
+ result.setPersonCount(map.get(formDTO.getCommunityId()));
+ }
+ return result;
+ }
+
+ /**
+ * 【双实录入】社区-网格列表
+ *
+ * @param formDTO
+ * @Param formDTO
+ * @Return {@link PageData}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 15:41
+ */
+ @Override
+ public PageData getGridList(HouseInformationFormDTO formDTO) {
+ PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
+ List list = icNeighborHoodDao.getGridList(formDTO);
+ PageInfo pageInfo = new PageInfo<>(list);
+ if (CollectionUtils.isNotEmpty(list)) {
+ //获取录入人口数
+ IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO();
+ countFormDTO.setOrgType(NumConstant.ZERO_STR);
+ countFormDTO.setOrgId(formDTO.getCommunityId());
+ countFormDTO.setType(NumConstant.ONE_STR);
+ Map map = getMapResult(countFormDTO);
+
+ list.forEach(item -> {
+ if (map.containsKey(item.getId())) {
+ item.setPersonCount(map.get(item.getId()));
+ }
+ item.setDifferPersonCount(item.getPersonRealCount() - item.getPersonCount());
+ });
+ }
+ return new PageData<>(list, pageInfo.getTotal());
+ }
+
+ /**
+ * 【双实录入】网格录入数据统计
+ *
+ * @param formDTO
+ * @Param formDTO
+ * @Return {@link GridStatisticsResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 15:41
+ */
+ @Override
+ public GridStatisticsResultDTO getGridCount(HouseInformationFormDTO formDTO) {
+ GridStatisticsResultDTO result = icNeighborHoodDao.getGridCount(formDTO);
+ //获取录入人口数
+ IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO();
+ countFormDTO.setOrgType(NumConstant.ONE_STR);
+ countFormDTO.setOrgId(formDTO.getGridId());
+ countFormDTO.setType(NumConstant.ZERO_STR);
+ Map map = getMapResult(countFormDTO);
+ if (map.containsKey(formDTO.getGridId())) {
+ result.setPersonCount(map.get(formDTO.getGridId()));
+ }
+ return result;
+ }
+
+ /**
+ * 【双实录入】网格-小区列表
+ *
+ * @param formDTO
+ * @Param formDTO
+ * @Return {@link PageData}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 16:24
+ */
+ @Override
+ public PageData getNeighborHoodList(HouseInformationFormDTO formDTO) {
+ PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
+ List list = icNeighborHoodDao.getNeighborHoodList(formDTO);
+ PageInfo pageInfo = new PageInfo<>(list);
+ if (CollectionUtils.isNotEmpty(list)) {
+ //获取录入人口数
+ IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO();
+ countFormDTO.setOrgType(NumConstant.ONE_STR);
+ countFormDTO.setOrgId(formDTO.getGridId());
+ countFormDTO.setType(NumConstant.ONE_STR);
+ Map map = getMapResult(countFormDTO);
+ list.forEach(item -> {
+ if (map.containsKey(item.getId())) {
+ item.setPersonCount(map.get(item.getId()));
+ }
+ item.setDifferPersonCount(item.getPersonRealCount() - item.getPersonCount());
+ });
+ }
+ return new PageData<>(list, pageInfo.getTotal());
+ }
+
+ /**
+ * 【双实录入】小区录入数据统计
+ *
+ * @param formDTO
+ * @Param formDTO
+ * @Return {@link NeighborHoodCountResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 16:43
+ */
+ @Override
+ public NeighborHoodCountResultDTO getNeighborHoodCount(HouseInformationFormDTO formDTO) {
+ NeighborHoodCountResultDTO result = icNeighborHoodDao.getNeighborHoodCount(formDTO);
+ //获取录入人口数
+ IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO();
+ countFormDTO.setOrgType(NumConstant.TWO_STR);
+ countFormDTO.setOrgId(formDTO.getNeighborHoodId());
+ countFormDTO.setType(NumConstant.ZERO_STR);
+ Map map = getMapResult(countFormDTO);
+ if (map.containsKey(formDTO.getNeighborHoodId())) {
+ result.setPersonCount(map.get(formDTO.getNeighborHoodId()));
+ }
+ return result;
+ }
+
+ /**
+ * 【双实录入】小区-楼栋列表
+ *
+ * @param formDTO
+ * @Param formDTO
+ * @Return {@link PageData}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 16:47
+ */
+ @Override
+ public PageData getBuildingList(HouseInformationFormDTO formDTO) {
+ List list;
+ long total = 0;
+
+ //获取录入人口数
+ IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO();
+ countFormDTO.setOrgType(NumConstant.TWO_STR);
+ countFormDTO.setOrgId(formDTO.getNeighborHoodId());
+ countFormDTO.setType(NumConstant.ONE_STR);
+ Map map = getMapResult(countFormDTO);
+
+ if (!NumConstant.FIVE_STR.equals(formDTO.getSort())) {
+ PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
+ list = icNeighborHoodDao.getBuildingList(formDTO);
+ PageInfo pageInfo = new PageInfo<>(list);
+ total = pageInfo.getTotal();
+
+ if (CollectionUtils.isNotEmpty(list)) {
+ list.forEach(item -> {
+ if (map.containsKey(item.getId())) {
+ item.setPersonCount(map.get(item.getId()));
+ }
+ item.setDifferPersonCount(item.getPersonRealCount() - item.getPersonCount());
+ });
+ }
+ } else {
+ list = icNeighborHoodDao.getBuildingList(formDTO);
+ if (CollectionUtils.isNotEmpty(list)) {
+ total = list.size();
+ list.forEach(item -> {
+ if (map.containsKey(item.getId())) {
+ item.setPersonCount(map.get(item.getId()));
+ }
+ item.setDifferPersonCount(item.getPersonRealCount() - item.getPersonCount());
+ });
+
+ //排序
+ list = list.stream().sorted(Comparator.comparing(BuildingListResultDTO::getDifferPersonCount).reversed()).collect(Collectors.toList());
+ //分页
+ list = list.stream().skip((long) (formDTO.getPageNo() - 1) * formDTO.getPageSize()).limit(formDTO.getPageSize()).collect(Collectors.toList());
+ }
+ }
+
+
+ return new PageData<>(list, total);
+ }
+
+ /**
+ * 【双实录入】楼栋录入数据统计
+ *
+ * @param formDTO
+ * @Param formDTO
+ * @Return {@link BuildingCountResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 16:50
+ */
+ @Override
+ public BuildingCountResultDTO getBuildingCount(HouseInformationFormDTO formDTO) {
+ BuildingCountResultDTO result = icNeighborHoodDao.getBuildingCount(formDTO);
+ //获取录入人口数
+ IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO();
+ countFormDTO.setOrgType(NumConstant.THREE_STR);
+ countFormDTO.setOrgId(formDTO.getBuildingId());
+ countFormDTO.setType(NumConstant.ZERO_STR);
+ Map map = getMapResult(countFormDTO);
+ if (map.containsKey(formDTO.getBuildingId())) {
+ result.setPersonCount(map.get(formDTO.getBuildingId()));
+ }
+ result.setBuildingType(BuildingTypeEnums.getTypeValue(result.getBuildingType()));
+ return result;
+ }
+
+ /**
+ * 【双实录入】楼栋-单元列表
+ *
+ * @param formDTO
+ * @Param formDTO
+ * @Return {@link PageData}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 16:54
+ */
+ @Override
+ public PageData getUnitList(HouseInformationFormDTO formDTO) {
+ PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
+ List list = icNeighborHoodDao.getUnitList(formDTO);
+ PageInfo pageInfo = new PageInfo<>(list);
+ if (CollectionUtils.isNotEmpty(list)) {
+ //获取录入人口数
+ IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO();
+ countFormDTO.setOrgType(NumConstant.THREE_STR);
+ countFormDTO.setOrgId(formDTO.getBuildingId());
+ countFormDTO.setType(NumConstant.ONE_STR);
+ Map map = getMapResult(countFormDTO);
+ list.forEach(item -> {
+ if (map.containsKey(item.getId())) {
+ item.setPersonCount(map.get(item.getId()));
+ }
+ });
+ }
+ return new PageData<>(list, pageInfo.getTotal());
+ }
+
+ /**
+ * 【双实录入】单元录入数据统计
+ *
+ * @param formDTO
+ * @Param formDTO
+ * @Return {@link UnitCountResultDTO}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 16:57
+ */
+ @Override
+ public UnitCountResultDTO getUnitCount(HouseInformationFormDTO formDTO) {
+ UnitCountResultDTO result = icNeighborHoodDao.getUnitCount(formDTO);
+ //获取录入人口数
+ IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO();
+ countFormDTO.setOrgType(NumConstant.FOUR_STR);
+ countFormDTO.setOrgId(formDTO.getUnitId());
+ countFormDTO.setType(NumConstant.ZERO_STR);
+ Map map = getMapResult(countFormDTO);
+ if (map.containsKey(formDTO.getUnitId())) {
+ result.setPersonCount(map.get(formDTO.getUnitId()));
+ }
+ return result;
+ }
+
+ /**
+ * 【双实录入】单元-房屋列表
+ *
+ * @param formDTO
+ * @Param formDTO
+ * @Return {@link PageData}
+ * @Author zhaoqifeng
+ * @Date 2022/6/28 17:01
+ */
+ @Override
+ public PageData getHouseList(HouseInformationFormDTO formDTO) {
+ List list = null;
+ long total = 0;
+ //获取录入人口数
+ IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO();
+ countFormDTO.setOrgType(NumConstant.FOUR_STR);
+ countFormDTO.setOrgId(formDTO.getUnitId());
+ countFormDTO.setType(NumConstant.ONE_STR);
+ Map map = getMapResult(countFormDTO);
+
+ if (!NumConstant.TWO_STR.equals(formDTO.getSort())) {
+ PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
+ list = icNeighborHoodDao.getHouseList(formDTO);
+ PageInfo pageInfo = new PageInfo<>(list);
+ total = pageInfo.getTotal();
+ if (CollectionUtils.isNotEmpty(list)) {
+ list.forEach(item -> {
+ item.setHouseType(HouseRentFlagEnums.getTypeValue(item.getHouseType()));
+ if (map.containsKey(item.getId())) {
+ item.setPersonCount(map.get(item.getId()));
+ }
+ });
+ }
+ } else {
+ list = icNeighborHoodDao.getHouseList(formDTO);
+ if (CollectionUtils.isNotEmpty(list)) {
+ total = list.size();
+ list.forEach(item -> {
+ item.setHouseType(HouseRentFlagEnums.getTypeValue(item.getHouseType()));
+ if (map.containsKey(item.getId())) {
+ item.setPersonCount(map.get(item.getId()));
+ }
+ });
+ //排序
+ list = list.stream().sorted(Comparator.comparing(HomeListResultDTO::getPersonCount).reversed()).collect(Collectors.toList());
+ //分页
+ list = list.stream().skip((long) (formDTO.getPageNo() - 1) * formDTO.getPageSize()).limit(formDTO.getPageSize()).collect(Collectors.toList());
+ }
+ }
+
+ return new PageData<>(list, total);
+ }
+
+ private Map getMapResult(IcUserCountFormDTO countFormDTO) {
+ Result> result = userOpenFeignClient.getIcUserCount(countFormDTO);
+ if (!result.success()) {
+ log.warn("查询录入人数失败");
+ return Collections.emptyMap();
+ }
+ return result.getData();
+ }
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
index ba9cb5e146..c89d9eb8c4 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
@@ -1,9 +1,10 @@
package com.epmet.service.impl;
-import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;
+import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.read.metadata.ReadSheet;
+import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.tools.constant.NumConstant;
@@ -24,10 +25,7 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.redis.common.bean.HouseInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
-import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.utils.FileUtils;
-import com.epmet.commons.tools.utils.HouseQRcodeUtils;
-import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.utils.*;
import com.epmet.constant.CustomerGridConstant;
import com.epmet.constant.NeighborhoodConstant;
import com.epmet.constants.ImportTaskConstants;
@@ -36,10 +34,7 @@ import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.*;
-import com.epmet.enums.HouseChangeEnums;
-import com.epmet.enums.HousePurposeEnums;
-import com.epmet.enums.HouseRentFlagEnums;
-import com.epmet.enums.HouseTypeEnums;
+import com.epmet.enums.*;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
@@ -48,7 +43,6 @@ import com.epmet.model.HouseInfoModel;
import com.epmet.model.ImportHouseInfoListener;
import com.epmet.redis.IcHouseRedis;
import com.epmet.service.*;
-import com.epmet.util.ExcelPoiUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.cache.Cache;
@@ -129,6 +123,12 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
private OssFeignClient ossFeignClient;
@Autowired
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
+ @Autowired
+ private IcOrganizationCodeInfoDao icOrganizationCodeInfoDao;
+ @Autowired
+ private IcOrganizationCodeInfoServiceImpl icOrganizationCodeInfoServiceImpl;
+ @Autowired
+ private IcBuildingUnitDao icBuildingUnitDao;
@Override
@@ -139,7 +139,14 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
if (null != count && count > 0) {
throw new RenException(EpmetErrorCode.DOOR_NAME_EXITED.getCode(), EpmetErrorCode.DOOR_NAME_EXITED.getMsg());
}
-
+ //房屋编码不可重复
+ if(org.apache.commons.lang3.StringUtils.isNotBlank(formDTO.getCoding())){
+ IcHouseEntity isHaveCoding = icHouseDao.selectByCoding(formDTO.getCoding());
+ if(null != isHaveCoding){
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "该房屋编码已存在,请勿重复!","该房屋编码已存在,请勿重复!");
+ }
+ updateHouseMaxNum(customerId,formDTO);
+ }
IcHouseEntity icHouseDTO = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class);
icHouseDTO.setCustomerId(customerId);
icHouseDTO.setHouseName(getHouseName(formDTO));
@@ -171,6 +178,30 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
icHouseDao.updateById(entity);
}
+ /**
+ * @describe: 如果编码未改动提交,则最大数+1
+ * @author wangtong
+ * @date 2022/7/5 10:53
+ * @params [customerId, formDTO]
+ * @return void
+ */
+ private void updateHouseMaxNum(String customerId, IcHouseAddFormDTO formDTO){
+ //如果是自增的,则最大数+1
+ IcOrganizationCodeInfoEntity communEntity = icOrganizationCodeInfoDao.selectByIdAndType(customerId, formDTO.getBuildingUnitId(), OrganizationTypeEnums.UNIT.getCode());
+ Integer houseMaxNum = org.apache.commons.lang3.StringUtils.isBlank(communEntity.getMaxNum())?1:Integer.valueOf(communEntity.getMaxNum()) + 1;
+ Integer submitMaxNum = null;
+ try {
+ submitMaxNum = Integer.valueOf(formDTO.getCoding().substring(formDTO.getCoding().length()-4));
+ }catch (Exception e){
+ e.printStackTrace();
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "编码转换失败", "编码转换失败");
+ }
+ if(houseMaxNum.intValue() == submitMaxNum.intValue()){
+ communEntity.setMaxNum(icOrganizationCodeInfoServiceImpl.getNewMaxIndex(4, houseMaxNum));
+ icOrganizationCodeInfoDao.updateMaxNumByIdAndType(communEntity);
+ }
+ }
+
private String getHouseName(IcHouseAddFormDTO formDTO) {
//设置房间名 楼栋-单元号-门牌号
IcBuildingDTO icBuilding = icBuildingService.get(formDTO.getBuildingId());
@@ -377,22 +408,41 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
public void exportBuildinginfo(IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception {
//如果类型是house 查房屋
//导出房屋
- PageData icHouseExcels = new PageData<>(new ArrayList<>(), NumConstant.ZERO);
- List list = new ArrayList<>();
+ PageData icHouseExcels = null;
Integer pageNo = NumConstant.ONE;
- do {
- formDTO.setPageNo(pageNo);
- icHouseExcels = getHouseList(formDTO);
- if (CollectionUtils.isEmpty(icHouseExcels.getList())) {
- break;
+ formDTO.setPageSize(NumConstant.TEN_THOUSAND);
+ ExcelWriter excelWriter = null;
+ long start = System.currentTimeMillis();
+ try {
+ String templatePath = "excel/house_export_for_easyexcel.xlsx";
+ InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(templatePath);
+ excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel("房屋信息.xlsx", response))
+ .withTemplate(inputStream).build();
+
+ WriteSheet writeSheet = EasyExcel.writerSheet().build();
+ do {
+ formDTO.setPageNo(pageNo);
+ icHouseExcels = getHouseList(formDTO);
+ if (CollectionUtils.isEmpty(icHouseExcels.getList())) {
+ break;
+ }
+ excelWriter.fill(icHouseExcels.getList(), writeSheet);
+ pageNo++;
+ } while (icHouseExcels.getList().size() == formDTO.getPageSize());
+ } catch (EpmetException e) {
+ response.reset();
+ response.setCharacterEncoding("UTF-8");
+ response.setHeader("content-type", "application/json; charset=UTF-8");
+ PrintWriter printWriter = response.getWriter();
+ Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg());
+ printWriter.write(JSON.toJSONString(result));
+ printWriter.close();
+ } finally {
+ if (excelWriter != null) {
+ excelWriter.finish();
}
- list.addAll(icHouseExcels.getList());
- pageNo++;
- } while (icHouseExcels.getList().size() == formDTO.getPageSize());
- TemplateExportParams templatePath = new TemplateExportParams("excel/house_export.xlsx");
- Map map = new HashMap<>();
- map.put("maplist", list);
- ExcelPoiUtils.exportExcel(templatePath, map, "房屋信息录入表", response);
+ log.info("exportBuildinginfo cost:{}ms",System.currentTimeMillis()-start);
+ }
}
@Override
@@ -521,6 +571,9 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
@Override
public HouseInfoDTO getHouseInfoDTO(String customerId, String houseId) {
HouseInfoDTO houseInfo = icHouseRedis.getHouseInfo(houseId, customerId);
+ if (null == houseInfo) {
+ return houseInfo;
+ }
if (null != houseInfo && StringUtils.isNotBlank(houseInfo.getAgencyId())) {
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(houseInfo.getAgencyId());
houseInfo.setAgencyPathName(StringUtils.isNotBlank(agencyInfoCache.getAllParentName()) ? agencyInfoCache.getAllParentName().concat(StrConstant.HYPHEN).concat(agencyInfoCache.getOrganizationName()) : agencyInfoCache.getOrganizationName());
@@ -1064,6 +1117,10 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
public Result getHomeInfoByHouseCode(HouseInfoFormDTO dto) {
HouseInfoResultDTO house = icHouseDao.selectHomeInfoByHouseCode(dto.getHouseCode());
+ if(null == house){
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"未获取到房屋信息,请核对房屋编码","未获取到房屋信息,请核对房屋编码");
+ }
+
HouseInfoCache cache = CustomerIcHouseRedis.getHouseInfo(house.getCustomerId(), house.getHouseId());
BeanUtils.copyProperties(cache,house);
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java
index 351fc95306..577e77c787 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java
@@ -25,9 +25,11 @@ import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcBuildingDao;
import com.epmet.dto.IcBuildingDTO;
import com.epmet.dto.ImportGeneralDTO;
+import com.epmet.dto.result.IcBulidingDetailDTO;
import com.epmet.entity.IcBuildingEntity;
import com.epmet.service.IcBuildingService;
import lombok.extern.slf4j.Slf4j;
@@ -121,7 +123,7 @@ public class IcBuildingServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcBuildingEntity::getNeighborHoodId, neighborHoodId);
- wrapper.last("ORDER BY CONVERT ( BUILDING_NAME USING gbk ) ASC");
+ wrapper.last("ORDER BY SORT ASC, BUILDING_NAME+0 ASC");
List list = baseDao.selectList(wrapper);
if(CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
@@ -166,4 +168,9 @@ public class IcBuildingServiceImpl extends BaseServiceImpl getBuildingDetail(String buildingId) {
+ return new Result().ok(baseDao.getBuildingDetail(buildingId));
+ }
+
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java
index 2e800bbda5..6b55f20cfd 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java
@@ -25,8 +25,11 @@ import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcBuildingUnitDao;
import com.epmet.dto.IcBuildingUnitDTO;
+import com.epmet.dto.result.HouseInfoResultDTO;
+import com.epmet.dto.result.IcBulidingDetailDTO;
import com.epmet.entity.IcBuildingUnitEntity;
import com.epmet.service.IcBuildingUnitService;
import lombok.extern.slf4j.Slf4j;
@@ -154,4 +157,9 @@ public class IcBuildingUnitServiceImpl extends BaseServiceImpl getUnitDetail(String unitId) {
+ return new Result().ok(baseDao.getUnitDetail(unitId));
+ }
+
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcCityManagementServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcCityManagementServiceImpl.java
index 0562ff6f1e..a8edb5e7cd 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcCityManagementServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcCityManagementServiceImpl.java
@@ -170,7 +170,10 @@ public class IcCityManagementServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(formDTO.getBuildingId()), IcHouseEntity::getBuildingId, formDTO.getBuildingId());
wrapper.eq(StringUtils.isNotBlank(formDTO.getUnitId()), IcHouseEntity::getBuildingUnitId, formDTO.getUnitId());
- wrapper.last("ORDER BY CONVERT ( HOUSE_NAME USING gbk ) ASC");
+ wrapper.last("ORDER BY SORT ASC, DOOR_NAME+0 ASC");
List list = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java
index c54ea3a436..14c9af3048 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java
@@ -791,4 +791,13 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl neighborhoodDetail(String neighborhoodId) {
+ IcNeighborHoodEntity result = baseDao.selectById(neighborhoodId);
+ if(null != result && null == result.getRemark()){
+ result.setRemark("");
+ }
+ return new Result().ok(result);
+ }
+
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java
new file mode 100644
index 0000000000..abc9fbf58c
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java
@@ -0,0 +1,387 @@
+package com.epmet.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.commons.tools.exception.EpmetErrorCode;
+import com.epmet.commons.tools.exception.EpmetException;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dao.*;
+import com.epmet.dto.IcOrganizationCodeInfoDTO;
+import com.epmet.dto.ImportGeneralDTO;
+import com.epmet.dto.result.HouseInfoResultDTO;
+import com.epmet.dto.result.OrganizationCodeResultDTO;
+import com.epmet.dto.result.OrganizationCommunityDTO;
+import com.epmet.entity.*;
+import com.epmet.enums.OrganizationTypeEnums;
+import com.epmet.redis.IcOrganizationCodeInfoRedis;
+import com.epmet.service.IcOrganizationCodeInfoService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 小区/楼栋/房屋编码辅助表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-06-27
+ */
+@Service
+public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl implements IcOrganizationCodeInfoService {
+
+ @Autowired
+ private IcOrganizationCodeInfoRedis icOrganizationCodeInfoRedis;
+
+ @Autowired
+ private CustomerGridDao customerGridDao;
+
+ @Autowired
+ private IcNeighborHoodDao icNeighborHoodDao;
+
+ @Autowired
+ private IcBuildingDao icBuildingDao;
+
+ @Autowired
+ private IcBuildingUnitDao icBuildingUnitDao;
+
+ @Autowired
+ private IcHouseDao icHouseDao;
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, IcOrganizationCodeInfoDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, IcOrganizationCodeInfoDTO.class);
+ }
+
+ private QueryWrapper getWrapper(Map params) {
+ String id = (String) params.get(FieldConstant.ID_HUMP);
+
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
+
+ return wrapper;
+ }
+
+ @Override
+ public IcOrganizationCodeInfoDTO get(String id) {
+ IcOrganizationCodeInfoEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, IcOrganizationCodeInfoDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(IcOrganizationCodeInfoDTO dto) {
+ IcOrganizationCodeInfoEntity entity = ConvertUtils.sourceToTarget(dto, IcOrganizationCodeInfoEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(IcOrganizationCodeInfoDTO dto) {
+ IcOrganizationCodeInfoEntity entity = ConvertUtils.sourceToTarget(dto, IcOrganizationCodeInfoEntity.class);
+ updateById(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void delete(String[] ids) {
+ // 逻辑删除(@TableLogic 注解)
+ baseDao.deleteBatchIds(Arrays.asList(ids));
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public Result getNeighborHoodCoding(String customerId, String gridId, Boolean updateFlag) {
+ if (StringUtils.isBlank(customerId) || StringUtils.isBlank(gridId)) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所有字段不可为空", "所有字段不可为空");
+ }
+ OrganizationCodeResultDTO result = new OrganizationCodeResultDTO();
+ //获取社区id、行政编码
+ OrganizationCommunityDTO communResult = customerGridDao.selectCommunityByGridId(gridId);
+ if (null == communResult || StringUtils.isBlank(communResult.getCommunityId())) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关社区信息", "未查到相关社区信息");
+ }
+ //查询该社区下是否存在数据
+ IcOrganizationCodeInfoEntity communEntity = baseDao.selectByIdAndType(customerId, communResult.getCommunityId(), OrganizationTypeEnums.COMM.getCode());
+ if (null == communEntity) {
+ Integer neighborMaxNum = 1;
+ String neighborCode = getCompleteAreaCode(communResult.getAreaCode()) + getNewMaxIndex(3, neighborMaxNum);
+ //开发测试需要检测,因为包含行政编码为空的社区,会出现小区编码重复的情况
+ IcNeighborHoodEntity isHaveCoding = icNeighborHoodDao.selectByCoding(neighborCode, null);
+ while (null != isHaveCoding) {
+ neighborMaxNum++;
+ neighborCode = getCompleteAreaCode(communResult.getAreaCode()) + getNewMaxIndex(3, neighborMaxNum);
+ isHaveCoding = icNeighborHoodDao.selectByCoding(neighborCode, null);
+ }
+
+ result.setCoding(neighborCode);
+ result.setSysCoding(neighborCode);
+ //新增该社区辅助数据
+ IcOrganizationCodeInfoEntity newEntity = new IcOrganizationCodeInfoEntity();
+ newEntity.setCustomerId(customerId);
+ newEntity.setSysId(communResult.getCommunityId());
+ if (updateFlag) {
+ newEntity.setMaxNum(getNewMaxIndex(3, neighborMaxNum));
+ }
+ newEntity.setSysType(OrganizationTypeEnums.COMM.getCode());
+ baseDao.insert(newEntity);
+ } else {
+ Integer neighborMaxNum = StringUtils.isBlank(communEntity.getMaxNum()) ? 1 : Integer.valueOf(communEntity.getMaxNum()) + 1;
+ //验证可编辑的编码是否有重复
+ String neiCode = getCompleteAreaCode(communResult.getAreaCode()) + getNewMaxIndex(3, neighborMaxNum);
+ IcNeighborHoodEntity isHaveCoding = icNeighborHoodDao.selectByCoding(neiCode, null);
+ while (null != isHaveCoding) {
+ //先更新已有的最大值
+ communEntity.setMaxNum(getNewMaxIndex(3, neighborMaxNum));
+ baseDao.updateMaxNumByIdAndType(communEntity);
+ neighborMaxNum++;
+ neiCode = getCompleteAreaCode(communResult.getAreaCode()) + getNewMaxIndex(3, neighborMaxNum);
+ isHaveCoding = icNeighborHoodDao.selectByCoding(neiCode, null);
+ }
+ //更新该社区下最大的小区编号
+ if (updateFlag) {
+ communEntity.setMaxNum(getNewMaxIndex(3, neighborMaxNum));
+ baseDao.updateMaxNumByIdAndType(communEntity);
+ }
+ String neighborCode = getCompleteAreaCode(communResult.getAreaCode()) + getNewMaxIndex(3, neighborMaxNum);
+ result.setCoding(neiCode);
+ result.setSysCoding(neighborCode);
+ }
+ return new Result().ok(result);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public Result getBuildingCoding(String customerId, String neighborhoodId, Boolean updateFlag) {
+ if (StringUtils.isBlank(customerId) || StringUtils.isBlank(neighborhoodId)) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所有字段不可为空", "所有字段不可为空");
+ }
+ //组装返回结果
+ OrganizationCodeResultDTO result = new OrganizationCodeResultDTO();
+
+ IcNeighborHoodEntity neighborHood = icNeighborHoodDao.selectById(neighborhoodId);
+ if (null == neighborHood) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关小区信息", "未查到相关小区信息");
+ }
+ //如果小区编码为空,先生成小区编码并更新
+ if (StringUtils.isBlank(neighborHood.getSysCoding())) {
+ OrganizationCodeResultDTO org = getNeighborHoodCoding(customerId, neighborHood.getGridId(), true).getData();
+ neighborHood.setCoding(org.getCoding());
+ neighborHood.setSysCoding(org.getSysCoding());
+ icNeighborHoodDao.updateById(neighborHood);
+ }
+
+ //获取社区id、小区编码
+ OrganizationCommunityDTO communResult = icNeighborHoodDao.selectCommunityByNeiId(neighborhoodId);
+ //查询该小区下是否存在楼栋数据
+ IcOrganizationCodeInfoEntity buildingEntity = baseDao.selectByIdAndType(customerId, neighborhoodId, OrganizationTypeEnums.NEI.getCode());
+ if (null == buildingEntity) {
+ Integer maxNum = 1;
+ result.setCoding(communResult.getCoding() + getNewMaxIndex(3, maxNum));
+ result.setSysCoding(communResult.getSysCoding() + getNewMaxIndex(3, maxNum));
+ //新增该楼栋辅助数据
+ IcOrganizationCodeInfoEntity newEntity = new IcOrganizationCodeInfoEntity();
+ newEntity.setCustomerId(customerId);
+ newEntity.setSysId(neighborhoodId);
+ if (updateFlag) {
+ newEntity.setMaxNum(getNewMaxIndex(3, maxNum));
+ }
+ newEntity.setSysType(OrganizationTypeEnums.NEI.getCode());
+ baseDao.insert(newEntity);
+ } else {
+ Integer buildingMaxNum = StringUtils.isBlank(buildingEntity.getMaxNum()) ? 1 : Integer.valueOf(buildingEntity.getMaxNum()) + 1;
+ //验证可编辑的编码是否有重复
+ String buildingCode = communResult.getCoding() + getNewMaxIndex(3, buildingMaxNum);
+ IcBuildingEntity isHaveCoding = icBuildingDao.selectByCoding(buildingCode, null);
+ while (null != isHaveCoding) {
+ //先更新已有的最大值
+ buildingEntity.setMaxNum(getNewMaxIndex(3, buildingMaxNum));
+ baseDao.updateMaxNumByIdAndType(buildingEntity);
+ buildingMaxNum++;
+ buildingCode = communResult.getCoding() + getNewMaxIndex(3, buildingMaxNum);
+ isHaveCoding = icBuildingDao.selectByCoding(buildingCode, null);
+ }
+ result.setCoding(buildingCode);
+ result.setSysCoding(communResult.getSysCoding() + getNewMaxIndex(3, buildingMaxNum));
+
+ //更新该社区下最大的楼栋编号
+ if (updateFlag) {
+ buildingEntity.setMaxNum(getNewMaxIndex(3, buildingMaxNum));
+ baseDao.updateMaxNumByIdAndType(buildingEntity);
+ }
+ }
+ return new Result().ok(result);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public Result getUnitCoding(String customerId, String buildingId, Boolean updateFlag) {
+ if (StringUtils.isBlank(customerId) || StringUtils.isBlank(buildingId)) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所有字段不可为空", "所有字段不可为空");
+ }
+ //组装返回结果
+ OrganizationCodeResultDTO result = new OrganizationCodeResultDTO();
+
+ IcBuildingEntity buildingEntity = icBuildingDao.selectById(buildingId);
+ if (null == buildingEntity) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关楼栋信息", "未查到相关楼栋信息");
+ }
+ //如果楼栋编码为空,先生成楼栋编码并更新
+ if (StringUtils.isBlank(buildingEntity.getSysCoding())) {
+ ImportGeneralDTO neiInfo = icBuildingDao.selectBuildingById(buildingId);
+ OrganizationCodeResultDTO org = getBuildingCoding(customerId, neiInfo.getNeighborHoodId(), true).getData();
+ buildingEntity.setCoding(org.getCoding());
+ buildingEntity.setSysCoding(org.getSysCoding());
+ icBuildingDao.updateById(buildingEntity);
+ }
+
+ //获取社区id、楼栋编码
+ OrganizationCommunityDTO communResult = icBuildingDao.selectCommunityByBuildingId(buildingId);
+ //查询该楼栋下是否存在单元数据
+ IcOrganizationCodeInfoEntity unitEntity = baseDao.selectByIdAndType(customerId, buildingId, OrganizationTypeEnums.BUI.getCode());
+ if (null == unitEntity) {
+ Integer maxNum = 1;
+ result.setCoding(communResult.getCoding() + getNewMaxIndex(2, maxNum));
+ result.setSysCoding(communResult.getSysCoding() + getNewMaxIndex(2, maxNum));
+ //新增该单元辅助数据
+ IcOrganizationCodeInfoEntity newEntity = new IcOrganizationCodeInfoEntity();
+ newEntity.setCustomerId(customerId);
+ newEntity.setSysId(buildingId);
+ if (updateFlag) {
+ newEntity.setMaxNum(getNewMaxIndex(2, maxNum));
+ }
+ newEntity.setSysType(OrganizationTypeEnums.BUI.getCode());
+ baseDao.insert(newEntity);
+ } else {
+ Integer unitMaxNum = StringUtils.isBlank(unitEntity.getMaxNum()) ? 1 : Integer.valueOf(unitEntity.getMaxNum()) + 1;
+ //验证可编辑的编码是否有重复
+ String unitCode = communResult.getCoding() + getNewMaxIndex(2, unitMaxNum);
+ IcBuildingUnitEntity isHaveCoding = icBuildingUnitDao.selectByCoding(unitCode);
+ while (null != isHaveCoding) {
+ unitMaxNum++;
+ unitCode = communResult.getCoding() + getNewMaxIndex(2, unitMaxNum);
+ isHaveCoding = icBuildingUnitDao.selectByCoding(unitCode);
+ }
+ result.setCoding(unitCode);
+ result.setSysCoding(communResult.getSysCoding() + getNewMaxIndex(2, unitMaxNum));
+
+ //更新该社区下最大的单元编号
+ if (updateFlag) {
+ unitEntity.setMaxNum(getNewMaxIndex(2, unitMaxNum));
+ baseDao.updateMaxNumByIdAndType(unitEntity);
+ }
+ }
+ return new Result().ok(result);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public Result getHouseCoding(String customerId, String unitId, Boolean updateFlag) {
+ if (StringUtils.isBlank(customerId) || StringUtils.isBlank(unitId)) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所有字段不可为空", "所有字段不可为空");
+ }
+ //组装返回结果
+ OrganizationCodeResultDTO result = new OrganizationCodeResultDTO();
+
+ IcBuildingUnitEntity unitEntity = icBuildingUnitDao.selectById(unitId);
+ if (null == unitEntity) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关单元信息", "未查到相关单元信息");
+ }
+ //如果单元编码为空,先生成单元编码并更新
+ if (StringUtils.isBlank(unitEntity.getSysCoding())) {
+ HouseInfoResultDTO buildingInfo = icBuildingUnitDao.getUnitDetail(unitId);
+ OrganizationCodeResultDTO org = getUnitCoding(customerId, buildingInfo.getBuildingId(), true).getData();
+ unitEntity.setCoding(org.getCoding());
+ unitEntity.setSysCoding(org.getSysCoding());
+ icBuildingUnitDao.updateById(unitEntity);
+ }
+
+ //获取社区id、单元编码
+ OrganizationCommunityDTO communResult = icBuildingUnitDao.selectCommunityByUnitId(unitId);
+ //查询该单元下是否存在房屋数据
+ IcOrganizationCodeInfoEntity houseEntity = baseDao.selectByIdAndType(customerId, unitId, OrganizationTypeEnums.UNIT.getCode());
+ if (null == houseEntity) {
+ Integer maxNum = 1;
+ result.setCoding(communResult.getCoding() + getNewMaxIndex(4, maxNum));
+ //新增该单元辅助数据
+ IcOrganizationCodeInfoEntity newEntity = new IcOrganizationCodeInfoEntity();
+ newEntity.setCustomerId(customerId);
+ newEntity.setSysId(unitId);
+ if (updateFlag) {
+ newEntity.setMaxNum(getNewMaxIndex(4, maxNum));
+ }
+ newEntity.setSysType(OrganizationTypeEnums.UNIT.getCode());
+ baseDao.insert(newEntity);
+ } else {
+ Integer houseMaxNum = StringUtils.isBlank(houseEntity.getMaxNum()) ? 1 : Integer.valueOf(houseEntity.getMaxNum()) + 1;
+ //验证可编辑的编码是否有重复
+ String houseCode = communResult.getCoding() + getNewMaxIndex(4, houseMaxNum);
+ IcHouseEntity isHaveCoding = icHouseDao.selectByCoding(houseCode);
+ while (null != isHaveCoding) {
+ //先更新已有的最大值
+ houseEntity.setMaxNum(getNewMaxIndex(4, houseMaxNum));
+ baseDao.updateMaxNumByIdAndType(houseEntity);
+ houseMaxNum++;
+ houseCode = communResult.getCoding() + getNewMaxIndex(4, houseMaxNum);
+ isHaveCoding = icHouseDao.selectByCoding(houseCode);
+ }
+ result.setCoding(houseCode);
+
+ //更新该社区下最大的房屋编号
+// houseEntity.setHouseMaxNum(getNewMaxIndex(4, houseMaxNum));
+// baseDao.updateMaxNumByIdAndType(houseEntity);
+ }
+ return new Result().ok(result);
+ }
+
+ /**
+ * @return java.lang.String
+ * @describe: 把数字转换成maxLength位的字符串,不够的前面补0
+ * @author wangtong
+ * @date 2022/6/29 10:30
+ * @params [maxLength, maxIndex]
+ */
+ public String getNewMaxIndex(Integer maxLength, Integer maxIndex) {
+ String result = maxIndex.toString();
+ while (result.length() < maxLength) {
+ result = "0" + result;
+ }
+ return result;
+ }
+
+ /**
+ * @return java.lang.String
+ * @describe: 补全行政编码,12位
+ * @author wangtong
+ * @date 2022/6/29 10:34
+ * @params [areaCode]
+ */
+ private String getCompleteAreaCode(String areaCode) {
+ if (StringUtils.isBlank(areaCode)) {
+ areaCode = "0";
+ }
+ while (areaCode.length() < 12) {
+ areaCode = areaCode + "0";
+ }
+ return areaCode;
+ }
+
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPublicServiceServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPublicServiceServiceImpl.java
index b822245662..6fd19e5839 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPublicServiceServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPublicServiceServiceImpl.java
@@ -27,6 +27,7 @@ import com.epmet.dto.result.IcCoverageCategoryDictListResultDTO;
import com.epmet.dto.result.IcPublicServiceListResultDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.entity.IcPublicServiceEntity;
+import com.epmet.entity.IcSuperiorResourceEntity;
import com.epmet.excel.IcPublicServiceExcel;
import com.epmet.excel.handler.IcPublicServiceExcelImportListener;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
@@ -170,7 +171,10 @@ public class IcPublicServiceServiceImpl extends BaseServiceImpl 0) {
throw new RenException(EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getCode(), EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getMsg());
}
-
+ //小区编码不可重复
+ formDTO.setSysCoding(null);
+ if(org.apache.commons.lang3.StringUtils.isNotBlank(formDTO.getCoding())){
+ IcNeighborHoodEntity isHaveCoding = icNeighborHoodDao.selectByCoding(formDTO.getCoding(),formDTO.getNeighborHoodId());
+ if(null != isHaveCoding){
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "该小区编码已存在,请勿重复!","该小区编码已存在,请勿重复!");
+ }
+ updateNeiMaxNum(customerId,formDTO);
+ }
IcNeighborHoodDTO icNeighborHoodDTO = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodDTO.class);
icNeighborHoodDTO.setId(formDTO.getNeighborHoodId());
icNeighborHoodDTO.setCustomerId(customerId);
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.31__add_ic_organization_code_info.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.31__add_ic_organization_code_info.sql
new file mode 100644
index 0000000000..c55fc29940
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.31__add_ic_organization_code_info.sql
@@ -0,0 +1,18 @@
+CREATE TABLE `ic_organization_code_info` (
+ `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
+ `COMMUNITY_ID` varchar(64) NOT NULL COMMENT '社区id',
+ `NEIGHBOR_MAX_NUM` varchar(10) NOT NULL COMMENT '该社区下最大的小区编码序列号',
+ `BUILDING_MAX_NUM` varchar(10) NOT NULL COMMENT '该社区下最大的楼栋编码序列号',
+ `HOUSE_MAX_NUM` varchar(10) NOT NULL COMMENT '该社区下最大的房屋编码序列号'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='小区/楼栋/房屋编码辅助表';
+
+
+alter table ic_neighbor_hood add COLUMN `CODING` varchar(64) DEFAULT NULL COMMENT '小区编码';
+alter table ic_neighbor_hood add COLUMN `SYS_CODING` varchar(64) DEFAULT NULL COMMENT '小区系统编码';
+alter table ic_neighbor_hood add COLUMN `REAL_BUILDING` int(10) DEFAULT NULL COMMENT '实有楼栋';
+
+alter table ic_building add COLUMN `CODING` varchar(64) DEFAULT NULL COMMENT '楼栋编码';
+alter table ic_building add COLUMN `SYS_CODING` varchar(64) DEFAULT NULL COMMENT '楼栋系统编码';
+alter table ic_building add COLUMN `REAL_PERSON` int(10) DEFAULT NULL COMMENT '实有人口';
+
+alter table ic_house add COLUMN `CODING` varchar(64) DEFAULT NULL COMMENT '房屋可编辑编码';
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.32__alter_ic_organization_code_info.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.32__alter_ic_organization_code_info.sql
new file mode 100644
index 0000000000..ee6e1fc7a1
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.32__alter_ic_organization_code_info.sql
@@ -0,0 +1,9 @@
+alter table ic_organization_code_info add COLUMN `UNIT_MAX_NUM` varchar(10) NOT NULL COMMENT '该社区下最大的单元编码序列号';
+
+alter table ic_building_unit add COLUMN `CODING` varchar(64) DEFAULT NULL COMMENT '单元编码';
+alter table ic_building_unit add COLUMN `SYS_CODING` varchar(64) DEFAULT NULL COMMENT '单元系统编码';
+
+ALTER TABLE ic_organization_code_info MODIFY COLUMN `NEIGHBOR_MAX_NUM` varchar(10) DEFAULT NULL COMMENT '该社区下最大的小区编码序列号';
+ALTER TABLE ic_organization_code_info MODIFY COLUMN `BUILDING_MAX_NUM` varchar(10) DEFAULT NULL COMMENT '该社区下最大的楼栋编码序列号';
+ALTER TABLE ic_organization_code_info MODIFY COLUMN `UNIT_MAX_NUM` varchar(10) DEFAULT NULL COMMENT '该社区下最大的单元编码序列号';
+ALTER TABLE ic_organization_code_info MODIFY COLUMN `HOUSE_MAX_NUM` varchar(10) DEFAULT NULL COMMENT '该社区下最大的房屋编码序列号';
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.33__alter_ic_building.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.33__alter_ic_building.sql
new file mode 100644
index 0000000000..a3a448ba14
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.33__alter_ic_building.sql
@@ -0,0 +1 @@
+alter table ic_building modify column `BUILDING_LEADER_NAME` varchar(32) DEFAULT NULL COMMENT '楼长姓名';
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.34__alter_ic_house.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.34__alter_ic_house.sql
new file mode 100644
index 0000000000..277dadd03d
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.34__alter_ic_house.sql
@@ -0,0 +1 @@
+update `ic_house` set CODING=HOUSE_CODE
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.35__alter_ic_organization_code_info.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.35__alter_ic_organization_code_info.sql
new file mode 100644
index 0000000000..e143c87c1d
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.35__alter_ic_organization_code_info.sql
@@ -0,0 +1,8 @@
+Drop Table ic_organization_code_info;
+
+CREATE TABLE `ic_organization_code_info` (
+ `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
+ `SYS_ID` varchar(64) NOT NULL COMMENT '社区/小区/楼栋/单元id',
+ `SYS_TYPE` varchar(32) DEFAULT NULL COMMENT '类型:\r\n社区community \r\n小区neighbor \r\n楼栋building \r\n单元unit',
+ `MAX_NUM` varchar(32) DEFAULT NULL COMMENT '最大数'
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='小区/楼栋/房屋编码辅助表';
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export_for_easyexcel.xlsx b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export_for_easyexcel.xlsx
new file mode 100644
index 0000000000..359b68f0bd
Binary files /dev/null and b/epmet-module/gov-org/gov-org-server/src/main/resources/excel/house_export_for_easyexcel.xlsx differ
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml
index 49d364c747..f366605fba 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/logback-spring.xml
@@ -1,6 +1,7 @@
-
+
+
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
index 2fd5aa5feb..136341dc18 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
@@ -756,6 +756,27 @@
AND CUSTOMER_ID = #{customerId}
AND CONCAT(PIDS,':',ID) LIKE CONCAT('%',#{agencyId},'%')
+
+
+
+
+ select
+ ID,
+ PID,
+ ID as value,
+ ORGANIZATION_NAME as label
+ from customer_agency
+ where DEL_FLAG = '0'
+ AND CUSTOMER_ID = #{customerId}
+
SELECT
a.id,
@@ -880,4 +901,33 @@
AND pids LIKE CONCAT('%', #{agencyId}, '%')
+
+
+
+
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
index 94d29e08b4..bd6f04bbc8 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
@@ -863,5 +863,13 @@
UPDATE customer_grid SET total_user = total_user+#{incrCount}
where id = #{gridId} and del_flag = '0'
+
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml
index 92c486f24a..5f825edc25 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml
@@ -403,5 +403,51 @@
SELECT COUNT(ID) FROM ic_building_unit WHERE BUILDING_ID = #{buildingId} AND DEL_FLAG = '0'
+
+ SELECT
+ b.ID AS buildingId,
+ b.BUILDING_NAME,
+ b.NEIGHBOR_HOOD_ID,
+ b.sort,
+ b.TOTAL_UNIT_NUM,
+ b.TOTAL_FLOOR_NUM,
+ b.TOTAL_HOUSE_NUM,
+ h.NEIGHBOR_HOOD_NAME,
+ b.LATITUDE,
+ b.LONGITUDE,
+ b.COORDINATE_POSITION,
+ b.TYPE,
+ h.GRID_ID,
+ h.AGENCY_ID,
+ b.BUILDING_LEADER_NAME,
+ b.BUILDING_LEADER_MOBILE,
+ b.CODING,
+ b.SYS_CODING,
+ b.REAL_PERSON
+ FROM ic_building b
+ INNER JOIN ic_neighbor_hood h ON (h.id = b.NEIGHBOR_HOOD_ID AND h.DEL_FLAG = '0')
+ WHERE b.DEL_FLAG = '0'
+ AND b.ID = #{buildingId}
+
+
+
+ select *
+ from ic_building
+ where del_flag = '0'
+ and CODING=#{coding}
+
+ and id != #{id}
+
+
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml
index 09f334b42d..fe5a0ef73b 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml
@@ -17,6 +17,47 @@
SELECT ID FROM ic_building_unit WHERE DEL_FLAG = '0' AND BUILDING_ID = #{buildingId} ORDER BY UNIT_NUM+0 DESC LIMIT #{size}
+
+ SELECT bu.CUSTOMER_ID,
+ h.AGENCY_ID,
+ ca.ORGANIZATION_NAME as agencyName,
+ CONCAT(ca.ALL_PARENT_NAME,'-',ca.ORGANIZATION_NAME) as agencyPathName,
+ ca.AREA_CODE,
+ h.GRID_ID,
+ g.GRID_NAME,
+ h.id as neighborHoodId,
+ h.NEIGHBOR_HOOD_NAME,
+ b.id as buildingId,
+ b.BUILDING_NAME,
+ bu.id as buildingUnitId,
+ bu.UNIT_NAME
+
+ FROM ic_building_unit bu
+ INNER JOIN ic_building b ON (b.id = bu.BUILDING_ID AND b.DEL_FLAG = '0')
+ INNER JOIN ic_neighbor_hood h ON (h.id = b.NEIGHBOR_HOOD_ID AND h.DEL_FLAG = '0')
+ INNER JOIN customer_agency ca ON (h.AGENCY_ID = ca.id AND ca.DEL_FLAG = '0')
+ INNER JOIN customer_grid g ON (h.GRID_ID = g.id AND g.DEL_FLAG = '0')
+ WHERE bu.DEL_FLAG = '0'
+ AND bu.ID = #{unitId}
+
+
+ select *
+ from ic_building_unit
+ where del_flag = '0'
+ and CODING=#{coding}
+
+
-
\ No newline at end of file
+
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcCityManagementDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcCityManagementDao.xml
index 22a66aeb56..2ed22909f9 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcCityManagementDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcCityManagementDao.xml
@@ -106,4 +106,15 @@
id = #{id}
AND del_flag = '0'
+
+
+ DELETE
+ FROM
+ ic_city_management
+ WHERE
+ del_flag != '0'
+ AND agency_id = #{agencyId}
+ AND `name` = #{name}
+
+
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcDangerousChemicalsDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcDangerousChemicalsDao.xml
index ccaea77ffd..99d3138558 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcDangerousChemicalsDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcDangerousChemicalsDao.xml
@@ -118,4 +118,14 @@
AND del_flag = '0'
+
+ DELETE
+ FROM
+ ic_dangerous_chemicals
+ WHERE
+ del_flag != '0'
+ AND agency_id = #{agencyId}
+ AND `name` = #{name}
+
+
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
index d0dd039a7f..f770ddfa8e 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
@@ -122,8 +122,8 @@
LEFT JOIN ic_building b on a.BUILDING_ID = b.ID and b.DEL_FLAG = '0'
LEFT JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0'
LEFT JOIN ic_building_unit d on a.BUILDING_UNIT_ID = d.ID and d.DEL_FLAG = '0'
- LEFT JOIN customer_grid gr on gr.ID = c.GRID_ID and d.DEL_FLAG = '0'
- LEFT JOIN customer_agency ag on ag.ID = c.AGENCY_ID and d.DEL_FLAG = '0'
+ LEFT JOIN customer_grid gr on gr.ID = c.GRID_ID and gr.DEL_FLAG = '0'
+ LEFT JOIN customer_agency ag on ag.ID = c.AGENCY_ID and ag.DEL_FLAG = '0'
1 = 1
and a.del_flag = '0'
@@ -451,7 +451,8 @@
a.OWNER_PHONE,
a.OWNER_ID_CARD,
a.REMARK,
- c.AGENCY_PIDS
+ c.AGENCY_PIDS,
+ a.CODING
from ic_house a
LEFT JOIN ic_building b on a.BUILDING_ID = b.ID and b.DEL_FLAG = '0'
LEFT JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0'
@@ -522,8 +523,17 @@
#{id}
)
+
UPDATE ic_house SET RESI_NUMBER = #{resiNumber}, UPDATED_TIME = NOW() where ID = #{houseId} and RESI_NUMBER != #{resiNumber} and DEL_FLAG = '0'
+
+ select *
+ from ic_house
+ where del_flag = '0'
+ and CODING=#{coding}
+
+
+
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml
index 8d6e24b5f7..2f76bc1b7a 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml
@@ -312,4 +312,356 @@
a.del_flag = '0'
AND a.ID = #{neighborHoodId}
+
+
+ select *
+ from ic_neighbor_hood
+ where del_flag = '0'
+ and CODING=#{coding}
+
+ and id != #{id}
+
+
+
+
+
+ SELECT
+ *
+ FROM (
+ SELECT
+ grid.ID,
+ grid.GRID_NAME AS name,
+ SUM(IFNULL( buildingRealCount, 0 )) AS buildingRealCount,
+ SUM(IFNULL( houseRealCount, 0 )) AS houseRealCount,
+ SUM(IFNULL( personRealCount, 0 )) AS personRealCount,
+ SUM(IFNULL( buildingCount, 0 )) AS buildingCount,
+ SUM(IFNULL( houseCount, 0 )) AS houseCount,
+ SUM(IFNULL( buildingRealCount, 0 )) - SUM(IFNULL( buildingCount, 0 )) AS differBuildingCount,
+ SUM(IFNULL( houseRealCount, 0 )) - SUM(IFNULL( houseCount, 0 )) AS differHouseCount
+ FROM
+ customer_grid grid
+ LEFT JOIN (
+ SELECT
+ a.ID,
+ a.GRID_ID,
+ IFNULL( a.REAL_BUILDING, 0 ) AS buildingRealCount,
+ SUM( IFNULL( b.TOTAL_HOUSE_NUM, 0 ) ) AS houseRealCount,
+ SUM( IFNULL( b.REAL_PERSON, 0 ) ) AS personRealCount,
+ COUNT( DISTINCT b.ID ) AS buildingCount,
+ c.houseCount
+ FROM
+ ic_neighbor_hood a
+ LEFT JOIN ic_building b ON a.ID = b.NEIGHBOR_HOOD_ID
+ AND b.DEL_FLAG = '0'
+ LEFT JOIN ( SELECT NEIGHBOR_HOOD_ID, COUNT( ID ) AS houseCount
+ FROM ic_house WHERE DEL_FLAG = '0'
+ AND CUSTOMER_ID = #{customerId}
+ GROUP BY NEIGHBOR_HOOD_ID ) c ON a.ID = c.NEIGHBOR_HOOD_ID
+ WHERE
+ a.DEL_FLAG = '0'
+ AND a.AGENCY_ID = #{communityId}
+ GROUP BY
+ a.ID
+ ) t ON grid.ID = t.GRID_ID
+ WHERE
+ grid.DEL_FLAG = '0'
+ AND grid.PID = #{communityId}
+ GROUP BY
+ grid.ID
+ ) t
+ WHERE
+ 1=1
+
+ AND t.name LIKE CONCAT('%', #{name}, '%')
+
+ ORDER BY convert(name using gbk)
+
+
+ SELECT
+ GRID_ID AS gridId,
+ GRID_NAME AS gridName,
+ SUM( buildingRealCount ) AS buildingRealCount,
+ SUM( houseRealCount ) AS houseRealCount,
+ SUM( personRealCount ) AS personRealCount,
+ SUM( buildingCount ) AS buildingCount,
+ SUM( houseCount ) AS houseCount
+ FROM
+ (
+ SELECT
+ a.GRID_ID,
+ d.GRID_NAME,
+ IFNULL( a.REAL_BUILDING, 0 ) AS buildingRealCount,
+ SUM( IFNULL( b.TOTAL_HOUSE_NUM, 0 ) ) AS houseRealCount,
+ SUM( IFNULL( b.REAL_PERSON, 0 ) ) AS personRealCount,
+ COUNT( DISTINCT b.ID ) AS buildingCount,
+ c.houseCount
+ FROM
+ ic_neighbor_hood a
+ LEFT JOIN ic_building b ON a.ID = b.NEIGHBOR_HOOD_ID
+ AND b.DEL_FLAG = '0'
+ LEFT JOIN (
+ SELECT
+ NEIGHBOR_HOOD_ID, COUNT( ID ) AS houseCount
+ FROM
+ ic_house
+ WHERE
+ DEL_FLAG = '0'
+ AND CUSTOMER_ID = #{customerId}
+ GROUP BY
+ NEIGHBOR_HOOD_ID
+ ) c ON a.ID = c.NEIGHBOR_HOOD_ID
+ INNER JOIN customer_grid d ON a.GRID_ID = d.ID
+ WHERE
+ a.DEL_FLAG = '0'
+ AND a.GRID_ID = #{gridId}
+ GROUP BY
+ a.ID
+ ) t
+
+
+ SELECT
+ *
+ FROM (
+ SELECT
+ a.ID,
+ a.NEIGHBOR_HOOD_NAME AS name,
+ IFNULL( a.REAL_BUILDING, 0 ) AS buildingRealCount,
+ SUM( IFNULL( b.TOTAL_HOUSE_NUM, 0 ) ) AS houseRealCount,
+ SUM( IFNULL( b.REAL_PERSON, 0 ) ) AS personRealCount,
+ COUNT( DISTINCT b.ID ) AS buildingCount,
+ IFNULL(c.houseCount, 0) AS houseCount,
+ IFNULL( a.REAL_BUILDING, 0 ) - COUNT( DISTINCT b.ID ) AS differBuildingCount,
+ SUM( IFNULL( b.TOTAL_HOUSE_NUM, 0 ) ) - IFNULL(c.houseCount, 0) AS differHouseCount
+ FROM
+ ic_neighbor_hood a
+ LEFT JOIN ic_building b ON a.ID = b.NEIGHBOR_HOOD_ID
+ AND b.DEL_FLAG = '0'
+ LEFT JOIN ( SELECT NEIGHBOR_HOOD_ID, COUNT( ID ) AS houseCount
+ FROM ic_house WHERE DEL_FLAG = '0'
+ AND CUSTOMER_ID = #{customerId}
+ GROUP BY NEIGHBOR_HOOD_ID ) c ON a.ID = c.NEIGHBOR_HOOD_ID
+ WHERE
+ a.DEL_FLAG = '0'
+ AND a.GRID_ID = #{gridId}
+ GROUP BY
+ a.ID
+ ) t
+ WHERE
+ 1 = 1
+
+ AND t.name LIKE CONCAT('%', #{name}, '%')
+
+ ORDER BY convert(name using gbk)
+
+
+
+ SELECT
+ a.ID AS neighborHoodId,
+ a.NEIGHBOR_HOOD_NAME AS neighborHoodName,
+ IFNULL( a.REAL_BUILDING, 0 ) AS buildingRealCount,
+ SUM( IFNULL( b.TOTAL_HOUSE_NUM, 0 ) ) AS houseRealCount,
+ SUM( IFNULL( b.REAL_PERSON, 0 ) ) AS personRealCount,
+ COUNT( DISTINCT b.ID ) AS buildingCount,
+ IFNULL( c.houseCount, 0 ) AS houseCount
+ FROM
+ ic_neighbor_hood a
+ LEFT JOIN ic_building b ON a.ID = b.NEIGHBOR_HOOD_ID
+ AND b.DEL_FLAG = '0'
+ LEFT JOIN ( SELECT NEIGHBOR_HOOD_ID, COUNT( ID ) AS houseCount FROM ic_house WHERE DEL_FLAG = '0'
+ AND NEIGHBOR_HOOD_ID = #{neighborHoodId}
+ GROUP BY NEIGHBOR_HOOD_ID ) c ON a.ID = c.NEIGHBOR_HOOD_ID
+ WHERE
+ a.DEL_FLAG = '0'
+ AND a.ID = #{neighborHoodId}
+ GROUP BY
+ a.ID
+
+
+
+ SELECT
+ *
+ FROM (
+ SELECT
+ a.ID,
+ a.SORT,
+ a.BUILDING_NAME AS name,
+ IFNULL( a.TOTAL_UNIT_NUM, 0 ) AS unitRealCount,
+ IFNULL(c.unitCount, 0) AS unitCount,
+ SUM( IFNULL( a.TOTAL_HOUSE_NUM, 0 ) ) AS houseRealCount,
+ SUM( IFNULL( a.REAL_PERSON, 0 ) ) AS personRealCount,
+ IFNULL(b.houseCount, 0) AS houseCount,
+ SUM( IFNULL( a.TOTAL_HOUSE_NUM, 0 ) )-IFNULL(b.houseCount, 0) AS differHouseCount
+ FROM
+ ic_building a
+ LEFT JOIN ( SELECT BUILDING_ID, COUNT( ID ) AS houseCount
+ FROM ic_house WHERE DEL_FLAG = '0'
+ AND NEIGHBOR_HOOD_ID = #{neighborHoodId}
+ GROUP BY BUILDING_ID ) b ON a.ID = b.BUILDING_ID
+ LEFT JOIN ( SELECT BUILDING_ID, COUNT( ID ) AS unitCount
+ FROM ic_building_unit
+ WHERE DEL_FLAG = '0'
+ GROUP BY BUILDING_ID ) c ON a.ID = c.BUILDING_ID
+ WHERE
+ a.DEL_FLAG = '0'
+ AND a.NEIGHBOR_HOOD_ID = #{neighborHoodId}
+ GROUP BY
+ a.ID
+ ) t
+ WHERE
+ 1 = 1
+
+ AND t.name LIKE CONCAT('%', #{name}, '%')
+
+ ORDER BY
+
+
+ SORT ASC, name + 0 ASC
+
+
+ houseRealCount desc, name + 0 ASC
+
+
+ personRealCount desc, name + 0 ASC
+
+
+ differHouseCount desc, name + 0 ASC
+
+
+ convert(name using gbk)
+
+
+
+
+
+
+ SELECT
+ a.ID AS buildingId,
+ a.TYPE AS buildingType,
+ CONCAT(NEIGHBOR_HOOD_NAME,' ',BUILDING_NAME) AS buildingName,
+ IFNULL( a.TOTAL_UNIT_NUM, 0 ) AS unitRealCount,
+ IFNULL( d.unitCount, 0 ) AS unitCount,
+ SUM( IFNULL( a.TOTAL_HOUSE_NUM, 0 ) ) AS houseRealCount,
+ SUM( IFNULL( a.REAL_PERSON, 0 ) ) AS personRealCount,
+ IFNULL( b.houseCount, 0 ) AS houseCount,
+ 0 AS personCount
+ FROM
+ ic_building a
+ LEFT JOIN ( SELECT BUILDING_ID, COUNT( ID ) AS houseCount
+ FROM ic_house
+ WHERE DEL_FLAG = '0'
+ AND BUILDING_ID = #{buildingId}
+ GROUP BY BUILDING_ID ) b ON a.ID = b.BUILDING_ID
+ LEFT JOIN ( SELECT BUILDING_ID, COUNT( ID ) AS unitCount
+ FROM ic_building_unit
+ WHERE DEL_FLAG = '0'
+ AND BUILDING_ID = #{buildingId}
+ GROUP BY BUILDING_ID ) d ON a.ID = d.BUILDING_ID
+ INNER JOIN ic_neighbor_hood c ON a.NEIGHBOR_HOOD_ID = c.ID
+ WHERE
+ a.DEL_FLAG = '0'
+ AND a.ID = #{buildingId}
+
+
+
+ SELECT
+ a.ID,
+ a.UNIT_NAME AS name,
+ IFNULL( b.houseCount, 0 ) AS houseCount,
+ 0 AS personCount
+ FROM
+ ic_building_unit a
+ LEFT JOIN ( SELECT BUILDING_UNIT_ID, COUNT( ID ) AS houseCount
+ FROM ic_house
+ WHERE DEL_FLAG = '0' AND BUILDING_ID = #{buildingId}
+ GROUP BY BUILDING_UNIT_ID ) b ON a.ID = b.BUILDING_UNIT_ID
+ WHERE
+ a.DEL_FLAG = '0'
+ AND a.BUILDING_ID = #{buildingId}
+ ORDER BY a.UNIT_NUM
+
+
+
+ SELECT
+ a.ID,
+ CONCAT(NEIGHBOR_HOOD_NAME,' ',BUILDING_NAME,' ',a.UNIT_NAME) AS unitName,
+ IFNULL( b.houseCount, 0 ) AS houseCount,
+ 0 AS personCount
+ FROM
+ ic_building_unit a
+ LEFT JOIN ( SELECT BUILDING_UNIT_ID, COUNT( ID ) AS houseCount FROM ic_house
+ WHERE DEL_FLAG = '0' AND BUILDING_UNIT_ID = #{unitId}
+ GROUP BY BUILDING_UNIT_ID ) b ON a.ID = b.BUILDING_UNIT_ID
+ INNER JOIN ic_building c ON a.BUILDING_ID = c.ID
+ INNER JOIN ic_neighbor_hood d ON c.NEIGHBOR_HOOD_ID = d.ID
+ WHERE
+ a.DEL_FLAG = '0'
+ AND a.ID = #{unitId}
+
+
+
+ SELECT
+ ID,
+ DOOR_NAME AS "name",
+ RENT_FLAG AS houseType,
+ HOUSE_CODE,
+ 0 AS personCount
+ FROM
+ ic_house
+ WHERE
+ DEL_FLAG = '0'
+ AND BUILDING_UNIT_ID = #{unitId}
+
+ AND DOOR_NAME LIKE CONCAT('%', #{name}, '%')
+
+ ORDER BY
+ SORT, DOOR_NAME+0
+
+
+
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcOrganizationCodeInfoDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcOrganizationCodeInfoDao.xml
new file mode 100644
index 0000000000..7a3d8441f9
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcOrganizationCodeInfoDao.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ select *
+ from ic_organization_code_info
+ where CUSTOMER_ID=#{customerId}
+ and SYS_ID = #{sysId}
+ AND SYS_TYPE = #{sysType}
+
+
+ update ic_organization_code_info
+ set MAX_NUM=#{maxNum}
+ where CUSTOMER_ID = #{customerId}
+ and SYS_ID = #{sysId}
+ AND SYS_TYPE = #{sysType}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPublicServiceDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPublicServiceDao.xml
index 6909d9ea5c..295ee69e36 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPublicServiceDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPublicServiceDao.xml
@@ -107,4 +107,14 @@
AND del_flag = '0'
+
+ DELETE
+ FROM
+ ic_public_service
+ WHERE
+ del_flag != '0'
+ AND agency_id = #{agencyId}
+ AND `name` = #{name}
+
+
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcSuperiorResourceDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcSuperiorResourceDao.xml
index 0b9d9760f4..8058120afd 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcSuperiorResourceDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcSuperiorResourceDao.xml
@@ -107,5 +107,15 @@
AND del_flag = '0'
+
+ DELETE
+ FROM
+ ic_superior_resource
+ WHERE
+ del_flag != '0'
+ AND agency_id = #{agencyId}
+ AND `name` = #{name}
+
+
\ No newline at end of file
diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
index 7dfdc190be..d6bfb0baba 100644
--- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
+++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
@@ -631,15 +631,20 @@ public class IcEventServiceImpl extends BaseServiceImpl getDependents(String idCard) {
+ // 家属列表
+ ArrayList dependents = new ArrayList<>();
IcResiUserBriefDTO familyInfo = getResultDataOrThrowsException(userOpenFeignClient.findFamilyMemByIdCard(idCard),
ServiceConstant.EPMET_USER_SERVER,
EpmetErrorCode.SERVER_ERROR.getCode(),
"【事件研判分析】查找家属失败",
"【事件研判分析】查找家属失败");
+ if (familyInfo == null) {
+ return dependents;
+ }
+
List houseUserList = familyInfo.getHouseUserList();
- ArrayList dependents = new ArrayList<>();
if (CollectionUtils.isEmpty(houseUserList)) {
return dependents;
}
diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/logback-spring.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/logback-spring.xml
index a851ad256c..a1e8c5f1b0 100644
--- a/epmet-module/gov-project/gov-project-server/src/main/resources/logback-spring.xml
+++ b/epmet-module/gov-project/gov-project-server/src/main/resources/logback-spring.xml
@@ -1,6 +1,7 @@
-
+
+
diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java
index a8269648f3..a71e8179fb 100644
--- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java
+++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java
@@ -55,7 +55,7 @@ public class ArticleContentDTO implements Serializable {
private String content;
/**
- * 内容类型 图片:img;文字:text;文件:file
+ * 内容类型 图片:img;文字:text;文件:file 富文本:rich_text
*/
private String contentType;
diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleDTO.java
index 4c72866e27..09660e6c8c 100644
--- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleDTO.java
+++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleDTO.java
@@ -124,6 +124,11 @@ public class ArticleDTO implements Serializable {
*/
private String departmentId;
+ /**
+ * 1:富文本;0:不是
+ */
+ private String richTextFlag;
+
/**
* 删除标识 0.未删除 1.已删除
*/
diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java
index ee29b969c7..add18d59f8 100644
--- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java
+++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java
@@ -55,7 +55,7 @@ public class DraftContentDTO implements Serializable {
private String content;
/**
- * 内容类型 图片:img;文字:text;文件:file
+ * 内容类型 图片:img;文字:text;文件:file 富文本:rich_text
*/
private String contentType;
diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftDTO.java
index c7a383a56d..55751bdfd1 100644
--- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftDTO.java
+++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftDTO.java
@@ -114,6 +114,11 @@ public class DraftDTO implements Serializable {
*/
private String departmentId;
+ /**
+ * 1:富文本;0:不是
+ */
+ private String richTextFlag;
+
/**
* 删除标识 0.未删除 1.已删除
*/
diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddOrSaveDraftFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddOrSaveDraftFormDTO.java
new file mode 100644
index 0000000000..568943b537
--- /dev/null
+++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddOrSaveDraftFormDTO.java
@@ -0,0 +1,84 @@
+package com.epmet.dto.form;
+
+import com.epmet.commons.tools.constant.NumConstant;
+import lombok.Data;
+import org.hibernate.validator.constraints.Length;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Author zxc
+ * @DateTime 2022/6/30 13:41
+ * @DESC
+ */
+@Data
+public class AddOrSaveDraftFormDTO implements Serializable {
+
+ public interface AddArticleForm{}
+ public interface AddDraftForm{}
+
+ /**
+ * 类型 发布文章:article;存草稿:draft
+ */
+ @NotBlank(message = "类型不能为空",groups = AddArticleForm.class)
+ private String type;
+
+ @NotBlank(message = "标题不能为空",groups = {AddArticleForm.class})
+ @Length(max = 50, message = "标题最长为50个字")
+ private String title;
+
+ /**
+ * 发布范围IDs
+ */
+ private List gridIdList;
+
+ /**
+ * 发布范围Names
+ */
+ private String publishRangeDesc;
+
+ /**
+ * 文章标签
+ */
+ private List tagNameList;
+
+ @NotBlank(message = "发布单位不能为空",groups = AddArticleForm.class)
+ private String publisher;
+
+ @NotBlank(message = "发布单位名称不能为空",groups = AddArticleForm.class)
+ private String publisherName;
+ /**
+ * 发布单位类型 机关:agency;部门:department;网格:grid
+ */
+ @NotBlank(message = "发布单位类型不能为空",groups = AddArticleForm.class)
+ private String publisherType;
+
+ @NotBlank(message = "发布时间不能为空",groups = AddArticleForm.class)
+ private String publishDate;
+
+ @NotBlank(message = "文章内容不能为空",groups = {AddArticleForm.class})
+ private String content;
+
+ /**
+ * 是否置顶 1是;0否;
+ */
+ private Integer isTop = NumConstant.ZERO;
+
+ private String userId;
+
+ private String customerId;
+
+ /**
+ * 草稿ID
+ */
+ private String draftId;
+
+ /**
+ * 封面图地址
+ */
+ private String imgUrl;
+}
diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleListFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleListFormDTO.java
new file mode 100644
index 0000000000..0a601e9802
--- /dev/null
+++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleListFormDTO.java
@@ -0,0 +1,60 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Author zxc
+ * @DateTime 2021/7/15 4:34 下午
+ * @DESC
+ */
+@Data
+public class ArticleListFormDTO implements Serializable {
+ private static final long serialVersionUID = 6397877545890473794L;
+
+ /**
+ * 文章标题
+ */
+ private String title;
+ /**
+ * 标签Id集合
+ */
+ private List