|
|
|
|
7
|
import com.community.commom.hk.HKOpenApi;
|
7
|
import com.community.commom.hk.HKOpenApi;
|
8
|
import com.community.huiju.dao.*;
|
8
|
import com.community.huiju.dao.*;
|
9
|
import com.community.huiju.model.*;
|
9
|
import com.community.huiju.model.*;
|
|
|
10
|
+import com.community.huiju.service.IHKService;
|
10
|
import com.community.huiju.service.TaVistorServiceI;
|
11
|
import com.community.huiju.service.TaVistorServiceI;
|
11
|
import com.google.common.collect.Maps;
|
12
|
import com.google.common.collect.Maps;
|
12
|
import lombok.extern.slf4j.Slf4j;
|
13
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
50
|
@Autowired
|
51
|
@Autowired
|
51
|
private ToCommunitiesMapper toCommunitiesMapper;
|
52
|
private ToCommunitiesMapper toCommunitiesMapper;
|
52
|
|
53
|
|
|
|
54
|
+ @Autowired
|
|
|
55
|
+ private TaUserHkMapper taUserHkMapper;
|
|
|
56
|
+
|
|
|
57
|
+ @Autowired
|
|
|
58
|
+ private IHKService ihkService;
|
|
|
59
|
+
|
53
|
|
60
|
|
54
|
@Override
|
61
|
@Override
|
55
|
@Transactional(rollbackFor = Exception.class)
|
62
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
147
|
// 获取设备树,里面有 opUserId
|
154
|
// 获取设备树,里面有 opUserId
|
148
|
TpEquipmentTree tpEquipmentTree = tpEquipmentTreeMapper.selectByCommunityId(communityId);
|
155
|
TpEquipmentTree tpEquipmentTree = tpEquipmentTreeMapper.selectByCommunityId(communityId);
|
149
|
|
156
|
|
150
|
- TaUser taUser = taUserMapper.selectByPrimaryKey(userId);
|
|
|
|
|
157
|
+ TaUserHk taUserHk = taUserHkMapper.selectByUserIdAndCommunityId(userId, communityId);
|
|
|
158
|
+
|
151
|
String result = HKOpenApi.temporaryRegister(visitor.getVisitorName(),visitor.getVisitorTel(),
|
159
|
String result = HKOpenApi.temporaryRegister(visitor.getVisitorName(),visitor.getVisitorTel(),
|
152
|
Integer.valueOf(visitor.getVisitorNum()),visitor.getVisitorStartTime().getTime(),
|
160
|
Integer.valueOf(visitor.getVisitorNum()),visitor.getVisitorStartTime().getTime(),
|
153
|
- visitor.getVisitorEndTime().getTime(),taUser.getHkUserId(), tpEquipmentTree.getOpUserUuid(), tpEquipmentTree.getAppkey(), tpEquipmentTree.getSecret(), tpEquipmentTree.getHttpServer());
|
|
|
|
|
161
|
+ visitor.getVisitorEndTime().getTime(),taUserHk.getHkUserId(), tpEquipmentTree.getOpUserUuid(), tpEquipmentTree.getAppkey(), tpEquipmentTree.getSecret(), tpEquipmentTree.getHttpServer());
|
154
|
|
162
|
|
155
|
JSONObject resultJSON = JSONObject.parseObject(result);
|
163
|
JSONObject resultJSON = JSONObject.parseObject(result);
|
156
|
int errorCode = resultJSON.getInteger("errorCode");
|
164
|
int errorCode = resultJSON.getInteger("errorCode");
|