1
0
Quellcode durchsuchen

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

黄亚琴 vor 6 Jahren
Ursprung
Commit
f2b0b256e2

+ 38 - 18
kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java

@@ -371,8 +371,16 @@ public class OrderServiceImpl implements OrderService {
         OrderEntity orderEntity = queryObject(id);
         if (orderEntity == null) {
             throw new RRException("此订单不存在!");
-        } else if (orderEntity.getShippingStatus() == 0 || StringUtils.isNullOrEmpty(orderEntity.getShippingNo())) {
-            throw new RRException("此订单还未发货!");
+        }
+        if(orderEntity.getShippingStatus() == 0){
+            if(orderEntity.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_00.getItem())
+                    || orderEntity.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_02.getItem())){
+                throw new RRException("此订单还未发货!");
+            }else{
+                if (StringUtils.isNullOrEmpty(orderEntity.getShippingNo())) {
+                    throw new RRException("此订单还未发货!");
+                }
+            }
         }
 
         Map logisticsInfo = new HashMap();
@@ -385,28 +393,40 @@ public class OrderServiceImpl implements OrderService {
                     + "送达" + storeDao.queryObject(orderEntity.getStoreId()).getStoreAddress()
                     + ";交易完成,用户已提走");
             wuliuEntityList.add(wuliuEntity);
