Explorar o código

呵呵商城改版part4

Aslee %!s(int64=3) %!d(string=hai) anos
pai
achega
80c435ea71
Modificáronse 24 ficheiros con 716 adicións e 146 borrados
  1. 294 0
      src/main/java/com/caimei/components/RedisService.java
  2. 42 12
      src/main/java/com/caimei/components/WeChatService.java
  3. 1 5
      src/main/java/com/caimei/controller/CouponApi.java
  4. 22 1
      src/main/java/com/caimei/controller/HeHeApi.java
  5. 29 13
      src/main/java/com/caimei/controller/PayOrderApi.java
  6. 59 50
      src/main/java/com/caimei/controller/ProductApi.java
  7. 5 0
      src/main/java/com/caimei/mapper/ProductMapper.java
  8. 1 1
      src/main/java/com/caimei/model/po/CmOrderProductPo.java
  9. 1 1
      src/main/java/com/caimei/model/po/ReductionUserPo.java
  10. 10 10
      src/main/java/com/caimei/model/vo/CartProductVo.java
  11. 2 2
      src/main/java/com/caimei/model/vo/OrderProductVo.java
  12. 4 4
      src/main/java/com/caimei/service/impl/HeliPayServiceImpl.java
  13. 1 8
      src/main/java/com/caimei/service/impl/OrderServiceImpl.java
  14. 24 15
      src/main/java/com/caimei/service/impl/OrderSubmitServiceImpl.java
  15. 2 2
      src/main/java/com/caimei/service/impl/ShoppingCartServiceImpl.java
  16. 1 1
      src/main/java/com/caimei/task/SplitAccountTask.java
  17. 55 0
      src/main/java/com/caimei/util/HttpClientUtil.java
  18. 86 0
      src/main/java/com/caimei/util/OkHttpUtil.java
  19. 18 0
      src/main/resources/config/beta/application-beta.yml
  20. 18 1
      src/main/resources/config/dev/application-dev.yml
  21. 18 0
      src/main/resources/config/prod/application-prod.yml
  22. 2 1
      src/main/resources/mapper/OrderMapper.xml
  23. 13 11
      src/main/resources/mapper/OrderSubmitMapper.xml
  24. 8 8
      src/main/resources/mapper/ShoppingCartMapper.xml

+ 294 - 0
src/main/java/com/caimei/components/RedisService.java

