From bbc2a449d39565f35dfdceb8d922541ced18bf66 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Sat, 13 Mar 2021 23:04:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=85=B1=E8=BD=AC=E6=8D=A2=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fangjia/script/gj/ccb/CcbCodeUtils.groovy | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/ccb/CcbCodeUtils.groovy diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/ccb/CcbCodeUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/ccb/CcbCodeUtils.groovy new file mode 100644 index 000000000..72117edad --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/ccb/CcbCodeUtils.groovy @@ -0,0 +1,150 @@ +package com.fangjia.script.gj.ccb + +import com.fangjia.core.util.DataUtil + +import java.util.regex.Pattern + +class CcbCodeUtils { + + + + static def parseBuildYear(String buildDate) { + if(buildDate){ + String years = DataUtil.match(buildDate, Pattern.compile("\\d{4}")) + if(years){ + return years.toInteger() + } + } + return null; + } + + //权属 产权:11 购房合同:12 集体产权:13 预定:14 经济适用房:15 拆迁补偿:16 产权抵押中:17 使用权:21 直管房:22 自管房:23 公产:24 公租房:25 廉租房:26 限价房:27 房改房:28 自建房:29 标准价房改:18 已购公房:19 小产权:20 其他:99 + static def parseHouseProperty(String houseProperty){ + if(houseProperty){ + if(houseProperty.contains("集体所有房产")){ + return 13; + }else{ + return 99 + } + } + return null + } + + //产权年限40:01 50:02 70:03 + static def parseHousePropertyYear(def propertyLife){ + if(propertyLife){ + if(propertyLife.contains("70")){ + return "03" + }else if(propertyLife.contains("50")){ + return "02" + }else if(propertyLife.contains("40")){ + return "01" + } + + } + return null + } + + // 建筑类型 //高层塔楼:0101 高层板楼:0102 小高层板楼:0103 多层板楼:0104 独栋别墅:0105 联排别墅:0106 叠拼别墅:0107 其他建筑形式:0199 + static def parseHouseEstateType(def buildType){ + if(buildType){ + return "0199" + } + return null + } + + + //朝向 南北通透:0301 东南:0302 南:0303 东西通透:0304 东:0305 西南:0306 西:0307 北:0308 东北:0309 西北:0310 其他朝向:0399 + static def getDirectionCode(def direction){ + if(direction){ + if(direction.contains("南北")){ + return "0301" + }else if(direction.contains("东南")){ + return "0302" + }else if(direction.contains("南")){ + return "0303" + }else if(direction.contains("东西")){ + return "0304" + }else if(direction.contains("东")){ + return "0305" + }else if(direction.contains("西南")){ + return "0306" + }else if(direction.contains("西")){ + return "0307" + }else if(direction.contains("东北")){ + return "0309" + }else if(direction.contains("西北")){ + return "0310" + }else if(direction.contains("北")){ + return "0308" + } + return "0399" + } + return null; + } + + + //装修 毛坯房:0601 简装修:0602 精装修:0603 + static def getFitmentCode(def fitmentStr){ + if(fitmentStr){ + if(fitmentStr.contains("毛坯")){ + return "0601" + }else if(fitmentStr.contains("简装")){ + return "0602" + }else if(fitmentStr.contains("精装")||fitmentStr.contains("豪装")){ + return "0603" + } + } + return null; + } + + //户型 非成套一室户:01 非成套二室户:02 非成套三室户:03 旧式里弄房一房:04 旧式里弄房二房:05 旧式里弄房三房:06 花园洋房:07 + //一室一厅:08 二室一厅:09 三室一厅:10 四室一厅:11 二室二厅:12 三室二厅:13 四室二厅:14 复式结构:15 别墅:16 其他:99 + static def getHouseTypeCode(def estate_type, def room, def hall){ + + if(estate_type && estate_type.contains("别墅")){ + return "16" + }else{ + if(room && hall){ + if(room==1 && hall==1){ + return "08" + }else if(room==2 && hall==1){ + return "09" + }else if(room==3 && hall==1){ + return "10" + }else if(room==4 && hall==1){ + return "11" + }else if(room==2 && hall==2){ + return "12" + }else if(room==3 && hall==2){ + return "13" + }else if(room==4 && hall==2){ + return "14" + } + return "99" + } + } + return null + } + + //钢混结构:1 砖混结构:2 钢结构:3 框架结构:4 框架剪力墙结构:5 剪力墙结构:6 筒体结构:7 框架筒体结构:8 筒中筒:9 砖木结构:10 其他:11 + //建筑结构 + static def getBuildStructureCode(def buildStructure){ + if(buildStructure){ + if(buildStructure.contains("钢结构")){ + return 3; + }else if(buildStructure.contains("钢筋混凝土结构")){ + return 1; + }else if(buildStructure.contains("砖木结构")){ + return 10; + } + return 11; + } + return null; + } + //室内结构 + //平层:11 错层:12 复式:13 阁楼:14 团结户:15 老式房:16 地下室:17 带阁楼:21 带车库:22 其他:99 跃层:18 带地下室:24 带储藏室:25 带车位:23 + static def getHouseStructureCode(){ + return null + } +}