Browse Source

双实信息录入-获取小区编码添加初始化验证,加长表字段

feature/teamB_zz_wgh
Jackwang 3 years ago
parent
commit
228bb2dfb3
  1. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java
  2. 1
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.33__alter_ic_building.sql

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java

@ -121,7 +121,15 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl<IcOrganiz
//查询该社区下是否存在数据
IcOrganizationCodeInfoEntity communEntity = baseDao.selectByCommunityIdAndCustomerId(customerId, communResult.getCommunityId());
if (null == communEntity) {
String neighborCode = getCompleteAreaCode(communResult.getAreaCode()) + "001";
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);
@ -129,7 +137,7 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl<IcOrganiz
IcOrganizationCodeInfoEntity newEntity = new IcOrganizationCodeInfoEntity();
newEntity.setCustomerId(customerId);
newEntity.setCommunityId(communResult.getCommunityId());
newEntity.setNeighborMaxNum("001");
newEntity.setNeighborMaxNum(getNewMaxIndex(3, neighborMaxNum));
baseDao.insert(newEntity);
} else {
Integer neighborMaxNum = Integer.valueOf(communEntity.getNeighborMaxNum()) + 1;

1
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 '楼长姓名';
Loading…
Cancel
Save