ソースを参照

Merge branch 'set_pin'

# Conflicts:
#	netflix-service/src/main/java/com/cyksj/service/mange/group/CmsGroupServiceImpl.java
#	netflix-service/src/main/java/com/cyksj/service/mange/impl/CmsOrderDonServiceImpl.java
#	netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java
#	netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupsRelationNetflixServiceImpl.java
zoujiajian 2 年 前
コミット
4adf4d17f3

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/mange/group/CmsGroupServiceImpl.java

@@ -264,7 +264,7 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
             //设置奈飞用户座位
             if (account.getGoodsId() == 1) {
                 User user = userMapper.selectById(relation.getUserId());
-                groupsRelationNetflixService.timingSetNetflix(relation.getNum(), user.getNickname(), account.getAccount(), account.getPassword(), relation.getExpiryTime());
+	            groupsRelationNetflixService.timingSetNetflix(relation.getNum(), user.getNickname(), account.getAccount(), account.getPassword(), relation.getExpiryTime(), null);
             }
         }
         if (groupsRelations.isEmpty() && verifyCodeList != null && verifyCodeList.size() > 0) {

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/mange/impl/CmsOrderDonServiceImpl.java

@@ -701,7 +701,7 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
             User user = userMapper.selectById(newRelation.getUserId());
             GroupsTrips groupsTrips = groupsMapper.selectById(newRelation.getGroupsId());
             Account account = accountMapper.selectById(groupsTrips.getAccountId());
-            groupsRelationNetflixService.timingSetNetflix(newRelation.getNum(), user.getNickname(), account.getAccount(), account.getPassword(), newRelation.getExpiryTime());
+	        groupsRelationNetflixService.timingSetNetflix(newRelation.getNum(), user.getNickname(), account.getAccount(), account.getPassword(), newRelation.getExpiryTime(), null);
         }
 
         if (plusPurchaseSkuRelation != null && plus_relationList != null) {

+ 2 - 2
netflix-service/src/main/java/com/cyksj/service/relation/GroupsRelationNetflixService.java

@@ -12,9 +12,9 @@ import java.util.Date;
  */
 public interface GroupsRelationNetflixService {
 
-	JSONObject setNetflixSeatNum(Integer seatNum, String seatName, String account, String password, Date expiryTime);
+	JSONObject setNetflixSeatNum(Integer seatNum, String seatName, String account, String password, Date expiryTime, String code);
 
-	JSONObject setNetflixPin(Long relationId, long userId);
+	JSONObject setNetflixPin(Long relationId, long userId, String code);
 
 	Integer getPinStatus(String taskId) throws Exception;
 

+ 8 - 4
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupsRelationNetflixServiceImpl.java

@@ -1,6 +1,7 @@
 package com.cyksj.service.relation.impl;
 
 import cn.hutool.core.date.DateTime;
+import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONObject;
 import com.cyksj.common.constant.Constant;
@@ -55,13 +56,16 @@ public class GroupsRelationNetflixServiceImpl implements GroupsRelationNetflixSe
 	private final JobManager jobManager;
 
 	@Override
-	public JSONObject setNetflixSeatNum(Integer seatNum, String seatName, String account, String password, Date expiryTime) {
+	public JSONObject setNetflixSeatNum(Integer seatNum, String seatName, String account, String password, Date expiryTime, String code) {
 		JSONObject params = new JSONObject();
 		params.putOpt("username", account);
 		params.putOpt("password", password);
 		params.putOpt("seat_name", seatName);
 		params.putOpt("seat_num", seatNum);
 		params.putOpt("seat_time", expiryTime);
+		if (StrUtil.isNotBlank(code)) {
+			params.putOpt("pin_code", code);
+		}
 		//设置座位
 		String url = Constant.ZHAOJU_MOVIES + "/netflix_set/netflix_seat";
 		log.info("设置账号:{} 奈飞用户:{}座位信息", account, seatName);
@@ -90,7 +94,7 @@ public class GroupsRelationNetflixServiceImpl implements GroupsRelationNetflixSe
 	}
 
 	@Override
-	public JSONObject setNetflixPin(Long relationId, long userId) {
+	public JSONObject setNetflixPin(Long relationId, long userId, String code) {
 		List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
 		GroupsRelation relation = relationMapper.selectById(relationId);
 		if (!userIdList.contains(relation.getUserId())) {
@@ -102,7 +106,7 @@ public class GroupsRelationNetflixServiceImpl implements GroupsRelationNetflixSe
 			throw BusinessRuntimeException.getInstance("系统错误");
 		}
 		User user = userMapper.selectById(relation.getUserId());
-		return setNetflixSeatNum(relation.getNum(), user.getNickname(), account.getAccount(), account.getPassword(), relation.getExpiryTime());
+		return setNetflixSeatNum(relation.getNum(), user.getNickname(), account.getAccount(), account.getPassword(), relation.getExpiryTime(), code);
 	}
 
 	@Override
@@ -157,7 +161,7 @@ public class GroupsRelationNetflixServiceImpl implements GroupsRelationNetflixSe
 				timingSetNetflix(num, nickname, account, password, expiryTime);
 			});
 		} else {
-			setNetflixSeatNum(num, nickname, account, password, expiryTime);
+			setNetflixSeatNum(num, nickname, account, password, expiryTime, null);
 			log.info("当前时间:{}开始调用设置奈飞座位信息接口", DateTime.now());
 		}
 	}

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

@@ -842,9 +842,9 @@ public class GroupRelationController {
      * 设置pin码
      */
     @PutMapping("/set/pin/{relationId}")
-    public Result<String> setPin(@PathVariable Long relationId) {
+    public Result<String> setPin(@PathVariable Long relationId, String code) {
         long userId = StpUserUtil.getLoginIdAsLong();
-        JSONObject data = groupsRelationNetflixService.setNetflixPin(relationId, userId);
+        JSONObject data = groupsRelationNetflixService.setNetflixPin(relationId, userId, code);
         return GatewayResponse.SUCCESS.newBuilder().toResult(data.toString());
     }