1
0
Переглянути джерело

新增人脸识别,跨境额度查询管理后台、小程序后台、小程序前端代码,发送模板修改,修改其他bug

hyq 5 роки тому
батько
коміт
c3229225f5
100 змінених файлів з 5264 додано та 497 видалено
  1. 3 2
      kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java
  2. 35 0
      kmall-admin/src/main/java/com/kmall/admin/controller/SysOssController.java
  3. 4 1
      kmall-admin/src/main/java/com/kmall/admin/controller/ThirdMerchantBizController.java
  4. 64 0
      kmall-admin/src/main/java/com/kmall/admin/controller/faceid/CheckFaceLivenessRecogController.java
  5. 2 3
      kmall-admin/src/main/java/com/kmall/admin/controller/mk/dist/MkDistHierController.java
  6. 22 0
      kmall-admin/src/main/java/com/kmall/admin/dao/FaceLivenessRecognitionReturnDataDao.java
  7. 10 0
      kmall-admin/src/main/java/com/kmall/admin/dao/OrderDao.java
  8. 3 0
      kmall-admin/src/main/java/com/kmall/admin/dao/ThirdMerchantBizDao.java
  9. 54 0
      kmall-admin/src/main/java/com/kmall/admin/dto/FaceByOrderDto.java
  10. 1126 0
      kmall-admin/src/main/java/com/kmall/admin/dto/OrderRecognitionDto.java
  11. 73 0
      kmall-admin/src/main/java/com/kmall/admin/dto/SendTempDto.java
  12. 227 0
      kmall-admin/src/main/java/com/kmall/admin/entity/FaceLivenessRecognitionReturnDataEntity.java
  13. 11 0
      kmall-admin/src/main/java/com/kmall/admin/entity/OrderEntity.java
  14. 11 1
      kmall-admin/src/main/java/com/kmall/admin/entity/ThirdMerchantBizEntity.java
  15. 11 0
      kmall-admin/src/main/java/com/kmall/admin/entity/UserEntity.java
  16. 30 0
      kmall-admin/src/main/java/com/kmall/admin/entity/mk/store/StoreTopicEntity.java
  17. 9 0
      kmall-admin/src/main/java/com/kmall/admin/service/OrderService.java
  18. 7 0
      kmall-admin/src/main/java/com/kmall/admin/service/UserService.java
  19. 14 0
      kmall-admin/src/main/java/com/kmall/admin/service/faceid/FaceIdService.java
  20. 44 3
      kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java
  21. 1 1
      kmall-admin/src/main/java/com/kmall/admin/service/impl/ProductStoreRelaServiceImpl.java
  22. 46 3
      kmall-admin/src/main/java/com/kmall/admin/service/impl/UserServiceImpl.java
  23. 213 0
      kmall-admin/src/main/java/com/kmall/admin/service/impl/faceid/FaceIdServiceImpl.java
  24. 47 47
      kmall-admin/src/main/resources/conf/fastdfs.properties
  25. 2 2
      kmall-admin/src/main/resources/mybatis/mapper/AddressDao.xml
  26. 17 17
      kmall-admin/src/main/resources/mybatis/mapper/CartDao.xml
  27. 182 0
      kmall-admin/src/main/resources/mybatis/mapper/FaceLivenessRecognitionReturnDataDao.xml
  28. 331 53
      kmall-admin/src/main/resources/mybatis/mapper/OrderDao.xml
  29. 2 2
      kmall-admin/src/main/resources/mybatis/mapper/TemplateConfDao.xml
  30. 33 8
      kmall-admin/src/main/resources/mybatis/mapper/ThirdMerchantBizDao.xml
  31. 2 2
      kmall-admin/src/main/resources/mybatis/mapper/UserCouponDao.xml
  32. 12 8
      kmall-admin/src/main/resources/mybatis/mapper/UserDao.xml
  33. 17 10
      kmall-admin/src/main/resources/mybatis/mapper/mk/store/StoreTopicDao.xml
  34. 63 0
      kmall-admin/src/main/webapp/WEB-INF/page/faceid/type10ordernopay.html
  35. 11 2
      kmall-admin/src/main/webapp/WEB-INF/page/shop/thirdmerchantbiz.html
  36. 11 1
      kmall-admin/src/main/webapp/WEB-INF/page/sys/thirdmerchswitch.html
  37. 476 0
      kmall-admin/src/main/webapp/js/faceid/type10ordernopay.js
  38. 23 7
      kmall-admin/src/main/webapp/js/mk/mkstorecampminus.js
  39. 4 4
      kmall-admin/src/main/webapp/js/mk/storetopic.js
  40. 3 3
      kmall-admin/src/main/webapp/js/shop/thirdmerchantbiz.js
  41. 12 3
      kmall-admin/src/main/webapp/js/sys/thirdmerchswitch.js
  42. 2 2
      kmall-api/src/main/java/com/kmall/api/api/ApiAddressController.java
  43. 58 37
      kmall-api/src/main/java/com/kmall/api/api/ApiAuthController.java
  44. 1 2
      kmall-api/src/main/java/com/kmall/api/api/ApiCartController.java
  45. 4 4
      kmall-api/src/main/java/com/kmall/api/api/ApiCommentController.java
  46. 15 23
      kmall-api/src/main/java/com/kmall/api/api/ApiCouponController.java
  47. 2 2
      kmall-api/src/main/java/com/kmall/api/api/ApiFeedbackController.java
  48. 2 2
      kmall-api/src/main/java/com/kmall/api/api/ApiGoodsController.java
  49. 10 10
      kmall-api/src/main/java/com/kmall/api/api/ApiIndexController.java
  50. 14 0
      kmall-api/src/main/java/com/kmall/api/api/ApiUserController.java
  51. 57 0
      kmall-api/src/main/java/com/kmall/api/api/faceid/ApiFaceIdController.java
  52. 3 2
      kmall-api/src/main/java/com/kmall/api/api/pingan/ApiPayPinganController.java
  53. 39 0
      kmall-api/src/main/java/com/kmall/api/api/quotalInquiry/CrossBoundaryQueryController.java
  54. 25 1
      kmall-api/src/main/java/com/kmall/api/api/wxGlobal/ApiWxGlobalPayController.java
  55. 1 8
      kmall-api/src/main/java/com/kmall/api/dao/ApiCouponMapper.java
  56. 16 0
      kmall-api/src/main/java/com/kmall/api/dao/ApiFaceLivenessRecognitionReturnDataMapper.java
  57. 13 0
      kmall-api/src/main/java/com/kmall/api/dao/ApiSysConfigMapper.java
  58. 7 0
      kmall-api/src/main/java/com/kmall/api/dao/ApiUserCouponMapper.java
  59. 2 0
      kmall-api/src/main/java/com/kmall/api/dao/mk/ApiMkStorePromMapper.java
  60. 205 0
      kmall-api/src/main/java/com/kmall/api/entity/FaceLivenessRecognitionReturnDataVo.java
  61. 11 1
      kmall-api/src/main/java/com/kmall/api/entity/ThirdMerchantBizVo.java
  62. 10 0
      kmall-api/src/main/java/com/kmall/api/entity/UserVo.java
  63. 2 0
      kmall-api/src/main/java/com/kmall/api/service/ApiCartService.java
  64. 11 65
      kmall-api/src/main/java/com/kmall/api/service/ApiCouponService.java
  65. 29 26
      kmall-api/src/main/java/com/kmall/api/service/ApiGoodsService.java
  66. 49 15
      kmall-api/src/main/java/com/kmall/api/service/ApiOrderService.java
  67. 28 12
      kmall-api/src/main/java/com/kmall/api/service/ApiPayService.java
  68. 7 7
      kmall-api/src/main/java/com/kmall/api/service/ApiUserCouponService.java
  69. 46 2
      kmall-api/src/main/java/com/kmall/api/service/ApiUserService.java
  70. 121 0
      kmall-api/src/main/java/com/kmall/api/service/faceid/ApiFaceIdService.java
  71. 2 7
      kmall-api/src/main/java/com/kmall/api/service/mk/ApiMkStoreTicketDiscountService.java
  72. 91 0
      kmall-api/src/main/java/com/kmall/api/service/quotalInquiry/ApiQuotalInquiryService.java
  73. 14 12
      kmall-api/src/main/java/com/kmall/api/service/wxGlobal/ApiWxGlobalPayService.java
  74. 1 1
      kmall-api/src/main/java/com/kmall/api/util/IdCardUtil.java
  75. 1 43
      kmall-api/src/main/resources/mybatis/mapper/ApiCouponMapper.xml
  76. 149 0
      kmall-api/src/main/resources/mybatis/mapper/ApiFaceLivenessRecognitionReturnDataMapper.xml
  77. 7 4
      kmall-api/src/main/resources/mybatis/mapper/ApiGoodsIssueMapper.xml
  78. 7 4
      kmall-api/src/main/resources/mybatis/mapper/ApiRelatedGoodsMapper.xml
  79. 13 0
      kmall-api/src/main/resources/mybatis/mapper/ApiSysConfigMapper.xml
  80. 16 7
      kmall-api/src/main/resources/mybatis/mapper/ApiThirdMerchantBizMapper.xml
  81. 46 4
      kmall-api/src/main/resources/mybatis/mapper/ApiUserCouponMapper.xml
  82. 12 4
      kmall-api/src/main/resources/mybatis/mapper/ApiUserMapper.xml
  83. 64 0
      kmall-common/src/main/java/com/kmall/common/constant/Dict.java
  84. 11 0
      kmall-common/src/main/java/com/kmall/common/utils/DateUtils.java
  85. 137 0
      kmall-common/src/main/java/com/kmall/common/utils/MD5Sign.java
  86. 1 1
      kmall-common/src/main/java/com/kmall/common/utils/ResponseData.java
  87. 1 1
      kmall-common/src/main/java/com/kmall/common/utils/ResponseDataRows.java
  88. 39 0
      kmall-common/src/main/java/com/kmall/common/utils/wxtemplate/WxTemplate2.java
  89. 90 0
      kmall-manager/src/main/java/com/kmall/manager/dto/CrossBoundaryQuotalDto.java
  90. 44 0
      kmall-manager/src/main/java/com/kmall/manager/dto/CrossQuotalInquiryResponseDto.java
  91. 113 0
      kmall-manager/src/main/java/com/kmall/manager/dto/FaceIdRequestDto.java
  92. 128 0
      kmall-manager/src/main/java/com/kmall/manager/manager/common/OkHttpUtilss.java
  93. 70 0
      kmall-manager/src/main/java/com/kmall/manager/manager/faceid/FaceCheckUtil.java
  94. 40 0
      kmall-manager/src/main/java/com/kmall/manager/manager/merch/OmsMerchProperties.java
  95. 19 0
      kmall-manager/src/main/java/com/kmall/manager/manager/pay/wxpay/WxPayProperties.java
  96. 69 0
      kmall-manager/src/main/java/com/kmall/manager/manager/quotalInquiry/CrossBoundaryQuotalInquiryUtil.java
  97. 1 1
      kmall-manager/src/main/java/com/kmall/manager/manager/wechat/WechatGlobalUtil.java
  98. 10 0
      kmall-manager/src/main/java/com/kmall/manager/manager/wechat/wxglobal/dto/WechatGlobalQueryApiResult.java
  99. 5 0
      kmall-manager/src/main/java/com/kmall/manager/manager/wechat/wxtemplate/TemplateData.java
  100. 5 4
      kmall-manager/src/main/java/com/kmall/manager/manager/wechat/wxtemplate/TokenThread.java

+ 3 - 2
kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java

