diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/BohaiEvaluationAuditDao.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/BohaiEvaluationAuditDao.java new file mode 100644 index 000000000..4f8c7d26b --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/BohaiEvaluationAuditDao.java @@ -0,0 +1,7 @@ +package com.fangjia.dal.sql.fangjia.dao; + +import com.fangjia.dal.SqlDao; +import com.fangjia.dal.sql.model.BohaiEvaluationAudit; + +public interface BohaiEvaluationAuditDao extends SqlDao { +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/BohaiEvaluationAuditDaoImpl.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/BohaiEvaluationAuditDaoImpl.java new file mode 100644 index 000000000..1035be137 --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/fangjia/dao/BohaiEvaluationAuditDaoImpl.java @@ -0,0 +1,7 @@ +package com.fangjia.dal.sql.fangjia.dao; + +import com.fangjia.dal.GoojiaFangjiaSqlDao; +import com.fangjia.dal.sql.model.BohaiEvaluationAudit; + +public class BohaiEvaluationAuditDaoImpl extends GoojiaFangjiaSqlDao implements BohaiEvaluationAuditDao{ +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/BohaiEvaluationAudit.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/BohaiEvaluationAudit.java new file mode 100644 index 000000000..adb5b7be6 --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/BohaiEvaluationAudit.java @@ -0,0 +1,184 @@ +package com.fangjia.dal.sql.model; +import java.util.Date; +import java.util.HashMap; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + +import com.fangjia.dal.SqlEntity; +@Entity +@Table(name = "bohai_evaluation_audit") +public class BohaiEvaluationAudit implements SqlEntity{ + + long id; + + long evaluationId; + String queryId; + Integer backStatus; + Integer inquirePrice; + Integer auditStatus;// + long userId; + Integer hopePrice; + Integer lastPrice; + String remark; + + String inquireRemark; + + String feedbackId; + Integer feedbackStatus; + String feedbackMsg; + + Date dateCreated; + Date lastUpdated; + + @Id + @Column(name = "id") + @GeneratedValue(strategy = GenerationType.AUTO) + public long getId() { + return id; + } + + @Override + public void setId(long id) { + this.id = id; + } + + @Column(name = "evaluation_id") + public long getEvaluationId() { + return evaluationId; + } + + public void setEvaluationId(long evaluationId) { + this.evaluationId = evaluationId; + } + + @Column(name = "query_id") + public String getQueryId() { + return queryId; + } + + public void setQueryId(String queryId) { + this.queryId = queryId; + } + + @Column(name = "back_status") + public Integer getBackStatus() { + return backStatus; + } + + public void setBackStatus(Integer backStatus) { + this.backStatus = backStatus; + } + + @Column(name = "inquire_price") + public Integer getInquirePrice() { + return inquirePrice; + } + + public void setInquirePrice(Integer inquirePrice) { + this.inquirePrice = inquirePrice; + } + + @Column(name = "audit_status") + public Integer getAuditStatus() { + return auditStatus; + } + + public void setAuditStatus(Integer auditStatus) { + this.auditStatus = auditStatus; + } + + @Column(name = "user_id") + public long getUserId() { + return userId; + } + + public void setUserId(long userId) { + this.userId = userId; + } + + @Column(name = "hope_price") + public Integer getHopePrice() { + return hopePrice; + } + + public void setHopePrice(Integer hopePrice) { + this.hopePrice = hopePrice; + } + + @Column(name = "last_price") + public Integer getLastPrice() { + return lastPrice; + } + + public void setLastPrice(Integer lastPrice) { + this.lastPrice = lastPrice; + } + + @Column(name = "remark") + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + @Column(name = "c_date") + public Date getDateCreated() { + return dateCreated; + } + + public void setDateCreated(Date dateCreated) { + this.dateCreated = dateCreated; + } + + @Column(name = "m_date") + public Date getLastUpdated() { + return lastUpdated; + } + + public void setLastUpdated(Date lastUpdated) { + this.lastUpdated = lastUpdated; + } + + @Column(name = "feedback_id") + public String getFeedbackId() { + return feedbackId; + } + + public void setFeedbackId(String feedbackId) { + this.feedbackId = feedbackId; + } + + @Column(name = "feedback_status") + public Integer getFeedbackStatus() { + return feedbackStatus; + } + + public void setFeedbackStatus(Integer feedbackStatus) { + this.feedbackStatus = feedbackStatus; + } + + @Column(name = "feedback_msg") + public String getFeedbackMsg() { + return feedbackMsg; + } + + public void setFeedbackMsg(String feedbackMsg) { + this.feedbackMsg = feedbackMsg; + } + + @Column(name = "inquire_remark") + public String getInquireRemark() { + return inquireRemark; + } + + public void setInquireRemark(String inquireRemark) { + this.inquireRemark = inquireRemark; + } +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/FjtEvaluation.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/FjtEvaluation.java index 4ca4a7f59..c5991df90 100644 --- a/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/FjtEvaluation.java +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/sql/model/FjtEvaluation.java @@ -99,6 +99,9 @@ public class FjtEvaluation implements SqlEntity{ private Integer buyYear; //ÊǷñÂúÎå private Integer onlyOne; //ÊǷñΨһ private Double registerPrice; //ÉîÛÚ µǼǼÛ + + private String finishDateStr;//¿¢¹¤ʱ¼ä + private String useType;//·¿ÎÝÓÃ; @GeneratedValue(strategy = GenerationType.AUTO) @Id @@ -729,6 +732,24 @@ public class FjtEvaluation implements SqlEntity{ this.registerPrice = registerPrice; } + @Column(name = "finish_date_str") + public String getFinishDateStr() { + return finishDateStr; + } + + public void setFinishDateStr(String finishDateStr) { + this.finishDateStr = finishDateStr; + } + + @Column(name = "use_type") + public String getUseType() { + return useType; + } + + public void setUseType(String useType) { + this.useType = useType; + } + @Override public String toString() { return "FjtEvaluation{" + diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/DistrictController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/DistrictController.java index a09518625..4cc728b6a 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/DistrictController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/DistrictController.java @@ -6,16 +6,12 @@ import com.fangjia.dal.QueryParam; import com.fangjia.dal.SdQuery; import com.fangjia.dal.SrQuery; import com.fangjia.dal.common.DistrictKey; -import com.fangjia.dal.mongo.model.DistrictStat; import com.fangjia.dal.seaweed.model.District; import com.fangjia.dal.sql.model.FjtUsers; -import com.fangjia.dal.sql.model.UserCity; import com.fangjia.open.compatible.model.JsonModel; -import com.fangjia.open.model.BaseModel; -import com.fangjia.open.model.FangjiaApiModel; import com.fangjia.open.model.weixin.DistrictModel; import com.fangjia.open.model.weixin.DistrictSearchModel; -import com.fangjia.open.model.weixin.UserModel; +import com.fangjia.open.util.BHBankUtils; import com.fangjia.service.api.AutoCompleteBo; import com.fangjia.service.bo.DistrictStatBo; import com.fangjia.service.bo.DistrictStatRentBo; @@ -27,8 +23,8 @@ import com.fangjia.service.sql.UserCityService; import com.fangjia.service.user.UsersInfoService; import com.fangjia.service.util.CookieUtils; import com.google.common.collect.Lists; -import com.google.common.collect.Maps; +import net.sf.json.JSONObject; import org.apache.commons.lang.StringUtils; import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanClause; @@ -40,7 +36,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.net.URLEncoder; import java.util.*; public class DistrictController { @@ -151,6 +146,7 @@ public class DistrictController { districtModel.setMsg("²ÎÊý´íÎó"); return districtModel; } + District district = null; if(StringUtils.isNotBlank(districtModel.getId())) { district = districtService.findById(districtModel.getId()); @@ -162,8 +158,14 @@ public class DistrictController { } else { district = districtService.findByKeyMiniModel(districtModel.getCityName(), districtModel.getRegion(), districtModel.getName(), "district"); } + //СÇø¼۸ñ DistrictStatBo districtStatBo = getDistrictStat(new DistrictKey(district)); + + String userId = CookieUtils.getCookieValue(request, "login_user_id"); + + + //СÇø×â½ð List districtStatRentBos = districtStatRentService.findAllHouseTypeByDistrictStatRent(new DistrictKey(district)); //´¦ÀíͼƬÁ´½Ó @@ -183,7 +185,7 @@ public class DistrictController { boolean is=true; if (null != districtStatBo && null != districtStatBo.getDefaultDistrictStat()) { double credit = districtStatBo.getDefaultDistrictStat().getCredit(); - String userId = CookieUtils.getCookieValue(request, "login_user_id"); + Map map = userCityService.FindCreditByUserId(Long.parseLong(userId)); String creditStr = map.get(city); if (StringUtils.isNotBlank(creditStr)) { @@ -208,6 +210,8 @@ public class DistrictController { return districtModel; } + + private DistrictStatBo getDistrictStat(DistrictKey districtKey) { District district = districtService.findDistrict(districtKey, true); DistrictStatBo statBo = null; diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/ReportController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/ReportController.java index 3fdb01671..2c75d331e 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/ReportController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/ReportController.java @@ -1,16 +1,10 @@ package com.fangjia.open.controllers.weixin; import com.fangjia.core.util.StringUtil; -import com.fangjia.dal.sql.model.EvaluationAudit; -import com.fangjia.dal.sql.model.FjtEvaluation; -import com.fangjia.dal.sql.model.FjtUsers; -import com.fangjia.dal.sql.model.UserTrades; +import com.fangjia.dal.sql.model.*; import com.fangjia.open.model.RestfulModelAndView; import com.fangjia.open.model.weixin.ReportModel; -import com.fangjia.service.sql.EvaluationAuditService; -import com.fangjia.service.sql.FjtEvaluationService; -import com.fangjia.service.sql.FjtUsersService; -import com.fangjia.service.sql.UserTradesService; +import com.fangjia.service.sql.*; import com.fangjia.service.util.CookieUtils; import net.sf.json.JSONArray; import net.sf.json.JSONObject; @@ -32,6 +26,7 @@ public class ReportController { private FjtEvaluationService fjtEvaluationService; private EvaluationAuditService evaluationAuditService; private FjtUsersService fjtUsersService; + private BohaiEvaluationAuditService bohaiEvaluationAuditService; public Object downloadListAction(HttpServletRequest req, ReportModel model, @Param(name = "page") String page) { if(req.getMethod()==null || "GET".equalsIgnoreCase(req.getMethod())) { @@ -68,7 +63,7 @@ public class ReportController { jsonObject.put("bgsf", userTrades.getCharge()+""); if(StringUtils.isNotBlank(evaluationId)) { FjtEvaluation fjtEvaluation = fjtEvaluationService.findEvaluationById(NumberUtils.toLong(evaluationId)); - EvaluationAudit evaluationAudit = evaluationAuditService.findByEvalutionId(evaluationId); + if(fjtEvaluation != null) { jsonObject.put("eid", fjtEvaluation.getId()); jsonObject.put("dz", fjtEvaluation.getAddress()); @@ -76,11 +71,40 @@ public class ReportController { jsonObject.put("rn", fjtEvaluation.getRoomNum()); jsonObject.put("zdr", StringUtils.isBlank(fjtEvaluation.getLender()) ? "-" : fjtEvaluation.getLender()); jsonObject.put("mj", fjtEvaluation.getHouseArea()); - jsonObject.put("zj", df.format(fjtEvaluation.getTotalPrice() / 10000.0)); } - if(evaluationAudit != null) { - jsonObject.put("ckj", (evaluationAudit.getDealPrice()==null) ? "-" : df.format(evaluationAudit.getDealPrice())+"");//²ο¼¼Û - jsonObject.put("zsj", (evaluationAudit.getAuditPrice()==null) ? "-" : df.format(evaluationAudit.getAuditPrice())+"");//ÖÕÉó¼Û + + if(fjtEvaluation != null && fjtUsers.getRole()==17){ + BohaiEvaluationAudit bhEvaluationAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(fjtEvaluation.getId()); + String zj = "-"; + String qwj = "-"; + String zsj = "-"; + if(bhEvaluationAudit != null){ + if(bhEvaluationAudit.getInquirePrice()!=null && bhEvaluationAudit.getInquirePrice() > 0){ + zj = String.valueOf((int)(bhEvaluationAudit.getInquirePrice() / 10000)); + } + if(bhEvaluationAudit.getHopePrice()!=null && bhEvaluationAudit.getHopePrice()>0){ + qwj = String.valueOf((int)(bhEvaluationAudit.getHopePrice() / 10000)); + } + + if(bhEvaluationAudit.getLastPrice()!=null && bhEvaluationAudit.getLastPrice()>0){ + zsj = String.valueOf((int)(bhEvaluationAudit.getLastPrice() / 10000)); + } + + } + jsonObject.put("zj", zj);//×ܼÛ + jsonObject.put("qwj", qwj);//ÆÚÍû¼Û + jsonObject.put("zsj", zsj);//ÖÕÉó¼Û + + }else{ + EvaluationAudit evaluationAudit = evaluationAuditService.findByEvalutionId(evaluationId); + if(fjtEvaluation != null) { + jsonObject.put("zj", df.format(fjtEvaluation.getTotalPrice() / 10000.0)); + } + + if(evaluationAudit != null) { + jsonObject.put("ckj", (evaluationAudit.getDealPrice()==null) ? "-" : df.format(evaluationAudit.getDealPrice())+"");//²ο¼¼Û + jsonObject.put("zsj", (evaluationAudit.getAuditPrice()==null) ? "-" : df.format(evaluationAudit.getAuditPrice())+"");//ÖÕÉó¼Û + } } } ja.add(jsonObject); @@ -106,4 +130,13 @@ public class ReportController { public void setFjtUsersService(FjtUsersService fjtUsersService) { this.fjtUsersService = fjtUsersService; } + + + public BohaiEvaluationAuditService getBohaiEvaluationAuditService() { + return bohaiEvaluationAuditService; + } + + public void setBohaiEvaluationAuditService(BohaiEvaluationAuditService bohaiEvaluationAuditService) { + this.bohaiEvaluationAuditService = bohaiEvaluationAuditService; + } } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/WeiXinEvaluationController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/WeiXinEvaluationController.java index 7507185f8..6ed2a56fd 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/WeiXinEvaluationController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/weixin/WeiXinEvaluationController.java @@ -1,5 +1,6 @@ package com.fangjia.open.controllers.weixin; +import java.io.IOException; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.*; @@ -7,9 +8,13 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import com.fangjia.dal.sql.model.*; +import com.fangjia.open.util.BHBankUtils; import com.fangjia.open.util.InsidePolygon2; import com.fangjia.service.mongo.fangjia.PriceBorderService; +import com.fangjia.service.sql.*; import net.sf.json.JSONArray; import net.sf.json.JSONObject; @@ -28,12 +33,6 @@ import com.fangjia.dal.mongo.model.LatlngPolygon; import com.fangjia.dal.mongo.model.PriceBorder; import com.fangjia.dal.mongo.model.bkoff.DistrictHouseStat; import com.fangjia.dal.seaweed.model.District; -import com.fangjia.dal.sql.model.EvaluationAudit; -import com.fangjia.dal.sql.model.FjtEvaluation; -import com.fangjia.dal.sql.model.FjtUsers; -import com.fangjia.dal.sql.model.GoldLogs; -import com.fangjia.dal.sql.model.UserTrades; -import com.fangjia.dal.sql.model.UsersDetail; import com.fangjia.open.compatible.model.JsonModel; import com.fangjia.open.model.RestfulModelAndView; import com.fangjia.open.model.weixin.EvaluationModel; @@ -56,13 +55,6 @@ import com.fangjia.service.mongo.fangjia.DealPriceService; import com.fangjia.service.mongo.fangjia.LatlngPolygonService; import com.fangjia.service.sms.SmsException; import com.fangjia.service.sms.SmsService; -import com.fangjia.service.sql.EvaluationAuditService; -import com.fangjia.service.sql.EvaluationRateService; -import com.fangjia.service.sql.FjtEvaluationService; -import com.fangjia.service.sql.FjtUsersService; -import com.fangjia.service.sql.GoldLogsService; -import com.fangjia.service.sql.UserTradesService; -import com.fangjia.service.sql.UsersDetailService; import com.fangjia.service.user.UsersInfoService; import com.fangjia.service.util.CookieUtils; import com.google.common.collect.ImmutableMap; @@ -107,6 +99,7 @@ public class WeiXinEvaluationController { private EvaluationService evaluationService; private GoldLogsService goldLogsService; private PriceBorderService priceBorderService; + private BohaiEvaluationAuditService bohaiEvaluationAuditService; private final static String DD_ID = "5938c43984aec20a36f474c5"; @@ -122,7 +115,7 @@ public class WeiXinEvaluationController { //MOBILES.add("13681915777");//13774361275 } - public Object formAction(HttpServletRequest req, EvaluationModel model){ + public Object formAction(HttpServletRequest req, EvaluationModel model, HttpServletResponse response){ District district = districtService.findById(model.getId()); model.setDistrict(district); @@ -130,9 +123,33 @@ public class WeiXinEvaluationController { long userId = Long.valueOf(cookieUserId); FjtUsers fjtUsers = fjtUsersService.findById(userId); model.setRole(fjtUsers.getRole()); + if(fjtUsers.getRole()==17){ + try { + response.sendRedirect("bhform?id="+model.getId()); + } catch (IOException e) { + } + } return model; } + public Object bhformAction(EvaluationModel model) { + District district = districtService.findById(model.getId()); + List addrAlias = new ArrayList(); + if(StringUtils.isNotBlank(district.getAddress())){ + addrAlias.add(district.getAddress()); + + if(district.getAddrAlias()!=null && !district.getAddrAlias().contains(district.getAddress())){ + addrAlias.addAll(district.getAddrAlias()); + } + district.setAddrAlias(addrAlias); + } + + model.setDistrict(district); + return model; + } + + + /** * ΢ÐÅС³ÌÐò:СÇøÏêÇé»ñȡ * @return @@ -177,6 +194,108 @@ public class WeiXinEvaluationController { return jsonModel; } + + + public Object bhhistoryAction(HttpServletRequest req, EvaluationModel model, @Param(name = "page") String page) { + if (req.getMethod() == null || "GET".equalsIgnoreCase(req.getMethod())) { + return model; + } + String cookieUserId = CookieUtils.getCookieValue(req, "login_user_id"); + long userId = Long.valueOf(cookieUserId); + FjtUsers fjtUsers = fjtUsersService.findById(userId); + RestfulModelAndView data = new RestfulModelAndView(); + JSONObject result = new JSONObject(); + //×î¶à10ҳ + if (NumberUtils.toInt(page) > 10) { + result.put("result", new JSONArray().toString()); + data.setModel(result); + return data; + } + Pager pager = new Pager(10); + pager.setCurrentPage(NumberUtils.toInt(page)); + List fjtEvaluationList = fjtEvaluationService.findEvaluationsByUserId(userId, pager); + JSONArray ja = new JSONArray(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd"); + for (int i = 0; i < fjtEvaluationList.size(); ++i) { + FjtEvaluation fjtEvaluation = fjtEvaluationList.get(i); + BohaiEvaluationAudit evaluationAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(fjtEvaluation.getId()); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("eid", fjtEvaluation.getId()); + jsonObject.put("pgrq", sdf.format(fjtEvaluation.getDateCreated()));//ÆÀ¹ÀÈÕÆÚ + jsonObject.put("tjrq", (evaluationAudit == null || evaluationAudit.getAuditStatus() != 4) ? "-" : sdf.format(evaluationAudit.getLastUpdated()));//µ÷¼ÛÈÕÆÚ + jsonObject.put("dz", fjtEvaluation.getAddress());//µØַ + jsonObject.put("hn", fjtEvaluation.getHouseNum()); + jsonObject.put("rn", fjtEvaluation.getRoomNum()); + jsonObject.put("wylx", StringUtils.isBlank(BUILDTYPE_MAP.get(fjtEvaluation.getBuildType())) ? "-" : BUILDTYPE_MAP.get(fjtEvaluation.getBuildType()));//ÎïҵÀàÐÍ + jsonObject.put("mj", fjtEvaluation.getHouseArea());//Ãæ»ý + String zj = "-"; + if(evaluationAudit != null && evaluationAudit.getInquirePrice() > 0){ + zj = String.valueOf((int)(evaluationAudit.getInquirePrice() / 10000)); + } + jsonObject.put("zj", zj);//×ܼÛ + jsonObject.put("ckj", (evaluationAudit == null || evaluationAudit.getHopePrice() == null) ? "-" : (int)(evaluationAudit.getHopePrice()/ 10000));//ÆÚÍû¼Û + jsonObject.put("zsj", (evaluationAudit == null || evaluationAudit.getLastPrice() == null) ? "-" : (int)(evaluationAudit.getLastPrice()/ 10000));//ÖÕÉó¼Û + jsonObject.put("zdr", StringUtils.isBlank(fjtEvaluation.getLender()) ? "-" : fjtEvaluation.getLender());//Ö÷´ûÈË + if(evaluationAudit==null || (evaluationAudit!=null && StringUtils.isBlank(evaluationAudit.getInquireRemark()))){ + jsonObject.put("pgsm","");//ÆÀ¹À˵Ã÷ + }else{ + jsonObject.put("pgsm",evaluationAudit.getInquireRemark());//ÆÀ¹À˵Ã÷ + } + + if (evaluationAudit!=null && evaluationAudit.getAuditStatus()==0) { + jsonObject.put("shzt", "¼۸ñ´ýÉóºË"); + + //½ÓÈëѯ¼۽á¹û²éѯ½ӿÚ + JSONObject obj = BHBankUtils.getInquireRecord(evaluationAudit.getQueryId()); + if(obj!=null){ + Integer totalPrice = (Integer) obj.get("inquirePrice"); + if(totalPrice>0){ + evaluationAudit.setAuditStatus(1); + evaluationAudit.setInquirePrice(totalPrice); + jsonObject.put("zj", (int)(totalPrice/10000)); + bohaiEvaluationAuditService.updateBohaiEvaluationAudit(evaluationAudit); + jsonObject.put("shzt", "¼۸ñÒÑÉóºË"); + } + } + } else if (evaluationAudit!=null && evaluationAudit.getAuditStatus()==1) { + jsonObject.put("shzt", "¼۸ñÒÑÉóºË"); + } else if (evaluationAudit!=null && evaluationAudit.getAuditStatus()==2) { + jsonObject.put("shzt", "¼۸ñ´ýÉóºË"); + if(evaluationAudit.getHopePrice()>0){ + //½ÓÈ뷴À¡½á¹û²éѯ½ӿÚ + JSONObject object = BHBankUtils.inquireFeedbackCall(evaluationAudit.getFeedbackId()); + if(object!=null){ + Integer feedbackStatus = (Integer) object.get("feedbackStatus"); + if(feedbackStatus!=0){ + int inquirePrice = (Integer) object.get("inquirePrice"); + evaluationAudit.setAuditStatus(3); + evaluationAudit.setLastPrice(inquirePrice); + evaluationAudit.setFeedbackStatus(feedbackStatus); + evaluationAudit.setFeedbackMsg((String)object.get("feedbackCallMsg")); + jsonObject.put("zsj",(int)(inquirePrice/ 10000));//ÖÕÉó¼Û + bohaiEvaluationAuditService.updateBohaiEvaluationAudit(evaluationAudit); + jsonObject.put("shzt", "ÉóºËÍê³É"); + } + } + } + }else if (evaluationAudit!=null && evaluationAudit.getAuditStatus()==3) { + jsonObject.put("shzt", "ÉóºËÍê³É"); + }else{ + jsonObject.put("shzt", "-"); + } + + UserTrades userTrade = userTradesService.findUserTradesByEvaluationId(String.valueOf(fjtEvaluation.getId())); + if(userTrade!=null){ + jsonObject.put("down", 1); + } + ja.add(jsonObject); + } + result.put("result", ja.toString()); + result.put("role", fjtUsers!=null? fjtUsers.getRole(): 0); + data.setModel(result); + return data; + } + /** * ¹À¼ۼǼÁбí * @param model @@ -243,6 +362,7 @@ public class WeiXinEvaluationController { return data; } + public Object inputAction(EvaluationModel model){ District district = districtService.findById(model.getId()); if(model.getEvaluation() == null){ @@ -277,7 +397,9 @@ public class WeiXinEvaluationController { evaluation.setCity(district.getCity()); evaluation.setRegion(district.getRegion()); evaluation.setDistrictName(district.getName()); - evaluation.setAddress(district.getAddress()); + if(StringUtils.isBlank(evaluation.getAddress())){ + evaluation.setAddress(district.getAddress()); + } evaluation.setUserId(userId); evaluation.setDateCreated(new Date()); evaluation.setLastUpdated(new Date()); @@ -294,14 +416,88 @@ public class WeiXinEvaluationController { } int avgPrice = districtStatService.findLatestDistrictAvgPrice(new DistrictKey(district), null); + + FjtUsers fjtUser = fjtUsersService.findById(Long.valueOf(userId)); + if(fjtUser!=null && fjtUser.getRole()==17) { + evaluation.setDirection(3);//²³º£³¯ÏòĬÈÏÄÏ + if(StringUtils.isBlank(evaluation.getUseType())){ + evaluation.setUseType("¾Óס"); + } +// BHBankUtils.getInquirePrice(model); + } if(avgPrice > 0){ long totalPrice = evaluationRateService.evaluation(avgPrice, evaluation); evaluation.setTotalPrice(Integer.valueOf(totalPrice+"")); evaluation.setAveragePrice((int)(totalPrice/evaluation.getHouseArea())); } + fjtEvaluationService.saveEvaluation(evaluation); + + if(fjtUser!=null && fjtUser.getRole()==17) { + List bhDists = BHBankUtils.getDistrictByBhbank(evaluation.getAddress()); + if(bhDists.size()<1){ + bhDists = BHBankUtils.getDistrictByBhbank(district.getName()); + } + Map bhMatchMap = new HashMap(); + if(bhDists.size()==1){ + JSONObject o = bhDists.get(0); + String bhDistName = (String)o.get("name"); + String regionCode = String.valueOf((Long)o.get("country")); + String bhRegion = BHBankUtils.regionCodeMap.get(regionCode); + bhMatchMap.put("preCode", (String)o.get("code")); + bhMatchMap.put("preName", bhDistName); + bhMatchMap.put("countryCode",regionCode); +// bhMatchMap.put("buildName",(String)o.get("address")); + }else{ + Map regionCodeMap = BHBankUtils.regionCodeMap; + String regionCode = null; + for(String key : regionCodeMap.keySet()){ + String value = regionCodeMap.get(key); + if(value.equals(district.getRegion())){ + regionCode = key; + break; + } + } + bhMatchMap.put("preName", district.getName()); + bhMatchMap.put("countryCode",regionCode); + System.out.println("¡¾²³º£ÒøÐС¿µØַ²éѯ·µ»ؽá¹û"+bhDists.size()+"¸ö"); + } + UsersDetail usersDetail = usersDetailService.findById(Long.valueOf(userId)); + if(StringUtils.isBlank(usersDetail.getMobile())){ + usersDetail.setMobile(fjtUser.getEmail()); + } + JSONObject bhApiResult = BHBankUtils.getInquirePrice(model, bhMatchMap, usersDetail, evaluation.getTotalPrice()); + if(bhApiResult!=null){ + JSONObject dataObj = (JSONObject) bhApiResult.get("data"); + String queryId = (String) dataObj.get("queryId"); + Integer inquirePrice = (Integer) dataObj.get("inquirePrice"); + Integer auditStatus = null; + String inquireRemark = (String) dataObj.get("remark"); + if((Integer) bhApiResult.get("errCode") == 1){//´ýÈ˹¤ºËÑé + auditStatus = 0; + }else if((Integer) bhApiResult.get("errCode") == 0){//Õý³£·µ»Ø + auditStatus = 1; + } + + BohaiEvaluationAudit audit = new BohaiEvaluationAudit(); + audit.setEvaluationId(evaluation.getId()); + audit.setQueryId(queryId); + audit.setBackStatus((Integer) bhApiResult.get("errCode") ); + audit.setUserId(userId); + audit.setInquirePrice(inquirePrice); + audit.setAuditStatus(auditStatus);//0:¼۸ñ´ýÉóºË 1:¼۸ñÒÑÉóºË 2£ºÓÐÆÚÍû¼Û 3£º¼۸ñȷÈÏ + if(StringUtils.isNotBlank(inquireRemark) && !inquireRemark.equals("None")){ + audit.setInquireRemark(inquireRemark); + } + audit.setDateCreated(new Date()); + audit.setDateCreated(new Date()); + bohaiEvaluationAuditService.saveBohaiEvaluationAudit(audit); + } + } + Map data = new HashMap(); data.put("id", String.valueOf(evaluation.getId())); + data.put("role", String.valueOf(fjtUser.getRole())); JsonModel json = new JsonModel(); json.setJsonModel(data); return json; @@ -380,6 +576,8 @@ public class WeiXinEvaluationController { model.setEvaluationAudit(evaluationAudit); if(fjtUser!=null && fjtUser.getRole()==17 && district.getCity().equals("ÉϺ£")){ + + Map retMap = getLoanInfo(district, evaluation.getHouseArea()); if(retMap!=null && retMap.size()>0){ model.setLoanInfoMap(retMap); @@ -387,6 +585,34 @@ public class WeiXinEvaluationController { } return model; } + + public Object bhreportAction(EvaluationModel model){ + String evaluationId = model.getEvaluationId(); + FjtEvaluation evaluation = fjtEvaluationService.findEvaluationById(Long.valueOf(evaluationId)); + model.setFjtEvaluation(evaluation); + DistrictStatBo districtStatBo = districtStatService.findDistrictStat(new DistrictKey(evaluation.getCity(), evaluation.getRegion(), evaluation.getDistrictName())); + model.setDistrictStatBo(districtStatBo); + + + FjtUsers fjtUser = fjtUsersService.findById(evaluation.getUserId()); + model.setRole(fjtUser.getRole()); + + District district = districtService.findDistrict(new DistrictKey(evaluation.getCity(), evaluation.getRegion(), evaluation.getDistrictName()), "district"); + model.setId(district.getId()); + //²ο¼¼Û + BohaiEvaluationAudit bohaiEvaluationAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(Long.valueOf(evaluationId)); + model.setBohaiEvaluationAudit(bohaiEvaluationAudit); + + + + if(fjtUser!=null && fjtUser.getRole()==17 && district.getCity().equals("ÉϺ£")){ + Map retMap = getLoanInfo(district, evaluation.getHouseArea()); + if(retMap!=null && retMap.size()>0){ + model.setLoanInfoMap(retMap); + } + } + return model; + } //To C ±¨¸æ½á¹ûҳ public Object resultAction(EvaluationModel model){ @@ -580,8 +806,6 @@ public class WeiXinEvaluationController { evaluationAudit.setVersion(1); evaluationAuditService.save(evaluationAudit); } - - String smsContent = "¡¾·¿¼ÛÍø¡¿΢ÐŶ˵÷¼۵Øַ£º"+evaluationAudit.getCity()+" "+evaluationAudit.getInput()+"£¬³ɽ»¼ۣº"+evaluationAudit.getDealPrice()+"Íò£¬Ç뼰ʱÉóºˣ¡Óû§ÓÊÏä: "+evaluationAudit.getUserName(); try { for (String mobile : MOBILES) { @@ -596,6 +820,40 @@ public class WeiXinEvaluationController { return jsonMmodel; } + public Object saveHopePriceAction(EvaluationModel model){ + JsonModel jsonMmodel = new JsonModel(); + if(StringUtils.isNotBlank(model.getEvaluationId()) && model.getHopePrice()!=null){ + BohaiEvaluationAudit evaluationAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(Long.valueOf(model.getEvaluationId())); + if(evaluationAudit != null){ + evaluationAudit.setHopePrice(model.getHopePrice()*10000); + evaluationAudit.setLastUpdated(new Date()); + evaluationAudit.setAuditStatus(2); + + //ÆÚÍû¼۷´À¡½ӿÚ + UsersDetail usersDetail = usersDetailService.findById(evaluationAudit.getUserId()); + String feedbackId = BHBankUtils.inquireFeedback(usersDetail.getName(), evaluationAudit.getQueryId(), model.getHopePrice()); + if(StringUtils.isNotBlank(feedbackId)){ + evaluationAudit.setFeedbackId(feedbackId); + } + bohaiEvaluationAuditService.updateBohaiEvaluationAudit(evaluationAudit); + } + } + return jsonMmodel; + } + + public Object saveBhRemarkAction(EvaluationModel model){ + JsonModel jsonMmodel = new JsonModel(); + if(StringUtils.isNotBlank(model.getEvaluationId()) && StringUtils.isNotBlank(model.getRemark())){ + BohaiEvaluationAudit evaluationAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(Long.valueOf(model.getEvaluationId())); + if(evaluationAudit != null){ + evaluationAudit.setRemark(model.getRemark()); + evaluationAudit.setLastUpdated(new Date()); + bohaiEvaluationAuditService.updateBohaiEvaluationAudit(evaluationAudit); + } + } + return jsonMmodel; + } + //ˢÐÂÉóº˼Û public Object refreshAuditPriceAction(EvaluationModel model){ JsonModel jsonMmodel = new JsonModel(); @@ -611,6 +869,22 @@ public class WeiXinEvaluationController { jsonMmodel.setJsonModel(dataMap); return jsonMmodel; } + + + public Object refreshBhAuditPriceAction(EvaluationModel model){ + JsonModel jsonMmodel = new JsonModel(); + Map dataMap = new HashMap(); + if(StringUtils.isNotBlank(model.getEvaluationId()) ){ + + BohaiEvaluationAudit bohaiEvaluationAudit = bohaiEvaluationAuditService.findByBohaiEvaluationAuditId(Long.valueOf(model.getEvaluationId())); + if(bohaiEvaluationAudit != null){ + dataMap.put("lastPrice", bohaiEvaluationAudit.getLastPrice()); + dataMap.put("hopePrice", bohaiEvaluationAudit.getHopePrice()); + } + } + jsonMmodel.setJsonModel(dataMap); + return jsonMmodel; + } public Object collectsAction(EvaluationModel model, HttpServletRequest req, @Param(name = "page") String page){ @@ -937,4 +1211,8 @@ public class WeiXinEvaluationController { public void setPriceBorderService(PriceBorderService priceBorderService) { this.priceBorderService = priceBorderService; } + + public void setBohaiEvaluationAuditService(BohaiEvaluationAuditService bohaiEvaluationAuditService) { + this.bohaiEvaluationAuditService = bohaiEvaluationAuditService; + } } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/DistrictModel.java b/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/DistrictModel.java index 3f0b81226..5f9c5a223 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/DistrictModel.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/DistrictModel.java @@ -47,6 +47,11 @@ public class DistrictModel extends BaseModel { // ÅжÏÊǷñÐèҪ²éѯ¾ù¼ۣ¬falseÔòµ÷Ó÷½×Լºȥ×éװ¼۸ñ private Boolean showPrice = true; + +// private String preCode;//²³º£½ӿÚ--¥Å̱àÂë +// private String preName;//²³º£½ӿÚ--¥ÅÌÃû³Æ +// private String countryCode;//²³º£½ӿÚ--ÇøÓò±àÂë +// private String buildName;//²³º£½ӿÚ--µØַ /** * ÅжÏÊDz»ÊÇÓѴï @@ -205,4 +210,35 @@ public class DistrictModel extends BaseModel { this.isYouDa = isYouDa; } +// public String getPreCode() { +// return preCode; +// } +// +// public void setPreCode(String preCode) { +// this.preCode = preCode; +// } +// +// public String getPreName() { +// return preName; +// } +// +// public void setPreName(String preName) { +// this.preName = preName; +// } +// +// public String getCountryCode() { +// return countryCode; +// } +// +// public void setCountryCode(String countryCode) { +// this.countryCode = countryCode; +// } +// +// public String getBuildName() { +// return buildName; +// } +// +// public void setBuildName(String buildName) { +// this.buildName = buildName; +// } } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/EvaluationModel.java b/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/EvaluationModel.java index 1282b227f..f6cd5a7fd 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/EvaluationModel.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/model/weixin/EvaluationModel.java @@ -5,6 +5,7 @@ import java.util.List; import java.util.Map; import com.fangjia.dal.seaweed.model.District; +import com.fangjia.dal.sql.model.BohaiEvaluationAudit; import com.fangjia.dal.sql.model.EvaluationAudit; import com.fangjia.dal.sql.model.FjtEvaluation; import com.fangjia.open.model.BaseModel; @@ -32,6 +33,7 @@ public class EvaluationModel extends BaseModel{ private long sellHouseCount; private long rentHouseCount; private EvaluationAudit evaluationAudit; + private BohaiEvaluationAudit bohaiEvaluationAudit; private String lender; private Double dealPrice; private List evaluations; @@ -40,6 +42,12 @@ public class EvaluationModel extends BaseModel{ private Integer role; private String cardId; private Map loanInfoMap; + private Integer hopePrice; + private String remark; +// private String preCode;//²³º£½ӿÚ--¥Å̱àÂë +// private String preName;//²³º£½ӿÚ--¥ÅÌÃû³Æ +// private String countryCode;//²³º£½ӿÚ--ÇøÓò±àÂë +// private String buildName;//²³º£½ӿÚ--µØַ public void setId(String id) { @@ -196,4 +204,60 @@ public class EvaluationModel extends BaseModel{ public void setLoanInfoMap(Map loanInfoMap) { this.loanInfoMap = loanInfoMap; } + + public BohaiEvaluationAudit getBohaiEvaluationAudit() { + return bohaiEvaluationAudit; + } + + public void setBohaiEvaluationAudit(BohaiEvaluationAudit bohaiEvaluationAudit) { + this.bohaiEvaluationAudit = bohaiEvaluationAudit; + } + + public Integer getHopePrice() { + return hopePrice; + } + + public void setHopePrice(Integer hopePrice) { + this.hopePrice = hopePrice; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + // public String getPreCode() { +// return preCode; +// } +// +// public void setPreCode(String preCode) { +// this.preCode = preCode; +// } +// +// public String getPreName() { +// return preName; +// } +// +// public void setPreName(String preName) { +// this.preName = preName; +// } +// +// public String getCountryCode() { +// return countryCode; +// } +// +// public void setCountryCode(String countryCode) { +// this.countryCode = countryCode; +// } +// +// public String getBuildName() { +// return buildName; +// } +// +// public void setBuildName(String buildName) { +// this.buildName = buildName; +// } } diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/util/BHBankUtils.java b/projects/fangjia-open/src/main/java/com/fangjia/open/util/BHBankUtils.java new file mode 100644 index 000000000..06d9f05f6 --- /dev/null +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/util/BHBankUtils.java @@ -0,0 +1,282 @@ +package com.fangjia.open.util; + +import com.fangjia.core.util.HttpRequest; +import com.fangjia.core.util.MD5Util; +import com.fangjia.dal.sql.model.FjtEvaluation; +import com.fangjia.dal.sql.model.UsersDetail; +import com.fangjia.open.model.weixin.EvaluationModel; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; +import org.apache.commons.lang.StringUtils; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.*; + +public class BHBankUtils { + +// public static String token = "bohaifangjiatest";//²âÊÔtoken + public static String token = "bohaifangjia";//Õýʽtoken + public static String nonce = "818975"; +// public static String uri = "http://topen.shbrea.com.cn/API";//²âÊÔ + public static String uri ="https://open.shbrea.com.cn/API"; + + public static Map regionCodeMap = new HashMap(){{ + put("310101000000","»ÆÆÖ"); + put("310104000000","Ðì»ã"); + put("310105000000","³¤Äþ"); + put("310106000000","¾²°²"); + put("310107000000","ÆÕÍÓ"); + put("310109000000","ºç¿Ú"); + put("310110000000","ÑîÆÖ"); + put("310112000000","ãÉÐÐ"); + put("310113000000","±¦ɽ"); + put("310114000000","¼ζ¨"); + put("310115000000","Æֶ«"); + put("310116000000","½ðɽ"); + put("310117000000","Ëɽ­"); + put("310118000000","ÇàÆÖ"); + put("310120000000","·îÏÍ"); + put("310230000000","³çÃ÷"); + }}; + + public static List getDistrictByBhbank(String address){ + + List list = new ArrayList(); + Map params = new HashMap(); + params.put("keyword",address); + + Integer date1 = (int)(new Date().getTime()/1000); + String str = token + date1.toString()+nonce; + String md5str2 = MD5Util.encrypt(str,"utf-8"); + + Map headers = new HashMap(); + headers.put("timestamp", date1.toString()); + headers.put("sign", md5str2); + headers.put("nonce", nonce.toString()); + HttpRequest request = new HttpRequest(); + String content = null; + try { + content = request.get(uri +"/searchAddr/bh/", params, headers, "utf-8"); + if(StringUtils.isNotBlank(content)){ + JSONObject jsonObj = JSONObject.fromObject(content); + JSONArray data = (JSONArray) jsonObj.get("data"); + if(data.size()>0){ + for(int i=0;i bhMatchMap, UsersDetail usersDetail, int fjwTotalPrice){ + List list = new ArrayList(); + Map params = new HashMap(); + FjtEvaluation ev = model.getFjtEvaluation(); + String queryFullAddr = ev.getAddress(); + if(StringUtils.isNotBlank(ev.getHouseNum())){ + queryFullAddr = queryFullAddr + ev.getHouseNum()+"ºÅ"; + } + if(StringUtils.isNotBlank(ev.getRoomNum())){ + queryFullAddr = queryFullAddr + ev.getRoomNum()+"ÊÒ"; + } + params.put("queryFullAddr",queryFullAddr);//¼ÓÁË¥¶°ºźÍÊҺÅ403 + if(bhMatchMap.containsKey("preCode")){ + params.put("preCode", bhMatchMap.get("preCode")); + } + if(bhMatchMap.containsKey("preName")){ + params.put("preName", bhMatchMap.get("preName")); + } + if(bhMatchMap.containsKey("countryCode")){ + params.put("countryCode", bhMatchMap.get("countryCode")); + } + + if(StringUtils.isNotBlank(ev.getAddress())){ + params.put("buildName", ev.getAddress()); + } + if(StringUtils.isNotBlank(ev.getUnitNum())){ + params.put("unitCode", ev.getUnitNum()); + } + if(ev.getHouseFloor()>0){ + params.put("floor", String.valueOf(ev.getHouseFloor())); + } + if(ev.getHouseHight()>0){ + params.put("totalFloor", String.valueOf(ev.getHouseHight())); + } + if(StringUtils.isNotBlank(ev.getRoomNum())){ + params.put("houseNo",ev.getRoomNum()); + } + if(ev.getHouseArea()>0){ + params.put("groundArea", String.valueOf(ev.getHouseArea())); + } + params.put("orientName", "ÄÏ"); + params.put("buildYear", ev.getFinishDateStr()); + fjwTotalPrice= (int)(fjwTotalPrice/10000) * 10000; + params.put("dealPriceTotal", String.valueOf(fjwTotalPrice)); + + params.put("userName", usersDetail.getName()); + params.put("userPhone", usersDetail.getPhone()); +// params.put("userMail", ""); + params.put("groupName", usersDetail.getOrgName()); + + + List lists = Arrays.asList("queryFullAddr", "preCode", "preName", "countryCode", "buildName", "unitCode","floor","totalFloor","houseNo","groundArea","undergroundArea","orientName","buildYear","dealPriceTotal","specialNo","userName","userPhone","userMail","groupName"); + + String s = ""; + for(String key : lists){ + String value = (String)params.get(key); + if(StringUtils.isNotBlank(value)){ + s = s + value; + } + } + String s1 = null; + try { + s1 = URLEncoder.encode(s,"utf-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + Integer date1 = (int)(new Date().getTime()/1000); + String str = token + date1.toString()+nonce+ s1; + String md5str2 = MD5Util.encrypt(str,"utf-8"); + + Map headers = new HashMap(); + headers.put("timestamp", date1.toString()); + headers.put("sign", md5str2); + headers.put("nonce", nonce.toString()); + HttpRequest request = new HttpRequest(); + String content = null; + try { + content = request.post(uri +"/inquirePrice/bh/", params, headers, "utf-8"); + if(StringUtils.isNotBlank(content)){ + JSONObject jsonObj = JSONObject.fromObject(content); + return jsonObj; + } + }catch (Exception e){ + e.printStackTrace(); + } + return null; + } + + public static JSONObject getInquireRecord(String queryId){ + List list = new ArrayList(); + Map params = new HashMap(); + params.put("queryId",queryId); + + Integer date1 = (int)(new Date().getTime()/1000); + String str = token + date1.toString()+nonce; + String md5str2 = MD5Util.encrypt(str,"utf-8"); + + Map headers = new HashMap(); + headers.put("timestamp", date1.toString()); + headers.put("sign", md5str2); + headers.put("nonce", nonce.toString()); + HttpRequest request = new HttpRequest(); + String content = null; + try { + content = request.get(uri + "/inquireRecord/bh/", params, headers, "utf-8"); + if(StringUtils.isNotBlank(content)){ + JSONObject jsonObj = JSONObject.fromObject(content); + JSONObject data = (JSONObject) jsonObj.get("data"); + if(data.size()>0){ + return data; + } + } + }catch (Exception e){ + e.printStackTrace(); + } + return null; + } + + public static String inquireFeedback(String name, String queryId, Integer hopePrice){ + String feedbackId = null; + List list = new ArrayList(); + Map params = new HashMap(); + params.put("queryId",queryId); + params.put("userName",name); + params.put("feedbackMsg","ÆÚÍû¼ۣº"+hopePrice+"Íò"); + + List lists = Arrays.asList("queryId", "userName", "feedbackMsg"); + + String s = ""; + for(String key : lists){ + String value = (String)params.get(key); + if(StringUtils.isNotBlank(value)){ + s = s + value; + } + } + String s1 = null; + try { + s1 = URLEncoder.encode(s,"utf-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + Integer date1 = (int)(new Date().getTime()/1000); + String str = token + date1.toString()+nonce+ s1; + String md5str2 = MD5Util.encrypt(str,"utf-8"); + + Map headers = new HashMap(); + headers.put("timestamp", date1.toString()); + headers.put("sign", md5str2); + headers.put("nonce", nonce.toString()); + HttpRequest request = new HttpRequest(); + String content = null; + try { + content = request.post(uri+"/inquireFeedback/bh/", params, headers, "utf-8"); + if(StringUtils.isNotBlank(content)){ + JSONObject jsonObj = JSONObject.fromObject(content); + Integer code = (Integer) jsonObj.get("errCode"); + if (code == 0) { + JSONObject data = (JSONObject) jsonObj.get("data"); + if(data.size()>0){ + feedbackId = (String) data.get("feedbackId"); + } + } + + } + }catch (Exception e){ + e.printStackTrace(); + } + return feedbackId; + } + + + public static JSONObject inquireFeedbackCall(String feedbackId){ + + List list = new ArrayList(); + Map params = new HashMap(); + params.put("feedbackId",feedbackId); + + Integer date1 = (int)(new Date().getTime()/1000); + String str = token + date1.toString()+nonce; + String md5str2 = MD5Util.encrypt(str,"utf-8"); + + Map headers = new HashMap(); + headers.put("timestamp", date1.toString()); + headers.put("sign", md5str2); + headers.put("nonce", nonce.toString()); + HttpRequest request = new HttpRequest(); + String content = null; + try { + content = request.get(uri+"/inquireFeedbackCall/bh/", params, headers, "utf-8"); + if(StringUtils.isNotBlank(content)){ + JSONObject jsonObj = JSONObject.fromObject(content); + Integer code = (Integer) jsonObj.get("errCode"); + if(code == 0){ + JSONObject data = (JSONObject) jsonObj.get("data"); + return data; + } + + } + }catch (Exception e){ + e.printStackTrace(); + } + return null; + } +} diff --git a/projects/fangjia-open/src/main/resources/persistence-goojia-fangjia.xml b/projects/fangjia-open/src/main/resources/persistence-goojia-fangjia.xml index fea498f8a..a853e4c82 100644 --- a/projects/fangjia-open/src/main/resources/persistence-goojia-fangjia.xml +++ b/projects/fangjia-open/src/main/resources/persistence-goojia-fangjia.xml @@ -15,6 +15,7 @@ com.fangjia.dal.sql.model.UsersDetail com.fangjia.dal.sql.model.EvaluationAudit com.fangjia.dal.sql.model.GoldLogs + com.fangjia.dal.sql.model.BohaiEvaluationAudit true \ No newline at end of file diff --git a/projects/fangjia-open/src/main/webapp/district/weXinList.ftl b/projects/fangjia-open/src/main/webapp/district/weXinList.ftl index 62e8a4f8d..3e07b5ef4 100644 --- a/projects/fangjia-open/src/main/webapp/district/weXinList.ftl +++ b/projects/fangjia-open/src/main/webapp/district/weXinList.ftl @@ -50,7 +50,12 @@ <#if type?? && type == 'b'>