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
56c916fd
Commit
56c916fd
authored
Aug 27, 2025
by
hcing
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register
parents
95028728
e40fd9a0
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
465 additions
and
84 deletions
+465
-84
JgChangeRegistrationUnitDto.java
...s/boot/module/jg/api/dto/JgChangeRegistrationUnitDto.java
+22
-0
JgChangeRegistrationUnit.java
...s/boot/module/jg/api/entity/JgChangeRegistrationUnit.java
+42
-1
DataDockController.java
...mos/boot/module/jg/biz/controller/DataDockController.java
+3
-2
IdxBizJqEquipmentRegisterController.java
...g/biz/controller/IdxBizJqEquipmentRegisterController.java
+1
-1
IIdxBizJgRegisterInfoService.java
...t/module/jg/biz/service/IIdxBizJgRegisterInfoService.java
+2
-1
DataDockServiceImpl.java
.../boot/module/jg/biz/service/impl/DataDockServiceImpl.java
+38
-1
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+73
-13
JgChangeRegistrationTransferServiceImpl.java
...service/impl/JgChangeRegistrationTransferServiceImpl.java
+24
-4
JgChangeRegistrationUnitServiceImpl.java
...biz/service/impl/JgChangeRegistrationUnitServiceImpl.java
+186
-22
JgEnableDisableServiceImpl.java
...odule/jg/biz/service/impl/JgEnableDisableServiceImpl.java
+24
-1
JgScrapCancelServiceImpl.java
.../module/jg/biz/service/impl/JgScrapCancelServiceImpl.java
+23
-1
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+27
-37
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/JgChangeRegistrationUnitDto.java
View file @
56c916fd
...
@@ -195,4 +195,26 @@ public class JgChangeRegistrationUnitDto extends BaseDto {
...
@@ -195,4 +195,26 @@ public class JgChangeRegistrationUnitDto extends BaseDto {
@ApiModelProperty
(
value
=
"接收机构公司的org_code"
)
@ApiModelProperty
(
value
=
"接收机构公司的org_code"
)
private
String
receiveCompanyOrgCode
;
private
String
receiveCompanyOrgCode
;
@ApiModelProperty
(
value
=
"设备移装完整详细地址"
)
private
String
fullAddress
;
@ApiModelProperty
(
value
=
"省"
)
private
String
province
;
@ApiModelProperty
(
value
=
"市"
)
private
String
city
;
@ApiModelProperty
(
value
=
"区县"
)
private
String
county
;
@ApiModelProperty
(
value
=
"街道"
)
private
String
street
;
@ApiModelProperty
(
value
=
"详细地址"
)
private
String
address
;
@ApiModelProperty
(
value
=
"属地监管部门"
)
private
String
orgBranchCode
;
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/entity/JgChangeRegistrationUnit.java
View file @
56c916fd
...
@@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
...
@@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.module.jg.api.common.BizCustomDateSerializer
;
import
com.yeejoin.amos.boot.module.jg.api.common.BizCustomDateSerializer
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
...
@@ -284,4 +283,46 @@ public class JgChangeRegistrationUnit extends BaseEntity {
...
@@ -284,4 +283,46 @@ public class JgChangeRegistrationUnit extends BaseEntity {
*/
*/
@TableField
(
"equ_list_code"
)
@TableField
(
"equ_list_code"
)
private
String
equListCode
;
private
String
equListCode
;
/**
* 设备移装完整详细地址
*/
@TableField
(
value
=
"full_address"
)
private
String
fullAddress
;
/**
* 省
*/
@TableField
(
value
=
"province"
)
private
String
province
;
/**
* 市
*/
@TableField
(
value
=
"city"
)
private
String
city
;
/**
* 区县
*/
@TableField
(
value
=
"county"
)
private
String
county
;
/**
* 街道
*/
@TableField
(
value
=
"street"
)
private
String
street
;
/**
* 详细地址
*/
@TableField
(
value
=
"address"
)
private
String
address
;
/**
* 属地监管部门
*/
@TableField
(
value
=
"org_branch_code"
)
private
String
orgBranchCode
;
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/DataDockController.java
View file @
56c916fd
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
controller
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.DataDockServiceImpl
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.DataDockServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -20,7 +21,7 @@ import java.util.Map;
...
@@ -20,7 +21,7 @@ import java.util.Map;
@RestController
@RestController
@Api
(
tags
=
"数据对接 API"
)
@Api
(
tags
=
"数据对接 API"
)
@RequestMapping
(
value
=
"/dataDock"
)
@RequestMapping
(
value
=
"/dataDock"
)
public
class
DataDockController
{
public
class
DataDockController
extends
BaseController
{
private
final
DataDockServiceImpl
dataDockService
;
private
final
DataDockServiceImpl
dataDockService
;
...
@@ -158,7 +159,7 @@ public class DataDockController {
...
@@ -158,7 +159,7 @@ public class DataDockController {
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"工业 、公用、长输管道批量保存"
,
notes
=
"工业 、公用、长输管道批量保存"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"工业 、公用、长输管道批量保存"
,
notes
=
"工业 、公用、长输管道批量保存"
)
@RestEventTrigger
(
value
=
"operateLogRestEventHandler"
)
@RestEventTrigger
(
value
=
"operateLogRestEventHandler"
)
public
ResponseModel
<?>
savePipingData
(
@RequestBody
Map
<
String
,
Object
>
paramMap
)
{
public
ResponseModel
<?>
savePipingData
(
@RequestBody
Map
<
String
,
Object
>
paramMap
)
{
return
ResponseHelper
.
buildResponse
(
dataDockService
.
savePipingData
(
paramMap
));
return
ResponseHelper
.
buildResponse
(
dataDockService
.
savePipingData
(
paramMap
,
getSelectedOrgInfo
().
getCompany
()
));
}
}
/**
/**
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/IdxBizJqEquipmentRegisterController.java
View file @
56c916fd
...
@@ -61,7 +61,7 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
...
@@ -61,7 +61,7 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
@RestEventTrigger
(
value
=
"operateLogRestEventHandler"
)
@RestEventTrigger
(
value
=
"operateLogRestEventHandler"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"设备注册和更新信息"
,
notes
=
"设备注册和更新信息"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"设备注册和更新信息"
,
notes
=
"设备注册和更新信息"
)
public
ResponseModel
<
Object
>
submit
(
@RequestBody
Map
<
String
,
Object
>
paramMap
)
{
public
ResponseModel
<
Object
>
submit
(
@RequestBody
Map
<
String
,
Object
>
paramMap
)
{
return
ResponseHelper
.
buildResponse
(
idxBizJgRegisterInfoService
.
equipmentRegisterSubmit
(
paramMap
));
return
ResponseHelper
.
buildResponse
(
idxBizJgRegisterInfoService
.
equipmentRegisterSubmit
(
paramMap
,
getSelectedOrgInfo
().
getCompany
()
));
}
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/IIdxBizJgRegisterInfoService.java
View file @
56c916fd
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.service;
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.service;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
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.bo.ReginParams
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
...
@@ -18,7 +19,7 @@ import java.util.Map;
...
@@ -18,7 +19,7 @@ import java.util.Map;
*/
*/
public
interface
IIdxBizJgRegisterInfoService
{
public
interface
IIdxBizJgRegisterInfoService
{
ResponseModel
equipmentRegisterSubmit
(
Map
<
String
,
Object
>
paramMap
);
ResponseModel
equipmentRegisterSubmit
(
Map
<
String
,
Object
>
paramMap
,
CompanyBo
company
);
boolean
batchDeleteByRecord
(
Map
<
String
,
Object
>
map
);
boolean
batchDeleteByRecord
(
Map
<
String
,
Object
>
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 @
56c916fd
...
@@ -161,6 +161,12 @@ public class DataDockServiceImpl {
...
@@ -161,6 +161,12 @@ public class DataDockServiceImpl {
private
final
IdxBizJgOtherInfoMapper
idxBizJgOtherInfoMapper
;
private
final
IdxBizJgOtherInfoMapper
idxBizJgOtherInfoMapper
;
private
final
IdxBizJgInspectionDetectionInfoMapper
idxBizJgInspectionDetectionInfoMapper
;
private
final
IdxBizJgInspectionDetectionInfoMapper
idxBizJgInspectionDetectionInfoMapper
;
@Value
(
"${equip.detail.path:/mixuap?appId=1742358052905971713&id=1734100233714954241&formType=detail&record=%s&DATA_SOURCE=%s}"
)
private
String
equipRoutePath
;
@Value
(
"${pipeline.detail.path:/mixuap?appId=1742358052905971713&id=1867406434120003586&formType=detail&sequenceNbr=%s}"
)
private
String
pipelineRoutePath
;
/**
/**
* 西安数据对接-保存设备信息
* 西安数据对接-保存设备信息
*
*
...
@@ -1583,6 +1589,7 @@ public class DataDockServiceImpl {
...
@@ -1583,6 +1589,7 @@ public class DataDockServiceImpl {
String
record
=
saveEquipmentDataInTransaction
(
equMap
,
dataSource
,
remark
);
String
record
=
saveEquipmentDataInTransaction
(
equMap
,
dataSource
,
remark
);
recordSet
.
add
(
record
);
recordSet
.
add
(
record
);
}
}
this
.
createResumeBatch
(
recordSet
,
dataSource
,
equipRoutePath
,
company
);
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
this
,
BusinessTypeEnum
.
JG_NEW_EQUIP
.
name
(),
BusinessTypeEnum
.
JG_NEW_EQUIP
.
name
(),
...
@@ -1591,6 +1598,21 @@ public class DataDockServiceImpl {
...
@@ -1591,6 +1598,21 @@ public class DataDockServiceImpl {
));
));
}
}
private
void
createResumeBatch
(
Set
<
String
>
records
,
String
dataSource
,
String
routePath
,
CompanyBo
company
)
{
jgResumeInfoService
.
saveBatchResume
(
records
.
stream
().
map
(
record
->
JgResumeInfoDto
.
builder
()
.
businessType
(
BusinessTypeEnum
.
JG_NEW_EQUIP
.
getName
())
.
businessId
(
record
)
.
equId
(
record
)
.
status
(
"正常"
)
.
approvalUnitCode
(
company
.
getCompanyCode
())
.
approvalUnit
(
company
.
getCompanyName
())
.
changeContent
(
BusinessTypeEnum
.
JG_NEW_EQUIP
.
getName
()
+
"业务办理"
)
.
routePath
(
String
.
format
(
routePath
,
record
,
dataSource
))
.
build
()).
collect
(
Collectors
.
toList
())
);
}
/**
/**
* 批量异步保存设备数据
* 批量异步保存设备数据
*
*
...
@@ -1770,7 +1792,7 @@ public class DataDockServiceImpl {
...
@@ -1770,7 +1792,7 @@ public class DataDockServiceImpl {
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Object
savePipingData
(
Map
<
String
,
Object
>
paramMap
)
{
public
Object
savePipingData
(
Map
<
String
,
Object
>
paramMap
,
CompanyBo
company
)
{
// 获取数据
// 获取数据
JSONObject
equipInfo
=
JSON
.
parseObject
(
toJSONString
(
paramMap
.
get
(
"equipInfo"
)),
JSONObject
.
class
);
JSONObject
equipInfo
=
JSON
.
parseObject
(
toJSONString
(
paramMap
.
get
(
"equipInfo"
)),
JSONObject
.
class
);
JSONObject
attachmentUpload
=
JSON
.
parseObject
(
toJSONString
(
paramMap
.
get
(
"attachmentUpload"
)),
JSONObject
.
class
);
JSONObject
attachmentUpload
=
JSON
.
parseObject
(
toJSONString
(
paramMap
.
get
(
"attachmentUpload"
)),
JSONObject
.
class
);
...
@@ -1836,10 +1858,25 @@ public class DataDockServiceImpl {
...
@@ -1836,10 +1858,25 @@ public class DataDockServiceImpl {
}
}
}
}
}
}
this
.
createResumePipeline
(
proCon
.
getSequenceNbr
(),
String
.
format
(
pipelineRoutePath
,
proCon
.
getSequenceNbr
()
+
""
),
company
);
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_PROJECT
.
name
(),
Sets
.
newHashSet
(
proCon
.
getSequenceNbr
()
+
""
),
EquipCreateOrEditEvent
.
EquipType
.
project
));
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_PROJECT
.
name
(),
Sets
.
newHashSet
(
proCon
.
getSequenceNbr
()
+
""
),
EquipCreateOrEditEvent
.
EquipType
.
project
));
return
Boolean
.
TRUE
;
return
Boolean
.
TRUE
;
}
}
private
void
createResumePipeline
(
Long
sequenceNbr
,
String
routePath
,
CompanyBo
company
)
{
jgResumeInfoService
.
saveBatchResume
(
Collections
.
singletonList
(
JgResumeInfoDto
.
builder
()
.
businessType
(
BusinessTypeEnum
.
JG_NEW_PROJECT
.
getName
())
.
businessId
(
sequenceNbr
+
""
)
.
equId
(
sequenceNbr
+
""
)
.
status
(
"正常"
)
.
approvalUnitCode
(
company
.
getCompanyCode
())
.
approvalUnit
(
company
.
getCompanyName
())
.
changeContent
(
BusinessTypeEnum
.
JG_NEW_PROJECT
.
getName
()
+
"业务办理"
)
.
routePath
(
routePath
)
.
build
())
);
}
public
void
saveCertChangeRecord
(
JgUseRegistration
useReg
,
JgUseRegistrationManage
regManage
,
List
<
String
>
records
,
EquipRequestParamsDto
paramsDto
)
{
public
void
saveCertChangeRecord
(
JgUseRegistration
useReg
,
JgUseRegistrationManage
regManage
,
List
<
String
>
records
,
EquipRequestParamsDto
paramsDto
)
{
Long
changeRecordId
=
sequence
.
nextId
();
Long
changeRecordId
=
sequence
.
nextId
();
JgCertificateChangeRecord
changeRecord
=
new
JgCertificateChangeRecord
()
JgCertificateChangeRecord
changeRecord
=
new
JgCertificateChangeRecord
()
...
...
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 @
56c916fd
...
@@ -336,6 +336,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -336,6 +336,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
@Value
(
"classpath:/json/urlInfo.json"
)
@Value
(
"classpath:/json/urlInfo.json"
)
private
Resource
urlInfo
;
private
Resource
urlInfo
;
@Value
(
"${equip.detail.path:/mixuap?appId=1742358052905971713&id=1734100233714954241&formType=detail&record=%s&DATA_SOURCE=%s}"
)
private
String
equipRoutePath
;
@Value
(
"${pipeline.detail.path:/mixuap?appId=1742358052905971713&id=1867406434120003586&formType=detail&sequenceNbr=%s}"
)
private
String
pipelineRoutePath
;
@Lazy
@Lazy
@Autowired
@Autowired
private
CommonServiceImpl
commonServiceImpl
;
private
CommonServiceImpl
commonServiceImpl
;
...
@@ -442,10 +448,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -442,10 +448,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
* 设备注册信息
* 设备注册信息
*
*
* @param paramMap
* @param paramMap
* @param company
* @return
* @return
*/
*/
@Transactional
@Transactional
public
ResponseModel
equipmentRegisterSubmit
(
Map
<
String
,
Object
>
paramMap
)
{
public
ResponseModel
equipmentRegisterSubmit
(
Map
<
String
,
Object
>
paramMap
,
CompanyBo
company
)
{
if
(
paramMap
==
null
)
{
if
(
paramMap
==
null
)
{
throw
new
IllegalArgumentException
(
"参数Map不能为空"
);
throw
new
IllegalArgumentException
(
"参数Map不能为空"
);
}
}
...
@@ -454,18 +461,18 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -454,18 +461,18 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
String
equListCode
=
(
String
)
equipmentInfoForm
.
get
(
EQU_LIST
);
String
equListCode
=
(
String
)
equipmentInfoForm
.
get
(
EQU_LIST
);
//管道添加设备
//管道添加设备
if
(
PipelineEnum
.
PRESSURE_PIPELINE
.
getCode
().
equals
(
equListCode
))
{
if
(
PipelineEnum
.
PRESSURE_PIPELINE
.
getCode
().
equals
(
equListCode
))
{
ResponseModel
responseModel
=
this
.
pipelineEquipCreateOrUpdate
(
paramMap
);
ResponseModel
responseModel
=
this
.
pipelineEquipCreateOrUpdate
(
paramMap
,
company
);
Long
projectContraptionId
=
(
Long
)
responseModel
.
getResult
();
Long
projectContraptionId
=
(
Long
)
responseModel
.
getResult
();
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_PROJECT
.
name
(),
Sets
.
newHashSet
(
projectContraptionId
.
toString
()),
EquipCreateOrEditEvent
.
EquipType
.
project
));
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_PROJECT
.
name
(),
Sets
.
newHashSet
(
projectContraptionId
.
toString
()),
EquipCreateOrEditEvent
.
EquipType
.
project
));
return
responseModel
;
return
responseModel
;
}
}
if
(
dataSource
.
contains
(
"black"
)){
if
(
dataSource
.
contains
(
"black"
)){
ResponseModel
responseModel
=
this
.
blackEquipCreateOrUpdate
(
paramMap
);
ResponseModel
responseModel
=
this
.
blackEquipCreateOrUpdate
(
paramMap
,
company
);
String
record
=
(
String
)
responseModel
.
getResult
();
String
record
=
(
String
)
responseModel
.
getResult
();
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_EQUIP
.
name
(),
Sets
.
newHashSet
(
record
),
EquipCreateOrEditEvent
.
EquipType
.
equip
));
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_EQUIP
.
name
(),
Sets
.
newHashSet
(
record
),
EquipCreateOrEditEvent
.
EquipType
.
equip
));
return
responseModel
;
return
responseModel
;
}
else
{
}
else
{
ResponseModel
responseModel
=
this
.
otherEquipCreateOrUpdate
(
paramMap
);
ResponseModel
responseModel
=
this
.
otherEquipCreateOrUpdate
(
paramMap
,
company
);
String
record
=
(
String
)
responseModel
.
getResult
();
String
record
=
(
String
)
responseModel
.
getResult
();
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_EQUIP
.
name
(),
Sets
.
newHashSet
(
record
),
EquipCreateOrEditEvent
.
EquipType
.
equip
));
eventPublisher
.
publish
(
new
EquipCreateOrEditEvent
(
this
,
BusinessTypeEnum
.
JG_NEW_EQUIP
.
name
(),
Sets
.
newHashSet
(
record
),
EquipCreateOrEditEvent
.
EquipType
.
equip
));
return
responseModel
;
return
responseModel
;
...
@@ -477,14 +484,15 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -477,14 +484,15 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
* 管道设备新增或更新
* 管道设备新增或更新
*
*
* @param paramMap 前端参数
* @param paramMap 前端参数
* @param company
* @return record
* @return record
*/
*/
private
ResponseModel
pipelineEquipCreateOrUpdate
(
Map
<
String
,
Object
>
paramMap
)
{
private
ResponseModel
pipelineEquipCreateOrUpdate
(
Map
<
String
,
Object
>
paramMap
,
CompanyBo
company
)
{
try
{
try
{
// 获取表单数据并进行类型检查
// 获取表单数据并进行类型检查
LinkedHashMap
equipmentInfoForm
=
castToLinkedHashMap
(
paramMap
.
get
(
EQUIP_INFO_FORM_ID
));
LinkedHashMap
equipmentInfoForm
=
castToLinkedHashMap
(
paramMap
.
get
(
EQUIP_INFO_FORM_ID
));
String
submitType
=
String
.
valueOf
(
paramMap
.
get
(
"submitType"
));
String
submitType
=
String
.
valueOf
(
paramMap
.
get
(
"submitType"
));
return
ResponseHelper
.
buildResponse
(
batchSubmitOrUpdatePipeline
(
equipmentInfoForm
,
submitType
));
return
ResponseHelper
.
buildResponse
(
batchSubmitOrUpdatePipeline
(
equipmentInfoForm
,
submitType
,
company
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"操作失败,数据异常: {}"
,
e
.
getMessage
(),
e
);
log
.
error
(
"操作失败,数据异常: {}"
,
e
.
getMessage
(),
e
);
handleError
(
e
,
String
.
valueOf
(
paramMap
.
getOrDefault
(
SEQUENCE_NBR
,
""
)));
handleError
(
e
,
String
.
valueOf
(
paramMap
.
getOrDefault
(
SEQUENCE_NBR
,
""
)));
...
@@ -512,7 +520,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -512,7 +520,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
return
new
ArrayList
<>(
15
);
return
new
ArrayList
<>(
15
);
}
}
private
Long
batchSubmitOrUpdatePipeline
(
LinkedHashMap
equipmentInfoForm
,
String
submitType
)
{
private
Long
batchSubmitOrUpdatePipeline
(
LinkedHashMap
equipmentInfoForm
,
String
submitType
,
CompanyBo
company
)
{
Date
date
=
new
Date
();
Date
date
=
new
Date
();
String
operateType
=
ValidationUtil
.
isEmpty
(
equipmentInfoForm
.
get
(
SEQUENCE_NBR
))
?
OPERATESAVE
:
OPERATEEDIT
;
String
operateType
=
ValidationUtil
.
isEmpty
(
equipmentInfoForm
.
get
(
SEQUENCE_NBR
))
?
OPERATESAVE
:
OPERATEEDIT
;
// 设备是否复制而来,复制来的设备走新增
// 设备是否复制而来,复制来的设备走新增
...
@@ -821,15 +829,33 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -821,15 +829,33 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
iIdxBizJgDesignInfoService
.
saveOrUpdateBatch
(
designInfoList
);
iIdxBizJgDesignInfoService
.
saveOrUpdateBatch
(
designInfoList
);
iIdxBizJgConstructionInfoService
.
saveOrUpdateBatch
(
constructionInfoList
);
iIdxBizJgConstructionInfoService
.
saveOrUpdateBatch
(
constructionInfoList
);
iIdxBizJgFactoryInfoService
.
saveOrUpdateBatch
(
factoryInfoList
);
iIdxBizJgFactoryInfoService
.
saveOrUpdateBatch
(
factoryInfoList
);
this
.
saveOrUpdateBatch
(
registerInfoList
);
super
.
saveOrUpdateBatch
(
registerInfoList
);
iIdxBizJgOtherInfoService
.
saveOrUpdateBatch
(
otherInfoList
);
iIdxBizJgOtherInfoService
.
saveOrUpdateBatch
(
otherInfoList
);
iIdxBizJgSupervisionInfoService
.
saveOrUpdateBatch
(
supervisionInfoList
);
iIdxBizJgSupervisionInfoService
.
saveOrUpdateBatch
(
supervisionInfoList
);
iIdxBizJgInspectionDetectionInfoService
.
saveOrUpdateBatch
(
inspectionDetectionInfoList
);
iIdxBizJgInspectionDetectionInfoService
.
saveOrUpdateBatch
(
inspectionDetectionInfoList
);
iIdxBizJgTechParamsPipelineService
.
saveOrUpdateBatch
(
paramsPipelineList
);
iIdxBizJgTechParamsPipelineService
.
saveOrUpdateBatch
(
paramsPipelineList
);
esEquipmentCategory
.
saveAll
(
esEquipmentCategoryList
);
esEquipmentCategory
.
saveAll
(
esEquipmentCategoryList
);
if
(
OPERATESAVE
.
equals
(
operateType
)){
// 记录设备创建履历
this
.
createResumePipeline
(
sequenceNbr
,
String
.
format
(
pipelineRoutePath
,
sequenceNbr
+
""
),
company
);
}
return
sequenceNbr
;
return
sequenceNbr
;
}
}
private
void
createResumePipeline
(
Long
sequenceNbr
,
String
routePath
,
CompanyBo
company
)
{
jgResumeInfoService
.
saveBatchResume
(
Collections
.
singletonList
(
JgResumeInfoDto
.
builder
()
.
businessType
(
BusinessTypeEnum
.
JG_NEW_PROJECT
.
getName
())
.
businessId
(
sequenceNbr
+
""
)
.
equId
(
sequenceNbr
+
""
)
.
status
(
"正常"
)
.
approvalUnitCode
(
company
.
getCompanyCode
())
.
approvalUnit
(
company
.
getCompanyName
())
.
changeContent
(
BusinessTypeEnum
.
JG_NEW_PROJECT
.
getName
()
+
"业务办理"
)
.
routePath
(
routePath
)
.
build
())
);
}
/**
/**
* 根据code获取市区县名字
* 根据code获取市区县名字
* @param key key
* @param key key
...
@@ -847,7 +873,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -847,7 +873,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.
orElse
(
""
);
.
orElse
(
""
);
}
}
private
ResponseModel
blackEquipCreateOrUpdate
(
Map
<
String
,
Object
>
paramMap
)
{
private
ResponseModel
blackEquipCreateOrUpdate
(
Map
<
String
,
Object
>
paramMap
,
CompanyBo
company
)
{
LinkedHashMap
equipmentClassForm
=
(
LinkedHashMap
)
checkAndCast
(
paramMap
.
get
(
EQUIP_CLASS_FORM_ID
));
LinkedHashMap
equipmentClassForm
=
(
LinkedHashMap
)
checkAndCast
(
paramMap
.
get
(
EQUIP_CLASS_FORM_ID
));
LinkedHashMap
equipmentInfoForm
=
(
LinkedHashMap
)
checkAndCast
(
paramMap
.
get
(
EQUIP_INFO_FORM_ID
));
LinkedHashMap
equipmentInfoForm
=
(
LinkedHashMap
)
checkAndCast
(
paramMap
.
get
(
EQUIP_INFO_FORM_ID
));
LinkedHashMap
equipmentParamsForm
=
(
LinkedHashMap
)
checkAndCast
(
paramMap
.
get
(
EQUIP_PARAMS_FORM_ID
));
LinkedHashMap
equipmentParamsForm
=
(
LinkedHashMap
)
checkAndCast
(
paramMap
.
get
(
EQUIP_PARAMS_FORM_ID
));
...
@@ -866,7 +892,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -866,7 +892,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 操作类型
// 操作类型
try
{
try
{
// 保存数据
// 保存数据
record
=
batchSubmitOrUpdate
(
equipmentClassForm
,
equipmentInfoForm
,
equipmentParamsForm
,
submitType
);
record
=
batchSubmitOrUpdate
(
equipmentClassForm
,
equipmentInfoForm
,
equipmentParamsForm
,
submitType
,
company
);
// 保存Es数据
// 保存Es数据
if
(!
ObjectUtils
.
isEmpty
(
record
))
{
if
(!
ObjectUtils
.
isEmpty
(
record
))
{
checkEsData
(
record
);
checkEsData
(
record
);
...
@@ -878,7 +904,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -878,7 +904,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
return
ResponseHelper
.
buildResponse
(
record
);
return
ResponseHelper
.
buildResponse
(
record
);
}
}
private
ResponseModel
otherEquipCreateOrUpdate
(
Map
<
String
,
Object
>
paramMap
)
{
private
ResponseModel
otherEquipCreateOrUpdate
(
Map
<
String
,
Object
>
paramMap
,
CompanyBo
company
)
{
if
(
paramMap
==
null
)
{
if
(
paramMap
==
null
)
{
throw
new
IllegalArgumentException
(
"参数Map不能为空"
);
throw
new
IllegalArgumentException
(
"参数Map不能为空"
);
}
}
...
@@ -922,7 +948,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -922,7 +948,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 操作类型
// 操作类型
try
{
try
{
// 保存数据
// 保存数据
record
=
batchSubmitOrUpdate
(
equipmentClassForm
,
equipmentInfoForm
,
equipmentParamsForm
,
submitType
);
record
=
batchSubmitOrUpdate
(
equipmentClassForm
,
equipmentInfoForm
,
equipmentParamsForm
,
submitType
,
company
);
// 保存Es数据
// 保存Es数据
if
(!
ObjectUtils
.
isEmpty
(
record
))
{
if
(!
ObjectUtils
.
isEmpty
(
record
))
{
checkEsData
(
record
);
checkEsData
(
record
);
...
@@ -3446,7 +3472,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -3446,7 +3472,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
return
""
;
return
""
;
}
}
private
String
batchSubmitOrUpdate
(
LinkedHashMap
equipmentClassForm
,
LinkedHashMap
equipmentInfoForm
,
LinkedHashMap
equipmentParamsForm
,
String
submitType
)
{
private
String
batchSubmitOrUpdate
(
LinkedHashMap
equipmentClassForm
,
LinkedHashMap
equipmentInfoForm
,
LinkedHashMap
equipmentParamsForm
,
String
submitType
,
CompanyBo
company
)
{
Date
date
=
new
Date
();
Date
date
=
new
Date
();
String
record
=
null
;
String
record
=
null
;
...
@@ -3669,9 +3695,27 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -3669,9 +3695,27 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
iIdxBizJgOtherInfoService
.
saveOrUpdateData
(
otherInfo
);
iIdxBizJgOtherInfoService
.
saveOrUpdateData
(
otherInfo
);
// 保存或者更新设备技术参数
// 保存或者更新设备技术参数
this
.
saveOrUpdateEquParams
(
equipmentInfoForm
,
equipmentParamsForm
,
equList
,
record
,
date
,
operateType
);
this
.
saveOrUpdateEquParams
(
equipmentInfoForm
,
equipmentParamsForm
,
equList
,
record
,
date
,
operateType
);
if
(
OPERATESAVE
.
equals
(
operateType
)){
// 记录设备创建履历
this
.
createResume
(
record
,
String
.
format
(
equipRoutePath
,
record
,
useInfo
.
getDataSource
()),
company
);
}
return
record
;
return
record
;
}
}
private
void
createResume
(
String
record
,
String
routePath
,
CompanyBo
company
)
{
jgResumeInfoService
.
saveBatchResume
(
Collections
.
singletonList
(
JgResumeInfoDto
.
builder
()
.
businessType
(
BusinessTypeEnum
.
JG_NEW_EQUIP
.
getName
())
.
businessId
(
record
)
.
equId
(
record
)
.
status
(
"正常"
)
.
approvalUnitCode
(
company
.
getCompanyCode
())
.
approvalUnit
(
company
.
getCompanyName
())
.
changeContent
(
BusinessTypeEnum
.
JG_NEW_EQUIP
.
getName
()
+
"业务办理"
)
.
routePath
(
routePath
)
.
build
())
);
}
/**
/**
* 保存或者更新设备技术参数
* 保存或者更新设备技术参数
* @param equipmentInfoForm
* @param equipmentInfoForm
...
@@ -4478,6 +4522,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -4478,6 +4522,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.
put
(
"nextInspectDate"
,
nextInspectDateStr
)
.
put
(
"nextInspectDate"
,
nextInspectDateStr
)
.
put
(
"useInnerCode"
,
useInfo
.
getUseInnerCode
())
.
put
(
"useInnerCode"
,
useInfo
.
getUseInnerCode
())
.
put
(
"informationSituation"
,
data
.
getInformationSituation
())
.
put
(
"informationSituation"
,
data
.
getInformationSituation
())
.
put
(
"dataSource"
,
useInfo
.
getDataSource
())
.
build
();
.
build
();
equipmentLists
.
add
(
equipMap
);
equipmentLists
.
add
(
equipMap
);
});
});
...
@@ -4567,6 +4612,21 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -4567,6 +4612,21 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.
build
())
.
build
())
.
collect
(
Collectors
.
toList
())
.
collect
(
Collectors
.
toList
())
);
);
}
else
{
jgResumeInfoService
.
saveBatchResume
(
equipmentLists
.
stream
()
.
map
(
equipId
->
JgResumeInfoDto
.
builder
()
.
businessType
(
BusinessTypeEnum
.
JG_NEW_EQUIP
.
getName
())
.
businessId
(
String
.
valueOf
(
equipId
.
get
(
"record"
)))
.
equId
(
String
.
valueOf
(
equipId
.
get
(
"record"
)))
.
approvalUnit
(
reginParams
.
getCompany
().
getCompanyName
())
.
approvalUnitCode
(
reginParams
.
getCompany
().
getCompanyCode
())
.
status
(
"正常"
)
.
changeContent
(
BusinessTypeEnum
.
JG_NEW_EQUIP
.
getName
()
+
"业务办理"
)
.
routePath
(
String
.
format
(
equipRoutePath
,
equipId
.
get
(
"record"
),
equipId
.
get
(
"dataSource"
)))
.
build
())
.
collect
(
Collectors
.
toList
())
);
}
}
List
<
CompletableFuture
<
Void
>>
futures
=
new
ArrayList
<>();
List
<
CompletableFuture
<
Void
>>
futures
=
new
ArrayList
<>();
futures
.
add
(
CompletableFuture
.
runAsync
(()
->
futures
.
add
(
CompletableFuture
.
runAsync
(()
->
...
...
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/JgChangeRegistrationTransferServiceImpl.java
View file @
56c916fd
...
@@ -87,8 +87,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
...
@@ -87,8 +87,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
private
static
final
String
PROCESS_DEFINITION_KEY
=
"changeRegistrationTransfer"
;
private
static
final
String
PROCESS_DEFINITION_KEY
=
"changeRegistrationTransfer"
;
private
static
final
String
TABLE_PAGE_ID
=
"changeRegistrationTransfer"
;
private
static
final
String
TABLE_PAGE_ID
=
"changeRegistrationTransfer"
;
private
final
List
<
String
>
NOT_FLOWING_STATE
=
Arrays
.
asList
(
"使用单位待提交"
,
"一级受理已驳回"
,
"使用单位已撤回"
,
"已作废"
,
"已完成"
);
private
final
List
<
String
>
NOT_FLOWING_STATE
=
Arrays
.
asList
(
"使用单位待提交"
,
"一级受理已驳回"
,
"使用单位已撤回"
,
"已作废"
,
"已完成"
);
@Autowired
RestHighLevelClient
restHighLevelClient
;
@Autowired
@Autowired
RedisUtils
redisUtils
;
RedisUtils
redisUtils
;
@Autowired
@Autowired
...
@@ -121,8 +120,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
...
@@ -121,8 +120,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
private
JgChangeRegistrationUnitEqMapper
jgChangeRegistrationUnitEqMapper
;
private
JgChangeRegistrationUnitEqMapper
jgChangeRegistrationUnitEqMapper
;
@Autowired
@Autowired
private
JgChangeRegistrationNameEqMapper
jgChangeRegistrationNameEqMapper
;
private
JgChangeRegistrationNameEqMapper
jgChangeRegistrationNameEqMapper
;
@Autowired
private
IdxBizJgOtherInfoMapper
idxBizJgOtherInfoMapper
;
@Autowired
@Autowired
private
IdxBizJgRegisterInfoMapper
idxBizJgRegisterInfoMapper
;
private
IdxBizJgRegisterInfoMapper
idxBizJgRegisterInfoMapper
;
@Autowired
@Autowired
...
@@ -150,6 +148,9 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
...
@@ -150,6 +148,9 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
@Autowired
@Autowired
private
JgVehicleInformationMapper
jgVehicleInformationMapper
;
private
JgVehicleInformationMapper
jgVehicleInformationMapper
;
@Autowired
JgResumeInfoServiceImpl
jgResumeInfoService
;
/**
/**
* 新增移装变更登记
* 新增移装变更登记
*
*
...
@@ -848,12 +849,31 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
...
@@ -848,12 +849,31 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
this
.
saveChangeRecord
(
jgChangeRegistrationTransfer
,
taskV2Model
);
this
.
saveChangeRecord
(
jgChangeRegistrationTransfer
,
taskV2Model
);
// 事务提交后发送数据刷新消息
// 事务提交后发送数据刷新消息
this
.
sendDataRefreshMsg
(
jgChangeRegistrationTransfer
);
this
.
sendDataRefreshMsg
(
jgChangeRegistrationTransfer
);
// 创建设备履历
this
.
createResume
(
jgChangeRegistrationTransfer
,
taskV2Model
.
getRoutePath
());
}
}
// redis流程实时数据更新
// redis流程实时数据更新
commonServiceImpl
.
saveExecuteFlowData2Redis
(
instanceId
,
this
.
buildInstanceRuntimeData
(
jgChangeRegistrationTransfer
));
commonServiceImpl
.
saveExecuteFlowData2Redis
(
instanceId
,
this
.
buildInstanceRuntimeData
(
jgChangeRegistrationTransfer
));
this
.
getBaseMapper
().
updateById
(
jgChangeRegistrationTransfer
);
this
.
getBaseMapper
().
updateById
(
jgChangeRegistrationTransfer
);
}
}
private
void
createResume
(
JgChangeRegistrationTransfer
jgChangeRegistrationTransfer
,
String
routePath
)
{
LambdaQueryWrapper
<
JgChangeRegistrationTransferEq
>
lambda
=
new
QueryWrapper
<
JgChangeRegistrationTransferEq
>().
lambda
();
lambda
.
eq
(
JgChangeRegistrationTransferEq:
:
getEquipTransferId
,
jgChangeRegistrationTransfer
.
getSequenceNbr
());
List
<
JgChangeRegistrationTransferEq
>
changeRegistrationTransferEqs
=
jgChangeRegistrationTransferEqService
.
getBaseMapper
().
selectList
(
lambda
);
jgResumeInfoService
.
saveBatchResume
(
changeRegistrationTransferEqs
.
stream
().
map
(
eq
->
JgResumeInfoDto
.
builder
().
applyNo
(
jgChangeRegistrationTransfer
.
getApplyNo
())
.
businessType
(
BusinessTypeEnum
.
JG_CHANGE_REGISTRATION
.
getName
())
.
businessId
(
String
.
valueOf
(
jgChangeRegistrationTransfer
.
getSequenceNbr
()))
.
equId
(
eq
.
getEquId
())
.
approvalUnit
(
jgChangeRegistrationTransfer
.
getReceiveOrgName
())
.
approvalUnitCode
(
jgChangeRegistrationTransfer
.
getReceiveCompanyCode
())
.
status
(
"正常"
)
.
changeContent
(
BusinessTypeEnum
.
JG_CHANGE_REGISTRATION
.
getName
()
+
"业务办理"
)
.
routePath
(
routePath
)
.
build
()).
collect
(
Collectors
.
toList
())
);
}
private
void
sendDataRefreshMsg
(
JgChangeRegistrationTransfer
jgChangeRegistrationTransfer
)
{
private
void
sendDataRefreshMsg
(
JgChangeRegistrationTransfer
jgChangeRegistrationTransfer
)
{
LambdaQueryWrapper
<
JgChangeRegistrationTransferEq
>
lambda
=
new
QueryWrapper
<
JgChangeRegistrationTransferEq
>().
lambda
();
LambdaQueryWrapper
<
JgChangeRegistrationTransferEq
>
lambda
=
new
QueryWrapper
<
JgChangeRegistrationTransferEq
>().
lambda
();
lambda
.
eq
(
JgChangeRegistrationTransferEq:
:
getEquipTransferId
,
jgChangeRegistrationTransfer
.
getSequenceNbr
());
lambda
.
eq
(
JgChangeRegistrationTransferEq:
:
getEquipTransferId
,
jgChangeRegistrationTransfer
.
getSequenceNbr
());
...
...
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 @
56c916fd
...
@@ -65,6 +65,7 @@ import java.time.format.DateTimeFormatter;
...
@@ -65,6 +65,7 @@ import java.time.format.DateTimeFormatter;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
.
JgUseRegistrationServiceImpl
.
getAuditPassedDate
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
.
JgUseRegistrationServiceImpl
.
getAuditPassedDate
;
...
@@ -189,6 +190,9 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -189,6 +190,9 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
@Autowired
@Autowired
private
EventPublisher
eventPublisher
;
private
EventPublisher
eventPublisher
;
@Autowired
private
JgResumeInfoServiceImpl
jgResumeInfoService
;
/**
/**
* 根据sequenceNbr查询:1、查询单位变更信息,2、查询使用登记证列表
* 根据sequenceNbr查询:1、查询单位变更信息,2、查询使用登记证列表
*
*
...
@@ -785,6 +789,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -785,6 +789,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
JgChangeRegistrationUnitDto
>
saveNotice
(
String
submitType
,
JSONObject
map
,
ReginParams
reginParams
)
{
public
List
<
JgChangeRegistrationUnitDto
>
saveNotice
(
String
submitType
,
JSONObject
map
,
ReginParams
reginParams
)
{
JgChangeRegistrationUnitDto
model
=
BeanUtil
.
toBeanIgnoreError
(
map
.
get
(
"changeRegisInfo"
),
JgChangeRegistrationUnitDto
.
class
);
JgChangeRegistrationUnitDto
model
=
BeanUtil
.
toBeanIgnoreError
(
map
.
get
(
"changeRegisInfo"
),
JgChangeRegistrationUnitDto
.
class
);
Map
<
String
,
Object
>
tableData
=
(
Map
<
String
,
Object
>)
map
.
get
(
"changeRegisInfo"
);
String
[]
taskName
=
new
String
[]{
"流程结束"
};
String
[]
taskName
=
new
String
[]{
"流程结束"
};
// 字段转换
// 字段转换
convertField
(
model
);
convertField
(
model
);
...
@@ -810,19 +815,17 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -810,19 +815,17 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
}
List
<
JSONObject
>
deviceList
=
registrationManageService
.
queryEquByCertificateSeqList
(
registrationIdList
);
List
<
JSONObject
>
deviceList
=
registrationManageService
.
queryEquByCertificateSeqList
(
registrationIdList
);
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
CompanyBo
company
=
reginParams
.
getCompany
();
deviceList
.
forEach
(
jsonObject
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
.
equipRepeatUsedCheck
(
String
.
valueOf
(
jsonObject
.
get
(
"SEQUENCE_NBR"
)),
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
())
?
company
.
getCompanyCode
().
split
(
"_"
)[
1
]
:
company
.
getCompanyCode
()));
}
// 获取单位变更设备列表
// 获取单位变更设备列表
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
throw
new
BadRequest
(
"使用登记证下无设备"
);
throw
new
BadRequest
(
"使用登记证下无设备"
);
}
}
//场车区分区外还是区内
if
(
"5000"
.
equals
(
model
.
getEquListCode
()))
{
String
city
=
Objects
.
toString
(
tableData
.
get
(
"city"
),
""
);
String
userCity
=
Optional
.
ofNullable
(
city
).
map
(
c
->
c
.
split
(
"_"
)[
0
]).
orElseThrow
(()
->
new
BadRequest
(
"请选择地市后暂存!"
));
this
.
validateDeviceCity
(
deviceList
,
userCity
,
"0"
.
equals
(
tableData
.
get
(
"changeType"
)));
}
// 获取单位变更单号
// 获取单位变更单号
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
DWBG
.
getCode
(),
1
);
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
DWBG
.
getCode
(),
1
);
...
@@ -831,6 +834,15 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -831,6 +834,15 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
log
.
error
(
"生成申请变更单位编码失败"
);
log
.
error
(
"生成申请变更单位编码失败"
);
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
CompanyBo
company
=
reginParams
.
getCompany
();
deviceList
.
forEach
(
jsonObject
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
PROCESS_DEFINITION_KEY
)
.
equipRepeatUsedCheck
(
String
.
valueOf
(
jsonObject
.
get
(
"SEQUENCE_NBR"
)),
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
())
?
company
.
getCompanyCode
().
split
(
"_"
)[
1
]
:
company
.
getCompanyCode
()));
}
ArrayList
<
String
>
roleListFirst
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListFirst
=
new
ArrayList
<>();
List
<
String
>
instanceIdList
=
new
ArrayList
<>();
List
<
String
>
instanceIdList
=
new
ArrayList
<>();
List
<
String
>
nextExecutorUserIds
=
new
ArrayList
<>();
List
<
String
>
nextExecutorUserIds
=
new
ArrayList
<>();
...
@@ -888,6 +900,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -888,6 +900,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
model
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
model
.
setCreateUserName
(
reginParams
.
getUserModel
().
getRealName
());
model
.
setUseRegistCode
(
String
.
join
(
","
,
registrationNoList
));
model
.
setUseRegistCode
(
String
.
join
(
","
,
registrationNoList
));
model
.
setEquList
(
registrationList
.
get
(
0
).
get
(
"equList"
).
toString
());
model
.
setEquList
(
registrationList
.
get
(
0
).
get
(
"equList"
).
toString
());
this
.
setFullAddress
(
tableData
,
model
);
JgChangeRegistrationUnit
registrationUnit
=
new
JgChangeRegistrationUnit
();
JgChangeRegistrationUnit
registrationUnit
=
new
JgChangeRegistrationUnit
();
BeanUtils
.
copyProperties
(
model
,
registrationUnit
);
BeanUtils
.
copyProperties
(
model
,
registrationUnit
);
setNewUnitInfo
(
reginParams
,
registrationUnit
);
setNewUnitInfo
(
reginParams
,
registrationUnit
);
...
@@ -970,6 +983,60 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -970,6 +983,60 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
return
Collections
.
singletonList
(
model
);
return
Collections
.
singletonList
(
model
);
}
}
public
void
setFullAddress
(
Map
<
String
,
Object
>
tableData
,
JgChangeRegistrationUnitDto
model
)
{
tableData
.
put
(
"region"
,
tableData
.
get
(
"county"
));
String
fullAddress
=
Stream
.
of
(
"province"
,
"city"
,
"region"
,
"street"
)
.
map
(
key
->
getRegionName
(
key
,
tableData
))
.
filter
(
s
->
!
s
.
isEmpty
())
.
collect
(
Collectors
.
joining
())
+
Objects
.
toString
(
tableData
.
get
(
"changeAddress"
),
""
);
model
.
setFullAddress
(
fullAddress
);
model
.
setAddress
(
Objects
.
toString
(
tableData
.
get
(
"changeAddress"
),
""
));
}
/**
* 根据code获取市区县名字
*
* @param codeKey codeKey
* @return name
*/
private
String
getRegionName
(
String
codeKey
,
Map
<
String
,
Object
>
tableData
)
{
List
<
LinkedHashMap
<
String
,
Object
>>
regions
=
(
List
<
LinkedHashMap
<
String
,
Object
>>)
redisUtils
.
get
(
codeKey
.
toUpperCase
());
return
regions
.
stream
()
.
filter
(
item
->
String
.
valueOf
(
item
.
get
(
"regionCode"
)).
equals
(
String
.
valueOf
(
tableData
.
get
(
codeKey
))))
.
map
(
item
->
(
String
)
item
.
get
(
"regionName"
))
.
collect
(
Collectors
.
joining
(
""
));
}
// 获取设备的地市编码
private
String
getDeviceCity
(
Map
<
String
,
Object
>
device
)
{
Object
usePlaceCodeObj
=
device
.
get
(
"USE_PLACE_CODE"
);
if
(
usePlaceCodeObj
==
null
)
{
throw
new
BadRequest
(
"没有查询到地市信息"
);
}
String
[]
parts
=
((
String
)
usePlaceCodeObj
).
split
(
"#"
);
if
(
parts
.
length
<
2
||
parts
[
1
]
==
null
||
parts
[
1
].
isEmpty
())
{
throw
new
BadRequest
(
"没有查询到地市信息"
);
}
return
parts
[
1
];
}
// 校验设备地市
private
void
validateDeviceCity
(
List
<
JSONObject
>
deviceList
,
String
userCity
,
boolean
isIntraDistrictChange
)
{
for
(
Map
<
String
,
Object
>
device
:
deviceList
)
{
String
deviceCity
=
getDeviceCity
(
device
);
if
(
isIntraDistrictChange
&&
!
userCity
.
equals
(
deviceCity
))
{
throw
new
BadRequest
(
"区内变更只能选择与设备地址中相同地市!"
);
}
if
(!
isIntraDistrictChange
&&
userCity
.
equals
(
deviceCity
))
{
throw
new
BadRequest
(
"区外变更只能选择与设备地址中不同地市!"
);
}
}
}
public
boolean
canConvertToLong
(
String
str
)
{
public
boolean
canConvertToLong
(
String
str
)
{
try
{
try
{
Long
.
parseLong
(
str
);
Long
.
parseLong
(
str
);
...
@@ -1220,7 +1287,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1220,7 +1287,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
.
stream
()
.
stream
()
.
map
(
IdxBizJgRegisterInfo:
:
getRecord
)
.
map
(
IdxBizJgRegisterInfo:
:
getRecord
)
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
if
(!
records
.
isEmpty
()
&&
enterpriseInfo
!=
null
)
{
if
(!
records
.
isEmpty
()
&&
enterpriseInfo
!=
null
)
{
idxBizJgUseInfoService
.
update
(
idxBizJgUseInfoService
.
update
(
new
IdxBizJgUseInfo
()
new
IdxBizJgUseInfo
()
.
setEstateUnitCreditCode
(
enterpriseInfo
.
getUseUnitCode
())
.
setEstateUnitCreditCode
(
enterpriseInfo
.
getUseUnitCode
())
...
@@ -1231,13 +1298,13 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1231,13 +1298,13 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
);
);
}
}
//场车更新车牌号
//场车更新车牌号
if
(
"5000"
.
equals
(
dto
.
getEquListCode
())
&&
newCarNumber
!=
null
&&
!
"null"
.
equals
(
newCarNumber
)
&&
useCode
!=
null
){
if
(
"5000"
.
equals
(
dto
.
getEquListCode
())
&&
newCarNumber
!=
null
&&
!
"null"
.
equals
(
newCarNumber
)
&&
useCode
!=
null
)
{
idxBizJgRegisterInfoService
.
update
(
new
IdxBizJgRegisterInfo
().
setCarNumber
(
newCarNumber
),
idxBizJgRegisterInfoService
.
update
(
new
IdxBizJgRegisterInfo
().
setCarNumber
(
newCarNumber
),
new
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>().
in
(
IdxBizJgRegisterInfo:
:
getUseOrgCode
,
useCode
)
new
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>().
in
(
IdxBizJgRegisterInfo:
:
getUseOrgCode
,
useCode
)
);
);
}
}
});
});
Map
<
String
,
String
>
seqToEquId
=
new
HashMap
<>();
for
(
JgChangeRegistrationUnitEq
jgChangeRegistrationUnitEq
:
jgChangeRegistrationUnitEqs
)
{
for
(
JgChangeRegistrationUnitEq
jgChangeRegistrationUnitEq
:
jgChangeRegistrationUnitEqs
)
{
String
equipId
=
jgChangeRegistrationUnitEq
.
getEquId
();
String
equipId
=
jgChangeRegistrationUnitEq
.
getEquId
();
LambdaQueryWrapper
<
UseInfo
>
queryWrapper2
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
UseInfo
>
queryWrapper2
=
new
LambdaQueryWrapper
<>();
...
@@ -1246,6 +1313,9 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1246,6 +1313,9 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
if
(
ObjectUtils
.
isNotEmpty
(
useInfo
))
{
if
(
ObjectUtils
.
isNotEmpty
(
useInfo
))
{
useInfo
.
setUseUnitName
(
registration
.
getNewUseUnitName
());
useInfo
.
setUseUnitName
(
registration
.
getNewUseUnitName
());
useInfo
.
setUseUnitCreditCode
(
registration
.
getNewUseUnitCreditCode
());
useInfo
.
setUseUnitCreditCode
(
registration
.
getNewUseUnitCreditCode
());
if
(
"1"
.
equals
(
registration
.
getChangeType
()))
{
useInfo
.
setFactoryUseSiteStreet
(
registration
.
getFullAddress
());
}
useInfoMapper
.
updateById
(
useInfo
);
useInfoMapper
.
updateById
(
useInfo
);
}
}
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
registerInfoLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
IdxBizJgRegisterInfo
>
registerInfoLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
...
@@ -1257,6 +1327,15 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1257,6 +1327,15 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
map1
.
put
(
"USE_UNIT_NAME"
,
registration
.
getNewUseUnitName
());
map1
.
put
(
"USE_UNIT_NAME"
,
registration
.
getNewUseUnitName
());
map1
.
put
(
"REC_DATE"
,
new
Date
());
// 更新时间,设备筛选时排在前面 bug-21476
map1
.
put
(
"REC_DATE"
,
new
Date
());
// 更新时间,设备筛选时排在前面 bug-21476
map1
.
put
(
"EQU_STATE"
,
"1"
);
map1
.
put
(
"EQU_STATE"
,
"1"
);
// 如果是变更类型=1,还需要更新证号到 ES
if
(
"1"
.
equals
(
registration
.
getChangeType
())
&&
"5000"
.
equals
(
dto
.
getEquListCode
()))
{
// 新证号生成逻辑
String
newCode
=
commonServiceImpl
.
generateRegistrationCode
(
equipId
,
registration
.
getReceiveCompanyCode
(),
false
);
map1
.
put
(
"USE_ORG_CODE"
,
newCode
);
seqToEquId
.
put
(
registerInfo
.
getUseOrgCode
(),
newCode
);
registerInfo
.
setUseOrgCode
(
newCode
);
registerInfoMapper
.
updateById
(
registerInfo
);
}
if
(
ObjectUtils
.
isNotEmpty
(
registerInfo
)
&&
ObjectUtils
.
isNotEmpty
(
registerInfo
.
getCarNumber
()))
{
if
(
ObjectUtils
.
isNotEmpty
(
registerInfo
)
&&
ObjectUtils
.
isNotEmpty
(
registerInfo
.
getCarNumber
()))
{
map1
.
put
(
"CAR_NUMBER"
,
registerInfo
.
getCarNumber
());
map1
.
put
(
"CAR_NUMBER"
,
registerInfo
.
getCarNumber
());
}
}
...
@@ -1267,23 +1346,66 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1267,23 +1346,66 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
}
registration
.
setNextTaskId
(
nextTaskId
);
registration
.
setNextTaskId
(
nextTaskId
);
updateTaskModel
(
registration
,
op
);
TaskV2Model
taskV2Model
=
updateTaskModel
(
registration
,
op
);
//新增使用登记证和设备变更记录
this
.
saveRecord
(
registration
);
JSONArray
historyJson
=
JSON
.
parseArray
(
history
.
getChangeData
());
JSONArray
historyJson
=
JSON
.
parseArray
(
history
.
getChangeData
());
// 更新历史表中一二级审批车牌号
// 更新历史表中一二级审批车牌号
history
.
setChangeData
(
JSONObject
.
toJSONString
(
dto
.
getRegistrationList
()));
history
.
setChangeData
(
JSONObject
.
toJSONString
(
dto
.
getRegistrationList
()));
registrationHistoryService
.
updateById
(
history
);
registrationHistoryService
.
updateById
(
history
);
List
<
String
>
ids
=
historyJson
.
stream
().
map
(
v
->
JSON
.
parseObject
(
v
.
toString
()).
getString
(
"sequenceNbr"
)).
collect
(
Collectors
.
toList
());
List
<
String
>
ids
=
historyJson
.
stream
().
map
(
v
->
JSON
.
parseObject
(
v
.
toString
()).
getString
(
"sequenceNbr"
)).
collect
(
Collectors
.
toList
());
List
<
JgUseRegistrationManage
>
list
=
useRegistrationManageService
.
lambdaQuery
().
in
(
BaseEntity:
:
getSequenceNbr
,
ids
).
list
();
List
<
JgUseRegistrationManage
>
list
=
useRegistrationManageService
.
lambdaQuery
().
in
(
BaseEntity:
:
getSequenceNbr
,
ids
).
list
();
// 用来存放新生成的登记证
List
<
JgUseRegistrationManage
>
newList
=
new
ArrayList
<>();
for
(
JgUseRegistrationManage
registrationManage
:
list
)
{
for
(
JgUseRegistrationManage
registrationManage
:
list
)
{
//
修改使用登记证管理使用单位地址、使用单位代码、接收机构、接收机构公司代码、办理日期、使用单位地址
//
修改使用登记证管理使用单位信息
registrationManage
.
setUseUnitName
(
registration
.
getNewUseUnitName
());
registrationManage
.
setUseUnitName
(
registration
.
getNewUseUnitName
());
registrationManage
.
setUseUnitCreditCode
(
registration
.
getNewUseUnitCreditCode
());
registrationManage
.
setUseUnitCreditCode
(
registration
.
getNewUseUnitCreditCode
());
registrationManage
.
setReceiveOrgName
(
registration
.
getReceiveOrgName
());
registrationManage
.
setReceiveOrgName
(
registration
.
getReceiveOrgName
());
registrationManage
.
setReceiveCompanyCode
(
registration
.
getReceiveOrgCode
());
registrationManage
.
setReceiveCompanyCode
(
registration
.
getReceiveOrgCode
());
registrationManage
.
setAuditPassDate
(
registration
.
getAuditPassDate
());
registrationManage
.
setAuditPassDate
(
registration
.
getAuditPassDate
());
registrationManage
.
setVersion
(
registrationManage
.
getVersion
()
+
1
);
registrationManage
.
setVersion
(
registrationManage
.
getVersion
()
+
1
);
if
(
"1"
.
equals
(
registration
.
getChangeType
())
&&
"5000"
.
equals
(
dto
.
getEquListCode
()))
{
// -------------------- 旧证处理 --------------------
registrationManage
.
setCertificateStatus
(
"已注销"
);
registrationManage
.
setChangeReason
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getName
());
// -------------------- 新证处理 --------------------
JgUseRegistrationManage
newManage
=
new
JgUseRegistrationManage
();
BeanUtils
.
copyProperties
(
registrationManage
,
newManage
);
String
newCode
=
seqToEquId
.
get
(
registrationManage
.
getUseRegistrationCode
());
newManage
.
setUseRegistrationCode
(
newCode
);
registration
.
setUseRegistCode
(
newCode
);
// 新证属性重置
newManage
.
setCertificateStatus
(
"已登记"
);
newManage
.
setVersion
(
1
);
// 如果 equListCode = 5000,则设置车牌号
if
(
"5000"
.
equals
(
registrationManage
.
getEquListCode
()))
{
String
targetCode
=
registrationManage
.
getUseRegistrationCode
();
dto
.
getRegistrationList
().
stream
()
.
filter
(
item
->
targetCode
.
equals
(
item
.
get
(
"useRegistrationCode"
)))
.
map
(
item
->
String
.
valueOf
(
item
.
get
(
"newCarNumber"
)))
.
filter
(
carNumber
->
carNumber
!=
null
&&
!
"null"
.
equalsIgnoreCase
(
carNumber
.
trim
()))
.
findFirst
()
.
ifPresent
(
newManage:
:
setCarNumber
);
}
newManage
.
setChangeReason
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getName
());
// 回填新单位地址
if
(!
ObjectUtils
.
isEmpty
(
registration
.
getNewUseUnitCreditCode
()))
{
TzBaseEnterpriseInfo
useCodeResult
=
tzBaseEnterpriseInfoMapper
.
selectOne
(
new
QueryWrapper
<
TzBaseEnterpriseInfo
>()
.
eq
(
"use_unit_code"
,
registration
.
getNewUseUnitCreditCode
())
);
if
(
useCodeResult
!=
null
)
{
newManage
.
setUseUnitAddress
(
useCodeResult
.
getAddress
());
}
}
newManage
.
setSequenceNbr
(
null
);
newList
.
add
(
newManage
);
}
else
{
registrationManage
.
setCertificateStatus
(
"已登记"
);
registrationManage
.
setCertificateStatus
(
"已登记"
);
if
(
"5000"
.
equals
(
registrationManage
.
getEquListCode
()))
{
if
(
"5000"
.
equals
(
registrationManage
.
getEquListCode
()))
{
String
targetCode
=
registrationManage
.
getUseRegistrationCode
();
String
targetCode
=
registrationManage
.
getUseRegistrationCode
();
...
@@ -1295,15 +1417,26 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1295,15 +1417,26 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
.
ifPresent
(
registrationManage:
:
setCarNumber
);
.
ifPresent
(
registrationManage:
:
setCarNumber
);
}
}
registrationManage
.
setChangeReason
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getName
());
registrationManage
.
setChangeReason
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getName
());
if
(!
ObjectUtils
.
isEmpty
(
registration
.
getNewUseUnitCreditCode
()))
{
//回填新单位地址
if
(!
ObjectUtils
.
isEmpty
(
registration
.
getNewUseUnitCreditCode
()))
{
TzBaseEnterpriseInfo
useCodeResult
=
tzBaseEnterpriseInfoMapper
.
selectOne
(
new
QueryWrapper
<
TzBaseEnterpriseInfo
>().
eq
(
"use_unit_code"
,
registration
.
getNewUseUnitCreditCode
()));
TzBaseEnterpriseInfo
useCodeResult
=
tzBaseEnterpriseInfoMapper
.
selectOne
(
new
QueryWrapper
<
TzBaseEnterpriseInfo
>()
.
eq
(
"use_unit_code"
,
registration
.
getNewUseUnitCreditCode
())
);
if
(
useCodeResult
!=
null
)
{
if
(
useCodeResult
!=
null
)
{
registrationManage
.
setUseUnitAddress
(
useCodeResult
.
getAddress
());
registrationManage
.
setUseUnitAddress
(
useCodeResult
.
getAddress
());
}
}
}
}
}
}
useRegistrationManageService
.
updateBatchById
(
list
);
}
}
if
(
CollUtil
.
isNotEmpty
(
newList
))
{
list
.
addAll
(
newList
);
}
useRegistrationManageService
.
saveOrUpdateBatch
(
list
);
this
.
createResume
(
registration
,
jgChangeRegistrationUnitEqs
,
taskV2Model
.
getRoutePath
());
}
//新增使用登记证和设备变更记录
this
.
saveRecord
(
registration
);
// 发送数据变更消息
// 发送数据变更消息
this
.
sendDataRefreshMsg
(
registration
);
this
.
sendDataRefreshMsg
(
registration
);
}
else
{
}
else
{
...
@@ -1318,7 +1451,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1318,7 +1451,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
registration
.
setNextTaskId
(
nextTaskId
);
registration
.
setNextTaskId
(
nextTaskId
);
registration
.
setStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskCode
).
getPass
());
registration
.
setStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskCode
).
getPass
());
executeOneStep
(
registration
,
taskName1
,
nextUserIds
,
op
);
executeOneStep
(
registration
,
taskName1
,
nextUserIds
,
op
);
if
(
"5000"
.
equals
(
dto
.
getEquListCode
())){
if
(
"5000"
.
equals
(
dto
.
getEquListCode
()))
{
history
.
setChangeData
(
JSONObject
.
toJSONString
(
dto
.
getRegistrationList
()));
history
.
setChangeData
(
JSONObject
.
toJSONString
(
dto
.
getRegistrationList
()));
registrationHistoryService
.
updateById
(
history
);
registrationHistoryService
.
updateById
(
history
);
}
}
...
@@ -1345,6 +1478,20 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1345,6 +1478,20 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
}
}
}
private
void
createResume
(
JgChangeRegistrationUnit
registration
,
List
<
JgChangeRegistrationUnitEq
>
jgChangeRegistrationUnitEqs
,
String
routePath
)
{
jgResumeInfoService
.
saveBatchResume
(
jgChangeRegistrationUnitEqs
.
stream
().
map
(
eq
->
JgResumeInfoDto
.
builder
().
applyNo
(
registration
.
getApplyNo
())
.
businessType
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getName
())
.
businessId
(
String
.
valueOf
(
registration
.
getSequenceNbr
()))
.
equId
(
eq
.
getEquId
())
.
approvalUnit
(
registration
.
getReceiveOrgName
())
.
approvalUnitCode
(
registration
.
getReceiveCompanyCode
())
.
status
(
"正常"
)
.
changeContent
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getName
()
+
"业务办理"
)
.
routePath
(
routePath
)
.
build
()).
collect
(
Collectors
.
toList
())
);
}
private
void
sendDataRefreshMsg
(
JgChangeRegistrationUnit
registration
)
{
private
void
sendDataRefreshMsg
(
JgChangeRegistrationUnit
registration
)
{
LambdaQueryWrapper
<
JgChangeRegistrationUnitEq
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
JgChangeRegistrationUnitEq
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
JgChangeRegistrationUnitEq:
:
getUnitChangeRegistrationId
,
registration
.
getSequenceNbr
());
queryWrapper
.
eq
(
JgChangeRegistrationUnitEq:
:
getUnitChangeRegistrationId
,
registration
.
getSequenceNbr
());
...
@@ -1366,10 +1513,12 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1366,10 +1513,12 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
throw
new
BadRequest
(
"工程/装置列表为空"
);
throw
new
BadRequest
(
"工程/装置列表为空"
);
}
}
registration
.
setNextTaskId
(
nextTaskId
);
registration
.
setNextTaskId
(
nextTaskId
);
updateTaskModel
(
registration
,
op
);
TaskV2Model
taskV2Model
=
updateTaskModel
(
registration
,
op
);
List
<
String
>
projectContraptionIds
=
new
ArrayList
<>();
for
(
Map
<
String
,
Object
>
map
:
projectContraptionList
)
{
for
(
Map
<
String
,
Object
>
map
:
projectContraptionList
)
{
String
useRegistrationCode
=
(
String
)
map
.
get
(
"useRegistrationCode"
);
String
useRegistrationCode
=
(
String
)
map
.
get
(
"useRegistrationCode"
);
String
sequenceNbr
=
(
String
)
map
.
get
(
"sequenceNbr"
);
String
sequenceNbr
=
(
String
)
map
.
get
(
"sequenceNbr"
);
projectContraptionIds
.
add
(
sequenceNbr
);
String
estateUnitSeq
=
String
.
valueOf
(
map
.
get
(
"estateUnitName"
));
String
estateUnitSeq
=
String
.
valueOf
(
map
.
get
(
"estateUnitName"
));
TzBaseEnterpriseInfo
enterpriseInfo
=
(
estateUnitSeq
!=
null
&&
!
estateUnitSeq
.
isEmpty
())
TzBaseEnterpriseInfo
enterpriseInfo
=
(
estateUnitSeq
!=
null
&&
!
estateUnitSeq
.
isEmpty
())
?
tzBaseEnterpriseInfoMapper
.
selectById
(
estateUnitSeq
)
?
tzBaseEnterpriseInfoMapper
.
selectById
(
estateUnitSeq
)
...
@@ -1383,7 +1532,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1383,7 +1532,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
throw
new
BadRequest
(
"使用登记证编号:"
+
useRegistrationCode
+
"对应的工程/装置列表不存在"
);
throw
new
BadRequest
(
"使用登记证编号:"
+
useRegistrationCode
+
"对应的工程/装置列表不存在"
);
}
}
//更新产权信息
//更新产权信息
if
(
enterpriseInfo
!=
null
){
if
(
enterpriseInfo
!=
null
)
{
idxBizJgUseInfoService
.
update
(
idxBizJgUseInfoService
.
update
(
new
IdxBizJgUseInfo
().
setEstateUnitCreditCode
(
enterpriseInfo
.
getUseUnitCode
())
new
IdxBizJgUseInfo
().
setEstateUnitCreditCode
(
enterpriseInfo
.
getUseUnitCode
())
.
setEstateUnitName
(
enterpriseInfo
.
getUseUnit
()),
.
setEstateUnitName
(
enterpriseInfo
.
getUseUnit
()),
...
@@ -1482,7 +1631,22 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -1482,7 +1631,22 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
this
.
updateRelationTable
(
idxBizJgProjectContraption
.
getSequenceNbr
(),
registration
,
Boolean
.
TRUE
,
code
);
this
.
updateRelationTable
(
idxBizJgProjectContraption
.
getSequenceNbr
(),
registration
,
Boolean
.
TRUE
,
code
);
}
}
}
}
// 创建设备履历
this
.
createResume
(
projectContraptionIds
,
registration
,
taskV2Model
.
getRoutePath
());
}
private
void
createResume
(
List
<
String
>
projectContraptionIds
,
JgChangeRegistrationUnit
registration
,
String
routePath
)
{
jgResumeInfoService
.
saveBatchResume
(
projectContraptionIds
.
stream
().
map
(
projectContraptionId
->
JgResumeInfoDto
.
builder
().
applyNo
(
registration
.
getApplyNo
())
.
businessType
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getName
())
.
businessId
(
String
.
valueOf
(
registration
.
getSequenceNbr
()))
.
equId
(
projectContraptionId
)
.
approvalUnit
(
registration
.
getReceiveOrgName
())
.
approvalUnitCode
(
registration
.
getReceiveCompanyCode
())
.
status
(
"正常"
)
.
changeContent
(
BusinessTypeEnum
.
JG_COMPANY_CHANGE_REGISTRATION
.
getName
()
+
"业务办理"
)
.
routePath
(
routePath
)
.
build
()).
collect
(
Collectors
.
toList
())
);
}
}
/**
/**
...
...
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/JgEnableDisableServiceImpl.java
View file @
56c916fd
...
@@ -126,6 +126,10 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
...
@@ -126,6 +126,10 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
*/
*/
public
static
final
String
APPLY_TYPE_TY
=
"SB_TY"
;
public
static
final
String
APPLY_TYPE_TY
=
"SB_TY"
;
@Autowired
JgResumeInfoServiceImpl
jgResumeInfoService
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
JgEnableDisable
>
saveOrUpdate
(
JSONObject
map
,
ReginParams
reginParams
)
{
public
List
<
JgEnableDisable
>
saveOrUpdate
(
JSONObject
map
,
ReginParams
reginParams
)
{
try
{
try
{
...
@@ -577,9 +581,11 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
...
@@ -577,9 +581,11 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
taskMap
.
put
(
"model"
,
jgEnableDisable
);
taskMap
.
put
(
"model"
,
jgEnableDisable
);
// 更新业务数据
// 更新业务数据
updateInfoOther
(
jgEnableDisable
);
updateInfoOther
(
jgEnableDisable
);
commonService
.
updateTaskModel
(
taskMap
);
TaskV2Model
taskV2Model1
=
commonService
.
updateTaskModel
(
taskMap
);
// 完成后发送数据刷新消息
// 完成后发送数据刷新消息
this
.
sendDataRefreshMsg
(
jgEnableDisable
);
this
.
sendDataRefreshMsg
(
jgEnableDisable
);
// 创建设备履历
this
.
createResume
(
jgEnableDisable
,
taskV2Model1
.
getRoutePath
());
}
else
{
}
else
{
jgEnableDisable
.
setNextExecutorIds
(
workflowResultDto
.
getNextExecutorRoleIds
());
jgEnableDisable
.
setNextExecutorIds
(
workflowResultDto
.
getNextExecutorRoleIds
());
if
(!
ObjectUtils
.
isEmpty
(
jgEnableDisable
.
getExecuteSequence
()))
{
if
(!
ObjectUtils
.
isEmpty
(
jgEnableDisable
.
getExecuteSequence
()))
{
...
@@ -654,6 +660,23 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
...
@@ -654,6 +660,23 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
}
}
}
}
private
void
createResume
(
JgEnableDisable
jgEnableDisable
,
String
routePath
)
{
LambdaQueryWrapper
<
JgEnableDisableEq
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
JgEnableDisableEq:
:
getEnableDisableApplyId
,
jgEnableDisable
.
getSequenceNbr
());
List
<
JgEnableDisableEq
>
enableDisableEqs
=
jgEnableDisableEqService
.
list
(
queryWrapper
);
jgResumeInfoService
.
saveBatchResume
(
enableDisableEqs
.
stream
().
map
(
eq
->
JgResumeInfoDto
.
builder
().
applyNo
(
jgEnableDisable
.
getApplyNo
())
.
businessType
(
getRegistrationClass
(
jgEnableDisable
))
.
businessId
(
String
.
valueOf
(
jgEnableDisable
.
getSequenceNbr
()))
.
equId
(
eq
.
getEquId
())
.
approvalUnit
(
jgEnableDisable
.
getReceiveOrgName
())
.
approvalUnitCode
(
jgEnableDisable
.
getReceiveCompanyCode
())
.
status
(
"正常"
)
.
changeContent
(
getRegistrationClass
(
jgEnableDisable
)
+
"业务办理"
)
.
routePath
(
routePath
)
.
build
()).
collect
(
Collectors
.
toList
())
);
}
private
void
sendDataRefreshMsg
(
JgEnableDisable
jgEnableDisable
)
{
private
void
sendDataRefreshMsg
(
JgEnableDisable
jgEnableDisable
)
{
LambdaQueryWrapper
<
JgEnableDisableEq
>
lambdaEq
=
new
QueryWrapper
<
JgEnableDisableEq
>().
lambda
();
LambdaQueryWrapper
<
JgEnableDisableEq
>
lambdaEq
=
new
QueryWrapper
<
JgEnableDisableEq
>().
lambda
();
lambdaEq
.
eq
(
JgEnableDisableEq:
:
getEnableDisableApplyId
,
jgEnableDisable
.
getSequenceNbr
());
lambdaEq
.
eq
(
JgEnableDisableEq:
:
getEnableDisableApplyId
,
jgEnableDisable
.
getSequenceNbr
());
...
...
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/JgScrapCancelServiceImpl.java
View file @
56c916fd
...
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
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.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
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.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
...
@@ -84,7 +85,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
...
@@ -84,7 +85,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
TzsServiceFeignClient
tzsServiceFeignClient
;
TzsServiceFeignClient
tzsServiceFeignClient
;
@Autowired
@Autowired
SuperviseInfoMapper
superviseInfoMapper
;
JgResumeInfoServiceImpl
jgResumeInfoService
;
@Autowired
@Autowired
CommonServiceImpl
commonService
;
CommonServiceImpl
commonService
;
@Autowired
@Autowired
...
@@ -969,9 +970,30 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
...
@@ -969,9 +970,30 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
updateInfoOther
(
jgScrapCancel
,
taskV2Model
.
getRoutePath
());
updateInfoOther
(
jgScrapCancel
,
taskV2Model
.
getRoutePath
());
// 发送数据变更消息
// 发送数据变更消息
this
.
sendDataRefreshMsg
(
jgScrapCancel
);
this
.
sendDataRefreshMsg
(
jgScrapCancel
);
// 创建设备履历
this
.
createResume
(
jgScrapCancel
,
taskV2Model
.
getRoutePath
());
}
}
this
.
getBaseMapper
().
updateById
(
jgScrapCancel
);
this
.
getBaseMapper
().
updateById
(
jgScrapCancel
);
}
}
private
void
createResume
(
JgScrapCancel
jgScrapCancel
,
String
routePath
)
{
LambdaQueryWrapper
<
JgScrapCancelEq
>
lambdaEq
=
new
QueryWrapper
<
JgScrapCancelEq
>().
lambda
();
lambdaEq
.
eq
(
JgScrapCancelEq:
:
getEquipTransferId
,
jgScrapCancel
.
getSequenceNbr
());
lambdaEq
.
select
(
JgScrapCancelEq:
:
getEquId
,
BaseEntity:
:
getSequenceNbr
);
List
<
JgScrapCancelEq
>
scrapCancelEqs
=
jgScrapCancelEqService
.
list
(
lambdaEq
);
jgResumeInfoService
.
saveBatchResume
(
scrapCancelEqs
.
stream
().
map
(
eq
->
JgResumeInfoDto
.
builder
().
applyNo
(
jgScrapCancel
.
getApplyNo
())
.
businessType
(
getRegistrationClass
(
jgScrapCancel
.
getCancelType
()))
.
businessId
(
String
.
valueOf
(
jgScrapCancel
.
getSequenceNbr
()))
.
equId
(
eq
.
getEquId
())
.
approvalUnit
(
jgScrapCancel
.
getReceiveOrgName
())
.
approvalUnitCode
(
jgScrapCancel
.
getReceiveCompanyCode
())
.
status
(
"正常"
)
.
changeContent
(
getRegistrationClass
(
jgScrapCancel
.
getCancelType
())
+
"业务办理"
)
.
routePath
(
routePath
)
.
build
()).
collect
(
Collectors
.
toList
())
);
}
private
void
sendDataRefreshMsg
(
JgScrapCancel
jgScrapCancel
)
{
private
void
sendDataRefreshMsg
(
JgScrapCancel
jgScrapCancel
)
{
LambdaQueryWrapper
<
JgScrapCancelEq
>
lambdaEq
=
new
QueryWrapper
<
JgScrapCancelEq
>().
lambda
();
LambdaQueryWrapper
<
JgScrapCancelEq
>
lambdaEq
=
new
QueryWrapper
<
JgScrapCancelEq
>().
lambda
();
lambdaEq
.
eq
(
JgScrapCancelEq:
:
getEquipTransferId
,
jgScrapCancel
.
getSequenceNbr
());
lambdaEq
.
eq
(
JgScrapCancelEq:
:
getEquipTransferId
,
jgScrapCancel
.
getSequenceNbr
());
...
...
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 @
56c916fd
...
@@ -123,6 +123,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -123,6 +123,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
private
final
String
DOWNLOAD_TOPIC
=
"/topic/download/excel/%s"
;
private
final
String
DOWNLOAD_TOPIC
=
"/topic/download/excel/%s"
;
private
final
String
BUCKET_NAME
=
"upload"
;
private
final
String
BUCKET_NAME
=
"upload"
;
private
final
String
UPLOAD_PATH
=
"/tzs/excelTempFile"
;
private
final
String
UPLOAD_PATH
=
"/tzs/excelTempFile"
;
private
final
List
<
String
>
equList
=
Arrays
.
asList
(
"1000"
,
"2000"
,
"3000"
,
"4000"
,
"5000"
,
"6000"
,
"8000"
,
"9000"
);
// 大屏统计图片路径前缀
// 大屏统计图片路径前缀
private
final
String
dpEquipPhotoPrefix
=
"/upload/tzs/dpscreen/statistic/equip/"
;
private
final
String
dpEquipPhotoPrefix
=
"/upload/tzs/dpscreen/statistic/equip/"
;
// 大屏统计图片路径后缀
// 大屏统计图片路径后缀
...
@@ -955,27 +956,25 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -955,27 +956,25 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
Map
<
String
,
Object
>
sum
=
new
HashMap
<>();
sum
.
put
(
"name"
,
"设备总数(台套)"
);
sum
.
put
(
"value"
,
totle
);
statics
.
add
(
sum
);
BoolQueryBuilder
pipeQuery
=
QueryBuilderUtils
.
copyBoolQuery
(
boolMust
);
List
<
Map
<
String
,
Object
>>
equipStatusMap
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
equipStatusMap
=
new
ArrayList
<>();
getEquipStatusStatic
(
boolMust
,
builder
,
equipStatusMap
);
getEquipStatusStatic
(
boolMust
,
builder
,
equipStatusMap
);
result
.
put
(
"keyIndicator"
,
equipStatusMap
);
result
.
put
(
"keyIndicator"
,
equipStatusMap
);
if
(
ObjectUtils
.
isEmpty
(
filterParams
)
||
!
filterParams
.
containsKey
(
"EQU_LIST"
))
{
String
equList
=
ObjectUtils
.
isEmpty
(
filterParams
)
||
""
.
equals
(
filterParams
.
get
(
"equList"
).
toString
())
?
"all"
:
filterParams
.
get
(
"equList"
).
toString
();
filterParams
=
new
JSONObject
();
String
equCategory
=
ObjectUtils
.
isEmpty
(
filterParams
)
||
""
.
equals
(
filterParams
.
get
(
"equCategory"
).
toString
())
?
"all"
:
filterParams
.
get
(
"equCategory"
).
toString
();
JSONArray
jsonArray
=
new
JSONArray
();
jsonArray
.
add
(
"all"
);
if
(!
equList
.
equals
(
"8000"
)
&&
!
equCategory
.
equals
(
"2300"
))
{
filterParams
.
put
(
"EQU_LIST"
,
jsonArray
);
BoolQueryBuilder
queryBuilder
=
QueryBuilderUtils
.
copyBoolQuery
(
boolMust
);
queryBuilder
.
mustNot
(
QueryBuilders
.
termQuery
(
"EQU_LIST_CODE"
,
"8000"
))
.
mustNot
(
QueryBuilders
.
termQuery
(
"EQU_CATEGORY_CODE"
,
"2300"
));
Long
count
=
getStatisticCount
(
queryBuilder
,
StatisticalAnalysisEnum
.
equip
.
getKey
());
Map
<
String
,
Object
>
sum
=
new
HashMap
<>();
sum
.
put
(
"name"
,
"设备总数(台套)"
);
sum
.
put
(
"value"
,
count
);
statics
.
add
(
sum
);
}
}
JSONArray
equList
=
(
JSONArray
)
filterParams
.
get
(
"EQU_LIST"
);
if
(
equList
.
contains
(
"8000"
)
||
equList
.
contains
(
"all"
))
{
if
(
ObjectUtils
.
isEmpty
(
equList
)
||
equList
.
contains
(
"8000"
)
||
equList
.
contains
(
"all"
))
{
// 获取压力管道长度
// 获取压力管道长度
BigDecimal
pipeLength
=
getPipeLength
(
boolMust
,
builder
,
"pipeLength"
);
BigDecimal
pipeLength
=
getPipeLength
(
boolMust
,
builder
,
"pipeLength"
);
Map
<
String
,
Object
>
pipeMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
pipeMap
=
new
HashMap
<>();
...
@@ -984,7 +983,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -984,7 +983,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
statics
.
add
(
pipeMap
);
statics
.
add
(
pipeMap
);
}
}
if
(
ObjectUtils
.
isEmpty
(
equList
)
||
equList
.
contains
(
"2000"
)
||
equList
.
contains
(
"all"
))
{
if
(
equList
.
contains
(
"all"
)
||
(
equList
.
contains
(
"2000"
)
&&
"all"
.
equals
(
equCategory
))
||
equCategory
.
contains
(
"2300"
))
{
// 气瓶数量
// 气瓶数量
CountRequest
countRequest
=
new
CountRequest
();
CountRequest
countRequest
=
new
CountRequest
();
countRequest
.
indices
(
StatisticalAnalysisEnum
.
equip
.
getKey
());
countRequest
.
indices
(
StatisticalAnalysisEnum
.
equip
.
getKey
());
...
@@ -996,7 +996,6 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -996,7 +996,6 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
Map
<
String
,
Object
>
gasMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
gasMap
=
new
HashMap
<>();
gasMap
.
put
(
"name"
,
"气瓶(个)"
);
gasMap
.
put
(
"name"
,
"气瓶(个)"
);
gasMap
.
put
(
"value"
,
ObjectUtils
.
isEmpty
(
response
)
?
0
:
response
.
getCount
());
gasMap
.
put
(
"value"
,
ObjectUtils
.
isEmpty
(
response
)
?
0
:
response
.
getCount
());
...
@@ -1030,6 +1029,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -1030,6 +1029,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
}
private
void
getEquipmentBoolQueryBuilder
(
BoolQueryBuilder
boolMust
,
JSONObject
filterParams
,
String
filterType
)
{
private
void
getEquipmentBoolQueryBuilder
(
BoolQueryBuilder
boolMust
,
JSONObject
filterParams
,
String
filterType
)
{
HashSet
<
String
>
equListCodes
=
new
HashSet
<>();
HashSet
<
String
>
equCategoryCodes
=
new
HashSet
<>();
//快捷筛选和自定义筛选解析筛选规则不一致
//快捷筛选和自定义筛选解析筛选规则不一致
if
(
filterType
.
equals
(
"advanced"
))
{
if
(
filterType
.
equals
(
"advanced"
))
{
JSONObject
finalFilterParams
=
filterParams
;
JSONObject
finalFilterParams
=
filterParams
;
...
@@ -1098,10 +1099,13 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -1098,10 +1099,13 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
boolMust
.
filter
(
QueryBuilders
.
rangeQuery
(
field
).
gte
(
startDate
).
lte
(
endDate
));
boolMust
.
filter
(
QueryBuilders
.
rangeQuery
(
field
).
gte
(
startDate
).
lte
(
endDate
));
}
}
}
else
if
(
k
.
equals
(
"EQU_LIST"
)
||
k
.
equals
(
"EQU_CATEGORY"
)
||
k
.
equals
(
"EQU_DEFINE"
)
||
k
.
equals
(
"DATA_QUALITY_SCORE"
))
{
}
else
if
(
k
.
equals
(
"EQU_LIST"
)
||
k
.
equals
(
"EQU_CATEGORY"
)
||
k
.
equals
(
"EQU_DEFINE"
)
||
k
.
equals
(
"DATA_QUALITY_SCORE"
))
{
JSONArray
jsonArray
=
(
JSONArray
)
v
;
if
(
k
.
equals
(
"EQU_LIST"
))
{
if
(
k
.
equals
(
"EQU_LIST"
))
{
field
=
"EQU_LIST_CODE"
;
field
=
"EQU_LIST_CODE"
;
equListCodes
.
addAll
((
jsonArray
).
toJavaList
(
String
.
class
));
}
else
if
(
k
.
equals
(
"EQU_CATEGORY"
))
{
}
else
if
(
k
.
equals
(
"EQU_CATEGORY"
))
{
field
=
"EQU_CATEGORY_CODE"
;
field
=
"EQU_CATEGORY_CODE"
;
equCategoryCodes
.
addAll
((
jsonArray
).
toJavaList
(
String
.
class
));
}
else
if
(
k
.
equals
(
"EQU_DEFINE"
))
{
}
else
if
(
k
.
equals
(
"EQU_DEFINE"
))
{
field
=
"EQU_DEFINE_CODE"
;
field
=
"EQU_DEFINE_CODE"
;
}
}
...
@@ -1180,27 +1184,13 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -1180,27 +1184,13 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
else
{
}
else
{
JSONArray
leftGroup
=
filterParams
.
getJSONArray
(
"group1"
);
JSONArray
leftGroup
=
filterParams
.
getJSONArray
(
"group1"
);
JSONArray
rightGroup
=
filterParams
.
getJSONArray
(
"group2"
);
JSONArray
rightGroup
=
filterParams
.
getJSONArray
(
"group2"
);
JSONArray
equListCodes
=
new
JSONArray
();
leftGroup
.
forEach
(
item
->
{
JSONObject
left
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
item
));
String
leftField
=
left
.
getString
(
"field"
);
String
leftValue
=
left
.
getString
(
"value"
);
if
(!
ObjectUtils
.
isEmpty
(
leftField
)
&&
leftField
.
equals
(
"EQU_LIST_CODE"
)
&&
!
ObjectUtils
.
isEmpty
(
leftValue
))
{
equListCodes
.
add
(
leftValue
);
}
});
rightGroup
.
forEach
(
item
->
{
JSONObject
left
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
item
));
String
rightField
=
left
.
getString
(
"field"
);
String
rightValue
=
left
.
getString
(
"value"
);
if
(!
ObjectUtils
.
isEmpty
(
rightField
)
&&
rightField
.
equals
(
"EQU_LIST_CODE"
)
&&
!
ObjectUtils
.
isEmpty
(
rightValue
))
{
equListCodes
.
add
(
rightValue
);
}
});
filterParams
.
put
(
"EQU_LIST"
,
equListCodes
);
Boolean
isOrGroup
=
or
.
equals
(
filterParams
.
getString
(
"groupAndOr"
))
?
Boolean
.
TRUE
:
Boolean
.
FALSE
;
Boolean
isOrGroup
=
or
.
equals
(
filterParams
.
getString
(
"groupAndOr"
))
?
Boolean
.
TRUE
:
Boolean
.
FALSE
;
handleAdvancedFilter
(
boolMust
,
leftGroup
,
rightGroup
,
isOrGroup
,
StatisticalAnalysisEnum
.
equip
.
getCode
());
handleAdvancedFilter
(
boolMust
,
leftGroup
,
rightGroup
,
isOrGroup
,
StatisticalAnalysisEnum
.
equip
.
getCode
());
equListCodes
.
add
(
"8000"
);
equCategoryCodes
.
add
(
"2300"
);
}
}
filterParams
.
put
(
"equList"
,
String
.
join
(
","
,
equListCodes
));
filterParams
.
put
(
"equCategory"
,
String
.
join
(
","
,
equCategoryCodes
));
}
}
private
void
getEquipStatusStatic
(
BoolQueryBuilder
boolMust
,
SearchSourceBuilder
builder
,
List
<
Map
<
String
,
Object
>>
statics
)
{
private
void
getEquipStatusStatic
(
BoolQueryBuilder
boolMust
,
SearchSourceBuilder
builder
,
List
<
Map
<
String
,
Object
>>
statics
)
{
...
@@ -3133,10 +3123,10 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
...
@@ -3133,10 +3123,10 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
equipBoolMust
.
must
(
QueryBuilders
.
termsQuery
(
"EQU_LIST_CODE"
,
Arrays
.
asList
(
"1000"
,
"2000"
,
"3000"
,
"4000"
,
"5000"
,
"6000"
,
"9000"
)));
equipBoolMust
.
must
(
QueryBuilders
.
termsQuery
(
"EQU_LIST_CODE"
,
Arrays
.
asList
(
"1000"
,
"2000"
,
"3000"
,
"4000"
,
"5000"
,
"6000"
,
"9000"
)));
BoolQueryBuilder
companyUnitTypeBoolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
companyUnitTypeBoolMust
=
QueryBuilders
.
boolQuery
();
companyBoolMust
(
companyUnitTypeBoolMust
,
"company"
);
companyBoolMust
(
companyUnitTypeBoolMust
,
"company"
);
BoolQueryBuilder
inspectionUnitTypeBoolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
inspectionUnitTypeBoolMust
=
QueryBuilders
.
boolQuery
();
companyBoolMust
(
inspectionUnitTypeBoolMust
,
"inspection"
);
companyBoolMust
(
inspectionUnitTypeBoolMust
,
"inspection"
);
BoolQueryBuilder
companyBoolMust
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
companyBoolMust
=
QueryBuilders
.
boolQuery
();
companyBoolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode.keyword"
,
orgCode
));
companyBoolMust
.
must
(
QueryBuilders
.
prefixQuery
(
"superviseOrgCode.keyword"
,
orgCode
));
...
...
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