@@ -635,7 +635,7 @@ public class OrderController {
             List<OrderWXPayRecordEntity> orderWXPayRecordEntitys =
                     orderWXPayRecordService.getRecordsByOutTradeNo(orderEntity.getOrderSn());
             for (OrderWXPayRecordEntity orderWXPayRecordTemp : orderWXPayRecordEntitys) {
-                //查询出来的记录不等于当前记录,并且未撤销,未关闭时,撤销订单
+                //查询出来的记录排除当前已支付成功的记录,对其他记录交易状态为未撤销,未关闭的订单,调用撤销订单
                 if (orderWXPayRecordTemp.getId() != orderWXPayRecordCurrent.getId() &&
                     (!WechatUtil.WXTradeState.REVOKED.getCode().equals(orderWXPayRecordTemp.getTradeState()) ||
                      !WechatUtil.WXTradeState.CLOSED.getCode().equals(orderWXPayRecordTemp.getTradeState()))) {
@@ -699,7 +699,7 @@ public class OrderController {
 
         ExcelExport ee = new ExcelExport("订单信息");
 
-        String[] header = new String[]{"订单编号","商户订单编号", "所属门店", "供应商", "订单状态", "SKU", "商品名称", "数量", "销售价", "实际支付金额", "保税模式", "快递公司名称", "快递单编号", "海关清单编号", "收货人姓名", "收件人手机", "收件人省份", "收件人城市", "收件人区县", "收件人地址", "下单时间", "支付流水号","身份证号"
+        String[] header = new String[]{"订单编号","商户订单编号", "所属门店", "供应商", "供应商第三方商户代码", "订单状态", "SKU", "商品名称", "数量", "销售价", "实际支付金额", "保税模式", "快递公司名称", "快递单编号", "海关清单编号", "收货人姓名", "收件人手机", "收件人省份", "收件人城市", "收件人区县", "收件人地址", "下单时间", "支付流水号","身份证号"
                 ,"原产国","规格型号","品牌","单位","毛重(kg)","净重"};
 
         List<Map<String, Object>> list = new ArrayList<>();
@@ -713,6 +713,7 @@ public class OrderController {
                 map.put("MerchOrderSn", orderEntity.getMerchOrderSn());
                 map.put("StoreName", orderEntity.getStoreName());
                 map.put("SupplierThirdPartyMerchName", orderEntity.getSupplierThirdPartyMerchName());
+                map.put("SupplierThirdPartyMerchCode", orderEntity.getSupplierThirdPartyMerchCode());
                 map.put("OrderStatus", StringUtils.isEmpty(orderStatus.toString())? "":Dict.orderStatus.valueOf("item_"+ orderStatus).getItemName());
                 map.put("SKU", orderEntity.getSku());
                 map.put("GoodsName", orderEntity.getGoodsName());

+ 35 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/SysOssController.java

@@ -18,7 +18,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
+import sun.misc.BASE64Encoder;
 
+import java.io.FileInputStream;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -129,7 +131,40 @@ public class SysOssController {
         r.put("link", url);
         return r;
     }
+    /**
+     * 上传视频文件,返回视频文件base64值
+     */
+    @RequestMapping("/uploadAndBase64")
+    @RequiresPermissions("sys:oss:all")
+    public R uploadAndBase64(@RequestParam("file") MultipartFile file) throws Exception {
+        if (file.isEmpty()) {
+            throw new RRException("上传文件不能为空");
+        }
+        Long size = file.getSize();
+        int ImgFileSize=Math.round(size/1024*100)/100;//取得图片文件的大小
+        if(ImgFileSize > 350){
+            throw new RRException("上传视频,不能超过 350k");
+        }
+
+        BASE64Encoder base64Encoder =new BASE64Encoder();
+        String base64EncoderImg = base64Encoder.encode(file.getBytes());
 
+        //上传文件在前端生成临时文件,此处只返回base64码
+        /*//上传文件
+        String url = FileManager.upload(file);
+
+        //保存文件信息
+        SysOssEntity ossEntity = new SysOssEntity();
+        ossEntity.setUrl(url);
+        ossEntity.setCreateDate(new Date());
+        sysOssService.save(ossEntity);*/
+
+        R r = new R();
+//        r.put("url", url);
+//        r.put("link", url);
+        r.put("base64EncoderImg", base64EncoderImg);
+        return r;
+    }
 
     /**
      * 删除

+ 4 - 1
kmall-admin/src/main/java/com/kmall/admin/controller/ThirdMerchantBizController.java

@@ -98,7 +98,10 @@ public class ThirdMerchantBizController {
         builder.put("thirdPartyMerchCode", "第三方商户代码");
         builder.put("thirdPartyMerchName", "第三方商户名称");
         builder.put("isStockShare", "库存是否共享");
-        builder.put("isStoreUserShare", "门店用户是否共享");
+//        builder.put("isStoreUserShare", "门店用户是否共享");
+        builder.put("isMapShow", "商户地图是否显示");
+        builder.put("isSupplierGoods", "供应商模式商品是否启用");
+        builder.put("isFaceCheck", "是否使用人脸核验");
         R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
         if (Integer.valueOf(r.get("code").toString()) != 0) {
             throw new RRException(r.get("msg").toString());

+ 64 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/faceid/CheckFaceLivenessRecogController.java

@@ -0,0 +1,64 @@
+package com.kmall.admin.controller.faceid;
+
+import com.kmall.admin.dto.FaceByOrderDto;
+import com.kmall.admin.dto.OrderRecognitionDto;
+import com.kmall.admin.entity.OrderEntity;
+import com.kmall.admin.service.OrderService;
+import com.kmall.admin.service.faceid.FaceIdService;
+import com.kmall.admin.utils.ParamUtils;
+import com.kmall.common.constant.Dict;
+import com.kmall.common.utils.PageUtils;
+import com.kmall.common.utils.Query;
+import com.kmall.manager.dto.FaceIdRequestDto;
+import com.kmall.common.utils.R;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author huangyq
+ * @version 1.0
+ * 2019-11-27 14:09
+ */
+@RestController
+public class CheckFaceLivenessRecogController {
+    @Autowired
+    private FaceIdService faceIdService;
+    @Autowired
+    private OrderService orderService;
+
+    @RequestMapping("face/checkLivenessRecognition")
+    @RequiresPermissions("face:checkLivenessRecognition")
+    public R checkLivenessRecognition(@RequestBody FaceByOrderDto faceByOrderDto) {
+        String msg = faceIdService.checkLivenessRecognition(faceByOrderDto);
+        return R.ok(msg);
+    }
+
+    /**
+     * 列表
+     */
+    @RequestMapping("face/orderList")
+    public R list(@RequestParam Map<String, Object> params) {
+        ParamUtils.setQueryPowerByRoleType(params, "storeId", "merchSn", "thirdPartyMerchCode");
+        params = ParamUtils.setTimeMap(params);
+        //查询列表数据
+        Query query = new Query(params);
+        query.put("isOnfiilineOrder", Dict.isOnfflineOrder.item_0.getItem());
+        List<OrderRecognitionDto> orderList = orderService.queryOrderListByRecognition(query);
+        int total = orderService.queryOrderListByRecognitionTotal(query);
+
+        PageUtils pageUtil = new PageUtils(orderList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    @RequestMapping("face/sendWxTemp/{orderId}")
+//    @RequiresPermissions("face:sendWxTemp")
+    public R sendWxTemp(@PathVariable("orderId") long orderId) {
+        faceIdService.sendWxTemp(orderId);
+        return R.ok();
+    }
+}

+ 2 - 3
kmall-admin/src/main/java/com/kmall/admin/controller/mk/dist/MkDistHierController.java

@@ -199,9 +199,6 @@ public class MkDistHierController {
 
         MkDistHierEntity mkDistHierEntity = mkDistHierService.queryObjectByDistMap(params);
         if(mkDistHierEntity != null){
-            String lvl = mkDistHierEntity.getHierLvl();
-            Integer hierLvl = Integer.parseInt(lvl);
-
             Map<String, Object> distMap = new HashMap<>();
             distMap.put("distId", distId);
             List<MkDistHierEntity> list = mkDistHierService.queryListByTree(distMap);
@@ -211,6 +208,8 @@ public class MkDistHierController {
             if(list != null && list.size() > 0){
                 pdistId = list.get(0).getPdistId();
             }
+            String lvl = mkDistHierEntity.getHierLvl();
+            Integer hierLvl = Integer.parseInt(lvl);
             for (int i = 0; i< hierLvl-1; i++){
                 Map<String, Object> lvlMap = new HashMap<>();
                 lvlMap.put("distId", pdistId);

+ 22 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/FaceLivenessRecognitionReturnDataDao.java

@@ -0,0 +1,22 @@
+package com.kmall.admin.dao;
+
+import com.kmall.admin.entity.FaceLivenessRecognitionReturnDataEntity;
+import com.kmall.manager.dao.BaseDao;
+
+import java.util.Map;
+
+/**
+ * 验证活体人脸核身接口返回的数据记录Dao
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2019-11-27 13:33:46
+ */
+public interface FaceLivenessRecognitionReturnDataDao extends BaseDao<FaceLivenessRecognitionReturnDataEntity> {
+
+    int updateByMerchOrderSn(FaceLivenessRecognitionReturnDataEntity entity);
+
+    FaceLivenessRecognitionReturnDataEntity getFaceByOrderSn(String merchOrderSn);
+
+    int updateOrderByTempNoti(Map fromObject);
+}

+ 10 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/OrderDao.java

@@ -1,5 +1,7 @@
 package com.kmall.admin.dao;
 
+import com.kmall.admin.dto.OrderRecognitionDto;
+import com.kmall.admin.dto.SendTempDto;
 import com.kmall.admin.entity.OrderEntity;
 import org.apache.ibatis.annotations.Param;
 import com.kmall.manager.dao.BaseDao;
@@ -91,4 +93,12 @@ public interface OrderDao extends BaseDao<OrderEntity> {
     List<OrderEntity> storeTopicOrderList(Map<String, Object> map);
 
     int queryStoreTopicOrderTotal(Map<String, Object> map);
+
+    //查询与人脸识别认证表相关联的保税展示跨境商品订单
+    List<OrderRecognitionDto> queryOrderListByRecognition(Map<String, Object> map);
+
+    //根据订单id查询发送微信模板需要的订单信息
+    SendTempDto queryOrderByRecogTemp(long orderId);
+
+    int queryOrderListByRecognitionTotal(Map<String, Object> map);
 }

+ 3 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/ThirdMerchantBizDao.java

@@ -15,5 +15,8 @@ import java.util.List;
  */
 public interface ThirdMerchantBizDao extends BaseDao<ThirdMerchantBizEntity> {
     List<ThirdMerchantBizEntity> findByMerchSn(String merchSn);
+
     ThirdMerchantBizEntity getThirdMerchangByCode(@Param("thirdMerchantCode")String thirdMerchantCode);
+
+    ThirdMerchantBizEntity queryThirdDataByStoreId(@Param("storeId")Integer storeId);
 }

+ 54 - 0
kmall-admin/src/main/java/com/kmall/admin/dto/FaceByOrderDto.java

@@ -0,0 +1,54 @@
+package com.kmall.admin.dto;
+
+import java.io.Serializable;
+
+/**
+ * 管理后台活体人脸核身接口请求参数
+ * @author huangyq
+ * @version 1.0
+ * 2019-11-27 14:45
+ */
+public class FaceByOrderDto implements Serializable {
+
+    private static final long serialVersionUID = -4707152622304052229L;
+
+    private String idCard;//身份证号
+
+    private String name;//姓名
+
+    private String videoBase64;//视频的BASE64值
+
+    private long orderId;
+
+    public String getIdCard() {
+        return idCard;
+    }
+
+    public void setIdCard(String idCard) {
+        this.idCard = idCard;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getVideoBase64() {
+        return videoBase64;
+    }
+
+    public void setVideoBase64(String videoBase64) {
+        this.videoBase64 = videoBase64;
+    }
+
+    public long getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(long orderId) {
+        this.orderId = orderId;
+    }
+}

+ 1126 - 0
kmall-admin/src/main/java/com/kmall/admin/dto/OrderRecognitionDto.java

@@ -0,0 +1,1126 @@
+package com.kmall.admin.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * @author huangyq
+ * @date 2019-11-28 10:41:09
+ */
+public class OrderRecognitionDto implements Serializable {
+  private static final long serialVersionUID = 1L;
+
+  //主键
+  private Long id;
+  //订单序列号
+  private String orderSn;
+  //会员Id
+  private Integer userId;
+  //订单状态
+  //订单相关状态字段设计,采用单个字段表示全部的订单状态
+  //1xx 表示订单取消和删除等状态 0订单创建成功等待付款, 101订单已取消, 102订单已删除
+  //2xx 表示订单支付状态 201订单已付款,等待发货
+  //3xx 表示订单物流相关状态 300订单已发货, 301用户确认收货
+  //4xx 表示订单退换货相关的状态 401 没有发货,退款 402 已收货,退款退货
+  private Integer orderStatus;
+  //发货状态 商品配送情况;0未发货,1已发货,2已收货,4退货
+  private Integer shippingStatus;
+  //付款状态 支付状态;0未付款;1付款中;2已付款
+  private Integer payStatus;
+  //收货人
+  private String consignee;
+  //国家
+  private String country;
+  //省
+  private String province;
+  //地市
+  private String city;
+  //区县
+  private String district;
+  //收货地址
+  private String address;
+  //联系电话
+  private String mobile;
+  //补充说明
+  private String postscript;
+  //快递公司Id
+  private Long shippingId;
+  //快递公司简称(顺丰:SF)
+  private String shippingCode;
+  //快递公司名称
+  private String shippingName;
+  //快递单号
+  private String shippingNo;
+  // 配送员手机
+  private String shippingMobile;
+  //付款
+  private String payId;
+  //
+  private String payName;
+  //快递费用
+  private BigDecimal shippingFee;
+  //实际需要支付的金额
+  private BigDecimal actualPrice;
+  //
+  private Integer integral;
+  //
+  private BigDecimal integralMoney;
+  //订单总价
+  private BigDecimal orderPrice;
+  //商品总价
+  private BigDecimal goodsPrice;
+  //新增时间
+  private Date addTime;
+  //确认时间
+  private Date confirmTime;
+  //付款时间
+  private Date payTime;
+  //重商品额外费用
+  private Integer freightPrice;
+  //使用的优惠券id
+  private Integer couponId;
+  //
+  private Integer parentId;
+  //优惠价格
+  private BigDecimal couponPrice;
+  //
+  private String callbackStatus;
+  // 活动Id 团购
+  private Integer activityId;
+  //订单类型 1:普通订单 2:团购订单
+  private String orderType;
+
+  private Integer storeId;
+  //
+  private String userName;
+  // 送达时间
+  @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+  private Date deliveryDate;
+  // 送到说明
+  private String deliveryRemark;
+  // 预计送达时间
+  private Date predictTime;
+
+  private String merchOrderSn;
+
+  private String orderBizType;
+
+  private String isPaymentSend;
+
+  private String isEleOrderSend;
+
+  private String isCustomsSend;
+
+  private String buyerPayCheck;
+
+  private String merchSn;
+
+  private String sku;
+
+  private Date createTime;
+
+  private Date modTime;
+
+  private String isOnfflineOrder;
+
+  private String payFlag;
+
+  private String orderSnWx;
+
+  private String isMergePay;
+  //商品名称
+  private String goodsName;
+  //商品数量
+  private Integer number;
+  //零售价格
+  private BigDecimal retailPrice;
+
+  private String payTransactionId;
+
+  private String storeName;
+
+  private String moderSn;
+
+  private String createrSn;
+
+  private String idNo;
+  //毛重,kg
+  private BigDecimal grossWeight;
+
+  //净重,kg
+  private BigDecimal netWeight;
+  //品牌
+  private String brand;
+  /**
+   * 国检规格型号
+   */
+  private String ciqProdModel;
+  /**
+   * 原产国代码,海关编码
+   */
+  private String oriCntCode;
+  /**
+   * 计量单位代码,参见海关编码
+   */
+  private String unitCode;
+
+  private Integer orderDetailCount;
+
+  private Integer promId;
+
+  private BigDecimal promActualPrice;
+
+  private Integer goodsId;
+
+  private String storeTopicName;
+
+  private String storeTopicType;
+
+  private Integer storeTopicId;
+
+  private String couponName;
+  //订单满减
+  private BigDecimal fullCutPrice;
+
+  private Integer campMinusId;
+
+  private String campName;
+
+  //供应商第三方商户
+  private String supplierThirdPartyMerchName;
+
+  private String isTempNoti;
+
+  private String isFaceCheck;
+
+  private String tempNotiMsg;
+
+  private String recognitionReturnMsg;
+
+  private String lastFaceTime;
+
+  private String addSecondTime;
+
+  //该订单是否在可验证人脸时间内
+  private String isDateLast;
+
+  private String thirdIsFaceCheck;
+
+  public String getThirdIsFaceCheck() {
+    return thirdIsFaceCheck;
+  }
+
+  public void setThirdIsFaceCheck(String thirdIsFaceCheck) {
+    this.thirdIsFaceCheck = thirdIsFaceCheck;
+  }
+
+  public String getAddSecondTime() {
+    return addSecondTime;
+  }
+
+  public void setAddSecondTime(String addSecondTime) {
+    this.addSecondTime = addSecondTime;
+  }
+
+  public String getIsDateLast() {
+    return isDateLast;
+  }
+
+  public void setIsDateLast(String isDateLast) {
+    this.isDateLast = isDateLast;
+  }
+
+  public String getSupplierThirdPartyMerchName() {
+    return supplierThirdPartyMerchName;
+  }
+
+  public void setSupplierThirdPartyMerchName(String supplierThirdPartyMerchName) {
+    this.supplierThirdPartyMerchName = supplierThirdPartyMerchName;
+  }
+
+  public Integer getCampMinusId() {
+    return campMinusId;
+  }
+
+  public void setCampMinusId(Integer campMinusId) {
+    this.campMinusId = campMinusId;
+  }
+
+  public BigDecimal getFullCutPrice() {
+    return fullCutPrice;
+  }
+
+  public void setFullCutPrice(BigDecimal fullCutPrice) {
+    this.fullCutPrice = fullCutPrice;
+  }
+
+  public String getCampName() {
+    return campName;
+  }
+
+  public void setCampName(String campName) {
+    this.campName = campName;
+  }
+
+  public String getCouponName() {
+    return couponName;
+  }
+
+  public void setCouponName(String couponName) {
+    this.couponName = couponName;
+  }
+
+  public String getStoreTopicName() {
+    return storeTopicName;
+  }
+
+  public void setStoreTopicName(String storeTopicName) {
+    this.storeTopicName = storeTopicName;
+  }
+
+  public String getStoreTopicType() {
+    return storeTopicType;
+  }
+
+  public void setStoreTopicType(String storeTopicType) {
+    this.storeTopicType = storeTopicType;
+  }
+
+  public Integer getStoreTopicId() {
+    return storeTopicId;
+  }
+
+  public void setStoreTopicId(Integer storeTopicId) {
+    this.storeTopicId = storeTopicId;
+  }
+
+  public Integer getGoodsId() {
+    return goodsId;
+  }
+
+  public void setGoodsId(Integer goodsId) {
+    this.goodsId = goodsId;
+  }
+
+  public BigDecimal getPromActualPrice() {
+    return promActualPrice;
+  }
+
+  public void setPromActualPrice(BigDecimal promActualPrice) {
+    this.promActualPrice = promActualPrice;
+  }
+
+  public Integer getPromId() {
+    return promId;
+  }
+
+  public void setPromId(Integer promId) {
+    this.promId = promId;
+  }
+
+  public Integer getOrderDetailCount() {
+    return orderDetailCount;
+  }
+
+  public void setOrderDetailCount(Integer orderDetailCount) {
+    this.orderDetailCount = orderDetailCount;
+  }
+
+  public String getBrand() {
+    return brand;
+  }
+
+  public void setBrand(String brand) {
+    this.brand = brand;
+  }
+
+  public String getCiqProdModel() {
+    return ciqProdModel;
+  }
+
+  public void setCiqProdModel(String ciqProdModel) {
+    this.ciqProdModel = ciqProdModel;
+  }
+
+  public String getOriCntCode() {
+    return oriCntCode;
+  }
+
+  public void setOriCntCode(String oriCntCode) {
+    this.oriCntCode = oriCntCode;
+  }
+
+  public String getUnitCode() {
+    return unitCode;
+  }
+
+  public void setUnitCode(String unitCode) {
+    this.unitCode = unitCode;
+  }
+
+  public BigDecimal getGrossWeight() {
+    return grossWeight;
+  }
+
+  public void setGrossWeight(BigDecimal grossWeight) {
+    this.grossWeight = grossWeight;
+  }
+
+  public BigDecimal getNetWeight() {
+    return netWeight;
+  }
+
+  public void setNetWeight(BigDecimal netWeight) {
+    this.netWeight = netWeight;
+  }
+
+  public String getIdNo() {
+    return idNo;
+  }
+
+  public void setIdNo(String idNo) {
+    this.idNo = idNo;
+  }
+
+  public String getModerSn() {
+    return moderSn;
+  }
+
+  public void setModerSn(String moderSn) {
+    this.moderSn = moderSn;
+  }
+
+  public String getCreaterSn() {
+    return createrSn;
+  }
+
+  public void setCreaterSn(String createrSn) {
+    this.createrSn = createrSn;
+  }
+
+  public String getStoreName() {
+    return storeName;
+  }
+
+  public void setStoreName(String storeName) {
+    this.storeName = storeName;
+  }
+
+  public String getPayTransactionId() {
+    return payTransactionId;
+  }
+
+  public void setPayTransactionId(String payTransactionId) {
+    this.payTransactionId = payTransactionId;
+  }
+
+  public String getGoodsName() {
+    return goodsName;
+  }
+
+  public void setGoodsName(String goodsName) {
+    this.goodsName = goodsName;
+  }
+
+  public Integer getNumber() {
+    return number;
+  }
+
+  public void setNumber(Integer number) {
+    this.number = number;
+  }
+
+  public BigDecimal getRetailPrice() {
+    return retailPrice;
+  }
+
+  public void setRetailPrice(BigDecimal retailPrice) {
+    this.retailPrice = retailPrice;
+  }
+
+  public String getIsMergePay() {
+    return isMergePay;
+  }
+
+  public void setIsMergePay(String isMergePay) {
+    this.isMergePay = isMergePay;
+  }
+
+  public String getOrderSnWx() {
+    return orderSnWx;
+  }
+
+  public void setOrderSnWx(String orderSnWx) {
+    this.orderSnWx = orderSnWx;
+  }
+
+  public String getPayFlag() {
+    return payFlag;
+  }
+
+  public void setPayFlag(String payFlag) {
+    this.payFlag = payFlag;
+  }
+
+
+  public String getIsOnfflineOrder() {
+    return isOnfflineOrder;
+  }
+
+  public void setIsOnfflineOrder(String isOnfflineOrder) {
+    this.isOnfflineOrder = isOnfflineOrder;
+  }
+
+  public String getMerchSn() {
+    return merchSn;
+  }
+
+  public void setMerchSn(String merchSn) {
+    this.merchSn = merchSn;
+  }
+
+  public String getSku() {
+    return sku;
+  }
+
+  public void setSku(String sku) {
+    this.sku = sku;
+  }
+
+  public Date getCreateTime() {
+    return createTime;
+  }
+
+  public void setCreateTime(Date createTime) {
+    this.createTime = createTime;
+  }
+
+  public Date getModTime() {
+    return modTime;
+  }
+
+  public void setModTime(Date modTime) {
+    this.modTime = modTime;
+  }
+
+  public String getBuyerPayCheck() {
+    return buyerPayCheck;
+  }
+
+  public void setBuyerPayCheck(String buyerPayCheck) {
+    this.buyerPayCheck = buyerPayCheck;
+  }
+
+  public String getIsPaymentSend() {
+    return isPaymentSend;
+  }
+
+  public void setIsPaymentSend(String isPaymentSend) {
+    this.isPaymentSend = isPaymentSend;
+  }
+
+  public String getIsEleOrderSend() {
+    return isEleOrderSend;
+  }
+
+  public void setIsEleOrderSend(String isEleOrderSend) {
+    this.isEleOrderSend = isEleOrderSend;
+  }
+
+  public String getIsCustomsSend() {
+    return isCustomsSend;
+  }
+
+  public void setIsCustomsSend(String isCustomsSend) {
+    this.isCustomsSend = isCustomsSend;
+  }
+
+  public String getOrderBizType() {
+    return orderBizType;
+  }
+
+  public void setOrderBizType(String orderBizType) {
+    this.orderBizType = orderBizType;
+  }
+
+  public String getMerchOrderSn() {
+    return merchOrderSn;
+  }
+
+  public void setMerchOrderSn(String merchOrderSn) {
+    this.merchOrderSn = merchOrderSn;
+  }
+
+  public String getOrderType() {
+    return orderType;
+  }
+
+  public void setOrderType(String orderType) {
+    this.orderType = orderType;
+  }
+
+  /**
+   * 设置:主键
+   */
+  public void setId(Long id) {
+    this.id = id;
+  }
+
+  /**
+   * 获取:主键
+   */
+  public Long getId() {
+    return id;
+  }
+
+  public String getShippingCode() {
+    return shippingCode;
+  }
+
+  public void setShippingCode(String shippingCode) {
+    this.shippingCode = shippingCode;
+  }
+
+  /**
+   * 设置:订单序列号
+   */
+  public void setOrderSn(String orderSn) {
+    this.orderSn = orderSn;
+  }
+
+  /**
+   * 获取:订单序列号
+   */
+  public String getOrderSn() {
+    return orderSn;
+  }
+
+  /**
+   * 设置:会员Id
+   */
+  public void setUserId(Integer userId) {
+    this.userId = userId;
+  }
+
+  /**
+   * 获取:会员Id
+   */
+  public Integer getUserId() {
+    return userId;
+  }
+
+  /**
+   * 设置:订单状态
+   */
+  public void setOrderStatus(Integer orderStatus) {
+    this.orderStatus = orderStatus;
+  }
+
+  /**
+   * 获取:订单状态
+   */
+  public Integer getOrderStatus() {
+    return orderStatus;
+  }
+
+  /**
+   * 设置:发货状态
+   */
+  public void setShippingStatus(Integer shippingStatus) {
+    this.shippingStatus = shippingStatus;
+  }
+
+  /**
+   * 获取:发货状态
+   */
+  public Integer getShippingStatus() {
+    return shippingStatus;
+  }
+
+  /**
+   * 设置:付款状态
+   */
+  public void setPayStatus(Integer payStatus) {
+    this.payStatus = payStatus;
+  }
+
+  /**
+   * 获取:付款状态
+   */
+  public Integer getPayStatus() {
+    return payStatus;
+  }
+
+  /**
+   * 设置:收货人
+   */
+  public void setConsignee(String consignee) {
+    this.consignee = consignee;
+  }
+
+  /**
+   * 获取:收货人
+   */
+  public String getConsignee() {
+    return consignee;
+  }
+
+  /**
+   * 设置:国家
+   */
+  public void setCountry(String country) {
+    this.country = country;
+  }
+
+  /**
+   * 获取:国家
+   */
+  public String getCountry() {
+    return country;
+  }
+
+  /**
+   * 设置:省
+   */
+  public void setProvince(String province) {
+    this.province = province;
+  }
+
+  /**
+   * 获取:省
+   */
+  public String getProvince() {
+    return province;
+  }
+
+  /**
+   * 设置:地市
+   */
+  public void setCity(String city) {
+    this.city = city;
+  }
+
+  /**
+   * 获取:地市
+   */
+  public String getCity() {
+    return city;
+  }
+
+  /**
+   * 设置:区县
+   */
+  public void setDistrict(String district) {
+    this.district = district;
+  }
+
+  /**
+   * 获取:区县
+   */
+  public String getDistrict() {
+    return district;
+  }
+
+  public String getShippingNo() {
+    return shippingNo;
+  }
+
+  public void setShippingNo(String shippingNo) {
+    this.shippingNo = shippingNo;
+  }
+
+  /**
+   * 设置:收货地址
+   */
+  public void setAddress(String address) {
+    this.address = address;
+  }
+
+  /**
+   * 获取:收货地址
+   */
+  public String getAddress() {
+    return address;
+  }
+
+  /**
+   * 设置:联系电话
+   */
+  public void setMobile(String mobile) {
+    this.mobile = mobile;
+  }
+
+  /**
+   * 获取:联系电话
+   */
+  public String getMobile() {
+    return mobile;
+  }
+
+  /**
+   * 设置:补充说明
+   */
+  public void setPostscript(String postscript) {
+    this.postscript = postscript;
+  }
+
+  /**
+   * 获取:补充说明
+   */
+  public String getPostscript() {
+    return postscript;
+  }
+
+  /**
+   * 设置:快递公司Id
+   */
+  public void setShippingId(Long shippingId) {
+    this.shippingId = shippingId;
+  }
+
+  /**
+   * 获取:快递公司Id
+   */
+  public Long getShippingId() {
+    return shippingId;
+  }
+
+  /**
+   * 设置:快递公司名称
+   */
+  public void setShippingName(String shippingName) {
+    this.shippingName = shippingName;
+  }
+
+  /**
+   * 获取:快递公司名称
+   */
+  public String getShippingName() {
+    return shippingName;
+  }
+
+  /**
+   * 设置:付款
+   */
+  public void setPayId(String payId) {
+    this.payId = payId;
+  }
+
+  /**
+   * 获取:付款
+   */
+  public String getPayId() {
+    return payId;
+  }
+
+  /**
+   * 设置:
+   */
+  public void setPayName(String payName) {
+    this.payName = payName;
+  }
+
+  /**
+   * 获取:
+   */
+  public String getPayName() {
+    return payName;
+  }
+
+  /**
+   * 设置:快递费用
+   */
+  public void setShippingFee(BigDecimal shippingFee) {
+    this.shippingFee = shippingFee;
+  }
+
+  /**
+   * 获取:快递费用
+   */
+  public BigDecimal getShippingFee() {
+    return shippingFee;
+  }
+
+  /**
+   * 设置:实际需要支付的金额
+   */
+  public void setActualPrice(BigDecimal actualPrice) {
+    this.actualPrice = actualPrice;
+  }
+
+  /**
+   * 获取:实际需要支付的金额
+   */
+  public BigDecimal getActualPrice() {
+    return actualPrice;
+  }
+
+  /**
+   * 设置:
+   */
+  public void setIntegral(Integer integral) {
+    this.integral = integral;
+  }
+
+  /**
+   * 获取:
+   */
+  public Integer getIntegral() {
+    return integral;
+  }
+
+  /**
+   * 设置:
+   */
+  public void setIntegralMoney(BigDecimal integralMoney) {
+    this.integralMoney = integralMoney;
+  }
+
+  /**
+   * 获取:
+   */
+  public BigDecimal getIntegralMoney() {
+    return integralMoney;
+  }
+
+  /**
+   * 设置:订单总价
+   */
+  public void setOrderPrice(BigDecimal orderPrice) {
+    this.orderPrice = orderPrice;
+  }
+
+  /**
+   * 获取:订单总价
+   */
+  public BigDecimal getOrderPrice() {
+    return orderPrice;
+  }
+
+  /**
+   * 设置:商品总价
+   */
+  public void setGoodsPrice(BigDecimal goodsPrice) {
+    this.goodsPrice = goodsPrice;
+  }
+
+  /**
+   * 获取:商品总价
+   */
+  public BigDecimal getGoodsPrice() {
+    return goodsPrice;
+  }
+
+  /**
+   * 设置:新增时间
+   */
+  public void setAddTime(Date addTime) {
+    this.addTime = addTime;
+  }
+
+  /**
+   * 获取:新增时间
+   */
+  public Date getAddTime() {
+    return addTime;
+  }
+
+  /**
+   * 设置:确认时间
+   */
+  public void setConfirmTime(Date confirmTime) {
+    this.confirmTime = confirmTime;
+  }
+
+  /**
+   * 获取:确认时间
+   */
+  public Date getConfirmTime() {
+    return confirmTime;
+  }
+
+  /**
+   * 设置:付款时间
+   */
+  public void setPayTime(Date payTime) {
+    this.payTime = payTime;
+  }
+
+  /**
+   * 获取:付款时间
+   */
+  public Date getPayTime() {
+    return payTime;
+  }
+
+  /**
+   * 设置:配送费用
+   */
+  public void setFreightPrice(Integer freightPrice) {
+    this.freightPrice = freightPrice;
+  }
+
+  /**
+   * 获取:配送费用
+   */
+  public Integer getFreightPrice() {
+    return freightPrice;
+  }
+
+  /**
+   * 设置:使用的优惠券id
+   */
+  public void setCouponId(Integer couponId) {
+    this.couponId = couponId;
+  }
+
+  /**
+   * 获取:使用的优惠券id
+   */
+  public Integer getCouponId() {
+    return couponId;
+  }
+
+  /**
+   * 设置:
+   */
+  public void setParentId(Integer parentId) {
+    this.parentId = parentId;
+  }
+
+  /**
+   * 获取:
+   */
+  public Integer getParentId() {
+    return parentId;
+  }
+
+  /**
+   * 设置:优惠价格
+   */
+  public void setCouponPrice(BigDecimal couponPrice) {
+    this.couponPrice = couponPrice;
+  }
+
+  /**
+   * 获取:优惠价格
+   */
+  public BigDecimal getCouponPrice() {
+    return couponPrice;
+  }
+
+  /**
+   * 设置:
+   */
+  public void setCallbackStatus(String callbackStatus) {
+    this.callbackStatus = callbackStatus;
+  }
+
+  /**
+   * 获取:
+   */
+  public String getCallbackStatus() {
+    return callbackStatus;
+  }
+
+  public String getUserName() {
+    return userName;
+  }
+
+  public void setUserName(String userName) {
+    this.userName = userName;
+  }
+
+  public Integer getStoreId() {
+    return storeId;
+  }
+
+  public void setStoreId(Integer storeId) {
+    this.storeId = storeId;
+  }
+
+  public String getShippingMobile() {
+    return shippingMobile;
+  }
+
+  public void setShippingMobile(String shippingMobile) {
+    this.shippingMobile = shippingMobile;
+  }
+
+  public Integer getActivityId() {
+    return activityId;
+  }
+
+  public void setActivityId(Integer activityId) {
+    this.activityId = activityId;
+  }
+
+  public Date getDeliveryDate() {
+    return deliveryDate;
+  }
+
+  public void setDeliveryDate(Date deliveryDate) {
+    this.deliveryDate = deliveryDate;
+  }
+
+  public String getDeliveryRemark() {
+    return deliveryRemark;
+  }
+
+  public void setDeliveryRemark(String deliveryRemark) {
+    this.deliveryRemark = deliveryRemark;
+  }
+
+  public Date getPredictTime() {
+    return predictTime;
+  }
+
+  public void setPredictTime(Date predictTime) {
+    this.predictTime = predictTime;
+  }
+
+  public String getIsTempNoti() {
+    return isTempNoti;
+  }
+
+  public void setIsTempNoti(String isTempNoti) {
+    this.isTempNoti = isTempNoti;
+  }
+
+  public String getIsFaceCheck() {
+    return isFaceCheck;
+  }
+
+  public void setIsFaceCheck(String isFaceCheck) {
+    this.isFaceCheck = isFaceCheck;
+  }
+
+  public String getTempNotiMsg() {
+    return tempNotiMsg;
+  }
+
+  public void setTempNotiMsg(String tempNotiMsg) {
+    this.tempNotiMsg = tempNotiMsg;
+  }
+
+  public String getRecognitionReturnMsg() {
+    return recognitionReturnMsg;
+  }
+
+  public void setRecognitionReturnMsg(String recognitionReturnMsg) {
+    this.recognitionReturnMsg = recognitionReturnMsg;
+  }
+
+  public String getLastFaceTime() {
+    return lastFaceTime;
+  }
+
+  public void setLastFaceTime(String lastFaceTime) {
+    this.lastFaceTime = lastFaceTime;
+  }
+}

+ 73 - 0
kmall-admin/src/main/java/com/kmall/admin/dto/SendTempDto.java

@@ -0,0 +1,73 @@
+package com.kmall.admin.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author huangyq
+ * @version 1.0
+ * 2019-11-28 10:52
+ */
+public class SendTempDto implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private Date addTime;
+
+    private String openId;
+
+    private String goodsName;
+
+    private String merchOrderSn;
+
+    private long orderId;
+
+    private String orderSn;
+
+    public Date getAddTime() {
+        return addTime;
+    }
+
+    public void setAddTime(Date addTime) {
+        this.addTime = addTime;
+    }
+
+    public String getOpenId() {
+        return openId;
+    }
+
+    public void setOpenId(String openId) {
+        this.openId = openId;
+    }
+
+    public String getGoodsName() {
+        return goodsName;
+    }
+
+    public void setGoodsName(String goodsName) {
+        this.goodsName = goodsName;
+    }
+
+    public String getMerchOrderSn() {
+        return merchOrderSn;
+    }
+
+    public void setMerchOrderSn(String merchOrderSn) {
+        this.merchOrderSn = merchOrderSn;
+    }
+
+    public long getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(long orderId) {
+        this.orderId = orderId;
+    }
+
+    public String getOrderSn() {
+        return orderSn;
+    }
+
+    public void setOrderSn(String orderSn) {
+        this.orderSn = orderSn;
+    }
+}

+ 227 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/FaceLivenessRecognitionReturnDataEntity.java

@@ -0,0 +1,227 @@
+package com.kmall.admin.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 验证活体人脸核身接口返回的数据记录实体
+ * 表名 face_liveness_recognition_return_data
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2019-11-27 13:33:46
+ */
+public class FaceLivenessRecognitionReturnDataEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Integer id;
+    /**
+     * 商户订单编号
+     */
+    private String merchOrderSn;
+
+    private String orderSn;
+    /**
+     * 模板是否通知 0:否 1:是;
+     */
+    private String isTempNoti;
+    /**
+     * 人脸核身是否核验成功0:否,1:是
+     */
+    private String isFaceCheck;
+    /**
+     * 用户id
+     */
+    private Integer userId;
+    /**
+     * 模板通知失败原因
+     */
+    private String tempNotiMsg;
+
+    private String recognitionReturnMsg;
+    /**
+     * 创建人编号
+     */
+    private String createrSn;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 修改人编号
+     */
+    private String moderSn;
+    /**
+     * 修改时间
+     */
+    private Date modTime;
+    /**
+     * 时间戳
+     */
+    private Date tstm;
+
+    /**
+     * 设置:主键
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * 获取:主键
+     */
+    public Integer getId() {
+        return id;
+    }
+    /**
+     * 设置:商户订单编号
+     */
+    public void setMerchOrderSn(String merchOrderSn) {
+        this.merchOrderSn = merchOrderSn;
+    }
+
+    /**
+     * 获取:商户订单编号
+     */
+    public String getMerchOrderSn() {
+        return merchOrderSn;
+    }
+
+    public String getOrderSn() {
+        return orderSn;
+    }
+
+    public void setOrderSn(String orderSn) {
+        this.orderSn = orderSn;
+    }
+
+    /**
+     * 设置:模板是否通知 0:否 1:是;
+     */
+    public void setIsTempNoti(String isTempNoti) {
+        this.isTempNoti = isTempNoti;
+    }
+
+    /**
+     * 获取:模板是否通知 0:否 1:是;
+     */
+    public String getIsTempNoti() {
+        return isTempNoti;
+    }
+    /**
+     * 设置:人脸核身是否核验成功0:否,1:是
+     */
+    public void setIsFaceCheck(String isFaceCheck) {
+        this.isFaceCheck = isFaceCheck;
+    }
+
+    /**
+     * 获取:人脸核身是否核验成功0:否,1:是
+     */
+    public String getIsFaceCheck() {
+        return isFaceCheck;
+    }
+    /**
+     * 设置:用户id
+     */
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    /**
+     * 获取:用户id
+     */
+    public Integer getUserId() {
+        return userId;
+    }
+    /**
+     * 设置:模板通知失败原因
+     */
+    public void setTempNotiMsg(String tempNotiMsg) {
+        this.tempNotiMsg = tempNotiMsg;
+    }
+
+    /**
+     * 获取:模板通知失败原因
+     */
+    public String getTempNotiMsg() {
+        return tempNotiMsg;
+    }
+
+    public String getRecognitionReturnMsg() {
+        return recognitionReturnMsg;
+    }
+
+    public void setRecognitionReturnMsg(String recognitionReturnMsg) {
+        this.recognitionReturnMsg = recognitionReturnMsg;
+    }
+
+    /**
+     * 设置:创建人编号
+     */
+    public void setCreaterSn(String createrSn) {
+        this.createrSn = createrSn;
+    }
+
+    /**
+     * 获取:创建人编号
+     */
+    public String getCreaterSn() {
+        return createrSn;
+    }
+    /**
+     * 设置:创建时间
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * 获取:创建时间
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+    /**
+     * 设置:修改人编号
+     */
+    public void setModerSn(String moderSn) {
+        this.moderSn = moderSn;
+    }
+
+    /**
+     * 获取:修改人编号
+     */
+    public String getModerSn() {
+        return moderSn;
+    }
+    /**
+     * 设置:修改时间
+     */
+    public void setModTime(Date modTime) {
+        this.modTime = modTime;
+    }
+
+    /**
+     * 获取:修改时间
+     */
+    public Date getModTime() {
+        return modTime;
+    }
+    /**
+     * 设置:时间戳
+     */
+    public void setTstm(Date tstm) {
+        this.tstm = tstm;
+    }
+
+    /**
+     * 获取:时间戳
+     */
+    public Date getTstm() {
+        return tstm;
+    }
+}

+ 11 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/OrderEntity.java

@@ -195,6 +195,17 @@ public class OrderEntity implements Serializable {
     //供应商第三方商户
     private String supplierThirdPartyMerchName;
 
+    //供应商第三方商户
+    private String supplierThirdPartyMerchCode;
+
+    public String getSupplierThirdPartyMerchCode() {
+        return supplierThirdPartyMerchCode;
+    }
+
+    public void setSupplierThirdPartyMerchCode(String supplierThirdPartyMerchCode) {
+        this.supplierThirdPartyMerchCode = supplierThirdPartyMerchCode;
+    }
+
     public String getSupplierThirdPartyMerchName() {
         return supplierThirdPartyMerchName;
     }

+ 11 - 1
kmall-admin/src/main/java/com/kmall/admin/entity/ThirdMerchantBizEntity.java

@@ -33,6 +33,8 @@ public class ThirdMerchantBizEntity implements Serializable {
 
     private String isStoreUserShare;
 
+    private String isFaceCheck;
+
     /**
      * 是否有效,0:有效,1:无效
      */
@@ -46,7 +48,7 @@ public class ThirdMerchantBizEntity implements Serializable {
      */
     private Date createTime;
     /**
-     * 
+     *
      */
     private String moderSn;
     /**
@@ -104,6 +106,14 @@ public class ThirdMerchantBizEntity implements Serializable {
         this.isStockShare = isStockShare;
     }
 
+    public String getIsFaceCheck() {
+        return isFaceCheck;
+    }
+
+    public void setIsFaceCheck(String isFaceCheck) {
+        this.isFaceCheck = isFaceCheck;
+    }
+
     public String getMerchSn() {
         return merchSn;
     }

+ 11 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/UserEntity.java

@@ -51,6 +51,9 @@ public class UserEntity implements Serializable {
 
     private String idNo;
 
+    //最后活体人脸核身时间
+    private String lastFaceTime;
+
     /**
      * 设置:主键
      */
@@ -262,4 +265,12 @@ public class UserEntity implements Serializable {
     public void setLevelName(String levelName) {
         this.levelName = levelName;
     }
+
+    public String getLastFaceTime() {
+        return lastFaceTime;
+    }
+
+    public void setLastFaceTime(String lastFaceTime) {
+        this.lastFaceTime = lastFaceTime;
+    }
 }

+ 30 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/mk/store/StoreTopicEntity.java

@@ -80,6 +80,12 @@ public class StoreTopicEntity implements Serializable {
      */
     private Date tstm;
 
+    private String storeName;
+
+    private String promTypeName;
+
+    private String thirdPartyMerchName;
+
     /**
      * 设置:主键
      */
@@ -284,4 +290,28 @@ public class StoreTopicEntity implements Serializable {
     public Date getTstm() {
         return tstm;
     }
+
+    public String getStoreName() {
+        return storeName;
+    }
+
+    public void setStoreName(String storeName) {
+        this.storeName = storeName;
+    }
+
+    public String getPromTypeName() {
+        return promTypeName;
+    }
+
+    public void setPromTypeName(String promTypeName) {
+        this.promTypeName = promTypeName;
+    }
+
+    public String getThirdPartyMerchName() {
+        return thirdPartyMerchName;
+    }
+
+    public void setThirdPartyMerchName(String thirdPartyMerchName) {
+        this.thirdPartyMerchName = thirdPartyMerchName;
+    }
 }

+ 9 - 0
kmall-admin/src/main/java/com/kmall/admin/service/OrderService.java

@@ -1,6 +1,7 @@
 package com.kmall.admin.service;
 
 import com.kmall.admin.dto.OrderExpressDto;
+import com.kmall.admin.dto.OrderRecognitionDto;
 import com.kmall.admin.entity.OfflineCartEntity;
 import com.kmall.admin.entity.OrderEntity;
 import com.kmall.admin.entity.OrderRefundEntity;
@@ -118,6 +119,14 @@ public interface OrderService {
 
     int queryStoreTopicOrderTotal(Map<String, Object> map);
 
+    /**
+     * 获取ccnet需要重发的订单数据
+     * @param map
+     * @return
+     */
     List<WxOrderEntity> wxOrderResendQueryAllList(Map<String, Object> map);
 
+    List<OrderRecognitionDto> queryOrderListByRecognition(Map<String, Object> map);
+
+    int queryOrderListByRecognitionTotal(Map<String, Object> map);
 }

+ 7 - 0
kmall-admin/src/main/java/com/kmall/admin/service/UserService.java

@@ -69,4 +69,11 @@ public interface UserService {
      * @return 删除条数
      */
     int deleteBatch(Integer[] ids);
+
+    /**
+     * 根据用户id判断上次活体人脸核身时间是否在可调用范围内
+     * @param userId
+     * @return
+     */
+    Map checkFaceTimeByUserId(Long userId);
 }

+ 14 - 0
kmall-admin/src/main/java/com/kmall/admin/service/faceid/FaceIdService.java

@@ -0,0 +1,14 @@
+package com.kmall.admin.service.faceid;
+
+import com.kmall.admin.dto.FaceByOrderDto;
+
+/**
+ * @author huangyq
+ * @version 1.0
+ * 2019-11-27 14:13
+ */
+public interface FaceIdService {
+    String checkLivenessRecognition(FaceByOrderDto faceByOrderDto);
+
+    String sendWxTemp(long orderId);
+}

+ 44 - 3
kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java

@@ -6,11 +6,13 @@ import com.google.common.collect.Maps;
 import com.kmall.admin.dao.*;
 import com.kmall.admin.dao.mk.store.MkStorePromOrderRealDao;
 import com.kmall.admin.dto.OrderExpressDto;
+import com.kmall.admin.dto.OrderRecognitionDto;
 import com.kmall.admin.entity.*;
 import com.kmall.admin.entity.OrderProcessRecordEntity;
 import com.kmall.admin.entity.mk.store.MkStorePromOrderRealEntity;
-import com.kmall.admin.utils.ResponseData;
-import com.kmall.api.entity.mk.MkStorePromOrderRealVo;
+import com.kmall.admin.fromcomm.dao.SysConfigDao;
+import com.kmall.admin.service.UserService;
+import com.kmall.common.utils.ResponseData;
 import com.kmall.manager.manager.express.sf.properties.SFPropertiesBuilder;
 import com.kmall.manager.manager.express.sf.properties.SFUtil;
 import com.kmall.manager.manager.express.sf.entity.SfRouteServiceResponseEntity;
@@ -76,6 +78,10 @@ public class OrderServiceImpl implements OrderService {
     private MkStorePromOrderRealDao mkStorePromOrderRealDao;
     @Autowired
     private UserCampMinusDao userCampMinusDao;
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private SysConfigDao sysConfigDao;
 
     @Override
     public OrderEntity queryObject(Long id) {
@@ -1194,7 +1200,7 @@ public class OrderServiceImpl implements OrderService {
     @Override
     public List<WxOrderEntity> wxOrderResendQueryAllList(Map<String, Object> map){
 //        String requestData = JacksonUtil.toJson(map);
-        String url = "http://120.78.152.8:9580/wx/wxOrderResendQueryAll";
+        String url = OmsMerchPropertiesBuilder.instance().getWxOrderResendUrl();
         // 同步访问,返回结果字符串
         String response = OkHttpUtils.post(map, url, "SSL");
         ResponseData responseData = JacksonUtils.fromStringJson(response, ResponseData.class);
@@ -1204,4 +1210,39 @@ public class OrderServiceImpl implements OrderService {
         }
         return null;
     }
+    @Override
+    public List<OrderRecognitionDto> queryOrderListByRecognition(Map<String, Object> map){
+        String value = sysConfigDao.queryByKey("FACE_COLLECT_FREQUENCY_TIME");
+        if(value==null){
+            throw new RRException("请联系管理员配系统参数置FACE_COLLECT_FREQUENCY_TIME信息!");
+        }
+        List<OrderRecognitionDto> list = orderDao.queryOrderListByRecognition(map);
+        for (OrderRecognitionDto orderRecognitionDto: list){
+            Integer frequencySecondTime = Integer.parseInt(value);
+            String lastFaceTime = orderRecognitionDto.getLastFaceTime();
+            if(StringUtils.isNotEmpty(lastFaceTime)) {
+                Date lastFaceDate = DateUtils.convertStringToDate(lastFaceTime, DateUtils.DATE_TIME_PATTERN);
+                Calendar calendar = Calendar.getInstance();
+                calendar.setTime(lastFaceDate);
+                calendar.add(Calendar.SECOND, frequencySecondTime);
+                Date addSecondTime = calendar.getTime();
+                Date nowDate = new Date();
+                if (addSecondTime.getTime() > nowDate.getTime()) {
+                    orderRecognitionDto.setAddSecondTime(DateUtils.format(addSecondTime,DateUtils.DATE_TIME_PATTERN));
+                    orderRecognitionDto.setIsDateLast("false");
+                } else {
+                    //可调用身份验证范围内
+                    orderRecognitionDto.setIsDateLast("true");
+                }
+            }else{//可调用身份验证范围内
+                orderRecognitionDto.setIsDateLast("true");
+            }
+        }
+        return list;
+    }
+
+    @Override
+    public int queryOrderListByRecognitionTotal(Map<String, Object> map){
+        return orderDao.queryOrderListByRecognitionTotal(map);
+    }
 }

+ 1 - 1
kmall-admin/src/main/java/com/kmall/admin/service/impl/ProductStoreRelaServiceImpl.java

@@ -240,7 +240,7 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
         storeMngChangeEntity.setIsValid(0);
         storeMngChangeDao.save(storeMngChangeEntity);
 
-        //更新门店商品是否有修改字段
+        //更新门店商品是否有修改字段为是
         updateLoadGoodsByStoreId(storeId, user);
 
         productStoreRela.setAttributeCategory(categoryDao.queryObject(productStoreRela.getCategoryId()).getParentId());

+ 46 - 3
kmall-admin/src/main/java/com/kmall/admin/service/impl/UserServiceImpl.java

@@ -2,13 +2,15 @@ package com.kmall.admin.service.impl;
 
 import com.kmall.admin.dao.UserDao;
 import com.kmall.admin.entity.UserEntity;
+import com.kmall.admin.fromcomm.dao.SysConfigDao;
 import com.kmall.admin.service.UserService;
+import com.kmall.common.utils.DateUtils;
+import com.kmall.common.utils.RRException;
+import com.kmall.common.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * Service实现类
@@ -21,6 +23,8 @@ import java.util.Map;
 public class UserServiceImpl implements UserService {
     @Autowired
     private UserDao userDao;
+    @Autowired
+    private SysConfigDao sysConfigDao;
 
     @Override
     public UserEntity queryObject(Integer id) {
@@ -57,4 +61,43 @@ public class UserServiceImpl implements UserService {
     public int deleteBatch(Integer[] ids) {
         return userDao.deleteBatch(ids);
     }
+
+    /**
+     * 根据用户id判断上次活体人脸核身时间是否在可调用范围内
+     * @param userId
+     * @return
+     */
+    public Map checkFaceTimeByUserId(Long userId){
+        Map map = new HashMap();
+        String value = sysConfigDao.queryByKey("FACE_COLLECT_FREQUENCY_TIME");
+        if(value==null){
+            throw new RRException("请联系管理员配系统参数置FACE_COLLECT_FREQUENCY_TIME信息!");
+        }
+        UserEntity userEntity = userDao.queryObject(userId);
+        if(userEntity != null && StringUtils.isNotEmpty(value)){
+            Integer frequencySecondTime = Integer.parseInt(value);
+            String lastFaceTime = userEntity.getLastFaceTime();
+            if(StringUtils.isNotEmpty(lastFaceTime)) {
+                Date lastFaceDate = DateUtils.convertStringToDate(lastFaceTime, DateUtils.DATE_TIME_PATTERN);
+                Calendar calendar = Calendar.getInstance();
+                calendar.setTime(lastFaceDate);
+                calendar.add(Calendar.SECOND, frequencySecondTime);
+                Date addSecondTime = calendar.getTime();
+                map.put("addSecondTime", addSecondTime);
+                Date nowDate = new Date();
+                if (addSecondTime.getTime() > nowDate.getTime()) {
+                    map.put("isCheck", false);
+                    return map;
+                } else {
+                    //可调用身份验证范围内
+                    map.put("isCheck", true);
+                    return map;
+                }
+            }else{//可调用身份验证范围内
+                map.put("isCheck", true);
+                return map;
+            }
+        }
+        return null;
+    }
 }

+ 213 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/faceid/FaceIdServiceImpl.java

@@ -0,0 +1,213 @@
+package com.kmall.admin.service.impl.faceid;
+
+import com.google.common.collect.ImmutableBiMap;
+import com.kmall.admin.dao.*;
+import com.kmall.admin.dto.FaceByOrderDto;
+import com.kmall.admin.dto.SendTempDto;
+import com.kmall.admin.entity.*;
+import com.kmall.admin.fromcomm.dao.SysConfigDao;
+import com.kmall.admin.service.UserService;
+import com.kmall.admin.service.faceid.FaceIdService;
+import com.kmall.manager.dao.TemplateConfDao;
+import com.kmall.manager.dto.FaceIdRequestDto;
+import com.kmall.common.constant.Dict;
+import com.kmall.common.utils.*;
+import com.kmall.manager.entity.pay.TemplateConfVo;
+import com.kmall.manager.manager.faceid.FaceCheckUtil;
+import com.kmall.manager.manager.wechat.wxtemplate.TemplateData;
+import com.kmall.manager.manager.wechat.wxtemplate.WxTemplate;
+import com.kmall.manager.manager.wechat.wxtemplate.WxTemplateUtil;
+import net.sf.json.JSONObject;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+
+/**
+ * @author huangyq
+ * @version 1.0
+ * 2019-11-27 14:14
+ */
+@Service("faceIdService")
+public class FaceIdServiceImpl implements FaceIdService {
+    private static Log logger = LogFactory.getLog(FaceIdServiceImpl.class);
+    @Autowired
+    private OrderDao orderDao;
+    @Autowired
+    private OrderGoodsDao orderGoodsDao;
+    @Autowired
+    private MerchDao merchDao;
+    @Autowired
+    private ThirdMerchantBizDao thirdMerchantBizDao;
+    @Autowired
+    private UserDao userDao;
+    @Autowired
+    private TemplateConfDao templateConfDao;
+    @Autowired
+    private FaceLivenessRecognitionReturnDataDao faceLivenessRecognitionReturnDataDao;
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private SysConfigDao sysConfigDao;
+
+    /**
+     * 人脸认证
+     * @param faceByOrderDto
+     * @return
+     */
+    @Override
+    public String checkLivenessRecognition(FaceByOrderDto faceByOrderDto){
+        Map<String, Object> valideDate = MapBeanUtil.fromObject(faceByOrderDto);
+        ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+        builder.put("idCard", "身份证号");
+        builder.put("name", "姓名");
+        builder.put("videoBase64", "视频的BASE64值");
+        builder.put("orderId", "订单id");
+        R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+        if (Integer.valueOf(r.get("code").toString()) != 0) {
+            throw new RRException(r.get("msg").toString());
+        }
+        OrderEntity orderEntity = orderDao.queryObject(faceByOrderDto.getOrderId());
+        if(orderEntity == null){
+            throw new RRException("订单不存在!");
+        }
+        Map map = userService.checkFaceTimeByUserId(Long.valueOf(String.valueOf(orderEntity.getUserId())));
+        boolean isCheck = (boolean)map.get("isCheck");
+        Date addSecondTime = (Date)map.get("addSecondTime");//人脸识别认证失效时间
+        if(!isCheck){
+            throw new RRException("该订单的用户在"+DateUtils.format(addSecondTime,DateUtils.DATE_TIME_PATTERN)+"时间前可不再进行人脸识别");
+        }
+        MerchEntity merchEntity = merchDao.findByMerchSn(orderEntity.getMerchSn());
+        if(merchEntity == null){
+            throw new RRException("商户不存在");
+        }
+        ThirdMerchantBizEntity thirdMerchantBizEntity = thirdMerchantBizDao.queryThirdDataByStoreId(orderEntity.getStoreId());
+        if(thirdMerchantBizEntity == null){
+            throw new RRException("该订单门店的第三方商户不存在");
+        }
+
+        FaceIdRequestDto faceIdRequestDto = new FaceIdRequestDto();
+        faceIdRequestDto.setLivenessType(Dict.livenessType.item_SILENT.getItem());
+        faceIdRequestDto.setIdCard(faceByOrderDto.getIdCard());
+        faceIdRequestDto.setName(faceByOrderDto.getName());
+        faceIdRequestDto.setVideoBase64(faceByOrderDto.getVideoBase64());
+        faceIdRequestDto.setMerchId(orderEntity.getMerchSn());
+        faceIdRequestDto.setMerchName(merchEntity.getMerchName());
+        faceIdRequestDto.setThirdPartyMerchCode(thirdMerchantBizEntity.getThirdPartyMerchCode());
+        faceIdRequestDto.setThirdPartyMerchName(thirdMerchantBizEntity.getThirdPartyMerchName());
+        ResponseData responseData = FaceCheckUtil.checkLivenessRecognition(faceIdRequestDto);
+        FaceLivenessRecognitionReturnDataEntity returnDataEntity = faceLivenessRecognitionReturnDataDao.getFaceByOrderSn(orderEntity.getOrderSn());
+        if(!responseData.getCode().equalsIgnoreCase("0")){
+            //更新验证活体人脸核身接口返回的数据记录表中的是否验证成功为已验证,通知模板为未通知
+            if(returnDataEntity != null) {
+                updateFaceLivenessRecognition(orderEntity.getOrderSn(), "0", responseData.getMsg());
+            }
+            throw new RRException(responseData.getMsg());
+        }else{//人脸核验成功
+            Map faceIdResponseDto = (Map)responseData.getData().getRows().get(0);
+            //保存用户表中的最后活体人脸核身时间
+            UserEntity user = new UserEntity();
+            user.setId(orderEntity.getUserId());
+            if(StringUtils.isNotEmpty((String)faceIdResponseDto.get("returnTime"))) {
+                user.setLastFaceTime((String)faceIdResponseDto.get("returnTime"));
+            }
+            userDao.update(user);
+            //更新验证活体人脸核身接口返回的数据记录表中的是否验证成功为已验证,通知模板为未通知
+            if(returnDataEntity != null) {
+                updateFaceLivenessRecognition(orderEntity.getOrderSn(), "1", responseData.getMsg());
+            }
+            return responseData.getMsg();
+        }
+    }
+
+    @Override
+    public String sendWxTemp(long orderId){
+        TemplateConfVo templateConfVo =
+                templateConfDao.queryByTypeId(10); //  模板类型 10待支付提醒
+        if (null == templateConfVo) {
+            return "";
+        }
+        SendTempDto sendTempDto = orderDao.queryOrderByRecogTemp(orderId);
+        if(sendTempDto != null) {
+            Map map = new HashMap();
+            map.put("orderId", orderId);
+            List<OrderGoodsEntity> orderGoodsEntityList = orderGoodsDao.queryList(map);
+            StringBuffer goodsNames = new StringBuffer();
+            if(orderGoodsEntityList.size()>0){
+                for(OrderGoodsEntity goodsEntity: orderGoodsEntityList){
+                    goodsNames.append(goodsEntity.getGoodsName() + ",");
+                }
+            }
+            Date add_time = sendTempDto.getAddTime();
+            String open_id = sendTempDto.getOpenId();
+            String goods_name = goodsNames.toString().substring(0, goodsNames.length() - 1);
+            String order_sn = sendTempDto.getOrderSn();
+            String addTime = "";
+            if (add_time != null) {
+                addTime = DateUtils.format(add_time, DateUtils.DATE_TIME_PATTERN);
+            }
+            WxTemplate tem = new WxTemplate();
+            tem.setTemplate_id(templateConfVo.getTemplateId());
+            tem.setTouser(open_id);
+            tem.setPage("/pages/ucenter/orderDetail/orderDetail?id=" + orderId);
+
+            List<TemplateData> paras = new ArrayList<TemplateData>();
+            String addTimeAfter = DateUtils.addMin(add_time, 15);
+            String desc = templateConfVo.getDesc().replace("addTimeAfter", addTimeAfter);
+            paras.add(new TemplateData("thing1", goods_name));
+            paras.add(new TemplateData("date2", addTime));
+            paras.add(new TemplateData("thing3", desc));
+            tem.setData(paras);
+            JSONObject jsonObject = WxTemplateUtil.sendMessage(tem);
+            int result = jsonObject.getInt("errcode");
+            String resultmsg = jsonObject.getString("errmsg");
+            if (result != 0) {
+                String error = "";
+                if (result == 43101) {
+                    error = "用户openId【" + open_id + "】待支付提醒模板推送失败,原因:用户拒绝接受消息,如果用户之前曾经订阅过,则表示用户取消了订阅关系";
+                    logger.info(error);
+                } else if (result == 40037) {
+                    error = "用户openId【" + open_id + "】待支付提醒模板推送失败,原因:订阅模板id为空不正确";
+                    logger.info(error);
+                } else if (result == 41030) {
+                    error = "用户openId【" + open_id + "】待支付提醒模板推送失败,原因:page路径不正确,需要保证在现网版本小程序中存在,与app.json保持一致";
+                    logger.info(error);
+                } else {
+                    error = resultmsg;
+                    logger.info(error);
+                }
+                Map param = new HashMap();
+                param.put("orderSn", order_sn);
+                param.put("isTempNoti", 0);
+                param.put("tempNotiMsg", error);
+                faceLivenessRecognitionReturnDataDao.updateOrderByTempNoti(param);
+                return error;
+            } else {
+                Map param = new HashMap();
+                param.put("orderSn", order_sn);
+                param.put("isTempNoti", 1);
+                param.put("tempNotiMsg", "通知成功");
+                faceLivenessRecognitionReturnDataDao.updateOrderByTempNoti(param);
+                return "通知成功";
+            }
+        }
+        return "通知成功";
+    }
+
+    /**
+     * 更新订单人脸认证记录表
+     * @param orderSn
+     * @param isFaceCheck
+     * @param msg
+     */
+    private void updateFaceLivenessRecognition(String orderSn,String isFaceCheck,String msg){
+        FaceLivenessRecognitionReturnDataEntity entity = new FaceLivenessRecognitionReturnDataEntity();
+        entity.setOrderSn(orderSn);
+        entity.setIsFaceCheck(isFaceCheck);
+        entity.setIsTempNoti("0");//未通知
+        entity.setRecognitionReturnMsg(msg);
+        faceLivenessRecognitionReturnDataDao.updateByMerchOrderSn(entity);
+    }
+}

+ 47 - 47
kmall-admin/src/main/resources/conf/fastdfs.properties

@@ -1,51 +1,15 @@
-###连接超时时间
-#connect_timeout=30
-#
-##网络超时时间
-#network_timeout=60
-#
-##文件路径
-#base_path=/data/files/
-#
-##tracker server是FastDFS文件系统的协调者,其主要作用是负载均衡和调度。
-##Tracker server在内存中记录分组和Storage server的状态等信息,不记录文件索引信息
-#tracker_server=192.168.1.251:22122
-#
-#log_level=info
-#
-#use_connection_pool = false
-#
-#connection_pool_max_idle_time = 3600
-#
-#load_fdfs_parameters_from_tracker=false
-#
-#use_storage_id = false
-#
-#storage_ids_filename = storage_ids.conf
-#
-##HTTP 服务器地址
-#http.tracket_nginx_addr=192.168.1.251
-#
-##HTTP 服务器端口号
-#http.tracker_server_port=80
-#
-##文件作者
-#file.author=kmall-pt
+##\u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4
+connect_timeout=30
 
-
-##############生产环境################
-##连接超时时间
-#connect_timeout=30
-#
-##网络超时时间
+#\u7F51\u7EDC\u8D85\u65F6\u65F6\u95F4
 network_timeout=60
 
-#文件路径
+#\u6587\u4EF6\u8DEF\u5F84
 base_path=/data/files/
 
-#tracker server是FastDFS文件系统的协调者,其主要作用是负载均衡和调度。
-#Tracker server在内存中记录分组和Storage server的状态等信息,不记录文件索引信息
-tracker_server=120.76.26.84:22122
+#tracker server\u662FFastDFS\u6587\u4EF6\u7CFB\u7EDF\u7684\u534F\u8C03\u8005,\u5176\u4E3B\u8981\u4F5C\u7528\u662F\u8D1F\u8F7D\u5747\u8861\u548C\u8C03\u5EA6\u3002
+#Tracker server\u5728\u5185\u5B58\u4E2D\u8BB0\u5F55\u5206\u7EC4\u548CStorage server\u7684\u72B6\u6001\u7B49\u4FE1\u606F\uFF0C\u4E0D\u8BB0\u5F55\u6587\u4EF6\u7D22\u5F15\u4FE1\u606F
+tracker_server=192.168.1.251:22122
 
 log_level=info
 
@@ -59,11 +23,47 @@ use_storage_id = false
 
 storage_ids_filename = storage_ids.conf
 
-#HTTP 服务器地址
-http.tracket_nginx_addr=120.76.26.84
+#HTTP \u670D\u52A1\u5668\u5730\u5740
+http.tracket_nginx_addr=192.168.1.251
 
-#HTTP 服务器端口号
+#HTTP \u670D\u52A1\u5668\u7AEF\u53E3\u53F7
 http.tracker_server_port=80
 
-#文件作者
+#\u6587\u4EF6\u4F5C\u8005
 file.author=kmall-pt
+
+
+###############\u751F\u4EA7\u73AF\u5883################
+####\u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4
+###connect_timeout=30
+###
+####\u7F51\u7EDC\u8D85\u65F6\u65F6\u95F4
+##network_timeout=60
+##
+###\u6587\u4EF6\u8DEF\u5F84
+##base_path=/data/files/
+##
+###tracker server\u662FFastDFS\u6587\u4EF6\u7CFB\u7EDF\u7684\u534F\u8C03\u8005,\u5176\u4E3B\u8981\u4F5C\u7528\u662F\u8D1F\u8F7D\u5747\u8861\u548C\u8C03\u5EA6\u3002
+###Tracker server\u5728\u5185\u5B58\u4E2D\u8BB0\u5F55\u5206\u7EC4\u548CStorage server\u7684\u72B6\u6001\u7B49\u4FE1\u606F\uFF0C\u4E0D\u8BB0\u5F55\u6587\u4EF6\u7D22\u5F15\u4FE1\u606F
+##tracker_server=120.76.26.84:22122
+##
+##log_level=info
+##
+##use_connection_pool = false
+##
+##connection_pool_max_idle_time = 3600
+##
+##load_fdfs_parameters_from_tracker=false
+##
+##use_storage_id = false
+##
+##storage_ids_filename = storage_ids.conf
+##
+###HTTP \u670D\u52A1\u5668\u5730\u5740
+##http.tracket_nginx_addr=120.76.26.84
+##
+###HTTP \u670D\u52A1\u5668\u7AEF\u53E3\u53F7
+##http.tracker_server_port=80
+##
+###\u6587\u4EF6\u4F5C\u8005
+##file.author=kmall-pt

+ 2 - 2
kmall-admin/src/main/resources/mybatis/mapper/AddressDao.xml

@@ -101,7 +101,7 @@
             AND s.third_party_merch_code = #{thirdPartyMerchCode}
         </if>
         <if test="userId != null">
-            AND mall_address.user_id = #{userId}
+            AND a.user_id = #{userId}
         </if>
         <if test="userName != null and userName != ''">
             AND mall_address.user_name LIKE concat('%', #{userName},'%')
@@ -164,4 +164,4 @@
         </foreach>
     </delete>
 
-</mapper>
+</mapper>

+ 17 - 17
kmall-admin/src/main/resources/mybatis/mapper/CartDao.xml

@@ -88,7 +88,7 @@
             and a.goods_id = #{goodsId}
         </if>
         <if test="userId != null">
-            AND mall_cart.user_id = #{userId}
+            AND d.user_id = #{userId}
         </if>
         <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
             AND s.third_party_merch_code = #{thirdPartyMerchCode}
@@ -99,16 +99,16 @@
 		insert into mall_cart
 		(
 			`user_id`,
-			`goods_id`, 
-			`goods_sn`, 
-			`product_id`, 
-			`goods_name`, 
-			`market_price`, 
-			`retail_price`, 
+			`goods_id`,
+			`goods_sn`,
+			`product_id`,
+			`goods_name`,
+			`market_price`,
+			`retail_price`,
 			`number`,
 			`goods_specification_name_value`,
 			`goods_specification_ids`,
-			`checked`, 
+			`checked`,
 			`list_pic_url`,
 			`stock_num`,
 			`store_id`,
@@ -122,16 +122,16 @@
 		values
 		(
 			#{userId},
-			#{goodsId}, 
-			#{goodsSn}, 
-			#{productId}, 
-			#{goodsName}, 
-			#{marketPrice}, 
-			#{retailPrice}, 
-			#{number}, 
+			#{goodsId},
+			#{goodsSn},
+			#{productId},
+			#{goodsName},
+			#{marketPrice},
+			#{retailPrice},
+			#{number},
 			#{goodsSpecificationNameValue},
 			#{goodsSpecificationIds},
-			#{checked}, 
+			#{checked},
 			#{listPicUrl},
 			#{stockNum},
 			#{storeId},
@@ -191,4 +191,4 @@
         </foreach>
     </delete>
 
-</mapper>
+</mapper>

+ 182 - 0
kmall-admin/src/main/resources/mybatis/mapper/FaceLivenessRecognitionReturnDataDao.xml

@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.kmall.admin.dao.FaceLivenessRecognitionReturnDataDao">
+
+    <resultMap type="com.kmall.admin.entity.FaceLivenessRecognitionReturnDataEntity" id="faceLivenessRecognitionReturnDataMap">
+        <result property="id" column="id"/>
+        <result property="merchOrderSn" column="merch_order_sn"/>
+        <result property="isTempNoti" column="is_temp_noti"/>
+        <result property="isFaceCheck" column="is_face_check"/>
+        <result property="userId" column="user_id"/>
+        <result property="tempNotiMsg" column="temp_noti_msg"/>
+		<result property="recognitionReturnMsg" column="recognition_return_msg"/>
+        <result property="createrSn" column="creater_sn"/>
+        <result property="createTime" column="create_time"/>
+        <result property="moderSn" column="moder_sn"/>
+        <result property="modTime" column="mod_time"/>
+        <result property="tstm" column="tstm"/>
+    </resultMap>
+
+	<select id="queryObject" resultType="com.kmall.admin.entity.FaceLivenessRecognitionReturnDataEntity">
+		select
+			`id`,
+			`merch_order_sn`,
+			`order_sn`,
+			`is_temp_noti`,
+			`is_face_check`,
+			`user_id`,
+			`temp_noti_msg`,
+			recognition_return_msg,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`
+		from face_liveness_recognition_return_data
+		where id = #{id}
+	</select>
+
+	<select id="queryList" resultType="com.kmall.admin.entity.FaceLivenessRecognitionReturnDataEntity">
+		select
+    		`id`,
+    		`merch_order_sn`,
+			`order_sn`,
+    		`is_temp_noti`,
+    		`is_face_check`,
+    		`user_id`,
+    		`temp_noti_msg`,
+		recognition_return_msg,
+    		`creater_sn`,
+    		`create_time`,
+    		`moder_sn`,
+    		`mod_time`,
+    		`tstm`
+		from face_liveness_recognition_return_data
+		WHERE 1=1
+		<if test="name != null and name.trim() != ''">
+			AND name LIKE concat('%',#{name},'%')
+		</if>
+        <choose>
+            <when test="sidx != null and sidx.trim() != ''">
+                order by ${sidx} ${order}
+            </when>
+			<otherwise>
+                order by id desc
+			</otherwise>
+        </choose>
+		<if test="offset != null and limit != null">
+			limit #{offset}, #{limit}
+		</if>
+	</select>
+
+ 	<select id="queryTotal" resultType="int">
+		select count(*) from face_liveness_recognition_return_data
+		WHERE 1=1
+        <if test="name != null and name.trim() != ''">
+            AND name LIKE concat('%',#{name},'%')
+        </if>
+	</select>
+
+	<insert id="save" parameterType="com.kmall.admin.entity.FaceLivenessRecognitionReturnDataEntity" useGeneratedKeys="true" keyProperty="id">
+		insert into face_liveness_recognition_return_data(
+			`merch_order_sn`,
+			`order_sn`,
+			`is_temp_noti`,
+			`is_face_check`,
+			`user_id`,
+			`temp_noti_msg`,
+			recognition_return_msg,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`)
+		values(
+			#{merchOrderSn},
+			#{orderSn},
+			#{isTempNoti},
+			#{isFaceCheck},
+			#{userId},
+			#{tempNotiMsg},
+			#{recognitionReturnMsg},
+			#{createrSn},
+			#{createTime},
+			#{moderSn},
+			#{modTime},
+			#{tstm})
+	</insert>
+
+	<update id="update" parameterType="com.kmall.admin.entity.FaceLivenessRecognitionReturnDataEntity">
+		update face_liveness_recognition_return_data
+		<set>
+			<if test="merchOrderSn != null">`merch_order_sn` = #{merchOrderSn}, </if>
+			<if test="orderSn != null">`order_sn` = #{orderSn}, </if>
+			<if test="isTempNoti != null">`is_temp_noti` = #{isTempNoti}, </if>
+			<if test="isFaceCheck != null">`is_face_check` = #{isFaceCheck}, </if>
+			<if test="userId != null">`user_id` = #{userId}, </if>
+			<if test="tempNotiMsg != null">`temp_noti_msg` = #{tempNotiMsg}, </if>
+			<if test="recognitionReturnMsg != null">`recognition_return_msg` = #{recognitionReturnMsg}, </if>
+			<if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
+			<if test="createTime != null">`create_time` = #{createTime}, </if>
+			<if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
+			<if test="modTime != null">`mod_time` = #{modTime}, </if>
+			<if test="tstm != null">`tstm` = #{tstm}</if>
+		</set>
+		where id = #{id}
+	</update>
+
+	<delete id="delete">
+		delete from face_liveness_recognition_return_data where id = #{value}
+	</delete>
+
+	<delete id="deleteBatch">
+		delete from face_liveness_recognition_return_data where id in
+		<foreach item="id" collection="array" open="(" separator="," close=")">
+			#{id}
+		</foreach>
+	</delete>
+
+	<update id="updateByMerchOrderSn" parameterType="com.kmall.admin.entity.FaceLivenessRecognitionReturnDataEntity">
+		update face_liveness_recognition_return_data
+		<set>
+			<if test="isTempNoti != null">`is_temp_noti` = #{isTempNoti}, </if>
+			<if test="isFaceCheck != null">`is_face_check` = #{isFaceCheck}, </if>
+			<if test="userId != null">`user_id` = #{userId}, </if>
+			<if test="recognitionReturnMsg != null">`recognition_return_msg` = #{recognitionReturnMsg}, </if>
+		</set>
+		where order_sn = #{orderSn}
+	</update>
+
+	<update id="updateOrderByTempNoti" parameterType="map">
+		update face_liveness_recognition_return_data
+		<set>
+			<if test="isTempNoti != null and isTempNoti != ''">
+				is_temp_noti = #{isTempNoti},
+			</if>
+			<if test="tempNotiMsg != null and tempNotiMsg != ''">
+				temp_noti_msg = #{tempNotiMsg}
+			</if>
+		</set>
+		where order_sn = #{orderSn}
+	</update>
+
+	<select id="getFaceByOrderSn" resultType="com.kmall.admin.entity.FaceLivenessRecognitionReturnDataEntity">
+		select
+			`id`,
+			`merch_order_sn`,
+			`order_sn`,
+			`is_temp_noti`,
+			`is_face_check`,
+			`user_id`,
+			`temp_noti_msg`,
+			recognition_return_msg,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`
+		from face_liveness_recognition_return_data
+		where order_sn = #{orderSn}
+	</select>
+</mapper>

+ 331 - 53
kmall-admin/src/main/resources/mybatis/mapper/OrderDao.xml

@@ -253,7 +253,8 @@
         uc.NAME unit_code,
         good.gross_weight * g.number gross_weight,
         good.net_weight * g.number net_weight,
-        t2.third_party_merch_name 'supplierThirdPartyMerchName'
+        t2.third_party_merch_name 'supplierThirdPartyMerchName',
+        t2.third_party_merch_code 'supplierThirdPartyMerchCode'
         FROM
         mall_order o
         LEFT JOIN mall_user u ON o.user_id = u.id
@@ -465,35 +466,35 @@
     <insert id="save" parameterType="com.kmall.admin.entity.OrderEntity" useGeneratedKeys="true" keyProperty="id">
 		insert into mall_order
 		(
-			`order_sn`, 
-			`user_id`, 
-			`order_status`, 
-			`shipping_status`, 
-			`pay_status`, 
-			`consignee`, 
-			`country`, 
-			`province`, 
-			`city`, 
+			`order_sn`,
+			`user_id`,
+			`order_status`,
+			`shipping_status`,
+			`pay_status`,
+			`consignee`,
+			`country`,
+			`province`,
+			`city`,
 			`district`,
-			`address`, 
-			`mobile`, 
-			`postscript`, 
-			`shipping_id`, 
+			`address`,
+			`mobile`,
+			`postscript`,
+			`shipping_id`,
 			`shipping_name`,
 			`shipping_code`,
 			`shipping_no`,
-			`pay_id`, 
-			`pay_name`, 
-			`shipping_fee`, 
-			`actual_price`, 
-			`integral`, 
-			`integral_money`, 
-			`order_price`, 
-			`goods_price`, 
-			`add_time`, 
-			`confirm_time`, 
-			`pay_time`, 
-			`freight_price`, 
+			`pay_id`,
+			`pay_name`,
+			`shipping_fee`,
+			`actual_price`,
+			`integral`,
+			`integral_money`,
+			`order_price`,
+			`goods_price`,
+			`add_time`,
+			`confirm_time`,
+			`pay_time`,
+			`freight_price`,
 			`coupon_id`,
 			`coupon_price`,
             full_cut_price,
@@ -512,35 +513,35 @@
 		)
 		values
 		(
-			#{orderSn}, 
-			#{userId}, 
-			#{orderStatus}, 
-			#{shippingStatus}, 
-			#{payStatus}, 
-			#{consignee}, 
-			#{country}, 
-			#{province}, 
-			#{city}, 
-			#{district}, 
-			#{address}, 
-			#{mobile}, 
-			#{postscript}, 
-			#{shippingId}, 
+			#{orderSn},
+			#{userId},
+			#{orderStatus},
+			#{shippingStatus},
+			#{payStatus},
+			#{consignee},
+			#{country},
+			#{province},
+			#{city},
+			#{district},
+			#{address},
+			#{mobile},
+			#{postscript},
+			#{shippingId},
 			#{shippingName},
 			#{shippingCode},
 			#{shippingNo},
-			#{payId}, 
-			#{payName}, 
-			#{shippingFee}, 
-			#{actualPrice}, 
-			#{integral}, 
-			#{integralMoney}, 
-			#{orderPrice}, 
-			#{goodsPrice}, 
-			#{addTime}, 
-			#{confirmTime}, 
-			#{payTime}, 
-			#{freightPrice}, 
+			#{payId},
+			#{payName},
+			#{shippingFee},
+			#{actualPrice},
+			#{integral},
+			#{integralMoney},
+			#{orderPrice},
+			#{goodsPrice},
+			#{addTime},
+			#{confirmTime},
+			#{payTime},
+			#{freightPrice},
 			#{couponId},
 			#{couponPrice},
             #{fullCutPrice},
@@ -1104,4 +1105,281 @@
             AND o.is_onffline_order = #{isOnfiilineOrder}
         </if>
     </select>
-</mapper>
+
+    <!-- 可根据自己的需求,是否要使用 -->
+    <resultMap type="com.kmall.admin.dto.OrderRecognitionDto" id="orderRecognitionMap">
+        <result property="id" column="id"/>
+        <result property="merchOrderSn" column="merch_order_sn"/>
+        <result property="orderSn" column="order_sn"/>
+        <result property="userId" column="user_id"/>
+        <result property="orderStatus" column="order_status"/>
+        <result property="shippingStatus" column="shipping_status"/>
+        <result property="payStatus" column="pay_status"/>
+        <result property="consignee" column="consignee"/>
+        <result property="country" column="country"/>
+        <result property="province" column="province"/>
+        <result property="city" column="city"/>
+        <result property="district" column="district"/>
+        <result property="address" column="address"/>
+        <result property="mobile" column="mobile"/>
+        <result property="postscript" column="postscript"/>
+        <result property="shippingId" column="shipping_id"/>
+        <result property="shippingName" column="shipping_name"/>
+        <result property="shippingCode" column="shipping_code"/>
+        <result property="shippingNo" column="shipping_no"/>
+        <result property="payId" column="pay_id"/>
+        <result property="payName" column="pay_name"/>
+        <result property="shippingFee" column="shipping_fee"/>
+        <result property="actualPrice" column="actual_price"/>
+        <result property="integral" column="integral"/>
+        <result property="integralMoney" column="integral_money"/>
+        <result property="orderPrice" column="order_price"/>
+        <result property="goodsPrice" column="goods_price"/>
+        <result property="addTime" column="add_time"/>
+        <result property="confirmTime" column="confirm_time"/>
+        <result property="payTime" column="pay_time"/>
+        <result property="freightPrice" column="freight_price"/>
+        <result property="couponId" column="coupon_id"/>
+        <result property="couponPrice" column="coupon_price"/>
+        <result property="callbackStatus" column="callback_status"/>
+        <result property="orderType" column="order_type"/>
+        <result property="storeId" column="store_id"/>
+        <result property="userName" column="username"/>
+        <result property="orderType" column="order_type"/>
+        <result property="activityId" column="activity_id"/>
+        <result property="deliveryDate" column="delivery_date"/>
+        <result property="deliveryRemark" column="delivery_remark"/>
+        <result property="predictTime" column="predict_time"/>
+        <result property="orderBizType" column="order_biz_type"/>
+        <result property="isPaymentSend" column="is_payment_send"/>
+        <result property="isEleOrderSend" column="is_ele_order_send"/>
+        <result property="isCustomsSend" column="is_customs_send"/>
+        <result property="payFlag" column="pay_flag"/>
+        <result column="buyer_pay_check" property="buyerPayCheck"/>
+        <result property="merchSn" column="merch_sn"/>
+        <result property="sku" column="sku"/>
+        <result property="createTime" column="create_time"/>
+        <result property="modTime" column="mod_time"/>
+        <result property="isOnfflineOrder" column="is_onffline_order"/>
+        <result property="orderSnWx" column="order_sn_wx"/>
+        <result property="isMergePay" column="is_merge_pay"/>
+        <result property="payTransactionId" column="pay_transaction_id"/>
+        <result property="storeName" column="store_name"/>
+        <result property="moderSn" column="moder_sn"/>
+        <result property="unitCode" column="unit_code"/>
+        <result property="ciqProdModel" column="ciq_prod_model"/>
+        <result property="oriCntCode" column="ori_cnt_code"/>
+        <result property="brand" column="brand"/>
+        <result column="gross_weight" property="grossWeight" />
+        <result column="net_weight" property="netWeight" />
+        <result property="fullCutPrice" column="full_cut_price"/>
+        <result property="campMinusId" column="camp_minus_id"/>
+        <result property="campName" column="camp_name"/>
+        <result property="isTempNoti" column="is_temp_noti"/>
+        <result property="isFaceCheck" column="is_face_check"/>
+        <result property="tempNotiMsg" column="temp_noti_msg"/>
+        <result property="recognitionReturnMsg" column="recognition_return_msg"/>
+        <result property="lastFaceTime" column="last_face_time"/>
+    </resultMap>
+
+    <select id="queryOrderListByRecognition" resultMap="orderRecognitionMap">
+        SELECT DISTINCT
+        o.order_sn,
+        o.merch_order_sn,
+        o.order_status,
+        o.actual_price,
+        o.order_biz_type,
+        o.shipping_no,
+        o.shipping_name,
+        o.shipping_code,
+        o.consignee,
+        o.mobile,
+        o.province,
+        o.city,
+        o.district,
+        o.address,
+        o.add_time,
+        o.pay_id,
+        o.pay_status,
+        o.shipping_status,
+        o.is_merge_pay,
+        o.buyer_pay_check,
+        o.order_price,
+        o.moder_sn,
+        o.id,
+        u.username AS username,
+        o.user_id,
+        p.is_payment_send,
+        p.is_ele_order_send,
+        p.is_customs_send,
+        s.store_name,
+        o.full_cut_price,
+        o.camp_minus_id,
+        o.camp_name,
+        fd.is_temp_noti,
+        fd.is_face_check,
+        fd.temp_noti_msg,
+        fd.recognition_return_msg,
+        u.last_face_time,
+        t.is_face_check 'thirdIsFaceCheck'
+        FROM
+        mall_order o
+        LEFT JOIN mall_user u ON o.user_id = u.id
+        LEFT JOIN mall_order_process_record p ON o.order_sn = p.order_sn
+        left join mall_store s on o.store_id = s.id
+        LEFT JOIN third_merchant_biz t ON t.third_party_merch_code = s.third_party_merch_code
+        LEFT JOIN mall_order_goods g ON o.id = g.order_id
+        LEFT JOIN mall_product_store_rela r ON o.store_id = r.store_id
+        AND r.goods_id = g.goods_id
+        LEFT JOIN mall_goods gs ON g.goods_id = gs.id
+        INNER JOIN face_liveness_recognition_return_data fd on fd.order_sn = o.order_sn and fd.user_id = o.user_id
+        WHERE 1=1
+        <if test="startTime != null and startTime != ''">
+            AND o.add_time <![CDATA[ >  ]]> #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            AND o.add_time <![CDATA[ <  ]]> #{endTime}
+        </if>
+        <if test="storeId != null and storeId != ''">
+            AND o.store_id = #{storeId}
+        </if>
+        <if test="sku != null and sku.trim() != ''">
+            AND gs.sku = #{sku}
+        </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
+        <if test="thirdMerchSn != null and thirdMerchSn != ''">
+            AND t.third_merch_sn = #{thirdMerchSn}
+        </if>
+        <if test="supplierThirdId != null and supplierThirdId != ''">
+            AND r.supplier_third_id = #{supplierThirdId}
+        </if>
+        <if test="orderBizType != null and orderBizType != ''">
+            AND o.order_biz_type = #{orderBizType}
+        </if>
+        <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
+            AND o.merch_order_sn = #{merchOrderSn}
+        </if>
+        <if test="merchSn != null and merchSn.trim() != ''">
+            AND o.merch_sn = #{merchSn}
+        </if>
+        <if test="orderSn != null and orderSn.trim() != ''">
+            AND o.order_sn LIKE concat('%',#{orderSn},'%')
+        </if>
+        <if test="shippingStatus != null and shippingStatus.trim() != ''">
+            AND o.shipping_status = #{shippingStatus}
+        </if>
+        <if test="payStatus != null and payStatus.trim() != ''">
+            AND o.pay_status = #{payStatus}
+        </if>
+        <if test="orderStatus != null and orderStatus.trim() != ''">
+            AND o.order_status = #{orderStatus}
+        </if>
+        <if test="shippingId != null and shippingId != 0">
+            AND o.shipping_id = #{shippingId}
+        </if>
+        <if test="orderType != null and orderType.trim() != ''">
+            AND o.order_type = #{orderType}
+        </if>
+        <if test="isOnfiilineOrder != null">
+            AND o.is_onffline_order = #{isOnfiilineOrder}
+        </if>
+        <if test="ids != null and ids.trim() != ''">
+            AND o.id in (${ids})
+        </if>
+        <choose>
+            <when test="sidx != null and sidx.trim() != ''">
+                order by ${sidx} ${order}
+            </when>
+            <otherwise>
+                order by o.id desc
+            </otherwise>
+        </choose>
+        <if test="offset != null and limit != null">
+            limit #{offset}, #{limit}
+        </if>
+    </select>
+
+    <select id="queryOrderListByRecognitionTotal" resultType="int">
+        SELECT count(1)
+        FROM
+        mall_order o
+        LEFT JOIN mall_user u ON o.user_id = u.id
+        LEFT JOIN mall_order_process_record p ON o.order_sn = p.order_sn
+        left join mall_store s on o.store_id = s.id
+        LEFT JOIN third_merchant_biz t ON t.third_party_merch_code = s.third_party_merch_code
+        LEFT JOIN mall_order_goods g ON o.id = g.order_id
+        LEFT JOIN mall_product_store_rela r ON o.store_id = r.store_id
+        AND r.goods_id = g.goods_id
+        LEFT JOIN mall_goods gs ON g.goods_id = gs.id
+        INNER JOIN face_liveness_recognition_return_data fd on fd.order_sn = o.order_sn and fd.user_id = o.user_id
+        WHERE 1=1
+        <if test="startTime != null and startTime != ''">
+            AND o.add_time <![CDATA[ >  ]]> #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            AND o.add_time <![CDATA[ <  ]]> #{endTime}
+        </if>
+        <if test="storeId != null and storeId != ''">
+            AND o.store_id = #{storeId}
+        </if>
+        <if test="sku != null and sku.trim() != ''">
+            AND gs.sku = #{sku}
+        </if>
+        <if test="thirdPartyMerchCode != null and thirdPartyMerchCode.trim() != ''">
+            AND s.third_party_merch_code = #{thirdPartyMerchCode}
+        </if>
+        <if test="thirdMerchSn != null and thirdMerchSn != ''">
+            AND t.third_merch_sn = #{thirdMerchSn}
+        </if>
+        <if test="supplierThirdId != null and supplierThirdId != ''">
+            AND r.supplier_third_id = #{supplierThirdId}
+        </if>
+        <if test="orderBizType != null and orderBizType != ''">
+            AND o.order_biz_type = #{orderBizType}
+        </if>
+        <if test="merchOrderSn != null and merchOrderSn.trim() != ''">
+            AND o.merch_order_sn = #{merchOrderSn}
+        </if>
+        <if test="merchSn != null and merchSn.trim() != ''">
+            AND o.merch_sn = #{merchSn}
+        </if>
+        <if test="orderSn != null and orderSn.trim() != ''">
+            AND o.order_sn LIKE concat('%',#{orderSn},'%')
+        </if>
+        <if test="shippingStatus != null and shippingStatus.trim() != ''">
+            AND o.shipping_status = #{shippingStatus}
+        </if>
+        <if test="payStatus != null and payStatus.trim() != ''">
+            AND o.pay_status = #{payStatus}
+        </if>
+        <if test="orderStatus != null and orderStatus.trim() != ''">
+            AND o.order_status = #{orderStatus}
+        </if>
+        <if test="shippingId != null and shippingId != 0">
+            AND o.shipping_id = #{shippingId}
+        </if>
+        <if test="orderType != null and orderType.trim() != ''">
+            AND o.order_type = #{orderType}
+        </if>
+        <if test="isOnfiilineOrder != null">
+            AND o.is_onffline_order = #{isOnfiilineOrder}
+        </if>
+        <if test="ids != null and ids.trim() != ''">
+            AND o.id in (${ids})
+        </if>
+    </select>
+    <select id="queryOrderByRecogTemp" resultType="com.kmall.admin.dto.SendTempDto">
+		SELECT
+            o.add_time 'addTime',
+            u.weixin_openid 'openId',
+            o.merch_order_sn 'merchOrderSn',
+            o.id 'orderId',
+            o.order_sn 'orderSn'
+        FROM
+            mall_order o
+            INNER JOIN mall_user u ON o.user_id = u.id
+            where o.id = #{value}
+	</select>
+</mapper>

+ 2 - 2
kmall-admin/src/main/resources/mybatis/mapper/TemplateConfDao.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 
-<mapper namespace="com.kmall.api.fromcomm.dao.TemplateConfDao">
+<mapper namespace="com.kmall.manager.dao.TemplateConfDao">
 
     <resultMap type="com.kmall.manager.entity.pay.TemplateConfVo" id="templateConfMap">
         <result property="id" column="id"/>
@@ -51,4 +51,4 @@
             AND name LIKE concat('%',#{name},'%')
         </if>
     </select>
-</mapper>
+</mapper>

+ 33 - 8
kmall-admin/src/main/resources/mybatis/mapper/ThirdMerchantBizDao.xml

@@ -19,6 +19,7 @@
 		<result property="isMapShow" column="is_map_show"/>
 		<result property="isDistSellStart" column="is_dist_sell_start"/>
 		<result property="isSupplierGoods" column="is_supplier_goods"/>
+		<result property="isFaceCheck" column="is_face_check"/>
 
     </resultMap>
 
@@ -32,6 +33,7 @@
 			is_stock_share,
 			is_store_user_share,
 			is_supplier_goods,
+			is_face_check,
 			`creater_sn`,
 			`create_time`,
 			`moder_sn`,
@@ -52,6 +54,7 @@
 		is_stock_share,
 		is_store_user_share,
 		is_supplier_goods,
+		is_face_check,
 		`creater_sn`,
 		`create_time`,
 		`moder_sn`,
@@ -72,12 +75,14 @@
 		is_stock_share,
 		is_store_user_share,
 		is_supplier_goods,
+		is_face_check,
+		is_map_show,
+		is_dist_sell_start,
 		`creater_sn`,
 		`create_time`,
 		`moder_sn`,
 		`mod_time`,
-		`tstm`,
-		is_map_show,is_dist_sell_start
+		`tstm`
 		from third_merchant_biz
 		where third_party_merch_code = #{thirdMerchantCode}
 	</select>
@@ -92,6 +97,7 @@
 			is_stock_share,
 			is_store_user_share,
 			is_supplier_goods,
+			is_face_check,
     		`creater_sn`,
     		`create_time`,
     		`moder_sn`,
@@ -123,7 +129,7 @@
 			limit #{offset}, #{limit}
 		</if>
 	</select>
-	
+
  	<select id="queryTotal" resultType="int">
 		select count(*) from third_merchant_biz
 		WHERE 1=1
@@ -149,6 +155,7 @@
 			is_map_show,
 			is_dist_sell_start,
 			is_supplier_goods,
+			is_face_check,
 			`creater_sn`,
 			`create_time`,
 			`moder_sn`,
@@ -164,6 +171,7 @@
 			#{isMapShow},
 			#{isDistSellStart},
 			#{isSupplierGoods},
+			#{isFaceCheck},
 			#{createrSn},
 			#{createTime},
 			#{moderSn},
@@ -172,7 +180,7 @@
 	</insert>
 
 	<update id="update" parameterType="com.kmall.admin.entity.ThirdMerchantBizEntity">
-		update third_merchant_biz 
+		update third_merchant_biz
 		<set>
 			<if test="merchSn != null">`merch_sn` = #{merchSn},</if>
 			<if test="thirdPartyMerchCode != null">`third_party_merch_code` = #{thirdPartyMerchCode}, </if>
@@ -183,6 +191,7 @@
 			<if test="isSupplierGoods != null">`is_supplier_goods` = #{isSupplierGoods}, </if>
 			<if test="isMapShow != null">`is_map_show` = #{isMapShow}, </if>
 			<if test="isDistSellStart != null">`is_dist_sell_start` = #{isDistSellStart}, </if>
+			<if test="isFaceCheck != null">`is_face_check` = #{isFaceCheck}, </if>
 			<if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
 			<if test="createTime != null">`create_time` = #{createTime}, </if>
 			<if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
@@ -191,16 +200,32 @@
 		</set>
 		where third_merch_sn = #{thirdMerchSn}
 	</update>
-	
+
 	<delete id="delete">
 		delete from third_merchant_biz where third_merch_sn = #{value}
 	</delete>
-	
+
 	<delete id="deleteBatch">
-		delete from third_merchant_biz where third_merch_sn in 
+		delete from third_merchant_biz where third_merch_sn in
 		<foreach item="thirdMerchSn" collection="array" open="(" separator="," close=")">
 			#{thirdMerchSn}
 		</foreach>
 	</delete>
 
-</mapper>
+	<select id="queryThirdDataByStoreId" resultType="com.kmall.admin.entity.ThirdMerchantBizEntity">
+		select
+		b.`third_merch_sn`,
+		b.`merch_sn`,
+		b.`third_party_merch_code`,
+		b.`third_party_merch_name`,
+		b.`is_valid`,
+		b.is_stock_share,
+		b.is_store_user_share,
+		b.is_map_show,
+		b.is_dist_sell_start,
+		b.is_supplier_goods,
+		b.is_face_check
+		from third_merchant_biz b inner join mall_store s on s.third_party_merch_code=b.third_party_merch_code
+		where s.id = #{storeId} and s.is_valid = 0
+	</select>
+</mapper>

+ 2 - 2
kmall-admin/src/main/resources/mybatis/mapper/UserCouponDao.xml

@@ -43,7 +43,7 @@
         mall_coupon.name coupon_name
         from mall_user_coupon
         LEFT JOIN mall_user ON mall_user_coupon.user_id = mall_user.id
-        LEFT JOIN mall_coupon ON mall_user_coupon.coupon_id = mall_coupon.id
+        LEFT JOIN mall_coupon ON mall_user_coupon.store_topic_id = mall_coupon.id
         WHERE 1=1
         <if test="userName != null and userName.trim() != ''">
             AND mall_user.username LIKE concat('%',#{userName},'%')
@@ -186,4 +186,4 @@
             AND c.is_used = #{isUsed}
         </if>
     </select>
-</mapper>
+</mapper>

+ 12 - 8
kmall-admin/src/main/resources/mybatis/mapper/UserDao.xml

@@ -19,6 +19,7 @@
         <result property="avatar" column="avatar"/>
         <result property="weixinOpenid" column="weixin_openid"/>
         <result property="id" column="id_no"/>
+        <result property="lastFaceTime" column="last_face_time"/>
     </resultMap>
 
     <select id="queryObject" resultType="com.kmall.admin.entity.UserEntity">
@@ -29,13 +30,13 @@
 
     <select id="queryList" resultType="com.kmall.admin.entity.UserEntity">
         SELECT DISTINCT
-        mall_user.*,
-        mall_user_level.NAME levelName
+        mall_user.*
+        ,mall_user_level.NAME levelName
         FROM
-        mall_store s
-        LEFT JOIN mall_merch_user mu ON mu.store_id = s.id
-        left join mall_user on mall_user.id = mu.user_id
+        mall_user
         LEFT JOIN mall_user_level ON mall_user.user_level_id = mall_user_level.id
+        LEFT JOIN mall_merch_user mu ON mall_user.id = mu.user_id
+        LEFT JOIN mall_store s on mu.store_id = s.id
         WHERE 1=1
         <if test="storeId != null and storeId != ''">
             and mu.store_id = #{storeId}
@@ -104,7 +105,8 @@
 			`mobile`,
 			`register_ip`,
 			`avatar`,
-			`weixin_openid`)
+			`weixin_openid`,
+			last_face_time)
 		values(
 			#{username},
 			#{password},
@@ -118,7 +120,8 @@
 			#{mobile},
 			#{registerIp},
 			#{avatar},
-			#{weixinOpenid})
+			#{weixinOpenid},
+			#{lastFaceTime})
 	</insert>
 
     <update id="update" parameterType="com.kmall.admin.entity.UserEntity">
@@ -137,6 +140,7 @@
             <if test="registerIp != null">`register_ip` = #{registerIp},</if>
             <if test="avatar != null">`avatar` = #{avatar},</if>
             <if test="weixinOpenid != null">`weixin_openid` = #{weixinOpenid}</if>
+            <if test="lastFaceTime != null">`last_face_time` = #{lastFaceTime}</if>
         </set>
         where id = #{id}
     </update>
@@ -152,4 +156,4 @@
         </foreach>
     </delete>
 
-</mapper>
+</mapper>

+ 17 - 10
kmall-admin/src/main/resources/mybatis/mapper/mk/store/StoreTopicDao.xml

@@ -45,16 +45,19 @@
 	</select>
 
 	<select id="queryList" resultType="com.kmall.admin.entity.mk.store.StoreTopicEntity">
-		select
+		SELECT
 		d.`id`,
 		d.`title`,
 		d.`content`,
 		d.`item_pic_url`,
 		d.`subtitle`,
 		d.`prom_type_id`,
+		pt.prom_type_name 'promTypeName',
 		d.`topic_price`,
 		d.`store_id`,
+		s.store_name 'storeName',
 		d.`third_merch_sn`,
+		t.third_party_merch_name 'thirdPartyMerchName',
 		d.`is_valid`,
 		d.`note`,
 		d.`creater_sn`,
@@ -62,7 +65,11 @@
 		d.`moder_sn`,
 		d.`mod_time`,
 		d.`tstm`
-		from mall_store_topic d left join third_merchant_biz t on d.third_merch_sn = t.third_merch_sn
+		FROM
+		mall_store_topic d
+		LEFT JOIN third_merchant_biz t ON d.third_merch_sn = t.third_merch_sn
+		LEFT JOIN mk_store_prom_type pt ON d.prom_type_id = pt.prom_type_id
+		left join mall_store s on d.store_id = s.id
 		WHERE 1=1
 		<if test="name != null and name.trim() != ''">
 			AND title LIKE concat('%',#{name},'%')
@@ -91,7 +98,7 @@
 			limit #{offset}, #{limit}
 		</if>
 	</select>
-	
+
  	<select id="queryTotal" resultType="int">
 		select count(*)
 		from mall_store_topic d left join third_merchant_biz t on d.third_merch_sn = t.third_merch_sn
@@ -112,7 +119,7 @@
 			AND t.third_party_merch_code = #{thirdPartyMerchCode}
 		</if>
 	</select>
-	 
+
 	<insert id="save" parameterType="com.kmall.admin.entity.mk.store.StoreTopicEntity" useGeneratedKeys="true" keyProperty="id">
 		insert into mall_store_topic(
 			`title`,
@@ -147,9 +154,9 @@
 			#{modTime},
 			#{tstm})
 	</insert>
-	 
+
 	<update id="update" parameterType="com.kmall.admin.entity.mk.store.StoreTopicEntity">
-		update mall_store_topic 
+		update mall_store_topic
 		<set>
 			<if test="title != null">`title` = #{title}, </if>
 			<if test="content != null">`content` = #{content}, </if>
@@ -169,16 +176,16 @@
 		</set>
 		where id = #{id}
 	</update>
-	
+
 	<delete id="delete">
 		delete from mall_store_topic where id = #{value}
 	</delete>
-	
+
 	<delete id="deleteBatch">
-		delete from mall_store_topic where id in 
+		delete from mall_store_topic where id in
 		<foreach item="id" collection="array" open="(" separator="," close=")">
 			#{id}
 		</foreach>
 	</delete>
 
-</mapper>
+</mapper>

+ 63 - 0
kmall-admin/src/main/webapp/WEB-INF/page/faceid/type10ordernopay.html

@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>人脸识别(保税展示跨境商品未支付订单)</title>
+    #parse("sys/header.html")
+</head>
+<body>
+<div id="rrapp" v-cloak>
+	<div v-show="showList == 0">
+        <Row :gutter="16">
+            <div class="search-group">
+                <i-col span="4">
+                    <i-input v-model="q.orderSn" @on-enter="query" placeholder="订单编号"/>
+                </i-col>
+                <i-button @click="query">查询</i-button>
+                <i-button @click="reloadSearch">重置</i-button>
+            </div>
+        </Row>
+	    <table id="jqGrid"></table>
+	    <div id="jqGridPager"></div>
+    </div>
+
+    <Card v-show="showList == 2">
+        <p slot="title">{{title}}</p>
+        <i-form ref="formValidate" :model="faceLivenessRecognition" :rules="ruleValidate" :label-width="80">
+            <Form-item label="身份证" prop="idCard">
+                <i-input type="text" v-model="faceLivenessRecognition.idCard" placeholder="身份证" disabled/>
+            </Form-item>
+            <Form-item label="姓名" prop="name">
+                <i-input type="text" v-model="faceLivenessRecognition.name" placeholder="姓名" disabled/>
+            </Form-item>
+            <Form-item label="录制视频" prop="videoUrl" >
+                <div style="width: 100% !important;">
+                    <video src="" width="480" height="320" style="width: 480px !important;height: 320px !important;float: left" controls id="video"></video>
+                    <p style="float: left;margin-left: 100px">视频录制成功预览:</p>
+                    <div id="outVideo-div" style="border: 1px solid #ccc;width: 480px !important;height: 320px !important;float: left"></div>
+                    <div style="border: 1px solid #ccc;width: 480px !important;height: 320px !important;">.</div>
+                </div>
+                <div style="width: 100% !important;">
+                    <!--                <i-button id="rec">开始录制</i-button>-->
+                    <!--                <i-button id="camera">拍照</i-button>-->
+                    <div id="commentDiv" style="width: 100%;height: 30px;color: red"></div>
+                    <div id="showtimes" style="width: 100%;height: 30px;color: red;font-weight: bolder;"></div>
+                    <div style="width: 100%;height: 30px;color: red;font-weight: bolder;">点击开始或重新开始录像按钮,自动录像3秒视频上传后台服务,点击提交按钮进行活体人脸识别核验,失败了则重新录像</div>
+                    <i-button id="startBtn">开始</i-button>
+<!--                    <i-button id="stopBtn">停止</i-button>-->
+                    <i-button id="ppBtn">重新开始录像</i-button>
+                </div>
+
+                <!--canvs绘制-->
+<!--                <canvas width="480" height="320" id="outrec"></canvas>-->
+                <!--base64绘制-->
+<!--                <img id="imgvideo" style="display:none;" width="640" height="480" src="" />-->
+            </Form-item>
+            <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
+            <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
+        </i-form>
+    </Card>
+</div>
+<script src="https://cdn.webrtc-experiment.com/MediaStreamRecorder.js"> </script>
+<script src="${rc.contextPath}/js/faceid/type10ordernopay.js?_${date.systemTime}"></script>
+</body>
+</html>

+ 11 - 2
kmall-admin/src/main/webapp/WEB-INF/page/shop/thirdmerchantbiz.html

@@ -100,7 +100,16 @@
                     </Radio>
                 </Radio-group>
             </Form-item>
-
+            <Form-item label="是否使用人脸核验" prop="isFaceCheck" v-show="isOperate">
+                <Radio-group v-model="thirdMerchantBiz.isFaceCheck">
+                    <Radio label="1">
+                        <span>是</span>
+                    </Radio>
+                    <Radio label="0">
+                        <span>否</span>
+                    </Radio>
+                </Radio-group>
+            </Form-item>
             <Form-item label="是否有效" prop="isValid">
                 <Radio-group v-model="thirdMerchantBiz.isValid">
                     <Radio label="1">
@@ -122,4 +131,4 @@
 
 <script src="${rc.contextPath}/js/shop/thirdmerchantbiz.js?_${date.systemTime}"></script>
 </body>
-</html>
+</html>

+ 11 - 1
kmall-admin/src/main/webapp/WEB-INF/page/sys/thirdmerchswitch.html

@@ -94,6 +94,16 @@
                     </Radio>
                 </Radio-group>
             </Form-item>
+            <Form-item label="是否使用人脸核验" prop="isFaceCheck">
+                <Radio-group v-model="thirdMerchantBiz.isFaceCheck">
+                    <Radio label="1">
+                        <span>是</span>
+                    </Radio>
+                    <Radio label="0">
+                        <span>否</span>
+                    </Radio>
+                </Radio-group>
+            </Form-item>
             <Form-item>
                 <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                 <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
@@ -105,4 +115,4 @@
 
 <script src="${rc.contextPath}/js/sys/thirdmerchswitch.js?_${date.systemTime}"></script>
 </body>
-</html>
+</html>

+ 476 - 0
kmall-admin/src/main/webapp/js/faceid/type10ordernopay.js

@@ -0,0 +1,476 @@
+$(function () {
+    let storeId = getQueryString("storeId");
+    let orderBizType = 10;
+    // let payStatus = '0';
+    // let orderStatus = '0';
+    let url = '../face/orderList?1';
+    if (storeId) {
+        url += '&storeId=' + storeId;
+    }
+    if (orderBizType) {
+        url += '&orderBizType=' + orderBizType;
+    }
+    // if (payStatus) {
+    //     url += '&payStatus=' + payStatus;
+    // }
+    // if (orderStatus) {
+    //     url += '&orderStatus=' + orderStatus;
+    // }
+    $("#jqGrid").jqGrid({
+        url: url,
+        datatype: "json",
+        colModel: [
+            {label: 'id', name: 'id', index: 'id', key: true, hidden: true},
+            {label: '所属门店', name: 'storeName', index: 'storeName',align: 'center', width: 70},
+            {label: '订单号', name: 'orderSn', index: 'order_sn', align: 'center',width: 110},
+            {label: '会员', name: 'userName', index: 'user_name', align: 'center',width: 60},
+            {label: '商户订单号', name: 'merchOrderSn', index: 'merchOrderSn',align: 'center', width: 110},
+            {
+                label: '订单业务类型', name: 'orderBizType', index: 'order_biz_type',align: 'center', width: 70,
+                formatter: function (value) {
+                    if (value == '00') {
+                        return '保税备货';
+                    } else if (value == '02') {
+                        return '保税展示补货';
+                    } else if (value == '10') {
+                        return '保税展示跨境';
+                    } else if (value == '11') {
+                        return '普通货物';
+                    }
+                    return '-';
+                }
+            },
+            {
+                label: '订单状态', name: 'orderStatus', index: 'order_status',align: 'center', width: 100,
+                formatter: function (value) {
+                    if (value == '0') {
+                        return '订单创建成功等待付款';
+                    } else if (value == '100') {
+                        return '订单付款中';
+                    } else if (value == '101') {
+                        return '订单已取消';
+                    } else if (value == '102') {
+                        return '订单已删除';
+                    } else if (value == '201') {
+                        return '订单已付款,等待发货';
+                    } else if (value == '300') {
+                        return '订单已发货';
+                    } else if (value == '301') {
+                        return '用户确认收货';
+                    } else if (value == '401') {
+                        return '没有发货,退款';
+                    } else if (value == '402') {
+                        return '已收货,退款退货';
+                    }
+                    return value;
+                }
+            },
+            // {
+            //     label: '订付人核验', name: 'buyerPayCheck', index: 'buyer_pay_check',align: 'center', width: 60,
+            //     formatter: function (value) {//订购人支付人校验,0:未知,1:一致,2:不一致,3:校验异常
+            //         if (value == '0') {
+            //             return '未知';
+            //         } else if (value == '1') {
+            //             return '一致';
+            //         } else if (value == '2') {
+            //             return '不一致';
+            //         }
+            //         return "-";
+            //     }
+            // },
+            {
+                label: '付款状态', name: 'payStatus', index: 'pay_status',align: 'center', width: 60,
+                formatter: function (value) {
+                    if (value == '0') {
+                        return '未付款';
+                    } else if (value == '1') {
+                        return '付款中';
+                    } else if (value == '2') {
+                        return '已付款';
+                    } else if (value == '3') {
+                        return '退款中';
+                    } else if (value == '4') {
+                        return '退款';
+                    }
+                    return value;
+                }
+            },
+            // {label: '实际支付', name: 'actualPrice', index: 'actual_price', align: 'center',width: 50},
+            {label: '订单总价', name: 'orderPrice', index: 'order_price', align: 'center',width: 50},
+            {
+                label: '下单时间', name: 'addTime', index: 'add_time',align: 'center', width: 95,
+                formatter: function (value) {
+                    return transDate(value, 'yyyy-MM-dd hh:mm:ss');
+                }
+            },
+            {label: '是否人脸认证', name: 'isFaceCheck', index: 'isFaceCheck', align: 'center',width: 65,
+                formatter: function (value) {
+                    if (value == '0') {
+                        return '否';
+                    } else if (value == '1') {
+                        return '是';
+                    }else{
+                        return '-';
+                    }
+                    return value;
+                }
+            },
+            {label: '是否模板通知', name: 'isTempNoti', index: 'isTempNoti', align: 'center',width: 65,
+                formatter: function (value) {
+                    if (value == '0') {
+                        return '否';
+                    } else if (value == '1') {
+                        return '是';
+                    }else{
+                        return '-';
+                    }
+                    return value;
+                }
+            },
+            {label: '人脸识别返回信息', name: 'recognitionReturnMsg', index: 'recognitionReturnMsg', align: 'center',width: 100},
+            {label: '模板通知返回信息', name: 'tempNotiMsg', index: 'tempNotiMsg', align: 'center',width: 100},
+            {
+                label: '操作', width: 140, align: 'center', sortable: false,
+                formatter: function (value, col, row) {
+                    let htmlStr = '';
+                    // if (hasPermission('face:checkLivenessRecognition')) {
+                    if((row.isFaceCheck==0 || row.isFaceCheck == null) && row.isDateLast=='true' && row.payStatus==0 && row.orderStatus==0){
+                        htmlStr +='<button class="btn btn-outline btn-danger" onclick="vm.startCheckFace(' +
+                            row.id + ','+row.userId+','+row.thirdIsFaceCheck+')">人脸识别</button>&nbsp;';
+                    }
+                    // }
+
+                    if((row.isFaceCheck==0 || row.isFaceCheck == null) && row.isDateLast=='false' && row.payStatus==0 && row.orderStatus==0){
+                        htmlStr +='<span style="color: red">该订单用户在\n'+row.addSecondTime+'时间前\n可不再进行人脸识别</span>';
+                    }
+                    if(row.isFaceCheck == 1 && row.isTempNoti == 0 && row.payStatus==0 && row.orderStatus==0){
+                        htmlStr +='<button class="btn btn-outline btn-danger" onclick="vm.sendWxTemp(' +
+                            row.id +','+row.thirdIsFaceCheck+')">发起微信待支付模板通知</button>&nbsp;';
+                    }
+                    return htmlStr==''?'-':htmlStr;
+                }
+            }],
+        viewrecords: true,
+        height: 645,
+        rowNum: 10,
+        rowList: [10, 30, 50],
+        rownumbers: true,
+        rownumWidth: 25,
+        autowidth: true,
+        multiselect: true,
+        pager: "#jqGridPager",
+        jsonReader: {
+            root: "page.list",
+            page: "page.currPage",
+            total: "page.totalPage",
+            records: "page.totalCount"
+        },
+        prmNames: {
+            page: "page",
+            rows: "limit",
+            order: "order"
+        },
+        gridComplete: function () {
+            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "hidden"});
+        }
+    });
+});
+
+var vm = new Vue({
+    el: '#rrapp',
+    data: {
+        showList: 0,
+        title: null,
+        faceLivenessRecognition: {},
+        ruleValidate: {
+            // approvalRemark: [
+            // {required: true, message: '审核备注不能为空', trigger: 'blur'}
+            // ]
+        },
+        q: {
+            orderSn: ''
+        },
+        video: null,
+        mediaStream: null
+    },
+    methods: {
+        query: function () {
+            vm.reload();
+        },
+        sendWxTemp: function(rowId,thirdIsFaceCheck){
+            if(thirdIsFaceCheck==1){
+                let url = '../face/sendWxTemp/';
+                confirm('是否确认发起微信待支付模板通知?', function () {
+                    $.get(url + rowId, function (r) {
+                        if (r.code === 0) {
+                            alert('操作成功', function (index) {
+                                vm.reload();
+                            });
+                        } else {
+                            alert(r.msg);
+                        }
+                    });
+                });
+            }else {
+                alert('请检查第三方商户需开放是否核验人脸开关');
+            }
+        },
+        startCheckFace: function(rowId,userId,thirdIsFaceCheck) {
+            if(thirdIsFaceCheck==1){
+                vm.showList = 2;
+                vm.title = "活体人脸核身";
+                $.get('../user/info/' + userId, function (r) {
+                    let userInfo = r.user;
+                    vm.faceLivenessRecognition = {
+                        idCard: userInfo.idNo,
+                        name: userInfo.username,
+                        // videoBase64: '1',
+                        orderId: rowId
+                    };
+                    vm.startVideo();
+                });
+            }else {
+                alert('请检查第三方商户需开放是否核验人脸开关');
+            }
+        },
+        startVideo: function(){
+            var that = this;
+            let lodingMsg = that.$Message.loading('视频加载中....', 6000);
+            $('#startBtn').attr('disabled', true);
+            $('#stopBtn').attr('disabled', true);
+            $('#ppBtn').attr('disabled', true);
+            $("#outVideo-div").html('');
+            //判断浏览器
+            navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
+            var constraints = { audio: true, video: { width: 480, height: 320 } };
+            var aa = '' ; //防止两次上传
+            //调用摄像头  成功后获取视频流:mediaStream
+            navigator.mediaDevices.getUserMedia(constraints)
+                .then(function(mediaStream) {
+                    vm.mediaStream = mediaStream;
+                    var video = document.querySelector('video');
+                    // 赋值 video 并开始播放
+                    video.srcObject = mediaStream;
+                    video.onloadedmetadata = function(e) {
+                        video.play();
+                        $('#startBtn').attr('disabled', false);
+                        setTimeout(lodingMsg, 0);
+                        that.$Message.loading('视频已加载成功', 0);
+                    };
+                    //录像api的调用
+                    var mediaRecorder = new MediaStreamRecorder(mediaStream);
+                    mediaRecorder.mimeType = 'video/webm';
+                    //  停止录像以后的回调函数
+                    mediaRecorder.ondataavailable = function (blob) {
+                        //  停止以后调用上传
+                        if(aa == ""){
+                            uploadToPHPServer(blob);
+                            aa = blob;
+                        }
+                    };
+                    $("#startBtn").click(function(){
+                        vm.showTime(4);
+                        $('#commentDiv').html('活体人脸识别音频开始录制...录制3秒后自动上传转为base64,录制倒计时:');
+                        $('#startBtn').attr('disabled',true);
+                        $('#ppBtn').attr('disabled',true);
+                        $('#stopBtn').attr('disabled',true);
+                        //开始录像
+                        mediaRecorder.start();
+                        setTimeout(function(){
+                            //停止录像
+                            mediaRecorder.stop();
+                        },4000);
+                    });
+                    //停止录像
+                    $("#stopBtn").click(function(){
+                        $('#commentDiv').html('');
+                        mediaRecorder.stop();
+                    });
+                    //重新开始录像
+                    $("#ppBtn").click(function(){
+                        if(aa !== ""){
+                            vm.showTime(4);
+                            $('#commentDiv').html('活体人脸识别音频开始录制...录制3秒后自动上传转为base64,录制倒计时:');
+                            // $('#startBtn').attr('disabled',false);
+                            $('#stopBtn').attr('disabled',true);
+                            $('#ppBtn').attr('disabled',true);
+                            aa = "";
+                            mediaRecorder.start();
+                            setTimeout(function(){
+                                //  4秒后停止录像
+                                mediaRecorder.stop();
+                            },4000);
+                        }
+                    });
+                    // 上传
+                    function uploadToPHPServer(blob) {
+                        var file = new File([blob], 'msr-' + (new Date).toISOString().replace(/:|\./g, '-') + '.webm', {
+                            type: 'video/webm'
+                        });
+                        var formData = new FormData();
+                        formData.append('videoFilename', file.name);
+                        formData.append('file', file);
+                        console.log(formData.get("file"));
+                        alert("录像结束",function () {
+                            $("#outVideo-div").html('');
+                            $.ajax({
+                                url:'../sys/oss/uploadAndBase64',
+                                dataType:'json',
+                                type:'POST',
+                                async: false,
+                                data: formData,
+                                processData : false, // 使数据不做处理
+                                contentType : false, // 不要设置Content-Type请求头
+                                success: function(data){
+                                    console.log(data);
+                                    if(data.code==0){
+                                        var objURL = vm.getObjectURL(formData.get("file"));//这里的objURL就是file的真实路径
+                                        // var src = data.url;
+                                        var video = '<video id="outVideo" controls="" autoplay="" name="media" style="width: 480px !important;height: 320px !important;">\n' +
+                                            '<source src=\"' + objURL +
+                                            '\"></video>';
+                                        $("#outVideo-div").html(video);
+
+                                        $('#ppBtn').attr('disabled', false);
+                                        $('#commentDiv').html('');
+
+                                        vm.faceLivenessRecognition.videoBase64 = data.base64EncoderImg;
+                                    }else{
+                                        alert(data.msg);
+                                        $('#ppBtn').attr('disabled', false);
+                                    }
+                                },
+                                error:function(response){
+                                    console.log(response);
+                                }
+                            });
+                        });
+                    }
+                    //  上传结束
+                }).catch(function(err) {
+                console.log(err.name + ": " + err.message);
+            });
+        },
+        getObjectURL:function(file) {
+            var url = null;
+            if (window.createObjcectURL != undefined) {
+                url = window.createOjcectURL(file);
+            } else if (window.URL != undefined) {
+                url = window.URL.createObjectURL(file);
+            } else if (window.webkitURL != undefined) {
+                url = window.webkitURL.createObjectURL(file);
+            }
+            return url;
+        },
+        // 计时开始
+        startTimer(){
+            let self = this;
+            this.si = setInterval(function () {
+                self.timer++;
+            }, 1000);
+        },
+        // 比赛结束,停止计时
+        stopTimer(){
+            let self = this;
+            clearInterval(self.si);
+        },
+        //显示倒数秒数
+        showTime(countdown){
+            let self = this;
+            self.isShareCount = true;
+            self.isShowBtn = false;
+            self.isShowFalseBtn = true;
+            document.getElementById('showtimes').innerHTML = countdown;
+            if (countdown == 0) {
+                self.isShareCount = false;
+                self.isShowTimer = true;
+                self.isShowFalseBtn = false;
+                document.getElementById('showtimes').innerHTML = "";
+                // 计时器开始计时
+                self.startTimer();
+            } else {
+                countdown -= 1;
+                setTimeout(function () {
+                    self.showTime(countdown);
+                }, 1000);
+            }
+        },
+        //访问用户媒体设备的兼容方法
+        getUserMedia: function(constraints, success, error) {
+            if (navigator.mediaDevices.getUserMedia) {
+                //最新的标准API
+                navigator.mediaDevices.getUserMedia(constraints).then(success).catch(error);
+            } else if (navigator.webkitGetUserMedia) {
+                //webkit核心浏览器
+                navigator.webkitGetUserMedia(constraints,success, error)
+            } else if (navigator.mozGetUserMedia) {
+                //firfox浏览器
+                navigator.mozGetUserMedia(constraints, success, error);
+            } else if (navigator.getUserMedia) {
+                //旧版API
+                navigator.getUserMedia(constraints, success, error);
+            }
+        },
+        videoSuccess: function(mediaStream) {
+            //兼容webkit核心浏览器
+            let CompatibleURL = window.URL || window.webkitURL;
+            try{
+                vm.video.src = CompatibleURL.createObjectURL(mediaStream);
+            }catch(e){
+                vm.video.srcObject = mediaStream;
+            }
+            vm.video.onloadedmetadata = function(e) {
+                vm.video.play();
+            };
+        },
+        videoError: function(error) {
+            console.log(`访问用户媒体设备失败${error.name}, ${error.message}`);
+            alert(`访问用户媒体设备失败${error.name}, ${error.message}`);
+        },
+        handleSubmit: function (name) {
+            handleSubmitValidate(this, name, function () {
+                vm.saveOrUpdate()
+            });
+        },
+        saveOrUpdate: function (event) {
+            let url = '../face/checkLivenessRecognition';
+            $.ajax({
+                type: "POST",
+                url: url,
+                contentType: "application/json",
+                data: JSON.stringify(vm.faceLivenessRecognition),
+                success: function (r) {
+                    if (r.code === 0) {
+                        alert(r.msg, function (index) {
+                            vm.reload();
+                        });
+                    } else {
+                        alert('活体人脸核身验证失败,失败原因:'+r.msg+';请重新录像!');
+                        $('#ppBtn').attr('disabled', false);
+                    }
+                }
+            });
+        },
+        reloadSearch: function() {
+            vm.q = {
+                orderSn: ''
+            }
+            vm.reload();
+        },
+        reload: function (event) {
+            if(vm.mediaStream){
+                vm.mediaStream.stop();
+            }
+            vm.showList = 0;
+            let page = $("#jqGrid").jqGrid('getGridParam', 'page');
+            $("#jqGrid").jqGrid('setGridParam', {
+                postData: {'orderSn': vm.q.orderSn},
+                page: page
+            }).trigger("reloadGrid");
+            vm.handleReset('formValidate');
+        },
+        handleReset: function (name) {
+            handleResetForm(this, name);
+        }
+    }
+});

+ 23 - 7
kmall-admin/src/main/webapp/js/mk/mkstorecampminus.js

@@ -63,7 +63,7 @@ $(function () {
             {label: '操作', width: 150, align: 'center', sortable: false,
                 formatter: function (value, col, row) {
                     let htmlStr = '';
-                    if ((row.isPast == '1' || row.isValid == 1) && row.applyType != '00') {//已结束
+                    if ((row.isPast == '1' || row.isValid == 1) && row.applyType != '00') {//已结束,适用类型不为全部商品
                         htmlStr = "<button class='btn btn-outline btn-primary' " +
                             "onclick='vm.showInfo(" + row.campMinusId + ")'>活动详情</button>&nbsp;&nbsp;&nbsp;&nbsp;" +
                             "<button class='btn btn-outline btn-primary' " +
@@ -71,7 +71,7 @@ $(function () {
                             "<button class='btn btn-outline btn-primary' " +
                             "onclick='vm.delById(" + row.campMinusId + ")'>删除活动</button>";
                     }
-                    if ((row.isPast == '0' && row.isValid == 0) && row.applyType != '00') {//进行中
+                    if ((row.isPast == '0' && row.isValid == 0) && row.applyType != '00') {//进行中,适用类型不为全部商品
                         htmlStr = "<button class='btn btn-outline btn-primary' " +
                             "onclick='vm.updateById(" + row.campMinusId + ")'>编辑活动</button>&nbsp;&nbsp;&nbsp;&nbsp;" +
                             "<button class='btn btn-outline btn-primary' " +
@@ -81,7 +81,7 @@ $(function () {
                             "<button class='btn btn-outline btn-primary' " +
                             "onclick='vm.putOn(" + row.campMinusId + ")'>投放</button>";
                     }
-                    if ((row.isPast == '2' && row.isValid == 0) && row.applyType != '00') {//未开始
+                    if ((row.isPast == '2' && row.isValid == 0) && row.applyType != '00') {//未开始,适用类型不为全部商品
                         htmlStr = "<button class='btn btn-outline btn-primary' " +
                             "onclick='vm.updateById(" + row.campMinusId + ")'>编辑活动</button>&nbsp;&nbsp;&nbsp;&nbsp;" +
                             "<button class='btn btn-outline btn-primary' " +
@@ -91,13 +91,13 @@ $(function () {
                             "<button class='btn btn-outline btn-primary' " +
                             "onclick='vm.putOn(" + row.campMinusId + ")'>投放</button>";
                     }
-                    if ((row.isPast == '1' || row.isValid == 1) && row.applyType == '00') {//已结束
+                    if ((row.isPast == '1' || row.isValid == 1) && row.applyType == '00') {//已结束,适用类型是00全部商品
                         htmlStr = "<button class='btn btn-outline btn-primary' " +
                             "onclick='vm.showInfo(" + row.campMinusId + ")'>活动详情</button>&nbsp;&nbsp;&nbsp;&nbsp;" +
                             "<button class='btn btn-outline btn-primary' " +
                             "onclick='vm.delById(" + row.campMinusId + ")'>删除活动</button>";
                     }
-                    if ((row.isPast == '0' && row.isValid == 0) && row.applyType == '00') {//进行中
+                    if ((row.isPast == '0' && row.isValid == 0) && row.applyType == '00') {//进行中,适用类型是00全部商品
                         htmlStr = "<button class='btn btn-outline btn-primary' " +
                             "onclick='vm.updateById(" + row.campMinusId + ")'>编辑活动</button>&nbsp;&nbsp;&nbsp;&nbsp;" +
                             "<button class='btn btn-outline btn-primary' " +
@@ -105,7 +105,7 @@ $(function () {
                             "<button class='btn btn-outline btn-primary' " +
                             "onclick='vm.putOn(" + row.campMinusId + ")'>投放</button>";
                     }
-                    if ((row.isPast == '2' && row.isValid == 0) && row.applyType == '00') {//未开始
+                    if ((row.isPast == '2' && row.isValid == 0) && row.applyType == '00') {//未开始,适用类型是00全部商品
                         htmlStr = "<button class='btn btn-outline btn-primary' " +
                             "onclick='vm.updateById(" + row.campMinusId + ")'>编辑活动</button>&nbsp;&nbsp;&nbsp;&nbsp;" +
                             "<button class='btn btn-outline btn-primary' " +
@@ -1193,6 +1193,16 @@ let vm = new Vue({
                     $("#"+(index+'unit')).html('');
                     vm.isValidationByUnit = true;
                 }
+
+                if (vm.minusTypeUnitAttrList[index].yuanMinusCond>=vm.minusTypeUnitAttrList[index].yuanMinusPref) {
+                    $("#"+(index+'unit')).html('');
+                    $("#"+(index+'unit_pref')).html('');
+                    vm.isValidationByUnit = true;
+                }else{
+                    $("#"+(index+'unit')).html('* 不能小于满元减优惠'+vm.minusTypeUnitAttrList[index].yuanMinusPref);
+                    vm.isValidationByUnit = false;
+                    return;
+                }
             }
             if(minusTypeUnitAttrList[0].yuanMinusCond != null){
                 for (var i = 0; i < minusTypeUnitAttrList.length; i++) {
@@ -1293,7 +1303,13 @@ let vm = new Vue({
                 }else if (vm.minusTypeUnitAttrList[index].yuanMinusPref<= 0) {
                     $("#"+(index+'unit_pref')).html('* 不能小于等于0');
                     vm.isValidationByUnit = false;
+                }else if (vm.minusTypeUnitAttrList[index].yuanMinusPref>vm.minusTypeUnitAttrList[index].yuanMinusCond) {
+                    $("#"+(index+'unit_pref')).html('* 不能大于满元减条件'+vm.minusTypeUnitAttrList[index].yuanMinusCond);
+                    vm.isValidationByUnit = false;
                 }else{
+                    if(vm.minusTypeUnitAttrList[index].yuanMinusPref<vm.minusTypeUnitAttrList[index].yuanMinusCond){
+                        $("#"+(index+'unit')).html('');
+                    }
                     $("#"+(index+'unit_pref')).html('');
                     vm.isValidationByUnit = true;
                 }
@@ -1772,4 +1788,4 @@ let vm = new Vue({
         });
 
     }
-});
+});

+ 4 - 4
kmall-admin/src/main/webapp/js/mk/storetopic.js

@@ -8,11 +8,11 @@ $(function () {
 			{label: '活动内容', name: 'content', index: 'content', width: 80},
 			// {label: '活动图片', name: 'itemPicUrl', index: 'item_pic_url', width: 80},
 			{label: '子标题', name: 'subtitle', index: 'subtitle', width: 80},
-			{label: '活动类别', name: 'promTypeId', index: 'prom_type_id', width: 80},
+			{label: '活动类别名称', name: 'promTypeName', index: 'prom_type_id', width: 80},
 			// {label: '活动价格', name: 'priceInfo', index: 'price_info', width: 80},
 			// {label: '场景图片链接', name: 'scenePicUrl', index: 'scene_pic_url', width: 80},
-			{label: '门店id', name: 'storeId', index: 'store_id', width: 80},
-			{label: '第三方商户id', name: 'thirdMerchSn', index: 'third_merch_sn', width: 80},
+			{label: '门店名称', name: 'storeName', index: 'store_id', width: 80},
+			{label: '第三方商户名称', name: 'thirdPartyMerchName', index: 'third_merch_sn', width: 80},
             {label: '是否有效', name: 'isValid', index: 'is_valid', width: 50, align: 'center',
                 formatter: function (value) {
                     if (value == '0') {
@@ -165,4 +165,4 @@ let vm = new Vue({
             handleResetForm(this, name);
         }
 	}
-});
+});

+ 3 - 3
kmall-admin/src/main/webapp/js/shop/thirdmerchantbiz.js

@@ -91,7 +91,7 @@ let vm = new Vue({
 	data: {
         showList: true,
         title: null,
-		thirdMerchantBiz: {isValid: '', isStockShare:'',isStoreUserShare:'',isMapShow:''},
+		thirdMerchantBiz: {isValid: '', isStockShare:'',isStoreUserShare:'',isMapShow:'',isDistSellStart:'',isSupplierGoods:'',isFaceCheck:''},
 		ruleValidate: {
 			name: [
 				{required: true, message: '名称不能为空', trigger: 'blur'}
@@ -111,7 +111,7 @@ let vm = new Vue({
 			vm.showList = false;
 			vm.title = "新增";
             vm.getMerchList();
-			vm.thirdMerchantBiz = {isValid: 0,isStockShare:0,isStoreUserShare:0,isMapShow:0,isDistSellStart:0,isSupplierGoods:0};
+			vm.thirdMerchantBiz = {isValid: 0,isStockShare:0,isStoreUserShare:0,isMapShow:0,isDistSellStart:0,isSupplierGoods:0,isFaceCheck:0};
 			vm.isOperate = true;
 		},
 		update: function (event) {
@@ -222,4 +222,4 @@ let vm = new Vue({
             handleResetForm(this, name);
         }
 	}
-});
+});

+ 12 - 3
kmall-admin/src/main/webapp/js/sys/thirdmerchswitch.js

@@ -52,6 +52,15 @@ $(function () {
                     }
                     return '';
                 }},
+            {label: '是否使用人脸核验', name: 'isFaceCheck', index: 'isFaceCheck', width: 80, align: 'center',
+                formatter: function (value) {
+                    if (value == '0') {
+                        return '禁用';
+                    } else if (value == '1') {
+                        return '启用';
+                    }
+                    return '';
+                }},
 			{label: '是否有效', name: 'isValid', index: 'is_valid', width: 80, align: 'center',
                 formatter: function (value) {
                     if (value == '0') {
@@ -92,7 +101,7 @@ let vm = new Vue({
 	data: {
         showList: true,
         title: null,
-		thirdMerchantBiz: {isValid: '', isStockShare:'',isStoreUserShare:'',isMapShow:''},
+		thirdMerchantBiz: {isValid: '', isStockShare:'',isStoreUserShare:'',isMapShow:'',isDistSellStart:'',isSupplierGoods:'',isFaceCheck:''},
 		ruleValidate: {
 			name: [
 				{required: true, message: '名称不能为空', trigger: 'blur'}
@@ -112,7 +121,7 @@ let vm = new Vue({
 			vm.showList = false;
 			vm.title = "新增";
             vm.getMerchList();
-			vm.thirdMerchantBiz = {isValid: 0,isStockShare:0,isStoreUserShare:0,isMapShow:0,isDistSellStart:0};
+			vm.thirdMerchantBiz = {isValid: 0,isStockShare:0,isStoreUserShare:0,isMapShow:0,isDistSellStart:0,isFaceCheck:0};
 			vm.isOperate = true;
 		},
 		update: function (event) {
@@ -207,4 +216,4 @@ let vm = new Vue({
             handleResetForm(this, name);
         }
 	}
-});
+});

+ 2 - 2
kmall-api/src/main/java/com/kmall/api/api/ApiAddressController.java

@@ -177,7 +177,7 @@ public class ApiAddressController extends ApiBaseAction {
         Long storeId = jsonParam.getLong("storeId");
         AddressVo addressVo = jsonParam.getObject("checkedAddress", AddressVo.class);
         if (null == addressVo || null == addressVo.getLatitude() || null == addressVo.getLongitude()) {
-            return toResponsFail("当前地址距离门店过远,无法配送,抱歉!");
+            return toResponsFail("当前地址经纬度不能为空!");
         }
         StoreVo storeVo = apiStoreService.queryObject(storeId);
         if (null == storeVo || null == storeVo.getLatitude() || null == storeVo.getLongitude()) {
@@ -192,4 +192,4 @@ public class ApiAddressController extends ApiBaseAction {
         storeVo.setDistance(new BigDecimal(distance));
         return toResponsSuccess(storeVo);
     }
-}
+}

+ 58 - 37
kmall-api/src/main/java/com/kmall/api/api/ApiAuthController.java

@@ -132,7 +132,7 @@ public class ApiAuthController extends ApiBaseAction {
     }
 
     /**
-     * 授权登录保存token到redis
+     * 保存token到redis,授权登录或未登录保存token
      * @param request
      * @return
      */
@@ -153,40 +153,45 @@ public class ApiAuthController extends ApiBaseAction {
 //            return toResponsFail("登录失败");
 //        }
         String code = "";
+        UserVo userVo = null;
+        String openId = "";
         if (!StringUtils.isNullOrEmpty(jsonParam.getString("code"))) {
             code = jsonParam.getString("code");
-        }
-        //获取openid
-        String requestUrl = ApiUserUtils.getWebAccess(code);//通过自定义工具类组合出小程序需要的登录凭证 code
-        logger.info("》》》组合token为:" + requestUrl);
-        JSONObject sessionData = CommonUtil.httpsRequest(requestUrl, "GET", null);
-        logger.info("》》》sessionData为:" + sessionData);
+            //获取openid
+            String requestUrl = ApiUserUtils.getWebAccess(code);//通过自定义工具类组合出小程序需要的登录凭证 code
+            logger.info("》》》组合token为:" + requestUrl);
+            JSONObject sessionData = CommonUtil.httpsRequest(requestUrl, "GET", null);
+            logger.info("》》》sessionData为:" + sessionData);
 
-        if (null == sessionData) {
-            return toResponsFail("登录失败");
-        }
-        String openId = sessionData.getString("openid");
-        if (StringUtils.isNullOrEmpty(openId)) {
-            return toResponsFail("登录失败");
-        }
-        UserVo userVo = userService.queryByOpenId(openId);
-        if (null == userVo) {
-            userVo = new UserVo();
-            userVo.setPassword(openId);
-            userVo.setRegister_time(new Date());
-            userVo.setRegister_ip(this.getClientIp());
-            userVo.setLast_login_ip(userVo.getRegister_ip());
-            userVo.setLast_login_time(userVo.getRegister_time());
-            userVo.setWeixin_openid(sessionData.getString("openid"));
-            if(userInfo != null){
-                userVo.setAvatar(userInfo.getAvatarUrl());
-                userVo.setGender(userInfo.getGender()); // //性别 0:未知、1:男、2:女
-                userVo.setNickname(filterEmoji(userInfo.getNickName()));
+            if (null == sessionData) {
+                return toResponsFail("登录失败");
             }
-            userVo.setUser_level_id(1);
-            userService.save(userVo);
-
-        } else {
+            openId = sessionData.getString("openid");
+            if (StringUtils.isNullOrEmpty(openId)) {
+                return toResponsFail("登录失败");
+            }
+            userVo = userService.queryByOpenId(openId);
+            if (null == userVo) {
+                userVo = new UserVo();
+                if(!StringUtils.isNullOrEmpty(openId)){
+                    userVo.setPassword(openId);
+                    userVo.setWeixin_openid(openId);
+                }
+                userVo.setRegister_time(new Date());
+                userVo.setRegister_ip(this.getClientIp());
+                userVo.setLast_login_ip(userVo.getRegister_ip());
+                userVo.setLast_login_time(userVo.getRegister_time());
+                if(userInfo != null){
+                    userVo.setAvatar(userInfo.getAvatarUrl());
+                    userVo.setGender(userInfo.getGender()); // //性别 0:未知、1:男、2:女
+                    userVo.setNickname(filterEmoji(userInfo.getNickName()));
+                }
+                userVo.setUser_level_id(1);
+                userService.save(userVo);
+            }
+        }
+        Long userId = null;
+        if(userVo != null) {
             userVo.setLast_login_ip(this.getClientIp());
             userVo.setLast_login_time(new Date());
             if(userInfo != null){
@@ -195,11 +200,12 @@ public class ApiAuthController extends ApiBaseAction {
                 userVo.setNickname(filterEmoji(userInfo.getNickName()));
             }
             userService.update(userVo);
+            userId = userVo.getId();
+            if(userId != null){
+                isRefusedLogin = "false";
+            }
         }
-        if(userVo.getId()!=null){
-            isRefusedLogin = "false";
-        }
-        Map<String, Object> tokenMap = tokenService.createAndUpdateToken(userVo.getWeixin_openid(), storeId,userVo.getId(),merchSn, isRefusedLogin);
+        Map<String, Object> tokenMap = tokenService.createAndUpdateToken(openId, storeId, userId ,merchSn, isRefusedLogin);
         String token = MapUtils.getString(tokenMap, "token");
 
         if (StringUtils.isNullOrEmpty(token)) {
@@ -208,7 +214,7 @@ public class ApiAuthController extends ApiBaseAction {
 
         resultObj.put("token", token);
         resultObj.put("userInfo", userInfo);
-        resultObj.put("userId", userVo.getId());
+        resultObj.put("userId", userId);
         return toResponsSuccess(resultObj);
     }
 
@@ -223,8 +229,23 @@ public class ApiAuthController extends ApiBaseAction {
         Map<String, Object> resultObj = Maps.newHashMap();
         JSONObject jsonParam = this.getJsonRequest();
         String token = (String)jsonParam.get("token");
+        String isRefusedLogin = (String)jsonParam.get("isRefusedLogin");
+        String userId = (String)jsonParam.get("userId");
+        Integer storeId = (Integer)jsonParam.get("storeId");
         //查询token信息
-        TokenEntity tokenEntity = UserTokenCache.getUserInfoByToken(token);
+        TokenEntity tokenEntity = null;
+        if(!StringUtils.isNullOrEmpty(userId) && (isRefusedLogin==null||!isRefusedLogin.equalsIgnoreCase("true"))) {
+            tokenEntity = UserTokenCache.getUserInfoByToken(token);
+        }
+        if(token != null && !StringUtils.isNullOrEmpty(userId) && (isRefusedLogin==null ||
+                !isRefusedLogin.equalsIgnoreCase("true"))) {
+            tokenEntity = UserTokenCache.getUserInfoByToken(token);
+        }
+        if(isRefusedLogin!=null){
+            if(storeId != null && isRefusedLogin.equalsIgnoreCase("true")){
+                tokenEntity = UserTokenCache.getStoreByTokenByRefused(token);
+            }
+        }
         if ((tokenEntity == null || tokenEntity.getExpireTime().getTime() < System.currentTimeMillis())) {
             logger.info("已授权,且token不为空,根据token查询token信息为空,校验token失效");//生成一个token
             throw new ApiRRException("token失效", 401);

+ 1 - 2
kmall-api/src/main/java/com/kmall/api/api/ApiCartController.java

@@ -549,7 +549,6 @@ public class ApiCartController extends ApiBaseAction {
         Integer number = jsonParam.getInteger("number");
         Integer id = jsonParam.getInteger("id");
         String checkCart = jsonParam.getString("checkCart");
-        boolean isAdd = true;
         GoodsVo goodsInfo = goodsService.queryObjectByStoreId(Long.valueOf(goodsId), storeId);
         if (null == goodsInfo || goodsInfo.getIs_delete() == 1 || goodsInfo.getIs_on_sale() == 0) {
             return toResponsFail("商品已下架");
@@ -798,4 +797,4 @@ public class ApiCartController extends ApiBaseAction {
         }
     }
 
-}
+}

+ 4 - 4
kmall-api/src/main/java/com/kmall/api/api/ApiCommentController.java

@@ -49,8 +49,8 @@ public class ApiCommentController extends ApiBaseAction {
         Integer typeId = jsonParam.getInteger("typeId");
         Long orderId = jsonParam.getLong("orderId");
         Long insertId = commentService.save(jsonParam, loginUser.getId());
-        // 是否领取优惠券
-        if (null != insertId && insertId > 0 && typeId == 0) {
+        // 是否领取发表评论优惠券,暂时无用
+        /*if (null != insertId && insertId > 0 && typeId == 0) {
             // 当前是否评价过
             Map param = Maps.newHashMap();
             param.put("user_id", loginUser.getId());
@@ -65,7 +65,7 @@ public class ApiCommentController extends ApiBaseAction {
                     resultObj.put("coupon", userCouponVo);
                 }
             }
-        }
+        }*/
         if (null != insertId && insertId > 0) {
             return toResponsObject(0, "评论添加成功", resultObj);
         } else {
@@ -145,4 +145,4 @@ public class ApiCommentController extends ApiBaseAction {
         }
         return toResponsSuccess(pageUtil);
     }
-}
+}

+ 15 - 23
kmall-api/src/main/java/com/kmall/api/api/ApiCouponController.java

@@ -54,7 +54,7 @@ public class ApiCouponController extends ApiBaseAction {
      *
      * @return
      */
-    @GetMapping("enableActivity")
+   /* @GetMapping("enableActivity")
     public Object enableActivity() {
         Map resultObj = Maps.newHashMap();
         Map param = Maps.newHashMap();
@@ -100,7 +100,7 @@ public class ApiCouponController extends ApiBaseAction {
 //            return toResponsSuccess(resultObj);
 //        }
         return toResponsSuccess(resultObj);
-    }
+    }*/
 
     /**
      * 获取优惠券列表
@@ -271,10 +271,11 @@ public class ApiCouponController extends ApiBaseAction {
         }*/
         return toResponsSuccess(null);
     }
+
     /**
-     *  校验是否领取
+     *  校验是否领新用户注册优惠券,暂时无用(没有注册用户优惠券)
      */
-    @GetMapping("checkActivit")
+    /*@GetMapping("checkActivit")
     public Object checkActivit(@LoginUser UserVo loginUser) {
         // 是否领取过了
         Map params = Maps.newHashMap();
@@ -286,41 +287,32 @@ public class ApiCouponController extends ApiBaseAction {
         }
 
         return toResponsSuccess(couponVos);
-    }
+    }*/
 
     /**
      * 转发,(领取红包,暂时无用)
      */
-    @GetMapping("transActivit")
+    /*@GetMapping("transActivit")
     public Object transActivit(@LoginUser UserVo loginUser, String sourceKey, Long referrer) {
         // 是否领取过了
         Map params = Maps.newHashMap();
         params.put("user_id", loginUser.getId());
-        params.put("send_type", 2);
         params.put("source_key", sourceKey);
-        List<CouponVo> couponVos = apiCouponService.queryUserCoupons(params);
+        //查询已领取的转发优惠券
+        List<UserCouponVo> couponVos = apiUserCouponService.queryUserCoupons(params);
         if (null != couponVos && couponVos.size() > 0) {
             return toResponsObject(2, "已经领取过", couponVos);
-        }
-        // 领取
-        Map couponParam = Maps.newHashMap();
-        couponParam.put("send_type", CouponTypeEnum.COUPONTYPE2.getIndex());
-        CouponVo newCouponConfig = apiCouponService.queryMaxUserEnableCoupon(couponParam);
-        if (null != newCouponConfig) {
-            UserCouponVo userCouponVo = apiCouponService.takeCoupon(newCouponConfig, loginUser.getId(), sourceKey, referrer, 1);
-            List<UserCouponVo> userCouponVos = new ArrayList();
-            userCouponVos.add(userCouponVo);
-            //
+        }else{
+            JSONObject jsonParam = getJsonRequest();
+            apiUserCouponService.getUserCoupon(jsonParam, loginUser);
+            //查询已领取的转发优惠券
             params = Maps.newHashMap();
             params.put("user_id", loginUser.getId());
-            params.put("send_type", 2);
             params.put("source_key", sourceKey);
-            couponVos = apiCouponService.queryUserCoupons(params);
+            couponVos = apiUserCouponService.queryUserCoupons(params);
             return toResponsSuccess(couponVos);
-        } else {
-            return toResponsFail("领取失败");
         }
-    }
+    }*/
 
     /**
      * 用户领取优惠券

+ 2 - 2
kmall-api/src/main/java/com/kmall/api/api/ApiFeedbackController.java

@@ -25,7 +25,7 @@ public class ApiFeedbackController extends ApiBaseAction {
     private ApiFeedbackService feedbackService;
 
     /**
-     * 添加或更新收货地址
+     * 添加用户反馈数据
      */
     @PostMapping("save")
     public Object save(@LoginUser UserVo loginUser) {
@@ -38,4 +38,4 @@ public class ApiFeedbackController extends ApiBaseAction {
         feedbackService.save(feedback);
         return toResponsSuccess("感谢你的反馈");
     }
-}
+}

+ 2 - 2
kmall-api/src/main/java/com/kmall/api/api/ApiGoodsController.java

@@ -355,7 +355,7 @@ public class ApiGoodsController extends ApiBaseAction {
         CategoryVo rootCategory = new CategoryVo();
         rootCategory.setId(0);
         rootCategory.setName("全部");
-        rootCategory.setChecked(false);
+        rootCategory.setChecked(true);
         filterCategory.add(rootCategory);
         //
         params.put("fields", "psr1.category_id");
@@ -649,4 +649,4 @@ public class ApiGoodsController extends ApiBaseAction {
         return toResponsSuccess(reusltObj);
     }
 
-}
+}

+ 10 - 10
kmall-api/src/main/java/com/kmall/api/api/ApiIndexController.java

@@ -40,18 +40,18 @@ public class ApiIndexController extends ApiBaseAction {
     private ApiAdService apiAdService;
     @Autowired
     private ApiChannelService channelService;
-    @Autowired
-    private ApiGoodsService goodsService;
-    @Autowired
-    private ApiCartService cartService;
+//    @Autowired
+//    private ApiGoodsService goodsService;
+//    @Autowired
+//    private ApiCartService cartService;
     @Autowired
     private ApiOrderService apiOrderService;
     @Autowired
     private ApiUserService apiUserService;
-    @Autowired
-    private ApiThirdMerchantBizService apiThirdMerchantBizService;
-    @Autowired
-    private ApiStoreService apiStoreService;
+//    @Autowired
+//    private ApiThirdMerchantBizService apiThirdMerchantBizService;
+//    @Autowired
+//    private ApiStoreService apiStoreService;
 
     /**
      * app首页
@@ -92,7 +92,7 @@ public class ApiIndexController extends ApiBaseAction {
     }
 
     /**
-     * 个人中心主页,是否是骑手
+     * 个人中心主页
      */
     @GetMapping("ucenterIndex")
     public Object ucenterIndex() {
@@ -143,4 +143,4 @@ public class ApiIndexController extends ApiBaseAction {
 
     }
 
-}
+}

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

@@ -289,4 +289,18 @@ public class ApiUserController extends ApiBaseAction {
 //        Map<String, Object> tokenMap = tokenService.createAndUpdateToken(userVo.getWeixin_openid(), storeId, getUserId(), merchSn, "false");
         return toResponsSuccess("注册成功");
     }
+
+    /**
+     * 根据用户id判断上次活体人脸核身时间是否在可调用范围内(待小程序开放人脸识别类目)
+     * @param loginUser
+     * @return
+     */
+    @PostMapping("checkFaceTimeByUserId")
+    public Object checkFaceTimeByUserId(@LoginUser UserVo loginUser) {
+        JSONObject jsonParam = getJsonRequest();
+        Long userId = jsonParam.getLong("userId");
+        Long storeId = jsonParam.getLong("storeId");
+        Boolean isCheck = userService.checkFaceTimeByUserId(userId,storeId);
+        return toResponsSuccess(isCheck);
+    }
 }

+ 57 - 0
kmall-api/src/main/java/com/kmall/api/api/faceid/ApiFaceIdController.java

@@ -0,0 +1,57 @@
+package com.kmall.api.api.faceid;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Maps;
+import com.kmall.api.annotation.LoginUser;
+import com.kmall.manager.dto.FaceIdRequestDto;
+import com.kmall.api.entity.UserVo;
+import com.kmall.api.service.faceid.ApiFaceIdService;
+import com.kmall.api.util.ApiBaseAction;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+/**
+ * @author huangyq
+ * @version 1.0
+ * 2019-11-21 15:52
+ */
+@RestController
+@RequestMapping("/api/face")
+public class ApiFaceIdController extends ApiBaseAction {
+    @Autowired
+    private ApiFaceIdService apiFaceIdService;
+
+    /**
+     * 活体人脸核身接口(待小程序开放人脸识别类目)
+     */
+    @PostMapping("checkLivenessRecognition")
+    public Object checkLivenessRecognition(@LoginUser UserVo loginUser) {
+        JSONObject json = this.getJsonRequest();
+        FaceIdRequestDto faceIdRequestDto = new FaceIdRequestDto();
+        faceIdRequestDto.setIdCard(json.getString("idCard"));
+        faceIdRequestDto.setName(json.getString("name"));
+        faceIdRequestDto.setVideoBase64(json.getString("videoBase64"));
+        faceIdRequestDto.setLivenessType(json.getString("livenessType"));
+        faceIdRequestDto.setValidateData(json.getString("validateData"));
+        faceIdRequestDto.setMerchId(json.getString("merchId"));
+        Long storeId = json.getLong("storeId");
+        String msg = apiFaceIdService.checkLivenessRecognition(faceIdRequestDto, storeId, getUserId());
+        return toResponsSuccess(msg);
+    }
+
+    /**
+     * 根据订单号获取是否人脸认证成功
+     * @param loginUser
+     * @param orderIds
+     * @return 1:认证成功,2:没有保税展示跨境订单,0/null:未认证
+     */
+    @GetMapping("getIsFaceCheckByOrderId")
+    public Object getIsFaceCheckByOrderId(@LoginUser UserVo loginUser, Long[] orderIds) {
+        String isFaceCheck = apiFaceIdService.getFaceDataByOrderId(orderIds);
+        Map resultObj = Maps.newHashMap();
+        resultObj.put("isFaceCheck", isFaceCheck);
+        return toResponsSuccess(resultObj);
+    }
+}

+ 3 - 2
kmall-api/src/main/java/com/kmall/api/api/pingan/ApiPayPinganController.java

@@ -165,7 +165,7 @@ public class ApiPayPinganController extends ApiBaseAction {
             System.out.println("返回字符串=" + rspStr);
 
             //解析数据,处理数据
-            return analysisResponse(rspStr, merchOrderSn, orderVoList);
+            return analysisResponse(rspStr, merchOrderSn, orderVoList,processRecordEntityList);
 
         } catch (Exception e) {
             e.printStackTrace();
@@ -194,7 +194,7 @@ public class ApiPayPinganController extends ApiBaseAction {
      * @param rspStr
      * @return
      */
-    private Object analysisResponse(String rspStr, String merchOrderSn, List<OrderVo> orderVoList) throws Exception {
+    private Object analysisResponse(String rspStr, String merchOrderSn, List<OrderVo> orderVoList,List<OrderProcessRecordEntity> processRecordEntityList) throws Exception {
         JSONObject respObject = JSONObject.fromObject(rspStr);
         logger.info("返回错误码:【" + MapUtils.getString("errcode", respObject) + "】");
         logger.info("返回错误提示【" + MapUtils.getString("msg", respObject) + "】");
@@ -257,6 +257,7 @@ public class ApiPayPinganController extends ApiBaseAction {
                             }
                         }
                         orderService.updateBatch(orderVoList);
+                        orderProcessRecordService.updateBatch(processRecordEntityList);//更新订单流转信息
 
                         Map<String, Object> payParam = new HashMap<>();
                         payParam.put("timeStamp", MapUtils.getString("timeStamp", dataObject));

+ 39 - 0
kmall-api/src/main/java/com/kmall/api/api/quotalInquiry/CrossBoundaryQueryController.java

@@ -0,0 +1,39 @@
+package com.kmall.api.api.quotalInquiry;
+
+import com.alibaba.fastjson.JSONObject;
+import com.kmall.api.annotation.LoginUser;
+import com.kmall.api.entity.UserVo;
+import com.kmall.api.service.quotalInquiry.ApiQuotalInquiryService;
+import com.kmall.api.util.ApiBaseAction;
+import com.kmall.manager.dto.CrossBoundaryQuotalDto;
+import com.kmall.manager.dto.CrossQuotalInquiryResponseDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 跨境额度查询
+ * @author huangyq
+ * @version 1.0
+ * 2019-12-17 15:35
+ */
+@RestController
+@RequestMapping("/api/quotalInquiry")
+public class CrossBoundaryQueryController extends ApiBaseAction {
+    @Autowired
+    private ApiQuotalInquiryService apiQuotalInquiryService;
+
+    @PostMapping("getCrossBoundaryQuotaQuery")
+    public Object getCrossBoundaryQuotaQuery(@LoginUser UserVo loginUser) {
+        JSONObject json = this.getJsonRequest();
+        CrossBoundaryQuotalDto crossBoundaryQuotalDto = new CrossBoundaryQuotalDto();
+        crossBoundaryQuotalDto.setIdCard(json.getString("idCard"));
+        crossBoundaryQuotalDto.setName(json.getString("name"));
+        crossBoundaryQuotalDto.setMerchId(json.getString("merchId"));
+        Long storeId = json.getLong("storeId");
+        CrossQuotalInquiryResponseDto crossQuotalInquiryResponseDto = apiQuotalInquiryService.
+                getCrossBoundaryQuotaQuery(crossBoundaryQuotalDto, storeId, getUserId());
+        return toResponsSuccess(crossQuotalInquiryResponseDto);
+    }
+}

+ 25 - 1
kmall-api/src/main/java/com/kmall/api/api/wxGlobal/ApiWxGlobalPayController.java

@@ -3,6 +3,8 @@ package com.kmall.api.api.wxGlobal;
 import com.google.common.collect.Maps;
 import com.kmall.api.annotation.IgnoreAuth;
 import com.kmall.api.annotation.LoginUser;
+import com.kmall.api.entity.cus.pay.data.open.CusPayDataOpenVo;
+import com.kmall.api.service.cus.pay.data.open.ApiCusPayDataOpenService;
 import com.kmall.manager.manager.wechat.AESUtil;
 import com.kmall.manager.manager.wechat.WechatGlobalUtil;
 import com.kmall.manager.manager.wechat.WechatUtil;
@@ -56,6 +58,8 @@ public class ApiWxGlobalPayController extends ApiBaseAction {
     private ApiOrderProcessRecordService orderProcessRecordService;
     @Autowired
     private ApiOrderExceptionRecordService apiOrderExceptionRecordService;
+    @Autowired
+    private ApiCusPayDataOpenService cusPayDataOpenService;
 
     /**
      * 发起支付
@@ -137,6 +141,26 @@ public class ApiWxGlobalPayController extends ApiBaseAction {
                     addOrderExceptionRecord(orderVoList, Dict.exceptionStatus.item_00.getItem(),"支付失败 ," +err_code_des);//记录订单异常信息
                     return toResponsFail("支付失败 ," + err_code_des);
                 } else if (result_code.equalsIgnoreCase(WechatGlobalUtil.WXTradeState.SUCCESS.getCode())) {
+                    // 添加信息
+                    for (OrderVo orderInfo: orderVoList) {
+                        if(!orderInfo.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_11.getItem())) {
+                            CusPayDataOpenVo cusPayDataOpen = cusPayDataOpenService.queryObjectByOrderNo(orderInfo.getOrder_sn());
+                            if (cusPayDataOpen == null) {
+                                cusPayDataOpen = new CusPayDataOpenVo();
+                                cusPayDataOpen.setMerchOrderSn(merchOrderSn);
+                                cusPayDataOpen.setOrderNo(orderInfo.getOrder_sn());
+                                cusPayDataOpen.setInitalRequest(queryApiResult.getXml());
+                                cusPayDataOpen.setCreateTime(new Date());
+                                cusPayDataOpen.setModTime(new Date());
+                                cusPayDataOpenService.save(cusPayDataOpen);
+                            } else {
+                                cusPayDataOpen.setMerchOrderSn(merchOrderSn);
+                                cusPayDataOpen.setInitalRequest(queryApiResult.getXml());
+                                cusPayDataOpen.setModTime(new Date());
+                                cusPayDataOpenService.update(cusPayDataOpen);
+                            }
+                        }
+                    }
                     apiWxGlobalPayService.payPrepay(resultObj, queryApiResult, nonceStr, orderVoList);
                     orderProcessRecordService.updateBatch(processRecordEntityList);//更新订单流转信息
                     return toResponsObject(0, "微信统一订单下单成功", resultObj);
@@ -280,4 +304,4 @@ public class ApiWxGlobalPayController extends ApiBaseAction {
     public static String setXml(String return_code, String return_msg) {
         return "<xml><return_code><![CDATA[" + return_code + "]]></return_code><return_msg><![CDATA[" + return_msg + "]]></return_msg></xml>";
     }
-}
+}

+ 1 - 8
kmall-api/src/main/java/com/kmall/api/dao/ApiCouponMapper.java

@@ -14,16 +14,9 @@ import java.util.Map;
  */
 @Component
 public interface ApiCouponMapper extends BaseDao<CouponVo> {
-    /**
-     * 按条件查询用户优惠券
-     *
-     * @param params
-     * @return
-     */
-    List<CouponVo> queryUserCoupons(Map<String, Object> params);
 
     /**
-     * 按类型查询
+     * 按类型查询,放弃表
      *
      * @param params
      * @return

+ 16 - 0
kmall-api/src/main/java/com/kmall/api/dao/ApiFaceLivenessRecognitionReturnDataMapper.java

@@ -0,0 +1,16 @@
+package com.kmall.api.dao;
+
+import com.kmall.api.entity.FaceLivenessRecognitionReturnDataVo;
+import com.kmall.manager.dao.BaseDao;
+
+/**
+ * 验证活体人脸核身接口返回的数据记录Dao
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2019-11-27 13:33:46
+ */
+public interface ApiFaceLivenessRecognitionReturnDataMapper extends BaseDao<FaceLivenessRecognitionReturnDataVo> {
+    FaceLivenessRecognitionReturnDataVo getFaceByOrderSn(String orderSn);
+
+}

+ 13 - 0
kmall-api/src/main/java/com/kmall/api/dao/ApiSysConfigMapper.java

@@ -0,0 +1,13 @@
+package com.kmall.api.dao;
+
+import com.kmall.api.entity.AddressVo;
+import com.kmall.api.entity.SysParam;
+import com.kmall.manager.dao.BaseDao;
+
+public interface ApiSysConfigMapper {
+
+    /**
+     * 根据key,查询value
+     */
+    String queryByKey(String paramKey);
+}

+ 7 - 0
kmall-api/src/main/java/com/kmall/api/dao/ApiUserCouponMapper.java

@@ -16,6 +16,13 @@ import java.util.Map;
 @Component
 public interface ApiUserCouponMapper extends BaseDao<UserCouponVo> {
     UserCouponVo queryByCouponNumber(@Param("coupon_number") String coupon_number);
+    /**
+     * 按条件查询用户优惠券
+     *
+     * @param params
+     * @return
+     */
+    List<UserCouponVo> queryUserCoupons(Map<String, Object> params);
 
     UserCouponVo queryByOrderId(@Param("order_id") Long order_id);
 

+ 2 - 0
kmall-api/src/main/java/com/kmall/api/dao/mk/ApiMkStorePromMapper.java

@@ -12,6 +12,8 @@ import org.apache.ibatis.annotations.Param;
  * @date 2019-04-26 15:52:20
  */
 public interface ApiMkStorePromMapper extends BaseDao<MkStorePromVo> {
+
     MkStorePromVo queryObjectByName(@Param("promName") String promName);
+
     MkStorePromVo queryObjectByGoodsIdAndStoreId(@Param("goodsId") Integer goodsId, @Param("storeId") Integer storeId);
 }

+ 205 - 0
kmall-api/src/main/java/com/kmall/api/entity/FaceLivenessRecognitionReturnDataVo.java

@@ -0,0 +1,205 @@
+package com.kmall.api.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 验证活体人脸核身接口返回的数据记录实体
+ * 表名 face_liveness_recognition_return_data
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2019-11-27 13:33:46
+ */
+public class FaceLivenessRecognitionReturnDataVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Integer id;
+    /**
+     * 商户订单编号
+     */
+    private String merchOrderSn;
+    /**
+     * 模板是否通知 0:否 1:是;
+     */
+    private String isTempNoti;
+    /**
+     * 人脸核身是否核验成功0:否,1:是
+     */
+    private String isFaceCheck;
+    /**
+     * 用户id
+     */
+    private Integer userId;
+    /**
+     * 模板通知失败原因
+     */
+    private String tempNotiMsg;
+    /**
+     * 创建人编号
+     */
+    private String createrSn;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    /**
+     * 修改人编号
+     */
+    private String moderSn;
+    /**
+     * 修改时间
+     */
+    private Date modTime;
+    /**
+     * 时间戳
+     */
+    private Date tstm;
+
+    /**
+     * 设置:主键
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * 获取:主键
+     */
+    public Integer getId() {
+        return id;
+    }
+    /**
+     * 设置:商户订单编号
+     */
+    public void setMerchOrderSn(String merchOrderSn) {
+        this.merchOrderSn = merchOrderSn;
+    }
+
+    /**
+     * 获取:商户订单编号
+     */
+    public String getMerchOrderSn() {
+        return merchOrderSn;
+    }
+    /**
+     * 设置:模板是否通知 0:否 1:是;
+     */
+    public void setIsTempNoti(String isTempNoti) {
+        this.isTempNoti = isTempNoti;
+    }
+
+    /**
+     * 获取:模板是否通知 0:否 1:是;
+     */
+    public String getIsTempNoti() {
+        return isTempNoti;
+    }
+    /**
+     * 设置:人脸核身是否核验成功0:否,1:是
+     */
+    public void setIsFaceCheck(String isFaceCheck) {
+        this.isFaceCheck = isFaceCheck;
+    }
+
+    /**
+     * 获取:人脸核身是否核验成功0:否,1:是
+     */
+    public String getIsFaceCheck() {
+        return isFaceCheck;
+    }
+    /**
+     * 设置:用户id
+     */
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    /**
+     * 获取:用户id
+     */
+    public Integer getUserId() {
+        return userId;
+    }
+    /**
+     * 设置:模板通知失败原因
+     */
+    public void setTempNotiMsg(String tempNotiMsg) {
+        this.tempNotiMsg = tempNotiMsg;
+    }
+
+    /**
+     * 获取:模板通知失败原因
+     */
+    public String getTempNotiMsg() {
+        return tempNotiMsg;
+    }
+    /**
+     * 设置:创建人编号
+     */
+    public void setCreaterSn(String createrSn) {
+        this.createrSn = createrSn;
+    }
+
+    /**
+     * 获取:创建人编号
+     */
+    public String getCreaterSn() {
+        return createrSn;
+    }
+    /**
+     * 设置:创建时间
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * 获取:创建时间
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+    /**
+     * 设置:修改人编号
+     */
+    public void setModerSn(String moderSn) {
+        this.moderSn = moderSn;
+    }
+
+    /**
+     * 获取:修改人编号
+     */
+    public String getModerSn() {
+        return moderSn;
+    }
+    /**
+     * 设置:修改时间
+     */
+    public void setModTime(Date modTime) {
+        this.modTime = modTime;
+    }
+
+    /**
+     * 获取:修改时间
+     */
+    public Date getModTime() {
+        return modTime;
+    }
+    /**
+     * 设置:时间戳
+     */
+    public void setTstm(Date tstm) {
+        this.tstm = tstm;
+    }
+
+    /**
+     * 获取:时间戳
+     */
+    public Date getTstm() {
+        return tstm;
+    }
+}

+ 11 - 1
kmall-api/src/main/java/com/kmall/api/entity/ThirdMerchantBizVo.java

@@ -47,7 +47,7 @@ public class ThirdMerchantBizVo implements Serializable {
      */
     private Date createTime;
     /**
-     * 
+     *
      */
     private String moderSn;
     /**
@@ -63,6 +63,16 @@ public class ThirdMerchantBizVo implements Serializable {
 
     private String isLoadGoods;
 
+    private String isFaceCheck;
+
+    public String getIsFaceCheck() {
+        return isFaceCheck;
+    }
+
+    public void setIsFaceCheck(String isFaceCheck) {
+        this.isFaceCheck = isFaceCheck;
+    }
+
     public String getIsLoadGoods() {
         return isLoadGoods;
     }

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

@@ -59,6 +59,8 @@ public class UserVo implements Serializable {
 
     private String merchSn;
 
+    private String lastFaceTime;//最后活体人脸核身时间
+
     public Long getStoreId() {
         return storeId;
     }
@@ -242,4 +244,12 @@ public class UserVo implements Serializable {
     public void setWeixin_openid(String weixin_openid) {
         this.weixin_openid = weixin_openid;
     }
+
+    public String getLastFaceTime() {
+        return lastFaceTime;
+    }
+
+    public void setLastFaceTime(String lastFaceTime) {
+        this.lastFaceTime = lastFaceTime;
+    }
 }

+ 2 - 0
kmall-api/src/main/java/com/kmall/api/service/ApiCartService.java

@@ -567,11 +567,13 @@ public class ApiCartService {
         BigDecimal actualPrice10 = goodsTotalPrice10;
         BigDecimal actualPrice11 = goodsTotalPrice11;
 
+        //根据购物车的商品list、实付金额、满减满折id、购物车商品满足可用的满减满折券list、加载状态,获取当前页面该选中的满减满折券信息
         Map campMinusMap00 = checkedCampMinus(campList00, checkedGoodsList, actualPrice00, campId00, isLoadStatus);
         Map campMinusMap02 = checkedCampMinus(campList02, checkedGoodsList, actualPrice02, campId02, isLoadStatus);
         Map campMinusMap10 = checkedCampMinus(campList10, checkedGoodsList, actualPrice10, campId10, isLoadStatus);
         Map campMinusMap11 = checkedCampMinus(campList11, checkedGoodsList, actualPrice11, campId11, isLoadStatus);
 
+        //根据购物车的商品list、实付金额、优惠券id、购物车商品满足可用的优惠券list、加载状态,获取当前页面该选中的优惠券信息
         Map couponMap00 = checkedCoupon(couponList00, checkedGoodsList, tickDiscId00, campMinusMap00, isLoadStatus);
         Map couponMap02 = checkedCoupon(couponList02, checkedGoodsList, tickDiscId02, campMinusMap02, isLoadStatus);
         Map couponMap10 = checkedCoupon(couponList10, checkedGoodsList, tickDiscId10, campMinusMap10, isLoadStatus);

+ 11 - 65
kmall-api/src/main/java/com/kmall/api/service/ApiCouponService.java

@@ -26,73 +26,16 @@ public class ApiCouponService {
     @Autowired
     private ApiCouponMapper apiCouponMapper;
     @Autowired
-    private ApiUserCouponMapper apiUserCouponMapper;
-    @Autowired
     private ApiMkStoreTicketDiscountMapper mkStoreTicketDiscountMapper;
 
-    public CouponVo queryObject(Long couponId) {
-        return apiCouponMapper.queryObject(couponId);
-    }
-
-    public List<CouponVo> queryList(Map<String, Object> map) {
-        return apiCouponMapper.queryList(map);
-    }
-
-    public int queryTotal(Map<String, Object> map) {
-        return apiCouponMapper.queryTotal(map);
-    }
-
-
-    public void save(CouponVo userVo) {
-        apiCouponMapper.save(userVo);
-    }
-
-    public void update(CouponVo user) {
-        apiCouponMapper.update(user);
-    }
-
-    public void delete(Long userId) {
-        apiCouponMapper.delete(userId);
-    }
-
-    public void deleteBatch(Long[] userIds) {
-        apiCouponMapper.deleteBatch(userIds);
-    }
-
-    public List<CouponVo> queryUserCoupons(Map<String, Object> map) {
-        return apiCouponMapper.queryUserCoupons(map);
-    }
-
-    public CouponVo queryMaxUserEnableCoupon(Map<String, Object> map) {
-        return apiCouponMapper.queryMaxUserEnableCoupon(map);
-    }
-
-    public UserCouponVo takeCoupon(CouponVo couponVo, Long userId, String source_key, Long referrer, Integer show_state) {
-        UserCouponVo userCouponVo = new UserCouponVo();
-        userCouponVo.setAddTime(new Date());
-//        userCouponVo.setCoupon_id(couponVo.getId());
-        userCouponVo.setCouponNumber(CharUtil.getRandomString(12));
-        userCouponVo.setUserId(userId);
-        userCouponVo.setReferrer(referrer);
-        userCouponVo.setSourceKey(source_key);
-        userCouponVo.setShowState(show_state);
-        userCouponVo.setSendType(couponVo.getSend_type());
-        userCouponVo.setTypeMoney(couponVo.getType_money());
-        userCouponVo.setCouponName(couponVo.getName());
-//        userCouponVo.setMin_goods_amount(couponVo.getMin_goods_amount());
-        userCouponVo.setEndTime(couponVo.getUse_end_date());
-        userCouponVo.setIsUsed(Dict.isUsed.item_0.getItem());
-        apiUserCouponMapper.save(userCouponVo);
-        return userCouponVo;
-    }
-
     /**
-     * 获取优惠信息提示 邮费
+     * 获取优惠信息提示邮费 还差多少邮费
      *
      * @param userId
      * @param goodsTotalPrice
      * @return
      */
+    /*
     public CouponVo matchShippingSign(Long userId, BigDecimal goodsTotalPrice) {
         CouponVo result = new CouponVo();
         //
@@ -142,7 +85,7 @@ public class ApiCouponService {
             }
         }
         return result;
-    }
+    }*/
 
     /**
      * 获取可使用的优惠 邮费
@@ -151,6 +94,7 @@ public class ApiCouponService {
      * @param goodsTotalPrice
      * @return
      */
+    /*
     public BigDecimal matchShipping(Long userId, BigDecimal goodsTotalPrice) {
         BigDecimal result = new BigDecimal(10);
         //
@@ -169,15 +113,16 @@ public class ApiCouponService {
             }
         }
         return result;
-    }
+    }*/
 
     /**
-     * 获取可用的 满减券
+     * 获取可用的满减券
      *
      * @param userId
      * @param goodsTotalPrice
      * @return
      */
+    /*
     public CouponVo matchFullSub(Long userId, BigDecimal goodsTotalPrice) {
         CouponVo result = new CouponVo();
         //
@@ -205,15 +150,16 @@ public class ApiCouponService {
             }
         }
         return result;
-    }
+    }*/
 
     /**
-     * 获取优惠信息提示 满减券
+     * 获取优惠信息提示满减券 还差多少满减
      *
      * @param userId
      * @param goodsTotalPrice
      * @return
-     *//*
+     */
+    /*
     public CouponVo matchFullSubSign(Long userId, BigDecimal goodsTotalPrice, long storeId) {
         CouponVo result = new CouponVo();
         //

+ 29 - 26
kmall-api/src/main/java/com/kmall/api/service/ApiGoodsService.java

@@ -110,7 +110,7 @@ public class ApiGoodsService {
     public Integer selectCountByCatalogProductList(Map<String, Object> map){
         return goodsDao.selectCountByCatalogProductList(map);
     }
-    
+
     public Map detail(GoodsVo info, GoodsDetailDto detailDto){
         Long userId = detailDto.getUserId();
         Long referrer = detailDto.getReferrer();
@@ -118,7 +118,7 @@ public class ApiGoodsService {
         Long storeId = detailDto.getStoreId();
         Integer promId = detailDto.getPromId();
         Long id = detailDto.getId();
-        
+
         Map<String, Object> resultObj = Maps.newHashMap();
         BrandVo brand = apiBrandService.queryObject(info.getBrand_id());
         resultObj.put("brand", brand);
@@ -143,6 +143,7 @@ public class ApiGoodsService {
         //商品问答
         Map issueParam = Maps.newHashMap();
         issueParam.put("merch_sn", merchSn);
+        issueParam.put("store_id", storeId);
         List<GoodsIssueVo> issue = goodsIssueService.queryList(issueParam);
         //商品评论
         param.put("value_id", id);
@@ -173,30 +174,33 @@ public class ApiGoodsService {
         if (userHasCollect > 0) {
             userHasCollect = 1;
         }
-        //记录用户的足迹
-        FootprintVo footprintEntity = new FootprintVo();
-        footprintEntity.setAdd_time(System.currentTimeMillis() / 1000);
-        footprintEntity.setGoods_brief(info.getGoods_brief());
-        footprintEntity.setList_pic_url(info.getList_pic_url());
-        footprintEntity.setGoods_id(id);
-        footprintEntity.setName(info.getName());
-        footprintEntity.setRetail_price(info.getRetail_price());
-        footprintEntity.setUser_id(userId);
-        if (null != referrer) {
-            footprintEntity.setReferrer(referrer);
-        } else {
-            footprintEntity.setReferrer(0L);
-        }
-        footprintService.save(footprintEntity);
+        if(userId!=null) {
+            //记录用户的足迹
+            FootprintVo footprintEntity = new FootprintVo();
+            footprintEntity.setAdd_time(System.currentTimeMillis() / 1000);
+            footprintEntity.setGoods_brief(info.getGoods_brief());
+            footprintEntity.setList_pic_url(info.getList_pic_url());
+            footprintEntity.setGoods_id(id);
+            footprintEntity.setName(info.getName());
+            footprintEntity.setRetail_price(info.getRetail_price());
+            footprintEntity.setUser_id(userId);
+            if (null != referrer) {
+                footprintEntity.setReferrer(referrer);
+            } else {
+                footprintEntity.setReferrer(0L);
+            }
+            footprintService.save(footprintEntity);
 
-        String isStockShare = StockUtil.getIsStockShareByGoodsVo(info);
-        Map cartMap= Maps.newHashMap();
-        cartMap.put("user_id",userId);
-        cartMap.put("goods_id",id);
-        cartMap.put("store_id", storeId);
-        cartMap.put("isStockShare", isStockShare);
-        cartMap.put("goodsBizType", info.getGoodsBizType());
-        List<CartVo> cartVoList = cartService.queryList(cartMap);
+            String isStockShare = StockUtil.getIsStockShareByGoodsVo(info);
+            Map cartMap = Maps.newHashMap();
+            cartMap.put("user_id", userId);
+            cartMap.put("goods_id", id);
+            cartMap.put("store_id", storeId);
+            cartMap.put("isStockShare", isStockShare);
+            cartMap.put("goodsBizType", info.getGoodsBizType());
+            List<CartVo> cartVoList = cartService.queryList(cartMap);
+            resultObj.put("cartNumber", cartVoList.size() != 0 ? cartVoList.get(0).getNumber():0);
+        }
 
         FreightEntity freightEntity = apiFreightService.queryObjectByGoodsId(id, storeId);
 
@@ -254,7 +258,6 @@ public class ApiGoodsService {
         resultObj.put("specificationList", specificationList);
         resultObj.put("productList", productEntityList);
         resultObj.put("stockNum", stockNum);
-        resultObj.put("cartNumber", cartVoList.size() != 0 ? cartVoList.get(0).getNumber():0);
         resultObj.put("defaultFreight", freightEntity != null? freightEntity.getDefaultFreight() :0);
         return resultObj;
     }

+ 49 - 15
kmall-api/src/main/java/com/kmall/api/service/ApiOrderService.java

@@ -90,6 +90,8 @@ public class ApiOrderService {
     private ApiMkStoreCampMinusMapper apiMkStoreCampMinusMapper;
     @Autowired
     private ApiUserCampMinusMapper apiUserCampMinusMapper;
+    @Autowired
+    private ApiFaceLivenessRecognitionReturnDataMapper apiFaceLivenessRecognitionReturnDataMapper;
 
     public OrderVo queryObject(Long id) {
         return apiOrderMapper.queryObject(id);
@@ -294,17 +296,20 @@ public class ApiOrderService {
                 resultObj.put("errmsg", "该身份证信息已被绑定");
                 return resultObj;
             }
-        }
-        // 实名认证身份证信息,认证成功更新到用户表
-        String result = IdCardUtil.checkIdCard(userVo.getIdNo(), userVo.getUsername());
-        IdCardMsgVo vo = JSON.parseObject(result,IdCardMsgVo.class);
-        if(vo.getRespCode().equalsIgnoreCase("0000")){
+            //已被当前用户绑定过,且没被占用的身份证信息不需要再次实名认证
             apiUserMapper.update(userVo);
         }else{
-            logger.info(vo.getRespMessage());
-            resultObj.put("errno", 400);
-            resultObj.put("errmsg", vo.getRespMessage());
-            return resultObj;
+            //如没被任何人绑定过,新用户绑定则进行实名认证身份证信息,认证成功更新到用户表
+            String result = IdCardUtil.checkIdCard(userVo.getIdNo(), userVo.getUsername());
+            IdCardMsgVo vo = JSON.parseObject(result,IdCardMsgVo.class);
+            if(vo.getRespCode().equalsIgnoreCase("0000")){
+                apiUserMapper.update(userVo);
+            }else{
+                logger.info(vo.getRespMessage());
+                resultObj.put("errno", 400);
+                resultObj.put("errmsg", vo.getRespMessage());
+                return resultObj;
+            }
         }
         CheckOutDto checkOutDto = new CheckOutDto();
         checkOutDto.setCheckCart(checkCart);
@@ -409,6 +414,7 @@ public class ApiOrderService {
 
         //开启事务,插入订单信息和订单商品
         if(orderInfoList != null && orderInfoList.size() > 0) {
+            Boolean isOrderBizType10 = false;//订单中是否有保税展示跨境商品
             apiOrderMapper.saveBatch(orderInfoList);
 
             List<OrderProcessRecordEntity> processRecordEntityList = new ArrayList<>();
@@ -421,6 +427,9 @@ public class ApiOrderService {
                 for (CartVo goodsItem : checkedGoodsList) {
                     //统计商品总价
                     if (orderInfo.getOrderBizType().equalsIgnoreCase(goodsItem.getGoodsBizType())) {
+                        if(Dict.orderBizType.item_10.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
+                            isOrderBizType10 = true;//订单中是否有保税展示跨境商品
+                        }
                         GoodsVo goodsVo = apiGoodsMapper.queryObjectByStoreId(goodsItem.getGoods_id(), storeId);
                         if (goodsVo == null) {
                             logger.error("订单提交失败:商品不存在");
@@ -430,11 +439,12 @@ public class ApiOrderService {
                         apiOrderGoodsMapper.save(orderGoodsVo);
                         //购物车id为空,则提交订单是从商品详情页立即购买过来的
                         if(goodsItem.getId() == null){
+                            //获取渠道信息
                             MkStorePromVo mkStorePromVo = apiMkStorePromMapper.queryObjectByGoodsIdAndStoreId(Integer.parseInt(String.valueOf(goodsItem.getGoods_id())),
                                     Integer.parseInt(String.valueOf(storeId)));
                             if(mkStorePromVo != null){
                                 MkStorePromStatVo statVo = apiMkStorePromStatService.queryObjectByPromId(mkStorePromVo.getPromId());
-                                if(statVo != null){
+                                if(statVo != null){//更新渠道追踪统计下单量数据
                                     apiMkStorePromStatService.updateStorePromStat(orderGoodsVo, orderInfo, loginUser, statVo);
                                 }
                             }
@@ -479,11 +489,20 @@ public class ApiOrderService {
                 orderVo.setMerchOrderSn(merchOrderSn);
                 apiOrderMapper.updateOrderByMerchOrderSn(orderVo);
             }
+            // formIds保存
+            formIdsService.save(loginUser.getId(), formId, 1, merchOrderSn);
+
+            //保税展示跨境商品保存是否核验信息
+            if(isOrderBizType10) {
+                saveFaceData(merchOrderSn, userVo);
+            }
+
             resultObj.put("errno", 0);
             resultObj.put("errmsg", "订单提交成功");
             //
             Map orderInfoMap = Maps.newHashMap();
             orderInfoMap.put("orderInfo", orderInfoList);
+            orderInfoMap.put("isOrderBizType10", isOrderBizType10);
             resultObj.put("data", orderInfoMap);
 
             // 优惠券标记已用,或促销满减活动保存已用
@@ -510,6 +529,20 @@ public class ApiOrderService {
     }
 
     /**
+     * 保税展示跨境商品保存是否核验信息
+     * @param merchOrderSn
+     * @param userVo
+     */
+    private void saveFaceData(String merchOrderSn, UserVo userVo){
+        FaceLivenessRecognitionReturnDataVo face = new FaceLivenessRecognitionReturnDataVo();
+        face.setMerchOrderSn(merchOrderSn);
+        face.setUserId(Integer.parseInt(String.valueOf(userVo.getId())));
+        face.setIsFaceCheck("0");
+        face.setIsTempNoti("0");
+        apiFaceLivenessRecognitionReturnDataMapper.save(face);
+    }
+
+    /**
      * 标记优惠券使用的订单id
      * @param orderInfo
      */
@@ -602,7 +635,7 @@ public class ApiOrderService {
         productInfo.setSell_volume(productInfo.getSell_volume() + goodsItem.getNumber());
         productInfo.setGoods_id(goodsVo.getId());
         apiProductMapper.updateStockNum(productInfo);
-        
+
         StoreMngChangeVo storeMngChangeVo = new StoreMngChangeVo();
         storeMngChangeVo.setChangeType(Dict.changeType.item_1.getItem());
         storeMngChangeVo.setChangeReason("小程序购买商品");
@@ -677,7 +710,7 @@ public class ApiOrderService {
                             updateStock(productInfo, goodsInfo, stockNum, goodsItem, storeId, userName);//扣减门店库存
                         }
                     }
-                    //该商品所属第三方商户为共享库存,且是保税备货商品,下单时改变
+                    //该商品所属第三方商户为共享库存,且是保税备货商品,下单时改变,定时任务触发
                     updateGoodsByIsShareStock(isStockShare, goodsInfo);
                 }
             }
@@ -1002,13 +1035,13 @@ public class ApiOrderService {
 
         BigDecimal number = new BigDecimal(Long.valueOf(goodsItem.getNumber()));
         BigDecimal goodsTotal = goodsItem.getRetail_price().multiply(number);//单商品总价
-        BigDecimal rate = goodsTotal.divide(orderInfo.getGoods_price(),2, BigDecimal.ROUND_HALF_UP);//商品总价/订单总价(不含运费、不含优惠券)
+        BigDecimal rate = goodsTotal.divide(orderInfo.getGoods_price(),2, BigDecimal.ROUND_HALF_UP);//当前商品总价/订单总价(不含运费、不含优惠券)
         BigDecimal freightPrice = BigDecimal.valueOf(orderInfo.getFreight_price());
         BigDecimal settlePrice = Constant.ZERO;
         if(orderInfo.getFreight_price() != 0 && !"0".equalsIgnoreCase(orderInfo.getCoupon_price()+"")){
             //运费-优惠券
             BigDecimal rateTotal = freightPrice.subtract(orderInfo.getCoupon_price());
-            //商品结算平摊价格(含优惠券、运费金额) = 单商品总价 + 商品总价/订单总价(不含运费、不含优惠券) * 运费与优惠券合计税率
+            //商品结算平摊价格(含优惠券、运费金额) = 单商品总价 + 当前商品总价/订单总价(不含运费、不含优惠券) * 运费与优惠券合计税率
             settlePrice = goodsTotal.add(rate.multiply(rateTotal));
         }else{
             if(orderInfo.getFreight_price()!=0){
@@ -1038,6 +1071,7 @@ public class ApiOrderService {
     @Transactional
     public void notifyPaySuccess(OrderVo orderInfo) {
         WxTemplate tem = new WxTemplate();
+        //查询formid,发送支付成功通知,暂无开放
         FormIdsEntity formIdsEntity = formIdsService.getFormIdsByMerchOrderSn(orderInfo.getMerchOrderSn());
         if (null == formIdsEntity || !StringUtils.isNotEmpty(formIdsEntity.getFormId())) {
             return;
@@ -1136,7 +1170,7 @@ public class ApiOrderService {
         }*/
         try {
 //            WxTemplateUtil.sendMessage(tem);
-            formIdsService.releaseFormIds(formIdsEntity);
+//            formIdsService.releaseFormIds(formIdsEntity);
         } catch (Exception e) {
             e.printStackTrace();
         }

+ 28 - 12
kmall-api/src/main/java/com/kmall/api/service/ApiPayService.java

@@ -93,17 +93,19 @@ public class ApiPayService {
                     payerChildOrderRealService.update(entity);
                 }
             }
-            FormIdsEntity formIdsEntity = formIdsService.getFormIdsByMerchOrderSn(orderInfo.getMerchOrderSn());
-            if(formIdsEntity== null){
-                // 保存form_id
-                formIdsService.save(orderInfo.getUser_id(), prepay_id, 1, orderInfo.getMerchOrderSn());
-            }else{
-                FormIdsEntity formIds = new FormIdsEntity();
-                formIds.setMerchOrderSn(orderInfo.getMerchOrderSn());
-                formIds.setFormId(prepay_id);
-                formIds.setId(formIdsEntity.getId());
-                formIds.setValidNum(formIdsEntity.getValidNum()+1);
-                formIdsService.releaseFormIds(formIds);
+            if(orderInfo.getPay_status() == Integer.parseInt(Dict.payStatus.item_2.getItem())) {
+                FormIdsEntity formIdsEntity = formIdsService.getFormIdsByMerchOrderSn(orderInfo.getMerchOrderSn());
+                if (formIdsEntity == null) {
+                    // 保存form_id
+                    formIdsService.save(orderInfo.getUser_id(), prepay_id, 1, orderInfo.getMerchOrderSn());
+                } else {
+                    FormIdsEntity formIds = new FormIdsEntity();
+                    formIds.setMerchOrderSn(orderInfo.getMerchOrderSn());
+                    formIds.setFormId(prepay_id);
+                    formIds.setId(formIdsEntity.getId());
+                    formIds.setValidNum(formIdsEntity.getValidNum() + 1);
+                    formIdsService.releaseFormIds(formIds);
+                }
             }
         }
     }
@@ -178,13 +180,27 @@ public class ApiPayService {
                     // 微信支付成功通知
                     orderService.notifyPaySuccess(orderInfo);
 
-                   /* // 打印机打印 todo 后台打印小票
+                   /* // 打印机打印 todo 后台打印小票,后期需要可放开注释
                     try {
                         orderService.printMsg(orderInfo.getId());
                     } catch (Exception e) {
                         logger.error("打印机打印异常【" + e.getMessage() + "】");
                     }*/
                 }
+                if(orderInfo.getPay_status() == Integer.parseInt(Dict.payStatus.item_2.getItem())) {
+                    FormIdsEntity formIdsEntity = formIdsService.getFormIdsByMerchOrderSn(orderInfo.getMerchOrderSn());
+                    if (formIdsEntity == null) {
+                        // 保存form_id
+                        formIdsService.save(orderInfo.getUser_id(), orderInfo.getPay_id(), 1, orderInfo.getMerchOrderSn());
+                    } else {
+                        FormIdsEntity formIds = new FormIdsEntity();
+                        formIds.setMerchOrderSn(orderInfo.getMerchOrderSn());
+                        formIds.setFormId(orderInfo.getPay_id());
+                        formIds.setId(formIdsEntity.getId());
+                        formIds.setValidNum(formIdsEntity.getValidNum() + 1);
+                        formIdsService.releaseFormIds(formIds);
+                    }
+                }
 
                 if(!orderInfo.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_11.getItem())) {
                     CusPayDataOpenVo cusPayDataOpen = cusPayDataOpenMapper.queryObjectByOrderNo(orderInfo.getOrder_sn());

+ 7 - 7
kmall-api/src/main/java/com/kmall/api/service/ApiUserCouponService.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.google.common.collect.Maps;
 import com.kmall.api.dto.UserCouponDto;
 import com.kmall.api.entity.CartVo;
+import com.kmall.api.entity.CouponVo;
 import com.kmall.api.entity.UserVo;
 import com.kmall.api.entity.mk.MkStoreTicketDiscountVo;
 import com.kmall.api.service.mk.ApiMkStoreTicketDiscountService;
@@ -11,10 +12,7 @@ import com.kmall.api.service.mk.ApiMkStoreTopicStatService;
 import com.kmall.common.constant.Dict;
 import com.kmall.api.dao.ApiUserCouponMapper;
 import com.kmall.api.entity.UserCouponVo;
-import com.kmall.common.utils.Constant;
-import com.kmall.common.utils.DateUtils;
-import com.kmall.common.utils.MapUtils;
-import com.kmall.common.utils.RRException;
+import com.kmall.common.utils.*;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -69,6 +67,9 @@ public class ApiUserCouponService {
         userCouponDao.deleteBatch(ids);
     }
 
+    public List<UserCouponVo> queryUserCoupons(Map<String, Object> map) {
+        return userCouponDao.queryUserCoupons(map);
+    }
     /**
      * 标记未使用的优惠券是否可用,暂时无用
      *
@@ -111,7 +112,6 @@ public class ApiUserCouponService {
             return result;
         }
         //获取订单中商品可支持的优惠券,自动选择减免最大的金额
-
         String isUsed = "0";
         //查询未使用已领取的优惠券
         Map map = mkStoreTicketDiscountService.queryStoreDiscountByCartGoodsId(userCouponDto, isUsed);
@@ -120,11 +120,11 @@ public class ApiUserCouponService {
             for (MkStoreTicketDiscountVo discountVo : discountVoList) {
                 BigDecimal cond = Constant.ZERO;
                 BigDecimal money = Constant.ZERO;
-                if(discountVo.getTickDiscType().equalsIgnoreCase(Dict.tickDiscType.item_00.getItem())){
+                if(discountVo.getTickDiscType().equalsIgnoreCase(Dict.tickDiscType.item_00.getItem())){//代金券
                     cond = discountVo.getVoucherCond();
                     money = discountVo.getVoucherMoney();
                 }
-                if(discountVo.getTickDiscType().equalsIgnoreCase(Dict.tickDiscType.item_01.getItem())){
+                if(discountVo.getTickDiscType().equalsIgnoreCase(Dict.tickDiscType.item_01.getItem())){//折扣券
                     cond = discountVo.getDiscCond();
                     money = discountVo.getDiscRatio();//满多少打几折
                 }

+ 46 - 2
kmall-api/src/main/java/com/kmall/api/service/ApiUserService.java

@@ -1,16 +1,20 @@
 package com.kmall.api.service;
 
+import com.kmall.api.dao.ApiSysConfigMapper;
+import com.kmall.api.dao.ApiThirdMerchantBizMapper;
 import com.kmall.api.dao.ApiUserLevelMapper;
 import com.kmall.api.dao.ApiUserMapper;
 import com.kmall.api.entity.SmsLogVo;
+import com.kmall.api.entity.ThirdMerchantBizVo;
 import com.kmall.api.entity.UserLevelVo;
 import com.kmall.api.entity.UserVo;
-import com.kmall.common.utils.RRException;
-import com.kmall.common.validator.Assert;
+import com.kmall.common.utils.DateUtils;
+import com.kmall.common.utils.StringUtils;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -22,6 +26,10 @@ public class ApiUserService {
     private ApiUserMapper userDao;
     @Autowired
     private ApiUserLevelMapper userLevelDao;
+    @Autowired
+    private ApiSysConfigMapper apiSysConfigMapper;
+    @Autowired
+    private ApiThirdMerchantBizMapper apiThirdMerchantBizMapper;
 
     public UserVo queryObject(Long userId) {
         return userDao.queryObject(userId);
@@ -102,4 +110,40 @@ public class ApiUserService {
     public UserVo queryObjectByIdNoAndName(String idNo,String userName){
         return userDao.queryObjectByIdNoAndName(idNo, userName);
     }
+
+    /**
+     * 根据用户id判断上次活体人脸核身时间是否在可调用范围内(待小程序开放人脸识别类目)
+     * @param userId
+     * @return
+     */
+    public Boolean checkFaceTimeByUserId(Long userId, Long storeId){
+        ThirdMerchantBizVo thirdMerchantBizVo = apiThirdMerchantBizMapper.queryDataByStoreId(storeId);
+        if(thirdMerchantBizVo.getIsFaceCheck().equalsIgnoreCase("1")) {
+            String value = apiSysConfigMapper.queryByKey("FACE_COLLECT_FREQUENCY_TIME");
+            UserVo userVo = userDao.queryObject(userId);
+            if (userVo != null && StringUtils.isNotEmpty(value)) {
+                Integer frequencySecondTime = Integer.parseInt(value);
+                String lastFaceTime = userVo.getLastFaceTime();
+                if (StringUtils.isNotEmpty(lastFaceTime)) {
+                    Date lastFaceDate = DateUtils.convertStringToDate(lastFaceTime, DateUtils.DATE_TIME_PATTERN);
+                    Calendar calendar = Calendar.getInstance();
+                    calendar.setTime(lastFaceDate);
+                    calendar.add(Calendar.SECOND, frequencySecondTime);
+                    Date addSecondTime = calendar.getTime();
+                    Date nowDate = new Date();
+                    if (addSecondTime.getTime() > nowDate.getTime()) {
+                        return false;
+                    } else {
+                        //可调用身份验证范围内
+                        return true;
+                    }
+                } else {//可调用身份验证范围内
+                    return true;
+                }
+            }
+        }else{
+            return false;//第三方商户是否核验身份为0否,则不调起身份核验操作直接支付
+        }
+        return null;
+    }
 }

+ 121 - 0
kmall-api/src/main/java/com/kmall/api/service/faceid/ApiFaceIdService.java

@@ -0,0 +1,121 @@
+package com.kmall.api.service.faceid;
+
+import com.google.common.collect.ImmutableBiMap;
+import com.kmall.api.dao.*;
+import com.kmall.api.entity.*;
+import com.kmall.manager.dto.FaceIdRequestDto;
+import com.kmall.common.constant.Dict;
+import com.kmall.common.utils.*;
+import com.kmall.manager.manager.faceid.FaceCheckUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Map;
+
+/**
+ * @author huangyq
+ * @version 1.0
+ * 2019-11-21 15:52
+ */
+@Service
+public class ApiFaceIdService {
+    @Autowired
+    private ApiThirdMerchantBizMapper apiThirdMerchantBizMapper;
+    @Autowired
+    private ApiMerchMapper apiMerchMapper;
+    @Autowired
+    private ApiUserMapper apiUserMapper;
+    @Autowired
+    private ApiFaceLivenessRecognitionReturnDataMapper apiFaceLivenessRecognitionReturnDataMapper;
+    @Autowired
+    private ApiOrderMapper apiOrderMapper;
+
+    /**
+     * (待小程序开放人脸识别类目)
+     * @param faceIdRequestDto
+     * @param storeId
+     * @param userId
+     * @return
+     */
+    @Transactional
+    public String checkLivenessRecognition(FaceIdRequestDto faceIdRequestDto, Long storeId, Long userId) {
+        Map<String, Object> valideDate = MapBeanUtil.fromObject(faceIdRequestDto);
+        ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+        builder.put("merchId", "商户编号");
+        builder.put("idCard", "身份证号");
+        builder.put("name", "姓名");
+        builder.put("videoBase64", "视频的BASE64值");
+        builder.put("livenessType", "活体检测类型");
+        R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+        if (Integer.valueOf(r.get("code").toString()) != 0) {
+            throw new RRException(r.get("msg").toString());
+        }
+
+        if(!faceIdRequestDto.getLivenessType().equalsIgnoreCase(Dict.livenessType.item_SILENT.getItem())){
+            if(faceIdRequestDto.getLivenessType().equalsIgnoreCase(Dict.livenessType.item_ACTION.getItem())){
+                builder.put("validateData", "动作顺序");
+            }
+            if(faceIdRequestDto.getLivenessType().equalsIgnoreCase(Dict.livenessType.item_LIP.getItem())){
+                builder.put("validateData", "数字验证码");
+            }
+            r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+            if (Integer.valueOf(r.get("code").toString()) != 0) {
+                throw new RRException(r.get("msg").toString());
+            }
+        }
+        String merchSn = faceIdRequestDto.getMerchId();
+        MerchVo merchVo = apiMerchMapper.queryObjectByMerchSn(merchSn);
+        if(merchVo == null){
+            throw new RRException("商户不存在");
+        }
+        ThirdMerchantBizVo thirdMerchantBizVo = apiThirdMerchantBizMapper.queryDataByStoreId(storeId);
+        if(thirdMerchantBizVo == null){
+            throw new RRException("该门店的第三方商户不存在");
+        }
+        faceIdRequestDto.setMerchName(merchVo.getMerchName());
+        faceIdRequestDto.setThirdPartyMerchCode(thirdMerchantBizVo.getThirdPartyMerchCode());
+        faceIdRequestDto.setThirdPartyMerchName(thirdMerchantBizVo.getThirdPartyMerchName());
+
+        ResponseData responseData = FaceCheckUtil.checkLivenessRecognition(faceIdRequestDto);
+        if(!responseData.getCode().equalsIgnoreCase("0")){
+            throw new RRException(responseData.getMsg());
+        }else{
+            //人脸核验成功了,保存用户表中的最后活体人脸核身时间
+            Map faceIdResponseDto = (Map)responseData.getData().getRows().get(0);
+            UserVo user = new UserVo();
+            user.setId(userId);
+            if(StringUtils.isNotEmpty((String)faceIdResponseDto.get("returnTime"))) {
+                user.setLastFaceTime((String)faceIdResponseDto.get("returnTime"));
+            }
+            apiUserMapper.update(user);
+            return responseData.getMsg();
+        }
+    }
+
+    /**
+     * 根据订单号获取是否人脸认证成功
+     * @param orderIds
+     * @return 1:认证成功,2:没有保税展示跨境订单,0/null:未认证
+     */
+    public String getFaceDataByOrderId(Long[] orderIds){
+        int count =0;
+        for (Long orderId: orderIds){
+            OrderVo orderVo = apiOrderMapper.queryObject(orderId);
+            if(orderVo != null){
+                if(orderVo.getOrderBizType().equalsIgnoreCase(Dict.orderBizType.item_10.getItem())){
+                    FaceLivenessRecognitionReturnDataVo face = apiFaceLivenessRecognitionReturnDataMapper.getFaceByOrderSn(orderVo.getOrder_sn());
+                    if (face != null){
+                        return face.getIsFaceCheck();
+                    }
+                }else{
+                    count = count+1;
+                }
+            }
+        }
+        if(count==orderIds.length){
+            return "2";//没有门店现场订单
+        }
+        return null;
+    }
+}

+ 2 - 7
kmall-api/src/main/java/com/kmall/api/service/mk/ApiMkStoreTicketDiscountService.java

@@ -155,6 +155,7 @@ public class ApiMkStoreTicketDiscountService {
                     //购物车返回的优惠券数据需根据领券时间校验优惠券是否有效
                     mkStoreTicketDiscountList = getValidDiscountList(resultDiscountList);
                 }
+                //根据领券时间筛选过的有效的优惠券list
                 for (MkStoreTicketDiscountVo discountEntity : mkStoreTicketDiscountList) {
                     //查询商品是否满足该优惠券
                     Integer total = queryDiscountGoodsTotal(storeId, goodsId, discountEntity);
@@ -166,6 +167,7 @@ public class ApiMkStoreTicketDiscountService {
                 }
             }
         }
+        //goodsIdStr为满足优惠券的多条商品id字符串,goodsIdStr不为空,将goodsList设置到discountVoList中
         if(goodsIdStr != null && !goodsIdStr.toString().equalsIgnoreCase("")) {
             String[] gid = goodsIdStr.toString().split(",");
             Integer[] goodsIds =  new Integer[gid.length];
@@ -248,15 +250,8 @@ public class ApiMkStoreTicketDiscountService {
             }
         }
         Map params = Maps.newHashMap();
-        params.put("fields", "psr1.category_id");
-        params.put("store_id", storeId);
         params.put("tickDiscId", discountEntity.getTickDiscId());
         params.put("applyType", discountEntity.getApplyType());
-
-        params.remove("fields");
-
-        params.put("fields", "a.id,a.name,a.goods_brief,a.list_pic_url,psr1.retail_price," +
-                "psr1.market_price,b.id as product_id,psr1.stock_num");
         params.put("is_hot", "1");
         params.put("is_delete", 0);
         params.put("store_id", storeId);

+ 91 - 0
kmall-api/src/main/java/com/kmall/api/service/quotalInquiry/ApiQuotalInquiryService.java

@@ -0,0 +1,91 @@
+package com.kmall.api.service.quotalInquiry;
+
+import com.google.common.collect.ImmutableBiMap;
+import com.kmall.api.dao.*;
+import com.kmall.api.entity.*;
+import com.kmall.common.constant.Dict;
+import com.kmall.common.utils.*;
+import com.kmall.manager.dto.CrossBoundaryQuotalDto;
+import com.kmall.manager.dto.CrossQuotalInquiryResponseDto;
+import com.kmall.manager.manager.quotalInquiry.CrossBoundaryQuotalInquiryUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Map;
+
+/**
+ * @author huangyq
+ * @version 1.0
+ * 2019-12-17 15:52
+ */
+@Service
+public class ApiQuotalInquiryService {
+    @Autowired
+    private ApiThirdMerchantBizMapper apiThirdMerchantBizMapper;
+    @Autowired
+    private ApiMerchMapper apiMerchMapper;
+    @Autowired
+    private ApiUserMapper apiUserMapper;
+
+    /**
+     * 跨境额度查询
+     * @param crossBoundaryQuotalDto
+     * @param storeId
+     * @param userId
+     * @return
+     */
+    @Transactional
+    public CrossQuotalInquiryResponseDto getCrossBoundaryQuotaQuery(CrossBoundaryQuotalDto crossBoundaryQuotalDto, Long storeId, Long userId) {
+        Map<String, Object> valideDate = MapBeanUtil.fromObject(crossBoundaryQuotalDto);
+        ImmutableBiMap.Builder builder = new ImmutableBiMap.Builder();
+        builder.put("merchId", "商户编号");
+        builder.put("idCard", "身份证号");
+        builder.put("name", "姓名");
+        R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
+        if (Integer.valueOf(r.get("code").toString()) != 0) {
+            throw new RRException(r.get("msg").toString());
+        }
+        /*UserVo userVo = apiUserMapper.queryObjectByIdNoAndName(crossBoundaryQuotalDto.getIdCard(),crossBoundaryQuotalDto.getName());
+        if(userVo == null){
+            throw new RRException("身份证信息未绑定");
+        }else{
+            if(userVo.getId() != userId){
+                throw new RRException("只能查询当前微信用户绑定的身份证信息");
+            }
+        }*/
+        String merchSn = crossBoundaryQuotalDto.getMerchId();
+        MerchVo merchVo = apiMerchMapper.queryObjectByMerchSn(merchSn);
+        if(merchVo == null){
+            throw new RRException("商户不存在");
+        }
+        ThirdMerchantBizVo thirdMerchantBizVo = apiThirdMerchantBizMapper.queryDataByStoreId(storeId);
+        if(thirdMerchantBizVo == null){
+            throw new RRException("该门店的第三方商户不存在");
+        }
+        crossBoundaryQuotalDto.setMerchName(merchVo.getMerchName());
+        crossBoundaryQuotalDto.setThirdPartyMerchCode(thirdMerchantBizVo.getThirdPartyMerchCode());
+        crossBoundaryQuotalDto.setThirdPartyMerchName(thirdMerchantBizVo.getThirdPartyMerchName());
+        crossBoundaryQuotalDto.setIsCheckIdCard("0");//是否身份证认证:0:否,1:是
+
+        ResponseData responseData = CrossBoundaryQuotalInquiryUtil.getCrossBoundaryQuotaQuery(crossBoundaryQuotalDto);
+        if(!responseData.getCode().equalsIgnoreCase("0")){
+            throw new RRException(responseData.getMsg());
+        }else{
+            //跨境额度查询成功,保存返回数据
+            Map quotalInquiryResponseDto = (Map)responseData.getData().getRows().get(0);
+            CrossQuotalInquiryResponseDto crossQuotalInquiryResponseDto = new CrossQuotalInquiryResponseDto();
+            String serviceTime = (String)quotalInquiryResponseDto.get("serviceTime");
+            Map resultMap = (Map)quotalInquiryResponseDto.get("result");
+            if(resultMap != null){
+                Double totalAmount = (Double)resultMap.get("totalAmount");
+                Double innerbalance = (Double)resultMap.get("innerbalance");
+                crossQuotalInquiryResponseDto.setInnerbalance(innerbalance);
+                crossQuotalInquiryResponseDto.setTotalAmount(totalAmount);
+            }
+            crossQuotalInquiryResponseDto.setServiceTime(serviceTime);
+
+            return crossQuotalInquiryResponseDto;
+        }
+    }
+}

+ 14 - 12
kmall-api/src/main/java/com/kmall/api/service/wxGlobal/ApiWxGlobalPayService.java

@@ -89,18 +89,6 @@ public class ApiWxGlobalPayService {
             }else{
                 payerChildOrderRealService.save(entity);//记录微信返回的支付单与子订单信息
             }
-            FormIdsEntity formIdsEntity = formIdsService.getFormIdsByMerchOrderSn(orderInfo.getMerchOrderSn());
-            if(formIdsEntity != null){
-                FormIdsEntity formIds = new FormIdsEntity();
-                formIds.setMerchOrderSn(orderInfo.getMerchOrderSn());
-                formIds.setFormId(prepay_id);
-                formIds.setValidNum(formIdsEntity.getValidNum()+1);
-                formIds.setId(formIdsEntity.getId());
-                formIdsService.releaseFormIds(formIds);
-            }else{
-                // 保存form_id
-                formIdsService.save(orderInfo.getUser_id(), prepay_id, 1, orderInfo.getMerchOrderSn());
-            }
         }
     }
 
@@ -153,6 +141,20 @@ public class ApiWxGlobalPayService {
                     orderService.update(orderInfo);
                     orderProcessRecordMapper.updateBatch(processRecordEntityList);//更新订单流转信息
 
+                    if(orderInfo.getPay_status()==Integer.parseInt(Dict.payStatus.item_2.getItem())){
+                        FormIdsEntity formIdsEntity = formIdsService.getFormIdsByMerchOrderSn(orderInfo.getMerchOrderSn());
+                        if(formIdsEntity != null){
+                            FormIdsEntity formIds = new FormIdsEntity();
+                            formIds.setMerchOrderSn(orderInfo.getMerchOrderSn());
+                            formIds.setFormId(orderInfo.getPay_id());
+                            formIds.setValidNum(formIdsEntity.getValidNum()+1);
+                            formIds.setId(formIdsEntity.getId());
+                            formIdsService.releaseFormIds(formIds);
+                        }else{
+                            // 保存form_id
+                            formIdsService.save(orderInfo.getUser_id(), orderInfo.getPay_id(), 1, orderInfo.getMerchOrderSn());
+                        }
+                    }
                     // 微信支付成功通知
                     orderService.notifyPaySuccess(orderInfo);
                 }

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

@@ -60,6 +60,6 @@ public class IdCardUtil {
     public static void main(String[] args) {
 //      System.out.println(SendMsgUtil.createRandomVcode());
 //      System.out.println("&ecb=12".substring(1));
-        System.out.println(checkIdCard("430527199312244222", "黄亚琴"));
+        System.out.println(checkIdCard("", ""));
     }
 }

+ 1 - 43
kmall-api/src/main/resources/mybatis/mapper/ApiCouponMapper.xml

@@ -75,48 +75,6 @@
         </if>
     </select>
 
-    <select id="queryUserCoupons" resultMap="couponMap">
-        select a.*,b.coupon_number,b.user_id
-        from mall_coupon a
-        left join mall_user_coupon b on a.id = b.coupon_id
-        where 1 = 1
-        <if test="user_id != null">
-            and b.`user_id` = #{user_id}
-        </if>
-        <if test="store_id != null">
-            and a.`store_id` = #{store_id}
-        </if>
-        <if test="send_type != null">
-            and a.send_type = #{send_type}
-        </if>
-        <if test="coupon_number != null">
-            and b.coupon_number = #{coupon_number}
-        </if>
-        <if test="source_key != null and source_key != ''">
-            and b.source_key = #{source_key}
-        </if>
-        <if test="unUsed != null and unUsed == true">
-            and b.used_time is null and (b.order_id is null or b.order_id =0)
-        </if>
-        <if test="unUsed != null and unUsed == true">
-            and (b.order_id is null or b.order_id =0)
-        </if>
-        <if test="unObtain != null and unObtain == true">
-            and b.id is null
-        </if>
-        <choose>
-            <when test="sidx != null and sidx.trim() != ''">
-                order by ${sidx} ${order}
-            </when>
-            <otherwise>
-                order by a.id desc
-            </otherwise>
-        </choose>
-        <if test="offset != null and limit != null">
-            limit #{offset}, #{limit}
-        </if>
-    </select>
-
     <select id="queryMaxUserEnableCoupon" resultMap="couponMap">
         select a.*
         from mall_coupon a
@@ -141,4 +99,4 @@
         order by type_money desc
         limit 1
     </select>
-</mapper>
+</mapper>

+ 149 - 0
kmall-api/src/main/resources/mybatis/mapper/ApiFaceLivenessRecognitionReturnDataMapper.xml

@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.kmall.api.dao.ApiFaceLivenessRecognitionReturnDataMapper">
+
+    <resultMap type="com.kmall.api.entity.FaceLivenessRecognitionReturnDataVo" id="faceLivenessRecognitionReturnDataMap">
+        <result property="id" column="id"/>
+        <result property="merchOrderSn" column="merch_order_sn"/>
+        <result property="isTempNoti" column="is_temp_noti"/>
+        <result property="isFaceCheck" column="is_face_check"/>
+        <result property="userId" column="user_id"/>
+        <result property="tempNotiMsg" column="temp_noti_msg"/>
+        <result property="createrSn" column="creater_sn"/>
+        <result property="createTime" column="create_time"/>
+        <result property="moderSn" column="moder_sn"/>
+        <result property="modTime" column="mod_time"/>
+        <result property="tstm" column="tstm"/>
+    </resultMap>
+
+	<select id="queryObject" resultType="com.kmall.api.entity.FaceLivenessRecognitionReturnDataVo">
+		select
+			`id`,
+			`merch_order_sn`,
+			`is_temp_noti`,
+			`is_face_check`,
+			`user_id`,
+			`temp_noti_msg`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`
+		from face_liveness_recognition_return_data
+		where id = #{id}
+	</select>
+
+	<select id="queryList" resultType="com.kmall.api.entity.FaceLivenessRecognitionReturnDataVo">
+		select
+    		`id`,
+    		`merch_order_sn`,
+    		`is_temp_noti`,
+    		`is_face_check`,
+    		`user_id`,
+    		`temp_noti_msg`,
+    		`creater_sn`,
+    		`create_time`,
+    		`moder_sn`,
+    		`mod_time`,
+    		`tstm`
+		from face_liveness_recognition_return_data
+		WHERE 1=1
+		<if test="name != null and name.trim() != ''">
+			AND name LIKE concat('%',#{name},'%')
+		</if>
+        <choose>
+            <when test="sidx != null and sidx.trim() != ''">
+                order by ${sidx} ${order}
+            </when>
+			<otherwise>
+                order by id desc
+			</otherwise>
+        </choose>
+		<if test="offset != null and limit != null">
+			limit #{offset}, #{limit}
+		</if>
+	</select>
+
+ 	<select id="queryTotal" resultType="int">
+		select count(*) from face_liveness_recognition_return_data
+		WHERE 1=1
+        <if test="name != null and name.trim() != ''">
+            AND name LIKE concat('%',#{name},'%')
+        </if>
+	</select>
+
+	<insert id="save" parameterType="com.kmall.api.entity.FaceLivenessRecognitionReturnDataVo" useGeneratedKeys="true" keyProperty="id">
+		insert into face_liveness_recognition_return_data(
+			`merch_order_sn`,
+			`order_sn`,
+			`is_temp_noti`,
+			`is_face_check`,
+			`user_id`,
+			`temp_noti_msg`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`)
+		values(
+			#{merchOrderSn},
+			#{orderSn},
+			#{isTempNoti},
+			#{isFaceCheck},
+			#{userId},
+			#{tempNotiMsg},
+			#{createrSn},
+			#{createTime},
+			#{moderSn},
+			#{modTime},
+			#{tstm})
+	</insert>
+
+	<update id="update" parameterType="com.kmall.api.entity.FaceLivenessRecognitionReturnDataVo">
+		update face_liveness_recognition_return_data
+		<set>
+			<if test="merchOrderSn != null">`merch_order_sn` = #{merchOrderSn}, </if>
+			<if test="orderSn != null">`order_sn` = #{orderSn}, </if>
+			<if test="isTempNoti != null">`is_temp_noti` = #{isTempNoti}, </if>
+			<if test="isFaceCheck != null">`is_face_check` = #{isFaceCheck}, </if>
+			<if test="userId != null">`user_id` = #{userId}, </if>
+			<if test="tempNotiMsg != null">`temp_noti_msg` = #{tempNotiMsg}, </if>
+			<if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
+			<if test="createTime != null">`create_time` = #{createTime}, </if>
+			<if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
+			<if test="modTime != null">`mod_time` = #{modTime}, </if>
+			<if test="tstm != null">`tstm` = #{tstm}</if>
+		</set>
+		where id = #{id}
+	</update>
+
+	<delete id="delete">
+		delete from face_liveness_recognition_return_data where id = #{value}
+	</delete>
+
+	<delete id="deleteBatch">
+		delete from face_liveness_recognition_return_data where id in
+		<foreach item="id" collection="array" open="(" separator="," close=")">
+			#{id}
+		</foreach>
+	</delete>
+
+	<select id="getFaceByOrderSn" resultType="com.kmall.api.entity.FaceLivenessRecognitionReturnDataVo">
+		select
+			`id`,
+			`merch_order_sn`,
+			order_sn,
+			`is_temp_noti`,
+			`is_face_check`,
+			`user_id`,
+			`temp_noti_msg`,
+			`creater_sn`,
+			`create_time`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`
+		from face_liveness_recognition_return_data
+		where order_sn = #{orderSn}
+	</select>
+</mapper>

+ 7 - 4
kmall-api/src/main/resources/mybatis/mapper/ApiGoodsIssueMapper.xml

@@ -28,6 +28,9 @@
             <if test="goods_id != null">
                 and goods_id = #{goods_id}
             </if>
+            <if test="store_id != null">
+                and store_id = #{store_id}
+            </if>
             <if test="merch_sn != null">
                 and merch_sn = #{merch_sn}
             </if>
@@ -52,14 +55,14 @@
     <insert id="save" parameterType="com.kmall.api.entity.GoodsIssueVo" useGeneratedKeys="true" keyProperty="id">
 		insert into mall_goods_issue
 		(
-			`goods_id`, 
-			`question`, 
+			`goods_id`,
+			`question`,
 			`answer`
 		)
 		values
 		(
 			#{goods_id},
-			#{question}, 
+			#{question},
 			#{answer}
 		)
 	</insert>
@@ -85,4 +88,4 @@
         </foreach>
     </delete>
 
-</mapper>
+</mapper>

+ 7 - 4
kmall-api/src/main/resources/mybatis/mapper/ApiRelatedGoodsMapper.xml

@@ -22,7 +22,10 @@
         <if test="fields == null or fields == ''">
             *
         </if>
-        from mall_related_goods
+        from mall_related_goods where 1 = 1
+        <if test="goods_id != null and goods_id != ''">
+            and goods_id = #{goods_id}
+        </if>
         <choose>
             <when test="sidx != null and sidx.trim() != ''">
                 order by ${sidx} ${order}
@@ -43,12 +46,12 @@
     <insert id="save" parameterType="com.kmall.api.entity.RelatedGoodsVo" useGeneratedKeys="true" keyProperty="id">
 		insert into mall_related_goods
 		(
-			`goods_id`, 
+			`goods_id`,
 			`related_goods_id`
 		)
 		values
 		(
-			#{goods_id}, 
+			#{goods_id},
 			#{related_goods_id}
 		)
 	</insert>
@@ -73,4 +76,4 @@
         </foreach>
     </delete>
 
-</mapper>
+</mapper>

+ 13 - 0
kmall-api/src/main/resources/mybatis/mapper/ApiSysConfigMapper.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.kmall.api.dao.ApiSysConfigMapper">
+	<!-- 根据key,查询value -->
+	<select id="queryByKey" parameterType="string" resultType="string">
+		select value from sys_config where `key` = #{key}
+	</select>
+
+	<!-- 根据key,更新value -->
+	<update id="updateValueByKey" parameterType="map">
+		update sys_config set `value` = #{value} where `key` = #{key}
+	</update>
+</mapper>

+ 16 - 7
kmall-api/src/main/resources/mybatis/mapper/ApiThirdMerchantBizMapper.xml

@@ -17,6 +17,9 @@
         <result property="modTime" column="mod_time"/>
         <result property="tstm" column="tstm"/>
 		<result property="isMapShow" column="is_map_show"/>
+		<result property="isDistSellStart" column="is_dist_sell_start"/>
+		<result property="isSupplierGoods" column="is_supplier_goods"/>
+		<result property="isFaceCheck" column="is_face_check"/>
     </resultMap>
 
 	<select id="queryObject" resultType="com.kmall.api.entity.ThirdMerchantBizVo">
@@ -29,6 +32,7 @@
 			is_stock_share,
 			is_store_user_share,
 			is_map_show,
+			is_face_check,
 			`creater_sn`,
 			`create_time`,
 			`moder_sn`,
@@ -48,6 +52,7 @@
 		is_stock_share,
 		is_store_user_share,
 		is_map_show,
+		is_face_check,
 		`creater_sn`,
 		`create_time`,
 		`moder_sn`,
@@ -67,6 +72,7 @@
 		is_stock_share,
 		is_store_user_share,
 		is_map_show,
+		is_face_check,
 		`creater_sn`,
 		`create_time`,
 		`moder_sn`,
@@ -85,7 +91,10 @@
 		b.`is_valid`,
 		b.is_stock_share,
 		b.is_store_user_share,
-		b.is_map_show
+		b.is_map_show,
+		b.is_dist_sell_start,
+		b.is_supplier_goods,
+		b.is_face_check
 		from third_merchant_biz b inner join mall_store s on s.third_party_merch_code=b.third_party_merch_code
 		where s.id = #{storeId} and s.is_valid = 0
 	</select>
@@ -128,7 +137,7 @@
 			limit #{offset}, #{limit}
 		</if>
 	</select>
-	
+
  	<select id="queryTotal" resultType="int">
 		select count(*) from third_merchant_biz
 		WHERE 1=1
@@ -171,7 +180,7 @@
 	</insert>
 
 	<update id="update" parameterType="com.kmall.api.entity.ThirdMerchantBizVo">
-		update third_merchant_biz 
+		update third_merchant_biz
 		<set>
 			<if test="merchSn != null">`merch_sn` = #{merchSn},</if>
 			<if test="thirdPartyMerchCode != null">`third_party_merch_code` = #{thirdPartyMerchCode}, </if>
@@ -187,16 +196,16 @@
 		</set>
 		where third_merch_sn = #{thirdMerchSn}
 	</update>
-	
+
 	<delete id="delete">
 		delete from third_merchant_biz where third_merch_sn = #{value}
 	</delete>
-	
+
 	<delete id="deleteBatch">
-		delete from third_merchant_biz where third_merch_sn in 
+		delete from third_merchant_biz where third_merch_sn in
 		<foreach item="thirdMerchSn" collection="array" open="(" separator="," close=")">
 			#{thirdMerchSn}
 		</foreach>
 	</delete>
 
-</mapper>
+</mapper>

+ 46 - 4
kmall-api/src/main/resources/mybatis/mapper/ApiUserCouponMapper.xml

@@ -168,9 +168,9 @@
 			`store_topic_id`,
 			`coupon_name`,
             `is_used`,
-			`coupon_number`, 
-			`user_id`, 
-			`used_time`, 
+			`coupon_number`,
+			`user_id`,
+			`used_time`,
 			`order_id`,
 			`add_time`,
 			valid_time,
@@ -257,4 +257,46 @@
         LEFT JOIN mall_store_topic s ON cc.store_topic_id = s.id
         WHERE s.id = #{storeTopicId}
     </select>
-</mapper>
+
+    <select id="queryUserCoupons" resultMap="userCouponMap">
+        select b.*
+        from mall_store_topic a
+        LEFT JOIN mall_user_coupon b ON a.id = b.store_topic_id
+        where 1 = 1
+        <if test="user_id != null">
+            and b.`user_id` = #{user_id}
+        </if>
+        <if test="store_id != null">
+            and a.`store_id` = #{store_id}
+        </if>
+        <!--        <if test="send_type != null">-->
+        <!--            and a.send_type = #{send_type}-->
+        <!--        </if>-->
+        <if test="coupon_number != null">
+            and b.coupon_number = #{coupon_number}
+        </if>
+        <if test="source_key != null and source_key != ''">
+            and b.source_key = #{source_key}
+        </if>
+        <if test="unUsed != null and unUsed == true">
+            and b.used_time is null and (b.order_id is null or b.order_id =0)
+        </if>
+        <if test="unUsed != null and unUsed == true">
+            and (b.order_id is null or b.order_id =0)
+        </if>
+        <if test="unObtain != null and unObtain == true">
+            and b.id is null
+        </if>
+        <choose>
+            <when test="sidx != null and sidx.trim() != ''">
+                order by ${sidx} ${order}
+            </when>
+            <otherwise>
+                order by a.id desc
+            </otherwise>
+        </choose>
+        <if test="offset != null and limit != null">
+            limit #{offset}, #{limit}
+        </if>
+    </select>
+</mapper>

+ 12 - 4
kmall-api/src/main/resources/mybatis/mapper/ApiUserMapper.xml

@@ -2,7 +2,6 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 
 <mapper namespace="com.kmall.api.dao.ApiUserMapper">
-
     <!-- 可根据自己的需求,是否要使用 -->
     <resultMap id="BaseResultMap" type="com.kmall.api.entity.UserVo" >
         <result property="id" column="id"/>
@@ -25,12 +24,13 @@
         <result column="moder_sn" property="moderSn" jdbcType="VARCHAR" />
         <result column="mod_time" property="modTime" jdbcType="TIMESTAMP" />
         <result column="tstm" property="tstm" jdbcType="TIMESTAMP" />
+        <result column="last_face_time" property="lastFaceTime" jdbcType="VARCHAR" />
     </resultMap>
 
     <sql id="Base_Column_List" >
         id, username, password, gender, birthday, register_time, last_login_time, last_login_ip,
         user_level_id, nickname, mobile, register_ip, avatar, weixin_openid, id_no, creater_sn,
-        create_time, moder_sn, mod_time, tstm
+        create_time, moder_sn, mod_time, tstm,last_face_time
     </sql>
     <select id="queryObject" resultMap="BaseResultMap" >
         select
@@ -86,7 +86,6 @@
     <insert id="save" parameterType="com.kmall.api.entity.UserVo" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
 		insert into mall_user
         <trim prefix="(" suffix=")" suffixOverrides="," >
-
             `username`,
             `password`,
             `gender`,
@@ -115,6 +114,9 @@
             <if test="modTime != null" >
                 mod_time,
             </if>
+            <if test="lastFaceTime != null" >
+                last_face_time,
+            </if>
             <if test="tstm != null" >
                 tstm,
             </if>
@@ -148,6 +150,9 @@
             <if test="modTime != null" >
                 #{modTime,jdbcType=TIMESTAMP},
             </if>
+            <if test="lastFaceTime != null" >
+                #{lastFaceTime,jdbcType=VARCHAR},
+            </if>
             <if test="tstm != null" >
                 #{tstm,jdbcType=TIMESTAMP},
             </if>
@@ -185,6 +190,9 @@
             <if test="modTime != null" >
                 mod_time = #{modTime,jdbcType=TIMESTAMP},
             </if>
+            <if test="lastFaceTime != null" >
+                last_face_time = #{lastFaceTime,jdbcType=VARCHAR},
+            </if>
             <if test="tstm != null" >
                 tstm = #{tstm,jdbcType=TIMESTAMP},
             </if>
@@ -237,4 +245,4 @@
         )
     </insert>
 
-</mapper>
+</mapper>

+ 64 - 0
kmall-common/src/main/java/com/kmall/common/constant/Dict.java

@@ -1400,6 +1400,38 @@ public class Dict {
     }
 
     /**
+     * 优惠券是否过期,0:否,1:是
+     */
+    public enum discountIsPast {
+        item_0("0", "否"),
+        item_1("1", "是");
+
+        private String item;
+        private String itemName;
+
+        discountIsPast(String item, String itemName) {
+            this.item = item;
+            this.itemName = itemName;
+        }
+
+        public String getItem() {
+            return item;
+        }
+
+        public void setItem(String item) {
+            this.item = item;
+        }
+
+        public String getItemName() {
+            return itemName;
+        }
+
+        public void setItemName(String itemName) {
+            this.itemName = itemName;
+        }
+    }
+
+    /**
      * 是否过期 0:进行中,1:已结束,2:未开始
      */
     public enum isPast {
@@ -1563,4 +1595,36 @@ public class Dict {
         }
     }
 
+    /**
+     * 活体检测类型;LIP:数字模式,ACTION:动作模式,SILENT:静默模式
+     */
+    public enum livenessType {
+        item_LIP("LIP", "数字模式"),
+        item_ACTION("ACTION", "动作模式"),
+        item_SILENT("SILENT", "静默模式");
+
+        private String item;
+        private String itemName;
+
+        livenessType(String item, String itemName) {
+            this.item = item;
+            this.itemName = itemName;
+        }
+
+        public String getItem() {
+            return item;
+        }
+
+        public void setItem(String item) {
+            this.item = item;
+        }
+
+        public String getItemName() {
+            return itemName;
+        }
+
+        public void setItemName(String itemName) {
+            this.itemName = itemName;
+        }
+    }
 }

+ 11 - 0
kmall-common/src/main/java/com/kmall/common/utils/DateUtils.java

@@ -232,6 +232,17 @@ public class DateUtils {
         return d;
     }
 
+    public static String addMin(Date date, Integer min){
+        SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss");
+
+        Calendar ca = Calendar.getInstance();
+        ca.setTime(date);
+        ca.add(Calendar.MINUTE, min);// min为增加的分钟数,可以改变的
+        Date d = ca.getTime();
+        String enddate = format.format(d);
+        return enddate;
+    }
+
     public static void main(String[] args) {
 //        Date date = new Date();
 //        String str = "20170818223629599";

+ 137 - 0
kmall-common/src/main/java/com/kmall/common/utils/MD5Sign.java

@@ -0,0 +1,137 @@
+package com.kmall.common.utils;
+
+import org.apache.commons.codec.digest.DigestUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.UnsupportedEncodingException;
+import java.security.SignatureException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * @author Scott Chen
+ * @since 1.0
+ * 2018-03-10
+ */
+public class MD5Sign {
+
+    private final static Logger logger = LoggerFactory.getLogger(MD5Sign.class);
+
+    private static String INPUT_CHARSET_UTF8 = "UTF-8";
+
+    /**
+     * Map按Key排序
+     * @param params
+     * @return
+     */
+    public static Map<String, Object> sortMapByKey(Map<String, Object> params) {
+        if (params == null || params.isEmpty()) {
+            return null;
+        }
+
+        Map<String, Object> sortMap = new TreeMap<String, Object>(
+                (x, y) -> x.compareTo(y)
+        );
+
+        sortMap.putAll(params);
+        return sortMap;
+    }
+
+    /**
+     * Map 的Key和Value连接
+     * @param params
+     * @return
+     */
+    public static String buildParamsStr(Map<String, Object> params) {
+        if (params == null || params.isEmpty()) {
+            return null;
+        }
+        StringBuffer sb = new StringBuffer();
+        for (Map.Entry entry : params.entrySet()) {
+            sb.append(String.valueOf(entry.getKey()) + String.valueOf(entry.getValue()));
+        }
+        return sb.toString();
+    }
+
+    /**
+     * 请求参数前添加密钥
+     * @param text
+     * @param secretKey
+     * @return
+     */
+    public static String insertSecretKey(String text, String secretKey) {
+        return new StringBuffer(text).insert(0, secretKey).toString();
+    }
+
+    /**
+     * 签名
+     * @param params 请求参数
+     * @param secretKey 密钥
+     * @return
+     */
+    public static String sign(Map<String, Object> params, String secretKey) {
+        String paramsStr = insertSecretKey(buildParamsStr(sortMapByKey(params)), secretKey);
+        String signature = DigestUtils.md5Hex(getContentBytes(paramsStr, INPUT_CHARSET_UTF8));
+        logger.debug("加签: {}", signature);
+        return signature;
+    }
+
+    /**
+     * 验证签名
+     * @param signature 签名
+     * @param params 请求参数
+     * @param secretKey 密钥
+     * @return
+     */
+    public static boolean verify(String signature, Map<String, Object> params, String secretKey) {
+        String paramsStr = insertSecretKey(buildParamsStr(sortMapByKey(params)), secretKey);
+        String calculateSign = DigestUtils.md5Hex(getContentBytes(paramsStr, INPUT_CHARSET_UTF8));
+        boolean verify =  calculateSign.equals(signature) ? true : false;
+        logger.debug("系统生成的签名::{}",calculateSign);
+        logger.debug("验签: {}", signature);
+        logger.debug("验签结果: {}", verify);
+        return verify;
+    }
+
+
+    /**
+     * @param content
+     * @param charset
+     * @return
+     * @throws SignatureException
+     * @throws UnsupportedEncodingException
+     */
+    private static byte[] getContentBytes(String content, String charset) {
+        if (charset == null || "".equals(charset)) {
+            return content.getBytes();
+        }
+        try {
+            return content.getBytes(charset);
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException("M" +
+                    "" +
+                    "" +
+                    "" +
+                    "" +
+                    "D5签名过程中出现错误,指定的编码集不对,您目前指定的编码集是:" + charset);
+        }
+    }
+
+
+
+    public static void main(String[] args) {
+        Map map = new HashMap();
+        //测试环境秘钥
+        String data = "{\"idCard\":\"430527199312244222\",\"name\":\"黄亚琴\",\"videoBase64\":\"111\",\"livenessType\":\"SILENT\",\"merchId\":\"mhbs990053989883052032\",\"merchName\":\"中网科技\",\"platSn\":\"mhpt990060576152485888\"}";
+        map.put("data", data);
+        map.put("timestamp", "1574240977");
+        map.put("merchId", "mhbs990053989883052032");
+
+        String si = sign(map, "IxyIvP0sJqlUZinx");
+
+        verify(si, map, "IxyIvP0sJqlUZinx");
+    }
+
+}

+ 1 - 1
kmall-admin/src/main/java/com/kmall/admin/utils/ResponseData.java → kmall-common/src/main/java/com/kmall/common/utils/ResponseData.java

@@ -1,4 +1,4 @@
-package com.kmall.admin.utils;
+package com.kmall.common.utils;
 
 /**
  * @author huangyq

+ 1 - 1
kmall-admin/src/main/java/com/kmall/admin/utils/ResponseDataRows.java → kmall-common/src/main/java/com/kmall/common/utils/ResponseDataRows.java

@@ -1,4 +1,4 @@
-package com.kmall.admin.utils;
+package com.kmall.common.utils;
 
 import java.util.List;
 

+ 39 - 0
kmall-common/src/main/java/com/kmall/common/utils/wxtemplate/WxTemplate2.java

@@ -0,0 +1,39 @@
+package com.kmall.common.utils.wxtemplate;
+
+import java.util.List;
+
+/**
+ * 微信模板
+ *
+ * @author Scott(CN)
+ * @date 2017/11/29.
+ */
+public class WxTemplate2 {
+    private WxTemplate2 mp_template_msg;//模板ID
+    private String touser;//目标客户
+
+    public WxTemplate2 getMp_template_msg() {
+        return mp_template_msg;
+    }
+
+    public void setMp_template_msg(WxTemplate2 mp_template_msg) {
+        this.mp_template_msg = mp_template_msg;
+    }
+
+    public String getTouser() {
+        return touser;
+    }
+
+    public void setTouser(String touser) {
+        this.touser = touser;
+    }
+
+    public String toJSON() {
+        StringBuffer buffer = new StringBuffer();
+        buffer.append("{");
+        buffer.append(String.format("\"touser\":\"%s\"", this.touser)).append(",");
+        buffer.append(String.format("\"mp_template_msg\":\"%s\"", this.mp_template_msg)).append(",");
+        buffer.append("}");
+        return buffer.toString();
+    }
+}

+ 90 - 0
kmall-manager/src/main/java/com/kmall/manager/dto/CrossBoundaryQuotalDto.java

@@ -0,0 +1,90 @@
+package com.kmall.manager.dto;
+
+import java.io.Serializable;
+
+/**
+ * 跨境额度查询dto
+ * @author huangyq
+ * @version 1.0
+ * 2019-12-17 15:49
+ */
+public class CrossBoundaryQuotalDto  implements Serializable {
+
+    private static final long serialVersionUID = -4707152622304052229L;
+    //商户编号
+    private String merchId;
+
+    //商户名称
+    private String merchName;
+
+    //第三方商户代码
+    private String thirdPartyMerchCode;
+
+    //第三方商户名称
+    private String thirdPartyMerchName;
+
+    //身份证号
+    private String idCard;
+
+    //姓名
+    private String name;
+
+    //是否身份证认证:0:否,1:是
+    private String isCheckIdCard;
+
+    public String getMerchId() {
+        return merchId;
+    }
+
+    public void setMerchId(String merchId) {
+        this.merchId = merchId;
+    }
+
+    public String getMerchName() {
+        return merchName;
+    }
+
+    public void setMerchName(String merchName) {
+        this.merchName = merchName;
+    }
+
+    public String getThirdPartyMerchCode() {
+        return thirdPartyMerchCode;
+    }
+
+    public void setThirdPartyMerchCode(String thirdPartyMerchCode) {
+        this.thirdPartyMerchCode = thirdPartyMerchCode;
+    }
+
+    public String getThirdPartyMerchName() {
+        return thirdPartyMerchName;
+    }
+
+    public void setThirdPartyMerchName(String thirdPartyMerchName) {
+        this.thirdPartyMerchName = thirdPartyMerchName;
+    }
+
+    public String getIdCard() {
+        return idCard;
+    }
+
+    public void setIdCard(String idCard) {
+        this.idCard = idCard;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getIsCheckIdCard() {
+        return isCheckIdCard;
+    }
+
+    public void setIsCheckIdCard(String isCheckIdCard) {
+        this.isCheckIdCard = isCheckIdCard;
+    }
+}

+ 44 - 0
kmall-manager/src/main/java/com/kmall/manager/dto/CrossQuotalInquiryResponseDto.java

@@ -0,0 +1,44 @@
+package com.kmall.manager.dto;
+
+import java.io.Serializable;
+
+/**
+ * 跨境额度查询接口返回数据
+ * @author huangyq
+ * @version 1.0
+ * 2019-12-17 16:15
+ */
+public class CrossQuotalInquiryResponseDto  implements Serializable {
+
+    private static final long serialVersionUID = -4707152622304052229L;
+
+    private String serviceTime;
+
+    private Double totalAmount;
+
+    private Double innerbalance;
+
+    public String getServiceTime() {
+        return serviceTime;
+    }
+
+    public void setServiceTime(String serviceTime) {
+        this.serviceTime = serviceTime;
+    }
+
+    public Double getTotalAmount() {
+        return totalAmount;
+    }
+
+    public void setTotalAmount(Double totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+
+    public Double getInnerbalance() {
+        return innerbalance;
+    }
+
+    public void setInnerbalance(Double innerbalance) {
+        this.innerbalance = innerbalance;
+    }
+}

+ 113 - 0
kmall-manager/src/main/java/com/kmall/manager/dto/FaceIdRequestDto.java

@@ -0,0 +1,113 @@
+package com.kmall.manager.dto;
+
+import java.io.Serializable;
+
+/**
+ * 活体人脸核身接口请求参数
+ * @author huangyq
+ * @version 1.0
+ * 2019-11-20 15:11
+ */
+public class FaceIdRequestDto implements Serializable {
+
+    private static final long serialVersionUID = -4707152622304052229L;
+    //商户编号
+    private String merchId;
+    //商户名称
+    private String merchName;
+    //第三方商户代码
+    private String thirdPartyMerchCode;
+    //第三方商户名称
+    private String thirdPartyMerchName;
+
+    private String idCard;//身份证号
+
+    private String name;//姓名
+
+    private String videoBase64;//视频的BASE64值
+
+    /**
+     * 活体检测类型,取值:LIP/ACTION/SILENT。
+     * LIP为数字模式,ACTION为动作模式,SILENT为静默模式,三种模式选择一种传入。
+     */
+    private String livenessType;
+
+    /**
+     * 数字模式传参:数字验证码(1234),需先调用接口获取数字验证码;
+     * 动作模式传参:传动作顺序(2,1 or 1,2),需先调用接口获取动作顺序;
+     * 静默模式传参:空。
+     */
+    private String validateData;
+
+    public String getMerchId() {
+        return merchId;
+    }
+
+    public void setMerchId(String merchId) {
+        this.merchId = merchId;
+    }
+
+    public String getMerchName() {
+        return merchName;
+    }
+
+    public void setMerchName(String merchName) {
+        this.merchName = merchName;
+    }
+
+    public String getThirdPartyMerchCode() {
+        return thirdPartyMerchCode;
+    }
+
+    public void setThirdPartyMerchCode(String thirdPartyMerchCode) {
+        this.thirdPartyMerchCode = thirdPartyMerchCode;
+    }
+
+    public String getThirdPartyMerchName() {
+        return thirdPartyMerchName;
+    }
+
+    public void setThirdPartyMerchName(String thirdPartyMerchName) {
+        this.thirdPartyMerchName = thirdPartyMerchName;
+    }
+
+    public String getIdCard() {
+        return idCard;
+    }
+
+    public void setIdCard(String idCard) {
+        this.idCard = idCard;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getVideoBase64() {
+        return videoBase64;
+    }
+
+    public void setVideoBase64(String videoBase64) {
+        this.videoBase64 = videoBase64;
+    }
+
+    public String getLivenessType() {
+        return livenessType;
+    }
+
+    public void setLivenessType(String livenessType) {
+        this.livenessType = livenessType;
+    }
+
+    public String getValidateData() {
+        return validateData;
+    }
+
+    public void setValidateData(String validateData) {
+        this.validateData = validateData;
+    }
+}

+ 128 - 0
kmall-manager/src/main/java/com/kmall/manager/manager/common/OkHttpUtilss.java

@@ -0,0 +1,128 @@
+package com.kmall.manager.manager.common;
+
+import okhttp3.*;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author Scott Chen
+ * @date 2017/3/13
+ */
+public class OkHttpUtilss {
+
+    public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
+    public static final int CONNEC_TIME = 20;
+    public static final int READ_TIME = 30;
+    public static final int WRITE_TIME = 30;
+
+    private static OkHttpClient okHttpClient = null;
+    static{
+        okHttpClient = new OkHttpClient.Builder()
+                .connectTimeout(CONNEC_TIME, TimeUnit.SECONDS)
+                .readTimeout(READ_TIME, TimeUnit.SECONDS)
+                .writeTimeout(WRITE_TIME, TimeUnit.SECONDS)
+                .build();
+    }
+
+    /**
+     * 构造RequestBody
+     *
+     * @param params
+     * @return
+     */
+    public static RequestBody buildRequestBody(Map<String, String> params) {
+        FormBody.Builder builder = new FormBody.Builder();
+        Iterator<Map.Entry<String, String>> iterator = params.entrySet().iterator();
+        while (iterator.hasNext()) {
+            Map.Entry<String, String> entry = iterator.next();
+            builder.add(entry.getKey(), entry.getValue());
+        }
+        return builder.build();
+    }
+
+
+    /**
+     * 以字符串数据构建Request(未使用)
+     * @param url
+     * @param json
+     * @return
+     */
+    public static Request buildRequest(String url, String json) {
+        RequestBody body = RequestBody.create(JSON, json);
+        return buildRequest(url, body);
+    }
+
+    /**
+     * 构建Request
+     * @param url
+     * @param body
+     * @return
+     */
+    public static Request buildRequest(String url, RequestBody body) {
+        return new Request.Builder()
+                .url(url)
+                .post(body)
+                .build();
+    }
+
+    /**
+     * 同步访问,返回结果字符串
+     * 可能超时
+     *
+     * @param request
+     * @return
+     * @throws IOException
+     */
+    public static String post(Request request) throws IOException {
+        Response response = okHttpClient.newCall(request).execute();
+        String result = "";
+        if (response.isSuccessful()) {
+            result = response.body().string();
+        }else {
+            throw new IOException("okhttp3 post exception: " + response);
+        }
+        return result;
+    }
+
+    /**
+     * 同步访问,返回Response
+     * 可能超时
+     * @param request
+     * @return
+     * @throws IOException
+     */
+    public static Response postReturnResponse(Request request)  throws IOException {
+        return okHttpClient.newCall(request).execute();
+    }
+
+    /**
+     * 异步访问,回调结果
+     * @param request
+     * @param responseCallback
+     */
+    public static void asyncPostCallback(Request request, Callback responseCallback) {
+        okHttpClient.newCall(request).enqueue(responseCallback);
+    }
+
+    /**
+     * 异步访问,无结果返回
+     * @param request
+     */
+    public static void asyncPost(Request request) {
+        okHttpClient.newCall(request).enqueue(new Callback() {
+            @Override
+            public void onFailure(Call call, IOException e) {
+
+            }
+
+            @Override
+            public void onResponse(Call call, Response response) throws IOException {
+
+            }
+        });
+    }
+
+}

+ 70 - 0
kmall-manager/src/main/java/com/kmall/manager/manager/faceid/FaceCheckUtil.java

@@ -0,0 +1,70 @@
+package com.kmall.manager.manager.faceid;
+
+import com.kmall.common.constant.Dict;
+import com.kmall.common.utils.JacksonUtils;
+import com.kmall.common.utils.MD5Sign;
+import com.kmall.common.utils.ResponseData;
+import com.kmall.manager.dto.FaceIdRequestDto;
+import com.kmall.manager.manager.common.OkHttpUtilss;
+import com.kmall.manager.manager.merch.OmsMerchPropertiesBuilder;
+import okhttp3.Request;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TreeMap;
+
+
+/**
+ * @author huangyq
+ * @version 1.0
+ * 2019-11-27 14:30
+ */
+public class FaceCheckUtil {
+    private static Logger loggger = LoggerFactory.getLogger(FaceCheckUtil.class);
+
+    public static ResponseData checkLivenessRecognition(FaceIdRequestDto faceIdRequestDto){
+        Map<String,String> sParaTemp = new TreeMap<String, String>();
+        sParaTemp.put("idCard", faceIdRequestDto.getIdCard());
+        sParaTemp.put("name", faceIdRequestDto.getName());
+        sParaTemp.put("videoBase64", faceIdRequestDto.getVideoBase64());
+        sParaTemp.put("livenessType", faceIdRequestDto.getLivenessType());
+        if(!faceIdRequestDto.getLivenessType().equalsIgnoreCase(Dict.livenessType.item_SILENT.getItem())){
+            sParaTemp.put("validateData", faceIdRequestDto.getValidateData());
+        }
+        sParaTemp.put("merchId", faceIdRequestDto.getMerchId());
+        sParaTemp.put("merchName", faceIdRequestDto.getMerchName());
+        sParaTemp.put("thirdPartyMerchCode", faceIdRequestDto.getThirdPartyMerchCode());
+        sParaTemp.put("thirdPartyMerchName", faceIdRequestDto.getThirdPartyMerchName());
+        String params = JacksonUtils.toJson(sParaTemp);
+
+        Map map = new HashMap();
+        map.put("data", params);
+        map.put("timestamp", System.currentTimeMillis());
+        map.put("merchId", faceIdRequestDto.getMerchId());
+        String md5Salt = OmsMerchPropertiesBuilder.instance().getMd5Salt();
+
+        String si = MD5Sign.sign(map, md5Salt);
+        map.put("sign",si);
+        String requestData = JacksonUtils.toJson(map);
+        String response = buildRequestPost(requestData);
+        ResponseData responseData = JacksonUtils.fromStringJson(response, ResponseData.class);
+        return responseData;
+    }
+
+    private static String buildRequestPost(String requestData){
+        String url = OmsMerchPropertiesBuilder.instance().getLivenessRecognitionUrl();
+        // 同步访问,返回结果字符串
+        Request request = OkHttpUtilss.buildRequest(url,requestData);
+        // 同步访问,返回结果字符串
+        String response = null;
+        try {
+            response = OkHttpUtilss.post(request);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return response;
+    }
+}

+ 40 - 0
kmall-manager/src/main/java/com/kmall/manager/manager/merch/OmsMerchProperties.java

@@ -17,6 +17,14 @@ public class OmsMerchProperties implements Serializable {
 
     private String merchShortName;
 
+    private String wxOrderResendUrl;
+
+    private String md5Salt;
+
+    private String livenessRecognitionUrl;
+
+    private String quotaInquiryUrl;
+
     public String getMerchSn() {
         return merchSn;
     }
@@ -40,4 +48,36 @@ public class OmsMerchProperties implements Serializable {
     public void setMerchShortName(String merchShortName) {
         this.merchShortName = merchShortName;
     }
+
+    public String getWxOrderResendUrl() {
+        return wxOrderResendUrl;
+    }
+
+    public void setWxOrderResendUrl(String wxOrderResendUrl) {
+        this.wxOrderResendUrl = wxOrderResendUrl;
+    }
+
+    public String getMd5Salt() {
+        return md5Salt;
+    }
+
+    public void setMd5Salt(String md5Salt) {
+        this.md5Salt = md5Salt;
+    }
+
+    public String getLivenessRecognitionUrl() {
+        return livenessRecognitionUrl;
+    }
+
+    public void setLivenessRecognitionUrl(String livenessRecognitionUrl) {
+        this.livenessRecognitionUrl = livenessRecognitionUrl;
+    }
+
+    public String getQuotaInquiryUrl() {
+        return quotaInquiryUrl;
+    }
+
+    public void setQuotaInquiryUrl(String quotaInquiryUrl) {
+        this.quotaInquiryUrl = quotaInquiryUrl;
+    }
 }

+ 19 - 0
kmall-manager/src/main/java/com/kmall/manager/manager/pay/wxpay/WxPayProperties.java

@@ -33,6 +33,25 @@ public class WxPayProperties implements Serializable {
     private String spbillCreateIp;
     private String refundNotifyUrl;
 
+    private String accessTokenUrl;
+    private String templateSendUrl;
+
+    public String getAccessTokenUrl() {
+        return accessTokenUrl;
+    }
+
+    public void setAccessTokenUrl(String accessTokenUrl) {
+        this.accessTokenUrl = accessTokenUrl;
+    }
+
+    public String getTemplateSendUrl() {
+        return templateSendUrl;
+    }
+
+    public void setTemplateSendUrl(String templateSendUrl) {
+        this.templateSendUrl = templateSendUrl;
+    }
+
     public String getMicropayUrl() {
         return micropayUrl;
     }

+ 69 - 0
kmall-manager/src/main/java/com/kmall/manager/manager/quotalInquiry/CrossBoundaryQuotalInquiryUtil.java

@@ -0,0 +1,69 @@
+package com.kmall.manager.manager.quotalInquiry;
+
+import com.kmall.common.utils.JacksonUtils;
+import com.kmall.common.utils.MD5Sign;
+import com.kmall.common.utils.ResponseData;
+import com.kmall.manager.dto.CrossBoundaryQuotalDto;
+import com.kmall.manager.manager.common.OkHttpUtilss;
+import com.kmall.manager.manager.merch.OmsMerchPropertiesBuilder;
+import okhttp3.Request;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TreeMap;
+
+
+/**
+ * 跨境额度查询
+ * @author huangyq
+ * @version 1.0
+ * 2019-11-27 14:30
+ */
+public class CrossBoundaryQuotalInquiryUtil {
+    private static Logger loggger = LoggerFactory.getLogger(CrossBoundaryQuotalInquiryUtil.class);
+
+    public static ResponseData getCrossBoundaryQuotaQuery(CrossBoundaryQuotalDto crossBoundaryQuotalDto){
+        Map<String,String> sParaTemp = new TreeMap<String, String>();
+        sParaTemp.put("merchId", crossBoundaryQuotalDto.getMerchId());
+        sParaTemp.put("merchName", crossBoundaryQuotalDto.getMerchName());
+        sParaTemp.put("thirdPartyMerchCode", crossBoundaryQuotalDto.getThirdPartyMerchCode());
+        sParaTemp.put("thirdPartyMerchName", crossBoundaryQuotalDto.getThirdPartyMerchName());
+        sParaTemp.put("idCard", crossBoundaryQuotalDto.getIdCard());
+        sParaTemp.put("name", crossBoundaryQuotalDto.getName());
+        sParaTemp.put("isCheckIdCard", crossBoundaryQuotalDto.getIsCheckIdCard());
+        String params = JacksonUtils.toJson(sParaTemp);
+
+        Map map = new HashMap();
+        map.put("data", params);
+        map.put("timestamp", System.currentTimeMillis()/1000);
+        map.put("merchId", crossBoundaryQuotalDto.getMerchId());
+        String md5Salt = OmsMerchPropertiesBuilder.instance().getMd5Salt();
+
+        String si = MD5Sign.sign(map, md5Salt);
+        map.put("sign",si);
+        String requestData = JacksonUtils.toJson(map);
+        loggger.info("请求oms跨境额度查询接口参数:"+requestData);
+        String response = buildRequestPost(requestData);
+        loggger.info("oms跨境额度查询接口返回参数:"+response);
+        ResponseData responseData = JacksonUtils.fromStringJson(response, ResponseData.class);
+        return responseData;
+    }
+
+    private static String buildRequestPost(String requestData){
+        String url = OmsMerchPropertiesBuilder.instance().getQuotaInquiryUrl();
+//        String url = "http://192.168.1.121:8680/al/cus/quotaInquiry";
+        // 同步访问,返回结果字符串
+        Request request = OkHttpUtilss.buildRequest(url,requestData);
+        // 同步访问,返回结果字符串
+        String response = null;
+        try {
+            response = OkHttpUtilss.post(request);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return response;
+    }
+}

+ 1 - 1
kmall-manager/src/main/java/com/kmall/manager/manager/wechat/WechatGlobalUtil.java

@@ -127,7 +127,7 @@ public class WechatGlobalUtil {
         logger.info("*******查询订单(WX Response:" + reponseXml);
         WechatGlobalQueryApiResult result =
                 (WechatGlobalQueryApiResult) XmlUtil.xmlStrToBean(reponseXml, WechatGlobalQueryApiResult.class);
-
+        result.setXml(xml);
         return result;
     }
 

+ 10 - 0
kmall-manager/src/main/java/com/kmall/manager/manager/wechat/wxglobal/dto/WechatGlobalQueryApiResult.java

@@ -47,6 +47,8 @@ public class WechatGlobalQueryApiResult {
 	 */
 	private String rate;//汇率
 
+	private String xml;
+
 	public String getReturn_code() {
 		return return_code;
 	}
@@ -246,4 +248,12 @@ public class WechatGlobalQueryApiResult {
 	public void setPrepay_id(String prepay_id) {
 		this.prepay_id = prepay_id;
 	}
+
+	public String getXml() {
+		return xml;
+	}
+
+	public void setXml(String xml) {
+		this.xml = xml;
+	}
 }

+ 5 - 0
kmall-manager/src/main/java/com/kmall/manager/manager/wechat/wxtemplate/TemplateData.java

@@ -14,6 +14,11 @@ public class TemplateData {
     // 颜色
     private String color;
 
+    public TemplateData(String name, String value) {
+        this.name = name;
+        this.value = value;
+    }
+
     public TemplateData(String name, String value, String color) {
         this.name = name;
         this.value = value;

+ 5 - 4
kmall-manager/src/main/java/com/kmall/manager/manager/wechat/wxtemplate/TokenThread.java

@@ -1,7 +1,7 @@
 package com.kmall.manager.manager.wechat.wxtemplate;
 
-import com.kmall.manager.manager.pay.wxpay.CommonWxPayPropertiesBuilder;
 import com.kmall.common.utils.wechat.AccessToken;
+import com.kmall.manager.manager.pay.wxpay.WxPayPropertiesBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -17,8 +17,9 @@ public class TokenThread implements Runnable {
         while (true) {
             try {
                 accessToken = WxTemplateUtil.getAccessToken(
-                        CommonWxPayPropertiesBuilder.instance().getAppId(),
-                        CommonWxPayPropertiesBuilder.instance().getPaySignKey());
+                        WxPayPropertiesBuilder.instance().getAppId(),
+                        WxPayPropertiesBuilder.instance().getSecret());
+//                accessToken = WxTemplateUtil.getAccessToken("wxb6b30b1b14ee502a","be0234dbbbde4ce68df43dd2b5e4c7b1");
                 if (null != accessToken) {
                     log.info("获取access_token成功,有效时长{}秒 token:{}", accessToken.getExpiresIn(), accessToken.getToken());
                     // 休眠7000秒
@@ -37,4 +38,4 @@ public class TokenThread implements Runnable {
             }
         }
     }
-}
+}

Деякі файли не було показано, через те що забагато файлів було змінено