wangxiaoming před 6 roky
rodič
revize
c5a3244fc1

+ 146 - 0
watero-common-core/src/main/java/com/iamberry/wechat/core/entity/product/IndexProduct.java

@@ -0,0 +1,146 @@
+package com.iamberry.wechat.core.entity.product;
+
+import  java.io.Serializable;
+import java.util.Date;
+
+/**
+ *  首页热销产品类
+ * @author xm
+ * @Date 2019-03-26
+ */
+public class IndexProduct  implements  Serializable{
+    private static final long serialVersionUID = -1352167235091303738L;
+    //id
+    private Integer indeProdId;
+    //产品id
+    private Integer productId;
+    //颜色id
+    private Integer colorId;
+    //排序
+    private Integer indeProdSort;
+    //状态: 1使用中 2未使用'
+    private Integer indeProdStatus;
+
+    private Integer colorProductId;		//所属产品id
+    private String colorProductName;	    //所属产品名称
+    private String colorProductPic;		//产品介绍图
+    private Integer colorProductType;	//产品类型
+    private String colorName;			    //颜色名称
+    private Integer colorDiscount;		//产品折扣价
+    private Integer colorPrice;			//产品市场价
+    private String color69Code;			//产品69码
+    private String colorImg;	//图片
+
+
+    public Integer getIndeProdId(){
+        return indeProdId;
+    }
+
+    public void setIndeProdId(Integer  indeProdId){
+        this.indeProdId=indeProdId;
+    }
+
+    public Integer getProductId(){
+        return productId;
+    }
+
+    public void setProductId(Integer  productId){
+        this.productId=productId;
+    }
+
+    public Integer getIndeProdSort(){
+        return indeProdSort;
+    }
+
+    public void setIndeProdSort(Integer  indeProdSort){
+        this.indeProdSort=indeProdSort;
+    }
+
+    public Integer getIndeProdStatus(){
+        return indeProdStatus;
+    }
+
+    public void setIndeProdStatus(Integer  indeProdStatus){
+        this.indeProdStatus=indeProdStatus;
+    }
+
+    public Integer getColorId() {
+        return colorId;
+    }
+
+    public void setColorId(Integer colorId) {
+        this.colorId = colorId;
+    }
+
+    public Integer getColorProductId() {
+        return colorProductId;
+    }
+
+    public void setColorProductId(Integer colorProductId) {
+        this.colorProductId = colorProductId;
+    }
+
+    public String getColorProductName() {
+        return colorProductName;
+    }
+
+    public void setColorProductName(String colorProductName) {
+        this.colorProductName = colorProductName;
+    }
+
+    public String getColorProductPic() {
+        return colorProductPic;
+    }
+
+    public void setColorProductPic(String colorProductPic) {
+        this.colorProductPic = colorProductPic;
+    }
+
+    public Integer getColorProductType() {
+        return colorProductType;
+    }
+
+    public void setColorProductType(Integer colorProductType) {
+        this.colorProductType = colorProductType;
+    }
+
+    public String getColorName() {
+        return colorName;
+    }
+
+    public void setColorName(String colorName) {
+        this.colorName = colorName;
+    }
+
+    public Integer getColorDiscount() {
+        return colorDiscount;
+    }
+
+    public void setColorDiscount(Integer colorDiscount) {
+        this.colorDiscount = colorDiscount;
+    }
+
+    public Integer getColorPrice() {
+        return colorPrice;
+    }
+
+    public void setColorPrice(Integer colorPrice) {
+        this.colorPrice = colorPrice;
+    }
+
+    public String getColor69Code() {
+        return color69Code;
+    }
+
+    public void setColor69Code(String color69Code) {
+        this.color69Code = color69Code;
+    }
+
+    public String getColorImg() {
+        return colorImg;
+    }
+
+    public void setColorImg(String colorImg) {
+        this.colorImg = colorImg;
+    }
+}

+ 11 - 0
watero-common-core/src/main/java/com/iamberry/wechat/core/entity/product/ProductColor.java

@@ -31,6 +31,9 @@ public class ProductColor implements java.io.Serializable{
 
 	private String colorImg;	//图片
 
+	//1:使用中 2:未使用'
+	private Integer colorStatus;
+
 	private PageBean page = new PageBean();		//分页
 	
 	public Integer getColorProductType() {
@@ -137,6 +140,14 @@ public class ProductColor implements java.io.Serializable{
 		this.colorImg = colorImg;
 	}
 
+	public Integer getColorStatus() {
+		return colorStatus;
+	}
+
+	public void setColorStatus(Integer colorStatus) {
+		this.colorStatus = colorStatus;
+	}
+
 	@Override
 	public String toString() {
 		return "ProductColor [colorId=" + colorId + ", colorProductId="

+ 193 - 0
watero-common-tool/src/main/java/com/iamberry/redis/RedisUtils.java

@@ -0,0 +1,193 @@
+package com.iamberry.redis;
+
+import com.alibaba.fastjson.JSONObject;
+import com.iamberry.wechat.tools.NameUtils;
+import org.apache.log4j.Logger;
+import redis.clients.jedis.Jedis;
+import redis.clients.jedis.JedisPool;
+import redis.clients.jedis.JedisPoolConfig;
+
+import java.util.List;
+
+/**
+ * redis工具类
+ * @author root
+ */
+public class RedisUtils {
+
+    /**ip*/
+    private static final String IP = NameUtils.getConfig("redis_host");
+    /**端口*/
+    private static final int PORT = Integer.parseInt(NameUtils.getConfig("redis_port"));
+    /**密码(原始默认是没有密码)*/
+    private static final String AUTH = NameUtils.getConfig("redis_auth");
+    /**最大连接数*/
+    private static int   MAX_ACTIVE = Integer.parseInt(NameUtils.getConfig("redis_max_active"));
+    /**设置最大空闲数*/
+    private static int   MAX_IDLE = Integer.parseInt(NameUtils.getConfig("redis_max_idle"));
+    /**最大连接时间*/
+    private static int   MAX_WAIT = Integer.parseInt(NameUtils.getConfig("redis_max_wait"));
+    /**超时时间*/
+    private static int   TIMEOUT = Integer.parseInt(NameUtils.getConfig("redis_timeout"));
+
+    private static JedisPool pool = null;
+
+    private static Logger logger = Logger.getLogger(RedisUtils.class);
+
+    static {
+        /*
+         * 初始化线程池(只在类进行初始化的时候进行一次)
+         */
+        JedisPoolConfig config = new JedisPoolConfig();
+        config.setMaxTotal(MAX_ACTIVE);
+        config.setMaxIdle(MAX_IDLE);
+        config.setMaxWaitMillis(MAX_WAIT);
+        config.setTestOnBorrow(false);
+        config.setTestOnReturn(true);
+        config.setTestWhileIdle(true);
+        pool = new JedisPool(config, IP, PORT, TIMEOUT);
+    }
+
+    /**
+     * 获取连接
+     */
+    private static synchronized Jedis getJedis() {
+        try {
+            if(pool != null) {
+                Jedis jedis = pool.getResource();
+                jedis.auth(AUTH);
+                return jedis;
+            } else {
+                throw new RuntimeException("获取失败Redis实例失败,请重试");
+            }
+        } catch (Exception e) {
+            logger.error("", e);
+            throw e;
+        }
+    }
+
+    /**
+     * 插入对象
+     * @param key
+     * @param obj
+     * @return
+     */
+    public static boolean put(String key, Object obj) {
+        Jedis jedis = null;
+        try {
+            String value = JSONObject.toJSONString(obj);
+            jedis = getJedis();
+            return "ok".equalsIgnoreCase(jedis.set(key, value));
+        } catch (Exception e) {
+            logger.error("", e);
+        } finally {
+            getColse(jedis);
+        }
+        return false;
+    }
+
+    /**
+     * 插入对象
+     * @param key
+     * @param value
+     * @return
+     */
+    public static boolean put(String key, String value) {
+        Jedis jedis = null;
+        try {
+            jedis = getJedis();
+            return "ok".equalsIgnoreCase(jedis.set(key, value));
+        } catch (Exception e) {
+            logger.error("", e);
+        } finally {
+            getColse(jedis);
+        }
+        return false;
+    }
+
+    /**
+     * 获取单个对象
+     * @param key
+     * @param clazz
+     * @return
+     */
+    public static <T> T get(String key, Class<T> clazz) {
+        Jedis jedis = null;
+        try {
+            jedis = getJedis();
+            String result = jedis.get(key);
+            return JSONObject.parseObject(result, clazz);
+        } catch (Exception e) {
+            logger.error("", e);
+        } finally {
+            getColse(jedis);
+        }
+        return null;
+    }
+
+    /**
+     * 获取单个String对象
+     * @param key
+     * @return
+     */
+    public static String get(String key) {
+        Jedis jedis = null;
+        try {
+            jedis = getJedis();
+            return jedis.get(key);
+        } catch (Exception e) {
+            logger.error("", e);
+        } finally {
+            getColse(jedis);
+        }
+        return null;
+    }
+
+    /**
+     * 获取list集合
+     * @param key
+     * @param clazz
+     * @return
+     */
+    public static <T> List<T> list(String key, Class<T> clazz) {
+        Jedis jedis = null;
+        try {
+            jedis = getJedis();
+            String result = jedis.get(key);
+            return JSONObject.parseArray(result, clazz);
+        } catch (Exception e) {
+            logger.error("", e);
+        } finally {
+            getColse(jedis);
+        }
+        return null;
+    }
+
+    /**
+     * 删除key
+     * @param key
+     * @return
+     */
+    public static boolean del(String key) {
+        Jedis jedis = null;
+        try {
+            jedis = getJedis();
+            return jedis.del(key) >= 1;
+        } catch (Exception e) {
+            logger.error("", e);
+        } finally {
+            getColse(jedis);
+        }
+        return false;
+    }
+
+    /**
+     * 关闭连接
+     * @param jedis
+     */
+    private static void getColse(Jedis jedis) {
+        if(jedis != null) {
+            jedis.close();
+        }
+    }
+}

+ 1 - 0
watero-common-tool/src/main/java/com/iamberry/wechat/tools/NameUtils.java

@@ -102,4 +102,5 @@ public class NameUtils {
      * 验证码类型为仅小写字母 
      */  
     public static final int TYPE_LOWER_ONLY = 6;
+
 }

+ 1 - 2
watero-common-web/src/main/java/com/iamberry/common/web/SimpleCORSFilter.java

@@ -33,11 +33,10 @@ public class SimpleCORSFilter implements Filter {
 		origins.add("static.watero.cn");
 		origins.add("static.iamberry.com");
 		origins.add("s.iamberry.com");
-		origins.add("w.iamberry.com:801");
-		origins.add("test.iamberry.com:801");
 		origins.add("w.iamberry.com:8848");
 		origins.add("test.iamberry.com:8848");
 		origins.add("rst.iamberry.com:8848");
+		origins.add("static.iamberry.com:8848");
 	}
     public void init(FilterConfig filterConfig) throws ServletException {}
     public void doFilter(ServletRequest servletRequest, ServletResponse

+ 43 - 0
watero-wechat-interface/src/main/java/com/iamberry/wechat/face/porduct/IndexProductService.java

@@ -0,0 +1,43 @@
+package com.iamberry.wechat.face.porduct;
+
+import com.iamberry.wechat.core.entity.product.IndexProduct;
+
+import java.util.List;
+
+/**
+ *  首页热销产品接口
+ * @author xm
+ * @Date 2019-03-26
+ */
+public interface IndexProductService {
+    /**
+     * 获取集合
+     * @param  indexProduct
+     * @return List
+     */
+    List<IndexProduct> getIndexProductList(IndexProduct  indexProduct);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  indexProduct
+     */
+    IndexProduct  getIndexProductById(Integer  id);
+    /**
+     * 增加数据
+     * @param  indexProduct
+     * @return Integer
+     */
+    Integer  save(IndexProduct  indexProduct);
+    /**
+     * 修改数据
+     * @param  indexProduct
+     * @return Integer
+     */
+    Integer  update(IndexProduct  indexProduct);
+    /**
+     * 删除数据
+     * @param  id
+     * @return Integer
+     */
+    Integer  delete(Integer  id);
+}

+ 43 - 0
watero-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/IndexProductMapper.java

@@ -0,0 +1,43 @@
+package com.iamberry.wechat.service.mapper;
+
+import com.iamberry.wechat.core.entity.product.IndexProduct;
+
+import java.util.List;
+
+/**
+ *  首页热销产品接口
+ * @author xm
+ * @Date 2019-03-26
+ */
+public interface IndexProductMapper {
+    /**
+     * 获取集合
+     * @param  indexProduct
+     * @return List
+     */
+    List<IndexProduct> getIndexProductList(IndexProduct  indexProduct);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  indexProduct
+     */
+    IndexProduct  getIndexProductById(Integer  id);
+    /**
+     * 增加数据
+     * @param  indexProduct
+     * @return Integer
+     */
+    Integer  save(IndexProduct  indexProduct);
+    /**
+     * 修改数据
+     * @param  indexProduct
+     * @return Integer
+     */
+    Integer  update(IndexProduct  indexProduct);
+    /**
+     * 删除数据
+     * @param  id
+     * @return Integer
+     */
+    Integer  delete(Integer  id);
+}

+ 95 - 0
watero-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/indexProductMapper.xml

@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.iamberry.wechat.service.mapper.IndexProductMapper">
+    <resultMap  id="BaseResultMap" type="IndexProduct" >
+        <result    column="inde_prod_id"    property="indeProdId" />
+        <result    column="product_id"    property="productId" />
+        <result    column="color_id"    property="colorId" />
+        <result    column="inde_prod_sort"    property="indeProdSort" />
+        <result    column="inde_prod_status"    property="indeProdStatus" />
+    </resultMap>
+    <sql    id="Base_List" >
+        t.inde_prod_id,
+        t.product_id,
+        t.color_id,
+        t.inde_prod_sort,
+        t.inde_prod_status
+    </sql>
+    <select id="getIndexProductList" resultMap="BaseResultMap" parameterType="IndexProduct" >
+        select
+        <include refid="Base_List" />,
+        pc.color_product_id,
+        pc.color_name,
+        pc.color_discount,
+        pc.color_price,
+        pc.color_69code,
+        pc.color_img
+        from tb_iamberry_index_product t
+        LEFT JOIN tb_iamberry_product_color pc ON  t.color_id = pc.color_id
+        <where>
+            <if test="indeProdId != null ">
+                AND t.inde_prod_id = #{indeProdId}
+            </if >
+            <if test="productId != null ">
+                AND t.product_id = #{productId}
+            </if >
+            <if test="colorId != null ">
+                AND t.color_id = #{colorId}
+            </if >
+            <if test="indeProdSort != null ">
+                AND t.inde_prod_sort = #{indeProdSort}
+            </if >
+            <if test="indeProdStatus != null ">
+                AND t.inde_prod_status = #{indeProdStatus}
+            </if >
+        </where>
+        ORDER BY t.inde_prod_sort
+    </select>
+    <select id="getIndexProductById" resultMap="BaseResultMap" parameterType="Integer" >
+        select
+        <include refid="Base_List" />
+        from tb_iamberry_index_product t
+        where t.inde_prod_id= #{indeProdId}
+    </select>
+    <insert id="save" parameterType="IndexProduct" >
+        insert into
+        tb_iamberry_index_product
+        (
+        product_id,
+        color_id,
+        inde_prod_sort,
+        inde_prod_status
+        )
+        values
+        (
+        #{productId},
+        #{colorId},
+        #{indeProdSort},
+        #{indeProdStatus}
+        )
+    </insert>
+    <update id="update" parameterType="IndexProduct" >
+        update
+        tb_iamberry_index_product
+        <set >
+            <if test="productId != null ">
+                product_id = #{productId},
+            </if >
+            <if test="colorId != null ">
+                color_id = #{colorId},
+            </if >
+            <if test="indeProdSort != null ">
+                inde_prod_sort = #{indeProdSort},
+            </if >
+            <if test="indeProdStatus != null ">
+                inde_prod_status = #{indeProdStatus}
+            </if >
+        </set >
+        where inde_prod_id= #{indeProdId}
+    </update>
+    <delete id="delete" parameterType="Integer" >
+        delete FROM
+            tb_iamberry_index_product
+        where inde_prod_id=#{indeProdId}
+    </delete>
+</mapper>

+ 10 - 2
watero-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/productColorMapper.xml

@@ -71,12 +71,20 @@
 		FROM TB_IAMBERRY_PRODUCT_COLOR PC
 		JOIN TB_IAMBERRY_PRODUCT_INFO PI
 		ON PC.COLOR_PRODUCT_ID = PI.PRODUCT_ID
+		<where>
+			<if test="colorStatus != null ">
+				AND PC.color_status = #{colorStatus}
+			</if >
+			<if test="colorProductId != null ">
+				AND color_product_id = #{colorProductId}
+			</if >
+		</where>
 		ORDER BY COLORID ASC
 		<if test="page!=null and page.recordBegin>0 and page.pageSize>0 ">
-	     LIMIT ${page.recordBegin},${page.pageSize}
+	     	LIMIT ${page.recordBegin},${page.pageSize}
 	    </if>
 	     <if test="page!=null and page.recordBegin==0 and page.pageSize>0 ">
-	     LIMIT ${page.pageSize}
+	     	LIMIT ${page.pageSize}
 	    </if>
 	</select>
 	

+ 65 - 0
watero-wechat-service/src/main/java/com/iamberry/wechat/service/product/IndexProductServiceImpl.java

@@ -0,0 +1,65 @@
+package com.iamberry.wechat.service.product;
+
+import com.iamberry.wechat.core.entity.product.IndexProduct;
+import com.iamberry.wechat.face.porduct.IndexProductService;
+import com.iamberry.wechat.service.mapper.IndexProductMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ *  首页热销产品接口
+ * @author xm
+ * @Date 2019-03-26
+ */
+@Service
+public class IndexProductServiceImpl  implements IndexProductService {
+    @Autowired
+    private IndexProductMapper indexProductMapper;
+    /**
+     * 获取集合
+     * @param  indexProduct
+     * @return List
+     */
+    @Override
+    public List<IndexProduct> getIndexProductList(IndexProduct  indexProduct){
+        return  indexProductMapper.getIndexProductList(indexProduct);
+    }
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  indexProduct
+     */
+    @Override
+    public  IndexProduct  getIndexProductById(Integer  id){
+        return  indexProductMapper.getIndexProductById(id);
+    }
+    /**
+     * 增加数据
+     * @param  indexProduct
+     * @return Integer
+     */
+    @Override
+    public  Integer  save(IndexProduct  indexProduct){
+        return  indexProductMapper.save(indexProduct);
+    }
+    /**
+     * 修改数据
+     * @param  indexProduct
+     * @return Integer
+     */
+    @Override
+    public  Integer  update(IndexProduct  indexProduct){
+        return  indexProductMapper.update(indexProduct);
+    }
+    /**
+     * 删除数据
+     * @param  id
+     * @return Integer
+     */
+    @Override
+    public  Integer  delete(Integer  id){
+        return  indexProductMapper.delete(id);
+    }
+}

+ 2 - 9
watero-wechat-web/src/main/java/com/iamberry/wechat/filters/WechatFilter.java

@@ -59,13 +59,6 @@ public class WechatFilter implements Filter {
 	 * @Time   2016年11月24日
 	 */
 	public void forword(HttpServletRequest req, HttpServletResponse resp, FilterChain chain) throws Exception {
-// 如果是扫描机器后面的二维码,那么转发到下层处理
-//		String ua = req.getHeader("user-agent").toLowerCase();
-//		if(ua.indexOf("micromessenger") < 0 && req.getRequestURL().indexOf("wechat/qrcode") > 0 ){
-//			chain.doFilter(req, resp);
-//			return;
-//		}
-		
 		// 如果不是扫描二维码,那么获取后转发微信服务器,完成授权。
 		String query = req.getQueryString();
 		String urlstr = req.getRequestURI().replace(req.getContextPath(), "");
@@ -77,14 +70,14 @@ public class WechatFilter implements Filter {
 		// 判断请求,如果是来自Ajax,那么直接返回302跳转会导致前端报错,所以返回JSON格式数据,状态为200
 		String requestedWith = req.getHeader("x-requested-with");
 		String accept = req.getHeader("accept");
-		if ((StringUtils.isNotEmpty(requestedWith) && requestedWith.indexOf("XMLHttpRequest") != -1) 
+		if ((requestedWith != null && StringUtils.isNotEmpty(requestedWith) && requestedWith.indexOf("XMLHttpRequest") != -1)
 				|| (StringUtils.isNotEmpty(accept) && accept.indexOf("json") != -1)) {
 			// 客户端需要的是json数据
 			String redirectURL = req.getHeader("Referer");
 			resp.getWriter().write("{\"isRedirect\":true, \"redirectURL\":\"" + WechatUtils.getOpenIdFunction(redirectURL) + "\"}");
 			return;
 		}
-		
+
 		// 客户端没有登录的请求不是来自于Ajax,可以执行跳转动作
 		resp.sendRedirect(url);
 	}

+ 39 - 7
watero-wechat-web/src/main/java/com/iamberry/wechat/handles/cart/ProductInfoHandler.java

@@ -10,6 +10,9 @@ import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.iamberry.redis.RedisUtils;
+import com.iamberry.wechat.core.entity.product.*;
+import com.iamberry.wechat.face.porduct.IndexProductService;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -24,10 +27,6 @@ import com.iamberry.wechat.core.entity.cart.ShopSalesOrderDto;
 import com.iamberry.wechat.core.entity.cart.UserGiftDto;
 import com.iamberry.wechat.core.entity.drp.PlaceInfo;
 import com.iamberry.wechat.core.entity.member.Member;
-import com.iamberry.wechat.core.entity.product.Product;
-import com.iamberry.wechat.core.entity.product.ProductColor;
-import com.iamberry.wechat.core.entity.product.ProductImageText;
-import com.iamberry.wechat.core.entity.product.ProductPicture;
 import com.iamberry.wechat.face.admin.SystemService;
 import com.iamberry.wechat.face.cart.CartService;
 import com.iamberry.wechat.face.cart.ProductInfoService;
@@ -60,10 +59,13 @@ public class ProductInfoHandler {
 	
 	@Autowired
 	private CartService cartService;
-	
-	@Autowired 
+
+	@Autowired
 	private ProductColorService productColorService;
-	
+
+	@Autowired
+	private IndexProductService indexProductService;
+
 	/**
 	 * 首页进入商城
 	 * @param request
@@ -160,6 +162,29 @@ public class ProductInfoHandler {
 		remsg.setData(map);
 		return remsg;
 	}
+
+
+	/**
+	 * 微商城首页-热销产品
+	 * @param request
+	 * @return list
+	 * @throws Exception
+	 */
+	@ResponseBody
+	@RequestMapping(value = "/productIndexSellWell",method = RequestMethod.POST)
+	public ResultMsg productIndexSellWell(HttpServletRequest request) throws Exception {
+		ResultMsg remsg= new ResultMsg();
+
+		IndexProduct indexProduct = new IndexProduct();
+		indexProduct.setIndeProdStatus(1);
+		List<IndexProduct> indexProductList = indexProductService.getIndexProductList(indexProduct);
+
+		remsg.setMessage(NameUtils.getConfig("SUCCESSINFO"));
+		remsg.setResultCode(ResultInfo.SUCCESSCODE);
+		remsg.setStatus(true);
+		remsg.setData(indexProductList);
+		return remsg;
+	}
 	
 	/**
 	 * 进入产品详细信息页面
@@ -248,6 +273,12 @@ public class ProductInfoHandler {
 			}
 			List<ProductPicture> pictureList = productPictureService.getProductPictureByproductId(Integer.parseInt(productId));
 			product.setPictureList(pictureList);
+
+			ProductColor productColor = new ProductColor();
+			productColor.setColorStatus(1);
+			productColor.setColorProductId(product.getProductId());
+			List<ProductColor> colorList = productColorService.selectProductColorList(productColor);
+
 			/*
 			 * 组装数据
 			 */
@@ -257,6 +288,7 @@ public class ProductInfoHandler {
 			map.put("cart_url", ResultInfo.CART_URL);
 			map.put("product", product);
 			map.put("shareOpenid", member.getUserOpenid());
+			map.put("colorList", colorList);
 			remsg.setData(map);
 			remsg.setMessage(NameUtils.getConfig("SUCCESSINFO"));
 			remsg.setResultCode(ResultInfo.SUCCESSCODE);

+ 6 - 0
watero-wechat-web/src/main/resources/iamberry-wechat-service-mybatis.xml

@@ -228,6 +228,9 @@
 		<!--2019 38节活动-->
 		<typeAlias type="com.iamberry.wechat.core.entity.admin.FullReduction" alias="FullReduction"/>
 
+		<!--首页热销产品-->
+		<typeAlias type="com.iamberry.wechat.core.entity.product.IndexProduct" alias="IndexProduct"/>
+
 		<package name="com.iamberry.wechat.core.entity.rent"/>
 	</typeAliases>
 	<mappers>
@@ -318,5 +321,8 @@
 		<!--官网查询授权码-->
 		<mapper resource="com/iamberry/wechat/service/mapper/prospectusMapper.xml"/>
 
+		<!--首页热销产品-->
+		<mapper resource="com/iamberry/wechat/service/mapper/indexProductMapper.xml"/>
+
 	</mappers>
 </configuration>

+ 10 - 0
watero-wechat-web/src/main/resources/platform.properties

@@ -195,3 +195,13 @@ reserve_pay_money=1
 DO_MAIN=test.iamberry.com
 
 IMAGE_URL=https://w.iamberry.com
+
+
+##redis
+redis_host=120.76.99.239
+redis_port=6379
+redis_auth=AiberleRedis&*()
+redis_max_active=8
+redis_max_idle=8
+redis_max_wait=-1
+redis_timeout=3000