|
|
@@ -5,11 +5,15 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.fdkankan.fusion.common.util.DateUtils;
|
|
|
import com.fdkankan.fusion.common.util.UploadToOssUtil;
|
|
|
+import com.fdkankan.fusion.config.FusionConfig;
|
|
|
import com.fdkankan.fusion.entity.*;
|
|
|
+import com.fdkankan.fusion.httpClient.HaixinService;
|
|
|
+import com.fdkankan.fusion.httpClient.response.HaixinCaseInfo;
|
|
|
import com.fdkankan.fusion.service.*;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
import io.netty.util.internal.UnstableApi;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -35,13 +39,15 @@ public class TaskService {
|
|
|
ICaseSettingsService caseSettingsService;
|
|
|
@Autowired
|
|
|
ICaseFusionService caseFusionService;
|
|
|
-
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ ICaseService caseService;
|
|
|
@Autowired
|
|
|
RedisUtil redisUtil;
|
|
|
+
|
|
|
+
|
|
|
@PostConstruct
|
|
|
public void cleanRedisKey(){
|
|
|
- String redisKey = String.format(downProcessKey, "*");
|
|
|
+ String redisKey = String.format("fusion:down:offline:process", "*");
|
|
|
Set<String> keys = redisUtil.keys(redisKey);
|
|
|
if(keys != null && !keys.isEmpty()){
|
|
|
for (String key : keys) {
|
|
|
@@ -242,4 +248,35 @@ public class TaskService {
|
|
|
caseFilesTypeIconService.save(caseFilesTypeIcon);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 定时获取警情编号
|
|
|
+ */
|
|
|
+ @Autowired
|
|
|
+ HaixinService haixinService;
|
|
|
+ @Autowired
|
|
|
+ FusionConfig fusionConfig;
|
|
|
+ @Scheduled(initialDelay = 2000,fixedDelay = 1000 * 60 * 60 *24)
|
|
|
+ public void getJqNumber() {
|
|
|
+ if(StringUtils.isBlank(fusionConfig.getPushDrawUrl())){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ log.info("调用海鑫接口获取警情编号");
|
|
|
+ LambdaQueryWrapper<CaseEntity> wrapper= new LambdaQueryWrapper<>();
|
|
|
+ wrapper.isNotNull(CaseEntity::getKNumber);
|
|
|
+ wrapper.isNull(CaseEntity::getJqNumber);
|
|
|
+ List<CaseEntity> list = caseService.list(wrapper);
|
|
|
+ if(list == null || list.isEmpty()){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ for (CaseEntity caseEntity : list) {
|
|
|
+ HaixinCaseInfo haixinCaseInfo = haixinService.queryScene(caseEntity.getKNumber());
|
|
|
+ if(haixinCaseInfo != null && StringUtils.isNotBlank(haixinCaseInfo.getAlarmNo())){
|
|
|
+ LambdaUpdateWrapper<CaseEntity> updateWrapper= new LambdaUpdateWrapper<>();
|
|
|
+ updateWrapper.eq(CaseEntity::getCaseId,caseEntity.getCaseId());
|
|
|
+ updateWrapper.set(CaseEntity::getJqNumber,haixinCaseInfo.getAlarmNo());
|
|
|
+ caseService.update(updateWrapper);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|