Commit a8a266a6 authored by wujiang's avatar wujiang

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents 9653642d 91e833ee
......@@ -39,6 +39,7 @@ class SqlStatement extends BaseSqlCondition {
private static final Map<String, String[]> valueTagFieldSqlMap;
private static final Pattern numberPattern = Pattern.compile("^[-\\+]?[\\d]+[.]?[\\d]*$");
private static final Pattern datePattern = Pattern.compile("^[\\d]{4}-[\\d]{2}-[\\d]{2} [\\d]{2}:[\\d]{2}:[\\d]{2}$");
private static final Pattern datePattern13 = Pattern.compile("^[\\d]{4}/[\\d]{2}/[\\d]{2} [\\d]{2}:[\\d]{2}$");
/**
* 字段类型
......@@ -102,35 +103,47 @@ class SqlStatement extends BaseSqlCondition {
}
boolean emptyVal = ValidationUtil.isEmpty(values);
if (fieldType != FieldType.textTag) {
switch (valueType) {
String val1 = values.get(0);
String val2 = "";
switch (valueType) {
case text:
//格式化
if (!emptyVal && !ValidationUtil.isEmpty(values.get(0))) {
values.add(0, stringParamFormat(values.get(0)));
if (!emptyVal && !ValidationUtil.isEmpty(val1)) {
values.add(0, stringParamFormat(val1));
values.remove(1);
}
break;
case date:
// 校验并格式化
if (!emptyVal && !ValidationUtil.isEmpty((values.get(0)))) {
paramValidate(datePattern, values.get(0));
values.add(0, stringParamFormat(values.get(0)));
if (!emptyVal && !ValidationUtil.isEmpty(val1)) {
if (val1.contains("/") && val1.length() == 16) {
paramValidate(datePattern13, val1);
} else {
paramValidate(datePattern, val1);
}
values.add(0, stringParamFormat(val1));
values.remove(1);
}
if (!emptyVal && values.size() > 1 && !ValidationUtil.isEmpty((values.get(1)))) {
paramValidate(datePattern, values.get(1));
values.add(1, stringParamFormat(values.get(1)));
val2 = values.get(1);
if (!emptyVal && !ValidationUtil.isEmpty(val2)) {
if (val2.contains("/") && val1.length() == 16) {
paramValidate(datePattern13, val2);
} else {
paramValidate(datePattern, val2);
}
values.add(1, stringParamFormat(val2));
values.remove(2);
}
break;
case range:
case single:
// 校验
if (!emptyVal && !ValidationUtil.isEmpty((values.get(0)))) {
paramValidate(numberPattern, values.get(0));
if (!emptyVal && !ValidationUtil.isEmpty(val1)) {
paramValidate(numberPattern, val1);
}
if (!emptyVal && values.size() > 1 && !ValidationUtil.isEmpty((values.get(1)))) {
paramValidate(numberPattern, values.get(1));
val2 = values.get(1);
if (!emptyVal && !ValidationUtil.isEmpty(val2)) {
paramValidate(numberPattern, val2);
}
break;
default:
......
......@@ -310,13 +310,13 @@ public class DocLibraryService {
List<ESDocEntity> esList = new ArrayList<>();
iPage.getRecords().forEach(doc -> {
ESDocEntity esDocEntity = esDocService.queryById(doc.getSequenceNbr());
if (ValidationUtil.isEmpty(esDocEntity)) {
throw new BadRequest("ES库数据丢失,请联系管理员协助解决");
if (!ValidationUtil.isEmpty(esDocEntity)) {
// throw new BadRequest("ES库数据丢失,请联系管理员协助解决");
Set<String> involvedTagIds = sqlCondition.getTagSeqs();
deleteRepeatedTags(esDocEntity.getDocTags(), involvedTagIds);
deleteRepeatedTags(esDocEntity.getContentTags(), involvedTagIds);
esList.add(esDocEntity);
}
Set<String> involvedTagIds = sqlCondition.getTagSeqs();
deleteRepeatedTags(esDocEntity.getDocTags(), involvedTagIds);
deleteRepeatedTags(esDocEntity.getContentTags(), involvedTagIds);
esList.add(esDocEntity);
});
fillDirectoryName(esList);
return page.setRecords(esList).setCurrent(iPage.getCurrent()).setSize(iPage.getSize()).setTotal(iPage.getTotal());
......
......@@ -96,8 +96,9 @@ public class ESDocService {
}
catch (Exception e)
{
return new AggregatedPageImpl<>(list, PageRequest.of(current, size), 0);
e.printStackTrace();
}
return new AggregatedPageImpl<>(list, PageRequest.of(current, size), 0);
}
/**
......@@ -129,12 +130,12 @@ public class ESDocService {
for (String key : keys) {
boolMust.must(
QueryBuilders.boolQuery().minimumShouldMatch(1)
.should(QueryBuilders.matchQuery("docTitle", key))
.should(QueryBuilders.matchQuery("docInfo", key))
.should(QueryBuilders.matchQuery("author", key))
.should(QueryBuilders.matchQuery("textContent", key))
.should(QueryBuilders.matchQuery("docTags.tagInfo", key))
.should(QueryBuilders.matchQuery("contentTags.tagInfo", key))
.should(QueryBuilders.matchPhraseQuery("docTitle", key))
.should(QueryBuilders.matchPhraseQuery("docInfo", key))
.should(QueryBuilders.matchPhraseQuery("author", key))
.should(QueryBuilders.matchPhraseQuery("textContent", key))
.should(QueryBuilders.matchPhraseQuery("docTags.tagInfo", key))
.should(QueryBuilders.matchPhraseQuery("contentTags.tagInfo", key))
);
}
// 创建查询构造器
......
......@@ -405,7 +405,9 @@
<if test="companyId != null and companyId != ''">and ppn.original_id = #{companyId}</if>
<if test="taskType != null and taskType != ''">and ppn.check_type_id = #{taskType}</if>
<if test="planTaskId != null and planTaskId > 0 ">and ptd.task_no = #{planTaskId}</if>
<if test="orderBy != null and orderBy != ''">order by ${orderBy}</if>
<!-- <if test="orderBy != null and orderBy != ''">order by ${orderBy}</if>-->
order by p.id
<if test="offset != null and pageSize != null">
limit #{offset},#{pageSize}
</if>
......
......@@ -22,5 +22,12 @@
<artifactId>jpush-client</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment