Authored by LUOXC

Merge branch 'test6.9.13' of http://git.yoho.cn/ufo/yohoufo-fore into test6.9.13

@@ -11,6 +11,7 @@ public interface SaleCategoryMapper { @@ -11,6 +11,7 @@ public interface SaleCategoryMapper {
11 SaleCategory selectByPrimaryKey(Integer id); 11 SaleCategory selectByPrimaryKey(Integer id);
12 12
13 List<SaleCategory> selectValid(); 13 List<SaleCategory> selectValid();
  14 + List<SaleCategory> selectXianyuLevel1();
14 15
15 List<SaleCategory> selectByPidList(@Param("pidList") List<Integer> pidList); 16 List<SaleCategory> selectByPidList(@Param("pidList") List<Integer> pidList);
16 } 17 }
@@ -30,6 +30,13 @@ @@ -30,6 +30,13 @@
30 from sale_category where status=0 and level=1 30 from sale_category where status=0 and level=1
31 order by order_by desc 31 order by order_by desc
32 </select> 32 </select>
  33 +
  34 + <select id="selectXianyuLevel1" resultMap="BaseResultMap">
  35 + select
  36 + <include refid="Base_Column_List" />
  37 + from sale_category where status=0 and level=1 and show_in_xianyu='show'
  38 + order by order_by desc
  39 + </select>
33 40
34 <select id="selectByPidList" resultMap="BaseResultMap"> 41 <select id="selectByPidList" resultMap="BaseResultMap">
35 select <include refid="Base_Column_List" /> 42 select <include refid="Base_Column_List" />
@@ -105,6 +105,7 @@ public class DepositServiceImpl implements DepositService { @@ -105,6 +105,7 @@ public class DepositServiceImpl implements DepositService {
105 @Autowired 105 @Autowired
106 private AppraiseOrderMapper appraiseOrderMapper; 106 private AppraiseOrderMapper appraiseOrderMapper;
107 107
  108 +
108 @Autowired 109 @Autowired
109 private ConfigReader configReader; 110 private ConfigReader configReader;
110 111
@@ -22,9 +22,6 @@ public class GuessLikeResourceParse implements IResourceParse { @@ -22,9 +22,6 @@ public class GuessLikeResourceParse implements IResourceParse {
22 22
23 public static final String TEMPLATE_NAME="guessLike"; 23 public static final String TEMPLATE_NAME="guessLike";
24 24
25 - @javax.annotation.Resource  
26 - private MakeUrlService makeUrlService;  
27 -  
28 @Override 25 @Override
29 public Serializable parse(Resource resource) { 26 public Serializable parse(Resource resource) {
30 try { 27 try {
@@ -46,11 +43,29 @@ public class GuessLikeResourceParse implements IResourceParse { @@ -46,11 +43,29 @@ public class GuessLikeResourceParse implements IResourceParse {
46 JSONObject list = data.getJSONObject("data").getJSONObject("list"); 43 JSONObject list = data.getJSONObject("data").getJSONObject("list");
47 for (String key : list.keySet()) { 44 for (String key : list.keySet()) {
48 JSONObject value = list.getJSONObject(key); 45 JSONObject value = list.getJSONObject(key);
  46 +
  47 + // 用query的json 代替原来的k=1&v=2
  48 + value.put("query",getQueryArray(value.getString("query")));
  49 +
49 value.put("tab_name", value.getString("tab_name")); 50 value.put("tab_name", value.getString("tab_name"));
50 - value.put("url", makeUrlService.makeUrl(value.getJSONObject("url"), resource.getClientType()));  
51 } 51 }
52 return data; 52 return data;
53 } 53 }
54 54
  55 + private JSONArray getQueryArray(String queryParam) {
  56 + if (StringUtils.isBlank(queryParam)){
  57 + return new JSONArray();
  58 + }
55 59
  60 + JSONArray queryArray = new JSONArray();
  61 + // k1=v1&k2=v2
  62 + String[] kys = queryParam.split("&");
  63 + for (String ky : kys){
  64 + JSONObject queryObj = new JSONObject();
  65 + String[] kvItem = ky.split("=");
  66 + queryObj.put(kvItem[0], kvItem[1]);
  67 + queryArray.add(queryObj);
  68 + }
  69 + return queryArray;
  70 + }
56 } 71 }
1 package com.yohoufo.resource.service.impl.resource; 1 package com.yohoufo.resource.service.impl.resource;
2 2
3 import com.alibaba.fastjson.JSONObject; 3 import com.alibaba.fastjson.JSONObject;
  4 +import com.yohoufo.resource.helper.MakeUrlService;
  5 +import com.yohoufo.resource.service.IResourceParse;
  6 +import com.yohoufo.resource.service.Resource;
4 import org.slf4j.Logger; 7 import org.slf4j.Logger;
5 import org.slf4j.LoggerFactory; 8 import org.slf4j.LoggerFactory;
6 import org.springframework.beans.factory.annotation.Autowired; 9 import org.springframework.beans.factory.annotation.Autowired;
7 import org.springframework.stereotype.Service; 10 import org.springframework.stereotype.Service;
  11 +
8 import com.yohoufo.resource.service.IResourceParse; 12 import com.yohoufo.resource.service.IResourceParse;
9 import com.yohoufo.resource.helper.MakeUrlService; 13 import com.yohoufo.resource.helper.MakeUrlService;
10 import com.yohoufo.resource.service.Resource; 14 import com.yohoufo.resource.service.Resource;