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
c6744180
Commit
c6744180
authored
Jul 09, 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
77e92940
8dbba929
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
927 additions
and
118 deletions
+927
-118
XiAnDataDockServiceImpl.java
...oin/amos/api/openapi/service/XiAnDataDockServiceImpl.java
+3
-7
JgNoticeToBeSubmitDto.java
...in/amos/boot/module/jg/api/dto/JgNoticeToBeSubmitDto.java
+3
-0
JgInstallationNotice.java
.../amos/boot/module/jg/api/entity/JgInstallationNotice.java
+6
-0
BusinessTypeEnum.java
...ejoin/amos/boot/module/jg/api/enums/BusinessTypeEnum.java
+3
-1
JgInstallationNoticeMapper.xml
.../src/main/resources/mapper/JgInstallationNoticeMapper.xml
+5
-1
EquipClaimController.java
...s/boot/module/jg/biz/controller/EquipClaimController.java
+49
-0
DataDockServiceImpl.java
.../boot/module/jg/biz/service/impl/DataDockServiceImpl.java
+3
-10
EquipClaimServiceImpl.java
...oot/module/jg/biz/service/impl/EquipClaimServiceImpl.java
+736
-0
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+30
-19
JgChangeRegistrationUnitServiceImpl.java
...biz/service/impl/JgChangeRegistrationUnitServiceImpl.java
+31
-21
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+2
-1
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+4
-2
DataQualityScoreEnum.java
...oot/module/statistics/api/enums/DataQualityScoreEnum.java
+3
-3
EquipStateEnum.java
...amos/boot/module/statistics/api/enums/EquipStateEnum.java
+12
-2
UnitTypeNewEnum.java
...mos/boot/module/statistics/api/enums/UnitTypeNewEnum.java
+1
-1
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+21
-34
equipCategory.json
...statistics-biz/src/main/resources/json/equipCategory.json
+15
-16
No files found.
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/service/XiAnDataDockServiceImpl.java
View file @
c6744180
...
...
@@ -11,6 +11,7 @@ import com.yeejoin.amos.api.common.restful.utils.ResponseHelper;
import
com.yeejoin.amos.api.openapi.dto.XiAnElevatorExcelDto
;
import
com.yeejoin.amos.api.openapi.dto.XiAnEquipInfoExcelDto
;
import
com.yeejoin.amos.api.openapi.feign.TzsJgServiceFeignClient
;
import
com.yeejoin.amos.boot.biz.common.utils.RequestContextWrapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
...
...
@@ -84,18 +85,13 @@ public class XiAnDataDockServiceImpl {
int
batchSize
=
1000
;
int
totalSize
=
equipInfoExcelDtos
.
size
();
// 主线程中获取登录信息传递到异步线程中
String
appKey
=
RequestContext
.
getAppKey
();
String
product
=
RequestContext
.
getProduct
();
String
token
=
RequestContext
.
getToken
();
RequestContextWrapper
contextWrapper
=
RequestContextWrapper
.
capture
();
List
<
CompletableFuture
<
Void
>>
futures
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
totalSize
;
i
+=
batchSize
)
{
List
<
XiAnEquipInfoExcelDto
>
batch
=
equipInfoExcelDtos
.
subList
(
i
,
Math
.
min
(
totalSize
,
i
+
batchSize
));
CompletableFuture
<
Void
>
future
=
CompletableFuture
.
runAsync
(()
->
{
try
{
RequestContext
.
setAppKey
(
appKey
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setToken
(
token
);
contextWrapper
.
apply
();
jgServiceFeignClient
.
saveEquipmentData
(
batch
);
}
catch
(
Exception
e
)
{
log
.
error
(
"西安数据上传,保存设备数据失败: "
,
e
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/JgNoticeToBeSubmitDto.java
View file @
c6744180
...
...
@@ -23,6 +23,9 @@ public class JgNoticeToBeSubmitDto extends BaseDto {
@ApiModelProperty
(
value
=
"业务类型"
)
private
String
businessType
;
@ApiModelProperty
(
value
=
"业务类型Code"
)
private
String
type
;
@ApiModelProperty
(
value
=
"申请单号"
)
private
String
applyNo
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/entity/JgInstallationNotice.java
View file @
c6744180
...
...
@@ -510,4 +510,10 @@ public class JgInstallationNotice extends BaseEntity {
*/
@TableField
(
"certificate_print_tag"
)
private
String
certificatePrintTag
;
/**
* 是否暂存状态(0-否,1-是)
*/
@TableField
(
"is_temporary_status"
)
private
String
isTemporaryStatus
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/enums/BusinessTypeEnum.java
View file @
c6744180
...
...
@@ -65,7 +65,9 @@ public enum BusinessTypeEnum {
JG_NEW_EQUIP
(
"122"
,
"新增设备"
),
JG_NEW_PROJECT
(
"123"
,
"新增装置"
);
JG_NEW_PROJECT
(
"123"
,
"新增装置"
),
JG_EQUIP_CLAIM
(
"124"
,
"设备认领"
);
private
final
String
code
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgInstallationNoticeMapper.xml
View file @
c6744180
...
...
@@ -390,6 +390,7 @@
SELECT
isn.sequence_nbr AS sequenceNbr,
'安装告知' AS businessType,
'GZ_AZ' AS type,
isn.apply_no AS applyNo,
ec1.name AS equListName,
ec2.name AS equCategoryName,
...
...
@@ -405,6 +406,7 @@
SELECT
isn.sequence_nbr AS sequenceNbr,
'改造告知' AS businessType,
'GZ_GZ' AS type,
isn.apply_no AS applyNo,
isn.equ_list_name AS equListName,
isn.equ_category_name AS equCategoryName,
...
...
@@ -418,6 +420,7 @@
SELECT
isn.sequence_nbr AS sequenceNbr,
'维修告知' AS businessType,
'GZ_WX' AS type,
isn.apply_no AS applyNo,
ec1.name AS equListName,
ec2.name AS equCategoryName,
...
...
@@ -433,6 +436,7 @@
SELECT
isn.sequence_nbr AS sequenceNbr,
'移装告知' AS businessType,
'GZ_YZ' AS type,
isn.apply_no AS applyNo,
ec1.name AS equListName,
ec2.name AS equCategoryName,
...
...
@@ -441,7 +445,7 @@
DATE_FORMAT(isn.create_date, '%Y-%m-%d') AS createDate
FROM tzs_jg_transfer_notice isn
LEFT JOIN tz_equipment_category ec1 ON ec1.code = isn.equ_list_code
LEFT JOIN tz_equipment_category ec2 ON ec2.code = isn.equ_category
LEFT JOIN tz_equipment_category ec2 ON ec2.code = isn.equ_category
_code
WHERE isn.is_delete = false
AND isn.notice_status = '6610'
AND isn.install_unit_credit_code = #{companyCode}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/EquipClaimController.java
0 → 100644
View file @
c6744180
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.EquipClaimServiceImpl
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.Map
;
@Api
(
tags
=
"设备认领"
)
@RestController
@RequestMapping
(
value
=
"/equipClaim"
)
@RequiredArgsConstructor
public
class
EquipClaimController
extends
BaseController
{
private
final
EquipClaimServiceImpl
equipClaimService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/setEquip/page"
)
@ApiOperation
(
value
=
"待认领-台套设备分页"
,
httpMethod
=
"GET"
)
public
ResponseModel
<
Page
<
JSONObject
>>
setEquipPage
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
equipClaimService
.
setEquipPage
(
new
JSONObject
(
map
)));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/setEquip/claim"
)
@ApiOperation
(
value
=
"认领-台套设备"
,
httpMethod
=
"POST"
)
public
ResponseModel
<
Object
>
setEquipClaim
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
equipClaimService
.
setEquipClaim
(
new
JSONObject
(
map
)));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/pipeEquip/page"
)
@ApiOperation
(
value
=
"待认领-管道装置设备分页"
,
httpMethod
=
"GET"
)
public
ResponseModel
<
IPage
<
IdxBizJgProjectContraption
>>
pipeEquipPage
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
equipClaimService
.
pipeEquipPage
(
new
JSONObject
(
map
)));
}
}
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/DataDockServiceImpl.java
View file @
c6744180
...
...
@@ -18,10 +18,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import
com.google.common.collect.Sets
;
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.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil
;
import
com.yeejoin.amos.boot.biz.common.utils.*
;
import
com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.common.api.dao.ExcelImportErrorLogDao
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
...
...
@@ -172,15 +169,11 @@ public class DataDockServiceImpl {
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
xiAnSaveEquipmentData
(
List
<
Map
<
String
,
Object
>>
equLists
)
{
String
appKey
=
RequestContext
.
getAppKey
();
String
product
=
RequestContext
.
getProduct
();
String
token
=
RequestContext
.
getToken
();
RequestContextWrapper
contextWrapper
=
RequestContextWrapper
.
capture
();
Set
<
String
>
recordSet
=
new
HashSet
<>();
CompletableFuture
.
allOf
(
equLists
.
parallelStream
().
map
(
equ
->
CompletableFuture
.
runAsync
(()
->
{
RequestContext
.
setAppKey
(
appKey
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setToken
(
token
);
contextWrapper
.
apply
();
String
record
=
saveEquipmentDataInTransaction
(
equ
,
"jg_his_xa"
,
null
);
recordSet
.
add
(
record
);
})).
toArray
(
CompletableFuture
[]::
new
)
...
...
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/EquipClaimServiceImpl.java
0 → 100644
View file @
c6744180
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.map.MapUtil
;
import
com.alibaba.fastjson.JSON
;
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.metadata.IPage
;
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.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgResumeInfoDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgResumeInfo
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq
;
import
com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationEqMapper
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.service.*
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
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.EquipmentClassifityEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
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.Operator
;
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.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.io.IOException
;
import
java.time.Instant
;
import
java.time.ZoneId
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicReference
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
toJSONString
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
.
IdxBizJgRegisterInfoServiceImpl
.*;
@Slf4j
@Service
@RequiredArgsConstructor
public
class
EquipClaimServiceImpl
{
private
static
final
String
JG_ALL_INDEX
=
"idx_biz_view_jg_all"
;
private
static
final
String
NUMBER
=
"number"
;
private
static
final
String
SIZE
=
"size"
;
private
static
final
String
SEQUENCE_NBR
=
"SEQUENCE_NBR"
;
private
static
final
String
EQU_STATE
=
"EQU_STATE"
;
private
static
final
String
record
=
"record"
;
private
static
final
String
RECORD
=
"RECORD"
;
private
static
final
String
CREATE_DATE
=
"CREATE_DATE"
;
private
static
final
String
DATA_SOURCE
=
"DATA_SOURCE"
;
private
static
final
String
IS_INTO_MANAGEMENT
=
"IS_INTO_MANAGEMENT"
;
private
static
final
String
EQU_LIST_CODE
=
"EQU_LIST_CODE"
;
private
static
final
String
EQU_CATEGORY_CODE
=
"EQU_CATEGORY_CODE"
;
private
static
final
String
EQU_DEFINE_CODE
=
"EQU_DEFINE_CODE"
;
private
static
final
String
PRODUCT_NAME
=
"PRODUCT_NAME"
;
private
static
final
String
EQU_CODE
=
"EQU_CODE"
;
private
static
final
String
USE_UNIT_NAME
=
"USE_UNIT_NAME"
;
private
static
final
String
ORG_BRANCH_CODE
=
"ORG_BRANCH_CODE"
;
private
static
final
String
ADDRESS
=
"ADDRESS"
;
private
static
final
String
data_source
=
"data_source"
;
private
static
final
String
jg_his_xa
=
"jg_his_xa"
;
private
static
final
String
is_into_management
=
"is_into_management"
;
private
static
final
String
equ_list
=
"equ_list"
;
private
static
final
String
create_date
=
"create_date"
;
public
static
final
String
JG_HIS_XA_CLAIM
=
"jg_his_xa_claim"
;
private
final
RedisUtils
redisUtils
;
private
final
ICommonService
commonService
;
private
final
RestHighLevelClient
restHighLevelClient
;
private
final
JgResumeInfoServiceImpl
jgResumeInfoService
;
private
final
IdxBizJgProjectContraptionServiceImplService
projectContraptionServiceImplService
;
private
final
IdxBizJgRegisterInfoServiceImpl
jgRegisterInfoService
;
private
final
IIdxBizJgConstructionInfoService
iIdxBizJgConstructionInfoService
;
private
final
IIdxBizJgUseInfoService
idxBizJgUseInfoService
;
private
final
IIdxBizJgDesignInfoService
iIdxBizJgDesignInfoService
;
private
final
IIdxBizJgFactoryInfoService
iIdxBizJgFactoryInfoService
;
private
final
IIdxBizJgOtherInfoService
iIdxBizJgOtherInfoService
;
private
final
IIdxBizJgSupervisionInfoService
iIdxBizJgSupervisionInfoService
;
private
final
IIdxBizJgInspectionDetectionInfoService
iIdxBizJgInspectionDetectionInfoService
;
private
final
JgUseRegistrationServiceImpl
useRegistrationService
;
private
final
JgUseRegistrationEqMapper
jgRelationEquipMapper
;
private
final
TzsServiceFeignClient
tzsServiceFeignClient
;
private
final
IdxBizJgSupervisionInfoMapper
idxBizJgSupervisionInfoMapper
;
private
final
IdxBizJgRegisterInfoMapper
idxBizJgRegisterInfoMapper
;
private
final
IdxBizJgDesignInfoServiceImpl
idxBizJgDesignInfoService
;
private
final
IdxBizJgDesignInfoMapper
idxBizJgDesignInfoMapper
;
private
final
IdxBizJgFactoryInfoServiceImpl
idxBizJgFactoryInfoService
;
private
final
IdxBizJgFactoryInfoMapper
idxBizJgFactoryInfoMapper
;
private
final
IdxBizJgUseInfoMapper
useInfoMapper
;
private
final
IdxBizJgOtherInfoMapper
otherInfoMapper
;
private
final
SnowflakeIdUtil
sequence
;
/**
* 当前登录人信息
*
* @return 当前登录人信息
*/
protected
ReginParams
getSelectedOrgInfo
()
{
return
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
}
/**
* 待认领-台套设备分页
*
* @param params 筛选条件
* @return result
*/
public
Page
<
JSONObject
>
setEquipPage
(
JSONObject
params
)
{
int
number
=
Integer
.
parseInt
((
String
)
params
.
getOrDefault
(
NUMBER
,
"1"
));
int
size
=
Integer
.
parseInt
((
String
)
params
.
getOrDefault
(
SIZE
,
"20"
));
long
totle
=
0
;
Page
<
JSONObject
>
result
=
new
Page
<>(
number
,
size
);
SearchRequest
request
=
new
SearchRequest
();
request
.
indices
(
JG_ALL_INDEX
);
SearchSourceBuilder
builder
=
new
SearchSourceBuilder
();
builder
.
trackTotalHits
(
true
);
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
// 默认条件 DATA_SOURCE == jg_his_xa && IS_INTO_MANAGEMENT == false && EQU_LIST_CODE != 8000
BoolQueryBuilder
dBuilder
=
QueryBuilders
.
boolQuery
();
dBuilder
.
must
(
QueryBuilders
.
termQuery
(
DATA_SOURCE
,
jg_his_xa
));
dBuilder
.
mustNot
(
QueryBuilders
.
termQuery
(
EQU_LIST_CODE
,
EquipmentClassifityEnum
.
YLGD
.
getCode
()));
dBuilder
.
must
(
QueryBuilders
.
matchQuery
(
IS_INTO_MANAGEMENT
,
false
));
boolMust
.
must
(
dBuilder
);
// -------------------------------- 参数过滤
this
.
buildSetSearchParams
(
params
,
boolMust
);
// -------------------------------- 字段排序
builder
.
sort
(
CREATE_DATE
,
SortOrder
.
DESC
);
builder
.
query
(
boolMust
);
builder
.
from
((
number
-
1
)
*
size
);
builder
.
size
(
size
);
request
.
source
(
builder
);
List
<
JSONObject
>
list
=
new
LinkedList
<>();
try
{
SearchResponse
response
=
restHighLevelClient
.
search
(
request
,
RequestOptions
.
DEFAULT
);
for
(
SearchHit
hit
:
response
.
getHits
().
getHits
())
{
JSONObject
sourceAsJSON
=
JSONObject
.
parseObject
(
toJSONString
(
hit
.
getSourceAsMap
()));
// 设备状态转化
if
(!
ValidationUtil
.
isEmpty
(
sourceAsJSON
.
get
(
EQU_STATE
)))
{
sourceAsJSON
.
put
(
EQU_STATE
,
EquimentEnum
.
getName
.
get
(
Integer
.
valueOf
(
sourceAsJSON
.
get
(
EQU_STATE
).
toString
())));
}
sourceAsJSON
.
put
(
record
,
sourceAsJSON
.
get
(
SEQUENCE_NBR
));
// 日期转化
sourceAsJSON
.
put
(
CREATE_DATE
,
Instant
.
ofEpochMilli
(
Long
.
parseLong
(
sourceAsJSON
.
getString
(
CREATE_DATE
))).
atZone
(
ZoneId
.
systemDefault
()).
toLocalDate
());
list
.
add
(
sourceAsJSON
);
}
if
(
response
.
getInternalResponse
().
hits
().
getTotalHits
()
!=
null
)
{
totle
=
response
.
getInternalResponse
().
hits
().
getTotalHits
().
value
;
}
result
.
setRecords
(
list
);
result
.
setTotal
(
totle
);
}
catch
(
IOException
e
)
{
log
.
error
(
"查询待认领台套设备,分页异常:{}"
,
e
.
getMessage
());
throw
new
RuntimeException
(
e
);
}
return
result
;
}
/**
* 台套查询条件组装
*
* @param params
* @param boolMust
*/
private
void
buildSetSearchParams
(
JSONObject
params
,
BoolQueryBuilder
boolMust
)
{
// 设备种类编码
if
(!
ObjectUtils
.
isEmpty
(
params
.
getString
(
EQU_LIST_CODE
)))
{
BoolQueryBuilder
elcBuilder
=
QueryBuilders
.
boolQuery
();
String
test
=
QueryParser
.
escape
(
params
.
getString
(
EQU_LIST_CODE
));
elcBuilder
.
must
(
QueryBuilders
.
matchPhraseQuery
(
EQU_LIST_CODE
,
test
));
boolMust
.
must
(
elcBuilder
);
}
// 设备类别编码
if
(!
ObjectUtils
.
isEmpty
(
params
.
getString
(
EQU_CATEGORY_CODE
)))
{
BoolQueryBuilder
pBuilder
=
QueryBuilders
.
boolQuery
();
String
test
=
QueryParser
.
escape
(
params
.
getString
(
EQU_CATEGORY_CODE
));
pBuilder
.
must
(
QueryBuilders
.
termQuery
(
EQU_CATEGORY_CODE
,
test
));
boolMust
.
must
(
pBuilder
);
}
// 设备品种编码
if
(!
ObjectUtils
.
isEmpty
(
params
.
getString
(
EQU_DEFINE_CODE
)))
{
BoolQueryBuilder
elcBuilder
=
QueryBuilders
.
boolQuery
();
String
test
=
QueryParser
.
escape
(
params
.
getString
(
EQU_DEFINE_CODE
));
elcBuilder
.
must
(
QueryBuilders
.
matchPhraseQuery
(
EQU_DEFINE_CODE
,
test
));
boolMust
.
must
(
elcBuilder
);
}
// 设备名称
if
(!
ObjectUtils
.
isEmpty
(
params
.
getString
(
PRODUCT_NAME
)))
{
BoolQueryBuilder
elcBuilder
=
QueryBuilders
.
boolQuery
();
String
test
=
QueryParser
.
escape
(
params
.
getString
(
PRODUCT_NAME
));
elcBuilder
.
must
(
QueryBuilders
.
matchPhraseQuery
(
PRODUCT_NAME
,
test
));
boolMust
.
must
(
elcBuilder
);
}
// 设备代码模糊查询
if
(!
ObjectUtils
.
isEmpty
(
params
.
getString
(
EQU_CODE
)))
{
BoolQueryBuilder
pBuilder
=
QueryBuilders
.
boolQuery
();
String
test
=
QueryParser
.
escape
(
params
.
getString
(
EQU_CODE
));
pBuilder
.
must
(
QueryBuilders
.
wildcardQuery
(
EQU_CODE
,
"*"
+
QueryParser
.
escape
(
test
.
toLowerCase
())
+
"*"
));
boolMust
.
must
(
pBuilder
);
}
// 使用单位 名称模糊查询
if
(!
ObjectUtils
.
isEmpty
(
params
.
getString
(
USE_UNIT_NAME
)))
{
BoolQueryBuilder
pBuilder
=
QueryBuilders
.
boolQuery
();
String
text
=
params
.
getString
(
USE_UNIT_NAME
);
pBuilder
.
must
(
QueryBuilders
.
matchQuery
(
USE_UNIT_NAME
,
text
).
operator
(
Operator
.
AND
));
boolMust
.
must
(
pBuilder
);
}
// 属地监管部门
if
(!
ObjectUtils
.
isEmpty
(
params
.
getString
(
ORG_BRANCH_CODE
)))
{
BoolQueryBuilder
pBuilder
=
QueryBuilders
.
boolQuery
();
pBuilder
.
must
(
QueryBuilders
.
wildcardQuery
(
"ORG_BRANCH_CODE.keyword"
,
QueryParser
.
escape
(
params
.
getString
(
ORG_BRANCH_CODE
))
+
"*"
));
boolMust
.
must
(
pBuilder
);
}
// 设备使用地址 名称模糊查询
if
(!
ObjectUtils
.
isEmpty
(
params
.
getString
(
ADDRESS
)))
{
BoolQueryBuilder
pBuilder
=
QueryBuilders
.
boolQuery
();
pBuilder
.
must
(
QueryBuilders
.
matchQuery
(
ADDRESS
,
params
.
getString
(
ADDRESS
))
.
operator
(
Operator
.
AND
));
boolMust
.
must
(
pBuilder
);
}
}
/**
* 待认领-管道装置设备分页
*
* @param params
* @return
*/
public
IPage
<
IdxBizJgProjectContraption
>
pipeEquipPage
(
JSONObject
params
)
{
int
number
=
Integer
.
parseInt
((
String
)
params
.
getOrDefault
(
NUMBER
,
"1"
));
int
size
=
Integer
.
parseInt
((
String
)
params
.
getOrDefault
(
SIZE
,
"20"
));
Page
<
IdxBizJgProjectContraption
>
page
=
new
Page
<>(
number
,
size
);
QueryWrapper
<
IdxBizJgProjectContraption
>
queryWrapper
=
new
QueryWrapper
<
IdxBizJgProjectContraption
>();
// 默认条件 DATA_SOURCE == jg_his_xa && IS_INTO_MANAGEMENT == false && EQU_LIST_CODE == 8000
queryWrapper
.
eq
(
data_source
,
jg_his_xa
);
queryWrapper
.
eq
(
is_into_management
,
false
);
queryWrapper
.
eq
(
equ_list
,
EquipmentClassifityEnum
.
YLGD
.
getCode
());
// -------------------------------- 参数过滤
this
.
buildPipeSearchParams
(
params
,
queryWrapper
);
queryWrapper
.
orderByDesc
(
create_date
);
return
projectContraptionServiceImplService
.
page
(
page
,
queryWrapper
);
}
/**
* 管道装置查询条件组装
*
* @param params
* @param queryWrapper
*/
private
void
buildPipeSearchParams
(
JSONObject
params
,
QueryWrapper
<
IdxBizJgProjectContraption
>
queryWrapper
)
{
queryWrapper
.
eq
(!
ObjectUtils
.
isEmpty
(
params
.
getString
(
"equCategoryCode"
)),
"equ_category"
,
params
.
getString
(
"equCategoryCode"
));
queryWrapper
.
eq
(!
ObjectUtils
.
isEmpty
(
params
.
getString
(
"equDefineCode"
)),
"equ_define"
,
params
.
getString
(
"equDefineCode"
));
queryWrapper
.
like
(!
ObjectUtils
.
isEmpty
(
params
.
getString
(
"projectContraption"
)),
"project_contraption"
,
params
.
getString
(
"projectContraption"
));
queryWrapper
.
like
(!
ObjectUtils
.
isEmpty
(
params
.
getString
(
"projectContraptionNo"
)),
"project_contraption_no"
,
params
.
getString
(
"projectContraptionNo"
));
queryWrapper
.
like
(!
ObjectUtils
.
isEmpty
(
params
.
getString
(
"useUnitName"
)),
"use_unit_name"
,
params
.
getString
(
"useUnitName"
));
queryWrapper
.
likeRight
(!
ObjectUtils
.
isEmpty
(
params
.
getString
(
"orgBranchCode"
)),
"org_code"
,
params
.
getString
(
"orgBranchCode"
));
}
/**
* 认领-台套设备
*
* @param json
* @return
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Object
setEquipClaim
(
JSONObject
json
)
{
JSONObject
equipInfo
=
JSON
.
parseObject
(
toJSONString
(
json
.
get
(
EQUIP_INFO_FORM_ID
)));
JSONObject
equipParams
=
JSON
.
parseObject
(
toJSONString
(
json
.
get
(
EQUIP_PARAMS_FORM_ID
)));
CompanyBo
company
=
getSelectedOrgInfo
().
getCompany
();
String
useRegistrationCode
=
Objects
.
toString
(
equipInfo
.
get
(
"useRegistrationCode"
),
null
);
// 参数校验 - 同 设备录入的逻辑
this
.
checkParams
(
new
LinkedHashMap
<>(
equipInfo
));
if
(
StringUtils
.
isEmpty
(
useRegistrationCode
))
{
// 认领到自己单位下 -> 未纳管设备列表 , dataSource 变为 -> jg_his_xa_claim
// 认领 更新设备信息
this
.
updateEquipInfoWithClaim
(
equipInfo
,
equipParams
,
false
);
// 添加设备的业务履历
this
.
addEquipResume
(
equipInfo
,
new
JgUseRegistration
());
}
else
{
// 认领到自己单位下 -> 已纳管设备列表 , + 历史设备登记
// 认领 更新设备信息
this
.
updateEquipInfoWithClaim
(
equipInfo
,
equipParams
,
true
);
// 历史设备登记
JgUseRegistration
useRegistration
=
this
.
addHistoryEquipRegistration
(
equipInfo
);
// 添加设备的业务履历
this
.
addEquipResume
(
equipInfo
,
useRegistration
);
}
// 添加es中的使用单位信息
HashMap
<
String
,
Map
<
String
,
Object
>>
objMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"USE_UNIT_CREDIT_CODE"
,
company
.
getCompanyCode
());
param
.
put
(
"USE_UNIT_NAME"
,
company
.
getCompanyName
());
objMap
.
put
(
equipInfo
.
get
(
RECORD
).
toString
(),
param
);
tzsServiceFeignClient
.
commonUpdateEsDataByIds
(
objMap
);
return
Boolean
.
TRUE
;
}
/**
* 历史设备登记
*
* @param equipInfo
* @return
*/
public
JgUseRegistration
addHistoryEquipRegistration
(
JSONObject
equipInfo
)
{
String
record
=
(
String
)
equipInfo
.
get
(
RECORD
);
CompanyBo
company
=
getSelectedOrgInfo
().
getCompany
();
AgencyUserModel
userModel
=
getSelectedOrgInfo
().
getUserModel
();
equipInfo
.
put
(
"useUnitCreditCode"
,
company
.
getCompanyCode
());
equipInfo
.
put
(
"useUnitName"
,
company
.
getCompanyName
());
equipInfo
.
put
(
"useInnerCode"
,
equipInfo
.
get
(
"USE_INNER_CODE"
));
// 历史使用登记信息
JgUseRegistration
jgUseRegistration
=
new
JgUseRegistration
();
jgUseRegistration
.
setSequenceNbr
(
sequence
.
nextId
());
try
{
jgUseRegistration
.
setRegDate
(
ValidationUtil
.
isEmpty
(
equipInfo
.
get
(
"oRegDate"
))
?
new
Date
()
:
DateUtils
.
dateParse
((
String
)
equipInfo
.
get
(
"oRegDate"
),
DateUtils
.
DATE_PATTERN
));
}
catch
(
Exception
e
)
{
log
.
error
(
"设备认领,历史使用登记信息转换日期失败:"
,
e
);
}
jgUseRegistration
.
setInputUnitNo
(
Objects
.
toString
(
equipInfo
.
get
(
"oRegUnit"
),
null
));
if
(!
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"otherAccessories"
)))
{
jgUseRegistration
.
setOtherAccessories
(
toJSONString
(
equipInfo
.
get
(
"otherAccessories"
)));
}
if
(
equipInfo
.
containsKey
(
"receiveOrgCode"
))
{
// 接收单位信息
String
[]
splitMaintenanceUnitCode
=
Objects
.
toString
(
equipInfo
.
getString
(
"receiveOrgCode"
),
""
).
split
(
"_"
);
jgUseRegistration
.
setReceiveCompanyCode
(
splitMaintenanceUnitCode
[
0
]);
jgUseRegistration
.
setReceiveOrgName
(
splitMaintenanceUnitCode
[
1
]);
jgUseRegistration
.
setReceiveCompanyOrgCode
(
commonService
.
getOneCompany
(
jgUseRegistration
.
getReceiveCompanyCode
()).
getOrgCode
());
}
if
(
equipInfo
.
containsKey
(
"orgBranchCode"
)
&&
!
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"orgBranchCode"
)))
{
// 监察处置机构代码
String
[]
splitOrgBranchCode
=
Objects
.
toString
(
equipInfo
.
getString
(
"orgBranchCode"
),
""
).
split
(
"_"
);
jgUseRegistration
.
setSupervisionOrgCode
(
splitOrgBranchCode
[
0
]);
}
// 使用单位提交
jgUseRegistration
.
setUseUnitName
(
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
())
?
company
.
getCompanyName
().
split
(
"_"
)[
1
]
:
company
.
getCompanyName
());
jgUseRegistration
.
setUseUnitCreditCode
(
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
())
?
company
.
getCompanyCode
().
split
(
"_"
)[
1
]
:
company
.
getCompanyCode
());
jgUseRegistration
.
setCreateUserId
(
userModel
.
getUserId
());
jgUseRegistration
.
setCreateUserName
(
userModel
.
getUserName
());
jgUseRegistration
.
setManageType
(
"set"
);
if
(!
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"inspectUnitCreditCode"
)))
{
jgUseRegistration
.
setInspectUnitCreditCode
(
equipInfo
.
get
(
"inspectUnitCreditCode"
).
toString
());
}
if
(!
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"inspectOrgName"
)))
{
jgUseRegistration
.
setInspectUnitName
(
equipInfo
.
get
(
"inspectOrgName"
).
toString
());
}
// 是否西咸
if
(!
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"isXixian"
)))
{
jgUseRegistration
.
setIsXixian
(
Objects
.
toString
(
equipInfo
.
get
(
"isXixian"
),
null
));
}
// 使用地点
String
useCityName
=
""
;
String
useCountyName
=
""
;
String
useStreetName
=
""
;
// 市
List
<
LinkedHashMap
>
city
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
"CITY"
);
// 区
List
<
LinkedHashMap
>
region
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
"REGION"
);
// 街道
List
<
LinkedHashMap
>
street
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
"STREET"
);
jgUseRegistration
.
setUseAddress
(
"陕西省"
);
// 城市
if
(!
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"city"
))
&&
!
ObjectUtils
.
isEmpty
(
city
))
{
AtomicReference
<
String
>
atomicUseCity
=
new
AtomicReference
<>(
useCityName
);
city
.
forEach
(
item
->
{
if
(
Objects
.
toString
(
item
.
get
(
"regionCode"
)).
equals
(
Objects
.
toString
(
equipInfo
.
get
(
"city"
))))
{
atomicUseCity
.
set
(
""
+
item
.
get
(
"regionName"
));
jgUseRegistration
.
setUseAddress
(
jgUseRegistration
.
getUseAddress
()
+
item
.
get
(
"regionName"
));
}
});
useCityName
=
atomicUseCity
.
get
();
}
// 区县
if
(!
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"county"
))
&&
!
ObjectUtils
.
isEmpty
(
city
))
{
AtomicReference
<
String
>
atomicUseCounty
=
new
AtomicReference
<>(
useCountyName
);
region
.
forEach
(
item
->
{
if
(
Objects
.
toString
(
item
.
get
(
"regionCode"
)).
equals
(
Objects
.
toString
(
equipInfo
.
get
(
"county"
))))
{
atomicUseCounty
.
set
(
""
+
item
.
get
(
"regionName"
));
jgUseRegistration
.
setUseAddress
(
jgUseRegistration
.
getUseAddress
()
+
item
.
get
(
"regionName"
));
}
});
useCountyName
=
atomicUseCounty
.
get
();
}
// 街道
if
(!
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"factoryUseSiteStreet"
))
&&
!
ObjectUtils
.
isEmpty
(
city
))
{
JSONObject
finalMap2
=
equipInfo
;
AtomicReference
<
String
>
atomicUseStreet
=
new
AtomicReference
<>(
useStreetName
);
street
.
forEach
(
item
->
{
if
(
Objects
.
toString
(
item
.
get
(
"regionCode"
)).
equals
(
Objects
.
toString
(
finalMap2
.
get
(
"factoryUseSiteStreet"
))))
{
atomicUseStreet
.
set
(
""
+
item
.
get
(
"regionName"
));
jgUseRegistration
.
setUseAddress
(
jgUseRegistration
.
getUseAddress
()
+
item
.
get
(
"regionName"
));
}
});
useStreetName
=
atomicUseStreet
.
get
();
}
jgUseRegistration
.
setUseAddress
(
jgUseRegistration
.
getUseAddress
()
+
equipInfo
.
get
(
"address"
));
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
SYDJ
.
getCode
(),
1
);
if
(!
ObjectUtils
.
isEmpty
(
listResponseModel
))
{
jgUseRegistration
.
setApplyNo
(
listResponseModel
.
getResult
().
get
(
0
));
}
jgUseRegistration
.
setAuditPassDate
(
new
Date
());
jgUseRegistration
.
setAuditStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
jgUseRegistration
.
setStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
jgUseRegistration
.
setUseRegistrationCode
(
ValidationUtil
.
isEmpty
(
equipInfo
.
get
(
"useRegistrationCode"
))
?
""
:
Objects
.
toString
(
equipInfo
.
get
(
"useRegistrationCode"
),
null
));
jgUseRegistration
.
setRegType
(
"1"
);
// 历史登记
// 暂存历史表
useRegistrationService
.
updateHistory
(
equipInfo
,
Objects
.
toString
(
record
,
null
),
Objects
.
toString
(
jgUseRegistration
.
getSequenceNbr
(),
null
),
jgUseRegistration
.
getSupervisoryCode
());
// 监督管理信息
LambdaQueryWrapper
<
IdxBizJgSupervisionInfo
>
lambdaSup
=
new
QueryWrapper
<
IdxBizJgSupervisionInfo
>().
lambda
();
lambdaSup
.
eq
(
IdxBizJgSupervisionInfo:
:
getRecord
,
record
);
IdxBizJgSupervisionInfo
supervisionInfo
=
idxBizJgSupervisionInfoMapper
.
selectOne
(
lambdaSup
);
if
(
supervisionInfo
!=
null
&&
!
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"orgBranchCode"
)))
{
supervisionInfo
.
setOrgBranchCode
(
Objects
.
toString
(
equipInfo
.
get
(
"orgBranchCode"
),
""
).
split
(
"_"
)[
0
]);
supervisionInfo
.
setOrgBranchName
(
Objects
.
toString
(
equipInfo
.
get
(
"orgBranchCode"
),
""
).
split
(
"_"
)[
1
]);
idxBizJgSupervisionInfoMapper
.
updateById
(
supervisionInfo
);
}
// 注册信息
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
lambdaReg
=
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
lambda
();
lambdaReg
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
record
);
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
lambdaReg
);
String
equCode
=
Objects
.
toString
(
equipInfo
.
get
(
"equCode"
),
null
);
if
(
registerInfo
!=
null
)
{
registerInfo
.
setUseOrgCode
(
jgUseRegistration
.
getUseRegistrationCode
());
registerInfo
.
setEquCodeType
(
Objects
.
toString
(
equipInfo
.
get
(
"equCodeType"
),
null
));
// 新提交或暂存后提交需生成设备代码
equCode
=
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"equCode"
))
&&
!
StringUtils
.
isEmpty
(
jgUseRegistration
.
getReceiveCompanyCode
())
?
useRegistrationService
.
getEquCode
(
registerInfo
,
jgUseRegistration
.
getReceiveCompanyCode
())
:
Objects
.
toString
(
equipInfo
.
get
(
"equCode"
),
null
);
registerInfo
.
setEquCode
(
equCode
);
// 设备代码
registerInfo
.
setEquPrice
(
Objects
.
toString
(
equipInfo
.
get
(
"equPrice"
),
null
));
registerInfo
.
setInstallationIsComplete
(
equipInfo
.
getOrDefault
(
"installationIsComplete"
,
"1"
).
toString
());
if
(
EquipmentClassifityEnum
.
CC
.
getCode
().
equals
(
equipInfo
.
get
(
"EQU_LIST_CODE"
)))
{
registerInfo
.
setCarNumber
((
String
)
equipInfo
.
get
(
"carNumber"
));
}
idxBizJgRegisterInfoMapper
.
updateById
(
registerInfo
);
}
// 设计信息
LambdaQueryWrapper
<
IdxBizJgDesignInfo
>
lambdaDes
=
new
QueryWrapper
<
IdxBizJgDesignInfo
>().
lambda
();
lambdaDes
.
eq
(
IdxBizJgDesignInfo:
:
getRecord
,
record
);
IdxBizJgDesignInfo
designInfo
=
idxBizJgDesignInfoService
.
getOne
(
lambdaDes
);
if
(
designInfo
!=
null
)
{
designInfo
.
setDesignUnitCreditCode
(
MapUtil
.
getStr
(
equipInfo
,
"designUnitCreditCode"
));
designInfo
.
setDesignUnitName
(
MapUtil
.
getStr
(
equipInfo
,
"designUnitName"
));
designInfo
.
setDesignLicenseNum
(
MapUtil
.
getStr
(
equipInfo
,
"designLicenseNum"
));
designInfo
.
setDesignUseDate
(
MapUtil
.
getStr
(
equipInfo
,
"designUseDate"
));
designInfo
.
setDesignDate
(!
StringUtils
.
isEmpty
(
equipInfo
.
get
(
"designDate"
))
?
DateUtil
.
parse
(
Objects
.
toString
(
equipInfo
.
get
(
"designDate"
),
null
),
"yyyy-MM-dd"
)
:
null
);
designInfo
.
setDrawingDo
(
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"drawingDo"
))
?
null
:
Objects
.
toString
(
equipInfo
.
get
(
"drawingDo"
),
null
));
designInfo
.
setAppraisalUnit
(
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"appraisalUnit"
))
?
null
:
Objects
.
toString
(
equipInfo
.
get
(
"appraisalUnit"
),
null
));
designInfo
.
setAppraisalDate
(
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"appraisalDate"
))
?
null
:
Objects
.
toString
(
equipInfo
.
get
(
"appraisalDate"
),
null
));
designInfo
.
setDesignDoc
(
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"DESIGN_DOC"
))
?
null
:
toJSONString
(
equipInfo
.
get
(
"DESIGN_DOC"
)));
designInfo
.
setDesignStandard
(
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"designStandard"
))
?
null
:
toJSONString
(
equipInfo
.
get
(
"designStandard"
)));
designInfo
.
setOtherAccessoriesDes
(
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"otherAccessoriesDes"
))
?
null
:
toJSONString
(
equipInfo
.
get
(
"otherAccessoriesDes"
)));
idxBizJgDesignInfoMapper
.
updateById
(
designInfo
);
}
// 制造信息
LambdaQueryWrapper
<
IdxBizJgFactoryInfo
>
factoryInfoWrapper
=
new
LambdaQueryWrapper
<>();
factoryInfoWrapper
.
eq
(
IdxBizJgFactoryInfo:
:
getRecord
,
record
);
IdxBizJgFactoryInfo
idxBizJgFactoryInfo
=
idxBizJgFactoryInfoService
.
getOne
(
factoryInfoWrapper
);
if
(
idxBizJgFactoryInfo
!=
null
)
{
idxBizJgFactoryInfo
.
setProduceUnitCreditCode
(
MapUtil
.
getStr
(
equipInfo
,
"produceUnitCreditCode"
));
idxBizJgFactoryInfo
.
setProduceUnitName
(
MapUtil
.
getStr
(
equipInfo
,
"produceUnitName"
));
idxBizJgFactoryInfo
.
setFactoryNum
(
MapUtil
.
getStr
(
equipInfo
,
"factoryNum"
));
idxBizJgFactoryInfo
.
setProduceLicenseNum
(
MapUtil
.
getStr
(
equipInfo
,
"produceLicenseNum"
));
idxBizJgFactoryInfo
.
setProduceDate
(!
StringUtils
.
isEmpty
(
equipInfo
.
get
(
"produceDate"
))
?
DateUtil
.
parse
(
Objects
.
toString
(
equipInfo
.
get
(
"produceDate"
),
null
),
"yyyy-MM-dd"
)
:
null
);
idxBizJgFactoryInfo
.
setImported
(
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"imported"
))
?
null
:
Objects
.
toString
(
equipInfo
.
get
(
"imported"
),
null
));
idxBizJgFactoryInfo
.
setProduceCountry
(
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"produceCountry"
))
?
null
:
Objects
.
toString
(
equipInfo
.
get
(
"produceCountry"
),
null
));
idxBizJgFactoryInfo
.
setOtherAccessoriesFact
(
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"otherAccessoriesFact"
))
?
null
:
toJSONString
(
equipInfo
.
get
(
"otherAccessoriesFact"
)));
idxBizJgFactoryInfo
.
setInsUseMaintainExplain
(
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"insUseMaintainExplain"
))
?
null
:
toJSONString
(
equipInfo
.
get
(
"insUseMaintainExplain"
)));
idxBizJgFactoryInfo
.
setFactoryStandard
(
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"factoryStandard"
))
?
null
:
toJSONString
(
equipInfo
.
get
(
"factoryStandard"
)));
idxBizJgFactoryInfo
.
setFactSupervisionInspectionReport
(
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"factSupervisionInspectionReport"
))
?
null
:
toJSONString
(
equipInfo
.
get
(
"factSupervisionInspectionReport"
)));
idxBizJgFactoryInfo
.
setBoilerEnergyEfficiencyCertificate
(
ObjectUtils
.
isEmpty
(
equipInfo
.
get
(
"boilerEnergyEfficiencyCertificate"
))
?
null
:
toJSONString
(
equipInfo
.
get
(
"boilerEnergyEfficiencyCertificate"
)));
idxBizJgFactoryInfoMapper
.
updateById
(
idxBizJgFactoryInfo
);
}
// 使用信息
LambdaQueryWrapper
<
IdxBizJgUseInfo
>
lambda
=
new
QueryWrapper
<
IdxBizJgUseInfo
>().
lambda
();
lambda
.
eq
(
IdxBizJgUseInfo:
:
getRecord
,
record
);
IdxBizJgUseInfo
useInfo
=
useInfoMapper
.
selectOne
(
lambda
);
String
usePlace
=
""
;
if
(
useInfo
!=
null
)
{
useInfo
.
setIsIntoManagement
(
Boolean
.
TRUE
);
useInfo
.
setUseUnitCreditCode
(
Objects
.
toString
(
equipInfo
.
get
(
"useUnitCreditCode"
),
null
));
useInfo
.
setUseUnitName
(
Objects
.
toString
(
equipInfo
.
get
(
"useUnitName"
),
null
));
useInfo
.
setProvince
(
"610000"
);
useInfo
.
setProvinceName
(
"陕西省"
);
useInfo
.
setCity
(
Objects
.
toString
(
equipInfo
.
get
(
"city"
),
null
));
useInfo
.
setUseInnerCode
(
Objects
.
toString
(
equipInfo
.
get
(
"useInnerCode"
),
null
));
useInfo
.
setCityName
(
useCityName
);
useInfo
.
setCounty
(
Objects
.
toString
(
equipInfo
.
get
(
"county"
),
null
));
useInfo
.
setCountyName
(
useCountyName
);
useInfo
.
setFactoryUseSiteStreet
(
Objects
.
toString
(
equipInfo
.
get
(
"factoryUseSiteStreet"
),
null
));
useInfo
.
setStreetName
(
useStreetName
);
useInfo
.
setAddress
(
Objects
.
toString
(
equipInfo
.
get
(
"address"
),
null
));
useInfo
.
setIsNotXiXian
(
Objects
.
toString
(
equipInfo
.
get
(
"isXixian"
),
null
));
useInfo
.
setEstateUnitCreditCode
(
Optional
.
ofNullable
(
equipInfo
.
get
(
"estateUnitName"
))
.
map
(
Object:
:
toString
)
.
filter
(
s
->
s
.
contains
(
"_"
))
.
map
(
s
->
s
.
split
(
"_"
,
2
))
.
filter
(
parts
->
parts
.
length
==
2
)
.
map
(
parts
->
parts
[
0
])
.
orElse
(
null
));
useInfo
.
setEstateUnitName
(
Optional
.
ofNullable
(
equipInfo
.
get
(
"estateUnitName"
))
.
map
(
Object:
:
toString
)
.
filter
(
s
->
s
.
contains
(
"_"
))
.
map
(
s
->
s
.
split
(
"_"
,
2
))
.
filter
(
parts
->
parts
.
length
==
2
)
.
map
(
parts
->
parts
[
1
])
.
orElse
(
null
));
useInfo
.
setPhone
(
Objects
.
toString
(
equipInfo
.
get
(
"phone"
),
null
));
useInfo
.
setSafetyManager
(
Objects
.
toString
(
Optional
.
ofNullable
(
equipInfo
.
get
(
"safetyManager"
))
.
map
(
Object:
:
toString
)
.
filter
(
s
->
s
.
contains
(
"_"
))
.
map
(
s
->
s
.
split
(
"_"
,
2
))
.
filter
(
parts
->
parts
.
length
==
2
)
.
map
(
parts
->
parts
[
0
])
.
orElse
(
null
),
null
));
useInfo
.
setUseDate
(
Objects
.
toString
(
equipInfo
.
get
(
"useDate"
),
null
));
useInfo
.
setLongitudeLatitude
(
toJSONString
(
equipInfo
.
get
(
"longitudeLatitude"
)));
useInfo
.
setUsePlace
((
String
)
equipInfo
.
get
(
"usePlace"
));
useInfo
.
setOldUseRegistrationTable
(
toJSONString
(
equipInfo
.
get
(
"oldUseRegistrationTable"
)));
useInfo
.
setOldUseRegistrationCertificate
(
toJSONString
(
equipInfo
.
get
(
"oldUseRegistrationCertificate"
)));
useInfo
.
setORegDate
(
Objects
.
toString
(
equipInfo
.
get
(
"oRegDate"
),
null
));
useInfo
.
setORegUnit
(
Objects
.
toString
(
equipInfo
.
get
(
"oRegUnit"
),
null
));
// 历史平台登记,将设备状态改为在用
if
(
useInfo
.
getEquState
()
==
null
)
{
useInfo
.
setEquState
(
EquimentEnum
.
ZAIYONG
.
getCode
().
toString
());
}
usePlace
=
useInfo
.
getProvinceName
()
+
"/"
+
useInfo
.
getCityName
()
+
"/"
+
useInfo
.
getCountyName
()
+
"/"
+
useInfo
.
getStreetName
();
useInfoMapper
.
updateById
(
useInfo
);
}
LambdaQueryWrapper
<
IdxBizJgOtherInfo
>
otherLambda
=
new
QueryWrapper
<
IdxBizJgOtherInfo
>().
lambda
();
otherLambda
.
eq
(
IdxBizJgOtherInfo:
:
getRecord
,
record
);
IdxBizJgOtherInfo
otherInfo
=
otherInfoMapper
.
selectOne
(
otherLambda
);
// 生成监管码 96333码
useRegistrationService
.
createCode
(
equipInfo
,
jgUseRegistration
,
registerInfo
,
useInfo
,
otherInfo
);
equipInfo
.
put
(
"equCode"
,
equCode
);
// 更新es
equipInfo
.
put
(
"equipId"
,
record
);
useRegistrationService
.
updateEsData2
(
usePlace
,
equipInfo
,
otherInfo
,
useInfo
,
jgUseRegistration
,
equipInfo
);
useRegistrationService
.
updateById
(
jgUseRegistration
);
useRegistrationService
.
historyEquGenManageRelated
(
equipInfo
,
jgUseRegistration
,
registerInfo
,
idxBizJgFactoryInfo
);
String
routePath
=
useRegistrationService
.
buildTaskModel
(
jgUseRegistration
,
equipInfo
,
getSelectedOrgInfo
());
jgResumeInfoService
.
createWithModel
(
JgResumeInfoDto
.
builder
()
.
applyNo
(
jgUseRegistration
.
getApplyNo
())
.
businessType
(
BusinessTypeEnum
.
JG_HISTORY_USAGE_REGISTRATION
.
getName
())
.
businessId
(
jgUseRegistration
.
getSequenceNbr
()
+
""
)
.
equId
(
Objects
.
toString
(
record
,
null
))
.
approvalUnit
(
jgUseRegistration
.
getReceiveOrgName
())
.
approvalUnitCode
(
jgUseRegistration
.
getReceiveOrgCode
())
.
status
(
"正常"
)
.
routePath
(
routePath
)
.
changeContent
(
BusinessTypeEnum
.
JG_HISTORY_USAGE_REGISTRATION
.
getName
()
+
"业务"
)
.
build
());
jgUseRegistration
.
setCreateDate
(
new
Date
());
useRegistrationService
.
save
(
jgUseRegistration
);
// 业务管理设备信息保存
JgUseRegistrationEq
jgRelationEquip
=
new
JgUseRegistrationEq
();
jgRelationEquip
.
setEquId
(
record
);
jgRelationEquip
.
setEquipTransferId
(
jgUseRegistration
.
getSequenceNbr
().
toString
());
jgRelationEquipMapper
.
insert
(
jgRelationEquip
);
return
useRegistrationService
.
getBaseMapper
().
selectById
(
jgUseRegistration
.
getSequenceNbr
());
}
/**
* 添加设备的业务履历
*/
public
void
addEquipResume
(
JSONObject
equipInfo
,
JgUseRegistration
useRegistration
)
{
String
record
=
(
String
)
equipInfo
.
get
(
RECORD
);
JgResumeInfoDto
resumeInfoDto
=
JgResumeInfoDto
.
builder
()
.
applyNo
(
null
)
.
businessType
(
BusinessTypeEnum
.
JG_EQUIP_CLAIM
.
getName
())
.
businessId
(
record
)
.
equId
(
record
)
.
approvalUnit
(
useRegistration
.
getReceiveOrgName
())
.
approvalUnitCode
(
useRegistration
.
getReceiveOrgName
())
.
status
(
"正常"
)
.
changeContent
(
BusinessTypeEnum
.
JG_EQUIP_CLAIM
.
getName
()
+
"业务"
)
.
routePath
(
null
)
.
build
();
JgResumeInfo
resumeInfo
=
new
JgResumeInfo
();
BeanUtils
.
copyProperties
(
resumeInfoDto
,
resumeInfo
);
jgResumeInfoService
.
save
(
resumeInfo
);
}
/**
* 参数校验 - 同 设备录入的逻辑
*/
public
void
checkParams
(
LinkedHashMap
equipInfo
)
{
String
dataSource
=
(
String
)
equipInfo
.
get
(
DATA_SOURCE
);
String
record
=
(
String
)
equipInfo
.
get
(
RECORD
);
// 设备代码 字段的唯一性校验
jgRegisterInfoService
.
checkEquCodeUniqueness
(
equipInfo
);
// 车用气瓶业务里面的 产品编号 校验唯一性(产品编号在车用气瓶范围内全局唯一)
jgRegisterInfoService
.
checkFactoryNumUniqueness
(
equipInfo
);
// 96333码 字段的唯一性校验
jgRegisterInfoService
.
check96333Code
(
equipInfo
);
// 气瓶 校验制造单位统一信用代码与出场编码唯一
jgRegisterInfoService
.
checkFactoryNumUniqueWithGasCylinder
(
equipInfo
,
record
);
// 历史(车用气瓶)设备校验使用登记证编号 VIN 全库唯一
jgRegisterInfoService
.
hisEquCheckUseRegCodeAndVINUniqueness
(
equipInfo
,
record
);
// 历史有使用登记证的场车设备校验车牌号的唯一性
jgRegisterInfoService
.
checkCarNumberUniquenessWithHisCC
(
equipInfo
,
record
,
dataSource
);
}
/**
* 认领 更新设备信息
*
* @param equipInfo
*/
public
void
updateEquipInfoWithClaim
(
JSONObject
equipInfo
,
JSONObject
equipParams
,
boolean
isIntoManagement
)
{
Date
timestamp
=
new
Date
();
AgencyUserModel
userModel
=
getSelectedOrgInfo
().
getUserModel
();
CompanyBo
company
=
getSelectedOrgInfo
().
getCompany
();
// 设备种类
String
equList
=
Objects
.
toString
(
equipInfo
.
get
(
EQU_LIST
));
String
record
=
equipInfo
.
get
(
RECORD
).
toString
();
// 使用信息
IdxBizJgUseInfo
useInfo
=
JSON
.
parseObject
(
toJSONString
(
equipInfo
),
IdxBizJgUseInfo
.
class
);
useInfo
.
setRecord
(
record
);
useInfo
.
setRecDate
(
timestamp
);
useInfo
.
setCreateDate
(
timestamp
);
useInfo
.
setDataSource
(
JG_HIS_XA_CLAIM
);
useInfo
.
setIsIntoManagement
(
isIntoManagement
);
useInfo
.
setUseUnitCreditCode
(
company
.
getCompanyCode
());
useInfo
.
setUseUnitName
(
company
.
getCompanyName
());
useInfo
.
setSequenceNbr
(
Objects
.
toString
(
equipInfo
.
get
(
"USEINFO_SEQ"
)));
idxBizJgUseInfoService
.
saveOrUpdateData
(
useInfo
);
// 设计信息
IdxBizJgDesignInfo
designInfo
=
JSON
.
parseObject
(
toJSONString
(
equipInfo
),
IdxBizJgDesignInfo
.
class
);
designInfo
.
setRecord
(
record
);
designInfo
.
setRecDate
(
timestamp
);
designInfo
.
setSequenceNbr
(
Objects
.
toString
(
equipInfo
.
get
(
"DESIGNINFO_SEQ"
)));
iIdxBizJgDesignInfoService
.
saveOrUpdateData
(
designInfo
);
// 制造信息
IdxBizJgFactoryInfo
factoryInfo
=
JSON
.
parseObject
(
toJSONString
(
equipInfo
),
IdxBizJgFactoryInfo
.
class
);
factoryInfo
.
setRecord
(
record
);
factoryInfo
.
setRecDate
(
timestamp
);
factoryInfo
.
setProductQualityYieldProve
(
ValidationUtil
.
isEmpty
(
equipInfo
.
get
(
"PRODUCT_QUALITY_YIELD_PROVE"
))
?
null
:
toJSONString
(
equipInfo
.
get
(
"PRODUCT_QUALITY_YIELD_PROVE"
)));
factoryInfo
.
setSequenceNbr
(
Objects
.
toString
(
equipInfo
.
get
(
"FACTORYINFO_SEQ"
)));
iIdxBizJgFactoryInfoService
.
saveOrUpdateData
(
factoryInfo
);
// 施工信息
IdxBizJgConstructionInfo
constructionInfo
=
JSON
.
parseObject
(
toJSONString
(
equipInfo
),
IdxBizJgConstructionInfo
.
class
);
constructionInfo
.
setRecord
(
record
);
constructionInfo
.
setRecDate
(
timestamp
);
constructionInfo
.
setSequenceNbr
(
Objects
.
toString
(
equipInfo
.
get
(
"CONSTRUCTIONINFO_SEQ"
)));
iIdxBizJgConstructionInfoService
.
saveOrUpdateData
(
constructionInfo
);
// 注册登记信息
IdxBizJgRegisterInfo
registerInfo
=
JSON
.
parseObject
(
toJSONString
(
equipInfo
),
IdxBizJgRegisterInfo
.
class
);
registerInfo
.
setRecord
(
record
);
registerInfo
.
setRecDate
(
timestamp
);
registerInfo
.
setRegisterState
(
jgRegisterInfoService
.
getRegCode
());
registerInfo
.
setUseOrgCode
(
Objects
.
toString
(
equipInfo
.
get
(
"useRegistrationCode"
),
null
));
registerInfo
.
setProductPhoto
(
ValidationUtil
.
isEmpty
(
equipInfo
.
get
(
"PRODUCT_PHOTO"
))
?
null
:
toJSONString
(
equipInfo
.
get
(
"PRODUCT_PHOTO"
)));
registerInfo
.
setOtherAccessoriesReg
(
ValidationUtil
.
isEmpty
(
equipInfo
.
get
(
"OTHER_ACCESSORIES_REG"
))
?
null
:
toJSONString
(
equipInfo
.
get
(
"OTHER_ACCESSORIES_REG"
)));
registerInfo
.
setSequenceNbr
(
Objects
.
toString
(
equipInfo
.
get
(
"REGISTERINFO_SEQ"
)));
jgRegisterInfoService
.
saveOrUpdate
(
registerInfo
);
// 监督管理
IdxBizJgSupervisionInfo
supervisionInfo
=
JSON
.
parseObject
(
toJSONString
(
equipInfo
),
IdxBizJgSupervisionInfo
.
class
);
supervisionInfo
.
setRecord
(
record
);
supervisionInfo
.
setRecDate
(
timestamp
);
supervisionInfo
.
setSequenceNbr
(
Objects
.
toString
(
equipInfo
.
get
(
"SUPERVISIONINFO_SEQ"
)));
iIdxBizJgSupervisionInfoService
.
saveOrUpdateData
(
supervisionInfo
);
// 其他信息
IdxBizJgOtherInfo
otherInfo
=
JSON
.
parseObject
(
toJSONString
(
equipInfo
),
IdxBizJgOtherInfo
.
class
);
otherInfo
.
setRecord
(
record
);
otherInfo
.
setClaimStatus
(
"已认领"
);
otherInfo
.
setRecDate
(
timestamp
);
otherInfo
.
setSequenceNbr
(
Objects
.
toString
(
equipInfo
.
get
(
"OTHERINFO_SEQ"
)));
iIdxBizJgOtherInfoService
.
saveOrUpdateData
(
otherInfo
);
// 检验检测信息
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfo
=
JSON
.
parseObject
(
toJSONString
(
equipInfo
),
IdxBizJgInspectionDetectionInfo
.
class
);
List
<
Map
<
String
,
Object
>>
inspectionAndTestingInstitutions
=
commonService
.
getUnitListByType
(
"inspection"
,
"gasCylindersForCars"
,
false
);
Optional
<
Map
<
String
,
Object
>>
optional
=
inspectionAndTestingInstitutions
.
stream
().
filter
(
x
->
x
.
get
(
"useCode"
).
equals
(
inspectionDetectionInfo
.
getInspectOrgCode
())).
findFirst
();
Map
<
String
,
Object
>
mapOrDefault
=
optional
.
orElse
(
Collections
.
emptyMap
());
inspectionDetectionInfo
.
setInspectOrgName
((
String
)
mapOrDefault
.
getOrDefault
(
"useUnit"
,
inspectionDetectionInfo
.
getInspectOrgName
()));
inspectionDetectionInfo
.
setRecord
(
record
);
inspectionDetectionInfo
.
setRecDate
(
timestamp
);
if
(
inspectionDetectionInfo
.
getNextInspectDate
()
!=
null
)
{
inspectionDetectionInfo
.
setNextInspectDate
(
DateUtil
.
parse
(
DateUtil
.
format
(
inspectionDetectionInfo
.
getNextInspectDate
(),
DatePattern
.
NORM_DATE_PATTERN
)));
}
inspectionDetectionInfo
.
setSequenceNbr
(
Objects
.
toString
(
equipInfo
.
get
(
"INSPECTIONDETECTIONINFO_SEQ"
)));
iIdxBizJgInspectionDetectionInfoService
.
saveOrUpdateData
(
inspectionDetectionInfo
);
// 技术参数
jgRegisterInfoService
.
saveOrUpdateEquParams
(
new
LinkedHashMap
<>(
equipInfo
),
new
LinkedHashMap
<>(
equipParams
),
equList
,
record
,
timestamp
,
"edit"
);
// 更新es
jgRegisterInfoService
.
checkEsData
(
record
);
}
}
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 @
c6744180
...
...
@@ -907,7 +907,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
p
rivate
void
checkEquCodeUniqueness
(
LinkedHashMap
equipmentInfoForm
)
{
p
ublic
void
checkEquCodeUniqueness
(
LinkedHashMap
equipmentInfoForm
)
{
// 根据设备代码检查唯一性
String
equCode
=
(
String
)
equipmentInfoForm
.
get
(
EQU_CODE
);
String
sequenceNbr
=
(
String
)
equipmentInfoForm
.
get
(
SEQUENCE_NBR
);
...
...
@@ -928,7 +928,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
* @param record
* @param dataSource
*/
p
rivate
void
checkCarNumberUniquenessWithHisCC
(
LinkedHashMap
<?,
?>
equipmentInfoForm
,
String
record
,
String
dataSource
)
{
p
ublic
void
checkCarNumberUniquenessWithHisCC
(
LinkedHashMap
<?,
?>
equipmentInfoForm
,
String
record
,
String
dataSource
)
{
if
(
dataSource
.
contains
(
"his"
)
&&
EquipmentClassifityEnum
.
CC
.
getCode
().
equals
(
equipmentInfoForm
.
get
(
EQU_LIST
))
&&
!
ValidationUtil
.
isEmpty
(
equipmentInfoForm
.
get
(
CAR_NUMBER
)))
{
String
carNumber
=
String
.
valueOf
(
equipmentInfoForm
.
get
(
CAR_NUMBER
));
if
(!
"无"
.
equals
(
carNumber
))
{
...
...
@@ -940,7 +940,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
p
rivate
void
check96333Code
(
LinkedHashMap
equipmentInfoForm
)
{
p
ublic
void
check96333Code
(
LinkedHashMap
equipmentInfoForm
)
{
if
(!
ObjectUtils
.
isEmpty
(
equipmentInfoForm
.
get
(
CODE96333
)))
{
// 根据96333码检查唯一性
LambdaQueryWrapper
<
IdxBizJgOtherInfo
>
wrapper
=
new
LambdaQueryWrapper
<>();
...
...
@@ -954,7 +954,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
p
rivate
void
checkFactoryNumUniqueWithGasCylinder
(
LinkedHashMap
equipmentInfoForm
,
String
record
)
{
p
ublic
void
checkFactoryNumUniqueWithGasCylinder
(
LinkedHashMap
equipmentInfoForm
,
String
record
)
{
if
(
equipmentInfoForm
.
get
(
EQU_LIST
).
equals
(
"2000"
)
&&
equipmentInfoForm
.
get
(
EQU_CATEGORY
).
equals
(
"2300"
)
&&
commonMapper
.
checkFactoryNumUnique
(
String
.
valueOf
(
equipmentInfoForm
.
get
(
FACTORY_NUM
)),
record
,
String
.
valueOf
(
equipmentInfoForm
.
get
(
"PRODUCE_UNIT_CREDIT_CODE"
)))
>
0
)
{
...
...
@@ -962,7 +962,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
p
rivate
void
checkFactoryNumUniqueness
(
LinkedHashMap
equipmentInfoForm
)
{
p
ublic
void
checkFactoryNumUniqueness
(
LinkedHashMap
equipmentInfoForm
)
{
// 车用气瓶业务里面的 出厂编号/产品编码 校验唯一性(产品编号在车用气瓶范围内全局唯一)
Integer
factoryNum
=
commonMapper
.
checkFactoryNumUniquenessForVehicleCylinder
((
String
)
equipmentInfoForm
.
get
(
FACTORY_NUM
),
(
String
)
equipmentInfoForm
.
get
(
RECORD
));
if
(
factoryNum
>
0
)
{
...
...
@@ -970,7 +970,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
p
rivate
void
hisEquCheckUseRegCodeAndVINUniqueness
(
LinkedHashMap
<?,
?>
equipmentInfoForm
,
String
record
)
{
p
ublic
void
hisEquCheckUseRegCodeAndVINUniqueness
(
LinkedHashMap
<?,
?>
equipmentInfoForm
,
String
record
)
{
// 历史(车用气瓶)设备校验使用登记证编号 VIN 全库唯一
if
(
"2000"
.
equals
(
equipmentInfoForm
.
get
(
EQU_LIST
))
&&
"2300"
.
equals
(
equipmentInfoForm
.
get
(
EQU_CATEGORY
))
&&
"23T0"
.
equals
(
equipmentInfoForm
.
get
(
EQU_DEFINE
))
&&
"1"
.
equals
(
equipmentInfoForm
.
get
(
WHETHER_VEHICLE_CYLINDER
)))
{
String
dataSource
=
(
String
)
equipmentInfoForm
.
get
(
DATA_SOURCE
);
...
...
@@ -3571,7 +3571,21 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
otherInfo
.
setCode96333
(
null
);
}
iIdxBizJgOtherInfoService
.
saveOrUpdateData
(
otherInfo
);
// 保存或者更新设备技术参数
this
.
saveOrUpdateEquParams
(
equipmentInfoForm
,
equipmentParamsForm
,
equList
,
record
,
date
,
operateType
);
return
record
;
}
/**
* 保存或者更新设备技术参数
* @param equipmentInfoForm
* @param equipmentParamsForm
* @param equList
* @param record
* @param date
* @param operateType
*/
public
void
saveOrUpdateEquParams
(
LinkedHashMap
equipmentInfoForm
,
LinkedHashMap
equipmentParamsForm
,
String
equList
,
String
record
,
Date
date
,
String
operateType
)
{
// 八大类技术参数和主要零部件和安全附件表
List
<
IdxBizJgMainParts
>
mainPartsList
=
new
ArrayList
<>();
List
<
IdxBizJgProtectionDevices
>
protectionDevicesList
=
new
ArrayList
<>();
...
...
@@ -3715,7 +3729,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if
(!
ValidationUtil
.
isEmpty
(
protectionDevicesList
))
{
iIdxBizJgProtectionDevicesService
.
saveOrUpdateBatchData
(
protectionDevicesList
);
}
return
record
;
}
/**
...
...
@@ -3777,29 +3790,27 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if
(
EQUIP_MAINPARTS_FORM_ID
.
equals
(
subFormType
)
&&
!
ValidationUtil
.
isEmpty
(
list
))
{
for
(
Object
s
:
list
)
{
List
subFormMainPartsList
=
(
ArrayList
)
map
.
get
(
s
);
if
(!
ObjectUtils
.
isEmpty
(
subFormMainPartsList
))
{
for
(
Object
obj
:
subFormMainPartsList
)
{
HashMap
<
String
,
Object
>
objMap
=
(
HashMap
<
String
,
Object
>)
obj
;
IdxBizJgMainParts
mainParts
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
objMap
),
IdxBizJgMainParts
.
class
);
JSONArray
subFormMainPartsList
=
JSON
.
parseArray
(
toJSONString
(
map
.
get
(
s
)));
subFormMainPartsList
.
forEach
(
data
->
{
JSONObject
jsonObject
=
(
JSONObject
)
data
;
IdxBizJgMainParts
mainParts
=
jsonObject
.
toJavaObject
(
IdxBizJgMainParts
.
class
);
mainParts
.
setRecord
(
record
);
mainParts
.
setRecDate
(
date
);
mainParts
.
setSequenceNbr
(
"save"
.
equals
(
type
)
?
null
:
String
.
valueOf
(
objMap
.
get
(
"MAINPARTS_SEQ"
)));
mainParts
.
setSequenceNbr
(
"save"
.
equals
(
type
)
?
null
:
String
.
valueOf
(
jsonObject
.
get
(
"MAINPARTS_SEQ"
)));
mainPartsList
.
add
(
mainParts
);
}
}
});
}
return
mainPartsList
;
}
else
if
(
EQUIP_PROTECTIONDEVICES_FORM_ID
.
equals
(
subFormType
)
&&
!
ValidationUtil
.
isEmpty
(
list
))
{
for
(
Object
s
:
list
)
{
List
subFormProtectionDevicesList
=
(
ArrayList
)
map
.
get
(
s
);
JSONArray
subFormProtectionDevicesList
=
JSON
.
parseArray
(
toJSONString
(
map
.
get
(
s
))
);
if
(!
ObjectUtils
.
isEmpty
(
subFormProtectionDevicesList
))
{
for
(
Object
obj
:
subFormProtectionDevicesList
)
{
HashMap
<
String
,
Object
>
objMap
=
(
HashMap
<
String
,
Object
>
)
obj
;
IdxBizJgProtectionDevices
protectionDevices
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
objMap
),
IdxBizJgProtectionDevices
.
class
);
JSONObject
jsonObject
=
(
JSONObject
)
obj
;
IdxBizJgProtectionDevices
protectionDevices
=
jsonObject
.
toJavaObject
(
IdxBizJgProtectionDevices
.
class
);
protectionDevices
.
setRecord
(
record
);
protectionDevices
.
setRecDate
(
date
);
protectionDevices
.
setSequenceNbr
(
"save"
.
equals
(
type
)
?
null
:
String
.
valueOf
(
objMap
.
get
(
"PROTECTIONDEVICES_SEQ"
)));
protectionDevices
.
setSequenceNbr
(
"save"
.
equals
(
type
)
?
null
:
String
.
valueOf
(
jsonObject
.
get
(
"PROTECTIONDEVICES_SEQ"
)));
protectionDevicesList
.
add
(
protectionDevices
);
}
}
...
...
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/JgChangeRegistrationUnitServiceImpl.java
View file @
c6744180
...
...
@@ -107,6 +107,8 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
@Autowired
UseInfoMapper
useInfoMapper
;
@Autowired
IdxBizJgRegisterInfoMapper
registerInfoMapper
;
@Autowired
TzsServiceFeignClient
tzsServiceFeignClient
;
@Autowired
...
...
@@ -1203,27 +1205,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
List
<
JgChangeRegistrationUnitEq
>
jgChangeRegistrationUnitEqs
=
JgChangeRegistrationUnitEqMapper
.
selectList
(
queryWrapper
);
//修改ES中使用单位信息和使用单位代码
Map
<
String
,
Map
<
String
,
Object
>>
resultMap
=
new
HashMap
<>();
for
(
JgChangeRegistrationUnitEq
jgChangeRegistrationUnitEq
:
jgChangeRegistrationUnitEqs
)
{
String
equipId
=
jgChangeRegistrationUnitEq
.
getEquId
();
LambdaQueryWrapper
<
UseInfo
>
queryWrapper2
=
new
LambdaQueryWrapper
<>();
queryWrapper2
.
eq
(
UseInfo:
:
getRecord
,
equipId
);
UseInfo
useInfo
=
useInfoMapper
.
selectOne
(
queryWrapper2
);
if
(
ObjectUtils
.
isNotEmpty
(
useInfo
))
{
useInfo
.
setUseUnitName
(
registration
.
getNewUseUnitName
());
useInfo
.
setUseUnitCreditCode
(
registration
.
getNewUseUnitCreditCode
());
useInfoMapper
.
updateById
(
useInfo
);
}
Map
<
String
,
Object
>
map1
=
new
HashMap
<>();
String
[]
companyCode
=
registration
.
getNewUseUnitCreditCode
().
split
(
"_"
);
map1
.
put
(
"USE_UNIT_CREDIT_CODE"
,
companyCode
.
length
>
1
?
companyCode
[
1
]
:
registration
.
getNewUseUnitCreditCode
());
map1
.
put
(
"USE_UNIT_NAME"
,
registration
.
getNewUseUnitName
());
map1
.
put
(
"REC_DATE"
,
new
Date
());
// 更新时间,设备筛选时排在前面 bug-21476
map1
.
put
(
"EQU_STATE"
,
"1"
);
resultMap
.
put
(
equipId
,
map1
);
//修改各类告知列表,置为废弃
this
.
updataInvalidStatusByHistory
(
equipId
,
registration
.
getApplyNo
());
tzsServiceFeignClient
.
commonUpdateEsDataByIds
(
resultMap
);
}
//更新产权信息
dto
.
getRegistrationList
().
forEach
(
v
->
{
String
useCode
=
String
.
valueOf
(
v
.
get
(
"useRegistrationCode"
));
...
...
@@ -1256,6 +1238,34 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
});
for
(
JgChangeRegistrationUnitEq
jgChangeRegistrationUnitEq
:
jgChangeRegistrationUnitEqs
)
{
String
equipId
=
jgChangeRegistrationUnitEq
.
getEquId
();
LambdaQueryWrapper
<
UseInfo
>
queryWrapper2
=
new
LambdaQueryWrapper
<>();
queryWrapper2
.
eq
(
UseInfo:
:
getRecord
,
equipId
);
UseInfo
useInfo
=
useInfoMapper
.
selectOne
(
queryWrapper2
);
if
(
ObjectUtils
.
isNotEmpty
(
useInfo
))
{
useInfo
.
setUseUnitName
(
registration
.
getNewUseUnitName
());
useInfo
.
setUseUnitCreditCode
(
registration
.
getNewUseUnitCreditCode
());
useInfoMapper
.
updateById
(
useInfo
);
}
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
registerInfoLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
registerInfoLambdaQueryWrapper
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
equipId
);
IdxBizJgRegisterInfo
registerInfo
=
registerInfoMapper
.
selectOne
(
registerInfoLambdaQueryWrapper
);
Map
<
String
,
Object
>
map1
=
new
HashMap
<>();
String
[]
companyCode
=
registration
.
getNewUseUnitCreditCode
().
split
(
"_"
);
map1
.
put
(
"USE_UNIT_CREDIT_CODE"
,
companyCode
.
length
>
1
?
companyCode
[
1
]
:
registration
.
getNewUseUnitCreditCode
());
map1
.
put
(
"USE_UNIT_NAME"
,
registration
.
getNewUseUnitName
());
map1
.
put
(
"REC_DATE"
,
new
Date
());
// 更新时间,设备筛选时排在前面 bug-21476
map1
.
put
(
"EQU_STATE"
,
"1"
);
if
(
ObjectUtils
.
isNotEmpty
(
registerInfo
)
&&
ObjectUtils
.
isNotEmpty
(
registerInfo
.
getCarNumber
()))
{
map1
.
put
(
"CAR_NUMBER"
,
registerInfo
.
getCarNumber
());
}
resultMap
.
put
(
equipId
,
map1
);
//修改各类告知列表,置为废弃
this
.
updataInvalidStatusByHistory
(
equipId
,
registration
.
getApplyNo
());
tzsServiceFeignClient
.
commonUpdateEsDataByIds
(
resultMap
);
}
registration
.
setNextTaskId
(
nextTaskId
);
updateTaskModel
(
registration
,
op
);
//新增使用登记证和设备变更记录
...
...
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/JgInstallationNoticeServiceImpl.java
View file @
c6744180
...
...
@@ -120,6 +120,7 @@ import static com.alibaba.fastjson.JSON.parseArray;
public
class
JgInstallationNoticeServiceImpl
extends
BaseService
<
JgInstallationNoticeDto
,
JgInstallationNotice
,
JgInstallationNoticeMapper
>
implements
IJgInstallationNoticeService
,
ICompensateFlowDataOfRedis
<
JgInstallationNotice
>
{
private
static
final
String
SUBMIT_TYPE_FLOW
=
"1"
;
private
static
final
String
SUBMIT_TYPE_TEMP
=
"3"
;
private
static
final
String
PROCESS_DEFINITION_KEY
=
"installationNotificationNew"
;
private
static
final
String
PROCESS_INSTALL_NOTICE_KEY
=
"installNotice"
;
...
...
@@ -878,7 +879,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
// 获取告知设备列表
List
<
Map
<
String
,
Object
>>
deviceList
=
model
.
getDeviceList
();
// 提交时对设备状态进行校验(处理并发问题,一个未被使用的设备同时被多个使用这打开,同时提交发起申请) todo 回滚异常未写
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//提交
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
throw
new
BadRequest
(
"设备列表为空"
);
}
...
...
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/JgUseRegistrationServiceImpl.java
View file @
c6744180
...
...
@@ -31,7 +31,6 @@ import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil;
import
com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.common.api.enums.JYJCResultEnum
;
import
com.yeejoin.amos.boot.module.common.biz.refresh.DataRefreshEvent
;
import
com.yeejoin.amos.boot.module.jg.api.dto.*
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.enums.*
;
...
...
@@ -1927,6 +1926,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
param
.
put
(
"EQU_CODE"
,
dataMap
.
get
(
"equCode"
));
param
.
put
(
"USE_ORG_CODE"
,
jgUseRegistration
.
getUseRegistrationCode
());
param
.
put
(
"CYLINDER_CATEGORY"
,
dataMap
.
get
(
"cylinderCategory"
));
if
((!
ObjectUtils
.
isEmpty
(
carNumber
)))
{
param
.
put
(
"CAR_NUMBER"
,
dataMap
.
get
(
"carNumber"
));
}
objMap
.
put
((
String
)
dataMap
.
get
(
"equipId"
),
param
);
tzsServiceFeignClient
.
commonUpdateEsDataByIds
(
objMap
);
}
...
...
@@ -4480,7 +4482,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
}
p
rivate
void
historyEquGenManageRelated
(
JSONObject
map
,
JgUseRegistration
jgUseRegistration
,
IdxBizJgRegisterInfo
registerInfo
,
IdxBizJgFactoryInfo
idxBizJgFactoryInfo
)
{
p
ublic
void
historyEquGenManageRelated
(
JSONObject
map
,
JgUseRegistration
jgUseRegistration
,
IdxBizJgRegisterInfo
registerInfo
,
IdxBizJgFactoryInfo
idxBizJgFactoryInfo
)
{
Optional
.
ofNullable
(
registerInfo
).
ifPresent
(
info
->
{
// 生成证书管理表记录
generateRegistrationManage
(
jgUseRegistration
,
registerInfo
,
Boolean
.
FALSE
,
null
);
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/enums/DataQualityScoreEnum.java
View file @
c6744180
...
...
@@ -17,9 +17,9 @@ public enum DataQualityScoreEnum {
* *设备等级
*/
I
(
"一
级(使用登记证信息齐全)"
,
"一级
"
,
"1"
),
II
(
"二
级(只有设备名称和使用登记证编号)"
,
"二级
"
,
"2"
),
III
(
"三
级(只有设备名称)"
,
"三级
"
,
"3"
);
I
(
"一
类(使用登记证信息齐全)"
,
"一类
"
,
"1"
),
II
(
"二
类(只有设备名称和使用登记证编号)"
,
"二类
"
,
"2"
),
III
(
"三
类(只有设备名称)"
,
"三类
"
,
"3"
);
private
String
name
;
private
String
label
;
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/enums/EquipStateEnum.java
View file @
c6744180
...
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
java.util.EnumSet
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -16,11 +17,11 @@ public enum EquipStateEnum {
* *设备状态
*/
WDJ
(
"未登记"
,
"0"
),
//
WDJ("未登记", "0"),
ZY
(
"在用"
,
"1"
),
TY
(
"停用"
,
"2"
),
BF
(
"报废"
,
"3"
),
ZX
(
"注销"
,
"4"
),
BF
(
"报废"
,
"3"
)
;
private
String
name
;
...
...
@@ -48,4 +49,13 @@ public enum EquipStateEnum {
}
return
jsonArray
;
}
public
static
String
getNameByCode
(
String
code
)
{
for
(
EquipStateEnum
e
:
EnumSet
.
allOf
(
EquipStateEnum
.
class
))
{
if
(
e
.
getCode
().
equals
(
code
)){
return
e
.
getName
();
}
}
return
null
;
}
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/enums/UnitTypeNewEnum.java
View file @
c6744180
...
...
@@ -54,7 +54,7 @@ public enum UnitTypeNewEnum {
}
public
static
JSONArray
getUnitTypeByType
(
String
category
)
{
if
(
ObjectUtils
.
isEmpty
(
category
))
{
if
(
ObjectUtils
.
isEmpty
(
category
)
||
category
.
equals
(
"all"
)
)
{
return
getAll
();
}
JSONArray
jsonArray
=
new
JSONArray
();
...
...
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/ComprehensiveStatisticalAnalysisServiceImpl.java
View file @
c6744180
...
...
@@ -261,15 +261,12 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
if
(!((
JSONArray
)
v
).
contains
(
"all"
)
&&
((
JSONArray
)
v
).
size
()
>
0
)
{
String
field
=
k
;
if
(
k
.
equals
(
"newPost"
)
||
k
.
equals
(
"subPost"
)
||
k
.
equals
(
"equipType"
))
{
boolMust
.
must
(
existsQuery
(
field
));
EnhancedDynamicQueryBuilder
enhancedDynamicQueryBuilder
=
new
EnhancedDynamicQueryBuilder
();
((
JSONArray
)
v
).
forEach
(
item
->
enhancedDynamicQueryBuilder
.
add
(
QueryBuilders
.
wildcardQuery
(
field
,
"*"
+
item
+
"*"
),
or
));
boolMust
.
should
(
enhancedDynamicQueryBuilder
.
build
()).
minimumShouldMatch
(
1
);
}
else
if
(
k
.
equals
(
"unitType"
))
{
boolMust
.
must
(
existsQuery
(
field
));
((
JSONArray
)
v
).
forEach
(
item
->
boolMust
.
should
(
QueryBuilders
.
wildcardQuery
(
field
+
".keyword"
,
"*"
+
(
item
.
equals
(
"企业"
)
?
"使用单位"
:
item
)
+
"*"
)).
minimumShouldMatch
(
1
));
}
else
if
(
k
.
equals
(
"education"
))
{
boolMust
.
must
(
existsQuery
(
field
));
TermsQueryBuilder
termsQuery
=
QueryBuilders
.
termsQuery
(
field
,
(
JSONArray
)
v
);
boolMust
.
must
(
termsQuery
);
}
else
if
(
k
.
equals
(
"certNo"
)
||
k
.
equals
(
"expiryDate"
)
||
k
.
equals
(
"permissionLevel"
)
||
k
.
equals
(
"certType"
)
||
k
.
equals
(
"jobItem"
)
||
k
.
equals
(
"permissionItem"
))
{
...
...
@@ -518,10 +515,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
if
(!((
JSONArray
)
v
).
contains
(
"all"
)
&&
((
JSONArray
)
v
).
size
()
>
0
)
{
String
field
=
k
;
if
(
k
.
equals
(
"regulatoryLabels"
)
||
k
.
equals
(
"equipCategory"
)
||
k
.
equals
(
"unitType"
))
{
boolMust
.
must
(
existsQuery
(
field
));
((
JSONArray
)
v
).
forEach
(
item
->
boolMust
.
should
(
QueryBuilders
.
wildcardQuery
(
field
+
".keyword"
,
"*"
+
(
item
.
equals
(
"企业"
)
?
"使用单位"
:
item
)
+
"*"
)).
minimumShouldMatch
(
1
));
}
else
if
(
k
.
equals
(
"industrySupervisor"
)
||
k
.
equals
(
"operatingStatus"
))
{
boolMust
.
must
(
existsQuery
(
field
));
TermsQueryBuilder
termsQuery
=
QueryBuilders
.
termsQuery
(
field
+
".keyword"
,
((
JSONArray
)
v
).
get
(
0
));
boolMust
.
must
(
termsQuery
);
}
else
if
(
k
.
equals
(
"itemCode"
)
||
k
.
equals
(
"subItemCode"
)
||
k
.
equals
(
"permitStatus"
))
{
...
...
@@ -577,7 +572,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
queryBuilder
.
minimumShouldMatch
(
1
);
boolMust
.
must
(
queryBuilder
);
}
else
if
(
k
.
equals
(
"unitCategory"
))
{
if
(!
""
.
equals
(
v
)
&&
!
ObjectUtils
.
isEmpty
(
v
))
{
if
(!
""
.
equals
(
v
)
&&
!
ObjectUtils
.
isEmpty
(
v
)
&&
!
"all"
.
equals
(
v
)
)
{
String
category
=
v
.
toString
();
JSONArray
unitTypeByType
=
UnitTypeNewEnum
.
getUnitTypeByType
(
category
);
List
<
String
>
list
=
unitTypeByType
.
stream
().
map
(
e
->
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
e
)).
get
(
"value"
).
toString
()).
collect
(
Collectors
.
toList
());
...
...
@@ -711,7 +706,6 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
String
field
=
k
;
if
(
k
.
equals
(
"NEXT_INSPECT_DATE"
))
{
String
finalField
=
field
;
boolMust
.
must
(
existsQuery
(
finalField
));
EnhancedDynamicQueryBuilder
queryBuilder
=
new
EnhancedDynamicQueryBuilder
();
((
JSONArray
)
v
).
forEach
(
item
->
{
if
(
item
.
equals
(
"overdue"
))
{
...
...
@@ -762,7 +756,6 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
else
if
(
k
.
equals
(
"EQU_DEFINE"
))
{
field
=
"EQU_DEFINE_CODE"
;
}
boolMust
.
must
(
existsQuery
(
field
));
TermsQueryBuilder
termsQuery
=
QueryBuilders
.
termsQuery
(
field
,
(
JSONArray
)
v
);
boolMust
.
must
(
termsQuery
);
}
else
if
(
k
.
equals
(
"JDJY"
)
||
k
.
equals
(
"DQJY"
)
||
k
.
equals
(
"SCJY"
)
||
k
.
equals
(
"DTJY"
))
{
...
...
@@ -888,6 +881,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
dto
.
put
(
"WHETHER_VEHICLE_CYLINDER"
,
ObjectUtils
.
isEmpty
(
dto
.
get
(
"WHETHER_VEHICLE_CYLINDER"
))
?
""
:
"1"
.
equals
(
dto
.
get
(
"WHETHER_VEHICLE_CYLINDER"
))
?
"是"
:
"否"
);
dto
.
put
(
"WHETHER_SKID_MOUNTED_PRESSURE_VESSEL"
,
ObjectUtils
.
isEmpty
(
dto
.
get
(
"WHETHER_SKID_MOUNTED_PRESSURE_VESSEL"
))
?
""
:
"1"
.
equals
(
dto
.
get
(
"WHETHER_SKID_MOUNTED_PRESSURE_VESSEL"
))
?
"是"
:
"否"
);
dto
.
put
(
"whetherSphericalTank"
,
ObjectUtils
.
isEmpty
(
dto
.
get
(
"whetherSphericalTank"
))
?
""
:
"1"
.
equals
(
dto
.
get
(
"whetherSphericalTank"
))
?
"是"
:
"否"
);
dto
.
put
(
"EQU_STATE"
,
ObjectUtils
.
isEmpty
(
dto
.
get
(
"EQU_STATE"
))
?
null
:
EquipStateEnum
.
getNameByCode
(
dto
.
get
(
"EQU_STATE"
).
toString
()));
list
.
add
(
dto
);
}
totle
=
Objects
.
requireNonNull
(
response
.
getInternalResponse
().
hits
().
getTotalHits
()).
value
;
...
...
@@ -1669,25 +1663,22 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
result
.
put
(
"permitStatus"
,
permitStatusData
);
//监管设备类型
List
<
EquipmentCategoryDto
>
equipmentCategoryDtos
=
equipmentCategoryMapper
.
selectClassify
();
JSONArray
equipCategoryData
=
new
JSONArray
();
for
(
int
i
=
0
;
i
<
equipmentCategoryDtos
.
size
();
i
++)
{
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"key"
,
equipmentCategoryDtos
.
get
(
i
).
getCode
());
object
.
put
(
"value"
,
equipmentCategoryDtos
.
get
(
i
).
getCode
());
object
.
put
(
"label"
,
equipmentCategoryDtos
.
get
(
i
).
getName
());
equipCategoryData
.
add
(
object
);
}
result
.
put
(
"equipCategory"
,
equipCategoryData
);
Map
<
String
,
List
<
Map
<
String
,
Object
>>>
resourceJson
=
JsonUtils
.
getResourceJson
(
equipCategory
);
List
<
Map
<
String
,
Object
>>
equipCategory
=
resourceJson
.
get
(
EquipmentClassifityEnum
.
ZHTJFX
.
getCode
());
result
.
put
(
"equipCategory"
,
equipCategory
);
return
result
;
}
private
static
JSONArray
getUnitCategory
()
{
JSONArray
unitCategory
=
new
JSONArray
();
for
(
int
i
=
0
;
i
<
2
;
i
++)
{
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
JSONObject
object
=
new
JSONObject
();
if
(
0
==
i
)
{
object
.
put
(
"key"
,
"all"
);
object
.
put
(
"value"
,
"all"
);
object
.
put
(
"label"
,
"全部"
);
}
else
if
(
1
==
i
)
{
object
.
put
(
"key"
,
"use"
);
object
.
put
(
"value"
,
"use"
);
object
.
put
(
"label"
,
"使用单位"
);
...
...
@@ -1776,16 +1767,9 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
//学历
result
.
put
(
"education"
,
deployDictionary
(
dataDictionaryService
.
getByType
(
"QYRYXL"
)));
//监管设备类型
List
<
EquipmentCategoryDto
>
equipmentCategoryDtos
=
equipmentCategoryMapper
.
selectClassify
();
JSONArray
equipCategoryData
=
new
JSONArray
();
for
(
int
i
=
0
;
i
<
equipmentCategoryDtos
.
size
();
i
++)
{
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"key"
,
equipmentCategoryDtos
.
get
(
i
).
getCode
());
object
.
put
(
"value"
,
equipmentCategoryDtos
.
get
(
i
).
getCode
());
object
.
put
(
"label"
,
equipmentCategoryDtos
.
get
(
i
).
getName
());
equipCategoryData
.
add
(
object
);
}
result
.
put
(
"equipType"
,
equipCategoryData
);
Map
<
String
,
List
<
Map
<
String
,
Object
>>>
resourceJson
=
JsonUtils
.
getResourceJson
(
equipCategory
);
List
<
Map
<
String
,
Object
>>
equipCategory
=
resourceJson
.
get
(
EquipmentClassifityEnum
.
ZHTJFX
.
getCode
());
result
.
put
(
"equipType"
,
equipCategory
);
//获取企业分类
result
.
put
(
"unitCategory"
,
getUnitCategory
());
//获取企业类型
...
...
@@ -1841,8 +1825,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
public
JSONArray
queryRYLX
(
JSONObject
params
)
{
JSONArray
result
=
new
JSONArray
();
JSONArray
type
=
params
.
containsKey
(
"type"
)
?
JSONObject
.
parseArray
(
JSONObject
.
toJSONString
(
params
.
get
(
"type"
)))
:
n
ull
;
String
subType
=
params
.
containsKey
(
"subType"
)
?
params
.
get
(
"subType"
).
toString
()
:
null
;
JSONArray
type
=
params
.
containsKey
(
"type"
)
?
JSONObject
.
parseArray
(
JSONObject
.
toJSONString
(
params
.
get
(
"type"
)))
:
n
ew
JSONArray
()
;
String
subType
=
params
.
containsKey
(
"subType"
)
?
params
.
get
(
"subType"
).
toString
()
:
""
;
List
<
String
>
typeList
=
new
ArrayList
<>(
Arrays
.
asList
(
"QYRYGW"
,
...
...
@@ -1858,7 +1842,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
.
in
(
DataDictionary:
:
getType
,
typeList
)
.
list
();
if
(
subType
!=
null
)
{
if
(
!
""
.
equals
(
subType
)
)
{
List
<
DataDictionary
>
childrenrylx
=
dataDictionaryService
.
lambdaQuery
()
.
in
(
DataDictionary:
:
getParent
,
subType
)
.
like
(
DataDictionary:
:
getType
,
"QYRYGW"
)
...
...
@@ -1867,11 +1851,14 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
result
=
deployDictionary
(
childrenrylx
);
}
if
(
type
!=
null
)
{
if
(
!
ObjectUtils
.
isEmpty
(
type
)
&&
!
type
.
contains
(
"all"
)
)
{
try
{
ArrayList
<
String
>
postDictCodeList
=
new
ArrayList
<>();
JsonNode
jsonNode
=
new
ObjectMapper
().
readTree
(
unitTypeLimitUserType
.
getInputStream
());
type
.
forEach
(
unitType
->
{
if
(
unitType
.
equals
(
"企业"
))
{
unitType
=
"使用单位"
;
}
JsonNode
companyTypeNode
=
jsonNode
.
get
(
unitType
.
toString
());
if
(
companyTypeNode
!=
null
&&
companyTypeNode
.
isObject
())
{
Iterator
<
Map
.
Entry
<
String
,
JsonNode
>>
fields
=
companyTypeNode
.
fields
();
...
...
@@ -1890,7 +1877,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
}
if
(
subType
==
null
&&
type
==
null
)
{
if
(
""
.
equals
(
subType
)
&&
(
ObjectUtils
.
isEmpty
(
type
)
||
type
.
contains
(
"all"
))
)
{
result
=
deployDictionary
(
allPost
);
}
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/resources/json/equipCategory.json
View file @
c6744180
...
...
@@ -404,6 +404,21 @@
"value"
:
"4000"
},
{
"key"
:
"144"
,
"label"
:
"客运索道"
,
"value"
:
"9000"
},
{
"key"
:
"80"
,
"label"
:
"大型游乐设施"
,
"value"
:
"6000"
},
{
"key"
:
"76"
,
"label"
:
"场(厂)内专用机动车辆"
,
"value"
:
"5000"
},
{
"key"
:
"1"
,
"label"
:
"锅炉"
,
"value"
:
"1000"
...
...
@@ -417,21 +432,6 @@
"key"
:
"133"
,
"label"
:
"压力管道"
,
"value"
:
"8000"
},
{
"key"
:
"80"
,
"label"
:
"大型游乐设施"
,
"value"
:
"6000"
},
{
"key"
:
"144"
,
"label"
:
"客运索道"
,
"value"
:
"9000"
},
{
"key"
:
"76"
,
"label"
:
"场(厂)内专用机动车辆"
,
"value"
:
"5000"
}
]
}
\ 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