Merge remote-tracking branch 'origin/fix_20230911_UAT' into fix_20230911_UAT

This commit is contained in:
gaosong
2023-10-28 09:46:35 +08:00
3 changed files with 218 additions and 67 deletions
@@ -47,6 +47,7 @@ import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@@ -99,6 +100,13 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
}
//删除英文标题
mapList.remove(index);
for (Map<String, Object> map : mapList) {
if("title".equals(map.get("db_field_name"))
&& CutEnum.EN.getValue().equals(cut)){
map.put("db_field_name","title_en");
}
}
//添加正文
Map<String, Object> map = new HashMap<>();
if(CutEnum.CN.getValue().equals(cut)){
@@ -213,7 +221,7 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
JSONArray jsonArrySort = new JSONArray();
JSONObject sort = new JSONObject();
Map<String,Object> mapSort = new HashMap<>();
Map<String,Object> mapSortTemp = new HashMap<>();
Map<String,Object> mapSortTemp = new LinkedHashMap<>();
if(StringUtils.isNotBlank(orderBy) && StringUtils.isNotBlank(orderByField)){
//orderBy=1正序,orderBy=1倒序
if("1".equals(orderBy)){
@@ -227,10 +235,28 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
mapSortTemp.put(orderByField,mapSort);
}
}else{
mapSortTemp.put("serial_number.keyword","asc");
if(ObjectUtils.isNotEmpty(((Map<String, Object>) map.get("mapOne")).get("serial_number"))
|| ObjectUtils.isNotEmpty(((Map<String, Object>) map.get("mapTwo")).get("serial_number"))
|| ObjectUtils.isNotEmpty(((Map<String, Object>) map.get("mapOne")).get("title"))
|| ObjectUtils.isNotEmpty(((Map<String, Object>) map.get("mapTwo")).get("title"))
|| ObjectUtils.isNotEmpty(((Map<String, Object>) map.get("mapOne")).get("title_en"))
|| ObjectUtils.isNotEmpty(((Map<String, Object>) map.get("mapTwo")).get("title_en"))){
Map<String,Object> score = new HashMap<>();
score.put("order","desc");
mapSortTemp.put("_score",score);
// Map<String,Object> map1 = new HashMap<>();
// map1.put("order","desc");
// mapSortTemp.put("serial_number.keyword",map1);
sort = new JSONObject(mapSortTemp);
}else{
mapSortTemp.put("serial_number.keyword","asc");
sort.putAll(mapSortTemp);
}
// sort.putAll(mapSortTemp);
// mapSortTemp.put("create_time","desc");
}
sort.putAll(mapSortTemp);
jsonArrySort.add(sort);
//封装查询条件
@@ -330,26 +356,67 @@ public class DocumentSearchServiceImpl implements IDocumentSearchService {
String value = (String) entry.getValue();
if (ObjectUtils.isNotEmpty(value)) {
for (String s : value.split(",")) {
Map<String, Object> map = new HashMap<>();
Map<String, Object> queryMap = new HashMap<>();
Map<String, Object> queryMapTemp = new HashMap<>();
JSONArray should = new JSONArray();
s = s.toLowerCase();
if(s.contains(" ")){
for (String valueTemp : s.split(" ")) {
Map<String,Object> mapTemp = new HashMap();
mapTemp.put(key,"*"+valueTemp+"*");
Map<String,Object> map1 = new HashMap<>();
map1.put("wildcard",mapTemp);
should.add(map1);
}
JSONObject jsonObject = jeroElasticsearchTemplate.buildBoolQuery(null, null, should);
must.add(jsonObject);
}else{
Map<String, Object> map = new HashMap<>();
Map<String, Object> queryMap = new HashMap<>();
Map<String, Object> queryMapTemp = new HashMap<>();
if (key.equals("serial_number")){
s = s.toLowerCase();
queryMap.put(key, "*" + s + "*");
map.put("wildcard", queryMap);
} else {
s = s.toLowerCase();
queryMapTemp.put("query", s);
queryMapTemp.put("minimum_should_match", 2);
queryMap.put(key, queryMapTemp);
map.put("match",queryMap);
if (key.equals("serial_number")){
s = s.toLowerCase();
queryMap.put(key, "*" + s + "*");
map.put("wildcard", queryMap);
} else {
s = s.toLowerCase();
queryMapTemp.put("query", s);
queryMapTemp.put("minimum_should_match", 2);
queryMap.put(key, queryMapTemp);
map.put("match",queryMap);
}
must.add(map);
}
must.add(map);
}
}
}
}
//封装输入框查询条件
// if (ObjectUtils.isNotEmpty(inputMap)) {
// for (Map.Entry<String, Object> entry : inputMap.entrySet()) {
// String key = entry.getKey();
// String value = (String) entry.getValue();
// if (ObjectUtils.isNotEmpty(value)) {
// for (String s : value.split(",")) {
// Map<String, Object> map = new HashMap<>();
// Map<String, Object> queryMap = new HashMap<>();
// Map<String, Object> queryMapTemp = new HashMap<>();
//
// if (key.equals("serial_number")){
// s = s.toLowerCase();
// queryMap.put(key, "*" + s + "*");
// map.put("wildcard", queryMap);
// } else {
// s = s.toLowerCase();
// queryMapTemp.put("query", s);
// queryMapTemp.put("minimum_should_match", 2);
// queryMap.put(key, queryMapTemp);
// map.put("match",queryMap);
// }
// must.add(map);
// }
// }
// }
// }
//封装下拉,树形查询条件
if (ObjectUtils.isNotEmpty(otherMap)) {
for (Map.Entry<String, Object> entry : otherMap.entrySet()) {
@@ -62,7 +62,8 @@
</div>
<div class="table-page-search-submitButtons submitButtons">
<a-button class="box-button" @click="searchReset">{{$t('reset')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery">{{$t('query')}}
</a-button>
</div>
</div>
<div class="text-right">
@@ -106,13 +107,29 @@
<a @click="handleCompare(record)" class="text-operation"> {{$t('Push')}}</a>
</span>
<span slot="serial_number" slot-scope="text,record">
<span style="cursor: pointer" :title="record.serial_number" class="textName" v-html="record.serial_number"
@click="titleClick(record)"></span>
<a-tooltip placement="topLeft" overlayClassName="tooltip-index" :mouseEnterDelay="0.5">
<template slot="title">
<span v-html="record.serial_number"></span>
</template>
<span style="cursor: pointer" class="textName" v-html="record.serial_number"
@click="titleClick(record)"></span>
</a-tooltip>
<!-- <span style="cursor: pointer" class="textName" v-html="record.serial_number"-->
<!-- @click="titleClick(record)"></span>-->
</span>
<span slot="titleName" slot-scope="text,record">
<span style="cursor: pointer" class="textName" v-html="language == 'en-us'?record.title_en:record.title"
:title="language == 'en-us'?record.title_en:record.title"
@click="titleClick(record)"></span>
<a-tooltip placement="topLeft" overlayClassName="tooltip-index" :mouseEnterDelay="0.5">
<template slot="title">
<span v-html="language == 'en-us'?record.title_en:record.title"></span>
</template>
<span style="cursor: pointer" class="textName"
v-html="language == 'en-us'?record.title_en:record.title"
:title="language == 'en-us'?record.title_en:record.title"
@click="titleClick(record)"></span>
</a-tooltip>
<!-- <span style="cursor: pointer" class="textName" v-html="language == 'en-us'?record.title_en:record.title"-->
<!-- :title="language == 'en-us'?record.title_en:record.title"-->
<!-- @click="titleClick(record)"></span>-->
</span>
<span slot="file_name" slot-scope="text,record">
<a style="color:#21c9cc" @click="fileNameClick(record)">
@@ -246,7 +263,7 @@
components: {
libraryPush
},
mixins:[ResizeHeader, ResizeColumnProvide],
mixins: [ResizeHeader, ResizeColumnProvide],
data() {
return {
searchOption: [],
@@ -363,7 +380,7 @@
searchQueryOne: {},
orderBy: '1',
orderByField: '',
language:localStorage.getItem('language'),
language: localStorage.getItem('language')
}
},
watch: {
@@ -632,10 +649,15 @@
postAction(this.url.getInfoList, query).then((res) => {
if (res.success) {
this.dataSource = res.result.records
let text = this.queryParam[this.selectModel] ? this.queryParam[this.selectModel].split(' ') : []
this.dataSource.forEach((val) => {
if (val[this.selectModel] && val[this.selectModel].includes(this.queryParam[this.selectModel])) {
val[this.selectModel] = val[this.selectModel].replace(this.queryParam[this.selectModel], `<text style="color:#21c9cc">${this.queryParam[this.selectModel]}</text>`)
}
text.forEach(ol => {
// if (val[this.selectModel] && val[this.selectModel].includes(ol)) {
if (val[this.selectModel]) {
val[this.selectModel] = val[this.selectModel].replace(ol, `<text style="color:#21c9cc">${ol}</text>`)
}
// }
})
})
this.total = res.result.total
this.loading = false
@@ -703,7 +725,7 @@
} else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank')
}else if(fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg'){
} else if (fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank')
} else {
@@ -741,7 +763,7 @@
}
</style>
<style lang="less" scoped>
@import'~@assets/less/common.less';
@import '~@assets/less/common.less';
.search-con-text {
@@ -960,7 +982,7 @@
/* max-width: calc(100% - 126px) !important;*/
/*}*/
/deep/.ant-table-thead > tr > th {
/deep/ .ant-table-thead > tr > th {
font-weight: bolder;
}
@@ -19,7 +19,7 @@
<span>{{$t('standard')}}</span>
</div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('standard')"
v-model="queryParam.serialNumber"></j-input>
v-model="queryParam.serial_number"></j-input>
</div>
</a-col>
<template v-if="toggleSearchStatus">
@@ -34,16 +34,27 @@
</a-col>
<a-col :md="12" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('areaOfResponsibility')">
<span>{{$t('areaOfResponsibility')}}</span>
<div class="title-text" :title="$t('status')">
<span>{{$t('status')}}</span>
</div>
<j-dict-select-tag class="box-input"
v-model="queryParam.dutyTerritory"
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
<j-dict-select-tag class="box-input" v-model="queryParam.state"
:placeholder="$t('PleaseSelect')+$t('status')"
:type="'select'"
:triggerChange="false" :dictCode="'duty_territory'"/>
:triggerChange="false" :dictCode="'state'"/>
</div>
</a-col>
<!-- <a-col :md="12" :sm="8">-->
<!-- <div class="box-title-text">-->
<!-- <div class="title-text" :title="$t('areaOfResponsibility')">-->
<!-- <span>{{$t('areaOfResponsibility')}}</span>-->
<!-- </div>-->
<!-- <j-dict-select-tag class="box-input"-->
<!-- v-model="queryParam.dutyTerritory"-->
<!-- :placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"-->
<!-- :type="'select'"-->
<!-- :triggerChange="false" :dictCode="'duty_territory'"/>-->
<!-- </div>-->
<!-- </a-col>-->
</template>
<span style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="12" :sm="24">
@@ -53,6 +64,9 @@
</a>
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
<globalAdvancedQuery ref="globalAdvancedQueryRef"
@handleSuperQuery="handleSuperQuery"
:fieldList="fieldList"/>
</a-col>
</span>
</a-row>
@@ -70,18 +84,18 @@
:loading="loading">
</a-table>
</div>
<!-- <div class="page" v-if="dataList.length > 0">
<a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:total="total"
:current="pageNo"
@change="onChange"
@showSizeChange="SizeChange"
/>
</div>-->
<div class="page" v-if="dataList.length > 0">
<a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:total="total"
:current="pageNo"
@change="onChange"
@showSizeChange="SizeChange"
/>
</div>
</div>
@@ -96,21 +110,27 @@
<script>
import { getAction, postAction } from '@/api/manage'
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
import globalAdvancedQuery from '@/components/globalAdvancedQuery/index'
export default {
name: 'addCodeNumber',
mixins: [ResizeHeader, ResizeColumnProvide],
components: {
globalAdvancedQuery
},
data() {
return {
url: {
addModelList: '/project/projectLawsInventoryEO/list'
//project/projectLawsInventoryEO/list
addModelList: '/project/projectLawsInventoryEO/queryPageDummy',
queryConditionInventory: '/project/projectLawsInventoryEO/queryConditionInventory',
},
visible: false,
toggleSearchStatus: false,
columns: [
{
title: this.$t('standard'),
dataIndex: 'serialNumber',
dataIndex: 'serial_number',
align: 'left',
ellipsis: true,
width: 250
@@ -123,18 +143,25 @@
width: 250
},
{
title: this.$t('certificationType'),
dataIndex: 'attestationType_dictText',
title: this.$t('zoneOfApplication'),
dataIndex: 'region',
align: 'left',
ellipsis: true,
width: 228
},
{
title: this.$t('ImplementationDate'),
dataIndex: 'xin1_che1_xing2_shi2_shi1_ri4_qi1',
align: 'left',
ellipsis: true,
width: 190
},
{
title: this.$t('areaOfResponsibility'),
dataIndex: 'dutyTerritory_dictText',
title: this.$t('vehicleInProductionDate'),
dataIndex: 'implement_time',
align: 'left',
ellipsis: true,
width: 100
width: 190
}
],
dataList: [],
@@ -144,13 +171,27 @@
pageSize: 10,
total: 0,
queryParam: {},
confirmLoading: false
confirmLoading: false,
queryConditionVOList: [],
fieldList:[],
}
},
mounted() {
},
methods: {
queryConditionInventory() {
let query = {
flag: 1
}
getAction(this.url.queryConditionInventory, query).then((res) => {
if (res.success) {
this.fieldList = res.result || []
} else {
this.fieldList = []
}
})
},
handleToggleSearch() {
this.toggleSearchStatus = !this.toggleSearchStatus
},
@@ -158,6 +199,8 @@
this.visible = true
this.queryParam = {}
this.selectedRowKeys = []
this.queryConditionVOList = []
this.queryConditionInventory()
this.replacePage()
},
handleCancel() {
@@ -170,6 +213,9 @@
searchReset() {
this.pageNo = 1
this.queryParam = {}
this.queryConditionVOList = []
this.$refs.globalAdvancedQueryRef.resetLine()
this.$refs.globalAdvancedQueryRef.emitCallback()
this.replacePage()
},
onChange(page, pageSize) {
@@ -182,18 +228,20 @@
this.replacePage()
},
replacePage() {
let queryConditionVOList = JSON.parse(JSON.stringify(this.queryConditionVOList))
let query = {
// pageNo: this.pageNo,
// pageSize: this.pageSize,
pageNo: this.pageNo,
pageSize: this.pageSize,
...this.queryParam,
projectLibraryId: this.$route.query.id,
roleCode: 0
// projectLibraryId: this.$route.query.id,
queryConditionVOList: JSON.stringify(queryConditionVOList)
// roleCode: 0
}
this.loading = true
getAction(this.url.addModelList, query).then((res) => {
postAction(this.url.addModelList, query).then((res) => {
if (res.success) {
this.dataList = res.result || []
// this.total = res.result.total
this.dataList = res.result.records || []
this.total = res.result.total
this.loading = false
} else {
this.dataList = []
@@ -217,8 +265,8 @@
this.confirmLoading = true
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
if (this.selectedRowKeys.length < 2) {
let fgid = this.selectedRowList[0].standId
let regulationIndex = this.selectedRowList[0].serialNumber
let fgid = this.selectedRowList[0].id
let regulationIndex = this.selectedRowList[0].serial_number
this.confirmLoading = false
this.visible = false
this.$emit('regulation', regulationIndex, fgid)
@@ -230,6 +278,20 @@
this.$message.warning(this.$t('selectLeastOne'))
this.confirmLoading = false
}
},
handleSuperQuery(params, matchType) {
let sqp = {}
if (!params || (params && params.length == 0)) {
this.queryConditionVOList = []
this.$refs.globalAdvancedQueryRef.superQueryFlag = false
} else {
this.$refs.globalAdvancedQueryRef.superQueryFlag = true
this.queryConditionVOList = params
this.queryConditionVOList.forEach(res => {
res.type = matchType
})
}
this.replacePage()
}
}
}