diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingDTO.java index b72e68c723..52567226eb 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingDTO.java @@ -141,4 +141,19 @@ public class IcBuildingDTO implements Serializable { */ private Date updatedTime; -} \ No newline at end of file + /** + * 楼栋编码 + */ + private String coding; + + /** + * 楼栋系统编码 + */ + private String sysCoding; + + /** + * 实有人口数 + */ + private Integer realPerson; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java index 42163539ce..8f3918adb9 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java @@ -152,4 +152,8 @@ public class IcHouseDTO implements Serializable { */ private String remark; -} \ No newline at end of file + /** + * 房屋可编辑编码 + */ + private String coding; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodDTO.java index 14bc28d43b..d50508c522 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodDTO.java @@ -129,4 +129,19 @@ public class IcNeighborHoodDTO implements Serializable { */ private Date updatedTime; + /** + * 小区编码 + */ + private String coding; + + /** + * 小区系统编码 + */ + private String sysCoding; + + /** + * 实有楼栋数 + */ + private Integer realBuilding; + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcOrganizationCodeInfoDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcOrganizationCodeInfoDTO.java new file mode 100644 index 0000000000..edeca85503 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcOrganizationCodeInfoDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 小区/楼栋/房屋编码辅助表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-27 + */ +@Data +public class IcOrganizationCodeInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 社区id + */ + private String communityId; + + /** + * 该社区下最大的小区编码序列号 + */ + private String neighborMaxNum; + + /** + * 该社区下最大的楼栋编码序列号 + */ + private String buildingMaxNum; + + /** + * 该社区下最大的房屋编码序列号 + */ + private String houseMaxNum; + +} 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/IcOrganizationCodeInfoDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcOrganizationCodeInfoDao.java new file mode 100644 index 0000000000..c3b0a92d80 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcOrganizationCodeInfoDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcOrganizationCodeInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 小区/楼栋/房屋编码辅助表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-27 + */ +@Mapper +public interface IcOrganizationCodeInfoDao extends BaseDao { + +} \ 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/IcHouseEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java index a535667426..1568dee910 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 @@ -117,4 +117,9 @@ public class IcHouseEntity extends BaseEpmetEntity { */ private String houseCode; private String houseQrcodeUrl; + + /** + * 房屋可编辑编码 + */ + 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..f4e9671a73 --- /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 communityId; + + /** + * 该社区下最大的小区编码序列号 + */ + private String neighborMaxNum; + + /** + * 该社区下最大的楼栋编码序列号 + */ + private String buildingMaxNum; + + /** + * 该社区下最大的房屋编码序列号 + */ + private String houseMaxNum; + +} 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/IcOrganizationCodeInfoService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcOrganizationCodeInfoService.java new file mode 100644 index 0000000000..e98db783b5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcOrganizationCodeInfoService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcOrganizationCodeInfoDTO; +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); +} \ No newline at end of file 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..d6eba569b3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java @@ -0,0 +1,87 @@ +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcOrganizationCodeInfoDao; +import com.epmet.dto.IcOrganizationCodeInfoDTO; +import com.epmet.entity.IcOrganizationCodeInfoEntity; +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; + + @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)); + } + +} \ No newline at end of file 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..b544ba7019 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcOrganizationCodeInfoDao.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file