实有房屋相关接口更新

develop
hanrenchun 10 months ago
parent c595bcc90d
commit 0b1582ec62

@ -323,16 +323,44 @@ public class BigScreenController extends BaseController {
}
}
// public static void main(String[] args) {
// String para = "abc11幢";
// int index = para.lastIndexOf("幢");
// String buildName = null;
// if (index != -1) {
// for (int i = index - 1; i >= 0; i--) { // 从特定字符位置-1开始向前遍历
// if (Pattern.matches("\\d", String.valueOf(para.charAt(i)))) {// 检查字符是否为数字
// buildName = para.substring(i,index);// 返回有数字的字符串
// }
// }
// int index1 = para.lastIndexOf(buildName);
// if (index1 != -1 ){
// para = para.substring(0,index1);
// }
// }
// System.out.println(buildName);
// System.out.println(para);
// }
@PostMapping("/buildRealEstate")
@ApiOperation("楼栋信息:实有房屋统计")
public AjaxResult buildRealEstate(@ApiParam("楼栋地址") @RequestParam String para) {
try {
int index = para.lastIndexOf("幢");
String buildName = null;
if (index != -1 && index > 0 ){
buildName = String.valueOf(para.charAt(index-1));
para = para.substring(0,index - 1);
if (index != -1) {
for (int i = index - 1; i >= 0; i--) { // 从特定字符位置-1开始向前遍历
if (Pattern.matches("\\d", String.valueOf(para.charAt(i)))) {// 检查字符是否为数字
buildName = para.substring(i,index);// 返回有数字的字符串
}
if (!Pattern.matches("\\d", String.valueOf(para.charAt(i)))){
break;
}
}
int index1 = para.lastIndexOf(buildName);
if (index1 != -1 ){
para = para.substring(0,index1);
}
}
QueryWrapper<MetaRealEstateInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("real_estate_brief_address",para);
@ -340,11 +368,16 @@ public class BigScreenController extends BaseController {
int a = realEstateInfoService.count(queryWrapper);
List<MetaRealEstateInfo> list = realEstateInfoService.list(queryWrapper);
int spCount = 0;
int kzCount = 0;
for (MetaRealEstateInfo metaRealEstateInfo : list){
int index1 = metaRealEstateInfo.getRealEstateAddress().indexOf("商铺");
if (index1 != -1){
spCount++;
}
Integer count = actualUserInfoService.lambdaQuery().eq(MetaActualUserInfo::getHabitationAddress, metaRealEstateInfo.getRealEstateAddress()).count();
if (count == 0){
kzCount++;
}
}
int zzCount = a-spCount;
//todo 目前都是写死的
@ -359,7 +392,7 @@ public class BigScreenController extends BaseController {
buildInformationVo.setZzCount(StringKit.toString(zzCount));
buildInformationVo.setSpCount(StringKit.toString(spCount));
buildInformationVo.setSzlyCount("0");
buildInformationVo.setKzCount("0");
buildInformationVo.setKzCount(StringKit.toString(kzCount));
return AjaxResult.success(buildInformationVo);
} catch (Exception e) {
@ -372,13 +405,22 @@ public class BigScreenController extends BaseController {
@ApiOperation("楼栋信息:实有人口统计")
public AjaxResult buildRealActual(@ApiParam("楼栋地址") @RequestParam String para) {
try {
int index = para.indexOf("幢");
int index = para.lastIndexOf("幢");
String buildName = null;
if (index != -1 && index > 0 ){
buildName = String.valueOf(para.charAt(index-1));
para = para.substring(0,index - 1);
if (index != -1) {
for (int i = index - 1; i >= 0; i--) { // 从特定字符位置-1开始向前遍历
if (Pattern.matches("\\d", String.valueOf(para.charAt(i)))) {// 检查字符是否为数字
buildName = para.substring(i,index);// 返回有数字的字符串
}
if (!Pattern.matches("\\d", String.valueOf(para.charAt(i)))){
break;
}
}
int index1 = para.lastIndexOf(buildName);
if (index1 != -1 ){
para = para.substring(0,index1);
}
}
// 创建查询条件,使用模糊查询
QueryWrapper<MetaRealEstateInfo> queryWrapperEstate = new QueryWrapper<>();
// queryWrapperEstate.like("real_estate_address", para); // 你需要替换成实际的模糊查询条件
@ -407,12 +449,15 @@ public class BigScreenController extends BaseController {
//人户一致 101
//流动人口 102
//人在户不在 124
//户在人不在 201
int actualType = 101;
List<MetaActualUserInfo> rhyzCount = filterListByType(lists, actualType);
actualType = 102;
List<MetaActualUserInfo> ldrkCount = filterListByType(lists, actualType);
actualType = 101;
actualType = 124;
List<MetaActualUserInfo> rzhbzCount = filterListByType(lists, actualType);
actualType = 201;
List<MetaActualUserInfo> hzrbzCount = filterListByType(lists, actualType);
//todo 重点人需要关联表
@ -420,7 +465,7 @@ public class BigScreenController extends BaseController {
actualVo.setCount(StringKit.toString(lists.size()));
actualVo.setRhyzCount(StringKit.toString(rhyzCount.size()));
actualVo.setRhbyzCount(StringKit.toString(rzhbzCount.size()));
actualVo.setHzrbzCount("0");
actualVo.setHzrbzCount(StringKit.toString(hzrbzCount.size()));
actualVo.setJwryCount("0");
actualVo.setZdryCount("0");
actualVo.setGaryCount("0");
@ -451,11 +496,21 @@ public class BigScreenController extends BaseController {
try {
//获取到房屋数据的实际地址
// para = para.substring(0, para.indexOf("号"));
int index = para.indexOf("幢");
int index = para.lastIndexOf("幢");
String buildName = null;
if (index != -1 && index > 0 ){
buildName = String.valueOf(para.charAt(index-1));
para = para.substring(0,index - 1);
if (index != -1) {
for (int i = index - 1; i >= 0; i--) { // 从特定字符位置-1开始向前遍历
if (Pattern.matches("\\d", String.valueOf(para.charAt(i)))) {// 检查字符是否为数字
buildName = para.substring(i,index);// 返回有数字的字符串
}
if (!Pattern.matches("\\d", String.valueOf(para.charAt(i)))){
break;
}
}
int index1 = para.lastIndexOf(buildName);
if (index1 != -1 ){
para = para.substring(0,index1);
}
}
QueryWrapper<MetaRealEstateInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("real_estate_brief_address", para);
@ -485,6 +540,10 @@ public class BigScreenController extends BaseController {
Map<String, String> entryMap = new HashMap<>();
entryMap.put("homeName", info.getHomeName());
entryMap.put("address", info.getRealEstateAddress());
Integer count = actualUserInfoService.lambdaQuery().eq(MetaActualUserInfo::getHabitationAddress, info.getRealEstateAddress()).count();
if (count == 0){
entryMap.put("type","空置");
}
return entryMap;
},
Collectors.toList()
@ -520,6 +579,9 @@ public class BigScreenController extends BaseController {
//网格 没有
homeInfoVo.setGrid("");
homeInfoVo.setType("住宅");
if (para.contains("商铺")){
homeInfoVo.setType("商铺");
}
QueryWrapper<MetaRentalHousingInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("rental_housing_address", para);
@ -610,4 +672,5 @@ public class BigScreenController extends BaseController {
}
}

Loading…
Cancel
Save