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
a78da737
Commit
a78da737
authored
Aug 18, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_tzs_register' of…
Merge branch 'develop_tzs_register' of
http://39.100.92.250:5000/moa/amos-boot-biz
into develop_tzs_register
parents
5b0beef4
c682eb68
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
170 additions
and
189 deletions
+170
-189
JgResumeInfoMapper.java
...in/amos/boot/module/jg/api/mapper/JgResumeInfoMapper.java
+2
-3
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+31
-15
JgResumeInfoServiceImpl.java
...t/module/jg/biz/service/impl/JgResumeInfoServiceImpl.java
+2
-2
JyjcInspectionResultServiceImpl.java
...yjc/biz/service/impl/JyjcInspectionResultServiceImpl.java
+29
-3
EquipmentStaticsServiceImpl.java
...atistcs/biz/service/impl/EquipmentStaticsServiceImpl.java
+101
-161
RiskReportMapper.xml
...le-tcm-api/src/main/resources/mapper/RiskReportMapper.xml
+1
-0
EquipmentCategoryMapper.java
...s/boot/module/ymt/api/mapper/EquipmentCategoryMapper.java
+1
-2
EquipmentCategoryServiceImpl.java
...le/ymt/biz/service/impl/EquipmentCategoryServiceImpl.java
+3
-3
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/JgResumeInfoMapper.java
View file @
a78da737
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.mapper.CustomBaseMapper
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgResumeInfoDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgResumeInfo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Set
;
...
...
@@ -15,7 +14,7 @@ import java.util.Set;
* @author system_generator
* @date 2024-05-29
*/
public
interface
JgResumeInfoMapper
extends
BaseMapper
<
JgResumeInfo
>
{
public
interface
JgResumeInfoMapper
extends
Custom
BaseMapper
<
JgResumeInfo
>
{
void
deleteBatchByBusinessId
(
@Param
(
"idList"
)
Set
<
String
>
idList
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
View file @
a78da737
...
...
@@ -4176,7 +4176,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
SearchRequest
request
=
new
SearchRequest
(
IDX_BIZ_EQUIPMENT_INFO
);
SearchSourceBuilder
sourceBuilder
=
new
SearchSourceBuilder
().
size
(
10000
)
.
fetchSource
(
new
String
[]{
"FACTORY_NUM"
,
"
PRODUC
E_UNIT_NAME"
},
null
);
.
fetchSource
(
new
String
[]{
"FACTORY_NUM"
,
"
US
E_UNIT_NAME"
},
null
);
BoolQueryBuilder
boolQuery
=
QueryBuilders
.
boolQuery
();
boolQuery
.
must
(
QueryBuilders
.
termQuery
(
"EQU_LIST_CODE"
,
"2000"
))
...
...
@@ -4198,8 +4198,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
for
(
SearchHit
hit
:
response
.
getHits
().
getHits
())
{
Map
<
String
,
Object
>
src
=
hit
.
getSourceAsMap
();
String
factoryNum
=
Objects
.
toString
(
src
.
get
(
"FACTORY_NUM"
),
""
);
String
produceUnitName
=
Objects
.
toString
(
src
.
get
(
"PRODUC
E_UNIT_NAME"
),
""
);
resultMap
.
put
(
factoryNum
,
produc
eUnitName
);
String
useUnitName
=
Objects
.
toString
(
src
.
get
(
"US
E_UNIT_NAME"
),
""
);
resultMap
.
put
(
factoryNum
,
us
eUnitName
);
}
return
resultMap
;
}
...
...
@@ -4563,17 +4563,35 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.
collect
(
Collectors
.
toList
())
);
}
batchInsert
(
idxBizJgSupervisionInfoMapper
,
supervisionInfoList
,
"监督信息"
);
batchInsert
(
idxBizJgUseInfoMapper
,
useInfoList
,
"使用信息"
);
batchInsert
(
idxBizJgDesignInfoMapper
,
designInfoList
,
"设计信息"
);
batchInsert
(
idxBizJgRegisterInfoMapper
,
registerInfoList
,
"注册信息"
);
batchInsert
(
idxBizJgFactoryInfoMapper
,
factoryInfoList
,
"制造信息"
);
batchInsert
(
otherInfoMapper
,
otherInfoList
,
"其他信息"
);
batchInsert
(
idxBizJgTechParamsVesselMapper
,
paramsVesselList
,
"容器参数信息"
);
batchInsert
(
idxBizJgInspectionDetectionInfoMapper
,
inspectionDetectionInfoList
,
"检验检测信息"
);
List
<
CompletableFuture
<
Void
>>
futures
=
new
ArrayList
<>();
futures
.
add
(
CompletableFuture
.
runAsync
(()
->
batchInsert
(
idxBizJgSupervisionInfoMapper
,
supervisionInfoList
,
"监督信息"
)
));
futures
.
add
(
CompletableFuture
.
runAsync
(()
->
batchInsert
(
idxBizJgUseInfoMapper
,
useInfoList
,
"使用信息"
)
));
futures
.
add
(
CompletableFuture
.
runAsync
(()
->
batchInsert
(
idxBizJgDesignInfoMapper
,
designInfoList
,
"设计信息"
)
));
futures
.
add
(
CompletableFuture
.
runAsync
(()
->
batchInsert
(
idxBizJgRegisterInfoMapper
,
registerInfoList
,
"注册信息"
)
));
futures
.
add
(
CompletableFuture
.
runAsync
(()
->
batchInsert
(
idxBizJgFactoryInfoMapper
,
factoryInfoList
,
"制造信息"
)
));
futures
.
add
(
CompletableFuture
.
runAsync
(()
->
batchInsert
(
otherInfoMapper
,
otherInfoList
,
"其他信息"
)
));
futures
.
add
(
CompletableFuture
.
runAsync
(()
->
batchInsert
(
idxBizJgTechParamsVesselMapper
,
paramsVesselList
,
"容器参数信息"
)
));
futures
.
add
(
CompletableFuture
.
runAsync
(()
->
batchInsert
(
idxBizJgInspectionDetectionInfoMapper
,
inspectionDetectionInfoList
,
"检验检测信息"
)
));
if
(!
esEquipmentCategoryList
.
isEmpty
())
{
esEquipmentCategory
.
saveAll
(
esEquipmentCategoryList
);
futures
.
add
(
CompletableFuture
.
runAsync
(()
->
esEquipmentCategory
.
saveAll
(
esEquipmentCategoryList
))
);
}
CompletableFuture
.
allOf
(
futures
.
toArray
(
new
CompletableFuture
[
0
])).
join
();
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_EQUIP
.
name
(),
recordSet
,
EquipCreateOrEditEvent
.
EquipType
.
equip
));
return
String
.
format
(
"导入完成,成功导入: %d 条数据!"
,
useInfoList
.
size
());
}
...
...
@@ -4581,10 +4599,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
/** 通用批量插入方法 */
public
<
T
>
void
batchInsert
(
CustomBaseMapper
<
T
>
mapper
,
List
<
T
>
list
,
String
name
)
{
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
mapper
.
insertBatchSomeColumn
(
list
,
10
00
);
mapper
.
insertBatchSomeColumn
(
list
,
5
00
);
log
.
info
(
"{} 批量插入完成,数量:{}"
,
name
,
list
.
size
());
}
else
{
log
.
info
(
"{} 列表为空,无需插入"
,
name
);
}
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgResumeInfoServiceImpl.java
View file @
a78da737
...
...
@@ -40,14 +40,14 @@ public class JgResumeInfoServiceImpl extends BaseService<JgResumeInfoDto, JgResu
}
public
void
saveBatchResume
(
List
<
JgResumeInfoDto
>
jgResumeInfoDtoList
)
{
Collection
<
JgResumeInfo
>
jgResumeInfoCollection
=
jgResumeInfoDtoList
.
stream
()
List
<
JgResumeInfo
>
jgResumeInfoCollection
=
jgResumeInfoDtoList
.
stream
()
.
map
(
dto
->
{
JgResumeInfo
info
=
new
JgResumeInfo
();
BeanUtils
.
copyProperties
(
dto
,
info
);
return
info
;
})
.
collect
(
Collectors
.
toList
());
this
.
saveBatch
(
jgResumeInfoCollection
);
this
.
baseMapper
.
insertBatchSomeColumn
(
jgResumeInfoCollection
,
500
);
}
/**
...
...
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/JyjcInspectionResultServiceImpl.java
View file @
a78da737
...
...
@@ -176,10 +176,10 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
model
=
new
JyjcInspectionResultModel
();
}
if
(
type
)
{
//检验检测单位分页查询
//
检验检测单位分页查询
model
.
setInspectionUnitCode
(
reginParams
.
getCompany
().
getCompanyCode
());
}
else
{
//报检单位分页查询
//
报检单位分页查询
model
.
setApplicationUnitCode
(
reginParams
.
getCompany
().
getCompanyCode
());
}
Page
<
JyjcInspectionResultModel
>
resultPage
=
resultMapper
.
selectJyjcInspectionResultpPage
(
page
,
model
);
...
...
@@ -802,12 +802,13 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
useInfoMapper
.
updateByRecord
(
inspectionDetectionInfo
.
getRecord
(),
jyjcInspectionResult
.
getNextInspectionDate
(),
jyjcInspectionResult
.
getInspectionType
(),
jyjcInspectionResult
.
getApplicationNo
());
// 4.更新es下次检验日期
commonService
.
updateEquipNextInspectDate
(
jyjcInspectionResult
,
inspectionDetectionInfo
.
getRecord
());
sendDataRefreshMsg
(
records
);
bizEmqPublisher
.
sendInspectionMsgAfterSave
(
inspectionDetectionInfo
,
"insert"
);
}
catch
(
Exception
e
)
{
log
.
warn
(
e
.
getMessage
());
throw
new
BadRequest
(
"数据异常,请联系管理员!"
);
}
}
sendDataRefreshMsg
(
records
);
return
Boolean
.
TRUE
;
}
...
...
@@ -936,6 +937,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
commonService
.
updateEquipNextInspectDate
(
jyjcInspectionResult
,
inspectionDetectionInfo
.
getRecord
());
// 发送数据变更消息
sendDataRefreshMsg
(
Sets
.
newHashSet
(
inspectionDetectionInfo
.
getRecord
()));
bizEmqPublisher
.
sendInspectionMsgAfterSave
(
inspectionDetectionInfo
,
"update"
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
BadRequest
(
"数据异常,请联系管理员!"
);
...
...
@@ -972,9 +974,33 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
jyjcInspectionHistoryService
.
getBaseMapper
().
delete
(
new
LambdaQueryWrapper
<
JyjcInspectionHistory
>().
eq
(
JyjcInspectionHistory:
:
getSSeq
,
resultSeq
));
// 发送数据变更消息
sendDataRefreshMsg
(
records
);
records
.
stream
()
.
filter
(
Objects:
:
nonNull
)
.
map
(
this
::
getTheLatestInspectionInformation
)
.
filter
(
Objects:
:
nonNull
)
.
forEach
(
info
->
bizEmqPublisher
.
sendInspectionMsgAfterSave
(
info
,
"update"
));
return
Boolean
.
TRUE
;
}
/**
* 获取最新的一条检验检测信息
*
* @param record 设备 record
* @return 最新的一条检验检测信息
*/
private
IdxBizJgInspectionDetectionInfo
getTheLatestInspectionInformation
(
String
record
)
{
List
<
IdxBizJgInspectionDetectionInfo
>
inspectionDetectionInfoList
=
idxBizJgInspectionDetectionInfoMapper
.
selectList
(
new
LambdaQueryWrapper
<
IdxBizJgInspectionDetectionInfo
>()
.
eq
(
IdxBizJgInspectionDetectionInfo:
:
getRecord
,
record
)
.
orderByDesc
(
IdxBizJgInspectionDetectionInfo:
:
getInspectDate
)
.
last
(
"LIMIT 1"
)
);
return
inspectionDetectionInfoList
.
stream
()
.
findFirst
()
.
orElse
(
null
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
PipelineInspectionResultDto
>
receivePipelineResultData
(
List
<
PipelineInspectionResultDto
>
resultData
)
{
log
.
info
(
"收到检验检测厂商推送的压力管道结果数据:{}"
,
JSONArray
.
toJSONString
(
resultData
));
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/EquipmentStaticsServiceImpl.java
View file @
a78da737
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
service
.
impl
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.SafetyProblemTracingMapper
;
import
com.yeejoin.amos.boot.module.
ymt.api.dto.EquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.
statistics.api.enums.StatisticalAnalysisEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -144,25 +143,15 @@ public class EquipmentStaticsServiceImpl {
private
Long
getFMEquipmentCount
(
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
long
num
=
0
;
CountRequest
request
=
new
CountRequest
();
request
.
indices
(
"idx_biz_view_jg_all"
);
request
.
indices
(
StatisticalAnalysisEnum
.
equip
.
getKey
()
);
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
// 按照管辖机构区域信息模糊查询
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"ORG_BRANCH_CODE.keyword"
,
QueryParser
.
escape
(
dpFilterParamForDetailDto
.
getOrgCode
())
+
"*"
));
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getTreeValue
()))
{
if
(
"2300"
.
equals
(
dpFilterParamForDetailDto
.
getTreeValue
())){
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_CATEGORY_CODE"
,
QueryParser
.
escape
(
dpFilterParamForDetailDto
.
getTreeValue
().
toLowerCase
())));
}
else
{
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_LIST_CODE"
,
QueryParser
.
escape
(
dpFilterParamForDetailDto
.
getTreeValue
().
toLowerCase
())));
}
}
createBoolQueryBuilder
(
boolMust
,
dpFilterParamForDetailDto
,
dpFilterParamForDetailDto
.
getOrgCode
());
// 且8大类,目的去掉脏数据
boolMust
.
must
(
QueryBuilders
.
termsQuery
(
"EQU_LIST_CODE"
,
StCommonServiceImpl
.
getEquipmentCategory
().
stream
().
map
(
EquipmentCategoryDto:
:
getCode
).
collect
(
Collectors
.
toList
())));
boolMust
.
must
(
QueryBuilders
.
existsQuery
(
"SUPERVISORY_CODE"
));
boolMust
.
mustNot
(
QueryBuilders
.
termQuery
(
"SUPERVISORY_CODE"
,
"null"
));
String
[]
status
=
{
"草稿"
,
"已拒领"
,
"待认领"
};
boolMust
.
mustNot
(
QueryBuilders
.
termsQuery
(
"STATUS"
,
Arrays
.
asList
(
status
)));
boolMust
.
mustNot
(
QueryBuilders
.
termQuery
(
"SUPERVISORY_CODE"
,
"null"
));
request
.
query
(
boolMust
);
try
{
CountResponse
response
=
restHighLevelClient
.
count
(
request
,
RequestOptions
.
DEFAULT
);
num
=
response
.
getCount
();
...
...
@@ -175,23 +164,9 @@ public class EquipmentStaticsServiceImpl {
private
Long
getAllEquipmentCount
(
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
long
num
=
0
;
CountRequest
request
=
new
CountRequest
();
request
.
indices
(
"idx_biz_view_jg_all"
);
request
.
indices
(
StatisticalAnalysisEnum
.
equip
.
getKey
()
);
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
// 按照管辖机构区域信息模糊查询
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getOrgCode
()))
{
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"ORG_BRANCH_CODE.keyword"
,
QueryParser
.
escape
(
dpFilterParamForDetailDto
.
getOrgCode
())
+
"*"
));
}
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getTreeValue
()))
{
if
(
"2300"
.
equals
(
dpFilterParamForDetailDto
.
getTreeValue
())){
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_CATEGORY_CODE"
,
QueryParser
.
escape
(
dpFilterParamForDetailDto
.
getTreeValue
().
toLowerCase
())));
}
else
{
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_LIST_CODE"
,
QueryParser
.
escape
(
dpFilterParamForDetailDto
.
getTreeValue
().
toLowerCase
())));
}
}
// 且8大类,目的去掉脏数据
boolMust
.
must
(
QueryBuilders
.
termsQuery
(
"EQU_LIST_CODE"
,
StCommonServiceImpl
.
getEquipmentCategory
().
stream
().
map
(
EquipmentCategoryDto:
:
getCode
).
collect
(
Collectors
.
toList
())));
String
[]
status
=
{
"草稿"
,
"已拒领"
,
"待认领"
};
boolMust
.
mustNot
(
QueryBuilders
.
termsQuery
(
"STATUS"
,
Arrays
.
asList
(
status
)));
createBoolQueryBuilder
(
boolMust
,
dpFilterParamForDetailDto
,
dpFilterParamForDetailDto
.
getOrgCode
());
request
.
query
(
boolMust
);
try
{
CountResponse
response
=
restHighLevelClient
.
count
(
request
,
RequestOptions
.
DEFAULT
);
...
...
@@ -205,22 +180,10 @@ public class EquipmentStaticsServiceImpl {
private
Long
getNGEquipmentCount
(
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
long
num
=
0
;
CountRequest
request
=
new
CountRequest
();
request
.
indices
(
"idx_biz_view_jg_all"
);
request
.
indices
(
StatisticalAnalysisEnum
.
equip
.
getKey
()
);
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
// 按照管辖机构区域信息模糊查询
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"ORG_BRANCH_CODE.keyword"
,
QueryParser
.
escape
(
dpFilterParamForDetailDto
.
getOrgCode
())
+
"*"
));
createBoolQueryBuilder
(
boolMust
,
dpFilterParamForDetailDto
,
dpFilterParamForDetailDto
.
getOrgCode
());
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"IS_INTO_MANAGEMENT"
,
true
));
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getTreeValue
()))
{
if
(
"2300"
.
equals
(
dpFilterParamForDetailDto
.
getTreeValue
())){
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_CATEGORY_CODE"
,
QueryParser
.
escape
(
dpFilterParamForDetailDto
.
getTreeValue
().
toLowerCase
())));
}
else
{
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_LIST_CODE"
,
QueryParser
.
escape
(
dpFilterParamForDetailDto
.
getTreeValue
().
toLowerCase
())));
}
}
// 且8大类,目的去掉脏数据
boolMust
.
must
(
QueryBuilders
.
termsQuery
(
"EQU_LIST_CODE"
,
StCommonServiceImpl
.
getEquipmentCategory
().
stream
().
map
(
EquipmentCategoryDto:
:
getCode
).
collect
(
Collectors
.
toList
())));
String
[]
status
=
{
"草稿"
,
"已拒领"
,
"待认领"
};
boolMust
.
mustNot
(
QueryBuilders
.
termsQuery
(
"STATUS"
,
Arrays
.
asList
(
status
)));
request
.
query
(
boolMust
);
try
{
CountResponse
response
=
restHighLevelClient
.
count
(
request
,
RequestOptions
.
DEFAULT
);
...
...
@@ -234,25 +197,10 @@ public class EquipmentStaticsServiceImpl {
private
Long
getLQEquipmentCount
(
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
long
num
=
0
;
CountRequest
request
=
new
CountRequest
();
request
.
indices
(
"idx_biz_view_jg_all"
);
request
.
indices
(
StatisticalAnalysisEnum
.
equip
.
getKey
()
);
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
// 按照管辖机构区域信息模糊查询
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"ORG_BRANCH_CODE.keyword"
,
QueryParser
.
escape
(
dpFilterParamForDetailDto
.
getOrgCode
())
+
"*"
));
// 且下次检验日期大于等于当天 且查询 下次检验日期 <= 当前天+30天 即为临期
long
currentDayTime
=
DateUtil
.
parse
(
DateUtil
.
today
(),
"yyy-MM-dd"
).
getTime
();
long
currentDayAfter30DayTime
=
DateUtil
.
offsetDay
(
DateUtil
.
parse
(
DateUtil
.
today
(),
"yyy-MM-dd"
),
30
).
getTime
();
boolMust
.
must
(
QueryBuilders
.
rangeQuery
(
"NEXT_INSPECT_DATE"
).
gte
(
currentDayTime
).
lte
(
currentDayAfter30DayTime
));
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getTreeValue
()))
{
if
(
"2300"
.
equals
(
dpFilterParamForDetailDto
.
getTreeValue
())){
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_CATEGORY_CODE"
,
QueryParser
.
escape
(
dpFilterParamForDetailDto
.
getTreeValue
().
toLowerCase
())));
}
else
{
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_LIST_CODE"
,
QueryParser
.
escape
(
dpFilterParamForDetailDto
.
getTreeValue
().
toLowerCase
())));
}
}
// 且8大类,目的去掉脏数据
boolMust
.
must
(
QueryBuilders
.
termsQuery
(
"EQU_LIST_CODE"
,
StCommonServiceImpl
.
getEquipmentCategory
().
stream
().
map
(
EquipmentCategoryDto:
:
getCode
).
collect
(
Collectors
.
toList
())));
String
[]
status
=
{
"草稿"
,
"已拒领"
,
"待认领"
};
boolMust
.
mustNot
(
QueryBuilders
.
termsQuery
(
"STATUS"
,
Arrays
.
asList
(
status
)));
createBoolQueryBuilder
(
boolMust
,
dpFilterParamForDetailDto
,
dpFilterParamForDetailDto
.
getOrgCode
());
boolMust
.
filter
(
QueryBuilders
.
rangeQuery
(
"NEXT_INSPECT_DATE"
).
gte
(
LocalDate
.
now
().
format
(
formatter
)).
lte
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
)));
request
.
query
(
boolMust
);
try
{
CountResponse
response
=
restHighLevelClient
.
count
(
request
,
RequestOptions
.
DEFAULT
);
...
...
@@ -266,26 +214,10 @@ public class EquipmentStaticsServiceImpl {
private
Long
getCQEquipmentCount
(
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
long
num
=
0
;
CountRequest
request
=
new
CountRequest
();
request
.
indices
(
"idx_biz_view_jg_all"
);
request
.
indices
(
StatisticalAnalysisEnum
.
equip
.
getKey
()
);
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
// 按照管辖机构区域信息模糊查询
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"ORG_BRANCH_CODE.keyword"
,
QueryParser
.
escape
(
dpFilterParamForDetailDto
.
getOrgCode
())
+
"*"
));
// 查询下次检验日期小于当前天的设备,即为超期检验超期设备
long
currentDayTime
=
DateUtil
.
parse
(
DateUtil
.
now
(),
"yyy-MM-dd"
).
getTime
();
boolMust
.
must
(
QueryBuilders
.
rangeQuery
(
"NEXT_INSPECT_DATE"
).
lt
(
currentDayTime
));
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getTreeValue
()))
{
if
(
"2300"
.
equals
(
dpFilterParamForDetailDto
.
getTreeValue
())){
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_CATEGORY_CODE"
,
QueryParser
.
escape
(
dpFilterParamForDetailDto
.
getTreeValue
().
toLowerCase
())));
}
else
{
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_LIST_CODE"
,
QueryParser
.
escape
(
dpFilterParamForDetailDto
.
getTreeValue
().
toLowerCase
())));
}
}
// 且8大类,目的去掉脏数据
boolMust
.
must
(
QueryBuilders
.
termsQuery
(
"EQU_LIST_CODE"
,
StCommonServiceImpl
.
getEquipmentCategory
().
stream
().
map
(
EquipmentCategoryDto:
:
getCode
).
collect
(
Collectors
.
toList
())));
String
[]
status
=
{
"草稿"
,
"已拒领"
,
"待认领"
};
boolMust
.
mustNot
(
QueryBuilders
.
termsQuery
(
"STATUS"
,
Arrays
.
asList
(
status
)));
createBoolQueryBuilder
(
boolMust
,
dpFilterParamForDetailDto
,
dpFilterParamForDetailDto
.
getOrgCode
());
boolMust
.
filter
(
QueryBuilders
.
rangeQuery
(
"NEXT_INSPECT_DATE"
).
lt
(
LocalDate
.
now
().
format
(
formatter
)));
request
.
query
(
boolMust
);
try
{
CountResponse
response
=
restHighLevelClient
.
count
(
request
,
RequestOptions
.
DEFAULT
);
...
...
@@ -296,37 +228,97 @@ public class EquipmentStaticsServiceImpl {
return
num
;
}
public
Page
<
Map
<
String
,
Object
>>
normalPage
(
Integer
current
,
Integer
size
,
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
dpFilterParamForDetailDto
.
getCityCode
());
if
(
dpFilterParamForDetailDto
.
getOrgBranchCode
()
!=
null
){
if
(
dpFilterParamForDetailDto
.
getOrgBranchCode
().
contains
(
"_"
)){
String
code
=
dpFilterParamForDetailDto
.
getOrgBranchCode
().
split
(
"_"
)[
0
];
orgCode
=
stCommonService
.
getAndSetOrgCode
(
code
);
}
}
if
(
StringUtils
.
isEmpty
(
orgCode
)){
return
new
Page
<>(
current
,
size
);
if
(
StringUtils
.
isEmpty
(
orgCode
))
{
return
new
Page
<>(
current
,
size
);
}
SearchRequest
request
=
new
SearchRequest
();
request
.
indices
(
"idx_biz_equipment_info"
);
request
.
indices
(
StatisticalAnalysisEnum
.
equip
.
getKey
()
);
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
createBoolQueryBuilder
(
boolMust
,
dpFilterParamForDetailDto
,
orgCode
);
//监管码状态0已赋码1未赋码
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getSupervisionCodeStatus
()))
{
if
(
StringUtils
.
equals
(
"0"
,
dpFilterParamForDetailDto
.
getSupervisionCodeStatus
()))
{
boolMust
.
must
(
QueryBuilders
.
existsQuery
(
"SUPERVISORY_CODE"
));
boolMust
.
mustNot
(
QueryBuilders
.
termQuery
(
"SUPERVISORY_CODE"
,
"null"
));
}
else
{
boolMust
.
mustNot
(
QueryBuilders
.
existsQuery
(
"SUPERVISORY_CODE"
));
}
}
searchSourceBuilder
.
query
(
boolMust
);
searchSourceBuilder
.
from
(
current
-
1
);
searchSourceBuilder
.
size
(
size
);
searchSourceBuilder
.
trackTotalHits
(
true
);
request
.
source
(
searchSourceBuilder
);
// 创建查询构造器
NativeSearchQuery
query
=
new
NativeSearchQueryBuilder
()
// 分页
.
withPageable
(
PageRequest
.
of
(
current
-
1
,
size
))
//过滤条件
.
withQuery
(
boolMust
).
build
();
query
.
setTrackTotalHits
(
true
);
query
.
setMaxResults
(
size
);
List
<
Map
<
String
,
Object
>>
list
=
new
LinkedList
<>();
long
total
=
0
;
Page
<
Map
<
String
,
Object
>>
result
=
new
Page
<>(
current
,
size
);
try
{
SearchResponse
response
=
restHighLevelClient
.
search
(
request
,
RequestOptions
.
DEFAULT
);
for
(
org
.
elasticsearch
.
search
.
SearchHit
hit
:
response
.
getHits
().
getHits
())
{
System
.
out
.
println
(
hit
);
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
toJSON
(
hit
);
JSONObject
dto2
=
jsonObject
.
getJSONObject
(
"sourceAsMap"
);
if
(!
ValidationUtil
.
isEmpty
(
dto2
.
get
(
EQUSTATE
)))
{
Integer
integer
=
Integer
.
valueOf
(
dto2
.
get
(
EQUSTATE
).
toString
());
String
equStatus
=
EquimentEnum
.
getName
.
get
(
integer
);
dto2
.
put
(
EQUSTATE
,
equStatus
);
}
if
(!
ValidationUtil
.
isEmpty
(
dto2
.
get
(
SUPERVISORYCODE
))
&&
dto2
.
get
(
SUPERVISORYCODE
)
!=
"null"
)
{
dto2
.
put
(
"IS_SUPERVISORY_CODE"
,
"已赋码"
);
}
else
{
dto2
.
put
(
"IS_SUPERVISORY_CODE"
,
"未赋码"
);
}
list
.
add
(
dto2
);
}
total
=
response
.
getInternalResponse
().
hits
().
getTotalHits
().
value
;
result
.
setRecords
(
list
);
result
.
setTotal
(
total
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
return
result
;
}
private
void
createBoolQueryBuilder
(
BoolQueryBuilder
boolMust
,
DPFilterParamForDetailDto
dpFilterParamForDetailDto
,
String
orgCode
)
{
String
orgBranchCode
=
null
;
if
(
dpFilterParamForDetailDto
.
getOrgBranchCode
()
!=
null
)
{
if
(
dpFilterParamForDetailDto
.
getOrgBranchCode
().
contains
(
"_"
))
{
String
code
=
dpFilterParamForDetailDto
.
getOrgBranchCode
().
split
(
"_"
)[
0
];
orgBranchCode
=
stCommonService
.
getAndSetOrgCode
(
code
);
}
}
// 按照管辖机构区域信息模糊查询
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"ORG_BRANCH_CODE"
,
orgCode
));
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"ORG_BRANCH_CODE"
,
orgCode
));
if
(
orgBranchCode
!=
null
)
{
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"ORG_BRANCH_CODE"
,
orgBranchCode
));
}
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getTreeValue
()))
{
if
(
"2300"
.
equals
(
dpFilterParamForDetailDto
.
getTreeValue
())){
if
(
"2300"
.
equals
(
dpFilterParamForDetailDto
.
getTreeValue
()))
{
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_CATEGORY_CODE"
,
QueryParser
.
escape
(
dpFilterParamForDetailDto
.
getTreeValue
().
toLowerCase
())));
}
else
{
}
else
{
boolMust
.
must
(
QueryBuilders
.
termQuery
(
"EQU_LIST_CODE"
,
QueryParser
.
escape
(
dpFilterParamForDetailDto
.
getTreeValue
().
toLowerCase
())));
}
}
// 且8大类,目的去掉脏数据
// boolMust.must(QueryBuilders.termsQuery("EQU_LIST_CODE", StCommonServiceImpl.getEquipmentCategory().stream().map(EquipmentCategoryDto::getCode).collect(Collectors.toList())));
String
[]
status
=
{
"草稿"
,
"已拒领"
,
"待认领"
};
boolMust
.
mustNot
(
QueryBuilders
.
termsQuery
(
"STATUS"
,
Arrays
.
asList
(
status
)));
//检验状态0临期1超期
String
[]
status
=
{
"草稿"
,
"已拒领"
,
"待认领"
};
boolMust
.
mustNot
(
QueryBuilders
.
termsQuery
(
"STATUS"
,
Arrays
.
asList
(
status
)));
// 检验状态: 0:临期,1:超期
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getInspectionStatus
()))
{
if
(
StringUtils
.
equals
(
"0"
,
dpFilterParamForDetailDto
.
getInspectionStatus
()))
{
boolMust
.
filter
(
QueryBuilders
.
rangeQuery
(
"NEXT_INSPECT_DATE"
).
gte
(
LocalDate
.
now
().
format
(
formatter
)).
lte
(
LocalDate
.
now
().
plusDays
(
30
).
format
(
formatter
)));
...
...
@@ -337,107 +329,55 @@ public class EquipmentStaticsServiceImpl {
/**
* 使用单位
*/
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getUseUnitName
()))
{
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getUseUnitName
()))
{
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"USE_UNIT_NAME"
,
"*"
+
dpFilterParamForDetailDto
.
getUseUnitName
()
+
"*"
));
}
/**
* 使用登记编号
*/
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getUseOrgCode
()))
{
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getUseOrgCode
()))
{
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"USE_ORG_CODE"
,
"*"
+
dpFilterParamForDetailDto
.
getUseOrgCode
()
+
"*"
));
}
/**
* 96333
*/
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getCode96333
()))
{
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getCode96333
()))
{
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"CODE96333"
,
"*"
+
dpFilterParamForDetailDto
.
getCode96333
()
+
"*"
));
}
/**
* 监管码
*/
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getSupervisoryCode
()))
{
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getSupervisoryCode
()))
{
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"SUPERVISORY_CODE"
,
"*"
+
dpFilterParamForDetailDto
.
getSupervisoryCode
()
+
"*"
));
}
/**
* 所属地区
*/
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getUsePlace
()))
{
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getUsePlace
()))
{
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"USE_PLACE"
,
"*"
+
dpFilterParamForDetailDto
.
getUsePlace
()
+
"*"
));
}
/**
* 设备状态
*/
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getEquState
()))
{
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getEquState
()))
{
boolMust
.
must
(
QueryBuilders
.
matchPhraseQuery
(
"EQU_STATE"
,
EquimentEnum
.
getCode
.
get
(
dpFilterParamForDetailDto
.
getEquState
())));
}
/**
* 信息化
*/
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getInformationSituation
()))
{
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getInformationSituation
()))
{
boolMust
.
must
(
QueryBuilders
.
matchQuery
(
"INFORMATION_SITUATION"
,
dpFilterParamForDetailDto
.
getInformationSituation
()));
}
/**
* 设备类别
*/
if
(
StrUtil
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getEquCategory
()))
{
if
(
StrUtil
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getEquCategory
()))
{
boolMust
.
must
(
QueryBuilders
.
wildcardQuery
(
"EQU_CATEGORY"
,
"*"
+
dpFilterParamForDetailDto
.
getEquCategory
()
+
"*"
));
}
//监管码状态0已赋码1未赋码
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getSupervisionCodeStatus
()))
{
if
(
StringUtils
.
equals
(
"0"
,
dpFilterParamForDetailDto
.
getSupervisionCodeStatus
()))
{
boolMust
.
must
(
QueryBuilders
.
existsQuery
(
"SUPERVISORY_CODE"
));
boolMust
.
mustNot
(
QueryBuilders
.
termQuery
(
"SUPERVISORY_CODE"
,
"null"
));
}
else
{
boolMust
.
mustNot
(
QueryBuilders
.
existsQuery
(
"SUPERVISORY_CODE"
));
}
}
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getNextInspectionDate
()))
{
if
(
StringUtils
.
isNotEmpty
(
dpFilterParamForDetailDto
.
getNextInspectionDate
()))
{
String
[]
timeArray
=
dpFilterParamForDetailDto
.
getNextInspectionDate
().
split
(
","
);
boolMust
.
filter
(
QueryBuilders
.
rangeQuery
(
"NEXT_INSPECT_DATE"
).
gte
(
timeArray
[
0
]).
lte
(
timeArray
[
1
]));
}
searchSourceBuilder
.
query
(
boolMust
);
searchSourceBuilder
.
from
(
current
-
1
);
searchSourceBuilder
.
size
(
size
);
searchSourceBuilder
.
trackTotalHits
(
true
);
request
.
source
(
searchSourceBuilder
);
// 创建查询构造器
NativeSearchQuery
query
=
new
NativeSearchQueryBuilder
()
// 分页
.
withPageable
(
PageRequest
.
of
(
current
-
1
,
size
))
//过滤条件
.
withQuery
(
boolMust
).
build
();
query
.
setTrackTotalHits
(
true
);
query
.
setMaxResults
(
size
);
List
<
Map
<
String
,
Object
>>
list
=
new
LinkedList
<>();
long
total
=
0
;
Page
<
Map
<
String
,
Object
>>
result
=
new
Page
<>(
current
,
size
);
try
{
SearchResponse
response
=
restHighLevelClient
.
search
(
request
,
RequestOptions
.
DEFAULT
);
for
(
org
.
elasticsearch
.
search
.
SearchHit
hit
:
response
.
getHits
().
getHits
())
{
System
.
out
.
println
(
hit
);
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
toJSON
(
hit
);
JSONObject
dto2
=
jsonObject
.
getJSONObject
(
"sourceAsMap"
);
if
(!
ValidationUtil
.
isEmpty
(
dto2
.
get
(
EQUSTATE
)))
{
Integer
integer
=
Integer
.
valueOf
(
dto2
.
get
(
EQUSTATE
).
toString
());
String
equStatus
=
EquimentEnum
.
getName
.
get
(
integer
);
dto2
.
put
(
EQUSTATE
,
equStatus
);
}
if
(!
ValidationUtil
.
isEmpty
(
dto2
.
get
(
SUPERVISORYCODE
))
&&
dto2
.
get
(
SUPERVISORYCODE
)
!=
"null"
){
dto2
.
put
(
"IS_SUPERVISORY_CODE"
,
"已赋码"
);
}
else
{
dto2
.
put
(
"IS_SUPERVISORY_CODE"
,
"未赋码"
);
}
list
.
add
(
dto2
);
}
total
=
response
.
getInternalResponse
().
hits
().
getTotalHits
().
value
;
result
.
setRecords
(
list
);
result
.
setTotal
(
total
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
return
result
;
}
}
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/resources/mapper/RiskReportMapper.xml
View file @
a78da737
...
...
@@ -20,6 +20,7 @@
FROM
privilege_company
<where>
is_deleted = false
<if
test=
"companyName != null and companyName != ''"
>
AND company_name LIKE CONCAT('%', TRIM(#{companyName}), '%')
</if>
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/mapper/EquipmentCategoryMapper.java
View file @
a78da737
...
...
@@ -127,8 +127,7 @@ public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
"\tAND ui.IS_INTO_MANAGEMENT = 1 \n"
+
"\tAND oi.SUPERVISORY_CODE IS NOT NULL \n"
+
"\tAND ( oi.code96333 IS NULL OR oi.code96333 = '' ) \n"
+
"\tAND ( ui.city != '610100' OR ui.\"IS_NOT_XIXIAN\" = 1 )\n"
+
"\tand oi.SUPERVISORY_CODE in ('A3100-0002769')\n"
)
"\tAND ( ui.city != '610100' OR ui.\"IS_NOT_XIXIAN\" = 1 )\n"
)
List
<
Map
<
String
,
String
>>
selectExceptionCode96333
();
@Select
(
"select * from biz_jg_supervisory_code where supervisory_code = #{supervisoryCode} ORDER BY supervisory_code"
)
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/biz/service/impl/EquipmentCategoryServiceImpl.java
View file @
a78da737
...
...
@@ -2700,12 +2700,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
String
city
=
jsonObj
.
getString
(
"city"
);
String
county
=
jsonObj
.
getString
(
"county"
);
String
isNotXixian
=
jsonObj
.
getString
(
"isNotXixian"
);
if
(
StringUtils
.
isEmpty
(
city
)
||
"null"
.
equals
(
city
))
{
// 监管码
String
supervisoryCode
=
jsonObj
.
getString
(
"supervisoryCode"
);
if
(
StringUtils
.
isEmpty
(
city
)
||
"null"
.
equals
(
city
)
||
StringUtils
.
isEmpty
(
supervisoryCode
))
{
manualProcessData
.
add
(
jsonObj
);
return
;
}
// 监管码
String
supervisoryCode
=
jsonObj
.
getString
(
"supervisoryCode"
);
// record
String
record
=
jsonObj
.
getString
(
"record"
);
String
code96333
=
""
;
...
...
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