1
0
Преглед на файлове

Merge branch 'master' of hyq/kmall-pt into master

黄亚琴 преди 6 години
родител
ревизия
6f7a9062eb
променени са 29 файла, в които са добавени 612 реда и са изтрити 68 реда
  1. 20 8
      kmall-api/src/main/java/com/kmall/api/api/ApiIndexController.java
  2. 6 22
      kmall-api/src/main/java/com/kmall/api/api/ApiOrderController.java
  3. 5 7
      kmall-api/src/main/java/com/kmall/api/api/ApiPayController.java
  4. 0 1
      kmall-api/src/main/java/com/kmall/api/api/ApiUserController.java
  5. 4 0
      kmall-api/src/main/java/com/kmall/api/dao/ApiOrderMapper.java
  6. 48 0
      kmall-api/src/main/java/com/kmall/api/dto/IdCardMsgVo.java
  7. 10 0
      kmall-api/src/main/java/com/kmall/api/entity/OrderVo.java
  8. 26 6
      kmall-api/src/main/java/com/kmall/api/service/ApiOrderService.java
  9. 312 0
      kmall-api/src/main/java/com/kmall/api/util/HttpUtils.java
  10. 75 0
      kmall-api/src/main/java/com/kmall/api/util/IdCardUtil.java
  11. 8 0
      kmall-api/src/main/resources/mybatis/mapper/ApiOrderMapper.xml
  12. 8 0
      kmall-schedule/src/main/java/com/kmall/schedule/service/QzOrderService.java
  13. 6 2
      kmall-schedule/src/main/resources/mybatis/mapper/QzOrderMapper.xml
  14. 3 3
      wx-mall/pages/cart/cart.js
  15. 1 1
      wx-mall/pages/goods/goods.wxml
  16. 2 2
      wx-mall/pages/goods/goods.wxss
  17. 5 1
      wx-mall/pages/hotGoods/hotGoods.js
  18. 1 1
      wx-mall/pages/index/index.wxml
  19. 4 0
      wx-mall/pages/pay/pay.js
  20. 6 2
      wx-mall/pages/payResult/payResult.js
  21. 1 1
      wx-mall/pages/payResult/payResult.wxml
  22. 5 0
      wx-mall/pages/shopping/checkout/checkout.js
  23. 5 1
      wx-mall/pages/shopping/checkout/checkout.wxss
  24. 12 4
      wx-mall/pages/ucenter/order/order.wxml
  25. 31 5
      wx-mall/pages/ucenter/order/order.wxss
  26. 3 1
      wx-mall/pages/ucenter/orderDetail/orderDetail.wxml
  27. 5 0
      wx-mall/pages/ucenter/orderDetail/orderDetail.wxss
  28. BIN
      wx-mall/static/images/service-jg.png
  29. BIN
      wx-mall/static/images/service-tk.png

+ 20 - 8
kmall-api/src/main/java/com/kmall/api/api/ApiIndexController.java

@@ -1,12 +1,18 @@
 package com.kmall.api.api;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.kmall.api.annotation.IgnoreAuth;
 import com.kmall.api.annotation.LoginUser;
+import com.kmall.api.dto.IdCardMsgVo;
+import com.kmall.api.dto.SendMsgVo;
 import com.kmall.api.entity.*;
 import com.kmall.api.service.*;
 import com.kmall.api.util.ApiBaseAction;
+import com.kmall.api.util.IdCardUtil;
 import com.kmall.common.utils.RRException;
+import org.apache.http.HttpResponse;
+import org.apache.http.util.EntityUtils;
 import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -14,6 +20,7 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpUtils;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -134,22 +141,27 @@ public class ApiIndexController extends ApiBaseAction {
         userVo.setId(userId);
         try {
             if(user != null){
-                if(loginUser.getId() == user.getId()){
-                    // TODO: 2018/10/18 实名认证身份证信息
-                    apiUserService.update(userVo);
-                    return toResponsMsgSuccess("实名绑定成功");
-                }else{
+                if(loginUser.getId() != user.getId()){
                     return toResponsFail("该身份证信息已被绑定");
                 }
-            }else{
-                // TODO: 2018/10/18 实名认证身份证信息
+            }
+            //实名认证身份证信息
+            String result = IdCardUtil.checkIdCard(idNo, username);
+            logger.info("idcard check result:"+result);
+            IdCardMsgVo vo = JSON.parseObject(result,IdCardMsgVo.class);
+            if(vo.getRespCode().equalsIgnoreCase("0000")){
                 apiUserService.update(userVo);
                 return toResponsMsgSuccess("实名绑定成功");
-
+            }else{
+                return toResponsFail(vo.getRespMessage());
             }
         }catch (Exception e){
             e.printStackTrace();
             return toResponsFail("系统异常");
         }
     }
+    public static void main(String[] args) {
+
+    }
+
 }

+ 6 - 22
kmall-api/src/main/java/com/kmall/api/api/ApiOrderController.java

@@ -205,28 +205,12 @@ public class ApiOrderController extends ApiBaseAction {
                 return toResponsObject(400, "订单号为"+orderInfo.getOrder_sn()+"的订单不存在", "");
             }
             actualPrice = actualPrice.add(orderInfo.getActual_price());
-            /*if (status == 0) {
+            if (status == 0) {
                 OrderVo orderVo = new OrderVo();
                 orderVo.setOrder_status(Integer.parseInt(Dict.orderStatus.item_0.getItem()));
                 orderVo.setPay_status(Integer.parseInt(Dict.payStatus.item_0.getItem()));
                 orderVo.setId(orderInfo.getId());
                 orderService.update(orderVo);
-            }*/
-            String out_trade_no = orderInfo.getMerchOrderSn();
-            WechatRefundApiResult result = WechatUtil.wxOrderQuery(out_trade_no);
-            if (result.getReturn_code().equalsIgnoreCase("SUCCESS")) {
-                if(result.getResult_code().equalsIgnoreCase("SUCCESS")
-                        && result.getTrade_state().equalsIgnoreCase("NOTPAY")) {//订单未支付
-                    OrderVo orderVo = new OrderVo();
-                    orderVo.setOrder_status(Integer.parseInt(Dict.orderStatus.item_0.getItem()));
-                    orderVo.setPay_status(Integer.parseInt(Dict.payStatus.item_0.getItem()));
-                    orderVo.setId(orderInfo.getId());
-                    orderService.update(orderVo);
-                }else{
-                    logger.info(">>>>>>>>>>>>>>>>>>>>orderQueryUpdate 微信查询接口返回失败信息:code 【"+result.getErr_code()+"】,des【"+result.getErr_code_des()+"】");
-                }
-            }else {
-                logger.info(">>>>>>>>>>>>>>>>>>>>orderQueryUpdate 微信查询接口调用失败: "+result.getReturn_msg());
             }
         }
         //订单的商品
