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
77863923
Commit
77863923
authored
Jul 01, 2025
by
yangyang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register
parents
26a9063d
dec5f834
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
498 additions
and
73 deletions
+498
-73
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+2
-0
JgVehicleInformationServiceImpl.java
.../jg/biz/service/impl/JgVehicleInformationServiceImpl.java
+94
-39
CompanyAdvanceSearchEnum.java
...module/statistics/api/enums/CompanyAdvanceSearchEnum.java
+57
-0
EquipAdvanceSearchEnum.java
...t/module/statistics/api/enums/EquipAdvanceSearchEnum.java
+2
-2
PersonAdvanceSearchEnum.java
.../module/statistics/api/enums/PersonAdvanceSearchEnum.java
+60
-0
UnitTypeEnum.java
...n/amos/boot/module/statistics/api/enums/UnitTypeEnum.java
+1
-1
ComprehensiveStatisticalAnalysisController.java
...ontroller/ComprehensiveStatisticalAnalysisController.java
+16
-4
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+266
-27
No files found.
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/CommonServiceImpl.java
View file @
77863923
...
...
@@ -1503,7 +1503,9 @@ public class CommonServiceImpl implements ICommonService {
@Override
public
Object
updateHistory
(
Map
<
String
,
Object
>
map
)
{
String
historyEquType
=
(
String
)
map
.
get
(
HISTORY_EQU_TYPE
);
String
historySubmitType
=
(
String
)
map
.
get
(
HISTORY_SUBMIT_TYPE
);
JSONObject
jsonObject
=
new
JSONObject
(
map
);
jsonObject
.
put
(
"historySubmitType"
,
historySubmitType
);
switch
(
historyEquType
)
{
case
"unit"
:
// return jgUseRegistrationServiceImpl.handleUnitHistoryEquip(jsonObject);
...
...
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/JgVehicleInformationServiceImpl.java
View file @
77863923
...
...
@@ -689,9 +689,19 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
.
map
(
JgVehicleInformationEq:
:
getEquId
)
.
collect
(
Collectors
.
toList
());
if
(
CollUtil
.
isNotEmpty
(
records
))
{
vo
.
setEquipmentLists
(
this
.
baseMapper
.
queryForUnitVesselEquipment
(
sequenceNbr
,
records
).
stream
()
.
peek
(
v
->
v
.
put
(
"chargingMedium"
,
getFillingMediumMap
().
get
(
v
.
getOrDefault
(
"chargingMedium"
,
""
)
+
""
)))
.
collect
(
Collectors
.
toList
()));
Map
<
String
,
Object
>
mediumMap
=
getFillingMediumMap
();
List
<
Map
<
String
,
Object
>>
equipmentList
=
this
.
baseMapper
.
queryForUnitVesselEquipment
(
sequenceNbr
,
records
)
.
stream
()
.
peek
(
item
->
{
String
key
=
Objects
.
toString
(
item
.
get
(
"chargingMedium"
),
""
);
mediumMap
.
getOrDefault
(
key
,
null
);
// 提前获取映射
if
(
mediumMap
.
containsKey
(
key
))
{
item
.
put
(
"chargingMedium"
,
mediumMap
.
get
(
key
));
}
})
.
collect
(
Collectors
.
toList
());
vo
.
setEquipmentLists
(
equipmentList
);
}
}
else
{
// 完成及已作废时显示历史数据详情
...
...
@@ -702,11 +712,19 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
.
map
(
JgVehicleInformationEq:
:
getEquId
)
.
collect
(
Collectors
.
toList
());
if
(
CollUtil
.
isNotEmpty
(
records
))
{
vo
.
setEquipmentLists
(
this
.
baseMapper
.
queryForUnitVesselEquipment
(
sequenceNbr
,
records
).
stream
()
.
peek
(
v
->
v
.
put
(
"chargingMedium"
,
getFillingMediumMap
().
get
(
v
.
getOrDefault
(
"chargingMedium"
,
""
)
+
""
)))
.
collect
(
Collectors
.
toList
())
);
Map
<
String
,
Object
>
mediumMap
=
getFillingMediumMap
();
// 假设返回的是 Map<String, String>
List
<
Map
<
String
,
Object
>>
equipmentList
=
this
.
baseMapper
.
queryForUnitVesselEquipment
(
sequenceNbr
,
records
)
.
stream
()
.
peek
(
item
->
{
String
key
=
Objects
.
toString
(
item
.
get
(
"chargingMedium"
),
""
);
mediumMap
.
getOrDefault
(
key
,
null
);
// 提前获取映射
if
(
mediumMap
.
containsKey
(
key
))
{
item
.
put
(
"chargingMedium"
,
mediumMap
.
get
(
key
));
}
})
.
collect
(
Collectors
.
toList
());
vo
.
setEquipmentLists
(
equipmentList
);
}
}
else
{
List
equList
=
objects
.
toJavaList
(
Map
.
class
);
...
...
@@ -1854,7 +1872,6 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
String
useRegistrationCode
=
String
.
valueOf
(
map
.
get
(
"useRegistrationCode"
)).
trim
();
// 车辆VIN码
String
identificationCode
=
String
.
valueOf
(
map
.
get
(
"identificationCode"
)).
trim
();
String
equipId
=
String
.
valueOf
(
map
.
get
(
"equipId"
));
// 表单设备列表
List
<
Map
<
String
,
Object
>>
equipmentLists
=
new
ObjectMapper
()
.
convertValue
(
map
.
get
(
"equipmentLists"
),
new
TypeReference
<
List
<
Map
<
String
,
Object
>>>()
{
...
...
@@ -2027,29 +2044,48 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
// 登记证记录表主键
Long
changeRecordId
=
sequence
.
nextId
();
//新增
Object
submitType
=
map
.
get
(
"historySubmitType"
);
if
(
StringUtils
.
isEmpty
(
vehicleInfoDto
.
getSequenceNbr
()))
{
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
SYDJ
.
getCode
(),
1
);
if
(!
ObjectUtils
.
isEmpty
(
listResponseModel
)
&&
listResponseModel
.
getStatus
()
!=
HttpStatus
.
OK
.
value
())
{
log
.
error
(
"车用气瓶使用登记申请单单号获取失败!"
);
throw
new
BadRequest
(
"车用气瓶使用登记申请单单号获取失败!"
);
}
String
applyNo
=
listResponseModel
.
getResult
().
get
(
0
);
vehicleInformation
.
setApplyNo
(
applyNo
);
vehicleInformation
.
setStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
vehicleInformation
.
setRegType
(
"1"
);
//历史登记
this
.
save
(
vehicleInformation
);
//暂存或者提交
if
(!
Arrays
.
asList
(
"tempSubmit"
,
"tempEdit"
).
contains
(
submitType
)){
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
SYDJ
.
getCode
(),
1
);
if
(!
ObjectUtils
.
isEmpty
(
listResponseModel
)
&&
listResponseModel
.
getStatus
()
!=
HttpStatus
.
OK
.
value
())
{
log
.
error
(
"车用气瓶使用登记申请单单号获取失败!"
);
throw
new
BadRequest
(
"车用气瓶使用登记申请单单号获取失败!"
);
}
String
applyNo
=
listResponseModel
.
getResult
().
get
(
0
);
vehicleInformation
.
setApplyNo
(
applyNo
);
String
status
=
"temp"
.
equals
(
submitType
)
?
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getName
()
:
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
();
vehicleInformation
.
setStatus
(
status
);
vehicleInformation
.
setRegType
(
"1"
);
//历史登记
this
.
save
(
vehicleInformation
);
// 取第一条设备的注册消息--用来获取这一批设备的设备种类/类别/品种
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
lambdaReg
=
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
lambda
();
lambdaReg
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
String
.
valueOf
(
equipmentLists
.
get
(
0
).
get
(
"record"
)));
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
lambdaReg
);
// 生成证书管理表记录
generateRegistrationManage
(
vehicleInformation
,
registerInfo
);
// 生成一条tzs_jg_certificate_change_record记录
generateCertificateChangeRecord
(
vehicleInformation
,
registerInfo
,
changeRecordId
,
null
);
if
(!
"temp"
.
equals
(
submitType
)){
// 取第一条设备的注册消息--用来获取这一批设备的设备种类/类别/品种
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
lambdaReg
=
new
QueryWrapper
<
IdxBizJgRegisterInfo
>().
lambda
();
lambdaReg
.
eq
(
IdxBizJgRegisterInfo:
:
getRecord
,
String
.
valueOf
(
equipmentLists
.
get
(
0
).
get
(
"record"
)));
IdxBizJgRegisterInfo
registerInfo
=
idxBizJgRegisterInfoMapper
.
selectOne
(
lambdaReg
);
// 生成证书管理表记录
generateRegistrationManage
(
vehicleInformation
,
registerInfo
);
// 生成一条tzs_jg_certificate_change_record记录
generateCertificateChangeRecord
(
vehicleInformation
,
registerInfo
,
changeRecordId
,
null
);
}
}
else
{
//暂存编辑或暂存提交
String
status
=
"tempEdit"
.
equals
(
submitType
)
?
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getName
()
:
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
();
vehicleInformation
.
setStatus
(
status
);
LambdaQueryWrapper
<
JgVehicleInformationEq
>
lambda
=
new
QueryWrapper
<
JgVehicleInformationEq
>().
lambda
();
lambda
.
eq
(
JgVehicleInformationEq:
:
getVehicleId
,
vehicleInformation
.
getSequenceNbr
());
jgVehicleInformationEqService
.
getBaseMapper
().
delete
(
lambda
);
this
.
getBaseMapper
().
updateById
(
vehicleInformation
);
}
}
else
{
// 编辑
// 删除以前设备关联关系
this
.
getBaseMapper
().
updateById
(
vehicleInformation
);
LambdaQueryWrapper
<
JgVehicleInformationEq
>
lambda
=
new
QueryWrapper
<
JgVehicleInformationEq
>().
lambda
();
lambda
.
eq
(
JgVehicleInformationEq:
:
getVehicleId
,
vehicleInformation
.
getSequenceNbr
());
jgVehicleInformationEqService
.
getBaseMapper
().
delete
(
lambda
);
...
...
@@ -2098,8 +2134,8 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
IdxBizJgUseInfo
useInfo
=
useInfoMapper
.
selectOne
(
useInfoLambdaQueryWrapper
);
useInfo
.
setOldUseRegistrationTable
(
JSON
.
toJSONString
(
map
.
get
(
"oldUseRegistrationTable"
)));
useInfo
.
setOldUseRegistrationCertificate
(
JSON
.
toJSONString
(
map
.
get
(
"oldUseRegistrationCertificate"
)));
useInfo
.
setORegDate
(
String
.
valueOf
(
map
.
get
(
"oRegDate"
)
));
useInfo
.
setORegUnit
(
String
.
valueOf
(
map
.
get
(
"oRegUnit"
)
));
useInfo
.
setORegDate
(
Objects
.
toString
(
map
.
get
(
"oRegDate"
),
null
));
useInfo
.
setORegUnit
(
Objects
.
toString
(
map
.
get
(
"oRegUnit"
),
null
));
useInfo
.
setEstateUnitCreditCode
(
vehicleInformation
.
getEstateUnitCreditCode
());
useInfo
.
setEstateUnitName
(
vehicleInformation
.
getEstateUnitName
());
useInfo
.
setSafetyManagerId
(
vehicleInformation
.
getSafetyManagerId
());
...
...
@@ -2124,9 +2160,11 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
IdxBizJgOtherInfo
otherInfo
=
otherInfoMapper
.
selectOne
(
otherInfoWrapper
);
// 更新设备信息
this
.
updateEquipInfo
(
vehicleInformation
,
registerInfo
,
otherInfo
,
String
.
valueOf
(
x
.
get
(
"record"
)));
// 更新es
this
.
updateEquipEsData
(
vehicleInformation
,
otherInfo
,
registerInfo
,
String
.
valueOf
(
x
.
get
(
"record"
)));
if
(!
Arrays
.
asList
(
"temp"
,
"tempEdit"
).
contains
(
submitType
)){
this
.
updateEquipInfo
(
vehicleInformation
,
registerInfo
,
otherInfo
,
String
.
valueOf
(
x
.
get
(
"record"
)));
// 更新es
this
.
updateEquipEsData
(
vehicleInformation
,
otherInfo
,
registerInfo
,
String
.
valueOf
(
x
.
get
(
"record"
)));
}
// 查询设备制造信息
LambdaQueryWrapper
<
IdxBizJgFactoryInfo
>
factoryInfoWrapper
=
new
LambdaQueryWrapper
<>();
factoryInfoWrapper
.
eq
(
IdxBizJgFactoryInfo:
:
getRecord
,
String
.
valueOf
(
x
.
get
(
"record"
)));
...
...
@@ -2191,6 +2229,10 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()))
+
""
,
ReginParams
.
class
);
JgVehicleInformationDto
vehicleInfoDto
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
map
),
JgVehicleInformationDto
.
class
);
List
<
Map
<
String
,
Object
>>
equipmentLists
=
(
List
<
Map
<
String
,
Object
>>)
map
.
get
(
"equipmentLists"
);
Optional
.
ofNullable
(
equipmentLists
)
.
filter
(
list
->
!
list
.
isEmpty
())
.
filter
(
list
->
list
.
stream
().
map
(
v
->
(
String
)
v
.
get
(
"chargingMedium"
)).
distinct
().
count
()
==
1
)
.
orElseThrow
(()
->
new
BadRequest
(
CollectionUtils
.
isEmpty
(
equipmentLists
)
?
"请选择设备信息!"
:
"请选择相同充装介质设备!"
));
CompanyBo
company
=
reginParams
.
getCompany
();
vehicleInfoDto
.
setCreateDate
(
new
Date
());
...
...
@@ -2284,13 +2326,24 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
vehicleInformation
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
vehicleInformation
.
setGasNum
(
equipmentLists
.
size
());
BigDecimal
totalVolume
=
equipmentLists
.
stream
()
.
map
(
x
->
new
BigDecimal
(
String
.
valueOf
(
x
.
get
(
"singleBottleVolume"
))))
.
map
(
x
->
{
Object
val
=
x
.
get
(
"singleBottleVolume"
);
try
{
return
new
BigDecimal
(
String
.
valueOf
(
val
));
}
catch
(
Exception
e
)
{
return
BigDecimal
.
ZERO
;
}
})
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
vehicleInformation
.
setVolume
(
totalVolume
.
toPlainString
());
vehicleInformation
.
setAuditPassDate
(
new
Date
());
// 登记证记录表主键
Long
changeRecordId
=
sequence
.
nextId
();
String
status
=
"tempEdit"
.
equals
(
map
.
get
(
"historySubmitType"
))
?
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getName
()
:
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
();
vehicleInformation
.
setStatus
(
status
);
this
.
getBaseMapper
().
updateById
(
vehicleInformation
);
JgUseRegistrationManage
jgUseRegistrationManage
=
jgUseRegistrationManageService
.
lambdaQuery
()
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
vehicleInformation
.
getUseRegistrationCode
())
...
...
@@ -2350,11 +2403,13 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
IdxBizJgFactoryInfo
idxBizJgFactoryInfo
=
idxBizJgFactoryInfoMapper
.
selectOne
(
factoryInfoWrapper
);
// 生成tzs_jg_certificate_change_record_eq记录
JgCertificateChangeRecordEq
changeRecordEq
=
new
JgCertificateChangeRecordEq
();
changeRecordEq
.
setChangeRecordId
(
String
.
valueOf
(
changeRecordId
));
//登记证记录主键
changeRecordEq
.
setEquId
(
registerInfo
.
getRecord
());
//设备主键
changeRecordEq
.
setProductCode
(
idxBizJgFactoryInfo
.
getFactoryNum
());
//产品编号
certificateChangeRecordEqService
.
save
(
changeRecordEq
);
if
(!
"tempEdit"
.
equals
(
map
.
get
(
"historySubmitType"
))){
JgCertificateChangeRecordEq
changeRecordEq
=
new
JgCertificateChangeRecordEq
();
changeRecordEq
.
setChangeRecordId
(
String
.
valueOf
(
changeRecordId
));
//登记证记录主键
changeRecordEq
.
setEquId
(
registerInfo
.
getRecord
());
//设备主键
changeRecordEq
.
setProductCode
(
idxBizJgFactoryInfo
.
getFactoryNum
());
//产品编号
certificateChangeRecordEqService
.
save
(
changeRecordEq
);
}
});
}
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/enums/CompanyAdvanceSearchEnum.java
0 → 100644
View file @
77863923
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistics
.
api
.
enums
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.annotation.TechnicalParameter
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
@AllArgsConstructor
@Getter
public
enum
CompanyAdvanceSearchEnum
{
/**
* 高级搜索枚举
*/
ADDRESS
(
"详细地址"
,
"address"
,
TechnicalParameter
.
ParamType
.
STRING
,
""
),
EXPIRYDATE
(
"许可有效期"
,
"expiryDate"
,
TechnicalParameter
.
ParamType
.
DATE
,
""
),
UNIT_TYPE
(
"企业类型"
,
"unitType"
,
null
,
""
),
REGULATORY_LABELS
(
"企业等级"
,
"regulatoryLabels"
,
null
,
""
),
INDUSTRY_SUPERVISOR
(
"行业主管部门"
,
"industrySupervisor"
,
null
,
""
),
ITEM_CODE
(
"许可项目"
,
"itemCode"
,
null
,
""
),
SUB_ITEM_CODE
(
"许可子项目"
,
"subItemCode"
,
null
,
""
),
OPERATING_STATUS
(
"经营状态"
,
"operatingStatus"
,
null
,
""
),
EQUIP_CATEGORY
(
"监管设备类型"
,
"equipCategory"
,
null
,
""
),
;
private
String
name
;
private
String
code
;
private
TechnicalParameter
.
ParamType
paramType
;
private
String
url
;
public
static
JSONArray
getAll
(){
JSONArray
jsonArray
=
new
JSONArray
();
for
(
CompanyAdvanceSearchEnum
item
:
values
())
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"label"
,
item
.
name
);
jsonObject
.
put
(
"value"
,
item
.
code
);
jsonObject
.
put
(
"key"
,
item
.
code
);
jsonObject
.
put
(
"paramType"
,
item
.
paramType
);
jsonObject
.
put
(
"isMulti"
,
false
);
if
(
TechnicalParameter
.
ParamType
.
BIG_DECIMAL
.
equals
(
item
.
paramType
)){
jsonObject
.
put
(
"type"
,
"inputNumber"
);
}
else
if
(
TechnicalParameter
.
ParamType
.
STRING
.
equals
(
item
.
paramType
)){
jsonObject
.
put
(
"type"
,
"input"
);
}
else
if
(
TechnicalParameter
.
ParamType
.
DATE
.
equals
(
item
.
paramType
)){
jsonObject
.
put
(
"type"
,
"date"
);
}
else
{
jsonObject
.
put
(
"type"
,
"select"
);
}
jsonObject
.
put
(
"conditions"
,
ConditionEnum
.
getByCode
(
item
.
paramType
));
jsonObject
.
put
(
"url"
,
item
.
url
);
jsonArray
.
add
(
jsonObject
);
}
return
jsonArray
;
}
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/enums/AdvanceSearchEnum.java
→
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/enums/
Equip
AdvanceSearchEnum.java
View file @
77863923
...
...
@@ -8,7 +8,7 @@ import lombok.Getter;
@AllArgsConstructor
@Getter
public
enum
AdvanceSearchEnum
{
public
enum
Equip
AdvanceSearchEnum
{
/**
* 高级搜索枚举
...
...
@@ -48,7 +48,7 @@ public enum AdvanceSearchEnum {
public
static
JSONArray
getAll
(){
JSONArray
jsonArray
=
new
JSONArray
();
for
(
AdvanceSearchEnum
item
:
values
())
{
for
(
Equip
AdvanceSearchEnum
item
:
values
())
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"label"
,
item
.
name
);
jsonObject
.
put
(
"value"
,
item
.
code
);
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/enums/PersonAdvanceSearchEnum.java
0 → 100644
View file @
77863923
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistics
.
api
.
enums
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.annotation.TechnicalParameter
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
@AllArgsConstructor
@Getter
public
enum
PersonAdvanceSearchEnum
{
/**
* 高级搜索枚举
*/
NAME
(
"人员名称"
,
"name"
,
TechnicalParameter
.
ParamType
.
STRING
,
""
),
NEWPOST
(
"人员类型"
,
"newPost"
,
TechnicalParameter
.
ParamType
.
DATE
,
""
),
SUBPOST
(
"人员子类型"
,
"subPost"
,
null
,
""
),
// REGULATORY_LABELS("有无资质", "regulatoryLabels",null,""),
// REGULATORY_LABELS("资质状态", "regulatoryLabels",null,""),
CERT_TYPE
(
"证书类型"
,
"certType"
,
null
,
""
),
PERMISSION_LEVEL
(
"证书级别"
,
"permissionLevel"
,
null
,
""
),
JOB_ITEM
(
"作业项目"
,
"jobItem"
,
null
,
""
),
ISSUE_DATE
(
"发证日期"
,
"issueDate"
,
TechnicalParameter
.
ParamType
.
DATE
,
""
),
EDUCATION
(
"学历"
,
"education"
,
null
,
""
),
ADDRESS
(
"住址"
,
"address"
,
TechnicalParameter
.
ParamType
.
STRING
,
""
),
EQUIP_TYPE
(
"监管设备类型"
,
"equipType"
,
null
,
""
),
;
private
String
name
;
private
String
code
;
private
TechnicalParameter
.
ParamType
paramType
;
private
String
url
;
public
static
JSONArray
getAll
(){
JSONArray
jsonArray
=
new
JSONArray
();
for
(
PersonAdvanceSearchEnum
item
:
values
())
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"label"
,
item
.
name
);
jsonObject
.
put
(
"value"
,
item
.
code
);
jsonObject
.
put
(
"key"
,
item
.
code
);
jsonObject
.
put
(
"paramType"
,
item
.
paramType
);
jsonObject
.
put
(
"isMulti"
,
false
);
if
(
TechnicalParameter
.
ParamType
.
BIG_DECIMAL
.
equals
(
item
.
paramType
)){
jsonObject
.
put
(
"type"
,
"inputNumber"
);
}
else
if
(
TechnicalParameter
.
ParamType
.
STRING
.
equals
(
item
.
paramType
)){
jsonObject
.
put
(
"type"
,
"input"
);
}
else
if
(
TechnicalParameter
.
ParamType
.
DATE
.
equals
(
item
.
paramType
)){
jsonObject
.
put
(
"type"
,
"date"
);
}
else
{
jsonObject
.
put
(
"type"
,
"select"
);
}
jsonObject
.
put
(
"conditions"
,
ConditionEnum
.
getByCode
(
item
.
paramType
));
jsonObject
.
put
(
"url"
,
item
.
url
);
jsonArray
.
add
(
jsonObject
);
}
return
jsonArray
;
}
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/enums/UnitTypeEnum.java
View file @
77863923
...
...
@@ -43,7 +43,7 @@ public enum UnitTypeEnum {
for
(
UnitTypeEnum
e
:
UnitTypeEnum
.
values
())
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"label"
,
e
.
name
);
jsonObject
.
put
(
"value"
,
e
.
cod
e
);
jsonObject
.
put
(
"value"
,
e
.
nam
e
);
jsonObject
.
put
(
"key"
,
e
.
code
);
jsonArray
.
add
(
jsonObject
);
}
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/controller/ComprehensiveStatisticalAnalysisController.java
View file @
77863923
...
...
@@ -128,10 +128,22 @@ public class ComprehensiveStatisticalAnalysisController extends BaseController {
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/select/queryZZZT"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询资质状态"
,
notes
=
"查询资质状态"
)
public
ResponseModel
<
JSONArray
>
queryZZZT
()
{
return
ResponseHelper
.
buildResponse
(
statisticalAnalysisService
.
queryZZZT
());
@GetMapping
(
value
=
"/select/queryZYXM"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询作业项目"
,
notes
=
"查询作业项目"
)
public
ResponseModel
<
JSONArray
>
queryZYXM
(
@RequestParam
String
type
)
{
return
ResponseHelper
.
buildResponse
(
statisticalAnalysisService
.
queryZYXM
(
type
));
}
/**
* @param
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/select/queryUnitByOrgCode"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据监管机构查询企业"
,
notes
=
"根据监管机构查询企业"
)
public
ResponseModel
<
JSONArray
>
queryUnitByOrgCode
(
@RequestParam
String
orgCode
)
{
return
ResponseHelper
.
buildResponse
(
statisticalAnalysisService
.
queryUnitByOrgCode
(
orgCode
));
}
/**
...
...
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 @
77863923
...
...
@@ -15,7 +15,7 @@ import com.yeejoin.amos.boot.module.common.biz.utils.TechParamUtil;
import
com.yeejoin.amos.boot.module.jg.api.enums.DPMapStatisticsItemEnum
;
import
com.yeejoin.amos.boot.module.statistcs.biz.utils.JsonUtils
;
import
com.yeejoin.amos.boot.module.statistcs.biz.utils.MinioUtils
;
import
com.yeejoin.amos.boot.module.statistics.api.enums.AdvanceSearchEnum
;
import
com.yeejoin.amos.boot.module.statistics.api.enums.
Equip
AdvanceSearchEnum
;
import
com.yeejoin.amos.boot.module.statistics.api.enums.ConditionEnum
;
import
com.yeejoin.amos.boot.module.statistics.api.enums.StatisticalAnalysisEnum
;
import
com.yeejoin.amos.boot.module.statistics.api.enums.UnitTypeEnum
;
...
...
@@ -24,8 +24,11 @@ import com.yeejoin.amos.boot.module.statistics.api.vo.EquipInfoVo;
import
com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.lucene.queryparser.classic.QueryParser
;
import
org.apache.lucene.search.join.ScoreMode
;
import
org.elasticsearch.action.search.SearchRequest
;
import
org.elasticsearch.action.search.SearchResponse
;
...
...
@@ -37,6 +40,8 @@ import org.elasticsearch.index.query.QueryBuilders;
import
org.elasticsearch.index.query.TermsQueryBuilder
;
import
org.elasticsearch.search.SearchHit
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.elasticsearch.search.sort.FieldSortBuilder
;
import
org.elasticsearch.search.sort.SortBuilders
;
import
org.elasticsearch.search.sort.SortOrder
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -146,9 +151,9 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
public
JSONArray
queryAdvancedSearch
(
String
type
)
{
JSONArray
all
=
new
JSONArray
();
if
(
"equip"
.
equals
(
type
))
{
all
=
AdvanceSearchEnum
.
getAll
();
}
else
if
(
"company"
.
equals
(
type
))
{
if
(
"equip"
.
equals
(
type
))
{
all
=
Equip
AdvanceSearchEnum
.
getAll
();
}
else
if
(
"company"
.
equals
(
type
))
{
}
else
if
(
"person"
.
equals
(
type
))
{
...
...
@@ -294,7 +299,10 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
// 排序
if
(!
ObjectUtils
.
isEmpty
(
filter
.
get
(
"sort"
)))
{
JSONObject
sort
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
filter
.
get
(
"sort"
)));
builder
.
sort
(
sort
.
getString
(
"field"
),
sort
.
getString
(
"order"
).
equals
(
"desc"
)
?
SortOrder
.
DESC
:
SortOrder
.
ASC
);
String
field
=
sort
.
getString
(
"filed"
);
SortOrder
sortOrder
=
sort
.
getString
(
"order"
).
equals
(
"desc"
)
?
SortOrder
.
DESC
:
SortOrder
.
ASC
;
FieldSortBuilder
sortBuilder
=
SortBuilders
.
fieldSort
(
field
+
".keyword"
).
order
(
sortOrder
);
builder
.
sort
(
sortBuilder
);
}
builder
.
query
(
boolMust
);
builder
.
from
((
current
-
1
)
*
size
);
...
...
@@ -412,7 +420,10 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
// 排序
if
(!
ObjectUtils
.
isEmpty
(
filter
.
get
(
"sort"
)))
{
JSONObject
sort
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
filter
.
get
(
"sort"
)));
builder
.
sort
(
sort
.
getString
(
"field"
),
sort
.
getString
(
"order"
).
equals
(
"desc"
)
?
SortOrder
.
DESC
:
SortOrder
.
ASC
);
String
field
=
sort
.
getString
(
"filed"
);
SortOrder
sortOrder
=
sort
.
getString
(
"order"
).
equals
(
"desc"
)
?
SortOrder
.
DESC
:
SortOrder
.
ASC
;
FieldSortBuilder
sortBuilder
=
SortBuilders
.
fieldSort
(
field
+
".keyword"
).
order
(
sortOrder
);
builder
.
sort
(
sortBuilder
);
}
builder
.
query
(
boolMust
);
...
...
@@ -461,7 +472,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
String
orgCode
=
filter
.
getString
(
"orgCode"
);
boolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"ORG_BRANCH_CODE"
,
orgCode
));
JSONObject
filterParams
=
null
;
JSONObject
filterParams
;
// 筛选
if
(!
ObjectUtils
.
isEmpty
(
filter
.
get
(
"filterParams"
)))
{
filterParams
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
filter
.
get
(
"filterParams"
)));
...
...
@@ -470,9 +481,15 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
if
(
filterType
.
equals
(
"advanced"
))
{
filterParams
.
forEach
((
k
,
v
)
->
{
if
(
k
.
equals
(
"techParam"
))
{
// todo 计数参数筛选
}
else
{
JSONArray
techParams
=
(
JSONArray
)
v
;
if
(!
techParams
.
contains
(
"all"
)
&&
techParams
.
size
()
==
1
)
{
JSONObject
paramRangeJson
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
filterParams
.
get
(
"paramRange"
)));
String
paramKey
=
techParams
.
getString
(
0
);
String
condition
=
paramRangeJson
.
getString
(
"condition"
);
Object
value
=
paramRangeJson
.
getString
(
"value"
);
getParamQuery
(
paramKey
,
condition
,
value
,
boolMust
);
}
}
else
if
(!
k
.
equals
(
"paramRange"
))
{
if
(
v
instanceof
JSONArray
)
{
if
(!((
JSONArray
)
v
).
contains
(
"all"
))
{
String
field
=
k
;
...
...
@@ -548,18 +565,22 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
// todo 自定义筛选
}
}
else
{
filterParams
=
null
;
}
// 排序
if
(!
ObjectUtils
.
isEmpty
(
filter
.
get
(
"sort"
)))
{
JSONObject
sort
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
filter
.
get
(
"sort"
)));
String
field
=
sort
.
getString
(
"fi
el
d"
);
String
field
=
sort
.
getString
(
"fi
le
d"
);
if
(
field
.
equals
(
"EQU_LIST"
))
{
field
=
"EQU_LIST_CODE"
;
}
else
if
(
field
.
equals
(
"EQU_CATEGORY"
))
{
field
=
"EQU_CATEGORY_CODE"
;
}
else
if
(
field
.
equals
(
"EQU_DEFINE"
))
{
field
=
"EQU_DEFINE_CODE"
;
}
else
{
field
=
field
+
".keyword"
;
}
builder
.
sort
(
field
,
sort
.
getString
(
"order"
).
equals
(
"desc"
)
?
SortOrder
.
DESC
:
SortOrder
.
ASC
);
}
...
...
@@ -634,6 +655,112 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
return
result
;
}
private
void
getParamQuery
(
String
paramKey
,
String
condition
,
Object
value
,
BoolQueryBuilder
boolMust
)
{
String
path
=
"techParams"
;
String
nestedFieldKey
=
path
+
".paramKey"
;
String
nestedFieldValue
=
path
+
".strValue"
;
NestedQueryBuilder
keyNestedQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
termsQuery
(
nestedFieldKey
,
paramKey
)),
ScoreMode
.
Avg
);
boolMust
.
must
(
keyNestedQuery
);
switch
(
condition
)
{
case
"eq"
:
NestedQueryBuilder
eqQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
termsQuery
(
nestedFieldValue
,
value
)),
ScoreMode
.
Avg
);
boolMust
.
must
(
eqQuery
);
break
;
case
"neq"
:
boolMust
.
must
(
keyNestedQuery
);
NestedQueryBuilder
neqQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
mustNot
(
QueryBuilders
.
termsQuery
(
nestedFieldValue
,
value
)),
ScoreMode
.
Avg
);
boolMust
.
mustNot
(
neqQuery
);
break
;
case
"like"
:
NestedQueryBuilder
likeQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
should
(
QueryBuilders
.
wildcardQuery
(
nestedFieldValue
,
"*"
+
value
+
"*"
)),
ScoreMode
.
Avg
);
boolMust
.
must
(
likeQuery
);
break
;
case
"notLike"
:
NestedQueryBuilder
notLikeQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
should
(
QueryBuilders
.
wildcardQuery
(
nestedFieldValue
,
"*"
+
value
+
"*"
)),
ScoreMode
.
Avg
);
boolMust
.
mustNot
(
notLikeQuery
);
break
;
case
"gt"
:
NestedQueryBuilder
gtQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
rangeQuery
(
nestedFieldValue
).
gt
(
Double
.
parseDouble
(
value
.
toString
()))),
ScoreMode
.
Avg
);
boolMust
.
must
(
gtQuery
);
break
;
case
"gte"
:
NestedQueryBuilder
gteQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
rangeQuery
(
nestedFieldValue
).
gte
(
Double
.
parseDouble
(
value
.
toString
()))),
ScoreMode
.
Avg
);
boolMust
.
must
(
gteQuery
);
break
;
case
"lt"
:
NestedQueryBuilder
ltQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
rangeQuery
(
nestedFieldValue
).
lt
(
Double
.
parseDouble
(
value
.
toString
()))),
ScoreMode
.
Avg
);
boolMust
.
must
(
ltQuery
);
break
;
case
"lte"
:
NestedQueryBuilder
lteQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
rangeQuery
(
nestedFieldValue
).
lte
(
Double
.
parseDouble
(
value
.
toString
()))),
ScoreMode
.
Avg
);
boolMust
.
must
(
lteQuery
);
break
;
case
"between"
:
JSONArray
btValues
=
(
JSONArray
)
value
;
NestedQueryBuilder
betweenQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
rangeQuery
(
nestedFieldValue
).
gte
(
Double
.
parseDouble
(
btValues
.
get
(
0
).
toString
())).
lte
(
Double
.
parseDouble
(
btValues
.
get
(
1
).
toString
()))),
ScoreMode
.
Avg
);
boolMust
.
must
(
betweenQuery
);
break
;
case
"in"
:
JSONArray
inValues
=
(
JSONArray
)
value
;
NestedQueryBuilder
inQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
termsQuery
(
nestedFieldValue
,
inValues
)),
ScoreMode
.
Avg
);
boolMust
.
must
(
inQuery
);
break
;
case
"notIn"
:
JSONArray
notInValues
=
(
JSONArray
)
value
;
NestedQueryBuilder
notInQuery
=
QueryBuilders
.
nestedQuery
(
path
,
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
termsQuery
(
nestedFieldValue
,
notInValues
)),
ScoreMode
.
Avg
);
boolMust
.
mustNot
(
notInQuery
);
break
;
}
}
public
JSONArray
queryUnitType
()
{
return
UnitTypeEnum
.
getAll
();
}
...
...
@@ -641,7 +768,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
public
JSONObject
queryCompanySearchData
()
{
JSONObject
result
=
new
JSONObject
();
//获取企业类型
result
.
put
(
"
UNIT_TYPE
"
,
UnitTypeEnum
.
getAll
());
result
.
put
(
"
unitType
"
,
UnitTypeEnum
.
getAll
());
//获取企业等级
result
.
put
(
"regulatoryLabels"
,
deployDictionary
(
dataDictionaryService
.
getByType
(
"QYBQ"
)));
...
...
@@ -655,17 +782,17 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
JSONArray
permitStatusData
=
new
JSONArray
();
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
JSONObject
object
=
new
JSONObject
();
if
(
0
==
i
)
{
object
.
put
(
"key"
,
"
0
"
);
object
.
put
(
"value"
,
"
0
"
);
if
(
0
==
i
)
{
object
.
put
(
"key"
,
"
overdue
"
);
object
.
put
(
"value"
,
"
overdue
"
);
object
.
put
(
"label"
,
"超期"
);
}
else
if
(
1
==
i
)
{
object
.
put
(
"key"
,
"
1
"
);
object
.
put
(
"value"
,
"
1
"
);
}
else
if
(
1
==
i
)
{
object
.
put
(
"key"
,
"
near
"
);
object
.
put
(
"value"
,
"
near
"
);
object
.
put
(
"label"
,
"临期"
);
}
else
{
object
.
put
(
"key"
,
"
2
"
);
object
.
put
(
"value"
,
"
2
"
);
}
else
{
object
.
put
(
"key"
,
"
normal
"
);
object
.
put
(
"value"
,
"
normal
"
);
object
.
put
(
"label"
,
"正常"
);
}
permitStatusData
.
add
(
object
);
...
...
@@ -682,15 +809,82 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
object
.
put
(
"label"
,
equipmentCategoryDtos
.
get
(
i
).
getName
());
equipCategoryData
.
add
(
object
);
}
result
.
put
(
"equip
List
"
,
equipCategoryData
);
result
.
put
(
"equip
Category
"
,
equipCategoryData
);
return
result
;
}
public
JSONObject
queryPersonSearchData
()
{
JSONObject
result
=
new
JSONObject
();
//资质状态
JSONArray
permissionStatus
=
new
JSONArray
();
for
(
int
i
=
0
;
i
<
3
;
i
++){
JSONObject
object
=
new
JSONObject
();
if
(
0
==
i
){
object
.
put
(
"key"
,
"noLicenses"
);
object
.
put
(
"value"
,
"noLicenses"
);
object
.
put
(
"label"
,
"无资质要求"
);
}
else
if
(
1
==
i
){
object
.
put
(
"key"
,
"overdue"
);
object
.
put
(
"value"
,
"overdue"
);
object
.
put
(
"label"
,
"资质超期"
);
}
else
if
(
2
==
i
){
object
.
put
(
"key"
,
"near"
);
object
.
put
(
"value"
,
"near"
);
object
.
put
(
"label"
,
"资质临期"
);
}
else
{
object
.
put
(
"key"
,
"normal"
);
object
.
put
(
"value"
,
"normal"
);
object
.
put
(
"label"
,
"正常"
);
}
permissionStatus
.
add
(
object
);
}
result
.
put
(
"expiryDate"
,
permissionStatus
);
//证书类型
List
<
DictionarieValueModel
>
certType
=
Systemctl
.
dictionarieClient
.
dictValues
(
"CERT_TYPE"
).
getResult
();
JSONArray
certTypeArray
=
new
JSONArray
();
for
(
int
i
=
0
;
i
<
certType
.
size
();
i
++){
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"key"
,
certType
.
get
(
i
).
getDictDataKey
());
object
.
put
(
"value"
,
certType
.
get
(
i
).
getDictDataKey
());
object
.
put
(
"label"
,
certType
.
get
(
i
).
getDictDataValue
());
certTypeArray
.
add
(
object
);
}
result
.
put
(
"certType"
,
certTypeArray
);
//证书级别
List
<
DictionarieValueModel
>
RYJB_JC
=
Systemctl
.
dictionarieClient
.
dictValues
(
"RYJB_JC"
).
getResult
();
List
<
DictionarieValueModel
>
RYJB_JY
=
Systemctl
.
dictionarieClient
.
dictValues
(
"RYJB_JY"
).
getResult
();
JSONArray
permissionLevelArray
=
new
JSONArray
();
for
(
int
i
=
0
;
i
<
RYJB_JC
.
size
();
i
++){
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"key"
,
RYJB_JC
.
get
(
i
).
getDictDataKey
());
object
.
put
(
"value"
,
RYJB_JC
.
get
(
i
).
getDictDataKey
());
object
.
put
(
"label"
,
RYJB_JC
.
get
(
i
).
getDictDataValue
());
permissionLevelArray
.
add
(
object
);
}
for
(
int
i
=
0
;
i
<
RYJB_JY
.
size
();
i
++){
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"key"
,
RYJB_JY
.
get
(
i
).
getDictDataKey
());
object
.
put
(
"value"
,
RYJB_JY
.
get
(
i
).
getDictDataKey
());
object
.
put
(
"label"
,
RYJB_JY
.
get
(
i
).
getDictDataValue
());
permissionLevelArray
.
add
(
object
);
}
result
.
put
(
"permissionLevel"
,
permissionLevelArray
);
//学历
result
.
put
(
"education"
,
deployDictionary
(
dataDictionaryService
.
getByType
(
"XLLX"
)));
//监管设备类型
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
);
//获取企业类型
result
.
put
(
"unitType"
,
UnitTypeEnum
.
getAll
());
return
result
;
}
...
...
@@ -800,9 +994,53 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
.
fluentPut
(
"time"
,
new
Date
().
getTime
()));
}
public
JSONArray
queryZZZT
()
{
JSONArray
array
=
new
JSONArray
();
public
JSONArray
queryZYXM
(
String
type
)
{
JSONArray
result
=
new
JSONArray
();
if
(
"特种设备安全管理和作业人员证"
.
equals
(
type
)){
List
<
DictionarieValueModel
>
certType
=
Systemctl
.
dictionarieClient
.
dictValues
(
"JOB_ITEM"
).
getResult
();
for
(
DictionarieValueModel
certTypeModel
:
certType
)
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"key"
,
certTypeModel
.
getDictDataKey
());
jsonObject
.
put
(
"value"
,
certTypeModel
.
getDictDataKey
());
jsonObject
.
put
(
"label"
,
certTypeModel
.
getDictDataValue
());
result
.
add
(
jsonObject
);
}
}
else
{
List
<
DictionarieValueModel
>
certType
=
Systemctl
.
dictionarieClient
.
dictValues
(
"ZZXM_"
+
type
).
getResult
();
for
(
DictionarieValueModel
certTypeModel
:
certType
)
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"key"
,
certTypeModel
.
getDictDataKey
());
jsonObject
.
put
(
"value"
,
certTypeModel
.
getDictDataKey
());
jsonObject
.
put
(
"label"
,
certTypeModel
.
getDictDataValue
());
result
.
add
(
jsonObject
);
}
}
return
result
;
}
public
JSONArray
queryUnitByOrgCode
(
String
orgCode
)
{
SearchRequest
searchRequest
=
new
SearchRequest
(
"idx_biz_enterprise_info"
);
SearchSourceBuilder
searchSourceBuilder
=
new
SearchSourceBuilder
();
BoolQueryBuilder
boolQueryBuilder
=
QueryBuilders
.
boolQuery
();
boolQueryBuilder
.
must
(
QueryBuilders
.
wildcardQuery
(
"superviseOrgCode.keyword"
,
QueryParser
.
escape
(
orgCode
)
+
"*"
));
searchSourceBuilder
.
query
(
boolQueryBuilder
);
searchRequest
.
source
(
searchSourceBuilder
);
return
null
;
JSONArray
result
=
new
JSONArray
();
try
{
SearchResponse
searchResponse
=
restHighLevelClient
.
search
(
searchRequest
,
RequestOptions
.
DEFAULT
);
for
(
org
.
elasticsearch
.
search
.
SearchHit
hit
:
searchResponse
.
getHits
().
getHits
())
{
JSONObject
jsonObject
=
((
JSONObject
)
JSONObject
.
toJSON
(
hit
)).
getJSONObject
(
"sourceAsMap"
);
JSONObject
dto
=
new
JSONObject
();
dto
.
put
(
"key"
,
jsonObject
.
getString
(
"useCode"
));
dto
.
put
(
"value"
,
jsonObject
.
getString
(
"useCode"
));
dto
.
put
(
"label"
,
jsonObject
.
getString
(
"useUnit"
));
result
.
add
(
dto
);
}
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
return
result
;
}
}
\ 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