ソースを参照

保存提交一版

15810770710@163.com 3 年 前
コミット
e546745837

+ 1 - 0
src/main/java/info/aspirecn/iov/sjjh/supplier10000043/constant/SupplierProperties.java

@@ -22,4 +22,5 @@ public class SupplierProperties {
     private int hour;
     private long url3PhotoUp;
     private long url4PhotoUp;
+    private long url5PhotoUp;
 }

+ 25 - 1
src/main/java/info/aspirecn/iov/sjjh/supplier10000043/service/ChannelServiceImpl.java

@@ -1211,6 +1211,7 @@ public class ChannelServiceImpl implements ChannelService {
         if(countStr!=null && Long.parseLong(countStr)>=upCount){
             return false;
         }
+        //sky 调用达量标记 上游返回标记
         if(stringRedisTemplate.boundHashOps(hashKey).hasKey(key+SjjhConstant.key_subStr)){
             return false;
         }
@@ -1226,6 +1227,7 @@ public class ChannelServiceImpl implements ChannelService {
             //起一个线程,处理此逻辑,
             testNotify(channelId,2);
         }
+        //sky 问题3 处理并发出现的问题
         if(visitCount>upCount){
             reduceVisitCount(hashKey,key);
             return false;
@@ -1516,10 +1518,26 @@ public class ChannelServiceImpl implements ChannelService {
         if (outTime <= SjjhConstant.PARA_ZERO) {
             outTime = Constant.HTTPCLIENT_CONNECTTIMEOUT;
         }
+        // sky 通道跳转机制改动-1 start
+        String channelId = request.getHeader("channelId");
+        String key="url5"+photoIdentityMethod;
+        LocalDateTime now = LocalDateTime.now();
+        String ymd = dateTimeFormatter.format(now);
+        String hashKey = "043-"+ymd;
+        // sky channelId是通道id
+        boolean flag = checkVisitCount(hashKey,key,supplierProperties.getUrl5PhotoUp(),channelId);
+        if(!flag){
+            countOver(ret,returnType);
+            return ret;
+        }
+        // sky 通道跳转机制改动-1 end
         log.info("supplier10000043.photoIdentityCheckV5New---customBody={},outTime={}", customBody, outTime);
         if (!decodeType.equals(SjjhConstant.DECODE_TYPE_COMMON)) {
             customBody = decodeParams(ret, returnType, customBody, decodeType);
             if (StringUtils.isBlank(customBody)) {
+                //sky 通道跳转机制改动-2 start
+                reduceVisitCount(hashKey,key);
+                //sky 通道跳转机制改动-2 end
                 ret.setCode(Constant.SUCCESS);
                 request.setAttribute(Constant.LOG_UPSTREAM_RESPONSE_CODE, upstreamCode);
                 return ret;
@@ -1538,6 +1556,9 @@ public class ChannelServiceImpl implements ChannelService {
 
 
             if(!checkParm(name,idCode,returnType,ret)){
+                //sky 通道跳转机制改动-3 start
+                reduceVisitCount(hashKey,key);
+                //sky 通道跳转机制改动-3 end
                 return ret;
             }
 
@@ -1565,7 +1586,10 @@ public class ChannelServiceImpl implements ChannelService {
                     .replace("{photo}", photo);
             String result = nciicServices.nciicCompare(SjjhConstant.PHOTO_IDENTITY_SECRET_KEY_V5,paramXml);
             log.info("photoIdentityCheck上游返回xml:{}", result);
-            upstreamCode = setPhotoIdentityCheckResponse(ret, returnType, result);
+            //sky 通道跳转机制改动-4 start
+            //upstreamCode = setPhotoIdentityCheckResponse(ret, returnType, result);
+            upstreamCode = setPhotoIdentityCheckResponse(ret, returnType, result,key+SjjhConstant.key_subStr,channelId);
+            //sky 通道跳转机制改动-4 start
         }catch (WebServiceException exception){
             log.info("supplier10000043.photoIdentityCheckV5New接口-WebServiceException:{}", exception);
             ErrorUtils.captureException(exception);