@@ -426,19 +410,19 @@ public class ApiOrderController extends ApiBaseAction {
             orderRefund.setRefundMoney(orderInfo.getActual_price());
 
             if(mallOrderRefund !=null){
-                if(mallOrderRefund.getRefundType() == Integer.parseInt(Dict.RefundStatus.item_2.getItem()) ){
+                if(mallOrderRefund.getRefundStatus() == Integer.parseInt(Dict.RefundStatus.item_2.getItem()) ){
                     return toResponsFail("该订单已退款成功,请勿重复申请");
                 }
-                if(mallOrderRefund.getRefundType() == Integer.parseInt(Dict.RefundStatus.item_5.getItem()) ){
+                if(mallOrderRefund.getRefundStatus() == Integer.parseInt(Dict.RefundStatus.item_5.getItem()) ){
                     return toResponsFail("该订单在退款处理中,请勿重复申请");
                 }
-                if(mallOrderRefund.getRefundType() == Integer.parseInt(Dict.RefundStatus.item_1.getItem()) ){
+                if(mallOrderRefund.getRefundStatus() == Integer.parseInt(Dict.RefundStatus.item_1.getItem()) ){
                     return toResponsFail("该订单在退款申请中,请勿重复申请");
                 }
                 orderRefund.setId(mallOrderRefund.getId());
                 apiOrderRefundService.update(orderRefund);
-                if(mallOrderRefund.getRefundType() == Integer.parseInt(Dict.RefundStatus.item_4.getItem()) ||
-                        mallOrderRefund.getRefundType() == Integer.parseInt(Dict.RefundStatus.item_3.getItem())){
+                if(mallOrderRefund.getRefundStatus() == Integer.parseInt(Dict.RefundStatus.item_4.getItem()) ||
+                        mallOrderRefund.getRefundStatus() == Integer.parseInt(Dict.RefundStatus.item_3.getItem())){
                     return toResponsMsgSuccess("重新申请订单成功");
                 }
             }else{

+ 5 - 7
kmall-api/src/main/java/com/kmall/api/api/ApiPayController.java

@@ -16,6 +16,7 @@ import com.kmall.common.utils.wechat.AESUtil;
 import com.kmall.common.utils.wechat.WechatRefundApiResult;
 import com.kmall.common.utils.wechat.WechatRefundResult;
 import com.kmall.common.utils.wechat.WechatUtil;
+import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -82,17 +83,14 @@ public class ApiPayController extends ApiBaseAction {
                 return toResponsObject(400, "订单号为"+orderInfo.getOrder_sn()+"的订单已支付,请不要重复操作", "");
             }
             merchOrderSn = orderInfo.getMerchOrderSn();
-            OrderVo orderVo = new OrderVo();
-            if(Dict.isMergePay.item_0.getItem().equalsIgnoreCase(isMergePay)){//如此次是单笔支付,则查询下单时该商户订单是否是拆单订单,如果都满足,则更新商户订单号,生成新的预支付信息
-                if(orderService.queryCountByMerchOrderSn(merchOrderSn) > 1) {//不止一笔订单则为拆单订单
+
+            //如此次是单笔支付,则判断下单时该商户订单是否是拆单订单,如果都满足,则更新商户订单号,生成新的预支付信息
+            if(Dict.isMergePay.item_0.getItem().equalsIgnoreCase(isMergePay)) {
+                if ("2".equalsIgnoreCase(orderInfo.getIsMergePay())) {//多笔订单单笔支付,则商户订单号,生成新的预支付信息
                     merchOrderSn = "EMATO" + new SimpleDateFormat("yyyyMMddhhmmss").format(new Date());
                     orderInfo.setMerchOrderSn(merchOrderSn);
-                    orderVo.setMerchOrderSn(orderInfo.getMerchOrderSn());
                 }
             }
-            orderVo.setIsMergePay(isMergePay);
-            orderVo.setId(orderInfo.getId());
-            orderService.update(orderVo);
 
             OrderProcessRecordEntity processRecordEntity = orderProcessRecordService.queryObjectByOrderSn(orderInfo.getOrder_sn());
             if(processRecordEntity != null){

+ 0 - 1
kmall-api/src/main/java/com/kmall/api/api/ApiUserController.java

@@ -71,7 +71,6 @@ public class ApiUserController extends ApiBaseAction {
             //发送验证码到手机
             String result = SendMsgUtil.sendMsg(phone,msgContent);
             SendMsgVo vo = JSON.parseObject(result,SendMsgVo.class);
-            System.out.println(result);
 
             SysSmsLogEntity smsLog = new SysSmsLogEntity();
             smsLog.setUserId(loginUser.getId());

+ 4 - 0
kmall-api/src/main/java/com/kmall/api/dao/ApiOrderMapper.java

@@ -39,5 +39,9 @@ public interface ApiOrderMapper extends BaseDao<OrderVo> {
 
     int queryCountByMerchOrderSn(@Param("merchOrderSn")String merchOrderSn);
 
+    int queryCountByPayId(@Param("payId")String payId);
+
+    int updateOrderByMerchOrderSn(OrderVo orderVo);
+
     List<OrderVo> queryOrderByMerchOrderSnAndRefundStatus(@Param("merchOrderSn")String merchOrderSn);
 }

+ 48 - 0
kmall-api/src/main/java/com/kmall/api/dto/IdCardMsgVo.java

@@ -0,0 +1,48 @@
+package com.kmall.api.dto;
+
+/**
+ * @author huangyaqin
+ * @version 1.0
+ * 2018-10-16 14:23
+ */
+public class IdCardMsgVo {
+    private String respCode;
+
+    private String respMessage;
+
+    private String idNo;
+
+    private String name;
+
+    public String getRespCode() {
+        return respCode;
+    }
+
+    public void setRespCode(String respCode) {
+        this.respCode = respCode;
+    }
+
+    public String getRespMessage() {
+        return respMessage;
+    }
+
+    public void setRespMessage(String respMessage) {
+        this.respMessage = respMessage;
+    }
+
+    public String getIdNo() {
+        return idNo;
+    }
+
+    public void setIdNo(String idNo) {
+        this.idNo = idNo;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 10 - 0
kmall-api/src/main/java/com/kmall/api/entity/OrderVo.java

@@ -171,6 +171,16 @@ public class OrderVo implements Serializable {
 
     private String isMergePay;
 
+    private String isCreatePayId;
+
+    public String getIsCreatePayId() {
+        return isCreatePayId;
+    }
+
+    public void setIsCreatePayId(String isCreatePayId) {
+        this.isCreatePayId = isCreatePayId;
+    }
+
     public String getIsMergePay() {
         return isMergePay;
     }

+ 26 - 6
kmall-api/src/main/java/com/kmall/api/service/ApiOrderService.java

@@ -1,11 +1,14 @@
 package com.kmall.api.service;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.kmall.api.contants.Dict;
 import com.kmall.api.dao.*;
+import com.kmall.api.dto.IdCardMsgVo;
 import com.kmall.api.entity.*;
 import com.kmall.api.service.merch.OmsMerchPropertiesBuilder;
 import com.kmall.api.util.CommonUtil;
+import com.kmall.api.util.IdCardUtil;
 import com.kmall.common.dao.TemplateConfDao;
 import com.kmall.common.entity.FormIdsEntity;
 import com.kmall.common.entity.TemplateConfVo;
@@ -116,6 +119,9 @@ public class ApiOrderService {
         order.setModTime(new Date());
         apiOrderMapper.update(order);
     }
+    public void updateOrderByMerchOrderSn(OrderVo order) {
+        apiOrderMapper.updateOrderByMerchOrderSn(order);
+    }
 
 
     public void delete(Integer id) {
@@ -151,17 +157,21 @@ public class ApiOrderService {
         userVo.setIdNo(idNo);
         userVo.setUsername(userName);
         if(user != null){
-            if(loginUser.getId() == user.getId()){
-                // TODO: 2018/10/18 实名认证身份证信息,认证成功更新到用户表
-                apiUserMapper.update(userVo);
-            }else{
+            if(loginUser.getId() != user.getId()){
                 resultObj.put("errno", 400);
                 resultObj.put("errmsg", "该身份证信息已被绑定");
                 return resultObj;
             }
-        }else{
-            // TODO: 2018/10/18 实名认证身份证信息,认证成功更新到用户表
+        }
+        // 实名认证身份证信息,认证成功更新到用户表
+        String result = IdCardUtil.checkIdCard(userVo.getIdNo(), userVo.getUsername());
+        IdCardMsgVo vo = JSON.parseObject(result,IdCardMsgVo.class);
+        if(vo.getRespCode().equalsIgnoreCase("0000")){
             apiUserMapper.update(userVo);
+        }else{
+            resultObj.put("errno", 400);
+            resultObj.put("errmsg", vo.getRespMessage());
+            return resultObj;
         }
 
         //获取要购买的商品
@@ -301,6 +311,13 @@ public class ApiOrderService {
 
             //清空已购买的商品
             apiCartMapper.deleteByCart(loginUser.getId(), storeId, 1);
+
+            if (apiOrderMapper.queryCountByMerchOrderSn(merchOrderSn) > 1) {//不止一笔订单则为拆单订单
+                OrderVo orderVo = new OrderVo();
+                orderVo.setIsMergePay("2");//多笔订单单笔支付
+                orderVo.setMerchOrderSn(merchOrderSn);
+                apiOrderMapper.updateOrderByMerchOrderSn(orderVo);
+            }
             resultObj.put("errno", 0);
             resultObj.put("errmsg", "订单提交成功");
             //
@@ -758,6 +775,9 @@ public class ApiOrderService {
     public int queryCountByMerchOrderSn(String merchOrderSn){
         return apiOrderMapper.queryCountByMerchOrderSn(merchOrderSn);
     }
+    public int queryCountByPayId(String payId){
+        return apiOrderMapper.queryCountByPayId(payId);
+    }
     public List<OrderVo> queryOrderByMerchOrderSnAndRefundStatus(String merchOrderSn){
         return apiOrderMapper.queryOrderByMerchOrderSnAndRefundStatus(merchOrderSn);
     }

+ 312 - 0
kmall-api/src/main/java/com/kmall/api/util/HttpUtils.java

@@ -0,0 +1,312 @@
+package com.kmall.api.util;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.HttpDelete;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.conn.ClientConnectionManager;
+import org.apache.http.conn.scheme.Scheme;
+import org.apache.http.conn.scheme.SchemeRegistry;
+import org.apache.http.conn.ssl.SSLSocketFactory;
+import org.apache.http.entity.ByteArrayEntity;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.message.BasicNameValuePair;
+
+public class HttpUtils {
+
+    /**
+     * get
+     *
+     * @param host
+     * @param path
+     * @param method
+     * @param headers
+     * @param querys
+     * @return
+     * @throws Exception
+     */
+    public static HttpResponse doGet(String host, String path, String method,
+                                     Map<String, String> headers,
+                                     Map<String, String> querys)
+            throws Exception {
+        HttpClient httpClient = wrapClient(host);
+
+        HttpGet request = new HttpGet(buildUrl(host, path, querys));
+        for (Map.Entry<String, String> e : headers.entrySet()) {
+            request.addHeader(e.getKey(), e.getValue());
+        }
+
+        return httpClient.execute(request);
+    }
+
+    /**
+     * post form
+     *
+     * @param host
+     * @param path
+     * @param method
+     * @param headers
+     * @param querys
+     * @param bodys
+     * @return
+     * @throws Exception
+     */
+    public static HttpResponse doPost(String host, String path, String method,
+                                      Map<String, String> headers,
+                                      Map<String, String> querys,
+                                      Map<String, String> bodys)
+            throws Exception {
+        HttpClient httpClient = wrapClient(host);
+
+        HttpPost request = new HttpPost(buildUrl(host, path, querys));
+        for (Map.Entry<String, String> e : headers.entrySet()) {
+            request.addHeader(e.getKey(), e.getValue());
+        }
+
+        if (bodys != null) {
+            List<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>();
+
+            for (String key : bodys.keySet()) {
+                nameValuePairList.add(new BasicNameValuePair(key, bodys.get(key)));
+            }
+            UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nameValuePairList, "utf-8");
+            formEntity.setContentType("application/x-www-form-urlencoded; charset=UTF-8");
+            request.setEntity(formEntity);
+        }
+
+        return httpClient.execute(request);
+    }
+
+    /**
+     * Post String
+     *
+     * @param host
+     * @param path
+     * @param method
+     * @param headers
+     * @param querys
+     * @param body
+     * @return
+     * @throws Exception
+     */
+    public static HttpResponse doPost(String host, String path, String method,
+                                      Map<String, String> headers,
+                                      Map<String, String> querys,
+                                      String body)
+            throws Exception {
+        HttpClient httpClient = wrapClient(host);
+
+        HttpPost request = new HttpPost(buildUrl(host, path, querys));
+        for (Map.Entry<String, String> e : headers.entrySet()) {
+            request.addHeader(e.getKey(), e.getValue());
+        }
+
+        if (StringUtils.isNotBlank(body)) {
+            request.setEntity(new StringEntity(body, "utf-8"));
+        }
+
+        return httpClient.execute(request);
+    }
+
+    /**
+     * Post stream
+     *
+     * @param host
+     * @param path
+     * @param method
+     * @param headers
+     * @param querys
+     * @param body
+     * @return
+     * @throws Exception
+     */
+    public static HttpResponse doPost(String host, String path, String method,
+                                      Map<String, String> headers,
+                                      Map<String, String> querys,
+                                      byte[] body)
+            throws Exception {
+        HttpClient httpClient = wrapClient(host);
+
+        HttpPost request = new HttpPost(buildUrl(host, path, querys));
+        for (Map.Entry<String, String> e : headers.entrySet()) {
+            request.addHeader(e.getKey(), e.getValue());
+        }
+
+        if (body != null) {
+            request.setEntity(new ByteArrayEntity(body));
+        }
+
+        return httpClient.execute(request);
+    }
+
+    /**
+     * Put String
+     * @param host
+     * @param path
+     * @param method
+     * @param headers
+     * @param querys
+     * @param body
+     * @return
+     * @throws Exception
+     */
+    public static HttpResponse doPut(String host, String path, String method,
+                                     Map<String, String> headers,
+                                     Map<String, String> querys,
+                                     String body)
+            throws Exception {
+        HttpClient httpClient = wrapClient(host);
+
+        HttpPut request = new HttpPut(buildUrl(host, path, querys));
+        for (Map.Entry<String, String> e : headers.entrySet()) {
+            request.addHeader(e.getKey(), e.getValue());
+        }
+
+        if (StringUtils.isNotBlank(body)) {
+            request.setEntity(new StringEntity(body, "utf-8"));
+        }
+
+        return httpClient.execute(request);
+    }
+
+    /**
+     * Put stream
+     * @param host
+     * @param path
+     * @param method
+     * @param headers
+     * @param querys
+     * @param body
+     * @return
+     * @throws Exception
+     */
+    public static HttpResponse doPut(String host, String path, String method,
+                                     Map<String, String> headers,
+                                     Map<String, String> querys,
+                                     byte[] body)
+            throws Exception {
+        HttpClient httpClient = wrapClient(host);
+
+        HttpPut request = new HttpPut(buildUrl(host, path, querys));
+        for (Map.Entry<String, String> e : headers.entrySet()) {
+            request.addHeader(e.getKey(), e.getValue());
+        }
+
+        if (body != null) {
+            request.setEntity(new ByteArrayEntity(body));
+        }
+
+        return httpClient.execute(request);
+    }
+
+    /**
+     * Delete
+     *
+     * @param host
+     * @param path
+     * @param method
+     * @param headers
+     * @param querys
+     * @return
+     * @throws Exception
+     */
+    public static HttpResponse doDelete(String host, String path, String method,
+                                        Map<String, String> headers,
+                                        Map<String, String> querys)
+            throws Exception {
+        HttpClient httpClient = wrapClient(host);
+
+        HttpDelete request = new HttpDelete(buildUrl(host, path, querys));
+        for (Map.Entry<String, String> e : headers.entrySet()) {
+            request.addHeader(e.getKey(), e.getValue());
+        }
+
+        return httpClient.execute(request);
+    }
+
+    private static String buildUrl(String host, String path, Map<String, String> querys) throws UnsupportedEncodingException {
+        StringBuilder sbUrl = new StringBuilder();
+        sbUrl.append(host);
+        if (!StringUtils.isBlank(path)) {
+            sbUrl.append(path);
+        }
+        if (null != querys) {
+            StringBuilder sbQuery = new StringBuilder();
+            for (Map.Entry<String, String> query : querys.entrySet()) {
+                if (0 < sbQuery.length()) {
+                    sbQuery.append("&");
+                }
+                if (StringUtils.isBlank(query.getKey()) && !StringUtils.isBlank(query.getValue())) {
+                    sbQuery.append(query.getValue());
+                }
+                if (!StringUtils.isBlank(query.getKey())) {
+                    sbQuery.append(query.getKey());
+                    if (!StringUtils.isBlank(query.getValue())) {
+                        sbQuery.append("=");
+                        sbQuery.append(URLEncoder.encode(query.getValue(), "utf-8"));
+                    }
+                }
+            }
+            if (0 < sbQuery.length()) {
+                sbUrl.append("?").append(sbQuery);
+            }
+        }
+
+        return sbUrl.toString();
+    }
+
+    private static HttpClient wrapClient(String host) {
+        HttpClient httpClient = new DefaultHttpClient();
+        if (host.startsWith("https://")) {
+            sslClient(httpClient);
+        }
+
+        return httpClient;
+    }
+
+    private static void sslClient(HttpClient httpClient) {
+        try {
+            SSLContext ctx = SSLContext.getInstance("TLS");
+            X509TrustManager tm = new X509TrustManager() {
+                public X509Certificate[] getAcceptedIssuers() {
+                    return null;
+                }
+                public void checkClientTrusted(X509Certificate[] xcs, String str) {
+
+                }
+                public void checkServerTrusted(X509Certificate[] xcs, String str) {
+
+                }
+            };
+            ctx.init(null, new TrustManager[] { tm }, null);
+            SSLSocketFactory ssf = new SSLSocketFactory(ctx);
+            ssf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
+            ClientConnectionManager ccm = httpClient.getConnectionManager();
+            SchemeRegistry registry = ccm.getSchemeRegistry();
+            registry.register(new Scheme("https", 443, ssf));
+        } catch (KeyManagementException ex) {
+            throw new RuntimeException(ex);
+        } catch (NoSuchAlgorithmException ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+}

+ 75 - 0
kmall-api/src/main/java/com/kmall/api/util/IdCardUtil.java

@@ -0,0 +1,75 @@
+package com.kmall.api.util;
+
+import com.kmall.api.service.common.CommonPropertiesBuilder;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.util.EntityUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author huangyaqin
+ * @version 1.0
+ * 2018-10-16 11:27
+ */
+public class IdCardUtil {
+    //编码格式。发送编码格式统一用UTF-8
+    private static String ENCODING = "UTF-8";
+    /**
+     * 实名校验
+     * 方法说明
+     * @Discription:扩展说明
+     * @return
+     * @return String
+     */
+    @SuppressWarnings("deprecation")
+    public static String checkIdCard(String idNo,String name) {
+        String appcode = CommonPropertiesBuilder.instance().getIdCardApiKey();
+        String host = CommonPropertiesBuilder.instance().getIdCardUrl();
+//        String appcode = "6a4e3f16f85843cb9575b14cf93aeded";
+//        String host = "https://idenauthen.market.alicloudapi.com";
+        String path = "/idenAuthentication";
+        String method = "POST";
+        Map<String, String> headers = new HashMap<String, String>();
+        //最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
+        headers.put("Authorization", "APPCODE " + appcode);
+        //根据API的要求,定义相对应的Content-Type
+        headers.put("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
+        Map<String, String> querys = new HashMap<String, String>();
+        Map<String, String> bodys = new HashMap<String, String>();
+        bodys.put("idNo", idNo);
+        bodys.put("name", name);
+        HttpResponse response = null;
+
+        try {
+            response = HttpUtils.doPost(host, path, method, headers, querys, bodys);
+            //获取response的body
+            return EntityUtils.toString(response.getEntity());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return "";
+    }
+    /**
+     * 测试
+     * 方法说明
+     * @Discription:扩展说明
+     * @param args
+     * @return void
+     */
+    public static void main(String[] args) {
+//      System.out.println(SendMsgUtil.createRandomVcode());
+//      System.out.println("&ecb=12".substring(1));
+        System.out.println(checkIdCard("430527199312244222", "黄亚琴"));
+    }
+}

+ 8 - 0
kmall-api/src/main/resources/mybatis/mapper/ApiOrderMapper.xml

@@ -555,6 +555,14 @@
         where id = #{id}
     </update>
 
+    <update id="updateOrderByMerchOrderSn" parameterType="com.kmall.api.entity.OrderVo">
+        update mall_order
+        <set>
+            `is_merge_pay` = #{isMergePay}
+        </set>
+        where merch_order_sn = #{merchOrderSn}
+    </update>
+
     <select id="queryUcenterMap" resultType="map">
         select count(a.id) as orders, sum(case a.order_status when 0 then 1 else 0 end ) as unPayNum, sum(case a.order_status when 300 then 1 else 0 end ) as unTakeNum
         ,sum(case a.order_status when 201 then 1 else 0 end ) as unPaymentNum,

+ 8 - 0
kmall-schedule/src/main/java/com/kmall/schedule/service/QzOrderService.java

@@ -296,6 +296,10 @@ public class QzOrderService {
                 String out_trade_no = MapUtils.getString("merch_order_sn", map);
                 String orderId = MapUtils.getString("order_id", map);
                 String add_time = MapUtils.getString("add_time", map);
+                Integer number = MapUtils.getInteger("number", map);
+                Integer stock_num = MapUtils.getInteger("stock_num", map);
+                Long storeRelaId = MapUtils.getLong("storeRelaId", map);
+
                 Date addTime = DateUtils.strToDate(add_time);
                 Date nowDate = new Date();
                 WechatRefundApiResult result = WechatUtil.wxOrderQuery(out_trade_no);
@@ -316,6 +320,10 @@ public class QzOrderService {
                         if(getDateBetween(addTime,nowDate) >= 15){//订单下单时间超过15分钟直接取消订单
                             orderRaram.put("payStatus", 0);//支付状态未支付
                             orderRaram.put("orderStatus", 101);//订单状态已取消
+                            Map param = new HashMap();
+                            param.put("id", storeRelaId);
+                            param.put("stock_num", stock_num + number);
+                            qzOrderMapper.updateStockNum(param);
                         }else{
                             orderRaram.put("payStatus", 0);//支付状态未支付
                             orderRaram.put("orderStatus", 0);//订单状态未支付

+ 6 - 2
kmall-schedule/src/main/resources/mybatis/mapper/QzOrderMapper.xml

@@ -56,8 +56,12 @@
     </select>
 
     <select id="queryPayingOrderList" resultType="map">
-		select a.pay_transaction_id,a.order_sn,a.order_status,a.pay_status,a.id 'order_id',a.merch_order_sn,date_format(a.add_time,'%Y-%m-%d %H:%i:%s') as add_time
-        from mall_order a where (a.order_status in ('100','201') and a.pay_status in (1,2))
+		select a.pay_transaction_id,a.order_sn,a.order_status,a.pay_status,a.id 'order_id',a.merch_order_sn,date_format(a.add_time,'%Y-%m-%d %H:%i:%s') as add_time,
+        b.product_id,b.number,c.stock_num,c.id as storeRelaId
+        from mall_order a
+        LEFT JOIN mall_order_goods b ON a.id = b.order_id
+        LEFT JOIN mall_product_store_rela c ON b.product_id = c.product_id
+        AND c.store_id = a.store_id  where (a.order_status in ('100','201') and a.pay_status in (1,2))
         and (a.pay_transaction_id = '' or a.pay_transaction_id is null or a.pay_time is null or a.pay_time = '')
     </select>
 

+ 3 - 3
wx-mall/pages/cart/cart.js

@@ -92,10 +92,10 @@ Page({
   },
   getCartList: function () {//获取购物车数据
     let that = this;
+    wx.showLoading({
+      title: '加载中...',
+    });
     util.request(api.CartList).then(function (res) {
-      wx.showLoading({
-        title: '加载中...',
-      });
       if (res.errno === 0) {
         that.setCommonData(res);
       }

+ 1 - 1
wx-mall/pages/goods/goods.wxml

@@ -60,7 +60,7 @@
             <text>{{brand.name}}</text>
           </navigator>
         </view> -->
-        <view>
+        <view style='margin-top:20px;'>
           <text class="desc">快递:{{defaultFreight==0?"免邮":"元"}}</text>
           <text class="desc2">销量:{{goods.sell_volume==null?0:goods.sell_volume}}</text>
         </view>

+ 2 - 2
wx-mall/pages/goods/goods.wxss

@@ -58,7 +58,7 @@
 
 .goods-info .name {
   height: 41rpx;
-  margin-bottom: 10rpx;
+  margin-bottom: 20rpx;
   font-size: 30rpx;
   line-height: 41rpx;
   margin-top: 10rpx;
@@ -75,7 +75,7 @@
 .desc2{
   position:absolute;
   right:220rpx;
-  top:880rpx;
+  top:910rpx;
   height: 43rpx;
   margin-bottom: 41rpx;
   font-size: 24rpx;

+ 5 - 1
wx-mall/pages/hotGoods/hotGoods.js

@@ -44,7 +44,10 @@ Page({
       }
     });
   },
-  getGoodsList (){
+  getGoodsList() {
+    wx.showLoading({
+      title: '加载中...',
+    });
     var that = this;
 
     util.request(api.HotGoodsList, { isHot: 1, page: that.data.page, size: that.data.size, order: that.data.currentSortOrder, sort: that.data.currentSortType, categoryId: that.data.categoryId})
@@ -54,6 +57,7 @@ Page({
             goodsList: res.data.goodsList,
             filterCategory: res.data.filterCategory
           });
+          wx.hideLoading();
           if(that.data.categoryId>0){
             let filterCategory = that.data.filterCategory;
             filterCategory.forEach(function (val, index, arr) {

+ 1 - 1
wx-mall/pages/index/index.wxml

@@ -27,7 +27,7 @@
     <view bindtap="handleStore" class="current-store arrow arrow-down">{{ storeName }}</view>
   </view>
 
-  <swiper class="banner" indicator-dots="true" autoplay="true" interval="3000" duration="750">
+  <swiper class="banner" indicator-dots="true" autoplay="true" interval="15000" duration="750">
     <swiper-item wx:for="{{banner}}" wx:key="{{item.id}}">
       <navigator url="{{item.link}}">
         <image class="swiper-item" src="{{item.imageUrl}}" background-size="cover"></image>

+ 4 - 0
wx-mall/pages/pay/pay.js

@@ -35,6 +35,9 @@ Page({
   //向服务请求支付参数
   requestPayParam() {
     let that = this;
+    wx.showLoading({
+      title: '加载中...',
+    });
     // 测试领取优惠券
     // wx.redirectTo({
     //   url: '/pages/payResult/payResult?status=1&orderId=' + that.data.orderId,
@@ -46,6 +49,7 @@ Page({
       }).then(function (res) {
       if (res.errno === 0) {
         let payParam = res.data;
+        wx.hideLoading();
         wx.requestPayment({
           'timeStamp': payParam.timeStamp,
           'nonceStr': payParam.nonceStr,

+ 6 - 2
wx-mall/pages/payResult/payResult.js

@@ -21,12 +21,16 @@ Page({
         this.getOrderDetail();
     },
     getOrderDetail() {
-        let that = this;
+      let that = this;
+      wx.showLoading({
+        title: '加载中...',
+      });
         util.request(api.OrderDetailList, {
             orderIds: that.data.orderIds,
             status:that.data.status
         }).then(function (res) {
-            if (res.errno === 0) {
+          if (res.errno === 0) {
+              wx.hideLoading();
                 console.log(res.data);
                 that.setData({
                     actualPrice: res.data.actualPrice,

+ 1 - 1
wx-mall/pages/payResult/payResult.wxml

@@ -18,7 +18,7 @@
       </view>
       <view class="btns">
         <navigator class="btn" url="/pages/ucenter/order/order" open-type="redirect">查看订单</navigator>
-        <navigator class="btn" url="/pages/pay/pay?orderIds={{orderIds}}&actualPrice={{actualPrice}}&isMergePay=0" open-type="redirect">重新付款</navigator>
+        <navigator class="btn" url="/pages/pay/pay?orderIds={{orderIds}}&actualPrice={{actualPrice}}&isMergePay=1" open-type="redirect">重新付款</navigator>
       </view>
     </view>
   </view>

+ 5 - 0
wx-mall/pages/shopping/checkout/checkout.js

@@ -236,6 +236,7 @@ Page({
   },
   submitOrder: function (e) {
     // console.log(e.detail.formId);
+    
 
     if (!this.data.addressVo) {
       util.showErrorToast('请选择收货地址');
@@ -276,6 +277,9 @@ Page({
     // console.log(that.data.postscript02);
     // console.log(that.data.postscript10);
     // console.log(that.data.postscript11);
+    wx.showLoading({
+      title: '加载中...',
+    });
 
     util.request(api.OrderSubmit, {
       checkedAddress: that.data.addressVo,
@@ -297,6 +301,7 @@ Page({
         for (let i = 0; i < res.data.orderInfo.length; i++){
           orderIds[i] = res.data.orderInfo[i].id;
         }
+        wx.hideLoading();
         wx.redirectTo({
           url: '/pages/pay/pay?orderIds=' + orderIds + '&actualPrice=' + actualPrice + '&isMergePay=1'//此处提交支付属于合并支付
         })

+ 5 - 1
wx-mall/pages/shopping/checkout/checkout.wxss

@@ -139,8 +139,12 @@ page {
 
 .goods-items .t .name {
   float: left;
-  width: 450rpx;
+  width: 400rpx;
   font-size: 24rpx;
+  overflow: hidden;
+text-overflow:ellipsis;
+white-space: nowrap;
+  
 }
 
 .goods-items .t .number {

+ 12 - 4
wx-mall/pages/ucenter/order/order.wxml

@@ -23,7 +23,8 @@
             <text class="biz-type" wx:if="{{item.orderBizType==11}}">{{item.storeName}} - 普通商品</text> 
             
             <!-- <text class="add_time">{{item.add_time}}{{orderList[0].id}}</text> -->
-            <text class="add_time" wx:if="{{tabIndex!=5}}">{{item.pay_status==3?'退款中':item.order_status_text}}</text>
+            <text class="add_time" wx:if="{{tabIndex!=5}}">{{item.pay_status==3?'退款中':item.order_status_text}}{{item.order_status == 201 && item.isRefundStatus?"(维权申请中)":""}}
+            </text>
           </view>
         </view>
         <view class="list-cell-ft router">
@@ -58,16 +59,23 @@
         <map id="map" longitude="{{item.markers[0].longitude}}" latitude="{{item.markers[0].latitude}}" show-location include-points markers="{{item.markers}}" style="width: 100%; height: 30vh;z-index: 600"></map>
       </view> -->
       
-      <view class="list-cell-tk" wx:if="{{tabIndex ==5 || (item.order_status == 401 || item.order_status == 402)}}">
-        <text style='font-size: 26rpx;'>
+      <view class="list-cell-tk" wx:if="{{tabIndex ==5 && (item.order_status == 401 || item.order_status == 402)}}">
+      <image src="../../../static/images/service-tk.png" class="search-icon-shop3"></image>
+        <text style='font-size: 26rpx;margin-left:5rpx'>
         {{item.order_status == 401?"仅退款 退款成功":""}}
         {{item.order_status == 402?"退货退款 退款成功":""}}
         </text>
       </view>
-      <view class="list-cell-wq" wx:if="{{item.order_status == 201 && item.isRefundStatus}}">
+      <!-- <view class="list-cell-wq" wx:if="{{item.order_status == 201 && item.isRefundStatus}}">
         <text class='names'>
         维权申请中
         </text>
+      </view> -->
+      <view class="list-cell-check" wx:if="{{item.buyerPayCheck == 1}}">
+      <image src="../../../static/images/service-jg.png" class="search-icon-shop2"></image>
+        <text class='names'>
+        您的订付人身份证姓名不一致
+        </text>
       </view>
 
       <view class="list-cell">

+ 31 - 5
wx-mall/pages/ucenter/order/order.wxss

@@ -12,7 +12,7 @@ page {
 
 .add_time{
   font-size: 0.9em;
-  color: red;
+  color:#FE7200;
   float: right;
   margin-top: 8rpx;
 
@@ -26,7 +26,6 @@ page {
 
 .order-details-cell text{
   font-size: .9em;
-  color: #9b9b9b;
 }
 
 .order-details-cell .name{
@@ -119,11 +118,12 @@ page {
   margin-bottom: -8rpx;
 }
 .list-cell-tk{
-  padding:5px 20px;
   position: relative;
   display: flex;
   align-items: center;
   height:40rpx;
+  margin-bottom:10px;
+  margin-left:512rpx;
 }
 .list-cell-wq{
   padding:5px 20px;
@@ -133,11 +133,37 @@ page {
   width: 300rpx;
   height: 0rpx;
   line-height: 0rpx;
-  margin-left:550rpx;
-  margin-bottom:16px;
+  /* margin-left:550rpx; */
+  margin-bottom:10px;
 }
 .list-cell-wq .names{
   font-size:14px;
+}
+.list-cell-check {
+  position:relative;
+  display:flex;
+  align-items:center;
+  height:30rpx;
+  bottom:8px;
+  left:230px;
+  line-height: 30rpx;
+  margin-bottom:10px;
+
+}
+.list-cell-check .names{
+  font-size:12px;
+  margin-left:5rpx;
   color:#FE7200;
 }
 
+.search-icon-shop2 {
+  width:28rpx;
+  height:28rpx;
+  margin-bottom:-24rpx;
+  vertical-align:middle;
+}
+.search-icon-shop3 {
+  width:28rpx;
+  height:28rpx;
+  vertical-align:middle;
+}

+ 3 - 1
wx-mall/pages/ucenter/orderDetail/orderDetail.wxml

@@ -28,7 +28,9 @@
           <view class="list-label week3" wx:if="{{orderInfo.order_status==201 && refundStatus == 3}}">
             您的退款申请订单已被拒绝,拒绝原因:{{approvalRemark}}
           </view>
-          
+          <view class="list-label week4" style='margin-top:14rpx;' wx:if="{{orderInfo.buyerPayCheck==1}}">
+            检测到您的订购人与支付人身份证与姓名不一致,请申请维权进行退款操作,保税商品订付人的身份信息必须一致再重新下单
+          </view>
         </view>
       </view>
     </view>

+ 5 - 0
wx-mall/pages/ucenter/orderDetail/orderDetail.wxss

@@ -391,6 +391,11 @@ page {
   color: white;
   margin-left: 40rpx;
 }
+.week4{
+  font-size: 0.8em !important;
+  color: white;
+  margin-left: 40rpx;
+}
 .btns {
   position: fixed;
   bottom: 0;

BIN
wx-mall/static/images/service-jg.png


BIN
wx-mall/static/images/service-tk.png