diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/BaseInfoFamilyBuildingFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/BaseInfoFamilyBuildingFormDTO.java new file mode 100644 index 0000000000..94bc0a05ab --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/BaseInfoFamilyBuildingFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/2 9:13 上午 + * @DESC + */ +@Data +public class BaseInfoFamilyBuildingFormDTO implements Serializable { + + private static final long serialVersionUID = 2009866136409462441L; + + public interface BaseInfoFamilyBuildingForm{} + + @NotBlank(message = "neighborHoodId不能为空",groups = BaseInfoFamilyBuildingForm.class) + private String neighborHoodId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BaseInfoFamilyBuildingResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BaseInfoFamilyBuildingResultDTO.java new file mode 100644 index 0000000000..ea5b86e2e6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BaseInfoFamilyBuildingResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/2 9:15 上午 + * @DESC + */ +@Data +public class BaseInfoFamilyBuildingResultDTO implements Serializable { + + private static final long serialVersionUID = 6084090841200733630L; + + /** + * 楼栋ID + */ + private String buildingId; + + /** + * 楼栋名字 + */ + private String buildingName; +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index 5d3ecedfbe..1cb9c525da 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -290,4 +290,16 @@ public class AgencyController { return new Result().ok(agencyService.mapOrg(formDTO,tokenDto)); } + /** + * @Description 查询楼栋信息 + * @param formDTO + * @author zxc + * @date 2021/11/2 9:18 上午 + */ + @PostMapping("baseinfofamilybuilding") + public Result> baseInfoFamilyBuilding(@RequestBody BaseInfoFamilyBuildingFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, BaseInfoFamilyBuildingFormDTO.BaseInfoFamilyBuildingForm.class); + return new Result>().ok(agencyService.baseInfoFamilyBuilding(formDTO)); + } + } \ No newline at end of file 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 511daa2fad..ddae0aca45 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 @@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Constants; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.BaseInfoFamilyBuildingResultDTO; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.IcBuildingEntity; import com.epmet.entity.IcHouseEntity; @@ -60,4 +61,12 @@ public interface IcBuildingDao extends BaseDao { List> selectListByName(@Param("neighborNameList")ArrayList strings, @Param("buildingNameList") ArrayList strings1, @Param("buildingUnitList") ArrayList integers); + + /** + * @Description 根据neighborHoodId查询楼 + * @param neighborHoodId + * @author zxc + * @date 2021/11/2 9:25 上午 + */ + List baseInfoFamilyBuilding(@Param("neighborHoodId")String neighborHoodId); } \ 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 b0153239fd..e9c092fed5 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 @@ -139,4 +139,13 @@ public interface AgencyService { * @date 2021/10/25 10:50 上午 */ MapOrgResultDTO mapOrg(MapOrgFormDTO formDTO, TokenDto tokenDto); + + /** + * @Description 查询楼栋信息 + * @param formDTO + * @author zxc + * @date 2021/11/2 9:18 上午 + */ + List baseInfoFamilyBuilding(BaseInfoFamilyBuildingFormDTO formDTO); + } \ No newline at end of file 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 f794ea229f..f95f2486ea 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 @@ -35,6 +35,7 @@ import com.epmet.constant.OrgInfoConstant; import com.epmet.constant.RoleKeyConstants; import com.epmet.dao.CustomerAgencyDao; import com.epmet.dao.CustomerGridDao; +import com.epmet.dao.IcBuildingDao; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.form.*; @@ -92,6 +93,8 @@ public class AgencyServiceImpl implements AgencyService { private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; @Autowired private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Autowired + private IcBuildingDao icBuildingDao; /** @@ -644,6 +647,21 @@ public class AgencyServiceImpl implements AgencyService { return result; } + /** + * @Description 查询楼栋信息 + * @param formDTO + * @author zxc + * @date 2021/11/2 9:18 上午 + */ + @Override + public List baseInfoFamilyBuilding(BaseInfoFamilyBuildingFormDTO formDTO) { + List result = icBuildingDao.baseInfoFamilyBuilding(formDTO.getNeighborHoodId()); + if (CollectionUtils.isEmpty(result)){ + return new ArrayList<>(); + } + return result; + } + private CustomerAgencyEntity constructInsertEntity(AddAgencyV2FormDTO formDTO, CustomerAgencyDTO parent) { CustomerAgencyEntity insertEntity = ConvertUtils.sourceToTarget(formDTO, CustomerAgencyEntity.class); insertEntity.setOrganizationName(formDTO.getAgencyName()); 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 bd82c907ec..3f9fc515cf 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 @@ -289,5 +289,15 @@ + + + \ No newline at end of file