Explorar el Código

Merge branch 'master' into pre

# Conflicts:
#	netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java
zoujiajian hace 2 años
padre
commit
580664923b

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/relation/GroupRelationFrontService.java

@@ -38,7 +38,7 @@ public interface GroupRelationFrontService {
 	/**
 	 * 获取车票账号登录 验证码
 	 */
-	String getAiVerifyCode(Long userId, Long relationId, Integer type) throws Exception;
+	String getAiVerifyCode(Long userId, Long relationId, Integer type, Boolean sync) throws Exception;
 
 
 	void checkGroupsAvailParkingNum(Long skuId, Long groupsId, Integer availableParkingNum, Integer maxNum);

+ 6 - 3
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java

@@ -499,7 +499,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 	}
 
 	@Override
-	public String getAiVerifyCode(Long userId, Long relationId, Integer type) throws Exception {
+	public String getAiVerifyCode(Long userId, Long relationId, Integer type, Boolean sync) throws Exception {
 		List<Long> relationUserIdList = userBindRelationService.getRelationUserIdList(userId, null);
 		RenewalView renewalView = beanSearcher.searchFirst(RenewalView.class, MapUtils.builder().field(RenewalView::getUserId, relationUserIdList).op(Operator.InList)
 				.field(RenewalView::getRelationId, relationId).build());
@@ -543,7 +543,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 		if (execute.getStatus() != HttpStatus.HTTP_OK) {
 			throw BusinessRuntimeException.getInstance("获取验证码异常,请联系客服...");
 		}
-		String code = getDifferentGoodsCode(renewalView.getGoodsId(), execute.body(), type);
+		String code = getDifferentGoodsCode(renewalView.getGoodsId(), execute.body(), type, sync);
 		GroupsRelationLoginCodeRecord record = new GroupsRelationLoginCodeRecord();
 		record.setUserId(userId);
 		record.setRelationId(relationId);
@@ -741,7 +741,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 		return expiryTickets;
 	}
 
-	public String getDifferentGoodsCode(Long goodsId, String body, Integer type) {
+	public String getDifferentGoodsCode(Long goodsId, String body, Integer type, Boolean sync) {
 		String code = null;
 		//奈飞
 		if (goodsId == 1) {
@@ -759,6 +759,9 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 				}
 				if (StrUtil.isNotBlank(code)) {
 					String url = urlPref + code;
+					//非点击装置同步更新按钮 直接返回链接
+					if (!sync) return url;
+					//失败返回验证链接
 					if (!groupsRelationNetflixService.confirmUpdate(url)) {
 						return url;
 					}

+ 2 - 2
netflix-web/src/main/java/com/cyksj/web/controller/group/GroupRelationController.java

@@ -617,9 +617,9 @@ public class GroupRelationController {
      * 读取车票账号登录验证码
      */
     @GetMapping("/get/verifyCode/{relationId}")
-    public Result<String> getAiVerifyCode(@PathVariable Long relationId, Integer type) throws Exception {
+    public Result<String> getAiVerifyCode(@PathVariable Long relationId, Integer type, @RequestParam(defaultValue = "0") Boolean sync) throws Exception {
         long userId = StpUserUtil.getLoginIdAsLong();
-        return GatewayResponse.SUCCESS.newBuilder().toResult(groupRelationFrontService.getAiVerifyCode(userId, relationId, type));
+        return GatewayResponse.SUCCESS.newBuilder().toResult(groupRelationFrontService.getAiVerifyCode(userId, relationId, type, sync));
     }
 
     /**