|
|
@@ -13,20 +13,29 @@ import com.zd.alg.forward.serivce.mqtt.CommonSend;
|
|
|
import com.zd.alg.forward.utils.Base64DecodedMultipartFile;
|
|
|
import com.zd.alg.forward.utils.FileUploadUtils;
|
|
|
import com.zd.alg.forward.utils.HttpUtils;
|
|
|
+import com.zd.algorithm.api.alarm.entity.AlarmEntrty;
|
|
|
+import com.zd.algorithm.api.alarm.entity.Routes;
|
|
|
+import com.zd.algorithm.api.alarm.entity.SendTypes;
|
|
|
import com.zd.algorithm.api.alarm.feign.RemoteAlarmService;
|
|
|
+import com.zd.base.api.feign.RemoteFileService;
|
|
|
import com.zd.common.core.exception.ServiceException;
|
|
|
import com.zd.common.core.redis.RedisService;
|
|
|
import com.zd.common.core.utils.ServletUtils;
|
|
|
import com.zd.common.core.utils.StringUtils;
|
|
|
import com.zd.common.mqtt.model.MessageBody;
|
|
|
+import com.zd.laboratory.api.feign.RemoteLaboratoryService;
|
|
|
import com.zd.model.constant.Constants;
|
|
|
+import com.zd.model.constant.SecurityConstants;
|
|
|
import com.zd.model.domain.R;
|
|
|
+import com.zd.model.entity.Algorithm;
|
|
|
+import com.zd.model.entity.SysFile;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
|
|
import org.springframework.core.io.FileSystemResource;
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.http.HttpEntity;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.http.MediaType;
|
|
|
@@ -64,6 +73,9 @@ public class CheckService {
|
|
|
private RedisService redisService;
|
|
|
|
|
|
@Autowired
|
|
|
+ private RedisTemplate redisTemplate;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private RemoteAlarmService remoteAlarmService;
|
|
|
|
|
|
@Autowired
|
|
|
@@ -130,7 +142,9 @@ public class CheckService {
|
|
|
}
|
|
|
logger.info("===============5=================");
|
|
|
R algorithm = saveAlgorithm(send, checkValid);
|
|
|
- if (algorithm.getCode() != 200) return algorithm;
|
|
|
+ if (algorithm.getCode() != 200) {
|
|
|
+ return algorithm;
|
|
|
+ }
|
|
|
DataPostAnalysisRespDto data = send.getData();
|
|
|
|
|
|
Map<String, Object> result = (Map<String, Object>) data.getAnalysisDatas().get(0).getResult();
|
|
|
@@ -147,7 +161,7 @@ public class CheckService {
|
|
|
//如果没有通过则次数加一
|
|
|
//键为前缀+签到id +下划线+验证类型
|
|
|
String key = Constants.SINGIN_CHECK_JUMP_KEY + id + "_" + code;
|
|
|
- Long increment = redisService.redisTemplate.opsForValue().increment(key);
|
|
|
+ Long increment = redisTemplate.opsForValue().increment(key);
|
|
|
redisService.expire(key, Constants.SINGIN_OUT_TIME);
|
|
|
if (increment != null && increment >= Integer.parseInt(labCheckCount)) {
|
|
|
//黎晨这里让把跳过时状态码改为700,所以700的含义为检查失败并且跳过
|
|
|
@@ -215,7 +229,7 @@ public class CheckService {
|
|
|
//如果没有通过则次数加一
|
|
|
//键为前缀+签到id +下划线+验证类型
|
|
|
String key = Constants.SINGIN_CHECK_JUMP_KEY + id + "_" + code;
|
|
|
- Long increment = redisService.redisTemplate.opsForValue().increment(key);
|
|
|
+ Long increment = redisTemplate.opsForValue().increment(key);
|
|
|
redisService.expire(key, Constants.SINGIN_OUT_TIME);
|
|
|
if (increment >= algorithmYml.getJumpThreshold()) {
|
|
|
//黎晨这里让把跳过时状态码改为700,所以700的含义为检查失败并且跳过
|
|
|
@@ -389,7 +403,7 @@ public class CheckService {
|
|
|
Map<String, Boolean> map = new HashMap(1);
|
|
|
//键为前缀+签到id +下划线+验证类型
|
|
|
String key = Constants.SINGIN_CHECK_JUMP_KEY + id + "_" + code;
|
|
|
- Long increment = redisService.redisTemplate.opsForValue().increment(key);
|
|
|
+ Long increment = redisTemplate.opsForValue().increment(key);
|
|
|
redisService.expire(key, Constants.SINGIN_OUT_TIME);
|
|
|
Boolean isJump = increment >= algorithmYml.getJumpThreshold();
|
|
|
map.put("jump", isJump);
|