-        } else if (StringUtils.isNotEmpty(orderEntity.getShippingCode())
-                && StringUtils.isNotEmpty(orderEntity.getShippingNo())) {
-            JSONObject traces = KdniaoUtil.getOrderTracesByJson(orderEntity.getShippingCode(), orderEntity.getShippingNo());
-            List<Map> mapList = (List<Map>) traces.get("Traces");
-            for (Map map : mapList) {
+        }
+        OrderProcessRecordEntity orderProcessRecordEntity = orderProcessRecordDao.queryObjectByOrderSn(orderEntity.getOrderSn());
+        if (orderProcessRecordEntity != null) {
+            if (StringUtils.isNotEmpty(orderEntity.getShippingCode())
+                    && StringUtils.isNotEmpty(orderEntity.getShippingNo()) &&orderProcessRecordEntity.getShipmentSuccTime()!=null) {
+                JSONObject traces = KdniaoUtil.getOrderTracesByJson(orderEntity.getShippingCode(), orderEntity.getShippingNo());
+                List<Map> mapList = (List<Map>) traces.get("Traces");
+                for (Map map : mapList) {
+                    WuliuEntity wuliuEntity = new WuliuEntity();
+                    wuliuEntity.setAcceptTime(map.get("AcceptTime").toString());
+                    wuliuEntity.setAcceptStation(map.get("AcceptStation").toString());
+                    wuliuEntityList.add(wuliuEntity);
+                }
+
+                String state = traces.get("State").toString();
+                if (Dict.logisticsStatus.item_0.getItem().equals(state) && traces.getBoolean("Success")) {
+                    String reason = traces.get("Reason").toString();
+                    WuliuEntity wuliuEntity = new WuliuEntity();
+                    wuliuEntity.setAcceptStation(reason);
+                    wuliuEntityList.add(wuliuEntity);
+                }
+            }
+            if (Dict.isSend.item_1.getItem().equalsIgnoreCase(orderProcessRecordEntity.getIsCustomsSend()) && orderProcessRecordEntity.getShipmentSuccTime() != null) {
                 WuliuEntity wuliuEntity = new WuliuEntity();
-                wuliuEntity.setAcceptTime(map.get("AcceptTime").toString());
-                wuliuEntity.setAcceptStation(map.get("AcceptStation").toString());
+                wuliuEntity.setAcceptStation( "订单已出库");
+                wuliuEntity.setAcceptTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(orderProcessRecordEntity.getShipmentSuccTime()));
                 wuliuEntityList.add(wuliuEntity);
             }
-
-            String state = traces.get("State").toString();
-            if (Dict.logisticsStatus.item_0.getItem().equals(state) && traces.getBoolean("Success")) {
-                String reason = traces.get("Reason").toString();
+            if (Dict.isSend.item_1.getItem().equalsIgnoreCase(orderProcessRecordEntity.getIsCustomsSend()) && orderProcessRecordEntity.getShipmentStartTime() != null) {
                 WuliuEntity wuliuEntity = new WuliuEntity();
-                wuliuEntity.setAcceptStation(reason);
+                wuliuEntity.setAcceptStation( "订单正在打包中");
+                wuliuEntity.setAcceptTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(orderProcessRecordEntity.getShipmentStartTime()));
                 wuliuEntityList.add(wuliuEntity);
             }
-        }
-
-        OrderProcessRecordEntity orderProcessRecordEntity = orderProcessRecordDao.queryObjectByOrderSn(orderEntity.getOrderSn());
-        if (orderProcessRecordEntity != null) {
             if (Dict.isSend.item_1.getItem().equals(orderProcessRecordEntity.getIsCustomsSend())) {
                 WuliuEntity wuliuEntity = new WuliuEntity();
                 wuliuEntity.setAcceptStation("订单清关完成,等待仓库发货");

+ 3 - 3
kmall-admin/src/main/resources/conf/express-kdn.properties

@@ -1,7 +1,7 @@
 ########## 快递-快递鸟配置 ##########
 
 # [dev, prod]
-express.kdn.env = dev
+express.kdn.env=prod
 
 #========== 开发环境 ==========
 #电商ID
@@ -15,9 +15,9 @@ kdn.dev.url=http://api.kdniao.cc/Ebusiness/EbusinessOrderHandle.aspx
 
 #========== 生产环境 ==========
 #电商ID
-kdn.prod.businessId=1302764
+kdn.prod.businessId=1396325
 #电商加密私钥,快递鸟提供
-kdn.prod.appKey=d7e59ac9-88f4-4ba3-a391-b95076cfc622
+kdn.prod.appKey=928c373d-9481-4ce2-817a-a28863766a4f
 #快递鸟请求url
 kdn.prod.url=http://api.kdniao.cc/Ebusiness/EbusinessOrderHandle.aspx
 

+ 71 - 52
kmall-api/src/main/java/com/kmall/api/api/ApiOrderController.java

@@ -135,16 +135,40 @@ public class ApiOrderController extends ApiBaseAction {
 
         //查询物流轨迹
         List<Map> mapList = new ArrayList<>();
-
-        if((orderInfo.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem()) ||
-                orderInfo.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_02.getItem()))
-                && orderInfo.getOrder_status() == Integer.parseInt(Dict.orderStatus.item_301.getItem())){
-            Map map = new HashMap();
-            map.put("AcceptStation", "交易完成,用户已提走");
-            mapList.add(map);
-        }
         OrderProcessRecordEntity entity = orderProcessRecordService.queryObjectByOrderSn(orderInfo.getOrder_sn());
         if (entity != null) {
+            if((orderInfo.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem()) ||
+                    orderInfo.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_02.getItem()))){
+                Map map = new HashMap();
+                map.put("AcceptStation", "交易完成,用户已提走");
+                mapList.add(map);
+            }else{
+                if (!StringUtils.isEmpty(orderInfo.getShipping_code()) && !StringUtils.isEmpty(orderInfo.getShipping_no()) &&entity.getShipmentSuccTime()!=null) {
+                    JSONObject Traces = apiKdniaoService.getOrderTracesByJson(orderInfo.getShipping_code(), orderInfo.getShipping_no());
+                    if (Traces != null) {
+                        mapList = (List<Map>) Traces.get("Traces");
+                        String State = (String) Traces.get("State"); //物流状态:2-在途中,3-签收,4-问题件
+                        if (Dict.logisticsStatus.item_0.getItem().equalsIgnoreCase(State)) {
+                            Map noDataMap = new HashMap();
+                            noDataMap.put("AcceptTime", "");
+                            noDataMap.put("AcceptStation", Traces.get("Reason"));
+                            mapList.add(noDataMap);
+                        }
+                    }
+                }
+            }
+            if (Dict.isSend.item_1.getItem().equalsIgnoreCase(entity.getIsCustomsSend()) && entity.getShipmentSuccTime() != null) {
+                Map map = new HashMap();
+                map.put("AcceptTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(entity.getShipmentSuccTime()));
+                map.put("AcceptStation", "订单已出库");
+                mapList.add(map);
+            }
+            if (Dict.isSend.item_1.getItem().equalsIgnoreCase(entity.getIsCustomsSend()) && entity.getShipmentStartTime() != null) {
+                Map map = new HashMap();
+                map.put("AcceptTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(entity.getShipmentStartTime()));
+                map.put("AcceptStation", "订单正在打包中");
+                mapList.add(map);
+            }
             if (Dict.isSend.item_1.getItem().equalsIgnoreCase(entity.getIsCustomsSend())) {
                 Map map = new HashMap();
                 map.put("AcceptTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(entity.getCustomsSuccTime()));
@@ -164,21 +188,6 @@ public class ApiOrderController extends ApiBaseAction {
                 mapList.add(map);
             }
         }
-        if(!orderInfo.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem())){
-            if (!StringUtils.isEmpty(orderInfo.getShipping_code()) && !StringUtils.isEmpty(orderInfo.getShipping_no())) {
-                JSONObject Traces = apiKdniaoService.getOrderTracesByJson(orderInfo.getShipping_code(), orderInfo.getShipping_no());
-                if (Traces != null) {
-                    mapList = (List<Map>) Traces.get("Traces");
-                    String State = (String) Traces.get("State"); //物流状态:2-在途中,3-签收,4-问题件
-                    if (Dict.logisticsStatus.item_0.getItem().equalsIgnoreCase(State)) {
-                        Map noDataMap = new HashMap();
-                        noDataMap.put("AcceptTime", "");
-                        noDataMap.put("AcceptStation", Traces.get("Reason"));
-                        mapList.add(noDataMap);
-                    }
-                }
-            }
-        }
         resultObj.put("wuliu", mapList != null && mapList.size() > 0 ? mapList.get(0) : null);
 
         if(orderInfo.getOrder_status() == Integer.parseInt(Dict.orderStatus.item_401.getItem()) || orderInfo.getOrder_status() == Integer.parseInt(Dict.orderStatus.item_402.getItem()) ) {
@@ -309,38 +318,48 @@ public class ApiOrderController extends ApiBaseAction {
         }
         List<WuliuVo> wuliuList = new ArrayList<WuliuVo>();
 
-        if((orderInfo.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem())
-                || orderInfo.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_02.getItem()))
-                && orderInfo.getOrder_status() == Integer.parseInt(Dict.orderStatus.item_301.getItem())){
-            WuliuVo vo = new WuliuVo();
-            vo.setAcceptStation("交易完成,用户已提走");
-            wuliuList.add(vo);
-        }
-        if(!orderInfo.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem())) {
-            if (!StringUtils.isEmpty(orderInfo.getShipping_code()) && !StringUtils.isEmpty(orderInfo.getShipping_no())) {
-                // 快递
-                JSONObject Traces = apiKdniaoService.getOrderTracesByJson(orderInfo.getShipping_code(), orderInfo.getShipping_no());
-                List<Map> mapList = (List<Map>) Traces.get("Traces");
-                for (int i = 0; i < mapList.size(); i++) {
-                    WuliuVo vo = new WuliuVo();
-                    vo.setAcceptTime((String) mapList.get(i).get("AcceptTime"));
-                    vo.setAcceptStation((String) mapList.get(i).get("AcceptStation"));
-                    wuliuList.add(vo);
-                }
+        OrderProcessRecordEntity entity = orderProcessRecordService.queryObjectByOrderSn(orderInfo.getOrder_sn());
+        if(entity !=null){
+            if(orderInfo.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem())
+                    || orderInfo.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_02.getItem())){
+                WuliuVo vo = new WuliuVo();
+                vo.setAcceptStation("交易完成,用户已提走");
+                wuliuList.add(vo);
+            }else {
+                if (!StringUtils.isEmpty(orderInfo.getShipping_code()) && !StringUtils.isEmpty(orderInfo.getShipping_no()) && entity.getShipmentSuccTime() != null) {
+                    // 快递
+                    JSONObject Traces = apiKdniaoService.getOrderTracesByJson(orderInfo.getShipping_code(), orderInfo.getShipping_no());
+                    List<Map> mapList = (List<Map>) Traces.get("Traces");
+                    for (int i = 0; i < mapList.size(); i++) {
+                        WuliuVo vo = new WuliuVo();
+                        vo.setAcceptTime((String) mapList.get(i).get("AcceptTime"));
+                        vo.setAcceptStation((String) mapList.get(i).get("AcceptStation"));
+                        wuliuList.add(vo);
+                    }
 
-                String State = (String) Traces.get("State"); //物流状态:2-在途中,3-签收,4-问题件
-                String Reason = (String) Traces.get("Reason");
-                if (Dict.logisticsStatus.item_0.getItem().equalsIgnoreCase(State)) {
-                    WuliuVo wuliuVo = new WuliuVo();
-                    wuliuVo.setAcceptStation(Reason);
-                    wuliuList.add(wuliuVo);
+                    String State = (String) Traces.get("State"); //物流状态:2-在途中,3-签收,4-问题件
+                    String Reason = (String) Traces.get("Reason");
+                    if (Dict.logisticsStatus.item_0.getItem().equalsIgnoreCase(State)) {
+                        WuliuVo wuliuVo = new WuliuVo();
+                        wuliuVo.setAcceptStation(Reason);
+                        wuliuList.add(wuliuVo);
+                    }
+                    map.put("State", Traces.get("State")); //物流状态:2-在途中,3-签收,4-问题件
+                    map.put("Reason", Traces.get("Reason"));
                 }
-                map.put("State", Traces.get("State")); //物流状态:2-在途中,3-签收,4-问题件
-                map.put("Reason", Traces.get("Reason"));
             }
-        }
-        OrderProcessRecordEntity entity = orderProcessRecordService.queryObjectByOrderSn(orderInfo.getOrder_sn());
-        if(entity !=null){
+            if (Dict.isSend.item_1.getItem().equalsIgnoreCase(entity.getIsCustomsSend()) && entity.getShipmentSuccTime() != null) {
+                WuliuVo wuliuVo = new WuliuVo();
+                wuliuVo.setAcceptStation("订单已出库");
+                wuliuVo.setAcceptTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(entity.getShipmentSuccTime()));
+                wuliuList.add(wuliuVo);
+            }
+            if (Dict.isSend.item_1.getItem().equalsIgnoreCase(entity.getIsCustomsSend()) && entity.getShipmentStartTime() != null) {
+                WuliuVo wuliuVo = new WuliuVo();
+                wuliuVo.setAcceptStation("订单正在打包中");
+                wuliuVo.setAcceptTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(entity.getShipmentStartTime()));
+                wuliuList.add(wuliuVo);
+            }
             if(Dict.isSend.item_1.getItem().equalsIgnoreCase(entity.getIsCustomsSend())){
                 WuliuVo wuliuVo = new WuliuVo();
                 wuliuVo.setAcceptStation("订单清关完成,等待仓库发货");

+ 13 - 0
kmall-schedule/src/main/java/com/kmall/schedule/dao/QzOrderMapper.java

@@ -41,4 +41,17 @@ public interface QzOrderMapper {
     void updateOrderInfo(Map param);
 
     List<Map> queryPayingOrderList();
+
+    List<Map> queryShipmentOrderList();
+
+    List<Map> queryShipmentBondedOrderList();
+
+    void updateShipmentOrder(Map param);
+
+    List<Map> queryReceiptOrderList();
+
+    void insertComment(Map param);
+
+    void updateReceiptOrderByCommentCount();
+
 }

+ 21 - 1
kmall-schedule/src/main/java/com/kmall/schedule/quartz/OrderTask.java

@@ -58,7 +58,7 @@ public class OrderTask {
     }
 
     /**
-     * 方法描述:查询支付中的订单以及小程序更新支付信息异常订单,查询微信订单更新订单状态
+     * 方法描述:查询支付中的订单以及小程序更新支付信息异常订单,查询微信订单信息更新订单状态
      * 二分钟更新订单
      */
     @Scheduled(fixedRate = 1000 * 60 * 1)
@@ -67,6 +67,26 @@ public class OrderTask {
         qzOrderService.orderQueryUpdate();
         logger.info(">>>>>>>>>>>>>>>>>>>>orderQueryUpdate is end ");
     }
+
+    /**
+     * 方法描述:商品发货后7天自动确认收货
+     */
+    @Scheduled(cron = "0 0 2 * * ?")
+    public void shipmentOrderAutoTakeGoods() {
+        logger.info(">>>>>>>>>>>>>>>>>>>>shipmentOrderAutoTakeGoods is start ");
+        qzOrderService.shipmentOrderAutoTakeGoods();
+        logger.info(">>>>>>>>>>>>>>>>>>>>shipmentOrderAutoTakeGoods is end ");
+    }
+
+    /**
+     * 方法描述:确认收货后30天自动确认好评
+     */
+    @Scheduled(cron = "0 0 2 * * ?")
+    public void receiptOrderAutoComment() {
+        logger.info(">>>>>>>>>>>>>>>>>>>>receiptOrderAutoComment is start ");
+        qzOrderService.receiptOrderAutoComment();
+        logger.info(">>>>>>>>>>>>>>>>>>>>receiptOrderAutoComment is end ");
+    }
 }
 
 

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

