From 8633a2b667c8ab70f4bc32ec7a10c7bf946e6de9 Mon Sep 17 00:00:00 2001 From: hanrenchun Date: Tue, 23 Jan 2024 11:15:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E6=9C=89=E6=88=BF=E5=B1=8B=E4=BB=A3?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../task/SydzToEstateInfoTask.java | 108 +++++++++--------- .../resources/mapper/VSySydzMysqlMapper.xml | 2 +- 2 files changed, 54 insertions(+), 56 deletions(-) diff --git a/src/main/java/com/ssf/mysqloracletest/task/SydzToEstateInfoTask.java b/src/main/java/com/ssf/mysqloracletest/task/SydzToEstateInfoTask.java index 1414a3c..c2382eb 100644 --- a/src/main/java/com/ssf/mysqloracletest/task/SydzToEstateInfoTask.java +++ b/src/main/java/com/ssf/mysqloracletest/task/SydzToEstateInfoTask.java @@ -50,23 +50,23 @@ public class SydzToEstateInfoTask { try { List sydzs = sydzMysqlService.selectVSySydz(new VSySydzMysql()); - CountDownLatch latch = new CountDownLatch(sydzs.size()); - ExecutorService jwtSyfwPool = Executors.newFixedThreadPool(50); +// CountDownLatch latch = new CountDownLatch(sydzs.size()); +// ExecutorService jwtSyfwPool = Executors.newFixedThreadPool(50); for (VSySydzMysql bean : sydzs) { - jwtSyfwPool.submit(() -> { +// jwtSyfwPool.submit(() -> { cleanJwtSyfw(bean); - latch.countDown(); - }); +// latch.countDown(); +// }); } - try { - // Wait for all threads to complete - latch.await(); - } catch (InterruptedException e) { - e.printStackTrace(); - } - // 关闭线程池 - jwtSyfwPool.shutdown(); +// try { +// // Wait for all threads to complete +// latch.await(); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } +// // 关闭线程池 +// jwtSyfwPool.shutdown(); } catch (Exception e) { logger.info(StringKit.getTrace(e)); } @@ -78,62 +78,60 @@ public class SydzToEstateInfoTask { try { BeanUtils.copyProperties(bean, beanCp); - - String dzdxtymc = StringKit.toString(beanCp.getDZDXTYMC()); - dzdxtymc = StringKit.convertChineseUnitToDigit(dzdxtymc); +// String dzdxtymc = StringKit.toString(beanCp.getDZDXTYMC()); +// dzdxtymc = StringKit.convertChineseUnitToDigit(dzdxtymc); // dzdxtymc = dzdxtymc.replaceAll("号","幢"); - String home = ""; - try { - home = StringKit.extractDigits(dzdxtymc.substring(0, dzdxtymc.indexOf("室"))); - } catch (Exception e) { - home = ""; - } + String home = "1"; +// try { +// home = StringKit.extractDigits(dzdxtymc.substring(0, dzdxtymc.indexOf("室"))); +// } catch (Exception e) { +// home = "1"; +// } String unit = "1"; - try { - unit = StringKit.extractDigits(dzdxtymc.substring(0, dzdxtymc.indexOf("单元"))); - } catch (Exception e) { - unit = "1"; - } - String build = ""; - try { - build = StringKit.extractDigits(dzdxtymc.substring(0, dzdxtymc.indexOf("幢"))); - } catch (Exception e) { - build = ""; - } - - - String address = ""; - try { - int index = dzdxtymc.indexOf("号"); - if (index != -1) { - address = dzdxtymc.substring(0, index); - } - } catch (Exception e) { - logger.info("小区地址未匹配到请求中户籍地址:" + build); - } - - - if ("".equals(home) || "".equals(unit) || "".equals(address)){ - beanCp.setStatus("2"); - sydzMysqlService.updateVSySydzById(beanCp); - return; - } +// try { +// unit = StringKit.extractDigits(dzdxtymc.substring(0, dzdxtymc.indexOf("单元"))); +// } catch (Exception e) { +// unit = "1"; +// } + String build = "1"; +// try { +// build = StringKit.extractDigits(dzdxtymc.substring(0, dzdxtymc.indexOf("幢"))); +// } catch (Exception e) { +// build = "1"; +// } + + +// String address = ""; +// try { +// int index = dzdxtymc.indexOf("号"); +// if (index != -1) { +// address = dzdxtymc.substring(0, index); +// } +// } catch (Exception e) { +// logger.info("小区地址未匹配到请求中户籍地址:" + build); +// } + + +// if ("".equals(home) || "".equals(unit) || "".equals(address)){ +// beanCp.setStatus("2"); +// sydzMysqlService.updateVSySydzById(beanCp); +// return; +// } MetaRealEstateInfo realEstateInfo = new MetaRealEstateInfo(); // realEstateInfo.setHomeId(); realEstateInfo.setPoliceStationCode(StringKit.toString(bean.getZRQDM())); realEstateInfo.setPoliceDistrictCode(StringKit.toString(bean.getZRQDM())); - realEstateInfo.setRealEstateBriefAddress(address + "号"); + realEstateInfo.setRealEstateBriefAddress(StringKit.toString(StringKit.convertChineseUnitToDigit(beanCp.getDZDXTYMC()))); realEstateInfo.setRealEstateAddress(StringKit.toString(StringKit.convertChineseUnitToDigit(beanCp.getDZDXTYMC()))); realEstateInfo.setUnitName(unit); realEstateInfo.setBuildingName(build); realEstateInfo.setHomeName(home); realEstateInfo.setLongitude(NumKit.checkDouble(bean.getJDZB())); realEstateInfo.setLatitude(NumKit.checkDouble(bean.getCJSJ())); - boolean b = estateInfoService.save(realEstateInfo); - - if (b) { + boolean save = estateInfoService.save(realEstateInfo); + if (save) { beanCp.setStatus("1"); sydzMysqlService.updateVSySydzById(beanCp); } diff --git a/src/main/resources/mapper/VSySydzMysqlMapper.xml b/src/main/resources/mapper/VSySydzMysqlMapper.xml index 62c021e..a820c09 100644 --- a/src/main/resources/mapper/VSySydzMysqlMapper.xml +++ b/src/main/resources/mapper/VSySydzMysqlMapper.xml @@ -22,7 +22,7 @@