Merge pull request !15 from Radar/develop
This commit is contained in:
Radar
2022-08-14 07:39:32 +00:00
committed by Gitee
4 changed files with 9 additions and 3 deletions

View File

@@ -97,7 +97,7 @@ public class RiskAnalysisEngineServiceImpl implements RiskAnalysisEngineService
// 3. save to db
boolean isAllowDuplicate = false;
if (isDuplicate != null && isDuplicate.equals("true")) {
if (isDuplicate != null && "true".equals(isDuplicate)) {
isAllowDuplicate = true;
}
entityService

View File

@@ -25,7 +25,7 @@ import java.util.stream.Collectors;
@Service
@ConditionalOnProperty(prefix = "sys.conf",name="app", havingValue = "engine")
//@ConditionalOnProperty(prefix = "sys.conf",name="app", havingValue = "engine")
public class MobileInfoServiceImpl implements MobileInfoService {
public static Logger logger = LoggerFactory.getLogger(MobileInfoServiceImpl.class);

View File

@@ -68,6 +68,7 @@ public class EntityServiceImpl implements EntityService {
Document attach = Document.parse(attachJson);
ModelVO model = modelService.getModelById(modelId);
attach.put("radar_ref_datetime", new Date(doc.getLong(model.getReferenceDate())));
attach.put("status", 1);
doc.putAll(attach);
if (!isAllowDuplicate) {
//设置查询条件

View File

@@ -204,9 +204,14 @@ public class ModelServiceImpl extends BaseLocalCacheService implements ModelServ
IndexOptions options = new IndexOptions();
options.expireAfter((long) eventExpireDays, TimeUnit.DAYS);
IndexModel ttlIndex = new IndexModel(ttlKeys, options);
indexes.add(ttlIndex);
// add status.
Document statusKey = new Document();
statusKey.put("status", 1);
IndexModel statusIndex = new IndexModel(statusKey);
indexes.add(statusIndex);
mongoService.getCollection(collectionName).createIndexes(indexes);
//