|
@@ -24,6 +24,7 @@ import com.yx.face.service.UserInfoService;
|
|
|
import com.yx.face.service.feign.TBDeviceFaceService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
@@ -73,9 +74,13 @@ public class UserInfoServiceImpl implements UserInfoService {
|
|
|
@Autowired
|
|
|
private AsyncTriggerRetryImpl asyncTriggerRetryImpl;
|
|
|
|
|
|
+ @Value("${wx.phone.url}")
|
|
|
+ private String wxUrl;
|
|
|
+
|
|
|
@Override
|
|
|
public String getWxPhone(WxInfoDTO dto) {
|
|
|
- String sync = OkHttpUtils.builder().url("http://10.61.107.140:9810/winxin-fyzd/weiXin/getPhone")
|
|
|
+
|
|
|
+ String sync = OkHttpUtils.builder().url(wxUrl)
|
|
|
// 有参数的话添加参数,可多个
|
|
|
.addParam("code", dto.getCode())
|
|
|
.addParam("signature", dto.getSignature())
|
|
@@ -414,38 +419,5 @@ public class UserInfoServiceImpl implements UserInfoService {
|
|
|
}
|
|
|
return path;
|
|
|
}
|
|
|
-
|
|
|
- //发送失败重试三次
|
|
|
- @Override
|
|
|
- public Boolean triggerRetry(Map<String, Object> params) {
|
|
|
- Map<String, Object> result = new HashMap<>();
|
|
|
- int times = 1;
|
|
|
- while (times <= 3) {
|
|
|
- try {
|
|
|
- Thread.sleep(1000 * 20); // 休眠20秒
|
|
|
- result = tbDeviceFaceService.downUser(params);
|
|
|
- log.info("下发人脸重试downFace = {} 重试次数 {}", params, times);
|
|
|
- if (result.get("msg") != null) {
|
|
|
- String msg = result.get("msg").toString();
|
|
|
- if (msg.contains("不在线")) {
|
|
|
- times++;
|
|
|
- } else {
|
|
|
- //代表成功
|
|
|
- times = 6;
|
|
|
- }
|
|
|
- } else {
|
|
|
- times++;
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- times++;
|
|
|
- log.info("下发失败 原因 {}", e.getMessage());
|
|
|
- }
|
|
|
- }
|
|
|
- //成功
|
|
|
- if (times == 6) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- return false;
|
|
|
- }
|
|
|
}
|
|
|
|