@@ -0,0 +1,294 @@
+package com.caimei.components;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.core.ValueOperations;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Redis 服务工具类
+ *
+ * @author : Charles
+ * @date : 2021/3/4
+ */
+@Slf4j
+@Service
+public class RedisService {
+
+	@Resource
+	private RedisTemplate<Serializable, Object> redisTemplate;
+
+    /**
+     * 批量删除
+     * @param keys
+     */
+	public void remove(String... keys) {
+		for(String key :keys){
+			remove(key);
+		}
+	}
+
+    /**
+     * 批量删除正则匹配到的
+     * @param pattern
+     */
+	public void removePattern(String pattern) {
+		Set<Serializable> keys = redisTemplate.keys(pattern);
+        assert keys != null;
+        if (keys.size() > 0){
+			redisTemplate.delete(keys);
+		}
+	}
+
+    /**
+     * 删除
+     * @param key
+     */
+	public void remove(String key) {
+		if (exists(key)) {
+			redisTemplate.delete(key);
+		}
+	}
+
+    /**
+     * 判断缓存中是否存在
+     * @param key
+     * @return boolean
+     */
+	public boolean exists(String key) {
+		return StringUtils.isBlank(key) ? false : redisTemplate.hasKey(key);
+	}
+
+    /**
+     * 读取缓存
+     * @param key
+     * @return
+     */
+	public Object get(String key) {
+		Object result = null;
+		ValueOperations<Serializable, Object> operations = redisTemplate.opsForValue();
+		result = operations.get(key);
+		return result;
+	}
+
+    /**
+     * 写入缓存
+     * @param key
+     * @param value
+     * @return
+     */
+	public boolean set(String key, Object value) {
+		boolean result = false;
+		try {
+			ValueOperations<Serializable, Object> operations = redisTemplate.opsForValue();
+			operations.set(key, value);
+			result = true;
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return result;
+	}
+
+    /**
+     * 写入缓存并加上过期时间(秒)
+     * @param key
+     * @param value
+     * @param expireTimeSeconds
+     * @return
+     */
+	public boolean set(String key, Object value, Long expireTimeSeconds) {
+		boolean result = false;
+		try {
+			ValueOperations<Serializable, Object> operations = redisTemplate.opsForValue();
+			operations.set(key, value);
+			redisTemplate.expire(key, expireTimeSeconds, TimeUnit.SECONDS);
+			result = true;
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return result;
+	}
+    /**
+     * 写入过期时间(秒)
+     * @param key
+     * @param expireTimeSeconds
+     * @return
+     */
+	public boolean expire(String key, Long expireTimeSeconds) {
+		boolean result = false;
+		try {
+			redisTemplate.expire(key, expireTimeSeconds, TimeUnit.SECONDS);
+			result = true;
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return result;
+	}
+    /* **************************** 针对list操作的方法 **************************** */
+    /**
+     * 在key对应list的尾部添加
+     * @param key
+     * @param value
+     * @return
+     */
+	public long rightPushForList(String key, Object value) {
+		return redisTemplate.opsForList().rightPush(key, value);
+	}
+
+    /**
+     * 在key对应list的头部添加
+     * @param key
+     * @param value
+     * @return
+     */
+	public long leftPushForList(String key, Object value) {
+		return redisTemplate.opsForList().leftPush(key, value);
+	}
+
+    /**
+     * key对应list的长度
+     * @param key
+     * @return
+     */
+	public long listSize(String key) {
+		return redisTemplate.opsForList().size(key);
+	}
+
+    /**
+     * 获取list集合
+     * @param Key
+     * @param begin
+     * @param end
+     * @return
+     */
+	public List<?> getList(String Key, int begin, int end) {
+		return redisTemplate.opsForList().range(Key, begin, end);
+	}
+
+    /**
+     * 在key对应list的尾部移除
+     * @param key
+     * @return
+     */
+	public Object rightPopForList(String key) {
+		return redisTemplate.opsForList().rightPop(key);
+	}
+
+    /**
+     * 在key对应list的头部移除
+     * @param key
+     * @return
+     */
+	public Object leftPopForList(String key) {
+		return redisTemplate.opsForList().leftPop(key);
+	}
+
+    /**
+     * 移除list的index位置上的值
+     * @param Key
+     * @param index
+     * @param value
+     */
+	public void removeList(String Key, long index, Object value) {
+		redisTemplate.opsForList().remove(Key, index, value);
+	}
+
+    /**
+     * 重置list的index位置上的值
+     * @param Key
+     * @param index
+     * @param value
+     */
+	public void setList(String Key, long index, Object value) {
+		redisTemplate.opsForList().set(Key, index, value);
+	}
+
+
+    /**
+     * 写入list
+     * @param key
+     * @param list
+     */
+	public void setList(String key, List list) {
+		if(list!=null&&list.size()>0){
+			for (Object object : list) {
+				rightPushForList(key,object);
+			}
+		}
+	}
+
+    /**
+     * 写入map
+     * @param key
+     * @param map
+     */
+	public void setMap(String key, Map<String, Object> map) {
+		redisTemplate.opsForHash().putAll(key, map);
+	}
+
+    /**
+     * 获取map
+     * @param key
+     * @param mapKey
+     * @return
+     */
+	public Object get(String key, String mapKey) {
+		return redisTemplate.opsForHash().get(key, mapKey);
+	}
+
+    /**
+     * 写入map
+     * @param key
+     * @param hashKey
+     * @param hashValue
+     */
+	public void setMapByKV(String key, Object hashKey, Object hashValue) {
+		redisTemplate.opsForHash().put(key, hashKey,hashValue);
+	}
+
+    /**
+     * 删除map中的某个key-value
+     * @param key
+     * @param hashKey
+     */
+	public void removeHash(String key, String hashKey) {
+		redisTemplate.opsForHash().delete(key, hashKey);
+	}
+
+    /**
+     *
+     * @param key
+     * @return
+     */
+	public Map<Object, Object> getEntries(String key) {
+		return redisTemplate.opsForHash().entries(key);
+	}
+
+    /**
+     *
+     * @param key
+     * @param step
+     * @return
+     */
+	public long increase(String key, long step) {
+		return redisTemplate.opsForValue().increment(key, step);
+	}
+
+    /**
+     * 获取失效时间
+     * @param key
+     * @return
+     */
+	public long getExpireTime(String key) {
+		return redisTemplate.getExpire(key, TimeUnit.SECONDS);
+	}
+
+}

+ 42 - 12
src/main/java/com/caimei/components/WeChatService.java

@@ -3,7 +3,9 @@ package com.caimei.components;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.caimei.model.ResponseJson;
+import com.caimei.util.HttpClientUtil;
 import com.caimei.util.HttpRequest;
+import com.caimei.util.OkHttpUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.lang.StringUtils;
@@ -11,15 +13,20 @@ import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
 import org.springframework.stereotype.Component;
 
 import javax.crypto.Cipher;
 import javax.crypto.spec.IvParameterSpec;
 import javax.crypto.spec.SecretKeySpec;
+import java.io.ByteArrayInputStream;
+import java.io.FileOutputStream;
+import java.nio.Buffer;
 import java.security.AlgorithmParameters;
 import java.security.Security;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Optional;
 
 /**
  * 微信 服务工具类
@@ -36,11 +43,11 @@ public class WeChatService {
     @Value("${wx.AppSecret}")
     private String heHeAppSecret;
 
-    /*private RedisService redisService;
+    private RedisService redisService;
     @Autowired
     public void setRedisService(RedisService redisService) {
         this.redisService = redisService;
-    }*/
+    }
 
     public static class Keys {
         public static final String OPEN_ID = "openid";
@@ -168,20 +175,20 @@ public class WeChatService {
      * @return access_token
      */
     public String getAccessToken() throws Exception {
-//        String access_token = String.valueOf(redisService.get("access_token:"+crmAppId));
-//        // 过期后会得到"null"值,所以需判断字符串"null"
-//        if (access_token != null && access_token.length() != 0 && !"null".equals(access_token)) {
-//            return access_token;
-//        }
+        String access_token = String.valueOf(redisService.get("access_token:"+heHeAppId));
+        // 过期后会得到"null"值,所以需判断字符串"null"
+        if (access_token != null && access_token.length() != 0 && !"null".equals(access_token)) {
+            return access_token;
+        }
         String link = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET";
-        link = link.replace("APPID", "wx0938e78f38bc203d");
-        link = link.replace("APPSECRET", "a563dd2c07c9c815a4e697c8b6cb73dc");
+        link = link.replace("APPID", heHeAppId);
+        link = link.replace("APPSECRET", heHeAppSecret);
         String result = HttpRequest.sendGet(link);
         log.info("微信公众号获取access_token>>>" + result);
         Map<String, Object> map = JSONObject.parseObject(result, Map.class);
-        String access_token = (String) map.get("access_token");
-//        // 将token存入redis, access_token的有效期目前为2个小时(redis存1.5小时)
-//        redisService.set("access_token:"+crmAppId, access_token, 5400L);
+        access_token = (String) map.get("access_token");
+        // 将token存入redis, access_token的有效期目前为2个小时(redis存1.5小时)
+        redisService.set("access_token:"+heHeAppId, access_token, 5400L);
         return access_token;
     }
 
@@ -208,5 +215,28 @@ public class WeChatService {
         return map;
     }
 
+    /**
+     * 根据accessToken生成小程序二维码
+     */
+    public String generateWxacode(String access_token,String params) throws Exception {
+        String requestUrl = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + access_token;
+        ByteArrayInputStream inputStream = HttpClientUtil.sendPost(requestUrl, params);
+        FileOutputStream outputStream = new FileOutputStream("D:/123.png");
+        int i = 0;
+        byte[] buffer = new byte[200];
+        while ((i = inputStream.read(buffer)) != -1) {
+            outputStream.write(buffer, 0, i);
+        }
+        outputStream.flush();
+        outputStream.close();
+        inputStream.close();
+        // 成功时微信服务直接返回小程序码的二进制数据,字节数组的长度会很大(大概是60000多)
+        /*if (entity.getStatusCode() != HttpStatus.OK || buffer == null || buffer.length < 200) {
+            log.error("请求获取小程序码失败, response: {}", Optional.ofNullable(buffer).map(String::new).orElse("response is null"));
+            throw new InternalErrorException(BusinessCode.NOT_IMPLEMENTED);
+        }*/
+        return "success";
+    }
+
 
 }

+ 1 - 5
src/main/java/com/caimei/controller/CouponApi.java

@@ -130,11 +130,7 @@ public class CouponApi {
     }
 
     @ApiOperation("首页优惠券列表")
-    @ApiImplicitParams({
-            @ApiImplicitParam(required = false, name = "userId", value = "机构用户id"),
-            @ApiImplicitParam(required = false, name = "pageNum", value = "页码"),
-            @ApiImplicitParam(required = false, name = "pageSize", value = "每页数量")
-    })
+    @ApiImplicitParam(required = false, name = "userId", value = "机构用户id")
     @GetMapping("/home")
     public ResponseJson<List<CouponVo>> homeCouponList(Integer userId) {
         return couponService.homeCouponList(userId);

+ 22 - 1
src/main/java/com/caimei/controller/HeHeApi.java

@@ -1,16 +1,20 @@
 package com.caimei.controller;
 
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.caimei.components.WeChatService;
 import com.caimei.model.ResponseJson;
 import com.caimei.service.CouponService;
 import com.caimei.util.HttpRequest;
+import com.caimei.util.OkHttpUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
+import redis.clients.jedis.ZParams;
 
 import java.util.Map;
 
@@ -29,7 +33,7 @@ public class HeHeApi {
     private String cloudApi;
 
     @Autowired
-    private CouponService couponService;
+    private WeChatService weChatService;
 
     @ApiOperation("微信授权登录")
     @GetMapping("/authorization")
@@ -55,6 +59,23 @@ public class HeHeApi {
         return getResponseJson(parameters);
     }
 
+    @ApiOperation("获取token")
+    @GetMapping("/access/token")
+    public ResponseJson<String> getAccessToken() throws Exception {
+        String accessToken = weChatService.getAccessToken();
+        return ResponseJson.success(accessToken);
+    }
+
+    @ApiOperation("获取小程序二维码图片")
+    @GetMapping("/wxacode/generate")
+    public ResponseJson<String> getWxImage() throws Exception {
+        String accessToken = weChatService.getAccessToken();
+        JSONObject params = new JSONObject();
+        params.put("scene", "yanxuanmeixue");
+        String result = weChatService.generateWxacode(accessToken, params.toString());
+        return ResponseJson.success(result);
+    }
+
     private ResponseJson<String> getResponseJson(String parameters) {
         JSONObject object = JSONObject.parseObject(parameters);
         Integer code = object.getInteger("code");

+ 29 - 13
src/main/java/com/caimei/controller/PayOrderApi.java

@@ -1,3 +1,4 @@
+package com.caimei.controller;/*
 package com.caimei.controller;
 
 
@@ -20,12 +21,14 @@ import org.springframework.web.reactive.function.server.ServerRequest;
 import java.util.HashMap;
 import java.util.Map;
 
+*/
 /**
  * Description
  *
  * @author : plf
  * @date : 2020/5/6
- */
+ *//*
+
 @Api(tags = "订单支付")
 @Slf4j
 @RestController
@@ -43,18 +46,22 @@ public class PayOrderApi {
     @Value("${wx.AppSecret}")
     private String appSecret;
 
-    /**
+    */
+/**
      * 获取线上支付开关状态
-     */
+     *//*
+
     @ApiOperation("获取线上支付开关状态")
     @GetMapping("/onLineSwitch")
     public ResponseJson<Integer> onLineSwitch() {
         return payOrderService.getPayOnLineSwitch();
     }
 
-    /**
+    */
+/**
      * 微信线上支付
-     */
+     *//*
+
     @ApiOperation("微信线上支付")
     @PostMapping("/miniWxPay")
     public ResponseJson<JSONObject> miniWxPay(@RequestBody PaymentDto payment, @RequestHeader HttpHeaders headers) {
@@ -104,9 +111,11 @@ public class PayOrderApi {
         return payOrderService.pay(payment);
     }
 
-    /**
+    */
+/**
      * 支付异步通知回调
-     */
+     *//*
+
     @GetMapping("/paymentCallback")
     public String paymentCallback(String data) throws Exception {
         log.info("异步回调通知>>>>>>>start");
@@ -116,9 +125,11 @@ public class PayOrderApi {
         return payOrderService.paymentCallback(data);
     }
 
-    /**
+    */
+/**
      * 判断此次支付是否完成
-     */
+     *//*
+
     @ApiOperation("判断此次支付是否完成")
     @GetMapping("/payWhetherSuccess")
     public ResponseJson<String> payWhetherSuccess(Integer orderId, Integer paySuccessCounter) {
@@ -128,9 +139,11 @@ public class PayOrderApi {
         return payOrderService.payWhetherSuccess(orderId, paySuccessCounter);
     }
 
-    /**
+    */
+/**
      * 查询本次支付订单是否完成
-     */
+     *//*
+
     @GetMapping("/findOrderStatus")
     public ResponseJson<JSONObject> findOrderStatus(String mbOrderId) {
         if (null == mbOrderId) {
@@ -139,9 +152,11 @@ public class PayOrderApi {
         return payOrderService.findOrderStatus(mbOrderId);
     }
 
-    /**
+    */
+/**
      * 延时分账异步通知回调
-     */
+     *//*
+
     @GetMapping("/delayedSplittingCallback")
     public String delayedSplittingCallback(String data) {
         log.info("延时分账异步通知>>>>>>>start");
@@ -151,3 +166,4 @@ public class PayOrderApi {
         return payOrderService.delayedSplittingCallback(data);
     }
 }
+*/

+ 59 - 50
src/main/java/com/caimei/controller/ProductApi.java

@@ -3,12 +3,9 @@ package com.caimei.controller;
 import com.alibaba.fastjson.JSONObject;
 import com.caimei.model.ResponseJson;
 import com.caimei.model.vo.CmHeHeImageVo;
-import com.caimei.model.vo.FloorVo;
-import com.caimei.model.vo.HeHeActivityVo;
-import com.caimei.model.vo.ProductVo;
 import com.caimei.service.ProductService;
 import com.caimei.util.HttpRequest;
-import com.github.pagehelper.PageInfo;
+import com.caimei.util.OkHttpUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -21,7 +18,6 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * Description
@@ -48,20 +44,21 @@ public class ProductApi {
     @ApiOperation("首页楼层")
     @GetMapping("/home/init")
     @ApiImplicitParam(name = "userId", required = true, value = "用户id")
-    public ResponseJson<String> gethomeData(Integer userId) throws Exception {
+    public String gethomeData(Integer userId) throws Exception {
         String url = cloudApi + "/commodity/hehe/home/init?userId=" + userId;
-        String parameters = HttpRequest.sendGet(url);
-        return getResponseJson(parameters);
+        return HttpRequest.sendGet(url);
     }
 
 
     @ApiOperation("商品列表")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "listType", value = "列表类型:1首页搜索商品列表,2首页分类商品列表,3首页楼层商品列表.4二级分类商品列表", required = false),
-            @ApiImplicitParam(name = "homeTypeId", value = "首页分类id", required = false),
-            @ApiImplicitParam(name = "homeFloorId", value = "首页楼层id", required = false),
-            @ApiImplicitParam(name = "smallTypeId", value = "二级分类id", required = false),
-            @ApiImplicitParam(name = "name", value = "搜索商品名称", required = false),
+            @ApiImplicitParam(name = "listType", value = "列表类型:1首页搜索商品列表,2首页分类商品列表,3首页楼层商品列表.4二级分类商品列表,5优惠券商品列表,6活动商品列表", required = false),
+            @ApiImplicitParam(name = "name", value = "搜索商品名称(1)", required = false),
+            @ApiImplicitParam(name = "homeTypeId", value = "首页分类id(2)", required = false),
+            @ApiImplicitParam(name = "homeFloorId", value = "首页楼层id(3)", required = false),
+            @ApiImplicitParam(name = "smallTypeId", value = "二级分类id(4)", required = false),
+            @ApiImplicitParam(name = "couponId", value = "优惠券id(5)", required = false),
+            @ApiImplicitParam(name = "activityId", value = "活动id(6)", required = false),
             @ApiImplicitParam(name = "userId", value = "用户id", required = false),
             @ApiImplicitParam(name = "sortType", value = "排序类型:1综合,2价格升序,3价格降序,4最新", required = false),
             @ApiImplicitParam(name = "productIds", value = "综合排序已查出的商品id,以,隔开", required = false),
@@ -69,16 +66,23 @@ public class ProductApi {
             @ApiImplicitParam(name = "pageSize", value = "每页数量", required = false)
     })
     @GetMapping("/list")
-    public ResponseJson<String> productList(@RequestParam(value = "listType", defaultValue = "1") Integer listType, Integer homeTypeId,
-                                            Integer homeFloorId, Integer smallTypeId, String name, Integer userId, String productIds,
-                                            @RequestParam(value = "sortType", defaultValue = "4") Integer sortType,
-                                            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
-                                            @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) throws Exception {
+    public String productList(@RequestParam(value = "listType", defaultValue = "1") Integer listType,
+                              @RequestParam(value = "name", defaultValue = "") String name,
+                              @RequestParam(value = "homeTypeId", defaultValue = "0") Integer homeTypeId,
+                                @RequestParam(value = "homeFloorId", defaultValue = "0") Integer homeFloorId,
+                                @RequestParam(value = "smallTypeId", defaultValue = "0") Integer smallTypeId,
+                                @RequestParam(value = "couponId", defaultValue = "0") Integer couponId,
+                                @RequestParam(value = "activityId", defaultValue = "0") Integer activityId,
+                                @RequestParam(value = "userId", defaultValue = "0") Integer userId,
+                                @RequestParam(value = "productIds", defaultValue = "") String productIds,
+                                @RequestParam(value = "sortType", defaultValue = "4") Integer sortType,
+                                @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
+                                @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
         String url = cloudApi + "/commodity/hehe/product/list?listType=" + listType + "&homeTypeId=" + homeTypeId +
-                "&homeFloorId=" + homeFloorId + "&smallTypeId=" + smallTypeId+ "&name=" + name + "&userId=" + userId +
-                "&sortType=" + sortType + "&productIds=" + productIds + "&pageNum=" + pageNum + "&pageSize=" + pageSize;
-        String parameters = HttpRequest.sendGet(url);
-        return getResponseJson(parameters);
+                "&homeFloorId=" + homeFloorId + "&smallTypeId=" + smallTypeId + "&name=" + name + "&couponId=" + couponId +
+                "&activityId=" + activityId + "&userId=" + userId + "&sortType=" + sortType + "&productIds=" + productIds +
+                "&pageNum=" + pageNum + "&pageSize=" + pageSize;
+        return OkHttpUtil.sendGet(url);
     }
 
     @ApiOperation("商品详情")
@@ -87,28 +91,25 @@ public class ProductApi {
             @ApiImplicitParam(name = "userId", required = true, value = "机构用户Id")
     })
     @GetMapping("/details")
-    public ResponseJson<String> productDetails(Integer productId, Integer userId) throws Exception {
+    public String productDetails(Integer productId, Integer userId) throws Exception {
         String url = cloudApi + "/commodity/hehe/details?productId=" + productId + "&userId=" + userId;
-        String parameters = HttpRequest.sendGet(url);
-        return getResponseJson(parameters);
+        return HttpRequest.sendGet(url);
     }
 
     @ApiOperation("商品搜索历史记录")
     @ApiImplicitParam(name = "userId", required = true, value = "用户id")
     @GetMapping("/search/history")
-    public ResponseJson<String> searchHistory(Integer userId) throws Exception {
+    public String searchHistory(Integer userId) throws Exception {
         String url = cloudApi + "/commodity/search/query/history?userId=" + userId;
-        String parameters = HttpRequest.sendGet(url);
-        return getResponseJson(parameters);
+        return HttpRequest.sendGet(url);
     }
 
     @ApiOperation("删除搜索历史记录")
     @ApiImplicitParam(name = "userId", required = true, value = "用户id")
     @GetMapping("/delete/history")
-    public ResponseJson<String> deleteHistory(Integer userId) throws Exception {
+    public String deleteHistory(Integer userId) throws Exception {
         String url = cloudApi + "/commodity/search/query/history/delete?userId=" + userId;
-        String parameters = HttpRequest.sendGet(url);
-        return getResponseJson(parameters);
+        return HttpRequest.sendGet(url);
     }
 
     @ApiOperation("活动专区(旧:/product/activityArea)")
@@ -118,11 +119,10 @@ public class ProductApi {
             @ApiImplicitParam(name = "pageSize", value = "一页多少条", required = false)
     })
     @GetMapping("/activity/list")
-    public ResponseJson<String> activityArea(Integer userId, @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
+    public String activityArea(Integer userId, @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                                @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) throws Exception {
         String url = cloudApi + "/commodity/hehe/activity/list?userId=" + userId + "&pageNum=" + pageNum + "&pageSize=" + pageSize;
-        String parameters = HttpRequest.sendGet(url);
-        return getResponseJson(parameters);
+        return HttpRequest.sendGet(url);
     }
 
     @ApiOperation("活动详情")
@@ -133,35 +133,44 @@ public class ProductApi {
             @ApiImplicitParam(name = "pageSize", value = "一页多少条", required = false)
     })
     @GetMapping("/activity/details")
-    public ResponseJson<String> activityDetails(Integer userId, Integer activityId,
+    public String activityDetails(Integer userId, Integer activityId,
                                                              @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                              @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) throws Exception {
         String url = cloudApi + "/commodity/hehe/activity/details?userId=" + userId + "&activityId=" + activityId+ "&pageNum=" + pageNum + "&pageSize=" + pageSize;
-        String parameters = HttpRequest.sendGet(url);
-        return getResponseJson(parameters);
+        return HttpRequest.sendGet(url);
     }
 
     @ApiOperation("首页分类列表")
     @GetMapping("/home/type")
-    public ResponseJson<String> getHomeTypeList() throws Exception {
+    public String getHomeTypeList() throws Exception {
         String url = cloudApi + "/commodity/hehe/home/type";
-        String parameters = HttpRequest.sendGet(url);
-        return getResponseJson(parameters);
+        return HttpRequest.sendGet(url);
     }
 
-    @ApiOperation("一级分类列表")
-    @GetMapping("/type/first")
-    public ResponseJson<String> getBigTypeSelect() throws Exception {
-        String url = cloudApi + "/commodity/type/first?mallType=2";
-        String parameters = HttpRequest.sendGet(url);
-        return getResponseJson(parameters);
+    @ApiOperation("分类列表")
+    @GetMapping("/classify")
+    public String getClassify() throws Exception {
+        String url = cloudApi + "/commodity/classify?typeSort=3&mallType=2";
+        return HttpRequest.sendGet(url);
     }
 
+    /*@ApiOperation("二级分类列表")
+    @ApiImplicitParam(name = "bigTypeId", value = "一级分类Id", required = true)
+    @GetMapping("/type/second")
+    public String getSmallTypeSelect(Integer bigTypeId) throws Exception {
+        String url = cloudApi + "/commodity/type/second?bigTypeId=" + bigTypeId;
+        return HttpRequest.sendGet(url);
+    }*/
+
     private ResponseJson<String> getResponseJson(String parameters) {
         JSONObject object = JSONObject.parseObject(parameters);
-        Integer code = object.getInteger("code");
-        String msg = object.getString("msg");
-        String data = object.getString("data");
-        return ResponseJson.success(code, msg, data);
+        if (null != object) {
+            Integer code = object.getInteger("code");
+            String msg = object.getString("msg");
+            String data = object.getString("data");
+            return ResponseJson.success(code, msg, data);
+        } else {
+            return ResponseJson.success(null);
+        }
     }
 }

+ 5 - 0
src/main/java/com/caimei/mapper/ProductMapper.java

@@ -219,5 +219,10 @@ public interface ProductMapper {
 
     Integer findProductBuyNum(@Param("productId") Integer productId, @Param("userId") Integer userId);
 
+    /**
+     * 查找商品限时特价
+     * @param productId
+     * @return
+     */
     BigDecimal getDiscountPrice(Integer productId);
 }

+ 1 - 1
src/main/java/com/caimei/model/po/CmOrderProductPo.java

@@ -225,7 +225,7 @@ public class CmOrderProductPo implements Serializable {
     private Integer cmbeanPrice;
 
     /**
-     * 下单时商品购买价格类型快照 0 机构价,1活动价 ,2阶梯
+     * 下单时商品购买价格类型快照 0 机构价,1活动价 ,2拼团价,3限时特
      */
     private String isActProduct;
 

+ 1 - 1
src/main/java/com/caimei/model/po/ReductionUserPo.java

@@ -24,7 +24,7 @@ public class ReductionUserPo implements Serializable {
     private Integer userId;
 
     /**
-     * 分享类型
+     * 分享渠道:1微信好友,2微信朋友圈
      */
     private Integer shareType;
 

+ 10 - 10
src/main/java/com/caimei/model/vo/CartProductVo.java

@@ -33,12 +33,12 @@ public class CartProductVo implements Serializable {
     /**
      * 商品名称
      */
-    private String productName;
+    private String name;
 
     /**
      * 商品图片
      */
-    private String mainImage;
+    private String productImage;
 
     /**
      * 市场价
@@ -53,7 +53,7 @@ public class CartProductVo implements Serializable {
     /**
      * 规格
      */
-    private String unit;
+    private String productUnit;
 
     /**
      * 起订量
@@ -75,15 +75,10 @@ public class CartProductVo implements Serializable {
      */
     private BigDecimal clubTaxPoint;
 
-    /**
-     * 活动状态:0没有活动,1活动价
-     */
-    private Integer activeStatus = 0;
-
     /**
      * 商品数量
      */
-    private Integer productCount;
+    private Integer num;
 
     /**
      * 分销者id
@@ -101,7 +96,12 @@ public class CartProductVo implements Serializable {
     private List<ActivityLadderVo> ladderList;
 
     /**
-     * 拼团状态:0没有拼团价,1拼团价价
+     * 活动状态:0没有活动,1活动价
+     */
+    private Integer activeStatus = 0;
+
+    /**
+     * 拼团状态:0没有拼团价,1拼团价
      */
     private Integer collageStatus = 0;
 

+ 2 - 2
src/main/java/com/caimei/model/vo/OrderProductVo.java

@@ -161,9 +161,9 @@ public class OrderProductVo implements Serializable {
     private Integer notOutStore;
 
     /**
-     * 下单时商品购买价格类型快照 0 机构价,1活动价 ,2阶梯
+     * 下单时商品购买价格类型快照 0 机构价,1活动价 ,2拼团价,3限时特
      */
-    private String isActProduct;
+    private String actProduct;
 
     /**
      * 是否是赠品 0 不是 1 是

+ 4 - 4
src/main/java/com/caimei/service/impl/HeliPayServiceImpl.java

@@ -62,8 +62,8 @@ public class HeliPayServiceImpl implements HeliPayService {
     @Resource
     private WeChatService weChatService;
 
-    @Value("${caimei.userUrl}")
-    private String userUrl;
+    @Value("${caimei.cloudApi}")
+    private String cloudApi;
 
 
     @Override
@@ -209,7 +209,7 @@ public class HeliPayServiceImpl implements HeliPayService {
                     map.put("type", 3);
                     map.put("mobile", mobile);
                     map.put("content", content);
-                    String url = userUrl + "/tools/sms/send";
+                    String url = cloudApi + "/tools/sms/send";
                     try {
                         String result = HttpRequest.sendPost(url, map);
                         log.info("【呵呵好友消费券派送】mobile:" + mobile + ",result:" + result);
@@ -253,7 +253,7 @@ public class HeliPayServiceImpl implements HeliPayService {
                         String content = "您的商品已拼团成功,请赶紧登录呵呵商城小程序查看订单吧。";
                         map.put("type", 1);
                         map.put("content", content);
-                        String url = userUrl + "/tools/sms/send";
+                        String url = cloudApi + "/tools/sms/send";
                         try {
                             for (String userMobile : mobileList) {
                                 map.put("mobile", userMobile);

+ 1 - 8
src/main/java/com/caimei/service/impl/OrderServiceImpl.java

@@ -76,10 +76,7 @@ public class OrderServiceImpl implements OrderService {
                     if ("0".equals(orderProduct.getIncludedTax()) && ("1".equals(orderProduct.getInvoiceType()) || "2".equals(orderProduct.getInvoiceType()))) {
                         BigDecimal valueTax = MathUtil.div(MathUtil.mul(orderProduct.getPrice(), orderProduct.getTaxRate()), 100);
                         orderProduct.setPrice(MathUtil.add(orderProduct.getPrice(), valueTax));
-                        orderProduct.setDiscountPrice(MathUtil.add(orderProduct.getPrice(), orderProduct.getAddedValueTax()));
-                    }
-                    if (order.getCollageFlag()) {
-                        orderProduct.setCollagePriceFlag(1);
+                        orderProduct.setDiscountPrice(MathUtil.add(orderProduct.getDiscountPrice(), orderProduct.getAddedValueTax()));
                     }
                 }
                 shopOrder.setOrderProductList(orderProductList);
@@ -147,10 +144,6 @@ public class OrderServiceImpl implements OrderService {
                     orderProduct.setPrice(MathUtil.add(orderProduct.getPrice(), valueTax));
                     orderProduct.setDiscountPrice(MathUtil.add(orderProduct.getDiscountPrice(), orderProduct.getAddedValueTax()));
                 }
-                // 拼团价标识
-                if (order.getCollageFlag()) {
-                    orderProduct.setCollagePriceFlag(1);
-                }
             }
             shopOrder.setOrderProductList(orderProductList);
             shopOrder.setShopLogo(ProductUtils.getImageURL("shopLogo", shopOrder.getShopLogo(), 0, domain));

+ 24 - 15
src/main/java/com/caimei/service/impl/OrderSubmitServiceImpl.java

@@ -15,7 +15,6 @@ import com.caimei.util.ProductUtils;
 import com.google.common.util.concurrent.AtomicDouble;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -83,7 +82,7 @@ public class OrderSubmitServiceImpl implements OrderSubmitService {
             List<CartProductVo> shopProducts = new ArrayList<>();
             if (productId != null && productId > 0) {
                 CartProductVo cartProduct = orderSubmitMapper.findProductById(productId);
-                cartProduct.setProductCount(productCount);
+                cartProduct.setNum(productCount);
                 cartProduct.setHeUserId(heUserId);
                 shopProducts.add(cartProduct);
             } else {
@@ -93,7 +92,7 @@ public class OrderSubmitServiceImpl implements OrderSubmitService {
             BigDecimal shopTotalPrice = BigDecimal.ZERO;
             for (CartProductVo product : shopProducts) {
                 shoppingCartService.setPrice(product, userId, collageFlag);
-                shopTotalPrice = MathUtil.add(shopTotalPrice, MathUtil.mul(product.getProductCount(), product.getPrice()));
+                shopTotalPrice = MathUtil.add(shopTotalPrice, MathUtil.mul(product.getNum(), product.getPrice()));
             }
             shop.setShopTotalPrice(shopTotalPrice);
             shop.setProductList(shopProducts);
@@ -145,7 +144,7 @@ public class OrderSubmitServiceImpl implements OrderSubmitService {
                     // 购物车结算
                     for (CartProductVo product : totalProducts) {
                         if (couponProductIds.contains(product.getProductId().toString())) {
-                            touchCouponAmount = MathUtil.add(touchCouponAmount, MathUtil.mul(product.getProductCount(), product.getPrice()));
+                            touchCouponAmount = MathUtil.add(touchCouponAmount, MathUtil.mul(product.getNum(), product.getPrice()));
                         }
                     }
                 }
@@ -292,10 +291,13 @@ public class OrderSubmitServiceImpl implements OrderSubmitService {
                     // 机构税费(单)
                     BigDecimal addedValueTax = new BigDecimal(0);
                     int priceType = 0;
-                    Integer activityId = productMapper.getActivityIdByProductId(product.getProductId());
+                    // 商品参与的活动id
+                    Integer activityId = productMapper.getActivityIdByProductId(productId);
+                    // 商品参与的限时特价活动
+                    BigDecimal discountPrice = productMapper.getDiscountPrice(productId);
                     if (activityId != null && activityId > 0) {
                         //活动阶梯
-                        List<ActivityLadderVo> ladderList = productMapper.getActivityLadderList(activityId, product.getProductId());
+                        List<ActivityLadderVo> ladderList = productMapper.getActivityLadderList(activityId, productId);
                         if (ladderList != null && ladderList.size() > 0) {
                             priceType = 1;
                             for (ActivityLadderVo ladder : ladderList) {
@@ -304,16 +306,20 @@ public class OrderSubmitServiceImpl implements OrderSubmitService {
                                 }
                             }
                         }
-                    }
-                    if (collageFlag != null && 1 == collageFlag) {
+                    } else if (collageFlag != null && 1 == collageFlag) {
                         // 拼团价
                         CmHeheCollageProductPo collageProduct = productMapper.findCollageProduct(productId);
                         if (collageProduct != null) {
+                            priceType = 2;
                             productPrice = collageProduct.getPrice();
                         }
+                    } else if (discountPrice != null) {
+                        // 限时特价
+                        priceType = 3;
+                        productPrice = discountPrice;
                     }
 
-                    Integer discount = productMapper.findProductDiscount(product.getProductId(), userId);
+                    Integer discount = productMapper.findProductDiscount(productId, userId);
                     if (null != discount && discount > 0) {
                         productPrice = MathUtil.div(MathUtil.mul(productPrice, discount), 100);
                     }
@@ -357,8 +363,8 @@ public class OrderSubmitServiceImpl implements OrderSubmitService {
                     orderProductList.add(orderProduct);
 
                     if (cartType == 1) {
-                        orderSubmitMapper.deleteCartByProductId(user.getUserID(), product.getProductId(), heUserId);
-                        log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>删除用户购物车数据productId:" + product.getProductId());
+                        orderSubmitMapper.deleteCartByProductId(user.getUserID(), productId, heUserId);
+                        log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>删除用户购物车数据productId:" + productId);
                     }
                 }
             }
@@ -681,6 +687,11 @@ public class OrderSubmitServiceImpl implements OrderSubmitService {
                 CmHeheCollagePo collage = new CmHeheCollagePo();
                 CmOrderProductPo orderProductPo = orderProductList.get(0);
                 CmHeheCollageProductPo collageProduct = collageMapper.findCollageProduct(orderProductPo.getProductID());
+                if (null == collageProduct) {
+                    //设置手动回滚事务
+                    TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                    return ResponseJson.error("拼团商品异常", null);
+                }
                 collage.setProductId(collageProduct.getProductId());
                 collage.setMemberNum(collageProduct.getMemberNum());
                 collage.setPrice(collageProduct.getPrice());
@@ -874,12 +885,10 @@ public class OrderSubmitServiceImpl implements OrderSubmitService {
         orderProduct.setNotOutStore(productNum);
         orderProduct.setActPreferential(new BigDecimal(0));
         orderProduct.setActType(null);
+        orderProduct.setIsActProduct(priceType + "");
+        orderProduct.setLadderPriceFlag("0");
         if (priceType == 1) {
-            orderProduct.setIsActProduct("1");
             orderProduct.setLadderPriceFlag("1");
-        } else {
-            orderProduct.setIsActProduct("1");
-            orderProduct.setLadderPriceFlag("0");
         }
         orderProduct.setProductImage(ProductUtils.getImageURL("product", product.getMainImage(), 0, domain));
         orderProduct.setProductType("0");

+ 2 - 2
src/main/java/com/caimei/service/impl/ShoppingCartServiceImpl.java

@@ -70,7 +70,7 @@ public class ShoppingCartServiceImpl implements ShoppingCartService {
             List<CartProductVo> productList = shoppingCartMapper.getCartProductsByShopId(shop.getShopId(), userId);
             for (CartProductVo product : productList) {
                 setPrice(product, userId, null);
-                shopTotalPrice = MathUtil.add(shopTotalPrice, MathUtil.mul(product.getProductCount(), product.getPrice()));
+                shopTotalPrice = MathUtil.add(shopTotalPrice, MathUtil.mul(product.getNum(), product.getPrice()));
             }
             shop.setShopTotalPrice(shopTotalPrice);
             shop.setProductList(productList);
@@ -101,7 +101,7 @@ public class ShoppingCartServiceImpl implements ShoppingCartService {
             List<ActivityLadderVo> ladderList = productMapper.getActivityLadderList(activityId, product.getProductId());
             if (ladderList != null && ladderList.size() > 0) {
                 for (ActivityLadderVo ladder : ladderList) {
-                    if (product.getProductCount() >= ladder.getBuyNum()) {
+                    if (product.getNum() >= ladder.getBuyNum()) {
                         // 根据商品数量设置价格
                         product.setPrice(ladder.getBuyPrice());
                     }

+ 1 - 1
src/main/java/com/caimei/task/SplitAccountTask.java

@@ -23,7 +23,7 @@ public class SplitAccountTask {
     /**
      * 延时分账,每一小时执行一次
      */
-    @Scheduled(cron = "0 0 * * * ?")
+    //@Scheduled(cron = "0 0 * * * ?")
     //@Scheduled(cron = "0 */1 * * * ?")
     public void delayedSplitting() {
         payOrderService.delayedSplitting();

+ 55 - 0
src/main/java/com/caimei/util/HttpClientUtil.java

@@ -0,0 +1,55 @@
+package com.caimei.util;
+
+import lombok.extern.slf4j.Slf4j;
+import okhttp3.*;
+import org.apache.http.HttpEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.protocol.HttpContext;
+import sun.net.www.http.HttpClient;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author zzj
+ */
+
+@Slf4j
+public class HttpClientUtil {
+
+    public static ByteArrayInputStream sendPost(String url, String params) throws URISyntaxException, IOException {
+        CloseableHttpClient client = HttpClients.createDefault();
+        HttpPost httpPost = new HttpPost();
+        httpPost.addHeader("Content-type","application/json;charset=UTF-8");
+        httpPost.setHeader("Accept","application/json");
+        URI uri = new URI(url);
+        httpPost.setURI(uri);
+        StringEntity entity = new StringEntity(params, "UTF-8");
+        httpPost.setEntity(entity);
+        CloseableHttpResponse response = client.execute(httpPost, (HttpContext) null);
+        HttpEntity responseEntity = response.getEntity();
+        InputStream inputStream = responseEntity.getContent();
+        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+        byte[] buffer = new byte[1024];
+        int len = 0;
+        while ((len = inputStream.read(buffer)) != -1) {
+            outputStream.write(buffer, 0, len);
+        }
+        inputStream.close();
+        ByteArrayInputStream byteInputStream = new ByteArrayInputStream(outputStream.toByteArray());
+        outputStream.flush();
+        outputStream.close();
+        return byteInputStream;
+
+    }
+
+}

+ 86 - 0
src/main/java/com/caimei/util/OkHttpUtil.java

@@ -0,0 +1,86 @@
+package com.caimei.util;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import okhttp3.*;
+
+import java.io.IOException;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author zzj
+ */
+
+@Slf4j
+public class OkHttpUtil {
+
+    public static OkHttpClient client = new OkHttpClient.Builder()
+            .connectTimeout(3, TimeUnit.SECONDS)
+            .readTimeout(20, TimeUnit.SECONDS)
+            .build();
+
+    public static String sendPost(String url, String params) {
+        Request request = new Request.Builder() // okHttp post
+                .url(url)
+                .post(RequestBody.create(MediaType.parse("application/json; charset=utf-8"), params))
+                .build();
+
+        Response response = null;
+        try {
+            response = client.newCall(request).execute();
+        } catch (IOException e) {
+            throw new IllegalStateException("请求出错", e);
+        }
+        if (!response.isSuccessful()) {
+            try {
+                log.info(response.body().string());
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+            throw new RuntimeException("请求失败了: http response code: " + response.code());
+        }
+
+        okhttp3.ResponseBody body = response.body();
+        String result = null;
+        try {
+            result = body.string();
+        } catch (IOException e) {
+            throw new IllegalStateException("IO异常", e);
+        }
+        return result;
+    }
+
+    public static String sendGet(String url) {
+        Request request = new Request.Builder() // okHttp post
+                .url(url)
+                .get()
+                .build();
+
+        Response response = null;
+        try {
+            response = client.newCall(request).execute();
+        } catch (IOException e) {
+            throw new IllegalStateException("请求出错", e);
+        }
+        if (!response.isSuccessful()) {
+            try {
+                log.info(response.body().string());
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+            throw new RuntimeException("请求失败了: http response code: " + response.code());
+        }
+
+        okhttp3.ResponseBody body = response.body();
+        String content = null;
+        try {
+            content = body.string();
+        } catch (IOException e) {
+            throw new IllegalStateException("IO异常", e);
+        }
+        return content;
+    }
+
+}

+ 18 - 0
src/main/resources/config/beta/application-beta.yml

@@ -16,6 +16,24 @@ spring:
       connection-timeout: 30000
       connection-test-query: SELECT 1
   #数据源连接--end
+  redis:
+    host: 172.31.165.27
+    port: 6379
+    password: 6#xsI%b4o@5c3RoE
+    #Redis数据库索引(默认为0)
+    database: 0
+    #连接池最大连接数(使用负值表示没有限制)
+    jedis:
+      pool:
+        max-active: 50
+        #连接池最大阻塞等待时间(使用负值表示没有限制)
+        max-wait: 3000
+        #连接池中的最大空闲连接
+        max-idle: 20
+        #连接池中的最小空闲连接
+        min-idle: 2
+    #连接超时时间(毫秒)
+    timeout: 5000
 
 #上传文件大小
   servlet:

+ 18 - 1
src/main/resources/config/dev/application-dev.yml

@@ -16,6 +16,23 @@ spring:
       connection-timeout: 30000
       connection-test-query: SELECT 1
   #数据源连接--end
+  redis:
+    host: 192.168.2.100
+    port: 6379
+    #password: 123456
+    #Redis数据库索引(默认为0)
+    database: 0
+    jedis:
+      pool:
+        max-active: 50
+        #连接池最大阻塞等待时间(使用负值表示没有限制)
+        max-wait: -1
+        #连接池中的最大空闲连接
+        max-idle: 20
+        #连接池中的最小空闲连接
+        min-idle: 2
+    #连接超时时间(毫秒)
+    timeout: 500
 
   #上传文件大小
   servlet:
@@ -46,6 +63,6 @@ caimei:
   #支付链接重定向地址
   redirectLink: https://mall2c-b.caimei365.com/PayOrder/jumpPage
   #微服务网关地址
-  cloudApi: http://localhost:18002
+  cloudApi: http://192.168.2.92:18002
   #延时分账异步回调地址
   delayedSplittingUrl: https://mall2c-b.caimei365.com/PayOrder/delayedSplittingCallback

+ 18 - 0
src/main/resources/config/prod/application-prod.yml

@@ -16,6 +16,24 @@ spring:
       connection-timeout: 30000
       connection-test-query: SELECT 1
   #数据源连接--end
+  redis:
+    host: 172.31.165.23
+    port: 6379
+    #password: 6#xsI%b4o@5c3RoE
+    #Redis数据库索引(默认为0)
+    database: 0
+    #连接池最大连接数(使用负值表示没有限制)
+    jedis:
+      pool:
+        max-active: 50
+        #连接池最大阻塞等待时间(使用负值表示没有限制)
+        max-wait: 3000
+        #连接池中的最大空闲连接
+        max-idle: 20
+        #连接池中的最小空闲连接
+        min-idle: 2
+    #连接超时时间(毫秒)
+    timeout: 5000
 
   #上传文件大小
   servlet:

+ 2 - 1
src/main/resources/mapper/OrderMapper.xml

@@ -147,7 +147,8 @@
           cop.productImage,
           cop.productType,
           cop.ladderPriceFlag,
-          cop.heUserId
+          cop.heUserId,
+          cop.isActProduct as actProduct
         FROM
           cm_order_product cop
         WHERE

+ 13 - 11
src/main/resources/mapper/OrderSubmitMapper.xml

@@ -26,16 +26,17 @@
         SELECT
           cc.cm_cartID AS cartId,
           cc.productID AS productId,
-          cc.productCount,
+          cc.productCount as num,
           cc.heUserId,
           chp.price,
+          chp.price as normalPrice,
           chp.includedTax,
           chp.invoiceType,
           chp.clubTaxPoint,
-          p.name AS productName,
+          p.name,
           p.shopID AS shopId,
-          p.mainImage,
-          p.unit
+          p.mainImage as productImage,
+          p.unit as productUnit
         FROM
           cm_cart cc
           LEFT JOIN cm_hehe_product chp ON cc.productID = chp.productId
@@ -1585,13 +1586,14 @@
         SELECT
           chp.productId,
           chp.price,
+          chp.price as normalPrice,
           chp.includedTax,
           chp.invoiceType,
           chp.clubTaxPoint,
-          p.name AS productName,
+          p.name,
           p.shopID AS shopId,
-          p.mainImage,
-          p.unit
+          p.mainImage as productImage,
+          p.unit as productUnit
         FROM
           cm_hehe_product chp
           LEFT JOIN product p ON chp.productId = p.productID
@@ -1603,16 +1605,16 @@
         SELECT
         cc.cm_cartID AS cartId,
         cc.productID AS productId,
-        cc.productCount,
+        cc.productCount as num,
         cc.heUserId,
         chp.price,
         chp.includedTax,
         chp.invoiceType,
         chp.clubTaxPoint,
-        p.name AS productName,
+        p.name,
         p.shopID AS shopId,
-        p.mainImage,
-        p.unit
+        p.mainImage as productImage,
+        p.unit as productUnit
         FROM
         cm_cart cc
         LEFT JOIN cm_hehe_product chp ON cc.productID = chp.productId

+ 8 - 8
src/main/resources/mapper/ShoppingCartMapper.xml

@@ -76,16 +76,16 @@
         SELECT
           cc.cm_cartID AS cartId,
           cc.productID AS productId,
-          cc.productCount,
+          cc.productCount as num,
           cc.heUserId,
           chp.price,
           chp.includedTax,
           chp.invoiceType,
           chp.clubTaxPoint,
-          p.name AS productName,
+          p.name,
           p.shopID AS shopId,
-          p.mainImage,
-          p.unit
+          p.mainImage as productImage,
+          p.unit as productUnit
         FROM
           cm_cart cc
           LEFT JOIN cm_hehe_product chp ON cc.productID = chp.productId
@@ -100,15 +100,15 @@
         SELECT
           cc.cm_cartID AS cartId,
           cc.productID AS productId,
-          cc.productCount,
+          cc.productCount as num,
           chp.price,
           chp.includedTax,
           chp.invoiceType,
           chp.clubTaxPoint,
-          p.name AS productName,
+          p.name,
           p.shopID AS shopId,
-          p.mainImage,
-          p.unit
+          p.mainImage as productImage,
+          p.unit as productUnit
         FROM
           cm_cart cc
           LEFT JOIN cm_hehe_product chp ON cc.productID = chp.productId