Sfoglia il codice sorgente

修改人脸核验bug

hyq 5 anni fa
parent
commit
719140b184

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

@@ -52,7 +52,7 @@
                 <!--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 id="sub" type="primary" @click="handleSubmit('formValidate')">提交</i-button>
             <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
         </i-form>
     </Card>

+ 9 - 1
kmall-admin/src/main/webapp/js/faceid/type10ordernopay.js

@@ -433,6 +433,10 @@ var vm = new Vue({
             });
         },
         saveOrUpdate: function (event) {
+            var that = this;
+            let lodingMsg = that.$Message.loading('人脸验证中....', 6000);
+
+            $('#sub').attr('disabled', true);
             let url = '../face/checkLivenessRecognition';
             $.ajax({
                 type: "POST",
@@ -441,12 +445,16 @@ var vm = new Vue({
                 data: JSON.stringify(vm.faceLivenessRecognition),
                 success: function (r) {
                     if (r.code === 0) {
+                        setTimeout(lodingMsg, 0);
+                        // that.$Message.loading('视频已加载成功', 0);
                         alert(r.msg, function (index) {
                             vm.reload();
+                            $('#sub').attr('disabled', false);
                         });
                     } else {
-                        alert('活体人脸核身验证失败,失败原因:'+r.msg+';请重新录像!');
+                        alert('请重新录像!活体人脸核身验证失败,失败原因:'+r.msg+);
                         $('#ppBtn').attr('disabled', false);
+                        $('#sub').attr('disabled', false);
                     }
                 }
             });

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

@@ -22,6 +22,8 @@ public class FaceLivenessRecognitionReturnDataVo implements Serializable {
      * 商户订单编号
      */
     private String merchOrderSn;
+
+    private String orderSn;
     /**
      * 模板是否通知 0:否 1:是;
      */
@@ -85,6 +87,15 @@ public class FaceLivenessRecognitionReturnDataVo implements Serializable {
     public String getMerchOrderSn() {
         return merchOrderSn;
     }
+
+    public String getOrderSn() {
+        return orderSn;
+    }
+
+    public void setOrderSn(String orderSn) {
+        this.orderSn = orderSn;
+    }
+
     /**
      * 设置:模板是否通知 0:否 1:是;
      */

+ 19 - 9
kmall-api/src/main/java/com/kmall/api/service/ApiOrderService.java

@@ -92,6 +92,8 @@ public class ApiOrderService {
     private ApiUserCampMinusMapper apiUserCampMinusMapper;
     @Autowired
     private ApiFaceLivenessRecognitionReturnDataMapper apiFaceLivenessRecognitionReturnDataMapper;
+    @Autowired
+    private ApiSysConfigMapper apiSysConfigMapper;
 
     public OrderVo queryObject(Long id) {
         return apiOrderMapper.queryObject(id);
@@ -102,7 +104,10 @@ public class ApiOrderService {
     }
 
     public Map queryUcenterMap(Map<String, Object> map) {
-        return apiOrderMapper.queryUcenterMap(map);
+        Map queryMap = apiOrderMapper.queryUcenterMap(map);
+        String value = apiSysConfigMapper.queryByKey("IS_QUERY_CROSS_QUOTAL");
+        queryMap.put("isQueryCrossQuotal", value);
+        return queryMap;
     }
 
 
@@ -415,6 +420,7 @@ public class ApiOrderService {
         //开启事务,插入订单信息和订单商品
         if(orderInfoList != null && orderInfoList.size() > 0) {
             Boolean isOrderBizType10 = false;//订单中是否有保税展示跨境商品
+            List<String> orderSnList = new ArrayList<>();
             apiOrderMapper.saveBatch(orderInfoList);
 
             List<OrderProcessRecordEntity> processRecordEntityList = new ArrayList<>();
@@ -429,6 +435,7 @@ public class ApiOrderService {
                     if (orderInfo.getOrderBizType().equalsIgnoreCase(goodsItem.getGoodsBizType())) {
                         if(Dict.orderBizType.item_10.getItem().equalsIgnoreCase(goodsItem.getGoodsBizType())){
                             isOrderBizType10 = true;//订单中是否有保税展示跨境商品
+                            orderSnList.add(orderInfo.getOrder_sn());
                         }
                         GoodsVo goodsVo = apiGoodsMapper.queryObjectByStoreId(goodsItem.getGoods_id(), storeId);
                         if (goodsVo == null) {
@@ -494,7 +501,7 @@ public class ApiOrderService {
 
             //保税展示跨境商品保存是否核验信息
             if(isOrderBizType10) {
-                saveFaceData(merchOrderSn, userVo);
+                saveFaceData(merchOrderSn, orderSnList, userVo);
             }
 
             resultObj.put("errno", 0);
@@ -533,13 +540,16 @@ 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);
+    private void saveFaceData(String merchOrderSn, List<String> orderSnList, UserVo userVo){
+        for(int i=0;i<orderSnList.size();i++) {
+            FaceLivenessRecognitionReturnDataVo face = new FaceLivenessRecognitionReturnDataVo();
+            face.setMerchOrderSn(merchOrderSn);
+            face.setOrderSn(orderSnList.get(i));
+            face.setUserId(Integer.parseInt(String.valueOf(userVo.getId())));
+            face.setIsFaceCheck("0");
+            face.setIsTempNoti("0");
+            apiFaceLivenessRecognitionReturnDataMapper.save(face);
+        }
     }
 
     /**

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

@@ -6,6 +6,7 @@
     <resultMap type="com.kmall.api.entity.FaceLivenessRecognitionReturnDataVo" id="faceLivenessRecognitionReturnDataMap">
         <result property="id" column="id"/>
         <result property="merchOrderSn" column="merch_order_sn"/>
+		<result property="orderSn" column="order_sn"/>
         <result property="isTempNoti" column="is_temp_noti"/>
         <result property="isFaceCheck" column="is_face_check"/>
         <result property="userId" column="user_id"/>
@@ -21,6 +22,7 @@
 		select
 			`id`,
 			`merch_order_sn`,
+			order_sn,
 			`is_temp_noti`,
 			`is_face_check`,
 			`user_id`,
@@ -38,6 +40,7 @@
 		select
     		`id`,
     		`merch_order_sn`,
+			order_sn,
     		`is_temp_noti`,
     		`is_face_check`,
     		`user_id`,

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

@@ -42,7 +42,7 @@ public class FaceCheckUtil {
 
         Map map = new HashMap();
         map.put("data", params);
-        map.put("timestamp", System.currentTimeMillis());
+        map.put("timestamp", System.currentTimeMillis()/1000);
         map.put("merchId", faceIdRequestDto.getMerchId());
         String md5Salt = OmsMerchPropertiesBuilder.instance().getMd5Salt();
 

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

@@ -54,7 +54,7 @@ public class CrossBoundaryQuotalInquiryUtil {
 
     private static String buildRequestPost(String requestData){
         String url = OmsMerchPropertiesBuilder.instance().getQuotaInquiryUrl();
-//        String url = "http://192.168.1.121:8680/al/cus/quotaInquiry";
+//        String url = "http://192.168.1.121:8680/al/cus/yearLimit";
         // 同步访问,返回结果字符串
         Request request = OkHttpUtilss.buildRequest(url,requestData);
         // 同步访问,返回结果字符串

+ 3 - 0
kmall-schedule/src/main/webapp/WEB-INF/web.xml

@@ -32,6 +32,9 @@
         <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
     </listener>
 
+    <listener>
+        <listener-class>com.kmall.common.listener.QuartzContextListener</listener-class>
+    </listener>
 
     <servlet>
         <servlet-name>dispatcherServlet</servlet-name>

+ 4 - 1
wx-mall/pages/ucenter/index/index.js

@@ -10,6 +10,7 @@ Page({
     unEvalNum:0,
     userInfo: {},
     curUser:{},
+    isQueryCrossQuotal: null
   },
   onLoad: function (options) {
     // 页面初始化 options为页面跳转所带来的参数
@@ -71,8 +72,10 @@ Page({
               unPayNum: res.data.countMap.unPayNum,
               unPaymentNum: res.data.countMap.unPaymentNum,
               unTakeNum: res.data.countMap.unTakeNum,
-              unEvalNum: res.data.countMap.unEvalNum
+              unEvalNum: res.data.countMap.unEvalNum,
+              isQueryCrossQuotal: res.data.countMap.isQueryCrossQuotal
             });
+            console.log(res.data.countMap.isQueryCrossQuotal)
           }
         }
       });

+ 17 - 16
wx-mall/pages/ucenter/index/index.wxml

@@ -72,6 +72,23 @@
       </view>
       <!-- </navigator> -->
     </view>
+    <view class="item" bindtap='checkCardLogin'>
+      <!-- <navigator url="/pages/ucenter/idCard/idCard" class="a"> -->
+      <view class="a">
+        <image src="../../../static/images/service-sfz.png" class="icon"></image>
+        <text class="txt">实名认证</text>
+      </view>
+      <!-- </navigator> -->
+    </view>
+    
+    <view class="item" bindtap='crossBoundaryQuotaQuery' wx:if="{{isQueryCrossQuotal==1&&curUser.idNo&&userInfo.nickName!='点击头像登录'}}">
+      <!-- <navigator url="/pages/ucenter/idCard/idCard" class="a"> -->
+      <view class="a">
+        <image src="../../../static/images/edcx.png" class="icon"></image>
+        <text class="txt">跨境额度查询</text>
+      </view>
+      <!-- </navigator> -->
+    </view>
     <view class="item" bindtap='checkFootLogin'>
       <!-- <navigator url="/pages/ucenter/footprint/footprint" class="a"> -->
       <view class="a">
@@ -102,22 +119,6 @@
         <text class="txt">我的团购</text>
       </navigator>
     </view> -->
-    <view class="item" bindtap='checkCardLogin'>
-      <!-- <navigator url="/pages/ucenter/idCard/idCard" class="a"> -->
-      <view class="a">
-        <image src="../../../static/images/service-sfz.png" class="icon"></image>
-        <text class="txt">实名认证</text>
-      </view>
-      <!-- </navigator> -->
-    </view>
-    <view class="item" bindtap='crossBoundaryQuotaQuery' wx:if="{{curUser.idNo&&userInfo.nickName!='点击头像登录'}}">
-      <!-- <navigator url="/pages/ucenter/idCard/idCard" class="a"> -->
-      <view class="a">
-        <image src="../../../static/images/edcx.png" class="icon"></image>
-        <text class="txt">跨境额度查询</text>
-      </view>
-      <!-- </navigator> -->
-    </view>
     <view class="item" wx:if="{{!curUser.mobile&&userInfo.nickName!='点击头像登录'}}" bindtap="bindMobile">
       <!-- <navigator url="/pages/ucenter/feedback/feedback" class="a"> -->
       <view class="a">