魏熙美 пре 6 година
родитељ
комит
b6618cc2df

+ 10
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaVistorServiceImpl.java Прегледај датотеку

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