|
|
@ -142,6 +142,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { |
|
|
|
//获取所属组织地区码
|
|
|
|
String areaCode = icNeighborHoodDao.getAreaCode(formDTO.getNeighborHoodId()); |
|
|
|
if (StringUtils.isNotBlank(areaCode)) { |
|
|
|
areaCode = numberAfterFillZero(areaCode, NumConstant.TWELVE); |
|
|
|
icHouseDTO.setHouseCode(createHouseCode(customerId, formDTO.getBuildingId(), areaCode)); |
|
|
|
} |
|
|
|
icHouseDao.insert(icHouseDTO); |
|
|
@ -981,5 +982,16 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
private String numberAfterFillZero(String str, int length) { |
|
|
|
StringBuilder buffer = new StringBuilder(str); |
|
|
|
if (buffer.length() >= length) { |
|
|
|
return buffer.toString(); |
|
|
|
} else { |
|
|
|
while (buffer.length() < length) { |
|
|
|
buffer.append("0"); |
|
|
|
} |
|
|
|
} |
|
|
|
return buffer.toString(); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|