Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
a0b65354
Commit
a0b65354
authored
Jun 12, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.新复制一个接口,设备列表,不再和监管公用
parent
d4021111
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
298 additions
and
3 deletions
+298
-3
JyjcInspectionApplicationMapper.java
...dule/jyjc/api/mapper/JyjcInspectionApplicationMapper.java
+8
-0
JyjcInspectionApplicationMapper.xml
...main/resources/mapper/JyjcInspectionApplicationMapper.xml
+10
-0
JyjcInspectionApplicationController.java
...c/biz/controller/JyjcInspectionApplicationController.java
+8
-1
JyjcInspectionApplicationServiceImpl.java
...iz/service/impl/JyjcInspectionApplicationServiceImpl.java
+272
-2
No files found.
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/mapper/JyjcInspectionApplicationMapper.java
View file @
a0b65354
...
...
@@ -7,6 +7,8 @@ import com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationEqui
import
com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionApplicationModel
;
import
org.springframework.data.repository.query.Param
;
import
java.util.Set
;
/**
* Mapper 接口
...
...
@@ -27,4 +29,10 @@ public interface JyjcInspectionApplicationMapper extends BaseMapper<JyjcInspecti
void
updatePromoter
(
@org
.
apache
.
ibatis
.
annotations
.
Param
(
"id"
)
Long
id
);
Page
<
JyjcInspectionApplicationModel
>
selectForPage
(
@Param
(
"page"
)
Page
<
JyjcInspectionApplication
>
page
,
@Param
(
"jyjcInspectionApplicationModel"
)
JyjcInspectionApplicationModel
jyjcInspectionApplicationModel
,
@Param
(
"identity"
)
String
identity
,
@Param
(
"currentApplicationUnitCode"
)
String
currentApplicationUnitCode
,
@Param
(
"currentInspectionUnitCode"
)
String
currentInspectionUnitCode
,
@Param
(
"currentUserId"
)
String
currentUserId
);
/**
* 查询待受理流流程状态的设备
* @return Set<String>
*/
Set
<
String
>
queryRecordInFlowing
();
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/resources/mapper/JyjcInspectionApplicationMapper.xml
View file @
a0b65354
...
...
@@ -193,6 +193,16 @@
WHERE
tzjia.sequence_nbr = #{sequenceNbr}
</select>
<select
id=
"queryRecordInFlowing"
resultType=
"java.lang.String"
>
SELECT
DISTINCT ae.equip_unicode as records
FROM
tz_jyjc_inspection_application a,
tz_jyjc_inspection_application_equip ae
where
a.sequence_nbr = ae.application_seq
and a.status='6611'
</select>
<update
id=
"updatePromoter"
>
UPDATE tz_jyjc_inspection_application set promoter = null
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/controller/JyjcInspectionApplicationController.java
View file @
a0b65354
...
...
@@ -206,7 +206,6 @@ public class JyjcInspectionApplicationController extends BaseController {
}
/**
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
...
...
@@ -231,4 +230,12 @@ public class JyjcInspectionApplicationController extends BaseController {
InspectionApplicationPushEvent
event
=
new
InspectionApplicationPushEvent
(
this
,
model
);
eventPublisher
.
publish
(
event
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备注册信息分页查询"
,
notes
=
"设备注册信息分页查询"
)
@GetMapping
(
value
=
"/equip/list"
)
public
ResponseModel
<
Page
<
JSONObject
>>
getEquipListWithOutFlowing
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
JSONObject
jsonObject
=
new
JSONObject
(
map
);
return
ResponseHelper
.
buildResponse
(
jyjcInspectionApplicationServiceImpl
.
queryForEquipmentRegisterPage
(
jsonObject
));
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/JyjcInspectionApplicationServiceImpl.java
View file @
a0b65354
...
...
@@ -7,8 +7,10 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
...
...
@@ -28,10 +30,14 @@ import com.yeejoin.amos.boot.module.jyjc.biz.event.publisher.EventPublisher;
import
com.yeejoin.amos.boot.module.jyjc.biz.feign.JgFeignClient
;
import
com.yeejoin.amos.boot.module.jyjc.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jyjc.biz.service.TaskModelServiceImpl
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgUseInfoMapper
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.systemctl.model.TaskV2Model
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO
;
...
...
@@ -41,6 +47,16 @@ import com.yeejoin.amos.feign.workflow.model.TaskResultDTO;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.lucene.queryparser.classic.QueryParser
;
import
org.elasticsearch.action.search.SearchRequest
;
import
org.elasticsearch.action.search.SearchResponse
;
import
org.elasticsearch.client.RequestOptions
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.search.SearchHit
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.elasticsearch.search.sort.SortOrder
;
import
org.redisson.api.RLock
;
import
org.redisson.api.RedissonClient
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -56,6 +72,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.io.IOException
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
...
...
@@ -90,19 +107,25 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
@Autowired
JyjcInspectionApplicationAttachmentServiceImpl
jyjcInspectionApplicationAttachmentService
;
@Autowired
JyjcInspectionApplicationEquipServiceImpl
jyjcInspectionApplicationEquipService
;
@Autowired
JyjcInspectionApplicationPushLogServiceImpl
jyjcInspectionApplicationPushLogService
;
@Autowired
JyjcOpeningApplicationServiceImpl
jyjcOpeningApplicationService
;
@Autowired
WorkflowFeignService
workflowFeignService
;
@Autowired
CommonServiceImpl
commonService
;
@Autowired
CmWorkflowServiceImpl
cmWorkflowService
;
@Value
(
"classpath:/json/bizTypeInfo.json"
)
private
Resource
bizTypeInfo
;
...
...
@@ -133,6 +156,19 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
@Autowired
JyjcBaseMapper
jyjcBaseMapper
;
@Autowired
IdxBizJgUseInfoMapper
jgUseInfoMapper
;
private
static
final
String
EQU_STATE
=
"EQU_STATE"
;
private
static
final
String
EQU_CODE
=
"EQU_CODE"
;
private
static
final
String
SEQUENCE_NBR
=
"SEQUENCE_NBR"
;
@Autowired
RestHighLevelClient
restHighLevelClient
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
JyjcInspectionApplicationModel
save
(
@RequestBody
JSONObject
obj
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
...
...
@@ -193,7 +229,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
if
(
inspectionUnit
.
length
==
2
)
{
model
.
setInspectionUnitCode
(
inspectionUnit
[
0
]);
model
.
setInspectionUnitName
(
inspectionUnit
[
1
]);
}
else
{
}
else
{
this
.
setInspectionUnitNameAfterSave
(
model
);
}
model
.
setStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getCode
()));
...
...
@@ -386,7 +422,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
private
void
setInspectionUnitNameAfterSave
(
JyjcInspectionApplicationModel
model
)
{
CompanyModel
companyModel
=
jyjcBaseMapper
.
selectOneCompanyByCode
(
model
.
getInspectionUnitCode
());
if
(
companyModel
!=
null
)
{
if
(
companyModel
!=
null
)
{
model
.
setInspectionUnitName
(
companyModel
.
getCompanyName
());
}
}
...
...
@@ -966,4 +1002,237 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
commonService
.
saveExecuteFlowData2Redis
(
inspectionApplication
.
getProcessInstanceId
(),
this
.
buildInstanceRuntimeData
(
inspectionApplication
));
});
}
/**
* 获取当前登录人单位类型
*
* @return
*/
public
JSONObject
getCompanyType
()
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
CompanyBo
company
=
reginParams
.
getCompany
();
JSONObject
object
=
new
JSONObject
();
if
(!
ValidationUtil
.
isEmpty
(
company
))
{
object
.
put
(
"level"
,
company
.
getLevel
());
object
.
put
(
"orgCode"
,
company
.
getOrgCode
());
object
.
put
(
"companyName"
,
company
.
getCompanyName
());
object
.
put
(
"companyCode"
,
company
.
getCompanyCode
());
CompanyModel
result
=
Privilege
.
companyClient
.
queryByCompanyCode
(
company
.
getCompanyCode
()).
getResult
();
if
(!
ValidationUtil
.
isEmpty
(
result
))
{
object
.
put
(
"companyType"
,
result
.
getCompanyType
());
}
}
return
object
;
}
/**
* 设备过滤查询-显示未提交的设备、未使用的设备,流程中的设备不显示
*
* @param map 查询参数
* @return 设备分页
*/
public
Page
<
JSONObject
>
queryForEquipmentRegisterPage
(
JSONObject
map
)
{
int
pageNumber
=
ObjectUtils
.
isEmpty
(
map
.
getInteger
(
"number"
))
?
1
:
map
.
getInteger
(
"number"
);
int
size
=
ObjectUtils
.
isEmpty
(
map
.
getInteger
(
"size"
))
?
20
:
map
.
getInteger
(
"size"
);
Page
<
JSONObject
>
result
=
new
Page
<>(
pageNumber
,
size
);
SearchRequest
request
=
new
SearchRequest
();
request
.
indices
(
"idx_biz_view_jg_all"
);
SearchSourceBuilder
builder
=
new
SearchSourceBuilder
();
builder
.
trackTotalHits
(
true
);
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
// 获取当前登录人单位类型
JSONObject
company
=
getCompanyType
();
if
(
ValidationUtil
.
isEmpty
(
company
))
{
result
.
setRecords
(
new
ArrayList
<>());
result
.
setTotal
(
0
);
return
result
;
}
String
companyCode
=
company
.
getString
(
"companyCode"
).
contains
(
"_"
)
?
company
.
getString
(
"companyCode"
).
split
(
"_"
)[
1
]
:
company
.
getString
(
"companyCode"
);
String
type
=
company
.
getString
(
"companyType"
);
// 根据当前登录用户类型及管辖机构筛选条件添加对应参数
if
(!
ValidationUtil
.
isEmpty
(
type
)
&&
type
.
contains
(
"使用单位"
))
{
if
(
ValidationUtil
.
isEmpty
(
map
.
getString
(
"USE_UNIT_CREDIT_CODE"
)))
{
map
.
put
(
"USE_UNIT_CREDIT_CODE"
,
companyCode
);
}
}
if
(!
ValidationUtil
.
isEmpty
(
type
)
&&
type
.
contains
(
"安装改造维修单位"
))
{
map
.
put
(
"USC_UNIT_CREDIT_CODE"
,
companyCode
);
}
if
(!
ValidationUtil
.
isEmpty
(
type
)
&&
type
.
contains
(
"个人主体"
))
{
map
.
put
(
"USE_UNIT_CREDIT_CODE"
,
companyCode
);
}
// 默认条件【STATUS==="" || null】
BoolQueryBuilder
meBuilder
=
QueryBuilders
.
boolQuery
();
meBuilder
.
should
(
QueryBuilders
.
matchQuery
(
"STATUS"
,
"已认领"
));
meBuilder
.
should
(
QueryBuilders
.
boolQuery
().
mustNot
(
QueryBuilders
.
existsQuery
(
"STATUS"
)));
meBuilder
.
should
(
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
matchPhraseQuery
(
"STATUS"
,
""
)));
meBuilder
.
minimumShouldMatch
(
1
);
boolMust
.
must
(
meBuilder
);
// DATA_SOURCE 为“jg”的数据(从监管新加的设备)
// 20240314 提出的监管业务不要让企业用户选到之前一码通认领或补录的设备,让从监管业务中去新增
BoolQueryBuilder
dBuilder
=
QueryBuilders
.
boolQuery
();
dBuilder
.
must
(
QueryBuilders
.
prefixQuery
(
"DATA_SOURCE"
,
"jg"
));
boolMust
.
must
(
dBuilder
);
// 设备状态
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"EQU_STATE"
)))
{
String
param
=
QueryParser
.
escape
(
map
.
getLong
(
"EQU_STATE"
).
toString
());
boolMust
.
must
(
QueryBuilders
.
matchQuery
(
"EQU_STATE"
,
param
));
}
// 使用单位 //安装改造维修单位
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"USE_UNIT_CREDIT_CODE"
))
&&
!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"USC_UNIT_CREDIT_CODE"
)))
{
BoolQueryBuilder
ubuilder
=
QueryBuilders
.
boolQuery
();
String
useCode
=
QueryParser
.
escape
(
map
.
getString
(
"USE_UNIT_CREDIT_CODE"
));
useCode
=
useCode
.
contains
(
"_"
)
?
useCode
.
split
(
"_"
)[
0
]
:
useCode
;
ubuilder
.
should
(
QueryBuilders
.
matchQuery
(
"USE_UNIT_CREDIT_CODE"
,
useCode
));
String
uscCode
=
QueryParser
.
escape
(
map
.
getString
(
"USC_UNIT_CREDIT_CODE"
)).
toLowerCase
();
ubuilder
.
should
(
QueryBuilders
.
wildcardQuery
(
"USC_UNIT_CREDIT_CODE"
,
"*"
+
uscCode
+
"*"
));
ubuilder
.
minimumShouldMatch
(
1
);
boolMust
.
must
(
ubuilder
);
}
else
{
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"USE_UNIT_CREDIT_CODE"
))
||
!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"useUnitCreditCode"
)))
{
String
uucc
=
!
ValidationUtil
.
isEmpty
(
map
.
getString
(
"USE_UNIT_CREDIT_CODE"
))
?
map
.
getString
(
"USE_UNIT_CREDIT_CODE"
)
:
map
.
getString
(
"useUnitCreditCode"
);
String
param
=
QueryParser
.
escape
(
uucc
);
param
=
param
.
contains
(
"_"
)
?
param
.
split
(
"_"
)[
0
]
:
param
;
boolMust
.
must
(
QueryBuilders
.
matchQuery
(
"USE_UNIT_CREDIT_CODE"
,
param
));
}
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"USC_UNIT_CREDIT_CODE"
)))
{
String
uscCode
=
QueryParser
.
escape
(
map
.
getString
(
"USC_UNIT_CREDIT_CODE"
)).
toLowerCase
();
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"USC_UNIT_CREDIT_CODE"
,
"*"
+
uscCode
+
"*"
));
}
}
// 监管码
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"SUPERVISORY_CODE"
)))
{
String
param
=
map
.
getString
(
"SUPERVISORY_CODE"
);
List
<
String
>
strings
=
Arrays
.
asList
(
param
.
split
(
","
));
boolMust
.
must
(
QueryBuilders
.
termsQuery
(
"SUPERVISORY_CODE"
,
strings
));
}
// 设备种类编码
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"EQU_LIST_CODE"
)))
{
boolMust
.
must
(
QueryBuilders
.
termsQuery
(
"EQU_LIST_CODE"
,
QueryParser
.
escape
(
map
.
getString
(
"EQU_LIST_CODE"
))));
}
// 设备类别
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"EQU_CATEGORY_CODE"
)))
{
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_CATEGORY_CODE"
,
QueryParser
.
escape
(
map
.
getString
(
"EQU_CATEGORY_CODE"
))));
}
// 设备类别编码
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"EQU_DEFINE_CODE"
)))
{
boolMust
.
must
(
QueryBuilders
.
matchPhraseQuery
(
"EQU_DEFINE_CODE"
,
QueryParser
.
escape
(
map
.
getString
(
"EQU_DEFINE_CODE"
))));
}
// 设备代码模糊查询
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
EQU_CODE
)))
{
String
test
=
QueryParser
.
escape
(
map
.
getString
(
EQU_CODE
));
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
EQU_CODE
,
"*"
+
test
.
toLowerCase
()
+
"*"
));
}
// 单位内部编号模糊查询
if
(!
ObjectUtils
.
isEmpty
(
map
.
getString
(
"USE_INNER_CODE"
)))
{
String
test
=
QueryParser
.
escape
(
map
.
getString
(
"USE_INNER_CODE"
));
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"USE_INNER_CODE"
,
"*"
+
test
.
toLowerCase
()
+
"*"
));
}
this
.
setFilterOfInFlowing
(
boolMust
);
builder
.
query
(
boolMust
);
builder
.
sort
(
"REC_DATE"
,
SortOrder
.
DESC
);
builder
.
from
((
pageNumber
-
1
)
*
size
);
builder
.
size
(
size
);
request
.
source
(
builder
);
List
<
JSONObject
>
list
=
new
LinkedList
<>();
long
totle
=
0
;
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"查询es 的查询条件: {}"
,
request
);
}
try
{
SearchResponse
response
=
restHighLevelClient
.
search
(
request
,
RequestOptions
.
DEFAULT
);
for
(
SearchHit
hit
:
response
.
getHits
().
getHits
())
{
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
toJSON
(
hit
);
JSONObject
dto2
=
jsonObject
.
getJSONObject
(
"sourceAsMap"
);
if
(!
ValidationUtil
.
isEmpty
(
dto2
.
get
(
EQU_STATE
)))
{
Integer
integer
=
Integer
.
valueOf
(
dto2
.
get
(
EQU_STATE
).
toString
());
String
status
=
EquimentEnum
.
getName
.
get
(
integer
);
dto2
.
put
(
EQU_STATE
,
status
);
}
dto2
.
put
(
"record"
,
dto2
.
get
(
SEQUENCE_NBR
));
list
.
add
(
dto2
);
}
// 填充地址
fillAddress
(
list
);
totle
=
response
.
getInternalResponse
().
hits
().
getTotalHits
().
value
;
result
.
setRecords
(
list
);
result
.
setTotal
(
totle
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
return
result
;
}
/**
* 过滤条件去掉流程中的设备
*
* @param boolMust 条件
*/
private
void
setFilterOfInFlowing
(
BoolQueryBuilder
boolMust
)
{
Set
<
String
>
records
=
this
.
getEquipInFlowing
();
if
(
records
!=
null
&&
!
records
.
isEmpty
())
{
boolMust
.
mustNot
(
QueryBuilders
.
termsQuery
(
"SEQUENCE_NBR.keyword"
,
records
));
}
}
private
Set
<
String
>
getEquipInFlowing
()
{
return
this
.
getBaseMapper
().
queryRecordInFlowing
();
}
private
void
fillAddress
(
List
<
JSONObject
>
list
)
{
// 获取所有设备的Id
List
<
String
>
equIds
=
null
;
if
(!
ValidationUtil
.
isEmpty
(
list
))
{
equIds
=
list
.
stream
().
map
(
item
->
item
.
get
(
SEQUENCE_NBR
).
toString
()).
collect
(
Collectors
.
toList
());
}
if
(!
ValidationUtil
.
isEmpty
(
equIds
))
{
// 查询设备地址
List
<
IdxBizJgUseInfo
>
useInfoListByEquIds
=
this
.
getUseInfoListByEquIds
(
equIds
);
Map
<
String
,
String
>
equAddressMap
=
new
HashMap
<>();
if
(!
ValidationUtil
.
isEmpty
(
useInfoListByEquIds
))
{
equAddressMap
=
useInfoListByEquIds
.
stream
().
collect
(
Collectors
.
toMap
(
IdxBizJgUseInfo:
:
getRecord
,
useInfo
->
{
String
fulladdress
=
""
;
if
(!
ValidationUtil
.
isEmpty
(
useInfo
.
getProvinceName
()))
{
fulladdress
+=
useInfo
.
getProvinceName
();
}
if
(!
ValidationUtil
.
isEmpty
(
useInfo
.
getCityName
()))
{
fulladdress
+=
useInfo
.
getCityName
();
}
if
(!
ValidationUtil
.
isEmpty
(
useInfo
.
getCountyName
()))
{
fulladdress
+=
useInfo
.
getCountyName
();
}
if
(!
ValidationUtil
.
isEmpty
(
useInfo
.
getStreetName
()))
{
fulladdress
+=
useInfo
.
getStreetName
();
}
if
(!
ValidationUtil
.
isEmpty
(
useInfo
.
getAddress
()))
{
fulladdress
+=
useInfo
.
getAddress
();
}
return
fulladdress
;
}
)
);
}
// 更新设备使用情况和设备地址
for
(
JSONObject
item
:
list
)
{
String
fullAddress
=
equAddressMap
.
get
(
item
.
getString
(
SEQUENCE_NBR
));
item
.
put
(
"ADDRESS"
,
!
ValidationUtil
.
isEmpty
(
fullAddress
)
?
fullAddress
:
""
);
}
}
}
private
List
<
IdxBizJgUseInfo
>
getUseInfoListByEquIds
(
List
<
String
>
equIds
)
{
QueryWrapper
<
IdxBizJgUseInfo
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
lambda
().
in
(
IdxBizJgUseInfo:
:
getRecord
,
equIds
);
return
jgUseInfoMapper
.
selectList
(
queryWrapper
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment