|
|
@@ -1,5 +1,6 @@
|
|
|
package com.cyksj.service.relation.impl;
|
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
import com.cyksj.common.constant.Constant;
|
|
|
@@ -48,13 +49,16 @@ public class GroupsRelationNetflixServiceImpl implements GroupsRelationNetflixSe
|
|
|
private final UserBindRelationService userBindRelationService;
|
|
|
|
|
|
@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);
|
|
|
@@ -83,7 +87,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())) {
|
|
|
@@ -95,7 +99,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
|