{o_Uf|dh
zzmTC0s9TEj2x9?zBX1KUAD(S7^H^@(ue=54Ddo@lmMo&~OH`f7+qJwe^*>?pD^Ft?
zxYSpbfmeJUsH|bz_dZrpCp^}4e2bIg6LWG2=T7EpdQZh{KtF*t#kJ#p<97Eqg4uuGBChlKq7#u
z-=i#-dv9-|gvL`fGQw@yO=(~*=aqotivm0-~Anh
zWg3=HzujMPjuq|1Z>Hzob8Y;ZUzL&*+(xdY_Y=IklmxR8ui)JDY|~J|a3=Fd>|?!Y
zWeW0ID;Zp36{}p-QQdn5&qunivUzO69r}%oOkgco&2T@V`%&CK{&l?e?pvJR&Eq@!
z7WQEql~K`iz@^{{uM3tn7Ds0GmhDum7R^1#MOE_dzSaMsCnEpy+VUG}T|isV@weaTVqtkJ#hp&|*erq90RPlIf_w
zE!?JPJNFmkEqJl_#C%oc<%`81UK{z0@3=1hn$AZUd-ff@711uBo_qiDehzm;$180$
zehq#%tbbL>F|;pP=|kH27NW+xytiW1RA3F(8>K~7Lu1dzKFt0R`w9EKku!6$$6}A?
zfOj{`f9za6?4Dr7*H(n`BPR`dI--7v-@|$gx54V1hHp&%;Ivu3W~)K0bx&D!#y&E3
zMJ-L>7R24)e2}TwFRoN&tOoJDwITkBRK2f(VSWi^!*^jA>lge|(
z{T}+#@7oMS1x2Mq6@2K6lgppki#hG;8^ha)+=1L<_040I)z3=CX0*-u$LS_^wqI5o
z+3%X~U>5aUcHPkaA&c=1-^=$I#!)S6`RPKdVS1&vpdGpkFiRp0MeK=P7q?2m5Bt6d
z-(p{g&|$GQ68RZu?XsL#v}0ZAyT=!C;8$aNPTdclHL8}@sDaVgL%TS|dYjZL#zrP$UFyM#wfoesDB@g>W3A2M8vElB4zXi|XN^Ui_ukpWZ0Fn$`pz)#
zLMUMtC)y^9*eCap%2dW06Q{E#27j2xdK9y94?oTY0mn$v)0uu_MIJAFEalTC7^nIK|ob$><77M-F?gIIBjLO)?d+
O_6CpmkFZbwx&8+h3kqxi
literal 0
HcmV?d00001
diff --git a/projects/fangjia-bkoff/src/main/webapp/style/theme.css.baiduyun.uploading.cfg b/projects/fangjia-bkoff/src/main/webapp/style/theme.css.baiduyun.uploading.cfg
new file mode 100644
index 0000000000000000000000000000000000000000..0c2959a189fbb34962c4435e33a0b7b4d772ef0c
GIT binary patch
literal 3472
zcmXBX$yPE;5Cq^_^C~Vx@K;>QBp^4Qg-P5P(?yAhl$jI!f<|!Sd
z(=<+Z=`|gt!*rhh(meg9YI-pKon9RGsg-WhS9(elmaTM|Zqu6eqvu_EPK$Jsx<S>wYpe@orPcs(xA{?cH$Wu0b&u6R`P{zjQ
zX^?(!y3cc0sg_o3s(x2&T4@jG$JFLAVbPS$V;ah;&3}Q{Q5uO*`$=6K
z?ueX5tnZ<2WV&3BxhwFVLgjRW|4H+J|(amQ8-IY#yjP
z#bV;=na7*)HrD%DpGSVL;x!Av
zI26B>QOB}diE{;G3424gnVA>YzL-TUw|-AO1?Pp#d&X8QqVJDn^^a~fy0461WAQ_$
z2?b7!H7Ib0&xI_T*p56;bkqTlPkGG6+2a#6If2umeADQmnCH+Bpe=BH^n2z!gn8q9
z$kpy=1{?N!yhfSrI_FsQRLN?e()5|#0@6h8f9?yp_FdhwP|=1A$`lyqw`Y{Q|D12z
z$b^P#(OWFWVh&sv>bLJ&Y
z{N8tDU6sQM>fG-g&at8$INywPT|dp&_%&p5fZMZU<@o^bflPwgGq2!$>Dre=9m6;8
zc7c7YH#a$hqPsN(S6Ia=7k$+BT*vcD-lx#UFh=G_Fi&{h(zFX}C*C2eYc?xh`;=(Q
zYpSDq&XE{**)}?(ZsZS_sO6y^tBBiVQGnGFBi@UioQG`7Y)gLUFkY}2seUheUAd1H
zyRD*M&Z7BPFaLPoWfe-eykj)eI~{0U9woZJvmNTGDjl|1{bCfW>@?S>jKj#xEj~M*
zU-0HM?nD1z^W%P`jtzOonsRQwEQ@RLH{vWERp(SjEAe8*4-T=WMfdL@bY%Q1;@E7w
zZB_m)ow$`plQOZl{ogY$=3@=4$~o#)%N#yjzo2(vox(iBx2)a|bRV-{$fyW!-}x%W
zFUuy&c*95Tn&L007dy>@RaB*9v<)?Oj*(~;yuQS}H2&?ZWrc<~^vqq!sDSf~?S1
zHsbVh?{sN85Fz%LU+1w%eSWbEenb8hvxaZYF=e~Ms70l+@j2@?oPyt}NU^@p#gF~5
zgIiO)HuNLeS7rQ@0kO|Acr)t*Aq+E3xNX!TR$)H?!q8-`FGDW-eqB`}T*tAH|D0
zE+DLB`-e%}-42`BPva}1&-MrUCXYmYLY-I{->vY90dkP)S;a__`g;+Kh-$-9(*129w&+#SDkn0x83*UId
z_l*9rkN&*MYE>Y_8ulRbA-3-rM6bmCGwxBpjghI08c-{af%!9xyCNLBD`WD6|AcLm
z?E}l`z&h1N_%u}{GM@3+>YjHN_xUaO|I6ze!&f@|KnlbjP951t?|_ePA^)z>0K%ukrV7=1u3L3uG=rBt1N5kebQd}~~qd7{ITSLE5$eP^)7qJ8)s
z$~AVg0`3ni>a>ZkiTLu2-ih@zz8pqb%d(h96pnA3=z|Wt_|Fr&SR48buXrzF$B$io
s39DkRY39IKC1(&yHpSlI6yJ;;vEvK$OwaZC$G261s?jkk^;nAWA0pgA00000
literal 0
HcmV?d00001
diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AaController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AaController.java
index d83085e01..ce11d95e3 100644
--- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AaController.java
+++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AaController.java
@@ -22,16 +22,16 @@ public class AaController {
private AddressModeParserChain addressModeParserChain;
public Object pickAction() throws Exception {
- File file = new File("C:\\Users\\yk\\Desktop\\yongjia\\test\\ÉϺ£-0730.txt");
- File file2 = new File("C:\\Users\\yk\\Desktop\\yongjia\\test\\ÉϺ£-0730_picker.txt");
+ File file = new File("C:\\Users\\yk\\Desktop\\yongjia\\test\\上海-0730.txt");
+ File file2 = new File("C:\\Users\\yk\\Desktop\\yongjia\\test\\上海-0730_picker.txt");
if (file2.exists()) {
file2.delete();
}
- BufferedWriter fw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file2, true), "GBK")); // Ö¸¶¨±àÂë¸ñʽ£¬ÒÔÃâ¶ÁȡʱÖÐÎÄ×Ö·ûÒì³£
+ BufferedWriter fw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file2, true), "GBK")); // 指定编ç �æ ¼å¼�,以å…�读å�–æ—¶ä¸æ–‡å—符异常
- // È«²¿Ð´È뻺´æÖеÄÄÚÈÝ
+ // 全部写入缓å˜ä¸çš„内容
- InputStreamReader read = new InputStreamReader(new FileInputStream(file), "utf-8");// ¿¼Âǵ½±àÂë¸ñʽ
+ InputStreamReader read = new InputStreamReader(new FileInputStream(file), "utf-8");// 考虑到编ç �æ ¼å¼�
BufferedReader bufferedReader = new BufferedReader(read);
String lineTxt = null;
while ((lineTxt = bufferedReader.readLine()) != null) {
@@ -42,7 +42,7 @@ public class AaController {
List tokens = CnAddressTokenizer.tokenizer(lineTxt);
addressPickerChain.doPick(tokens, ret);
- // parserChain.doParse("ÉϺ£", lineTxt, ret);
+ // parserChain.doParse("上海", lineTxt, ret);
ret.remove(AddressAnalyseResultKeyEnum.orgAddress.name());
// ret.remove(AddressAnalyseResultKeyEnum.shortAddress.name());
@@ -64,16 +64,16 @@ public class AaController {
}
public Object parseAction() throws Exception {
- File file = new File("C:\\Users\\yk\\Desktop\\yongjia\\test\\ÉϺ£-0730.txt");
- File file2 = new File("C:\\Users\\yk\\Desktop\\yongjia\\test\\ÉϺ£-0730_parser.txt");
+ File file = new File("C:\\Users\\yk\\Desktop\\yongjia\\test\\上海-0730.txt");
+ File file2 = new File("C:\\Users\\yk\\Desktop\\yongjia\\test\\上海-0730_parser.txt");
if (file2.exists()) {
file2.delete();
}
- BufferedWriter fw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file2, true), "GBK")); // Ö¸¶¨±àÂë¸ñʽ£¬ÒÔÃâ¶ÁȡʱÖÐÎÄ×Ö·ûÒì³£
+ BufferedWriter fw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file2, true), "GBK")); // 指定编ç �æ ¼å¼�,以å…�读å�–æ—¶ä¸æ–‡å—符异常
- // È«²¿Ð´È뻺´æÖеÄÄÚÈÝ
+ // 全部写入缓å˜ä¸çš„内容
- InputStreamReader read = new InputStreamReader(new FileInputStream(file), "utf-8");// ¿¼Âǵ½±àÂë¸ñʽ
+ InputStreamReader read = new InputStreamReader(new FileInputStream(file), "utf-8");// 考虑到编ç �æ ¼å¼�
BufferedReader bufferedReader = new BufferedReader(read);
String lineTxt = null;
while ((lineTxt = bufferedReader.readLine()) != null) {
@@ -81,7 +81,7 @@ public class AaController {
ret.put(AddressAnalyseResultKeyEnum.orgAddress.name(), lineTxt);
System.out.println(lineTxt);
- addressModeParserChain.doParse("ÉϺ£", lineTxt, ret);
+ addressModeParserChain.doParse("上海", lineTxt, ret);
ret.remove(AddressAnalyseResultKeyEnum.orgAddress.name());
ret.remove(AddressAnalyseResultKeyEnum.shortAddress.name());
diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/ComprehensiveQueryController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/ComprehensiveQueryController.java
new file mode 100644
index 000000000..710ced096
--- /dev/null
+++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/ComprehensiveQueryController.java
@@ -0,0 +1,1316 @@
+package com.fangjia.open.controllers;
+
+import com.fangjia.core.util.*;
+import com.fangjia.dal.common.DistrictKey;
+import com.fangjia.dal.mongo.fangjia.model.ServerArea;
+import com.fangjia.dal.mongo.model.ApiUserCfg;
+import com.fangjia.dal.mongo.model.DistrictFacilitys;
+import com.fangjia.dal.mongo.model.Evaluation;
+import com.fangjia.dal.mongo.model.FangjiaOfficialAreaMap;
+import com.fangjia.dal.mongo.model.bkoff.Loudong;
+import com.fangjia.dal.mongo.open.model.ApiUserAuthority;
+import com.fangjia.dal.mongo.open.model.EvaluateRatio;
+import com.fangjia.dal.seaweed.model.District;
+import com.fangjia.open.HttpCode;
+import com.fangjia.open.OpenHttpCodeEnum;
+import com.fangjia.open.dto.HouseValueInformationDto;
+import com.fangjia.open.dto.UniversalDto;
+import com.fangjia.open.dto.addressGovernance.MatchedBuildingDto;
+import com.fangjia.open.interceptors.AuthenticationBean;
+import com.fangjia.open.interceptors.Authority;
+import com.fangjia.open.interceptors.Role;
+import com.fangjia.open.model.*;
+import com.fangjia.open.util.CommonDtoUtils;
+import com.fangjia.open.util.CommonUtils;
+import com.fangjia.open.ws.query.SampleQuery;
+import com.fangjia.service.api.AddressMatchProxyService;
+import com.fangjia.service.api.ApiUserCfgService;
+import com.fangjia.service.bo.Collateral;
+import com.fangjia.service.bo.DistrictStatBo;
+import com.fangjia.service.bo.Sample;
+import com.fangjia.service.datastore.*;
+import com.fangjia.service.datastore.bean.CollateralSampleQueryBean;
+import com.fangjia.service.district.*;
+import com.fangjia.service.mongo.bkoff.HouseLoudongService;
+import com.fangjia.service.mongo.bkoff.LoudongService;
+import com.fangjia.service.mongo.fangjia.*;
+import com.fangjia.service.open.*;
+import com.fangjia.service.tool.OpenLogService;
+import com.fangjia.service.web.AddressService;
+import net.sf.json.JSONObject;
+import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.time.DateUtils;
+import org.slf4j.Logger;
+import org.sothis.web.mvc.ActionContext;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.ParseException;
+import java.util.*;
+
+import static com.poseidon.util.TypeConverter.convertToString;
+
+/**
+ * @author 13607
+ * @since 2023/12/12 10:29
+ */
+@Authority(role = Role.USER)
+public class ComprehensiveQueryController {
+ private DistrictService districtService;
+
+ private DistrictStatService districtStatService;
+
+ private FangjiaOfficialAreaService fangjiaOfficialAreaService;
+ private AddressMatchProxyService addressMatchProxyService;
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(PropertyController.class);
+ private HouseLoudongService houseLoudongService;
+ private LoudongService loudongService;
+ private EvaluationService evaluationService;
+ private BatchEvaluateService batchEvaluateService;
+ private ApiUserAuthorityService apiUserAuthorityService;
+ private AverageStatisticsService averageStatisticsService;
+ private ServerAreaService serverAreaService;
+ private ApiUserCfgService apiUserCfgService;
+ private OpenApiLogService openApiLogService;
+ private EvaluateFactorService evaluateFactorService;
+
+ private CzbankSampleService czbankSampleService;
+
+ private DistrictFacilitysService districtFacilitysService;
+
+ private static final int DEFAULT_PAGE_SIZE = 20;
+ private static final String[] PROPERTY_SEARCH_API_FIELDS = {"address", "city", "region", "name", "lat2", "lng2", "lat", "lng", "block", "estateType2", "addrAlias"};
+ static final int BAI_DU_GEO = 1;// °Ù¶ÈÏµ×ø±ê
+ static final int GAO_DE_GEO = 2;// ¸ßµÂÏµ×ø±ê
+
+
+
+ private EvaluateRatioService evaluateRatioService;
+
+ private static final int EVALUATE_SHOW_DETAIL = 1;
+ private static final Map PROPERTY_TYPES = new HashMap() {
+ {
+ put(null, "ÆÕͨסլ");
+ put("0", "ÆÕͨסլ");
+ put("1", "±ðÊû");
+ put("2", "ÉÌס");
+ }
+ };
+
+ private static final Map DIRECTION = new HashMap() {
+ {
+ put(null, "ÄÏ");
+ put("1", "Î÷ÄÏ");
+ put("2", "¶«ÄÏ");
+ put("3", "ÄÏ");
+ put("4", "Î÷±±");
+ put("5", "¶«±±");
+ put("6", "¶«");
+ put("7", "Î÷");
+ put("8", "±±");
+ put("9", "¶«Î÷");
+ put("10", "Äϱ±");
+ }
+ };
+
+ private static final Map FITMENT = new HashMap() {
+ {
+ put(null, "¼ò×°");
+ put("1", "ëÅ÷");
+ put("2", "¼ò×°");
+ put("3", "¾«×°");
+ put("4", "ºÀ×°");
+ }
+ };
+
+ private static final Map EVALUATION_MODEL_FITMENT = new HashMap() {
+ {
+ put(null, "¼òµ¥×°ÐÞ");
+ put("¼ò×°", "¼òµ¥×°ÐÞ");
+ put("ëÅ÷", "ëÅ÷");
+ put("¾«×°", "¾«×°ÐÞ");
+ put("ºÀ×°", "ºÀ»ª×°ÐÞ");
+ }
+ };
+
+ private static final Map SIGHT = new HashMap() {
+ {
+ put(null, "Ò»°ã");
+ put("1", "¾°¹Û·¿");
+ put("2", "²à¾°¹Û·¿");
+ put("3", "Ò»°ã");
+ put("4", "²î");
+ }
+ };
+
+ private static final Map NOISE = new HashMap() {
+ {
+ put(null, "ÎÞÔëÒô");
+ put("0", "ÎÞÔëÒô");
+ put("1", "ÔëÒô½ÏС");
+ put("2", "ÔëÒô´ó");
+ }
+ };
+ private static final Map FACILITIES = new HashMap() {
+ {
+ put("0", "½¡Éí·¿");
+ put("1", "ÓÎÓ¾³Ø");
+ put("2", "»áËù");
+ put("3", "ÍøÇò³¡");
+ put("4", "Çò³¡");
+ put("5", "ÆåÅÆÊÒ");
+ put("6", "Í£³µ³¡");
+ put("7", "ͼÊé¹Ý");
+ put("8", "»î¶¯ÖÐÐÄ");
+ }
+ };
+
+ private static final Map NEGATIVE_FACTOR = new HashMap() {
+ {
+ put(null, "ÎÞ");
+ put("1", "ºÜ½ü");
+ put("2", "½Ï½ü");
+ put("3", "ÎÞ");
+ }
+ };
+
+
+ Map listKeyMap = new HashMap() {
+ {
+ put("school", "schools");
+ put("hospital", "hospitals");
+ put("bank", "banks");
+ put("supermarket", "supermarkets");
+ put("market", "markets");
+ put("beautySalon", "beautySalons");
+ put("gym", "gyms");
+ put("park", "parks");
+ put("bus", "buses");
+ put("metro", "metros");
+ put("dock", "docks");
+ put("airport", "airports");
+ put("trainStation", "trainStations");
+ put("restaurant", "restaurants");
+ put("hotel", "hotels");
+ }
+ };
+
+ private static final Map CITYLEVEL_MAP = new HashMap() {
+ {
+ put("1000", "one");// Ò»Ïß
+ put("1500", "newOne");// ÐÂÒ»Ïß
+ put("2000", "two");// ¶þÏß
+ put("3000", "three");// ÈýÏß
+ put("4000", "four");// ËÄÏß
+ put("5000", "five");// ÎåÏß
+ }
+ };
+
+ public Object houseValueInformationAction(HouseInfomationModel model, HttpServletRequest httpServletRequest) {
+
+ // ÔÐ¡Çø¾ù¼Û
+ HouseValueInformationDto houseValueInformation = new HouseValueInformationDto();
+ RestfulModelAndView mav = new RestfulModelAndView();
+
+ if (StringUtils.isBlank(model.getAddress()) || StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(String.valueOf(model.getSize()))) {
+ mav.setModel(BasicModel.buildBadRequestModel("³ÇÊÐ(city),µØÖ·(address),Ãæ»ý(size)Ϊ±ØÌî×Ö¶Î"));
+ return mav;
+ }
+
+ HttpRequest httpRequest = new HttpRequest();
+ JSONObject json = null;
+ Map communityAvgPriceParams = new HashMap();
+ communityAvgPriceParams.put("city", model.getCity());
+ communityAvgPriceParams.put("address", model.getAddress());
+ communityAvgPriceParams.put("category", model.getCategory());
+ communityAvgPriceParams.put("useMap", String.valueOf(model.isUseMap()));
+ JSONObject matchResponse = null;
+ try {
+ matchResponse = httpRequest.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/v2/match", communityAvgPriceParams, "UTF-8");
+ } catch (HttpRequestException e) {
+
+ }
+ if(matchResponse == null || !matchResponse.containsKey("result") || !matchResponse.getJSONObject("result").containsKey("id")) {
+ mav.setModel(BasicModel.buildBadRequestModel("¸ÃµØÖ·²»Ö§³Ö¹À¼Û£¡"));
+ return mav;
+ }
+ String id = matchResponse.getJSONObject("result").getString("id");
+ District district = districtService.findById(id);
+ if (district == null) {
+ mav.setModel(BasicModel.buildBadRequestModel("¸ÃµØÖ·²»Ö§³Ö¹À¼Û£¡"));
+ return mav;
+ }
+
+ MatchedBuildingDto dto = CommonDtoUtils.transformV(MatchedBuildingDto.class, matchResponse.getJSONObject("result"));
+ DistrictStatBo statBo = districtStatService.findCurrentDistrictStat(new DistrictKey(district));
+ if (null != statBo) {
+ if (statBo.getDistrictStat() != null) {
+ dto.setAvgPrice(statBo.getDistrictStat().getAvgPrice());
+ } else if (statBo.getVillaDistrictStat() != null) {
+ dto.setAvgPrice(statBo.getVillaDistrictStat().getAvgPrice());
+ }
+
+ }
+ // ±£´æÐ¡Çø¾ù¼ÛµÄ·µ»Ø½á¹û
+ houseValueInformation.setCommunityAvgPrice(dto);
+
+ //Ô·¿ÎݼÛÖµÆÀ¹À
+ //¸ù¾Ýmodel¸øPropertyEvaluationModel¸³Öµ
+ PropertyEvaluationModel propertyEvaluationModel = createPropertyEvaluationModelFromHouseInfomationModel(model);
+ boolean villaFlag = DataUtil.isVilla(propertyEvaluationModel.getSize(), propertyEvaluationModel.getName(), propertyEvaluationModel.getHeight(), propertyEvaluationModel.getRoom());
+ String propertyType = district.getEstateType2();
+ if (villaFlag && StringUtils.isNotBlank(propertyType) && !propertyType.equals("±ðÊû")) {
+ District bieShuDistrict = districtService.findByNameAndAlias(district.getCity(), district.getRegion(), district.getName() + "±ðÊû", "district");
+ if (bieShuDistrict != null) {
+ district = bieShuDistrict;
+ }
+ }
+ propertyEvaluationModel.setDistrict(district.getRegion());
+ propertyEvaluationModel.setName(district.getName());
+ try {
+ evaluateAction(propertyEvaluationModel, httpServletRequest, houseValueInformation, mav);
+ } catch (IllegalAccessException e) {
+
+ }
+// houseValueInformation.setAddressValue(modelAndView);
+
+ //·¿Ô´Ñù±¾
+
+ //¹¹ÔìsampleQuery¶ÔÏó
+ SampleQuery sampleQuery = new SampleQuery();
+ sampleQuery.setCity(model.getCity());
+ sampleQuery.setStrctureArea(model.getSize());
+ sampleQuery.setAddress(model.getAddress());
+
+// RestfulModelAndView houseCaseMav = new RestfulModelAndView();
+ List querys = null;
+ try {
+ querys = convertSampileQueryToBean(district,sampleQuery);
+ } catch (Exception e) {
+ mav.setModel(BasicModel.buildBadRequestModel(e.getMessage()));
+ return mav;
+ }
+ if (null == sampleQuery.getMax()) {
+ sampleQuery.setMax(10);
+ }
+ // ´Ë´¦Âý
+ long start = System.currentTimeMillis();
+ List collaterals = czbankSampleService.findSample2(querys, sampleQuery.getMax());
+ long end = System.currentTimeMillis();
+ System.out.println("ÓÃʱ:"+(end-start));
+ Collateral collateral = collaterals.get(0);
+ List samples = collateral.getSample();
+ UniversalDto houseCaseDto = UniversalDto.newDto();
+ if (null != collateral.getMaxPrice()) {
+ houseCaseDto.append("maxUnitPrice", collateral.getMaxPrice());
+ }
+ if (null != collateral.getMinPrice()) {
+ houseCaseDto.append("minUnitPrice", collateral.getMinPrice());
+ }
+ houseCaseDto.append("datas", samples);
+// if(samples!= null && samples.size()>=2){
+// Sample minSample = samples.get(samples.size()-2);
+// Sample maxSample = samples.get(samples.size()-1);
+// dto.append("minUnitPrice", minSample.getUnitPrice());
+// dto.append("maxUnitPrice", maxSample.getUnitPrice());
+// }
+// if(samples.size()>2){
+// dto.append("datas", samples.subList(0, samples.size()-2));
+// }else{
+// dto.append("datas", samples);
+// }
+
+// houseCaseMav.setModel(BasicModel.buildOKModel().setResult(dto));
+// return houseCaseMav;
+
+ //½«·¿Ô´Êý¾Ý·Åµ½½á¹û¼¯
+ houseValueInformation.setHouseCase(houseCaseDto);
+
+ // ÔÖܱßPOI
+ DistrictFacilitys facilitys = districtFacilitysService.findByDistrict(district);
+ // ½«ÖܱßPOIÊý¾Ý·Åµ½½á¹û¼¯
+ houseValueInformation.setSurroundingPoi(facilitys);
+ mav.setModel(BasicModel.buildOKModel().setResult(houseValueInformation));
+ return mav;
+ }
+
+ private PropertyEvaluationModel createPropertyEvaluationModelFromHouseInfomationModel(HouseInfomationModel model) {
+ PropertyEvaluationModel propertyModel = new PropertyEvaluationModel();
+ propertyModel.setCity(model.getCity());
+ propertyModel.setAddress(model.getAddress());
+ propertyModel.setSize(model.getSize());
+
+ if (StringUtils.isNotBlank(model.getDistrict())) {
+ propertyModel.setDistrict(model.getDistrict());
+ }
+ if (StringUtils.isNotBlank(model.getName())) {
+ propertyModel.setName(model.getName());
+ }
+ if (StringUtils.isNotBlank(model.getBuildingNumber())) {
+ propertyModel.setBuildingNumber(model.getBuildingNumber());
+ }
+ if (StringUtils.isNotBlank(model.getUnitNumber())) {
+ propertyModel.setUnitNumber(model.getUnitNumber());
+ }
+ if (model.getFloor() != null && model.getFloor() != 0) {
+ propertyModel.setFloor(model.getFloor());
+ }
+ if (model.getMaxFloor() != null && model.getMaxFloor() != 0) {
+ propertyModel.setMaxFloor(model.getMaxFloor());
+ }
+ if (model.getRoom() != null && model.getRoom() != 0) {
+ propertyModel.setRoom(model.getRoom());
+ }
+ if (model.getHall() != 0) {
+ propertyModel.setHall(model.getHall());
+ }
+ if (model.getToilet() != 0) {
+ propertyModel.setToilet(model.getToilet());
+ }
+ if (model.getCalDate() != null) {
+ propertyModel.setCalDate(model.getCalDate());
+ }
+ if (model.getPropertyType() != null) {
+ propertyModel.setPropertyType(model.getPropertyType());
+ }
+ if (StringUtils.isNotBlank(model.getDirection())) {
+ propertyModel.setDirection(model.getDirection());
+ }
+ if (StringUtils.isNotBlank(model.getDecoration())) {
+ propertyModel.setDecoration(model.getDecoration());
+ }
+
+ if (model.getDecorationCost() != null && model.getDecorationCost() != 0) {
+ propertyModel.setDecorationCost(model.getDecorationCost());
+ }
+
+ if (model.getDecorationAge() != 0) {
+ propertyModel.setDecorationAge(model.getDecorationAge());
+ }
+ if (StringUtils.isNotBlank(model.getView())) {
+ propertyModel.setView(model.getView());
+ }
+ if (StringUtils.isNotBlank(model.getNoise())) {
+ propertyModel.setNoise(model.getNoise());
+ }
+ if (model.getGardenSize() != null && model.getGardenSize() != 0) {
+ propertyModel.setGardenSize(model.getGardenSize());
+ }
+ if (model.getBasementSize() != null && model.getBasementSize() != 0) {
+ propertyModel.setBasementSize(model.getBasementSize());
+ }
+ if (model.getOuterSize() != null && model.getOuterSize() != 0) {
+ propertyModel.setOuterSize(model.getOuterSize());
+ }
+ if (model.getAtticSize() != null && model.getAtticSize() != 0) {
+ propertyModel.setAtticSize(model.getAtticSize());
+ }
+ if (StringUtils.isNotBlank(model.getNegativeFactor())) {
+ propertyModel.setNegativeFactor(model.getNegativeFactor());
+ }
+ if (model.getAge() != 0) {
+ propertyModel.setAge(model.getAge());
+ }
+ if (model.getCarportPrice() != null && model.getCarportPrice() != 0) {
+ propertyModel.setCarportPrice(model.getCarportPrice());
+ }
+
+ if (StringUtils.isNotBlank(model.getFacilities())) {
+ propertyModel.setFacilities(model.getFacilities());
+ }
+ if (StringUtils.isNotBlank(model.getInsidePosition())) {
+ propertyModel.setInsidePosition(model.getInsidePosition());
+ }
+ return propertyModel;
+ }
+
+ private List convertSampileQueryToBean(District district,SampleQuery... queries) throws Exception {
+
+ List queryBeans = new ArrayList(queries.length);
+ for (SampleQuery q : queries) {
+
+ CollateralSampleQueryBean queryBean = new CollateralSampleQueryBean();
+ BeanUtils.copyProperties(q, queryBean);
+ queryBean.setProperty(district);
+ String estateType = queryBean.getProperty().getEstateType2();
+ queryBean.setPropertyTypeCode("01");
+ if (StringUtils.isNotBlank(estateType)) {
+ if (estateType.equals("ÆÕͨסլ")) {
+ queryBean.setPropertyTypeCode("01");
+ } else if (estateType.equals("±ðÊû")) {
+ queryBean.setPropertyTypeCode("02");
+ } else if (estateType.equals("ÉÌס")) {
+ queryBean.setPropertyTypeCode("03");
+ }
+ }
+
+ Integer decrCondCode = queryBean.getDecrCondCode();
+ if (decrCondCode == null) {
+ decrCondCode = 2;
+ }
+ if (decrCondCode > 5 || decrCondCode < 1) {
+ throw new Exception("decrCondCodeȡֵ·Ç·¨");
+ }
+ Integer towardDirectCode = queryBean.getTowardDirectCode();
+ if (towardDirectCode == null) {
+ towardDirectCode = 3;
+ }
+ if (towardDirectCode > 10 || towardDirectCode < 1) {
+ throw new Exception("towardDirectCodeȡֵ·Ç·¨");
+ }
+ queryBeans.add(queryBean);
+ }
+ return queryBeans;
+ }
+
+ private void adjustPriceByRatio(District district, Evaluation evaluation) {
+
+ try {
+ ApiUserCfg apiUserCfg_pt = apiUserCfgService.findByUserId(Long.valueOf(evaluation.getFromUserId()), ApiUserCfg.ApiUserCfgKey.PRICE_TYPE);
+ if (apiUserCfg_pt != null && apiUserCfg_pt.getCfgValue() != null) {
+ String priceType = apiUserCfg_pt.getCfgValue().toString();
+ // ÆÀ¹À¼ÛÔòϵÊýµ÷Õû
+ if (StringUtils.isNotBlank(priceType) && "evaluate".equals(priceType)) {
+ EvaluateRatio evaluateRatio = null;
+ if (StringUtils.isNotBlank(district.getRegion())) {
+ evaluateRatio = evaluateRatioService.findByCityAndRegion(district.getCity(), district.getRegion());
+ }
+ if (evaluateRatio == null) {
+ evaluateRatio = evaluateRatioService.findByCity(district.getCity());
+ }
+ if (evaluateRatio != null) {
+ // ϵÊýÌí¼Ó
+ long totalPrice = evaluation.getBigTotalPrice();
+ totalPrice = (long) (totalPrice * (1 + evaluateRatio.getRatio()));
+ evaluation.setBigTotalPrice(totalPrice);
+ evaluation.setAvgPrice((int) (totalPrice / evaluation.getArea()));
+ }
+ }
+ }
+ } catch (Exception ex) {
+ LOGGER.error("ϵÊýϵ÷Òì³£{}", ex.getMessage());
+ }
+ }
+
+ public Object evaluateAction(PropertyEvaluationModel model, HttpServletRequest request, HouseValueInformationDto houseValueInformation, RestfulModelAndView mav)
+ throws NumberFormatException, IllegalAccessException {
+// RestfulModelAndView mav = new RestfulModelAndView();
+// mav.setViewType("rest");
+ if (StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(model.getName())
+ || StringUtils.isBlank(model.getDistrict()) || model.getSize() <= 0) {
+ mav.setModel(BasicModel.buildBadRequestModel("²ÎÊý·Ç·¨:³ÇÊÐ,ÇøÓò,Ð¡ÇøÃû,Ãæ»ý(size)Ϊ±ØÌîÏî"));
+ return mav;
+ }
+ if (model.getCity().endsWith("ÊÐ")) {
+ model.setCity(model.getCity().replaceAll("ÊÐ$", ""));
+ }
+ if (StringUtils.isNotBlank(request.getParameter("calDate"))) {
+ Date calDate = null;
+ try {
+ calDate = DateUtils.parseDate(request.getParameter("calDate"), new String[]{"yyyy-MM-dd"});
+ } catch (ParseException e) {
+
+ }
+ if (calDate == null) {
+ mav.setModel(BasicModel.buildBadRequestModel("calDate:Êý¾ÝÀàÐͲ»ºÏ·¨"));
+ return mav;
+ } else {
+ model.setCalDate(calDate);
+ }
+ }
+ /* Ïȵ½CPDB¿âÖвéÕÒÐ¡Çø */
+ District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(),
+ "district");
+ if (district == null) {
+ if (model.getDistrict().contains("ÊÐÏ½Çø") || model.getDistrict().contains(model.getCity())) {
+ district = districtService.findByNameAndAlias(model.getCity(), null, model.getName(), "district");
+ }
+ if (district == null) {
+ mav.setModel(BasicModel.buildBadRequestModel("¸ÃÐ¡Çø²»´æÔÚ"));
+ return mav;
+ }
+ }
+ model.setName(district.getName());
+
+ if (model.getCarportPrice() != null && (model.getCarportPrice() < 0 || model.getCarportPrice() > 1000000)) {
+ mav.setModel(BasicModel.buildBadRequestModel("carportPrice(³µÎ»)ȡֵ²»ºÏ·¨"));
+ return mav;
+ }
+ if (model.getMaxFloor() != null && (model.getMaxFloor() <= 0 || model.getMaxFloor() > 59)) {
+ mav.setModel(BasicModel.buildBadRequestModel("maxFloorȡֵ·Ç·¨,ÕýÈ··¶Î§[1,60)"));
+ return mav;
+ }
+
+ if (model.getFloor() != null && (model.getFloor() <= 0 || model.getFloor() > 59)) {
+ mav.setModel(BasicModel.buildBadRequestModel("floorȡֵ·Ç·¨,ÕýÈ··¶Î§[1,60)"));
+ return mav;
+ }
+ if (model.getMaxFloor() != null && model.getFloor() != null && model.getFloor() > model.getMaxFloor()) {
+ mav.setModel(BasicModel.buildBadRequestModel("ËùÔÚÂ¥²ã²»ÄÜ´óÓÚ×ÜÂ¥²ã"));
+ return mav;
+ }
+
+ if (model.getFloor() == null) {
+ JSONObject structureOb = addressMatchProxyService.addressStructure(district.getCity(), model.getAddress());
+ if (structureOb != null) {
+ if (structureOb.containsKey("buildingNumber")) {
+ model.setBuildingNumber(structureOb.getString("buildingNumber"));
+ }
+
+ if (structureOb.containsKey("roomNumber")) {
+ String roomNumber = structureOb.getString("roomNumber");
+ model.setFloor(getFloor(roomNumber));
+ }
+
+ }
+ }
+
+ if (model.getMaxFloor() == null && model.getFloor() != null && StringUtils.isNotBlank(model.getBuildingNumber())) {
+ Loudong loudong = loudongService.findForEvaluate(district.getId(), model.getBuildingNumber(), model.getUnitNumber());
+ if (loudong != null && loudong.getFloors() >= model.getFloor()) {
+ model.setMaxFloor(loudong.getFloors());
+ }
+ }
+ model.setRegion(district.getRegion());
+ model.setDistrictName(district.getName());
+ if (StringUtils.isBlank(model.getPropertyType())) {
+ if (district.getEstateType2() != null && district.getEstateType2().contains("±ðÊû")) {
+ model.setPropertyType("1");
+ }
+ }
+
+ if (model.getCalDate() != null) {
+ if (new Date().before(model.getCalDate())) {
+ model.setCalDate(DateUtil.getFirstDayOfWeek(new Date()));
+ } else {
+ model.setCalDate(DateUtil.getFirstDayOfWeek(model.getCalDate()));
+ }
+ } else {
+ model.setCalDate(DateUtil.getFirstDayOfWeek(new Date()));
+ }
+
+
+ Evaluation evaluation = evaluationService.evaluate(district, buildEvaluation(model, request),
+ model.getCalDate());
+ Double cityPriceCredit = null;
+ if (StringUtils.isNotBlank(evaluation.getFromUserId())) {
+ try {
+ ApiUserAuthority apiUserAuthority = apiUserAuthorityService
+ .findByUserId(Long.valueOf(evaluation.getFromUserId()));
+ if (apiUserAuthority.getCityCreditMap() != null
+ && apiUserAuthority.getCityCreditMap().containsKey(evaluation.getCity())) {
+ cityPriceCredit = apiUserAuthority.getCityCreditMap().get(evaluation.getCity());
+ if (cityPriceCredit > 1 || cityPriceCredit < 0) {
+ cityPriceCredit = null;
+ }
+ }
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+
+ this.adjustPriceByRatio(district, evaluation);
+ }
+
+ // µ÷ÕûÃæ»ý²»Í¬Ãæ»ý¼Û¸ñ
+ try {
+ DistrictStatBo districtStatBo = districtStatService.findDistrictStat(new DistrictKey(district));
+ int orgAvgPrice = 0;
+ if (districtStatBo != null) {
+ if (StringUtils.isNotBlank(district.getEstateType2()) && district.getEstateType2().contains("±ðÊû") && districtStatBo.getVillaDistrictStat() != null) {
+ orgAvgPrice = districtStatBo.getVillaDistrictStat().getAvgPrice();
+ } else if (districtStatBo.getDistrictStat() != null) {
+ orgAvgPrice = districtStatBo.getDistrictStat().getAvgPrice();
+ }
+ }
+ if (evaluation != null && evaluation.getAvgPrice() != null && evaluation.getAvgPrice() > 0) {
+ int factorPrice = evaluation.getAvgPrice();
+ int avgPrice = evaluateFactorService.recompose(district.getCity(), district.getRegion(), evaluation.getArea(), factorPrice, orgAvgPrice);
+ Integer minPrice = (int) (evaluation.getAvgPrice() * 0.95);
+ Integer maxPrice = (int) (evaluation.getAvgPrice() * 1.05);
+ // Æ«Àë¶È³¬¹ý5%²»½øÐе÷Õû
+ if (minPrice <= avgPrice && avgPrice <= maxPrice) {
+ evaluation.setAvgPrice(avgPrice);
+ evaluation.setBigTotalPrice((long) (avgPrice * evaluation.getArea()));
+ }
+ }
+ } catch (Exception ex) {
+ LOGGER.error("µ÷ÕûÃæ»ý²»Í¬Ãæ»ý¼Û¸ñÒì³£{}", ex.getMessage());
+ }
+
+ if (evaluation.getTotalPrice() != null && evaluation.getTotalPrice() != 0
+ && (cityPriceCredit == null || evaluation.getCredit() >= cityPriceCredit)) {
+ Map districtPriceMap = new HashMap();
+ districtPriceMap.put("city", district.getCity());
+ districtPriceMap.put("district", district.getRegion());
+ districtPriceMap.put("name", district.getName());
+ districtPriceMap.put("totalPrice", evaluation.getBigTotalPrice());
+ districtPriceMap.put("avgPrice", evaluation.getAvgPrice());
+
+ // ¸ù¾Ý³ÇÊÐµÈ ¼¶ÉèÖÃD¼¶¿ÉÐŶÈ
+ ApiUserAuthority apiUserAuthority = apiUserAuthorityService
+ .findByUserId(Long.valueOf(evaluation.getFromUserId()));
+ if (apiUserAuthority != null && null != apiUserAuthority.getCreditLevelStatus()
+ && apiUserAuthority.getCreditLevelStatus() == 1) {
+ double dCredit = 0.61;
+ if (null != apiUserAuthority.getPriceRatingMap()) {
+ ServerArea serverArea = serverAreaService.findByDisplay(evaluation.getCity());
+ Map rateMap = apiUserAuthority.getPriceRatingMap();
+ if (null != rateMap) {
+ dCredit = rateMap.get(CITYLEVEL_MAP.get(serverArea.getNewCityGrade().toString()));
+ }
+ }
+ Map rMap = getLastEvaluationPrice(district, evaluation, dCredit);
+
+ if (model.getScope() == EVALUATE_SHOW_DETAIL) {
+ if (null != rMap) {
+ if (rMap.containsKey("level")) {
+ districtPriceMap.put("level", rMap.get("level"));
+ }
+ if (rMap.containsKey("other_price")) {
+ districtPriceMap.put("other_price", rMap.get("other_price"));
+ }
+ }
+ }
+
+ Long lastPrice = (Long) rMap.get("lastPrice");
+
+ if (null != lastPrice) {
+ districtPriceMap.put("totalPrice", lastPrice);
+ if (lastPrice > 0 && lastPrice != evaluation.getBigTotalPrice()) {
+ districtPriceMap.put("avgPrice", (int) (lastPrice / evaluation.getArea()));
+ }
+ } else {
+ mav.setModel(BasicModel.buildOKModel().setMsg("ÔÝʱ²»Ö§³Ö¸ÃÐ¡ÇøµÄ¹À¼Û").markNoData());
+ return mav;
+ }
+
+ } else {
+ districtPriceMap.put("totalPrice", evaluation.getBigTotalPrice());
+ }
+
+ if (model.getScope() == EVALUATE_SHOW_DETAIL) {
+ districtPriceMap.put("evaluateWay", evaluation.getEvaluateWay());
+ districtPriceMap.put("credit", evaluation.getCredit());
+ districtPriceMap.put("id", evaluation.getId());
+ }
+ // ½«ÆÀ¹À¼Û·Åµ½½á¹û¼¯
+ houseValueInformation.setAddressValue(districtPriceMap);
+// mav.setModel(BasicModel.buildOKModel().setResult(districtPriceMap));
+ try {
+ if (StringUtils.isNotBlank(evaluation.getFromUserId()) && !evaluation.getFromUserId().equals("1007497")) {
+ openApiLogService.saveLog(CommonUtils.convertToMap(model), districtPriceMap, evaluation, "/property/evaluate");
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return mav;
+ } else {
+ evaluationService.remove(evaluation.getId());
+ mav.setModel(BasicModel.buildOKModel().setMsg("ÔÝʱ²»Ö§³Ö¸ÃÐ¡ÇøµÄ¹À¼Û").markNoData());
+ return mav;
+ }
+ }
+
+ private Integer getFloor(String roomNumber) {
+ if (StringUtils.isNotBlank(roomNumber) && DataUtil.isNumber(roomNumber)) {
+ if (roomNumber.length() == 3) {
+ return Integer.valueOf(roomNumber.substring(0, 1));
+ } else if (roomNumber.length() == 4) {
+ return Integer.valueOf(roomNumber.substring(0, 2));
+ } else {
+ return null;
+ }
+ }
+ return null;
+ }
+
+ private Evaluation buildEvaluation(PropertyEvaluationModel model, HttpServletRequest request) {
+ Evaluation evaluation = new Evaluation();
+ evaluation.setCity(model.getCity());
+ evaluation.setRegion(model.getRegion());
+ evaluation.setDistrictName(model.getName());
+ evaluation.setDirection(DIRECTION.get(model.getDirection()));
+ evaluation.setFitment(EVALUATION_MODEL_FITMENT.get(FITMENT.get(StringUtils.isNotBlank(model.getDecoration()) ?
+ model.getDecoration() : model.getFitment())));
+ evaluation.setNoise(NOISE.get(model.getNoise()));
+ evaluation.setEstateType(PROPERTY_TYPES.get(model.getPropertyType()));
+ evaluation.setSight(SIGHT.get(model.getView()));
+ evaluation.setAtticArea(model.getAtticSize());
+ evaluation.setTerraceArea(model.getOuterSize());
+ evaluation.setBasementArea(model.getBasementSize());
+ evaluation.setGardenArea(model.getGardenSize());
+ String worryFacility = model.getNegativeFactor();
+ evaluation.setWorryFacility(NEGATIVE_FACTOR.get(worryFacility));
+ evaluation.setCreationDate(new Date());
+ evaluation.setModificationDate(new Date());
+ evaluation.setClientNo(model.getClientNo());
+ if (0 != model.getAge()) {
+ evaluation.setAge(model.getAge());
+ }
+ evaluation.setArea(model.getSize());
+ if (ArrayUtils.isNotEmpty(model.getBuildQuality())) {
+ evaluation.setBuildQuality(convertToString(model.getBuildQuality()));
+ }
+ if (StringUtils.isNotBlank(model.getBuildType())) {
+ evaluation.setBuildType(model.getBuildType());
+ }
+ if (StringUtils.isNotBlank(model.getCarport())) {
+ evaluation.setCarport(model.getCarport());
+ }
+ if (model.getDecorationAge() >= 1 && model.getDecorationAge() <= 5) {
+ evaluation.setFitmentAge(model.getDecorationAge());
+ }
+ evaluation.setCarportPrice(model.getCarportPrice());
+ evaluation.setCity(model.getCity());
+ evaluation.setDistrictName(model.getName());
+ if (model.getDecorationCost() != null && model.getDecorationCost() > 0) {
+ evaluation.setFitmentCharge(model.getDecorationCost());
+ }
+ if (0 != model.getHall()) {
+ evaluation.setHall(model.getHall());
+ }
+ if (null != model.getFloor()) {
+ evaluation.setFloor(model.getFloor());
+ }
+ if (model.getMaxFloor() != null && 0 != model.getMaxFloor()) {
+ evaluation.setHeight(model.getMaxFloor());
+ }
+ if (StringUtils.isNotBlank(model.getBuildingNumber())) {
+ evaluation.setHouseNum(model.getBuildingNumber());
+ }
+ if (StringUtils.isNotBlank(model.getHouseProperty())) {
+ evaluation.setHouseProperty(model.getHouseProperty());
+ }
+ if (StringUtils.isNotBlank(model.getInsidepos())) {
+ evaluation.setInsidepos(model.getInsidepos());
+ }
+ if (StringUtils.isNotBlank(model.getLightingVentilation())) {
+ evaluation.setLightingVentilation(model.getLightingVentilation());
+ }
+
+ if (StringUtils.isNotBlank(model.getOtherFactor())) {
+ evaluation.setOtherFactor(model.getOtherFactor());
+ }
+ evaluation.setRegion(model.getDistrict());
+ if (null != model.getRoom()) {
+ evaluation.setRoom(model.getRoom());
+ }
+ if (StringUtils.isNotBlank(model.getRoomNumber())) {
+ evaluation.setRoomNum(model.getRoomNumber());
+ }
+ if (StringUtils.isNotBlank(model.getSideset())) {
+ evaluation.setSideset(model.getSideset());
+ }
+ if (0 != model.getToilet()) {
+ evaluation.setToilet(model.getToilet());
+ }
+ if (model.getFacilities() != null) {
+ String facilities = model.getFacilities();
+ String[] fs = facilities.split(",");
+ for (int i = 0; i < fs.length; i++) {
+ fs[i] = FACILITIES.get(fs[i]);
+ }
+ evaluation.setFacilities(convertToString(fs));
+ }
+
+ if (StringUtils.isNotBlank(model.getFacade())) {
+ evaluation.setFacade(model.getFacade());
+ }
+ if (StringUtils.isNotBlank(model.getTraffice())) {
+ evaluation.setTraffice(model.getTraffice());
+ }
+ if (StringUtils.isNotBlank(model.getShape())) {
+ evaluation.setShape(model.getShape());
+ }
+ if (StringUtils.isNotBlank(model.getObstacle())) {
+ evaluation.setObstacle(model.getObstacle());
+ }
+ if (StringUtils.isNotBlank(model.getIndustry())) {
+ evaluation.setIndustry(model.getIndustry());
+ }
+ if (StringUtils.isNotBlank(model.getSupportDevice())) {
+ evaluation.setSupportDevice(model.getSupportDevice());
+ }
+ if (StringUtils.isNotBlank(model.getLeftPosition())) {
+ evaluation.setLeftPosition(model.getLeftPosition());
+ }
+ if (StringUtils.isNotBlank(model.getShopType())) {
+ evaluation.setShopType(model.getShopType());
+ }
+ if (StringUtils.isNotBlank(model.getShopUnique())) {
+ evaluation.setShopUnique(model.getShopUnique());
+ }
+ if (StringUtils.isNotBlank(model.getLocation())) {
+ evaluation.setLocation(model.getLocation());
+ }
+ if (model.isNewDistrict()) {
+ evaluation.setNewDistrict(model.isNewDistrict());
+ }
+ String ip = AnalyticsUtil.getIpAddress(ActionContext.getContext().getRequest());
+ evaluation.setIp(ip);
+ AuthenticationBean authenticationBean = (AuthenticationBean) request
+ .getAttribute(AuthenticationBean.ATTR_AUTHENTICATION_BEAN);
+ if (authenticationBean != null && authenticationBean.apiUser != null) {
+ evaluation.setFromUserId(String.valueOf(authenticationBean.apiUser.getId()));
+ }
+ evaluation.setSource("api_property_evaluation");
+ return evaluation;
+ }
+
+ private Map getLastEvaluationPrice(District district, Evaluation evaluation, double dCredit)
+ throws NumberFormatException, IllegalAccessException {
+ Date startDate = DateUtil.parseDate(DateUtil.addMonth(new Date(), -6), "yyyy-MM-dd");
+ // µÚÈý·½¼Û¸ñ
+ Map otherPriceRets = averageStatisticsService.findFirstAverageStatictics(district.getCity(),
+ district.getRegion(), district.getName(), district.getCategory(), startDate);
+ if (null == otherPriceRets) {
+ otherPriceRets = new HashMap();
+ }
+
+ otherPriceRets.put("fjw_price", evaluation.getAvgPrice());
+ Map levelMap = getPriceLevel(otherPriceRets, evaluation.getCredit());
+ Long lastPrice = getLastPrice(levelMap, otherPriceRets, evaluation, dCredit);
+
+ Map rMap = new HashMap();
+ rMap.put("lastPrice", lastPrice);
+ if (null != levelMap && levelMap.containsKey("level")) {
+ String priceLevel = (String) levelMap.get("level");
+ rMap.put("level", priceLevel);
+ }
+ rMap.put("other_price", otherPriceRets);
+ return rMap;
+ }
+
+ private Map getPriceLevel(Map otherPriceRets, double credit) {
+
+ Integer avgPrice = (Integer) otherPriceRets.get("fjw_price");
+
+ int keyCount = 0;
+ int commonCount = 0;
+ int isExistCount = 0;
+
+ List prices = new ArrayList();
+ List smallPrices = new ArrayList();
+
+ if (null != otherPriceRets.get("fanggugu_price")) {
+ Integer fangguguPrice = (Integer) otherPriceRets.get("fanggugu_price");
+ int mod = avgPrice - fangguguPrice;
+ double temp = DataUtil.getDoubleRound(2, mod * 100 / avgPrice);
+ temp = Math.abs(temp);
+ if (temp <= 15) {
+ keyCount++;
+ } else {
+ prices.add(fangguguPrice);
+ }
+ isExistCount++;
+ }
+ if (null != otherPriceRets.get("yungujia_price")) {
+ Integer yungujiaPrice = (Integer) otherPriceRets.get("yungujia_price");
+ int mod = avgPrice - yungujiaPrice;
+ double temp = DataUtil.getDoubleRound(2, mod * 100 / avgPrice);
+ temp = Math.abs(temp);
+ if (temp <= 15) {
+ keyCount++;
+ } else {
+ prices.add(yungujiaPrice);
+ }
+
+ isExistCount++;
+ }
+
+ if (null != otherPriceRets.get("zhugezhaofang_price")) {
+ Integer zhugezhaofangPrice = (Integer) otherPriceRets.get("zhugezhaofang_price");
+ int mod = avgPrice - zhugezhaofangPrice;
+ double temp = DataUtil.getDoubleRound(2, mod * 100 / avgPrice);
+ temp = Math.abs(temp);
+ if (temp <= 15) {
+ keyCount++;
+ } else {
+ prices.add(zhugezhaofangPrice);
+ }
+
+ isExistCount++;
+ }
+
+ if (null != otherPriceRets.get("lianjia_price")) {
+ Integer lianjiaPrice = (Integer) otherPriceRets.get("lianjia_price");
+ int mod = avgPrice - lianjiaPrice;
+ double temp = DataUtil.getDoubleRound(2, mod * 100 / avgPrice);
+ temp = Math.abs(temp);
+ if (temp <= 15) {
+ keyCount++;
+ } else {
+ prices.add(lianjiaPrice);
+ }
+ isExistCount++;
+ }
+ if (null != otherPriceRets.get("anjuke_price")) {
+ Integer anjukePrice = (Integer) otherPriceRets.get("anjuke_price");
+ int mod = avgPrice - anjukePrice;
+ double temp = DataUtil.getDoubleRound(2, mod * 100 / avgPrice);
+ temp = Math.abs(temp);
+ if (temp <= 15) {
+ commonCount++;
+ smallPrices.add(anjukePrice);
+ } else {
+ prices.add(anjukePrice);
+ }
+
+ isExistCount++;
+ }
+ if (null != otherPriceRets.get("ganji_price")) {
+ Integer ganjiPrice = (Integer) otherPriceRets.get("ganji_price");
+ int mod = avgPrice - ganjiPrice;
+ double temp = DataUtil.getDoubleRound(2, mod * 100 / avgPrice);
+ temp = Math.abs(temp);
+ if (temp <= 15) {
+ commonCount++;
+ smallPrices.add(ganjiPrice);
+ } else {
+ prices.add(ganjiPrice);
+ }
+
+ isExistCount++;
+ }
+ if (null != otherPriceRets.get("soufan_price")) {
+ Integer soufan_price = (Integer) otherPriceRets.get("soufan_price");
+ int mod = avgPrice - soufan_price;
+ double temp = DataUtil.getDoubleRound(2, mod * 100 / avgPrice);
+ temp = Math.abs(temp);
+ if (temp <= 15) {
+ commonCount++;
+ smallPrices.add(soufan_price);
+ } else {
+ prices.add(soufan_price);
+ }
+
+ isExistCount++;
+ }
+ if (null != otherPriceRets.get("tobushi_price")) {
+ Integer tobushi = (Integer) otherPriceRets.get("tobushi_price");
+ int mod = avgPrice - tobushi;
+ double temp = DataUtil.getDoubleRound(2, mod * 100 / avgPrice);
+ temp = Math.abs(temp);
+ if (temp <= 15) {
+ commonCount++;
+ smallPrices.add(tobushi);
+ } else {
+ prices.add(tobushi);
+ }
+
+ isExistCount++;
+ }
+
+ if (null != otherPriceRets.get("zhongyuan_price")) {
+ Integer zhongyuanPrice = (Integer) otherPriceRets.get("zhongyuan_price");
+ int mod = avgPrice - zhongyuanPrice;
+ double temp = DataUtil.getDoubleRound(2, mod * 100 / avgPrice);
+ temp = Math.abs(temp);
+ if (temp <= 15) {
+ commonCount++;
+ smallPrices.add(zhongyuanPrice);
+ } else {
+ prices.add(zhongyuanPrice);
+ }
+
+ isExistCount++;
+ }
+
+ Map retMap = new HashMap();
+ String level = null;
+ if (keyCount >= 2) {
+ level = "A";
+ } else if (keyCount >= 1 && commonCount >= 1) {
+ level = "A";
+ } else if (keyCount >= 1 || commonCount >= 2) {
+ level = "B";
+ } else if (commonCount >= 1) {
+ level = "C";
+ } else if (isExistCount == 0) {
+ level = "D";
+ } else if (isExistCount >= 1) {
+ if (isExistCount == 1) {
+ level = "D";
+ } else {
+ level = "E";
+ }
+ }
+
+ if (credit == 0) {
+ level = "E";
+ }
+
+ if (StringUtils.isNotBlank(level)) {
+ retMap.put("level", level);
+ retMap.put("prices", prices);
+ retMap.put("small_prices", smallPrices);
+ }
+ return retMap;
+ }
+
+ private Long getLastPrice(Map retMap, Map otherPriceRets, Evaluation evaluation, double dCredit) {
+ Long lastPrice = null;
+ if (null != retMap) {
+ String priceLevel = (String) retMap.get("level");
+
+ if (priceLevel.equals("D")) {
+
+ lastPrice = inputResultByWebsite(otherPriceRets, evaluation, dCredit);
+
+ } else if (priceLevel.equals("E")) {
+ if (evaluation.getCredit() >= 0.65) {
+ lastPrice = evaluation.getBigTotalPrice();
+ } else {
+ List prices = (List) retMap.get("prices");
+ int avgPrice = 0;
+ if (prices != null) {
+ avgPrice = findNewPrice(prices, evaluation.getAvgPrice());
+ }
+ // ÔÚ dCreditÓë0.65Ö®¼ä
+ if (evaluation.getCredit() >= dCredit && dCredit < 0.65) {
+ if (avgPrice > 0) {
+ Double newTotalPrice = avgPrice * evaluation.getArea();
+ lastPrice = newTotalPrice.longValue();
+ } else {
+ if (null != otherPriceRets.get("lianjia_price")) {
+ Integer lianjiaPrice = (Integer) otherPriceRets.get("lianjia_price");
+ Double newTotalPrice = lianjiaPrice * evaluation.getArea();
+ lastPrice = newTotalPrice.longValue();
+ } else if (null != otherPriceRets.get("zhugezhaofang_price")) {
+ Integer zhugezhaofangPrice = (Integer) otherPriceRets.get("zhugezhaofang_price");
+ Double newTotalPrice = zhugezhaofangPrice * evaluation.getArea();
+ lastPrice = newTotalPrice.longValue();
+ } else if (null != otherPriceRets.get("yungujia_price")) {
+ Integer yungujiaPrice = (Integer) otherPriceRets.get("yungujia_price");
+ Double newTotalPrice = yungujiaPrice * evaluation.getArea();
+ lastPrice = newTotalPrice.longValue();
+ } else if (null != otherPriceRets.get("fanggugu_price")) {
+ Integer fangguguPrice = (Integer) otherPriceRets.get("fanggugu_price");
+ Double newTotalPrice = fangguguPrice * evaluation.getArea();
+ lastPrice = newTotalPrice.longValue();
+ } else {
+ lastPrice = evaluation.getBigTotalPrice();
+ }
+ }
+ } else if (evaluation.getCredit() < dCredit) {// ÔÚdCreditÒÔÏÂ
+ if (avgPrice > 0) {
+ Double newTotalPrice = avgPrice * evaluation.getArea();
+ lastPrice = newTotalPrice.longValue();
+ } else {
+ if (null != otherPriceRets.get("lianjia_price")) {
+ Integer lianjiaPrice = (Integer) otherPriceRets.get("lianjia_price");
+ Double newTotalPrice = lianjiaPrice * evaluation.getArea();
+ lastPrice = newTotalPrice.longValue();
+ } else if (null != otherPriceRets.get("zhugezhaofang_price")) {
+ Integer zhugezhaofangPrice = (Integer) otherPriceRets.get("zhugezhaofang_price");
+ Double newTotalPrice = zhugezhaofangPrice * evaluation.getArea();
+ lastPrice = newTotalPrice.longValue();
+ } else if (null != otherPriceRets.get("yungujia_price")) {
+ Integer yungujiaPrice = (Integer) otherPriceRets.get("yungujia_price");
+ Double newTotalPrice = yungujiaPrice * evaluation.getArea();
+ lastPrice = newTotalPrice.longValue();
+ } else if (null != otherPriceRets.get("fanggugu_price")) {
+ Integer fangguguPrice = (Integer) otherPriceRets.get("fanggugu_price");
+ Double newTotalPrice = fangguguPrice * evaluation.getArea();
+ lastPrice = newTotalPrice.longValue();
+ }
+ }
+ }
+ }
+
+ } else if (priceLevel.equals("C")) {
+ List smallPrices = (List) retMap.get("small_prices");
+ if (smallPrices != null) {
+ smallPrices.add(evaluation.getAvgPrice());
+ int avgPrice = sum(smallPrices) / smallPrices.size();
+ Double newTotalPrice = avgPrice * evaluation.getArea();
+ lastPrice = newTotalPrice.longValue();
+ }
+ } else {
+ lastPrice = evaluation.getBigTotalPrice();
+ }
+ }
+ return lastPrice;
+ }
+
+ private Integer sum(List smallPrices) {
+ int sum = 0;
+ for (int price : smallPrices) {
+ sum += price;
+ }
+ return sum;
+ }
+
+ private Long inputResultByWebsite(Map otherPriceRets, Evaluation evaluation, double dCredit) {
+ Long lastPrice = null;
+ if (evaluation.getCredit() >= dCredit) {
+ lastPrice = evaluation.getBigTotalPrice();
+ } else {
+ if (evaluation.getCredit() < dCredit) {
+ if (null != otherPriceRets.get("lianjia_price")) {
+ Integer lianjiaPrice = (Integer) otherPriceRets.get("lianjia_price");
+ Double newTotalPrice = lianjiaPrice * evaluation.getArea();
+ lastPrice = newTotalPrice.longValue();
+ } else if (null != otherPriceRets.get("zhugezhaofang_price")) {
+ Integer zhugezhaofangPrice = (Integer) otherPriceRets.get("zhugezhaofang_price");
+ Double newTotalPrice = zhugezhaofangPrice * evaluation.getArea();
+ lastPrice = newTotalPrice.longValue();
+ } else if (null != otherPriceRets.get("yungujia_price")) {
+ Integer yungujiaPrice = (Integer) otherPriceRets.get("yungujia_price");
+ Double newTotalPrice = yungujiaPrice * evaluation.getArea();
+ lastPrice = newTotalPrice.longValue();
+ } else if (null != otherPriceRets.get("fanggugu_price")) {
+ Integer fangguguPrice = (Integer) otherPriceRets.get("fanggugu_price");
+ Double newTotalPrice = fangguguPrice * evaluation.getArea();
+ lastPrice = newTotalPrice.longValue();
+ } else {
+ lastPrice = evaluation.getBigTotalPrice();
+ }
+ } else {
+ lastPrice = evaluation.getBigTotalPrice();
+ }
+ }
+ return lastPrice;
+ }
+
+ private Integer findNewPrice(List prices, int avgPrice) {
+ int minValue1 = Integer.MAX_VALUE;
+ List> values = new ArrayList>();
+ int fjw_price = avgPrice;
+
+ // ÕÒ³ö×îС²î
+ for (int i = 0; i < prices.size() - 1; i++) {
+ int a = prices.get(i);
+ for (int j = i + 1; j < prices.size(); j++) {
+ int b = prices.get(j);
+ int mod = Math.abs(a - b);
+ if (mod < minValue1) {
+ minValue1 = mod;
+ }
+ }
+ }
+
+ // ¸ù¾Ý×îС²îÕÒ³ö½á¹û
+ for (int i = 0; i < prices.size() - 1; i++) {
+ int a = prices.get(i);
+ for (int j = i + 1; j < prices.size(); j++) {
+ int b = prices.get(j);
+ int mod = Math.abs(a - b);
+ if (mod == minValue1) {
+ values.add(Arrays.asList(a, b));
+ }
+ }
+ }
+
+ int minValue2 = Integer.MAX_VALUE;
+ int lastValue = 0;
+ if (values.size() >= 1) {
+ for (List value : values) {
+ int newPrice = (value.get(0) + value.get(1)) / 2;
+ int mod = Math.abs(fjw_price - newPrice);
+ if (mod < minValue2) {
+ minValue2 = mod;
+ lastValue = newPrice;
+ }
+ }
+ }
+
+ if (lastValue > 0) {
+ double temp = DataUtil.getDoubleRound(2, minValue1 * 100 / lastValue);
+ temp = Math.abs(temp);
+ if (temp > 15) {
+ lastValue = 0;
+ }
+ }
+ return lastValue;
+ }
+
+
+
+
+ public void setEvaluationService(EvaluationService evaluationService) {
+ this.evaluationService = evaluationService;
+ }
+
+ public void setDistrictService(DistrictService districtService) {
+ this.districtService = districtService;
+ }
+
+ public void setAddressService(AddressService addressService) {
+ }
+
+ public void setDistrictStatService(DistrictStatService districtStatService) {
+ this.districtStatService = districtStatService;
+ }
+
+ protected AddressMatchLogService addressMatchLogService;
+
+ public void setAddressMatchLogService(AddressMatchLogService addressMatchLogService) {
+ this.addressMatchLogService = addressMatchLogService;
+ }
+
+
+
+ public BatchEvaluateService getBatchEvaluateService() {
+ return batchEvaluateService;
+ }
+
+ public void setBatchEvaluateService(BatchEvaluateService batchEvaluateService) {
+ this.batchEvaluateService = batchEvaluateService;
+ }
+
+ public void setAddressMatchProxyService(AddressMatchProxyService addressMatchProxyService) {
+ this.addressMatchProxyService = addressMatchProxyService;
+ }
+
+ public void setLoudongService(LoudongService loudongService) {
+ this.loudongService = loudongService;
+ }
+
+ public void setApiUserAuthorityService(ApiUserAuthorityService apiUserAuthorityService) {
+ this.apiUserAuthorityService = apiUserAuthorityService;
+ }
+
+ public void setAverageStatisticsService(AverageStatisticsService averageStatisticsService) {
+ this.averageStatisticsService = averageStatisticsService;
+ }
+
+ public void setServerAreaService(ServerAreaService serverAreaService) {
+ this.serverAreaService = serverAreaService;
+ }
+
+ public void setApiUserCfgService(ApiUserCfgService apiUserCfgService) {
+ this.apiUserCfgService = apiUserCfgService;
+ }
+
+ public void setOpenApiLogService(OpenApiLogService openApiLogService) {
+ this.openApiLogService = openApiLogService;
+ }
+
+ public void setFangjiaOfficialAreaService(FangjiaOfficialAreaService fangjiaOfficialAreaService) {
+ this.fangjiaOfficialAreaService = fangjiaOfficialAreaService;
+ }
+
+
+ public void setEvaluateRatioService(EvaluateRatioService evaluateRatioService) {
+ this.evaluateRatioService = evaluateRatioService;
+ }
+
+
+ public void setEvaluateFactorService(EvaluateFactorService evaluateFactorService) {
+ this.evaluateFactorService = evaluateFactorService;
+ }
+
+ public void setCzbankSampleService(CzbankSampleService czbankSampleService) {
+ this.czbankSampleService = czbankSampleService;
+ }
+
+ public void setDistrictFacilitysService(DistrictFacilitysService districtFacilitysService) {
+ this.districtFacilitysService = districtFacilitysService;
+ }
+
+}
+
diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/HouseController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/HouseController.java
index 083ae48f0..f3548c9cc 100644
--- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/HouseController.java
+++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/HouseController.java
@@ -903,7 +903,10 @@ public class HouseController {
if(null == sampleQuery.getMax()){
sampleQuery.setMax(10);
}
+ long start = System.currentTimeMillis();
List collaterals = czbankSampleService.findSample2(querys, sampleQuery.getMax());
+ long end = System.currentTimeMillis();
+ System.out.println("ÓÃʱ:"+(end-start));
Collateral collateral = collaterals.get(0);
List samples = collateral.getSample();
UniversalDto dto = UniversalDto.newDto();
@@ -913,7 +916,8 @@ public class HouseController {
if(null != collateral.getMinPrice()){
dto.append("minUnitPrice", collateral.getMinPrice());
}
- dto.append("datas", samples);
+
+ dto.append("datas", samples);
// if(samples!= null && samples.size()>=2){
// Sample minSample = samples.get(samples.size()-2);
// Sample maxSample = samples.get(samples.size()-1);
diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/TestController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/TestController.java
new file mode 100644
index 000000000..07fbed914
--- /dev/null
+++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/TestController.java
@@ -0,0 +1,1608 @@
+/*
+package com.fangjia.open.controllers;
+
+import com.fangjia.core.util.*;
+import com.fangjia.dal.common.DistrictKey;
+import com.fangjia.dal.mongo.fangjia.model.ServerArea;
+import com.fangjia.dal.mongo.model.ApiUserCfg;
+import com.fangjia.dal.mongo.model.DistrictFacilitys;
+import com.fangjia.dal.mongo.model.Evaluation;
+import com.fangjia.dal.mongo.model.FangjiaOfficialAreaMap;
+import com.fangjia.dal.mongo.model.bkoff.Loudong;
+import com.fangjia.dal.mongo.open.model.ApiUserAuthority;
+import com.fangjia.dal.mongo.open.model.EvaluateRatio;
+import com.fangjia.dal.seaweed.model.District;
+import com.fangjia.open.HttpCode;
+import com.fangjia.open.OpenHttpCodeEnum;
+import com.fangjia.open.dto.HouseValueInformationDto;
+import com.fangjia.open.dto.UniversalDto;
+import com.fangjia.open.dto.addressGovernance.MatchedBuildingDto;
+import com.fangjia.open.interceptors.AuthenticationBean;
+import com.fangjia.open.model.*;
+import com.fangjia.open.util.CommonDtoUtils;
+import com.fangjia.open.util.CommonUtils;
+import com.fangjia.open.ws.query.SampleQuery;
+import com.fangjia.service.api.AddressMatchProxyService;
+import com.fangjia.service.api.ApiUserCfgService;
+import com.fangjia.service.bo.Collateral;
+import com.fangjia.service.bo.DistrictStatBo;
+import com.fangjia.service.bo.Sample;
+import com.fangjia.service.datastore.*;
+import com.fangjia.service.datastore.bean.CollateralSampleQueryBean;
+import com.fangjia.service.district.*;
+import com.fangjia.service.mongo.bkoff.HouseLoudongService;
+import com.fangjia.service.mongo.bkoff.LoudongService;
+import com.fangjia.service.mongo.fangjia.*;
+import com.fangjia.service.open.*;
+import com.fangjia.service.tool.OpenLogService;
+import com.fangjia.service.web.AddressService;
+import net.sf.json.JSONObject;
+import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.time.DateUtils;
+import org.slf4j.Logger;
+import org.sothis.web.mvc.ActionContext;
+import org.sothis.web.mvc.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.ParseException;
+import java.util.*;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
+import static com.poseidon.util.TypeConverter.convertToString;
+
+*/
+/**
+ * @author 13607
+ * @since 2023/12/12 10:29
+ *//*
+
+
+
+public class TestController {
+ private DistrictService districtService;
+
+ private DistrictStatService districtStatService;
+
+ private FangjiaOfficialAreaService fangjiaOfficialAreaService;
+ private AddressMatchProxyService addressMatchProxyService;
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(PropertyController.class);
+ private HouseLoudongService houseLoudongService;
+ private LoudongService loudongService;
+ private EvaluationService evaluationService;
+ private BatchEvaluateService batchEvaluateService;
+ private ApiUserAuthorityService apiUserAuthorityService;
+ private AverageStatisticsService averageStatisticsService;
+ private ServerAreaService serverAreaService;
+ private ApiUserCfgService apiUserCfgService;
+ private OpenApiLogService openApiLogService;
+ private EvaluateFactorService evaluateFactorService;
+
+ private CzbankSampleService czbankSampleService;
+
+ private DistrictFacilitysService districtFacilitysService;
+
+ private static final int DEFAULT_PAGE_SIZE = 20;
+ private static final String[] PROPERTY_SEARCH_API_FIELDS = {"address", "city", "region", "name", "lat2", "lng2", "lat", "lng", "block", "estateType2", "addrAlias"};
+ static final int BAI_DU_GEO = 1;// °Ù¶ÈÏµ×ø±ê
+ static final int GAO_DE_GEO = 2;// ¸ßµÂÏµ×ø±ê
+
+
+ private EvaluateRatioService evaluateRatioService;
+
+ private static final int EVALUATE_SHOW_DETAIL = 1;
+ private static final Map PROPERTY_TYPES = new HashMap() {
+ {
+ put(null, "ÆÕͨסլ");
+ put("0", "ÆÕͨסլ");
+ put("1", "±ðÊû");
+ put("2", "ÉÌס");
+ }
+ };
+
+ private static final Map DIRECTION = new HashMap() {
+ {
+ put(null, "ÄÏ");
+ put("1", "Î÷ÄÏ");
+ put("2", "¶«ÄÏ");
+ put("3", "ÄÏ");
+ put("4", "Î÷±±");
+ put("5", "¶«±±");
+ put("6", "¶«");
+ put("7", "Î÷");
+ put("8", "±±");
+ put("9", "¶«Î÷");
+ put("10", "Äϱ±");
+ }
+ };
+
+ private static final Map FITMENT = new HashMap() {
+ {
+ put(null, "¼ò×°");
+ put("1", "ëÅ÷");
+ put("2", "¼ò×°");
+ put("3", "¾«×°");
+ put("4", "ºÀ×°");
+ }
+ };
+
+ private static final Map EVALUATION_MODEL_FITMENT = new HashMap() {
+ {
+ put(null, "¼òµ¥×°ÐÞ");
+ put("¼ò×°", "¼òµ¥×°ÐÞ");
+ put("ëÅ÷", "ëÅ÷");
+ put("¾«×°", "¾«×°ÐÞ");
+ put("ºÀ×°", "ºÀ»ª×°ÐÞ");
+ }
+ };
+
+ private static final Map SIGHT = new HashMap() {
+ {
+ put(null, "Ò»°ã");
+ put("1", "¾°¹Û·¿");
+ put("2", "²à¾°¹Û·¿");
+ put("3", "Ò»°ã");
+ put("4", "²î");
+ }
+ };
+
+ private static final Map NOISE = new HashMap() {
+ {
+ put(null, "ÎÞÔëÒô");
+ put("0", "ÎÞÔëÒô");
+ put("1", "ÔëÒô½ÏС");
+ put("2", "ÔëÒô´ó");
+ }
+ };
+ private static final Map FACILITIES = new HashMap() {
+ {
+ put("0", "½¡Éí·¿");
+ put("1", "ÓÎÓ¾³Ø");
+ put("2", "»áËù");
+ put("3", "ÍøÇò³¡");
+ put("4", "Çò³¡");
+ put("5", "ÆåÅÆÊÒ");
+ put("6", "Í£³µ³¡");
+ put("7", "ͼÊé¹Ý");
+ put("8", "»î¶¯ÖÐÐÄ");
+ }
+ };
+
+ private static final Map NEGATIVE_FACTOR = new HashMap() {
+ {
+ put(null, "ÎÞ");
+ put("1", "ºÜ½ü");
+ put("2", "½Ï½ü");
+ put("3", "ÎÞ");
+ }
+ };
+
+
+ Map listKeyMap = new HashMap() {
+ {
+ put("school", "schools");
+ put("hospital", "hospitals");
+ put("bank", "banks");
+ put("supermarket", "supermarkets");
+ put("market", "markets");
+ put("beautySalon", "beautySalons");
+ put("gym", "gyms");
+ put("park", "parks");
+ put("bus", "buses");
+ put("metro", "metros");
+ put("dock", "docks");
+ put("airport", "airports");
+ put("trainStation", "trainStations");
+ put("restaurant", "restaurants");
+ put("hotel", "hotels");
+ }
+ };
+
+ private static final Map CITYLEVEL_MAP = new HashMap() {
+ {
+ put("1000", "one");// Ò»Ïß
+ put("1500", "newOne");// ÐÂÒ»Ïß
+ put("2000", "two");// ¶þÏß
+ put("3000", "three");// ÈýÏß
+ put("4000", "four");// ËÄÏß
+ put("5000", "five");// ÎåÏß
+ }
+ };
+
+
+ //È«¾Öjson
+ private JSONObject globalJson = null;
+
+
+ public Object houseValueInformationAction(HouseInfomationModel model, HttpServletRequest httpServletRequest) throws IllegalAccessException, HttpRequestException {
+
+ HouseValueInformationDto houseValueInformation = new HouseValueInformationDto();
+ RestfulModelAndView mav = new RestfulModelAndView();
+
+ if (StringUtils.isBlank(model.getAddress()) || StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(String.valueOf(model.getSize()))) {
+ mav.setModel(BasicModel.buildBadRequestModel("³ÇÊÐ(city),µØÖ·(address),Ãæ»ý(size)Ϊ±ØÌî×Ö¶Î"));
+ return mav;
+ }
+
+ HttpRequest httpRequest = new HttpRequest();
+
+ Map communityAvgPriceParams = new HashMap();
+ communityAvgPriceParams.put("city", model.getCity());
+ communityAvgPriceParams.put("address", model.getAddress());
+ communityAvgPriceParams.put("category", model.getCategory());
+ communityAvgPriceParams.put("useMap", String.valueOf(model.isUseMap()));
+ globalJson = httpRequest.getJsonContent("http://192.168.0.100:32080/FangJiaNlpService/match", communityAvgPriceParams, "UTF-8");
+
+ // ´´½¨Ï̳߳Ø
+ ExecutorService executorService = Executors.newFixedThreadPool(5);
+
+ Future avgPriceFuture = executorService.submit(new UpdateCommunityAvgPriceCallable(globalJson, mav));
+ Future