@@ -191,6 +191,7 @@ public class QzOrderService {
     @Transactional
     public void unpayPastUpdate() {
         logger.info(">>>>>>>>>>>>>>>>>>>>unpayPastUpdate is start ");
+        logger.info(">>>>>>>>>>>>>>>>>>>>更新过期未支付订单 ");
         // 获取快过期订单
         List<Map> pastOrderList = qzOrderMapper.queryPastOrderList();
         if (null != pastOrderList && pastOrderList.size() > 0) {
@@ -214,6 +215,7 @@ public class QzOrderService {
     @Transactional
     public void refundUpdate() {
         logger.info(">>>>>>>>>>>>>>>>>>>>refundUpdate is start ");
+        logger.info(">>>>>>>>>>>>>>>>>>>>查询已申请退款订单以及退款中订单,查询微信退款信息更新订单状态 ");
         // 获取退款中或更新退款信息异常订单
         List<Map> refundOrderList = qzOrderMapper.queryRefundOrderList();
         if (null != refundOrderList && refundOrderList.size() > 0) {
@@ -289,6 +291,7 @@ public class QzOrderService {
     @Transactional
     public void orderQueryUpdate() {
         logger.info(">>>>>>>>>>>>>>>>>>>>orderQueryUpdate is start ");
+        logger.info(">>>>>>>>>>>>>>>>>>>>查询支付中的订单以及小程序更新支付信息异常订单,查询微信订单信息更新订单状态 ");
         // 获取支付中的订单以及小程序更新支付信息异常订单
         List<Map> orderList = qzOrderMapper.queryPayingOrderList();
         if (null != orderList && orderList.size() > 0) {
@@ -343,6 +346,68 @@ public class QzOrderService {
         logger.info(">>>>>>>>>>>>>>>>>>>>orderQueryUpdate is end ");
     }
 
+    @Transactional
+    public void shipmentOrderAutoTakeGoods() {
+        logger.info(">>>>>>>>>>>>>>>>>>>>shipmentOrderAutoTakeGoods is start ");
+        logger.info(">>>>>>>>>>>>>>>>>>>>商品发货后7天自动确认收货 ");
+        // 查询门店业务发货后7天的订单
+        List<Map> shipmentOrderList = qzOrderMapper.queryShipmentOrderList();
+        if (null != shipmentOrderList && shipmentOrderList.size() > 0) {
+            for (Map map:shipmentOrderList) {
+                Map orderMap = new HashMap();
+                orderMap.put("orderId",MapUtils.getLong("orderId",map));
+                qzOrderMapper.updateShipmentOrder(orderMap);
+            }
+        }
+        //查询保税备货发货后7天的订单
+        List<Map> shipmentBondedOrderList = qzOrderMapper.queryShipmentBondedOrderList();
+        if (null != shipmentBondedOrderList && shipmentBondedOrderList.size() > 0) {
+            for (Map map:shipmentBondedOrderList) {
+                Map orderMap = new HashMap();
+                orderMap.put("orderId",MapUtils.getLong("orderId",map));
+                qzOrderMapper.updateShipmentOrder(orderMap);
+            }
+        }
+        logger.info(">>>>>>>>>>>>>>>>>>>>shipmentOrderAutoTakeGoods is end ");
+    }
+
+    @Transactional
+    public void receiptOrderAutoComment() {
+        logger.info(">>>>>>>>>>>>>>>>>>>>receiptOrderAutoComment is start ");
+        logger.info(">>>>>>>>>>>>>>>>>>>>确认收货后30天自动确认好评 ");
+        // 获取收货后30天的订单
+        List<Map> receiptOrderList = qzOrderMapper.queryReceiptOrderList();
+        if (null != receiptOrderList && receiptOrderList.size() > 0) {
+            for (Map map : receiptOrderList) {
+                Long userId = MapUtils.getLong("userId", map);
+                Long orderId = MapUtils.getLong("orderId", map);
+                Long goodsId = MapUtils.getLong("goodsId", map);
+                Long productId = MapUtils.getLong("productId", map);
+                String goodsSpecificationNameValue = MapUtils.getString("goodsSpecificationNameValue", map);
+                String goodsName = MapUtils.getString("goodsName", map);
+
+                Map param = new HashMap();
+                param.put("userId", userId);
+                param.put("orderId", orderId);
+                param.put("valueId",goodsId);
+                param.put("typeId",0);
+                param.put("productId",productId);
+                param.put("goodsSpecificationNameValue",goodsSpecificationNameValue);
+                param.put("status","1");
+                param.put("content","默认好评");
+                param.put("evalLevel",5);
+                param.put("goodsLevel",5);
+                param.put("valueName",goodsName);
+                param.put("createTime",new Date());
+                param.put("modTime",new Date());
+                qzOrderMapper.insertComment(param);//新增评论
+            }
+            qzOrderMapper.updateReceiptOrderByCommentCount();//修改评论数量
+        }
+        logger.info(">>>>>>>>>>>>>>>>>>>>receiptOrderAutoComment is end ");
+
+    }
+
     public long getDateBetween(Date begin,Date end){
         SimpleDateFormat dfs = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 

+ 58 - 1
kmall-schedule/src/main/resources/mybatis/mapper/QzOrderMapper.xml

@@ -34,7 +34,7 @@
         UPDATE mall_order a
         SET order_status=101,shipping_status=0,pay_status=0
         WHERE 1 = 1
-        AND a.add_time <![CDATA[ <  ]]> DATE_ADD(now(),INTERVAL -10 MINUTE)
+        AND a.add_time <![CDATA[ <  ]]> DATE_ADD(now(),INTERVAL -15 MINUTE)
         AND a.order_status = 0  and a.order_type = 1
     </update>
 
@@ -91,4 +91,61 @@
         WHERE 1 = 1
         AND a.out_refund_no = #{orderRefundId}
     </update>
+
+    <select id="queryShipmentOrderList" resultType="map">
+        SELECT a.order_sn,a.order_status,a.pay_status,a.id 'orderId',a.merch_order_sn,date_format(r.customs_succ_time,'%Y-%m-%d %H:%i:%s') as customs_succ_time
+        FROM `mall_order` a inner join mall_order_process_record r on a.order_sn=r.order_sn where order_status='300'
+        and shipping_status ='1' and a.order_biz_type in(10,02) AND r.customs_succ_time <![CDATA[ <  ]]>  DATE_ADD(now(),INTERVAL -7 DAY)
+    </select>
+    <select id="queryShipmentBondedOrderList" resultType="map">
+        SELECT a.order_sn,a.order_status,a.pay_status,a.id 'orderId',a.merch_order_sn,date_format(r.shipment_succ_time,'%Y-%m-%d %H:%i:%s') as shipment_succ_time
+        FROM `mall_order` a inner join mall_order_process_record r on a.order_sn=r.order_sn where order_status='300' and shipping_status ='1'
+        and a.order_biz_type in(00,11) AND r.shipment_succ_time <![CDATA[ <  ]]>  DATE_ADD(now(),INTERVAL -7 DAY)
+    </select>
+
+    <update id="updateShipmentOrder" parameterType="map">
+        update mall_order set order_status ='301', shipping_status='2',confirm_time=now() where id=#{orderId}
+    </update>
+
+    <select id="queryReceiptOrderList" resultType="map">
+        select o.user_id 'userId',o.id 'orderId',g.product_id'productId',g.goods_specification_name_value 'goodsSpecificationNameValue', g.goods_id 'goodsId',
+        g.goods_name 'goodsName',confirm_time FROM `mall_order` o inner join mall_order_goods g on o.id = g.order_id
+        where order_status='301' and shipping_status ='2' and comment_count=0 AND confirm_time <![CDATA[ < ]]> DATE_ADD(now(),INTERVAL -30 DAY)
+    </select>
+
+    <update id="updateReceiptOrderByCommentCount">
+        update mall_order set comment_count = 1 where
+        order_status='301' and shipping_status ='2' and comment_count=0 AND confirm_time <![CDATA[ < ]]> DATE_ADD(now(),INTERVAL -30 DAY)
+    </update>
+
+    <update id="insertComment" parameterType="map">
+        insert into mall_comment(
+        `type_id`,
+        `value_id`,
+        `user_id`,
+        `order_id`,
+        `product_id`,
+        `goods_specification_name_value`,
+        `status`,
+        `content`,
+        `eval_level`,
+        `value_name`,
+        `goods_level`,
+        `create_time`,
+        `mod_time`)
+        values(
+        #{typeId},
+        #{valueId},
+        #{userId},
+        #{orderId},
+        #{productId},
+        #{goodsSpecificationNameValue},
+        #{status},
+        #{content},
+        #{evalLevel},
+        #{valueName},
+        #{goodsLevel},
+        #{createTime},
+        #{modTime})
+    </update>
 </mapper>

+ 50 - 2
wx-mall/pages/goods/goods.js

@@ -33,6 +33,11 @@ Page({
     autoplay: false,
     defaultFreight: 0,
     current: 0,//banner当前的index
+    isPlay: true,
+    indexNum: 0,
+    windowWidth: 0,
+    leftWidth: 0,
+    startX:0
   },
   toggleNav() {
     this.setData({
@@ -194,9 +199,10 @@ Page({
                 clientWidth = res.windowWidth,
                 rpxR = 750 / clientWidth;
             var calc = clientHeight * rpxR - 100;
-            console.log(calc)
+            // console.log(calc);
             that.setData({
-                winHeight: calc
+              winHeight: calc,
+              windowWidth: res.windowWidth
             });
         }
     });
@@ -445,4 +451,46 @@ Page({
       url: '/pages/index/index'
     });
   },
+  //触摸事件start
+  touchStart(e) {
+    let startX = e.changedTouches[0].pageX
+    this.setData({
+      startX: startX
+    })
+    console.log("startX:" + startX);
+  },
+
+  //触摸事件end
+  touchEnd(e) {
+    let _self = this;
+    let windowWidth = this.data.windowWidth;
+    let moveWidth = e.changedTouches[0].pageX - this.data.startX;
+    let defineWidth = windowWidth / 20;
+    let rankList = this.data.gallery;
+    let index_now = e.currentTarget.dataset.index;
+    if (moveWidth >= defineWidth) {
+      //上一张
+      let transWidth = (index_now - 1) * (-this.data.windowWidth);
+      if (index_now >= 1) {
+        this.setData({
+          indexNum: index_now - 1,
+          rankList: rankList,
+          leftWidth: transWidth
+        })
+      }
+    } else if (moveWidth <= (0 - defineWidth)) {
+      //下一张
+      this.videoContext.pause();
+      let transWidth = (index_now + 1) * (-this.data.windowWidth);
+      if (index_now < rankList.length - 1) {
+        this.setData({
+          indexNum: index_now + 1,
+          rankList: rankList,
+          leftWidth: transWidth
+        })
+      }
+    } else {
+      //console.log('不能修改样式')
+    }
+  },
 })

+ 42 - 5
wx-mall/pages/goods/goods.wxml

@@ -36,12 +36,49 @@
     </view>
     <view wx:if="{{showNavList}}" class="close" bindtap="toggleNav">X</view>
   </view>
-  <view>
-    <swiper class="goodsimgs" indicator-dots="true" autoplay="true" interval="3000" duration="1000" bindtap="hideSwitchAttrPop">
+  <view>   
+  <!-- 滚动的卡片布局 -->
+  <view class='goodsimgs'>
+    <view class='content-wrapper'>
+      <view class='scroll-wrapper'>
+        <scroll-view class='scroll-view'>
+          <view class="items-wrapper" style="transform:translate3d({{leftWidth}}px, 0, 0)">
+            <view wx:for="{{gallery}}" wx:key="index" data-index="{{index}}" class="item"  bindtouchstart='touchStart' bindtouchend='touchEnd' >
+              <view class='rank-num' style="background-color: #c8c8c8">{{index+1}}/{{gallery.length}}</view>
+              <view class='img-wrapper'>
+                <video wx:if="{{item.file_type==1}}" id="myVideo" style='height:400rpx;width:100%;margin-top:140rpx;'  src="{{item.img_url}}" binderror="videoErrorCallback" objectFit="cover" initial-time='2' show-center-play-btn enable-progress-gesture controls></video>
+                <image src="{{item.img_url}}" class="imageClass" mode='aspectFill' catchtap='preview' data-url="{{item.img_url}}" wx:else/>
+              </view>
+            </view>
+          </view>
+        </scroll-view>
+      </view>
+    </view>
+  </view>
+      <!-- <swiper indicator-dots indicator-color="{{indicator}}" current="{{current}}" indicator-active-color="{{activeIndicator}}" class="goodsimgs" duration="300">  
+        <block wx:for="{{gallery}}" wx:key="item.id">  
+          <swiper-item>  
+            <block wx:if="{{item.file_type == 1}}">  
+              <block wx:if="{{isPlay}}" class='video-wrapper'>  
+                <video src="{{item.img_url}}" class='video' id='myVideo' binderror="videoErrorCallback" initial-time='2' show-center-play-btn enable-progress-gesture controls></video>  
+              </block>  
+              <block wx:else class='video-host-wrapper' catchtap='play'>  
+                <image src="{{gallery[1].img_url}}" mode='aspectFill' />
+              </block>  
+            </block>
+            <block wx:else>
+              <image src="{{item.img_url}}" mode='aspectFill' catchtap='preview' data-url="{{item.img_url}}" />
+            </block>
+          </swiper-item>  
+        </block>  
+      </swiper> -->
+    <!-- <swiper class="goodsimgs" indicator-dots="true" autoplay="{{autoplay}}" bindtap="hideSwitchAttrPop"> 
       <swiper-item wx:for="{{gallery}}" wx:key="{{item.id}}">
-        <image src="{{item.img_url}}" background-size="cover"></image>
+        <video wx:if="{{item.file_type==1}}" id="myVideo" style='height:400rpx;width:100%;margin-top:140rpx;'  src="{{item.img_url}}" binderror="videoErrorCallback" objectFit="cover" initial-time='2' show-center-play-btn enable-progress-gesture controls></video>
+        <image class="imageClass" wx:if="{{item.file_type==0}}" src="{{item.img_url}}"></image>
       </swiper-item>
-    </swiper>
+    </swiper> -->
+  
     <!-- <view class="service-policy">
       <view class="item">30分钟速达</view>
       <view class="item">每日优选生鲜</view>
@@ -173,7 +210,7 @@
       <view class="b">
         <view class="item" wx:for="{{relatedGoods}}" wx:key="{{item.id}}">
           <navigator url="/pages/goods/goods?id={{item.id}}">
-            <image class="img" src="{{item.list_pic_url}}" background-size="cover"></image>
+            <image class="img" src="{{item.list_pic_url}}"></image>
             <text class="name">{{item.name}}</text>
             <view class="price">¥{{item.retail_price}}
               <image class="cart" data-goods-id="{{item.id}}" data-product-id="{{item.product_id}}" catchtap='addNumber2' src="/static/images/cart.png" background-size="cover"></image>

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

@@ -7,13 +7,174 @@
   height: 750rpx;
 }
 
-.goodsimgs image {
+/* .goodsimgs image {
   width: 750rpx;
   height: 750rpx;
 }
+.goodsimgs video{
+  position: absolute;
+  width:750rpx; 
+  height: 750rpx;
+  display: block;
+} */
+
+.content-wrapper {
+  /* position: fixed; */
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  z-index: 2;
+  width: 750rpx;
+  height: 750rpx;
+}
+.content-wrapper .overflow {
+  width: 750rpx;
+  height: 750rpx;
+}
+.content-wrapper .scroll-wrapper {
+  width: 750rpx;
+  height: 750rpx;
+  overflow: hidden;
+}
+.content-wrapper .scroll-view {
+  white-space: nowrap;
+  display: block;
+  /* height: 750rpx; */
+  overflow-x: auto;
+  margin-top: -100rpx;
+  /* padding-bottom: 100rpx; */
+  -webkit-transform: translateY(100rpx);
+  transform: translateY(100rpx);
+}
+.content-wrapper .scroll-view .items-wrapper {
+  height: 750rpx;
+  box-sizing: border-box;
+  display: -webkit-box;
+  display: -webkit-flex;
+  display: -moz-box;
+  display: flex;
+  flex-flow: row nowrap;
+  -webkit-box-orient: horizontal;
+  flex-direction: row;
+  -webkit-box-align: center;
+  -webkit-align-items: center;
+  align-items: center;
+  position:relative;
+  transition:all 0.3s ease;
+  -webkit-overflow-scrolling:touch; 
+  transform: translateZ(0);
+}
+.content-wrapper .scroll-view .item {
+  display: block;
+  position: relative;
+  flex-shrink: 0;
+  transition: transform 0.2s ease;
+  transform-origin: center;
+  letter-spacing: 0;
+}
+/* .content-wrapper .scroll-view .item:nth-child(1) {
+   margin-left: 127rpx; 
+} */
+.content-wrapper .scroll-view .item .rank-num {
+  position: absolute;
+  left: 650rpx;
+  top: 680rpx;
+  padding: 0 20rpx;
+  line-height: 50rpx;
+  height: 50rpx;
+  border-radius: 8rpx;
+  color: #ffffff;
+}
+.content-wrapper .scroll-view .item .img-wrapper {
+  width: 750rpx;
+  height: 750rpx;
+  border-radius: 8rpx;
+  overflow: hidden;
+}
+.content-wrapper .scroll-view .item .img-wrapper .img {
+  display: block;
+  width: 750rpx;
+  min-height: 750rpx;
+}
+.content-wrapper .scroll-view .item .content {
+  padding: 20rpx;
+  background-color: rgba(255, 255, 255, 0.9);
+  box-sizing: border-box;
+  position: absolute;
+  right: 20rpx;
+  bottom: 20rpx;
+  left: 20rpx;
+  z-index: 2;
+  border-radius: 8rpx;
+  overflow: hidden;
+}
+.content-wrapper .scroll-view .item .content .title {
+  display: block;
+  font-size: 32rpx;
+  line-height: 44rpx;
+  color: #333333;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  margin-bottom: 10rpx;
+}
+.content-wrapper .scroll-view .item .content .rank-wrapper {
+  display: -webkit-box;
+  display: -webkit-flex;
+  display: -moz-box;
+  display: flex;
+  flex-flow: row nowrap;
+  -webkit-box-orient: horizontal;
+  flex-direction: row;
+  -webkit-box-align: center;
+  -webkit-align-items: center;
+  align-items: center;
+  margin-bottom: 12rpx;
+}
+.content-wrapper .scroll-view .item .content .rank-wrapper .stars-wrapper {
+  display: -webkit-box;
+  display: -webkit-flex;
+  display: -moz-box;
+  display: flex;
+  flex-flow: row nowrap;
+  -webkit-box-orient: horizontal;
+  flex-direction: row;
+  margin-right: 20rpx;
+}
+.content-wrapper .scroll-view .item .content .rank-wrapper .stars-wrapper .star {
+  display: block;
+  width: 32rpx;
+  height: 32rpx;
+}
+.content-wrapper .scroll-view .item .content .rank-wrapper .score {
+  font-size: 32rpx;
+  line-height: 44rpx;
+  color: #333333;
+}
+.content-wrapper .scroll-view .item .content .p {
+  display: block;
+  font-size: 28rpx;
+  line-height: 40rpx;
+  color: white;
+}
+
+/* 如果不为激活状态,那就添加图层蒙版  */
+.poker-face {
+ filter: brightness(40%)
+}
+
+/* 添加激活状态 */
+.active {
+  transform: scale(1.083333)
+}
+
+
 
 .imageClass{
   background-size:600rpx 600rpx;
+  width: 750rpx;
+  height: 750rpx;
 }
 .weui-cells{
   margin-top: 80rpx;
@@ -29,7 +190,7 @@
 .service-policy {
   width: 750rpx;
   height: 73rpx;
-  background: #f4f4f4;
+  background: #f5f1f1ef;
   padding: 0 31.25rpx;
   display: flex;
   flex-flow: row nowrap;